Documentation ¶
Index ¶
- Variables
- func AddNotificationTime(time2 time.Time, notificationTime string) time.Time
- func GetSubscribedChats(time string, chatRepo data.ChatRepository) ([]*data.Chat, error)
- func IsGroupHaveClasses(schedule *api2.TimeTableDate, calls api2.CallSchedule, time2 time.Time) (bool, error)
- func IsGroupHaveNextClassesPart(schedule *api2.TimeTableDate, calls api2.CallSchedule, time2 time.Time) (bool, error)
- func MakeChatUnavailable(chat *data.Chat, chatRepo data.ChatRepository) error
- func SendNotification(chat *data.Chat, chatRepo data.ChatRepository, lang i18n.Language, ...) error
- func SendNotifications(time2 string, chatRepo data.ChatRepository, api api2.Api, bot *gotgbot.Bot, ...) error
- func Setup(api api2.Api, bot *gotgbot.Bot, langs map[string]i18n.Language, ...) (*gocron.Scheduler, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Location = "Europe/Kiev"
Functions ¶
func AddNotificationTime ¶
AddNotificationTime returns adds notification time to given time
func GetSubscribedChats ¶
GetSubscribedChats returns chats that subscribed to notifications for given time
func IsGroupHaveClasses ¶
func IsGroupHaveClasses(schedule *api2.TimeTableDate, calls api2.CallSchedule, time2 time.Time) (bool, error)
IsGroupHaveClasses checks if group have classes at given time that are about to start to know if we need to send notifications
func IsGroupHaveNextClassesPart ¶
func IsGroupHaveNextClassesPart(schedule *api2.TimeTableDate, calls api2.CallSchedule, time2 time.Time) (bool, error)
IsGroupHaveNextClassesPart checks if group have next classes part at given time that are about to start.
func MakeChatUnavailable ¶
func MakeChatUnavailable(chat *data.Chat, chatRepo data.ChatRepository) error
MakeChatUnavailable makes chat unavailable if user blocked bot. It is needed to prevent sending notifications to blocked users.
func SendNotification ¶
func SendNotification(chat *data.Chat, chatRepo data.ChatRepository, lang i18n.Language, bot *gotgbot.Bot, schedule *api2.TimeTableDate, time string, type2 string) error
SendNotification sends notification to chat
func SendNotifications ¶
func SendNotifications(time2 string, chatRepo data.ChatRepository, api api2.Api, bot *gotgbot.Bot, langs map[string]i18n.Language, calls api2.CallSchedule) error
SendNotifications sends notifications to chats that subscribed to notifications
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.