Initial commit
This commit is contained in:
24
internal/holy/cronTask.go
Normal file
24
internal/holy/cronTask.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package holy
|
||||
|
||||
import (
|
||||
"tg-holy-bot/internal/log"
|
||||
)
|
||||
|
||||
// CronTask sends generated hiliday list to the channel.
|
||||
func CronTask() {
|
||||
log.Info("Cron Task triggered")
|
||||
|
||||
phrase, err := APIClient()
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Unable to get holidays: %s", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if _, err = Bot.SendMessage(phrase, Config.ChannelID, nil); err != nil {
|
||||
log.Errorf("Unable to send message to channel: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||
Reference in New Issue
Block a user