package tg
import (
"context"
"sync"
"go.uber.org/multierr"
)
var (
_ = context .Background ()
_ = multierr .AppendInto
_ = sync .Mutex {}
)
type Handler = func (context .Context , Entities , UpdateClass ) error
type UpdateDispatcher struct {
state *dispatcherState
}
func NewUpdateDispatcher () UpdateDispatcher {
return UpdateDispatcher {
state : newDispatcherState (),
}
}
type BeforeHandler func (ctx context .Context , e Entities , update UpdateClass ) error
func (u UpdateDispatcher ) OnBefore (handler BeforeHandler ) {
u .state .setBefore (handler )
}
type dispatcherState struct {
mux sync .RWMutex
handlers map [uint32 ]Handler
fallback Handler
before BeforeHandler
}
func newDispatcherState () *dispatcherState {
return &dispatcherState {
handlers : map [uint32 ]Handler {},
}
}
func (s *dispatcherState ) set (typeID uint32 , h Handler ) {
s .mux .Lock ()
defer s .mux .Unlock ()
s .handlers [typeID ] = h
}
func (s *dispatcherState ) setFallback (h Handler ) {
s .mux .Lock ()
defer s .mux .Unlock ()
s .fallback = h
}
func (s *dispatcherState ) setBefore (h BeforeHandler ) {
s .mux .Lock ()
defer s .mux .Unlock ()
s .before = h
}
func (s *dispatcherState ) handler (typeID uint32 ) (BeforeHandler , Handler ) {
if s == nil {
return nil , nil
}
s .mux .RLock ()
defer s .mux .RUnlock ()
if h , ok := s .handlers [typeID ]; ok {
return s .before , h
}
return s .before , s .fallback
}
type Entities struct {
Short bool
Users map [int64 ]*User
Chats map [int64 ]*Chat
Channels map [int64 ]*Channel
}
func EntitiesFrom (users []UserClass , chats []ChatClass ) Entities {
c := ChatClassArray (chats )
return Entities {
Users : UserClassArray (users ).NotEmptyToMap (),
Chats : c .ChatToMap (),
Channels : c .ChannelToMap (),
}
}
type EntitiesResult interface {
MapUsers () UserClassArray
MapChats () ChatClassArray
}
func EntitiesFromResult (r EntitiesResult ) Entities {
chats := r .MapChats ()
return Entities {
Users : r .MapUsers ().NotEmptyToMap (),
Chats : chats .ChatToMap (),
Channels : chats .ChannelToMap (),
}
}
func (u *Entities ) short () {
u .Short = true
u .Users = make (map [int64 ]*User , 0 )
u .Chats = make (map [int64 ]*Chat , 0 )
u .Channels = make (map [int64 ]*Channel , 0 )
}
func (u UpdateDispatcher ) Handle (ctx context .Context , updates UpdatesClass ) error {
var (
e Entities
upds []UpdateClass
)
switch u := updates .(type ) {
case *Updates :
upds = u .Updates
e = EntitiesFromResult (u )
case *UpdatesCombined :
upds = u .Updates
e = EntitiesFromResult (u )
case *UpdateShort :
upds = []UpdateClass {u .Update }
e .short ()
default :
return nil
}
var err error
for _ , update := range upds {
multierr .AppendInto (&err , u .dispatch (ctx , e , update ))
}
return err
}
func (u UpdateDispatcher ) dispatch (ctx context .Context , e Entities , update UpdateClass ) error {
if update == nil {
return nil
}
before , handler := u .state .handler (update .TypeID ())
if before != nil {
if err := before (ctx , e , update ); err != nil {
return err
}
}
if handler == nil {
return nil
}
return handler (ctx , e , update )
}
type NewMessageHandler func (ctx context .Context , e Entities , update *UpdateNewMessage ) error
func (u UpdateDispatcher ) OnNewMessage (handler NewMessageHandler ) {
u .state .set (UpdateNewMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNewMessage ))
})
}
type MessageIDHandler func (ctx context .Context , e Entities , update *UpdateMessageID ) error
func (u UpdateDispatcher ) OnMessageID (handler MessageIDHandler ) {
u .state .set (UpdateMessageIDTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateMessageID ))
})
}
type DeleteMessagesHandler func (ctx context .Context , e Entities , update *UpdateDeleteMessages ) error
func (u UpdateDispatcher ) OnDeleteMessages (handler DeleteMessagesHandler ) {
u .state .set (UpdateDeleteMessagesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDeleteMessages ))
})
}
type UserTypingHandler func (ctx context .Context , e Entities , update *UpdateUserTyping ) error
func (u UpdateDispatcher ) OnUserTyping (handler UserTypingHandler ) {
u .state .set (UpdateUserTypingTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateUserTyping ))
})
}
type ChatUserTypingHandler func (ctx context .Context , e Entities , update *UpdateChatUserTyping ) error
func (u UpdateDispatcher ) OnChatUserTyping (handler ChatUserTypingHandler ) {
u .state .set (UpdateChatUserTypingTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChatUserTyping ))
})
}
type ChatParticipantsHandler func (ctx context .Context , e Entities , update *UpdateChatParticipants ) error
func (u UpdateDispatcher ) OnChatParticipants (handler ChatParticipantsHandler ) {
u .state .set (UpdateChatParticipantsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChatParticipants ))
})
}
type UserStatusHandler func (ctx context .Context , e Entities , update *UpdateUserStatus ) error
func (u UpdateDispatcher ) OnUserStatus (handler UserStatusHandler ) {
u .state .set (UpdateUserStatusTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateUserStatus ))
})
}
type UserNameHandler func (ctx context .Context , e Entities , update *UpdateUserName ) error
func (u UpdateDispatcher ) OnUserName (handler UserNameHandler ) {
u .state .set (UpdateUserNameTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateUserName ))
})
}
type NewAuthorizationHandler func (ctx context .Context , e Entities , update *UpdateNewAuthorization ) error
func (u UpdateDispatcher ) OnNewAuthorization (handler NewAuthorizationHandler ) {
u .state .set (UpdateNewAuthorizationTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNewAuthorization ))
})
}
type NewEncryptedMessageHandler func (ctx context .Context , e Entities , update *UpdateNewEncryptedMessage ) error
func (u UpdateDispatcher ) OnNewEncryptedMessage (handler NewEncryptedMessageHandler ) {
u .state .set (UpdateNewEncryptedMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNewEncryptedMessage ))
})
}
type EncryptedChatTypingHandler func (ctx context .Context , e Entities , update *UpdateEncryptedChatTyping ) error
func (u UpdateDispatcher ) OnEncryptedChatTyping (handler EncryptedChatTypingHandler ) {
u .state .set (UpdateEncryptedChatTypingTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateEncryptedChatTyping ))
})
}
type EncryptionHandler func (ctx context .Context , e Entities , update *UpdateEncryption ) error
func (u UpdateDispatcher ) OnEncryption (handler EncryptionHandler ) {
u .state .set (UpdateEncryptionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateEncryption ))
})
}
type EncryptedMessagesReadHandler func (ctx context .Context , e Entities , update *UpdateEncryptedMessagesRead ) error
func (u UpdateDispatcher ) OnEncryptedMessagesRead (handler EncryptedMessagesReadHandler ) {
u .state .set (UpdateEncryptedMessagesReadTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateEncryptedMessagesRead ))
})
}
type ChatParticipantAddHandler func (ctx context .Context , e Entities , update *UpdateChatParticipantAdd ) error
func (u UpdateDispatcher ) OnChatParticipantAdd (handler ChatParticipantAddHandler ) {
u .state .set (UpdateChatParticipantAddTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChatParticipantAdd ))
})
}
type ChatParticipantDeleteHandler func (ctx context .Context , e Entities , update *UpdateChatParticipantDelete ) error
func (u UpdateDispatcher ) OnChatParticipantDelete (handler ChatParticipantDeleteHandler ) {
u .state .set (UpdateChatParticipantDeleteTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChatParticipantDelete ))
})
}
type DCOptionsHandler func (ctx context .Context , e Entities , update *UpdateDCOptions ) error
func (u UpdateDispatcher ) OnDCOptions (handler DCOptionsHandler ) {
u .state .set (UpdateDCOptionsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDCOptions ))
})
}
type NotifySettingsHandler func (ctx context .Context , e Entities , update *UpdateNotifySettings ) error
func (u UpdateDispatcher ) OnNotifySettings (handler NotifySettingsHandler ) {
u .state .set (UpdateNotifySettingsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNotifySettings ))
})
}
type ServiceNotificationHandler func (ctx context .Context , e Entities , update *UpdateServiceNotification ) error
func (u UpdateDispatcher ) OnServiceNotification (handler ServiceNotificationHandler ) {
u .state .set (UpdateServiceNotificationTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateServiceNotification ))
})
}
type PrivacyHandler func (ctx context .Context , e Entities , update *UpdatePrivacy ) error
func (u UpdateDispatcher ) OnPrivacy (handler PrivacyHandler ) {
u .state .set (UpdatePrivacyTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePrivacy ))
})
}
type UserPhoneHandler func (ctx context .Context , e Entities , update *UpdateUserPhone ) error
func (u UpdateDispatcher ) OnUserPhone (handler UserPhoneHandler ) {
u .state .set (UpdateUserPhoneTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateUserPhone ))
})
}
type ReadHistoryInboxHandler func (ctx context .Context , e Entities , update *UpdateReadHistoryInbox ) error
func (u UpdateDispatcher ) OnReadHistoryInbox (handler ReadHistoryInboxHandler ) {
u .state .set (UpdateReadHistoryInboxTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadHistoryInbox ))
})
}
type ReadHistoryOutboxHandler func (ctx context .Context , e Entities , update *UpdateReadHistoryOutbox ) error
func (u UpdateDispatcher ) OnReadHistoryOutbox (handler ReadHistoryOutboxHandler ) {
u .state .set (UpdateReadHistoryOutboxTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadHistoryOutbox ))
})
}
type WebPageHandler func (ctx context .Context , e Entities , update *UpdateWebPage ) error
func (u UpdateDispatcher ) OnWebPage (handler WebPageHandler ) {
u .state .set (UpdateWebPageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateWebPage ))
})
}
type ReadMessagesContentsHandler func (ctx context .Context , e Entities , update *UpdateReadMessagesContents ) error
func (u UpdateDispatcher ) OnReadMessagesContents (handler ReadMessagesContentsHandler ) {
u .state .set (UpdateReadMessagesContentsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadMessagesContents ))
})
}
type ChannelTooLongHandler func (ctx context .Context , e Entities , update *UpdateChannelTooLong ) error
func (u UpdateDispatcher ) OnChannelTooLong (handler ChannelTooLongHandler ) {
u .state .set (UpdateChannelTooLongTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChannelTooLong ))
})
}
type ChannelHandler func (ctx context .Context , e Entities , update *UpdateChannel ) error
func (u UpdateDispatcher ) OnChannel (handler ChannelHandler ) {
u .state .set (UpdateChannelTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChannel ))
})
}
type NewChannelMessageHandler func (ctx context .Context , e Entities , update *UpdateNewChannelMessage ) error
func (u UpdateDispatcher ) OnNewChannelMessage (handler NewChannelMessageHandler ) {
u .state .set (UpdateNewChannelMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNewChannelMessage ))
})
}
type ReadChannelInboxHandler func (ctx context .Context , e Entities , update *UpdateReadChannelInbox ) error
func (u UpdateDispatcher ) OnReadChannelInbox (handler ReadChannelInboxHandler ) {
u .state .set (UpdateReadChannelInboxTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadChannelInbox ))
})
}
type DeleteChannelMessagesHandler func (ctx context .Context , e Entities , update *UpdateDeleteChannelMessages ) error
func (u UpdateDispatcher ) OnDeleteChannelMessages (handler DeleteChannelMessagesHandler ) {
u .state .set (UpdateDeleteChannelMessagesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDeleteChannelMessages ))
})
}
type ChannelMessageViewsHandler func (ctx context .Context , e Entities , update *UpdateChannelMessageViews ) error
func (u UpdateDispatcher ) OnChannelMessageViews (handler ChannelMessageViewsHandler ) {
u .state .set (UpdateChannelMessageViewsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChannelMessageViews ))
})
}
type ChatParticipantAdminHandler func (ctx context .Context , e Entities , update *UpdateChatParticipantAdmin ) error
func (u UpdateDispatcher ) OnChatParticipantAdmin (handler ChatParticipantAdminHandler ) {
u .state .set (UpdateChatParticipantAdminTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChatParticipantAdmin ))
})
}
type NewStickerSetHandler func (ctx context .Context , e Entities , update *UpdateNewStickerSet ) error
func (u UpdateDispatcher ) OnNewStickerSet (handler NewStickerSetHandler ) {
u .state .set (UpdateNewStickerSetTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNewStickerSet ))
})
}
type StickerSetsOrderHandler func (ctx context .Context , e Entities , update *UpdateStickerSetsOrder ) error
func (u UpdateDispatcher ) OnStickerSetsOrder (handler StickerSetsOrderHandler ) {
u .state .set (UpdateStickerSetsOrderTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateStickerSetsOrder ))
})
}
type StickerSetsHandler func (ctx context .Context , e Entities , update *UpdateStickerSets ) error
func (u UpdateDispatcher ) OnStickerSets (handler StickerSetsHandler ) {
u .state .set (UpdateStickerSetsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateStickerSets ))
})
}
type SavedGifsHandler func (ctx context .Context , e Entities , update *UpdateSavedGifs ) error
func (u UpdateDispatcher ) OnSavedGifs (handler SavedGifsHandler ) {
u .state .set (UpdateSavedGifsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateSavedGifs ))
})
}
type BotInlineQueryHandler func (ctx context .Context , e Entities , update *UpdateBotInlineQuery ) error
func (u UpdateDispatcher ) OnBotInlineQuery (handler BotInlineQueryHandler ) {
u .state .set (UpdateBotInlineQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotInlineQuery ))
})
}
type BotInlineSendHandler func (ctx context .Context , e Entities , update *UpdateBotInlineSend ) error
func (u UpdateDispatcher ) OnBotInlineSend (handler BotInlineSendHandler ) {
u .state .set (UpdateBotInlineSendTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotInlineSend ))
})
}
type EditChannelMessageHandler func (ctx context .Context , e Entities , update *UpdateEditChannelMessage ) error
func (u UpdateDispatcher ) OnEditChannelMessage (handler EditChannelMessageHandler ) {
u .state .set (UpdateEditChannelMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateEditChannelMessage ))
})
}
type BotCallbackQueryHandler func (ctx context .Context , e Entities , update *UpdateBotCallbackQuery ) error
func (u UpdateDispatcher ) OnBotCallbackQuery (handler BotCallbackQueryHandler ) {
u .state .set (UpdateBotCallbackQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotCallbackQuery ))
})
}
type EditMessageHandler func (ctx context .Context , e Entities , update *UpdateEditMessage ) error
func (u UpdateDispatcher ) OnEditMessage (handler EditMessageHandler ) {
u .state .set (UpdateEditMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateEditMessage ))
})
}
type InlineBotCallbackQueryHandler func (ctx context .Context , e Entities , update *UpdateInlineBotCallbackQuery ) error
func (u UpdateDispatcher ) OnInlineBotCallbackQuery (handler InlineBotCallbackQueryHandler ) {
u .state .set (UpdateInlineBotCallbackQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateInlineBotCallbackQuery ))
})
}
type ReadChannelOutboxHandler func (ctx context .Context , e Entities , update *UpdateReadChannelOutbox ) error
func (u UpdateDispatcher ) OnReadChannelOutbox (handler ReadChannelOutboxHandler ) {
u .state .set (UpdateReadChannelOutboxTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadChannelOutbox ))
})
}
type DraftMessageHandler func (ctx context .Context , e Entities , update *UpdateDraftMessage ) error
func (u UpdateDispatcher ) OnDraftMessage (handler DraftMessageHandler ) {
u .state .set (UpdateDraftMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDraftMessage ))
})
}
type ReadFeaturedStickersHandler func (ctx context .Context , e Entities , update *UpdateReadFeaturedStickers ) error
func (u UpdateDispatcher ) OnReadFeaturedStickers (handler ReadFeaturedStickersHandler ) {
u .state .set (UpdateReadFeaturedStickersTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadFeaturedStickers ))
})
}
type RecentStickersHandler func (ctx context .Context , e Entities , update *UpdateRecentStickers ) error
func (u UpdateDispatcher ) OnRecentStickers (handler RecentStickersHandler ) {
u .state .set (UpdateRecentStickersTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateRecentStickers ))
})
}
type ConfigHandler func (ctx context .Context , e Entities , update *UpdateConfig ) error
func (u UpdateDispatcher ) OnConfig (handler ConfigHandler ) {
u .state .set (UpdateConfigTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateConfig ))
})
}
type PtsChangedHandler func (ctx context .Context , e Entities , update *UpdatePtsChanged ) error
func (u UpdateDispatcher ) OnPtsChanged (handler PtsChangedHandler ) {
u .state .set (UpdatePtsChangedTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePtsChanged ))
})
}
type ChannelWebPageHandler func (ctx context .Context , e Entities , update *UpdateChannelWebPage ) error
func (u UpdateDispatcher ) OnChannelWebPage (handler ChannelWebPageHandler ) {
u .state .set (UpdateChannelWebPageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChannelWebPage ))
})
}
type DialogPinnedHandler func (ctx context .Context , e Entities , update *UpdateDialogPinned ) error
func (u UpdateDispatcher ) OnDialogPinned (handler DialogPinnedHandler ) {
u .state .set (UpdateDialogPinnedTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDialogPinned ))
})
}
type PinnedDialogsHandler func (ctx context .Context , e Entities , update *UpdatePinnedDialogs ) error
func (u UpdateDispatcher ) OnPinnedDialogs (handler PinnedDialogsHandler ) {
u .state .set (UpdatePinnedDialogsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePinnedDialogs ))
})
}
type BotWebhookJSONHandler func (ctx context .Context , e Entities , update *UpdateBotWebhookJSON ) error
func (u UpdateDispatcher ) OnBotWebhookJSON (handler BotWebhookJSONHandler ) {
u .state .set (UpdateBotWebhookJSONTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotWebhookJSON ))
})
}
type BotWebhookJSONQueryHandler func (ctx context .Context , e Entities , update *UpdateBotWebhookJSONQuery ) error
func (u UpdateDispatcher ) OnBotWebhookJSONQuery (handler BotWebhookJSONQueryHandler ) {
u .state .set (UpdateBotWebhookJSONQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotWebhookJSONQuery ))
})
}
type BotShippingQueryHandler func (ctx context .Context , e Entities , update *UpdateBotShippingQuery ) error
func (u UpdateDispatcher ) OnBotShippingQuery (handler BotShippingQueryHandler ) {
u .state .set (UpdateBotShippingQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotShippingQuery ))
})
}
type BotPrecheckoutQueryHandler func (ctx context .Context , e Entities , update *UpdateBotPrecheckoutQuery ) error
func (u UpdateDispatcher ) OnBotPrecheckoutQuery (handler BotPrecheckoutQueryHandler ) {
u .state .set (UpdateBotPrecheckoutQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotPrecheckoutQuery ))
})
}
type PhoneCallHandler func (ctx context .Context , e Entities , update *UpdatePhoneCall ) error
func (u UpdateDispatcher ) OnPhoneCall (handler PhoneCallHandler ) {
u .state .set (UpdatePhoneCallTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePhoneCall ))
})
}
type LangPackTooLongHandler func (ctx context .Context , e Entities , update *UpdateLangPackTooLong ) error
func (u UpdateDispatcher ) OnLangPackTooLong (handler LangPackTooLongHandler ) {
u .state .set (UpdateLangPackTooLongTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateLangPackTooLong ))
})
}
type LangPackHandler func (ctx context .Context , e Entities , update *UpdateLangPack ) error
func (u UpdateDispatcher ) OnLangPack (handler LangPackHandler ) {
u .state .set (UpdateLangPackTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateLangPack ))
})
}
type FavedStickersHandler func (ctx context .Context , e Entities , update *UpdateFavedStickers ) error
func (u UpdateDispatcher ) OnFavedStickers (handler FavedStickersHandler ) {
u .state .set (UpdateFavedStickersTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateFavedStickers ))
})
}
type ChannelReadMessagesContentsHandler func (ctx context .Context , e Entities , update *UpdateChannelReadMessagesContents ) error
func (u UpdateDispatcher ) OnChannelReadMessagesContents (handler ChannelReadMessagesContentsHandler ) {
u .state .set (UpdateChannelReadMessagesContentsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChannelReadMessagesContents ))
})
}
type ContactsResetHandler func (ctx context .Context , e Entities , update *UpdateContactsReset ) error
func (u UpdateDispatcher ) OnContactsReset (handler ContactsResetHandler ) {
u .state .set (UpdateContactsResetTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateContactsReset ))
})
}
type ChannelAvailableMessagesHandler func (ctx context .Context , e Entities , update *UpdateChannelAvailableMessages ) error
func (u UpdateDispatcher ) OnChannelAvailableMessages (handler ChannelAvailableMessagesHandler ) {
u .state .set (UpdateChannelAvailableMessagesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChannelAvailableMessages ))
})
}
type DialogUnreadMarkHandler func (ctx context .Context , e Entities , update *UpdateDialogUnreadMark ) error
func (u UpdateDispatcher ) OnDialogUnreadMark (handler DialogUnreadMarkHandler ) {
u .state .set (UpdateDialogUnreadMarkTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDialogUnreadMark ))
})
}
type MessagePollHandler func (ctx context .Context , e Entities , update *UpdateMessagePoll ) error
func (u UpdateDispatcher ) OnMessagePoll (handler MessagePollHandler ) {
u .state .set (UpdateMessagePollTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateMessagePoll ))
})
}
type ChatDefaultBannedRightsHandler func (ctx context .Context , e Entities , update *UpdateChatDefaultBannedRights ) error
func (u UpdateDispatcher ) OnChatDefaultBannedRights (handler ChatDefaultBannedRightsHandler ) {
u .state .set (UpdateChatDefaultBannedRightsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChatDefaultBannedRights ))
})
}
type FolderPeersHandler func (ctx context .Context , e Entities , update *UpdateFolderPeers ) error
func (u UpdateDispatcher ) OnFolderPeers (handler FolderPeersHandler ) {
u .state .set (UpdateFolderPeersTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateFolderPeers ))
})
}
type PeerSettingsHandler func (ctx context .Context , e Entities , update *UpdatePeerSettings ) error
func (u UpdateDispatcher ) OnPeerSettings (handler PeerSettingsHandler ) {
u .state .set (UpdatePeerSettingsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePeerSettings ))
})
}
type PeerLocatedHandler func (ctx context .Context , e Entities , update *UpdatePeerLocated ) error
func (u UpdateDispatcher ) OnPeerLocated (handler PeerLocatedHandler ) {
u .state .set (UpdatePeerLocatedTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePeerLocated ))
})
}
type NewScheduledMessageHandler func (ctx context .Context , e Entities , update *UpdateNewScheduledMessage ) error
func (u UpdateDispatcher ) OnNewScheduledMessage (handler NewScheduledMessageHandler ) {
u .state .set (UpdateNewScheduledMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNewScheduledMessage ))
})
}
type DeleteScheduledMessagesHandler func (ctx context .Context , e Entities , update *UpdateDeleteScheduledMessages ) error
func (u UpdateDispatcher ) OnDeleteScheduledMessages (handler DeleteScheduledMessagesHandler ) {
u .state .set (UpdateDeleteScheduledMessagesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDeleteScheduledMessages ))
})
}
type ThemeHandler func (ctx context .Context , e Entities , update *UpdateTheme ) error
func (u UpdateDispatcher ) OnTheme (handler ThemeHandler ) {
u .state .set (UpdateThemeTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateTheme ))
})
}
type GeoLiveViewedHandler func (ctx context .Context , e Entities , update *UpdateGeoLiveViewed ) error
func (u UpdateDispatcher ) OnGeoLiveViewed (handler GeoLiveViewedHandler ) {
u .state .set (UpdateGeoLiveViewedTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateGeoLiveViewed ))
})
}
type LoginTokenHandler func (ctx context .Context , e Entities , update *UpdateLoginToken ) error
func (u UpdateDispatcher ) OnLoginToken (handler LoginTokenHandler ) {
u .state .set (UpdateLoginTokenTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateLoginToken ))
})
}
type MessagePollVoteHandler func (ctx context .Context , e Entities , update *UpdateMessagePollVote ) error
func (u UpdateDispatcher ) OnMessagePollVote (handler MessagePollVoteHandler ) {
u .state .set (UpdateMessagePollVoteTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateMessagePollVote ))
})
}
type DialogFilterHandler func (ctx context .Context , e Entities , update *UpdateDialogFilter ) error
func (u UpdateDispatcher ) OnDialogFilter (handler DialogFilterHandler ) {
u .state .set (UpdateDialogFilterTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDialogFilter ))
})
}
type DialogFilterOrderHandler func (ctx context .Context , e Entities , update *UpdateDialogFilterOrder ) error
func (u UpdateDispatcher ) OnDialogFilterOrder (handler DialogFilterOrderHandler ) {
u .state .set (UpdateDialogFilterOrderTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDialogFilterOrder ))
})
}
type DialogFiltersHandler func (ctx context .Context , e Entities , update *UpdateDialogFilters ) error
func (u UpdateDispatcher ) OnDialogFilters (handler DialogFiltersHandler ) {
u .state .set (UpdateDialogFiltersTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDialogFilters ))
})
}
type PhoneCallSignalingDataHandler func (ctx context .Context , e Entities , update *UpdatePhoneCallSignalingData ) error
func (u UpdateDispatcher ) OnPhoneCallSignalingData (handler PhoneCallSignalingDataHandler ) {
u .state .set (UpdatePhoneCallSignalingDataTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePhoneCallSignalingData ))
})
}
type ChannelMessageForwardsHandler func (ctx context .Context , e Entities , update *UpdateChannelMessageForwards ) error
func (u UpdateDispatcher ) OnChannelMessageForwards (handler ChannelMessageForwardsHandler ) {
u .state .set (UpdateChannelMessageForwardsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChannelMessageForwards ))
})
}
type ReadChannelDiscussionInboxHandler func (ctx context .Context , e Entities , update *UpdateReadChannelDiscussionInbox ) error
func (u UpdateDispatcher ) OnReadChannelDiscussionInbox (handler ReadChannelDiscussionInboxHandler ) {
u .state .set (UpdateReadChannelDiscussionInboxTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadChannelDiscussionInbox ))
})
}
type ReadChannelDiscussionOutboxHandler func (ctx context .Context , e Entities , update *UpdateReadChannelDiscussionOutbox ) error
func (u UpdateDispatcher ) OnReadChannelDiscussionOutbox (handler ReadChannelDiscussionOutboxHandler ) {
u .state .set (UpdateReadChannelDiscussionOutboxTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadChannelDiscussionOutbox ))
})
}
type PeerBlockedHandler func (ctx context .Context , e Entities , update *UpdatePeerBlocked ) error
func (u UpdateDispatcher ) OnPeerBlocked (handler PeerBlockedHandler ) {
u .state .set (UpdatePeerBlockedTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePeerBlocked ))
})
}
type ChannelUserTypingHandler func (ctx context .Context , e Entities , update *UpdateChannelUserTyping ) error
func (u UpdateDispatcher ) OnChannelUserTyping (handler ChannelUserTypingHandler ) {
u .state .set (UpdateChannelUserTypingTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChannelUserTyping ))
})
}
type PinnedMessagesHandler func (ctx context .Context , e Entities , update *UpdatePinnedMessages ) error
func (u UpdateDispatcher ) OnPinnedMessages (handler PinnedMessagesHandler ) {
u .state .set (UpdatePinnedMessagesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePinnedMessages ))
})
}
type PinnedChannelMessagesHandler func (ctx context .Context , e Entities , update *UpdatePinnedChannelMessages ) error
func (u UpdateDispatcher ) OnPinnedChannelMessages (handler PinnedChannelMessagesHandler ) {
u .state .set (UpdatePinnedChannelMessagesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePinnedChannelMessages ))
})
}
type ChatHandler func (ctx context .Context , e Entities , update *UpdateChat ) error
func (u UpdateDispatcher ) OnChat (handler ChatHandler ) {
u .state .set (UpdateChatTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChat ))
})
}
type GroupCallParticipantsHandler func (ctx context .Context , e Entities , update *UpdateGroupCallParticipants ) error
func (u UpdateDispatcher ) OnGroupCallParticipants (handler GroupCallParticipantsHandler ) {
u .state .set (UpdateGroupCallParticipantsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateGroupCallParticipants ))
})
}
type GroupCallHandler func (ctx context .Context , e Entities , update *UpdateGroupCall ) error
func (u UpdateDispatcher ) OnGroupCall (handler GroupCallHandler ) {
u .state .set (UpdateGroupCallTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateGroupCall ))
})
}
type PeerHistoryTTLHandler func (ctx context .Context , e Entities , update *UpdatePeerHistoryTTL ) error
func (u UpdateDispatcher ) OnPeerHistoryTTL (handler PeerHistoryTTLHandler ) {
u .state .set (UpdatePeerHistoryTTLTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePeerHistoryTTL ))
})
}
type ChatParticipantHandler func (ctx context .Context , e Entities , update *UpdateChatParticipant ) error
func (u UpdateDispatcher ) OnChatParticipant (handler ChatParticipantHandler ) {
u .state .set (UpdateChatParticipantTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChatParticipant ))
})
}
type ChannelParticipantHandler func (ctx context .Context , e Entities , update *UpdateChannelParticipant ) error
func (u UpdateDispatcher ) OnChannelParticipant (handler ChannelParticipantHandler ) {
u .state .set (UpdateChannelParticipantTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChannelParticipant ))
})
}
type BotStoppedHandler func (ctx context .Context , e Entities , update *UpdateBotStopped ) error
func (u UpdateDispatcher ) OnBotStopped (handler BotStoppedHandler ) {
u .state .set (UpdateBotStoppedTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotStopped ))
})
}
type GroupCallConnectionHandler func (ctx context .Context , e Entities , update *UpdateGroupCallConnection ) error
func (u UpdateDispatcher ) OnGroupCallConnection (handler GroupCallConnectionHandler ) {
u .state .set (UpdateGroupCallConnectionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateGroupCallConnection ))
})
}
type BotCommandsHandler func (ctx context .Context , e Entities , update *UpdateBotCommands ) error
func (u UpdateDispatcher ) OnBotCommands (handler BotCommandsHandler ) {
u .state .set (UpdateBotCommandsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotCommands ))
})
}
type PendingJoinRequestsHandler func (ctx context .Context , e Entities , update *UpdatePendingJoinRequests ) error
func (u UpdateDispatcher ) OnPendingJoinRequests (handler PendingJoinRequestsHandler ) {
u .state .set (UpdatePendingJoinRequestsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePendingJoinRequests ))
})
}
type BotChatInviteRequesterHandler func (ctx context .Context , e Entities , update *UpdateBotChatInviteRequester ) error
func (u UpdateDispatcher ) OnBotChatInviteRequester (handler BotChatInviteRequesterHandler ) {
u .state .set (UpdateBotChatInviteRequesterTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotChatInviteRequester ))
})
}
type MessageReactionsHandler func (ctx context .Context , e Entities , update *UpdateMessageReactions ) error
func (u UpdateDispatcher ) OnMessageReactions (handler MessageReactionsHandler ) {
u .state .set (UpdateMessageReactionsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateMessageReactions ))
})
}
type AttachMenuBotsHandler func (ctx context .Context , e Entities , update *UpdateAttachMenuBots ) error
func (u UpdateDispatcher ) OnAttachMenuBots (handler AttachMenuBotsHandler ) {
u .state .set (UpdateAttachMenuBotsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateAttachMenuBots ))
})
}
type WebViewResultSentHandler func (ctx context .Context , e Entities , update *UpdateWebViewResultSent ) error
func (u UpdateDispatcher ) OnWebViewResultSent (handler WebViewResultSentHandler ) {
u .state .set (UpdateWebViewResultSentTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateWebViewResultSent ))
})
}
type BotMenuButtonHandler func (ctx context .Context , e Entities , update *UpdateBotMenuButton ) error
func (u UpdateDispatcher ) OnBotMenuButton (handler BotMenuButtonHandler ) {
u .state .set (UpdateBotMenuButtonTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotMenuButton ))
})
}
type SavedRingtonesHandler func (ctx context .Context , e Entities , update *UpdateSavedRingtones ) error
func (u UpdateDispatcher ) OnSavedRingtones (handler SavedRingtonesHandler ) {
u .state .set (UpdateSavedRingtonesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateSavedRingtones ))
})
}
type TranscribedAudioHandler func (ctx context .Context , e Entities , update *UpdateTranscribedAudio ) error
func (u UpdateDispatcher ) OnTranscribedAudio (handler TranscribedAudioHandler ) {
u .state .set (UpdateTranscribedAudioTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateTranscribedAudio ))
})
}
type ReadFeaturedEmojiStickersHandler func (ctx context .Context , e Entities , update *UpdateReadFeaturedEmojiStickers ) error
func (u UpdateDispatcher ) OnReadFeaturedEmojiStickers (handler ReadFeaturedEmojiStickersHandler ) {
u .state .set (UpdateReadFeaturedEmojiStickersTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadFeaturedEmojiStickers ))
})
}
type UserEmojiStatusHandler func (ctx context .Context , e Entities , update *UpdateUserEmojiStatus ) error
func (u UpdateDispatcher ) OnUserEmojiStatus (handler UserEmojiStatusHandler ) {
u .state .set (UpdateUserEmojiStatusTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateUserEmojiStatus ))
})
}
type RecentEmojiStatusesHandler func (ctx context .Context , e Entities , update *UpdateRecentEmojiStatuses ) error
func (u UpdateDispatcher ) OnRecentEmojiStatuses (handler RecentEmojiStatusesHandler ) {
u .state .set (UpdateRecentEmojiStatusesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateRecentEmojiStatuses ))
})
}
type RecentReactionsHandler func (ctx context .Context , e Entities , update *UpdateRecentReactions ) error
func (u UpdateDispatcher ) OnRecentReactions (handler RecentReactionsHandler ) {
u .state .set (UpdateRecentReactionsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateRecentReactions ))
})
}
type MoveStickerSetToTopHandler func (ctx context .Context , e Entities , update *UpdateMoveStickerSetToTop ) error
func (u UpdateDispatcher ) OnMoveStickerSetToTop (handler MoveStickerSetToTopHandler ) {
u .state .set (UpdateMoveStickerSetToTopTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateMoveStickerSetToTop ))
})
}
type MessageExtendedMediaHandler func (ctx context .Context , e Entities , update *UpdateMessageExtendedMedia ) error
func (u UpdateDispatcher ) OnMessageExtendedMedia (handler MessageExtendedMediaHandler ) {
u .state .set (UpdateMessageExtendedMediaTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateMessageExtendedMedia ))
})
}
type UserHandler func (ctx context .Context , e Entities , update *UpdateUser ) error
func (u UpdateDispatcher ) OnUser (handler UserHandler ) {
u .state .set (UpdateUserTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateUser ))
})
}
type AutoSaveSettingsHandler func (ctx context .Context , e Entities , update *UpdateAutoSaveSettings ) error
func (u UpdateDispatcher ) OnAutoSaveSettings (handler AutoSaveSettingsHandler ) {
u .state .set (UpdateAutoSaveSettingsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateAutoSaveSettings ))
})
}
type StoryHandler func (ctx context .Context , e Entities , update *UpdateStory ) error
func (u UpdateDispatcher ) OnStory (handler StoryHandler ) {
u .state .set (UpdateStoryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateStory ))
})
}
type ReadStoriesHandler func (ctx context .Context , e Entities , update *UpdateReadStories ) error
func (u UpdateDispatcher ) OnReadStories (handler ReadStoriesHandler ) {
u .state .set (UpdateReadStoriesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadStories ))
})
}
type StoryIDHandler func (ctx context .Context , e Entities , update *UpdateStoryID ) error
func (u UpdateDispatcher ) OnStoryID (handler StoryIDHandler ) {
u .state .set (UpdateStoryIDTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateStoryID ))
})
}
type StoriesStealthModeHandler func (ctx context .Context , e Entities , update *UpdateStoriesStealthMode ) error
func (u UpdateDispatcher ) OnStoriesStealthMode (handler StoriesStealthModeHandler ) {
u .state .set (UpdateStoriesStealthModeTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateStoriesStealthMode ))
})
}
type SentStoryReactionHandler func (ctx context .Context , e Entities , update *UpdateSentStoryReaction ) error
func (u UpdateDispatcher ) OnSentStoryReaction (handler SentStoryReactionHandler ) {
u .state .set (UpdateSentStoryReactionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateSentStoryReaction ))
})
}
type BotChatBoostHandler func (ctx context .Context , e Entities , update *UpdateBotChatBoost ) error
func (u UpdateDispatcher ) OnBotChatBoost (handler BotChatBoostHandler ) {
u .state .set (UpdateBotChatBoostTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotChatBoost ))
})
}
type ChannelViewForumAsMessagesHandler func (ctx context .Context , e Entities , update *UpdateChannelViewForumAsMessages ) error
func (u UpdateDispatcher ) OnChannelViewForumAsMessages (handler ChannelViewForumAsMessagesHandler ) {
u .state .set (UpdateChannelViewForumAsMessagesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChannelViewForumAsMessages ))
})
}
type PeerWallpaperHandler func (ctx context .Context , e Entities , update *UpdatePeerWallpaper ) error
func (u UpdateDispatcher ) OnPeerWallpaper (handler PeerWallpaperHandler ) {
u .state .set (UpdatePeerWallpaperTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePeerWallpaper ))
})
}
type BotMessageReactionHandler func (ctx context .Context , e Entities , update *UpdateBotMessageReaction ) error
func (u UpdateDispatcher ) OnBotMessageReaction (handler BotMessageReactionHandler ) {
u .state .set (UpdateBotMessageReactionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotMessageReaction ))
})
}
type BotMessageReactionsHandler func (ctx context .Context , e Entities , update *UpdateBotMessageReactions ) error
func (u UpdateDispatcher ) OnBotMessageReactions (handler BotMessageReactionsHandler ) {
u .state .set (UpdateBotMessageReactionsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotMessageReactions ))
})
}
type SavedDialogPinnedHandler func (ctx context .Context , e Entities , update *UpdateSavedDialogPinned ) error
func (u UpdateDispatcher ) OnSavedDialogPinned (handler SavedDialogPinnedHandler ) {
u .state .set (UpdateSavedDialogPinnedTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateSavedDialogPinned ))
})
}
type PinnedSavedDialogsHandler func (ctx context .Context , e Entities , update *UpdatePinnedSavedDialogs ) error
func (u UpdateDispatcher ) OnPinnedSavedDialogs (handler PinnedSavedDialogsHandler ) {
u .state .set (UpdatePinnedSavedDialogsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePinnedSavedDialogs ))
})
}
type SavedReactionTagsHandler func (ctx context .Context , e Entities , update *UpdateSavedReactionTags ) error
func (u UpdateDispatcher ) OnSavedReactionTags (handler SavedReactionTagsHandler ) {
u .state .set (UpdateSavedReactionTagsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateSavedReactionTags ))
})
}
type SMSJobHandler func (ctx context .Context , e Entities , update *UpdateSMSJob ) error
func (u UpdateDispatcher ) OnSMSJob (handler SMSJobHandler ) {
u .state .set (UpdateSMSJobTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateSMSJob ))
})
}
type QuickRepliesHandler func (ctx context .Context , e Entities , update *UpdateQuickReplies ) error
func (u UpdateDispatcher ) OnQuickReplies (handler QuickRepliesHandler ) {
u .state .set (UpdateQuickRepliesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateQuickReplies ))
})
}
type NewQuickReplyHandler func (ctx context .Context , e Entities , update *UpdateNewQuickReply ) error
func (u UpdateDispatcher ) OnNewQuickReply (handler NewQuickReplyHandler ) {
u .state .set (UpdateNewQuickReplyTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNewQuickReply ))
})
}
type DeleteQuickReplyHandler func (ctx context .Context , e Entities , update *UpdateDeleteQuickReply ) error
func (u UpdateDispatcher ) OnDeleteQuickReply (handler DeleteQuickReplyHandler ) {
u .state .set (UpdateDeleteQuickReplyTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDeleteQuickReply ))
})
}
type QuickReplyMessageHandler func (ctx context .Context , e Entities , update *UpdateQuickReplyMessage ) error
func (u UpdateDispatcher ) OnQuickReplyMessage (handler QuickReplyMessageHandler ) {
u .state .set (UpdateQuickReplyMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateQuickReplyMessage ))
})
}
type DeleteQuickReplyMessagesHandler func (ctx context .Context , e Entities , update *UpdateDeleteQuickReplyMessages ) error
func (u UpdateDispatcher ) OnDeleteQuickReplyMessages (handler DeleteQuickReplyMessagesHandler ) {
u .state .set (UpdateDeleteQuickReplyMessagesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDeleteQuickReplyMessages ))
})
}
type BotBusinessConnectHandler func (ctx context .Context , e Entities , update *UpdateBotBusinessConnect ) error
func (u UpdateDispatcher ) OnBotBusinessConnect (handler BotBusinessConnectHandler ) {
u .state .set (UpdateBotBusinessConnectTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotBusinessConnect ))
})
}
type BotNewBusinessMessageHandler func (ctx context .Context , e Entities , update *UpdateBotNewBusinessMessage ) error
func (u UpdateDispatcher ) OnBotNewBusinessMessage (handler BotNewBusinessMessageHandler ) {
u .state .set (UpdateBotNewBusinessMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotNewBusinessMessage ))
})
}
type BotEditBusinessMessageHandler func (ctx context .Context , e Entities , update *UpdateBotEditBusinessMessage ) error
func (u UpdateDispatcher ) OnBotEditBusinessMessage (handler BotEditBusinessMessageHandler ) {
u .state .set (UpdateBotEditBusinessMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotEditBusinessMessage ))
})
}
type BotDeleteBusinessMessageHandler func (ctx context .Context , e Entities , update *UpdateBotDeleteBusinessMessage ) error
func (u UpdateDispatcher ) OnBotDeleteBusinessMessage (handler BotDeleteBusinessMessageHandler ) {
u .state .set (UpdateBotDeleteBusinessMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotDeleteBusinessMessage ))
})
}
type NewStoryReactionHandler func (ctx context .Context , e Entities , update *UpdateNewStoryReaction ) error
func (u UpdateDispatcher ) OnNewStoryReaction (handler NewStoryReactionHandler ) {
u .state .set (UpdateNewStoryReactionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNewStoryReaction ))
})
}
type StarsBalanceHandler func (ctx context .Context , e Entities , update *UpdateStarsBalance ) error
func (u UpdateDispatcher ) OnStarsBalance (handler StarsBalanceHandler ) {
u .state .set (UpdateStarsBalanceTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateStarsBalance ))
})
}
type BusinessBotCallbackQueryHandler func (ctx context .Context , e Entities , update *UpdateBusinessBotCallbackQuery ) error
func (u UpdateDispatcher ) OnBusinessBotCallbackQuery (handler BusinessBotCallbackQueryHandler ) {
u .state .set (UpdateBusinessBotCallbackQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBusinessBotCallbackQuery ))
})
}
type StarsRevenueStatusHandler func (ctx context .Context , e Entities , update *UpdateStarsRevenueStatus ) error
func (u UpdateDispatcher ) OnStarsRevenueStatus (handler StarsRevenueStatusHandler ) {
u .state .set (UpdateStarsRevenueStatusTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateStarsRevenueStatus ))
})
}
type BotPurchasedPaidMediaHandler func (ctx context .Context , e Entities , update *UpdateBotPurchasedPaidMedia ) error
func (u UpdateDispatcher ) OnBotPurchasedPaidMedia (handler BotPurchasedPaidMediaHandler ) {
u .state .set (UpdateBotPurchasedPaidMediaTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotPurchasedPaidMedia ))
})
}
type PaidReactionPrivacyHandler func (ctx context .Context , e Entities , update *UpdatePaidReactionPrivacy ) error
func (u UpdateDispatcher ) OnPaidReactionPrivacy (handler PaidReactionPrivacyHandler ) {
u .state .set (UpdatePaidReactionPrivacyTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePaidReactionPrivacy ))
})
}
type SentPhoneCodeHandler func (ctx context .Context , e Entities , update *UpdateSentPhoneCode ) error
func (u UpdateDispatcher ) OnSentPhoneCode (handler SentPhoneCodeHandler ) {
u .state .set (UpdateSentPhoneCodeTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateSentPhoneCode ))
})
}
type GroupCallChainBlocksHandler func (ctx context .Context , e Entities , update *UpdateGroupCallChainBlocks ) error
func (u UpdateDispatcher ) OnGroupCallChainBlocks (handler GroupCallChainBlocksHandler ) {
u .state .set (UpdateGroupCallChainBlocksTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateGroupCallChainBlocks ))
})
}
type ReadMonoForumInboxHandler func (ctx context .Context , e Entities , update *UpdateReadMonoForumInbox ) error
func (u UpdateDispatcher ) OnReadMonoForumInbox (handler ReadMonoForumInboxHandler ) {
u .state .set (UpdateReadMonoForumInboxTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadMonoForumInbox ))
})
}
type ReadMonoForumOutboxHandler func (ctx context .Context , e Entities , update *UpdateReadMonoForumOutbox ) error
func (u UpdateDispatcher ) OnReadMonoForumOutbox (handler ReadMonoForumOutboxHandler ) {
u .state .set (UpdateReadMonoForumOutboxTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateReadMonoForumOutbox ))
})
}
type MonoForumNoPaidExceptionHandler func (ctx context .Context , e Entities , update *UpdateMonoForumNoPaidException ) error
func (u UpdateDispatcher ) OnMonoForumNoPaidException (handler MonoForumNoPaidExceptionHandler ) {
u .state .set (UpdateMonoForumNoPaidExceptionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateMonoForumNoPaidException ))
})
}
type GroupCallMessageHandler func (ctx context .Context , e Entities , update *UpdateGroupCallMessage ) error
func (u UpdateDispatcher ) OnGroupCallMessage (handler GroupCallMessageHandler ) {
u .state .set (UpdateGroupCallMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateGroupCallMessage ))
})
}
type GroupCallEncryptedMessageHandler func (ctx context .Context , e Entities , update *UpdateGroupCallEncryptedMessage ) error
func (u UpdateDispatcher ) OnGroupCallEncryptedMessage (handler GroupCallEncryptedMessageHandler ) {
u .state .set (UpdateGroupCallEncryptedMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateGroupCallEncryptedMessage ))
})
}
type PinnedForumTopicHandler func (ctx context .Context , e Entities , update *UpdatePinnedForumTopic ) error
func (u UpdateDispatcher ) OnPinnedForumTopic (handler PinnedForumTopicHandler ) {
u .state .set (UpdatePinnedForumTopicTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePinnedForumTopic ))
})
}
type PinnedForumTopicsHandler func (ctx context .Context , e Entities , update *UpdatePinnedForumTopics ) error
func (u UpdateDispatcher ) OnPinnedForumTopics (handler PinnedForumTopicsHandler ) {
u .state .set (UpdatePinnedForumTopicsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdatePinnedForumTopics ))
})
}
type DeleteGroupCallMessagesHandler func (ctx context .Context , e Entities , update *UpdateDeleteGroupCallMessages ) error
func (u UpdateDispatcher ) OnDeleteGroupCallMessages (handler DeleteGroupCallMessagesHandler ) {
u .state .set (UpdateDeleteGroupCallMessagesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDeleteGroupCallMessages ))
})
}
type StarGiftAuctionStateHandler func (ctx context .Context , e Entities , update *UpdateStarGiftAuctionState ) error
func (u UpdateDispatcher ) OnStarGiftAuctionState (handler StarGiftAuctionStateHandler ) {
u .state .set (UpdateStarGiftAuctionStateTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateStarGiftAuctionState ))
})
}
type StarGiftAuctionUserStateHandler func (ctx context .Context , e Entities , update *UpdateStarGiftAuctionUserState ) error
func (u UpdateDispatcher ) OnStarGiftAuctionUserState (handler StarGiftAuctionUserStateHandler ) {
u .state .set (UpdateStarGiftAuctionUserStateTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateStarGiftAuctionUserState ))
})
}
type EmojiGameInfoHandler func (ctx context .Context , e Entities , update *UpdateEmojiGameInfo ) error
func (u UpdateDispatcher ) OnEmojiGameInfo (handler EmojiGameInfoHandler ) {
u .state .set (UpdateEmojiGameInfoTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateEmojiGameInfo ))
})
}
type StarGiftCraftFailHandler func (ctx context .Context , e Entities , update *UpdateStarGiftCraftFail ) error
func (u UpdateDispatcher ) OnStarGiftCraftFail (handler StarGiftCraftFailHandler ) {
u .state .set (UpdateStarGiftCraftFailTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateStarGiftCraftFail ))
})
}
type ChatParticipantRankHandler func (ctx context .Context , e Entities , update *UpdateChatParticipantRank ) error
func (u UpdateDispatcher ) OnChatParticipantRank (handler ChatParticipantRankHandler ) {
u .state .set (UpdateChatParticipantRankTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateChatParticipantRank ))
})
}
type ManagedBotHandler func (ctx context .Context , e Entities , update *UpdateManagedBot ) error
func (u UpdateDispatcher ) OnManagedBot (handler ManagedBotHandler ) {
u .state .set (UpdateManagedBotTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateManagedBot ))
})
}
type BotGuestChatQueryHandler func (ctx context .Context , e Entities , update *UpdateBotGuestChatQuery ) error
func (u UpdateDispatcher ) OnBotGuestChatQuery (handler BotGuestChatQueryHandler ) {
u .state .set (UpdateBotGuestChatQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotGuestChatQuery ))
})
}
type AiComposeTonesHandler func (ctx context .Context , e Entities , update *UpdateAiComposeTones ) error
func (u UpdateDispatcher ) OnAiComposeTones (handler AiComposeTonesHandler ) {
u .state .set (UpdateAiComposeTonesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateAiComposeTones ))
})
}
type JoinChatWebViewDecisionHandler func (ctx context .Context , e Entities , update *UpdateJoinChatWebViewDecision ) error
func (u UpdateDispatcher ) OnJoinChatWebViewDecision (handler JoinChatWebViewDecisionHandler ) {
u .state .set (UpdateJoinChatWebViewDecisionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateJoinChatWebViewDecision ))
})
}
type NewBotConnectionHandler func (ctx context .Context , e Entities , update *UpdateNewBotConnection ) error
func (u UpdateDispatcher ) OnNewBotConnection (handler NewBotConnectionHandler ) {
u .state .set (UpdateNewBotConnectionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNewBotConnection ))
})
}
type WebBrowserSettingsHandler func (ctx context .Context , e Entities , update *UpdateWebBrowserSettings ) error
func (u UpdateDispatcher ) OnWebBrowserSettings (handler WebBrowserSettingsHandler ) {
u .state .set (UpdateWebBrowserSettingsTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateWebBrowserSettings ))
})
}
type WebBrowserExceptionHandler func (ctx context .Context , e Entities , update *UpdateWebBrowserException ) error
func (u UpdateDispatcher ) OnWebBrowserException (handler WebBrowserExceptionHandler ) {
u .state .set (UpdateWebBrowserExceptionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateWebBrowserException ))
})
}
type NewEphemeralMessageHandler func (ctx context .Context , e Entities , update *UpdateNewEphemeralMessage ) error
func (u UpdateDispatcher ) OnNewEphemeralMessage (handler NewEphemeralMessageHandler ) {
u .state .set (UpdateNewEphemeralMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateNewEphemeralMessage ))
})
}
type DeleteEphemeralMessagesHandler func (ctx context .Context , e Entities , update *UpdateDeleteEphemeralMessages ) error
func (u UpdateDispatcher ) OnDeleteEphemeralMessages (handler DeleteEphemeralMessagesHandler ) {
u .state .set (UpdateDeleteEphemeralMessagesTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateDeleteEphemeralMessages ))
})
}
type EditEphemeralMessageHandler func (ctx context .Context , e Entities , update *UpdateEditEphemeralMessage ) error
func (u UpdateDispatcher ) OnEditEphemeralMessage (handler EditEphemeralMessageHandler ) {
u .state .set (UpdateEditEphemeralMessageTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateEditEphemeralMessage ))
})
}
type EphemeralBotCallbackQueryHandler func (ctx context .Context , e Entities , update *UpdateEphemeralBotCallbackQuery ) error
func (u UpdateDispatcher ) OnEphemeralBotCallbackQuery (handler EphemeralBotCallbackQueryHandler ) {
u .state .set (UpdateEphemeralBotCallbackQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateEphemeralBotCallbackQuery ))
})
}
type BotStarsSubscriptionHandler func (ctx context .Context , e Entities , update *UpdateBotStarsSubscription ) error
func (u UpdateDispatcher ) OnBotStarsSubscription (handler BotStarsSubscriptionHandler ) {
u .state .set (UpdateBotStarsSubscriptionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotStarsSubscription ))
})
}
type WalletStateHandler func (ctx context .Context , e Entities , update *UpdateWalletState ) error
func (u UpdateDispatcher ) OnWalletState (handler WalletStateHandler ) {
u .state .set (UpdateWalletStateTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateWalletState ))
})
}
type SentWalletTransactionHandler func (ctx context .Context , e Entities , update *UpdateSentWalletTransaction ) error
func (u UpdateDispatcher ) OnSentWalletTransaction (handler SentWalletTransactionHandler ) {
u .state .set (UpdateSentWalletTransactionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateSentWalletTransaction ))
})
}
type WalletGaslessInfoHandler func (ctx context .Context , e Entities , update *UpdateWalletGaslessInfo ) error
func (u UpdateDispatcher ) OnWalletGaslessInfo (handler WalletGaslessInfoHandler ) {
u .state .set (UpdateWalletGaslessInfoTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateWalletGaslessInfo ))
})
}
type WalletTonConnectSessionHandler func (ctx context .Context , e Entities , update *UpdateWalletTonConnectSession ) error
func (u UpdateDispatcher ) OnWalletTonConnectSession (handler WalletTonConnectSessionHandler ) {
u .state .set (UpdateWalletTonConnectSessionTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateWalletTonConnectSession ))
})
}
type WalletTonConnectPendingDisconnectHandler func (ctx context .Context , e Entities , update *UpdateWalletTonConnectPendingDisconnect ) error
func (u UpdateDispatcher ) OnWalletTonConnectPendingDisconnect (handler WalletTonConnectPendingDisconnectHandler ) {
u .state .set (UpdateWalletTonConnectPendingDisconnectTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateWalletTonConnectPendingDisconnect ))
})
}
type EditForumTopicHandler func (ctx context .Context , e Entities , update *UpdateEditForumTopic ) error
func (u UpdateDispatcher ) OnEditForumTopic (handler EditForumTopicHandler ) {
u .state .set (UpdateEditForumTopicTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateEditForumTopic ))
})
}
type BotWidgetQueryHandler func (ctx context .Context , e Entities , update *UpdateBotWidgetQuery ) error
func (u UpdateDispatcher ) OnBotWidgetQuery (handler BotWidgetQueryHandler ) {
u .state .set (UpdateBotWidgetQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotWidgetQuery ))
})
}
type InlineBotWidgetQueryHandler func (ctx context .Context , e Entities , update *UpdateInlineBotWidgetQuery ) error
func (u UpdateDispatcher ) OnInlineBotWidgetQuery (handler InlineBotWidgetQueryHandler ) {
u .state .set (UpdateInlineBotWidgetQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateInlineBotWidgetQuery ))
})
}
type BotWidgetCopyQueryHandler func (ctx context .Context , e Entities , update *UpdateBotWidgetCopyQuery ) error
func (u UpdateDispatcher ) OnBotWidgetCopyQuery (handler BotWidgetCopyQueryHandler ) {
u .state .set (UpdateBotWidgetCopyQueryTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateBotWidgetCopyQuery ))
})
}
type MessageWidgetDataHandler func (ctx context .Context , e Entities , update *UpdateMessageWidgetData ) error
func (u UpdateDispatcher ) OnMessageWidgetData (handler MessageWidgetDataHandler ) {
u .state .set (UpdateMessageWidgetDataTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateMessageWidgetData ))
})
}
type TranscribedAudioFileHandler func (ctx context .Context , e Entities , update *UpdateTranscribedAudioFile ) error
func (u UpdateDispatcher ) OnTranscribedAudioFile (handler TranscribedAudioFileHandler ) {
u .state .set (UpdateTranscribedAudioFileTypeID , func (ctx context .Context , e Entities , update UpdateClass ) error {
return handler (ctx , e , update .(*UpdateTranscribedAudioFile ))
})
}
func (u UpdateDispatcher ) OnFallback (handler Handler ) {
u .state .setFallback (handler )
}
The pages are generated with Golds v0.8.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .