notifier

package
v1.6.1-0...-e0dc824 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Location = "Europe/Kiev"

Functions

func AddNotificationTime

func AddNotificationTime(time2 time.Time, notificationTime string) time.Time

AddNotificationTime returns adds notification time to given time

func GetSubscribedChats

func GetSubscribedChats(time string, chatRepo data.ChatRepository) ([]*data.Chat, error)

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

func Setup

func Setup(api api2.Api, bot *gotgbot.Bot, langs map[string]i18n.Language, chatRepo data.ChatRepository) (*gocron.Scheduler, error)

Setup initializes notifier and starts cron Scheduler

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL