Documentation ¶
Index ¶
- Constants
- Variables
- func GetSuperAdminChatID() int64
- func SetSuperAdminChatID(chatID int64)
- type AdminDB
- type AnnouncementSubscription
- type AnnouncementSubscriptionDB
- type BannedChannelDB
- type BannedRegexDB
- type Channel
- type Chat
- type ChatDB
- type ChatKillswitchDB
- type EventPickCountDB
- type EventPickCountEntry
- type FilterToggleDB
- type Member
- type MemberDB
- type Mute
- type MuteDB
- type NameReplacementDB
- type OncePerDayLimiter
- type RemovedMessageDB
- type ScrutinyDB
- type Sex
- type StickerDB
Constants ¶
View Source
const SuperAdminChatIDNotSet = -1
Variables ¶
View Source
var ( ErrNoBackupDir = errors.New("backup directory is not specified") ErrNoDater = errors.New("date generation function not supplied") )
View Source
var ErrNoMembers = errors.New("member list is empty")
Functions ¶
func GetSuperAdminChatID ¶
func GetSuperAdminChatID() int64
func SetSuperAdminChatID ¶
func SetSuperAdminChatID(chatID int64)
Types ¶
type AdminDB ¶
type AdminDB struct {
// contains filtered or unexported fields
}
func GetAdminDB ¶
func GetAdminDB() *AdminDB
func (*AdminDB) IsSuperAdmin ¶
IsSuperAdmin reports whether nick belongs to the Super Admin. Super-admin is the first admin in the admin database.
type AnnouncementSubscriptionDB ¶
type AnnouncementSubscriptionDB struct {
// contains filtered or unexported fields
}
func GetAnnouncementSubscriptionDB ¶
func GetAnnouncementSubscriptionDB() *AnnouncementSubscriptionDB
func (*AnnouncementSubscriptionDB) GetSubscriberChatIDs ¶
func (db *AnnouncementSubscriptionDB) GetSubscriberChatIDs() []int64
func (*AnnouncementSubscriptionDB) Subscribe ¶
func (db *AnnouncementSubscriptionDB) Subscribe(chatID int64, userName string)
func (*AnnouncementSubscriptionDB) Unsubscribe ¶
func (db *AnnouncementSubscriptionDB) Unsubscribe(chatID int64)
type BannedChannelDB ¶
type BannedChannelDB struct {
// contains filtered or unexported fields
}
func GetBannedChannelDB ¶
func GetBannedChannelDB() *BannedChannelDB
func (*BannedChannelDB) Ban ¶
func (db *BannedChannelDB) Ban(ch Channel)
func (*BannedChannelDB) Clear ¶
func (db *BannedChannelDB) Clear() error
func (*BannedChannelDB) Get ¶
func (db *BannedChannelDB) Get() []Channel
func (*BannedChannelDB) IsBanned ¶
func (db *BannedChannelDB) IsBanned(channelID int64) bool
type BannedRegexDB ¶
type BannedRegexDB struct {
// contains filtered or unexported fields
}
func GetBannedRegexDB ¶
func GetBannedRegexDB() *BannedRegexDB
func (*BannedRegexDB) Ban ¶
func (db *BannedRegexDB) Ban(regex string) error
func (*BannedRegexDB) Get ¶
func (db *BannedRegexDB) Get() []string
func (*BannedRegexDB) Unban ¶
func (db *BannedRegexDB) Unban(regex string) error
type ChatDB ¶
type ChatDB struct {
// contains filtered or unexported fields
}
func GetChatsDB ¶
func GetChatsDB() *ChatDB
type ChatKillswitchDB ¶
type ChatKillswitchDB struct {
// contains filtered or unexported fields
}
func GetChatKillswitchDB ¶
func GetChatKillswitchDB() *ChatKillswitchDB
func (*ChatKillswitchDB) Get ¶
func (db *ChatKillswitchDB) Get(chatOrdinal int) bool
func (*ChatKillswitchDB) Set ¶
func (db *ChatKillswitchDB) Set(chatOrdinal int, toggle bool)
type EventPickCountDB ¶
type EventPickCountDB struct {
// contains filtered or unexported fields
}
EventPickCountDB stores the amount of times each person was randomly selected by the /event command.
func GetEventPickCountDB ¶
func GetEventPickCountDB() *EventPickCountDB
func (*EventPickCountDB) Inc ¶
func (e *EventPickCountDB) Inc(userName string)
func (EventPickCountDB) List ¶
func (e EventPickCountDB) List() []EventPickCountEntry
type EventPickCountEntry ¶
type FilterToggleDB ¶
type FilterToggleDB struct {
// contains filtered or unexported fields
}
func GetFilterToggleDB ¶
func GetFilterToggleDB() *FilterToggleDB
func (*FilterToggleDB) IsFilterEnabled ¶
func (db *FilterToggleDB) IsFilterEnabled(id string) bool
func (*FilterToggleDB) SetFilterEnabled ¶
func (db *FilterToggleDB) SetFilterEnabled(filterID string, enabled bool)
SetFilterEnabled updates the filter enabled state. It does not check the filterID validity, it is assumed to be correct.
type MemberDB ¶
type MemberDB struct {
// contains filtered or unexported fields
}
func GetMemberDB ¶
func GetMemberDB() MemberDB
func (MemberDB) GetNameByUserName ¶
type MuteDB ¶
type MuteDB struct {
// contains filtered or unexported fields
}
func (*MuteDB) GetByUserName ¶
func (*MuteDB) MarkMuteAnnounced ¶
func (*MuteDB) UnmuteUser ¶
type NameReplacementDB ¶
type NameReplacementDB struct {
// contains filtered or unexported fields
}
func GetNameReplacementDB ¶
func GetNameReplacementDB() *NameReplacementDB
func (*NameReplacementDB) GetNameForUser ¶
func (db *NameReplacementDB) GetNameForUser(user *tgbotapi.User) string
type OncePerDayLimiter ¶
type OncePerDayLimiter struct {
// contains filtered or unexported fields
}
func GetOncePerDayLimiter ¶
func GetOncePerDayLimiter() *OncePerDayLimiter
func (*OncePerDayLimiter) Try ¶
func (l *OncePerDayLimiter) Try(chatID int64) bool
type RemovedMessageDB ¶
type RemovedMessageDB struct {
// contains filtered or unexported fields
}
func GetRemovedMessageDB ¶
func GetRemovedMessageDB() *RemovedMessageDB
func (*RemovedMessageDB) Add ¶
func (db *RemovedMessageDB) Add(message *tgbotapi.Message)
type ScrutinyDB ¶
type ScrutinyDB struct {
// contains filtered or unexported fields
}
func GetScrutinyDB ¶
func GetScrutinyDB() *ScrutinyDB
func (*ScrutinyDB) Add ¶
func (db *ScrutinyDB) Add(nick string)
func (*ScrutinyDB) IsUnderScrutiny ¶
func (db *ScrutinyDB) IsUnderScrutiny(nick string) bool
func (*ScrutinyDB) Remove ¶
func (db *ScrutinyDB) Remove(nick string) bool
type StickerDB ¶
type StickerDB struct {
// contains filtered or unexported fields
}
func GetStickerDB ¶
func GetStickerDB() *StickerDB
func (*StickerDB) GetRandomMockStickerFileID ¶
Click to show internal directories.
Click to hide internal directories.