Documentation
¶
Index ¶
- Variables
- func DefaultHelpRegistry() *moduleStruct
- func HandleAnonymousAdmin(b *gotgbot.Bot, ctx *ext.Context, command string) error
- func HandleDeepLink(b *gotgbot.Bot, ctx *ext.Context, user *gotgbot.User, arg string) error
- func LoadAdmin(dispatcher *ext.Dispatcher)
- func LoadAllModules(dispatcher *ext.Dispatcher)
- func LoadAntiRaid(dispatcher *ext.Dispatcher)
- func LoadAntiflood(dispatcher *ext.Dispatcher)
- func LoadAntispam(dispatcher *ext.Dispatcher)
- func LoadApprovals(dispatcher *ext.Dispatcher)
- func LoadBackup(dispatcher *ext.Dispatcher)
- func LoadBans(dispatcher *ext.Dispatcher)
- func LoadBlacklists(dispatcher *ext.Dispatcher)
- func LoadBotUpdates(dispatcher *ext.Dispatcher)
- func LoadCaptcha(dispatcher *ext.Dispatcher)
- func LoadConnections(dispatcher *ext.Dispatcher)
- func LoadDev(dispatcher *ext.Dispatcher)
- func LoadDisabling(dispatcher *ext.Dispatcher)
- func LoadFilters(dispatcher *ext.Dispatcher)
- func LoadGreetings(dispatcher *ext.Dispatcher)
- func LoadHelp(dispatcher *ext.Dispatcher)
- func LoadLanguage(dispatcher *ext.Dispatcher)
- func LoadLocks(dispatcher *ext.Dispatcher)
- func LoadMisc(dispatcher *ext.Dispatcher)
- func LoadMkdCmd(dispatcher *ext.Dispatcher)
- func LoadMutes(dispatcher *ext.Dispatcher)
- func LoadNotes(dispatcher *ext.Dispatcher)
- func LoadPin(dispatcher *ext.Dispatcher)
- func LoadPurges(dispatcher *ext.Dispatcher)
- func LoadReactions(dispatcher *ext.Dispatcher)
- func LoadReports(dispatcher *ext.Dispatcher)
- func LoadRules(dispatcher *ext.Dispatcher)
- func LoadUsers(dispatcher *ext.Dispatcher)
- func LoadWarns(dispatcher *ext.Dispatcher)
- func RegisterAnonymousAdminHandler(command string, handler AnonymousAdminHandler)
- func RegisterDeepLinkHandler(prefix string, handler DeepLinkHandler)
- func RegisterExactDeepLinkHandler(arg string, handler DeepLinkHandler)
- func RegisterLegacyModule(name string, priority int, load func(*ext.Dispatcher))
- func SendCaptcha(bot *gotgbot.Bot, ctx *ext.Context, userID int64, userName string) error
- func SendWelcomeMessage(bot *gotgbot.Bot, ctx *ext.Context, userID int64, firstName string) error
- func StartAntiRaidExpiryPoller()
- func StopAntiRaidExpiryPoller()
- type AnonymousAdminHandler
- type DeepLinkHandler
- type PurgeWorker
Constants ¶
This section is empty.
Variables ¶
var ( OTHER filters.Message = func(msg *gotgbot.Message) bool { return msg.Game != nil || msg.Sticker != nil || message.Animation(msg) } MEDIA filters.Message = func(msg *gotgbot.Message) bool { return msg.Audio != nil || msg.Document != nil || msg.VideoNote != nil || msg.Video != nil || msg.Voice != nil || msg.Photo != nil } MESSAGES filters.Message = func(msg *gotgbot.Message) bool { return msg.Text != "" || msg.Contact != nil || msg.Location != nil || msg.Venue != nil || MEDIA(msg) || OTHER(msg) } PREVIEW filters.Message = hasURLEntity )
var ConnectionsModule = moduleStruct{/* contains filtered or unexported fields */}
var MutedPermissions = gotgbot.ChatPermissions{ CanSendMessages: false, CanSendPhotos: false, CanSendVideos: false, CanSendAudios: false, CanSendDocuments: false, CanSendVideoNotes: false, CanSendVoiceNotes: false, CanAddWebPagePreviews: false, CanChangeInfo: false, CanInviteUsers: false, CanPinMessages: false, CanManageTopics: helpers.Ptr(false), CanSendPolls: false, CanSendOtherMessages: false, }
MutedPermissions represents a fully restricted user - all sending capabilities disabled
Functions ¶
func DefaultHelpRegistry ¶
func DefaultHelpRegistry() *moduleStruct
DefaultHelpRegistry returns the default help registry.
func HandleAnonymousAdmin ¶
HandleAnonymousAdmin routes an anonymous admin command to the appropriate handler.
func HandleDeepLink ¶
HandleDeepLink routes a deep link argument to the appropriate handler.
func LoadAdmin ¶
func LoadAdmin(dispatcher *ext.Dispatcher)
LoadAdmin registers all admin module command handlers with the dispatcher. Sets up commands for promotion, demotion, title setting, and admin management.
func LoadAllModules ¶
func LoadAllModules(dispatcher *ext.Dispatcher)
LoadAllModules sorts registered modules by ascending priority and calls each loader.
func LoadAntiRaid ¶
func LoadAntiRaid(dispatcher *ext.Dispatcher)
func LoadAntiflood ¶
func LoadAntiflood(dispatcher *ext.Dispatcher)
LoadAntiflood registers all antiflood module handlers with the dispatcher. Sets up flood detection commands and message monitoring handlers.
func LoadAntispam ¶
func LoadAntispam(dispatcher *ext.Dispatcher)
LoadAntispam registers the antispam message handler with the dispatcher. Sets up spam detection monitoring for all incoming messages.
func LoadApprovals ¶
func LoadApprovals(dispatcher *ext.Dispatcher)
LoadApprovals registers all approvals module handlers with the dispatcher.
func LoadBackup ¶
func LoadBackup(dispatcher *ext.Dispatcher)
LoadBackup registers all backup module handlers with the dispatcher.
func LoadBans ¶
func LoadBans(dispatcher *ext.Dispatcher)
LoadBans registers all ban-related command handlers with the dispatcher. Sets up ban, kick, restrict commands and their associated callback handlers.
func LoadBlacklists ¶
func LoadBlacklists(dispatcher *ext.Dispatcher)
LoadBlacklists registers all blacklist module handlers with the dispatcher. Sets up commands for managing blacklists and the message watcher for enforcement.
func LoadBotUpdates ¶
func LoadBotUpdates(dispatcher *ext.Dispatcher)
LoadBotUpdates registers bot event handlers for group management. Sets up handlers for bot joins, admin updates, and anonymous admin verification.
func LoadCaptcha ¶
func LoadCaptcha(dispatcher *ext.Dispatcher)
LoadCaptcha registers all captcha module handlers with the dispatcher.
func LoadConnections ¶
func LoadConnections(dispatcher *ext.Dispatcher)
LoadConnections registers all connection module handlers with the dispatcher. Sets up commands for managing remote chat connections and their callbacks.
func LoadDev ¶
func LoadDev(dispatcher *ext.Dispatcher)
LoadDev registers all development-related command handlers with the dispatcher. Sets up admin commands for bot management, user management, and statistics.
func LoadDisabling ¶
func LoadDisabling(dispatcher *ext.Dispatcher)
LoadDisabling registers all disabling-related command handlers with the dispatcher. Sets up commands for managing which bot commands are enabled or disabled in chats.
func LoadFilters ¶
func LoadFilters(dispatcher *ext.Dispatcher)
LoadFilters registers all filter-related handlers with the dispatcher. Sets up commands for managing filters and the message watcher for automatic responses.
func LoadGreetings ¶
func LoadGreetings(dispatcher *ext.Dispatcher)
LoadGreetings registers all greeting-related handlers with the dispatcher. Sets up welcome/goodbye messages, join requests, and service message cleanup.
func LoadHelp ¶
func LoadHelp(dispatcher *ext.Dispatcher)
LoadHelp registers all help-related command and callback handlers. Sets up the help system including start, about, donate, and configuration commands.
func LoadLanguage ¶
func LoadLanguage(dispatcher *ext.Dispatcher)
LoadLanguage registers language-related command and callback handlers. Sets up language selection commands and keyboard navigation for internationalization.
func LoadLocks ¶
func LoadLocks(dispatcher *ext.Dispatcher)
LoadLocks registers all locks module handlers with the dispatcher, including commands and message filters for lock enforcement.
func LoadMisc ¶
func LoadMisc(dispatcher *ext.Dispatcher)
LoadMisc registers all miscellaneous module handlers with the dispatcher, including utility commands for IDs, ping, translation, and stats.
func LoadMkdCmd ¶
func LoadMkdCmd(dispatcher *ext.Dispatcher)
LoadMkdCmd registers markdown and formatting command handlers with the dispatcher. Sets up help commands and callback handlers for formatting assistance.
func LoadMutes ¶
func LoadMutes(dispatcher *ext.Dispatcher)
LoadMutes registers all mute module handlers with the dispatcher, including various mute commands and their variants.
func LoadNotes ¶
func LoadNotes(dispatcher *ext.Dispatcher)
LoadNotes registers all notes module handlers with the dispatcher, including note management commands and the notes watcher.
func LoadPin ¶
func LoadPin(dispatcher *ext.Dispatcher)
LoadPin registers all pins module handlers with the dispatcher, including pin management commands and channel message monitoring.
func LoadPurges ¶
func LoadPurges(dispatcher *ext.Dispatcher)
LoadPurges registers all purges module handlers with the dispatcher, including message deletion commands and callback handlers.
func LoadReactions ¶
func LoadReactions(dispatcher *ext.Dispatcher)
LoadReactions loads the reactions module with all command handlers
func LoadReports ¶
func LoadReports(dispatcher *ext.Dispatcher)
LoadReports registers all reports module handlers with the dispatcher, including report commands and @admin mention monitoring.
func LoadRules ¶
func LoadRules(dispatcher *ext.Dispatcher)
LoadRules registers all rules module handlers with the dispatcher, including rules management and display commands.
func LoadUsers ¶
func LoadUsers(dispatcher *ext.Dispatcher)
LoadUsers registers the user logging handler with the dispatcher to automatically track users and chats across all messages.
func LoadWarns ¶
func LoadWarns(dispatcher *ext.Dispatcher)
LoadWarns registers all warns module handlers with the dispatcher, including warning commands and callback handlers.
func RegisterAnonymousAdminHandler ¶
func RegisterAnonymousAdminHandler(command string, handler AnonymousAdminHandler)
RegisterAnonymousAdminHandler registers a handler for an anonymous admin command.
func RegisterDeepLinkHandler ¶
func RegisterDeepLinkHandler(prefix string, handler DeepLinkHandler)
RegisterDeepLinkHandler registers a handler for a deep link prefix.
func RegisterExactDeepLinkHandler ¶
func RegisterExactDeepLinkHandler(arg string, handler DeepLinkHandler)
RegisterExactDeepLinkHandler registers a handler for an exact deep link match.
func RegisterLegacyModule ¶
func RegisterLegacyModule(name string, priority int, load func(*ext.Dispatcher))
RegisterLegacyModule registers a module loader. Duplicate registrations are silently ignored to prevent double-loading handlers.
func SendCaptcha ¶
SendCaptcha sends a captcha challenge to a new member. Called when a new member joins a group with captcha enabled.
func SendWelcomeMessage ¶
SendWelcomeMessage sends the configured welcome message for a user in a chat. This is extracted as a separate function to be reusable after captcha verification.
func StartAntiRaidExpiryPoller ¶
func StartAntiRaidExpiryPoller()
StartAntiRaidExpiryPoller starts the background expiry poller after cache is available.
func StopAntiRaidExpiryPoller ¶
func StopAntiRaidExpiryPoller()
StopAntiRaidExpiryPoller stops the background expiry poller.
Types ¶
type AnonymousAdminHandler ¶
AnonymousAdminHandler processes an anonymous admin command.
type DeepLinkHandler ¶
DeepLinkHandler processes a deep link argument.
type PurgeWorker ¶
type PurgeWorker struct {
// contains filtered or unexported fields
}
PurgeWorker manages concurrent message deletion with rate limiting
Source Files
¶
- admin.go
- anonymous_admin_router.go
- antiflood.go
- antiraid.go
- antispam.go
- approvals.go
- backup.go
- bans.go
- blacklists.go
- bot_updates.go
- callback_codec.go
- callback_context.go
- callback_parse_overwrite.go
- captcha.go
- chat_permissions.go
- connections.go
- connections_auth.go
- core.go
- deeplink_router.go
- devs.go
- disabling.go
- filters.go
- formatting.go
- greetings.go
- help.go
- help_system.go
- i18n_helpers.go
- language.go
- locks.go
- misc.go
- moderation.go
- moderation_input.go
- mute.go
- notes.go
- overwrite.go
- pins.go
- purges.go
- reactions.go
- registry.go
- reports.go
- rules.go
- rules_format.go
- users.go
- warns.go