Skip to content

oddsteam/bot-holiday

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

botholiday

botholiday is a Go package designed to help check the holidays of the Bank of Thailand.

Install

go get github.com/oddsteam/bot-holiday

Usage

You can register and obtain a ClientID from Here.

import (
    "github.com/oddsteam/bot-holiday/pkg/botholiday"
)

botholiday.Initialize("ClientID")

Example

Get all holidays of the Bank of Thailand in this year.

import (
    "github.com/oddsteam/bot-holiday/pkg/botholiday"
)

inst := botholiday.Initialize("Client ID.")
inst.GetBOTHoliday()

Check if today is a holiday of the Bank of Thailand for this year or not.

import (
    "time"
    "github.com/oddsteam/bot-holiday/pkg/botholiday"
)

inst := botholiday.Initialize("Client ID.")
if botholiday.CheckHoliday(inst.GetBOTHoliday(), time.Now()) {
    // Do something if today is a holiday.
}

Maintainer

ODDS

License

MIT