Documentation
¶
Index ¶
Constants ¶
View Source
const ( StateNotSubscribed = "not_subscribed" StateSubscribed = "subscribed" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot interface { // Start starts Bot Start() error // Close shuts down Bot Close() }
Bot wraps Bot logic
type DB ¶
type DB interface { // GetOrCreate fetches a chat state from DB // If chat is not registered yet, it will be created GetOrCreate(chatID int64, userID int, username string) (*chatEntity, error) // Update stores chat state into DB Update(chat *chatEntity) error // GetSubscribedStationIDs returns map of stations with subscription // Map key is station ID and value is count of active subscriptions GetSubscribedStationIDs() (map[int]int, error) // GetSubscribedChats returns map of chats subscribed to specified station GetSubscribedChats(stationID int) ([]*chatEntity, error) // Close shuts down DB Close() }
type Option ¶
type Option func(*options)
Option is a configuration option for NewBot function
func AllowedUsernamesOption ¶
AllowedUsernamesOption sets list of allowed usernames
func WAQIServiceOption ¶
WAQIServiceOption sets WAQI service instance
Click to show internal directories.
Click to hide internal directories.