// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	

	
)

// No-op definition for keeping imports.
var (
	_ = context.Background()
	_ = multierr.AppendInto
	_ = sync.Mutex{}
)

type Handler = func(context.Context, Entities, UpdateClass) error

// UpdateDispatcher dispatches updates to registered handlers.
//
// Copies of UpdateDispatcher share registered handlers, so it is safe to
// pass it by value and to register handlers (including fallback) after the
// copy was made or while updates are dispatched.
//
// Use NewUpdateDispatcher to create UpdateDispatcher; zero value is not usable.
type UpdateDispatcher struct {
	state *dispatcherState
}

// NewUpdateDispatcher creates new UpdateDispatcher.
func () UpdateDispatcher {
	return UpdateDispatcher{
		state: newDispatcherState(),
	}
}

// BeforeHandler is called for every dispatched update before its handler,
// including updates without handler, e.g. for metrics, tracing or filtering.
//
// A non-nil error skips the update's handler and is returned by Handle,
// joined with errors of other updates of the same batch.
type BeforeHandler func(ctx context.Context, e Entities, update UpdateClass) error

// OnBefore sets hook called for every dispatched update before its handler.
func ( UpdateDispatcher) ( BeforeHandler) {
	.state.setBefore()
}

// dispatcherState is shared by all copies of UpdateDispatcher.
//
// UpdateDispatcher is commonly passed by value (e.g. as telegram.UpdateHandler),
// so every registration must be visible through every copy, and handlers can
// be registered while updates are being dispatched.
type dispatcherState struct {
	mux      sync.RWMutex
	handlers map[uint32]Handler
	fallback Handler
	before   BeforeHandler
}

func () *dispatcherState {
	return &dispatcherState{
		handlers: map[uint32]Handler{},
	}
}

func ( *dispatcherState) ( uint32,  Handler) {
	.mux.Lock()
	defer .mux.Unlock()
	.handlers[] = 
}

func ( *dispatcherState) ( Handler) {
	.mux.Lock()
	defer .mux.Unlock()
	.fallback = 
}

func ( *dispatcherState) ( BeforeHandler) {
	.mux.Lock()
	defer .mux.Unlock()
	.before = 
}

// handler returns before hook (or nil) and handler for given type ID, or
// fallback handler, or nil.
//
// A nil state (zero UpdateDispatcher value) has no handlers.
func ( *dispatcherState) ( uint32) (BeforeHandler, Handler) {
	if  == nil {
		return nil, nil
	}
	.mux.RLock()
	defer .mux.RUnlock()
	if ,  := .handlers[];  {
		return .before, 
	}
	return .before, .fallback
}

type Entities struct {
	Short    bool
	Users    map[int64]*User
	Chats    map[int64]*Chat
	Channels map[int64]*Channel
}

// EntitiesFrom creates Entities from users and chats, e.g. from fields
// of Updates, UpdatesDifference or MessagesMessages.
func ( []UserClass,  []ChatClass) Entities {
	 := ChatClassArray()
	return Entities{
		Users:    UserClassArray().NotEmptyToMap(),
		Chats:    .ChatToMap(),
		Channels: .ChannelToMap(),
	}
}

// EntitiesResult is a result that contains users and chats, like Updates,
// UpdatesDifference, MessagesMessages or MessagesDialogs.
type EntitiesResult interface {
	MapUsers() UserClassArray
	MapChats() ChatClassArray
}

// EntitiesFromResult creates Entities from users and chats of result.
func ( EntitiesResult) Entities {
	 := .MapChats()
	return Entities{
		Users:    .MapUsers().NotEmptyToMap(),
		Chats:    .ChatToMap(),
		Channels: .ChannelToMap(),
	}
}

func ( *Entities) () {
	.Short = true
	.Users = make(map[int64]*User, 0)
	.Chats = make(map[int64]*Chat, 0)
	.Channels = make(map[int64]*Channel, 0)
}

// Handle implements UpdateDispatcher.
func ( UpdateDispatcher) ( context.Context,  UpdatesClass) error {
	var (
		    Entities
		 []UpdateClass
	)
	switch u := .(type) {
	case *Updates:
		 = .Updates
		 = EntitiesFromResult()
	case *UpdatesCombined:
		 = .Updates
		 = EntitiesFromResult()
	case *UpdateShort:
		 = []UpdateClass{.Update}
		.short()
	default:
		// *UpdateShortMessage
		// *UpdateShortChatMessage
		// *UpdateShortSentMessage
		// *UpdatesTooLong
		return nil
	}

	var  error
	for ,  := range  {
		multierr.AppendInto(&, .dispatch(, , ))
	}
	return 
}

func ( UpdateDispatcher) ( context.Context,  Entities,  UpdateClass) error {
	if  == nil {
		return nil
	}
	,  := .state.handler(.TypeID())
	if  != nil {
		if  := (, , );  != nil {
			return 
		}
	}
	if  == nil {
		return nil
	}
	return (, , )
}

// NewMessageHandler is a NewMessage event handler.
type NewMessageHandler func(ctx context.Context, e Entities, update *UpdateNewMessage) error

// OnNewMessage sets NewMessage handler.
func ( UpdateDispatcher) ( NewMessageHandler) {
	.state.set(UpdateNewMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNewMessage))
	})
}

// MessageIDHandler is a MessageID event handler.
type MessageIDHandler func(ctx context.Context, e Entities, update *UpdateMessageID) error

// OnMessageID sets MessageID handler.
func ( UpdateDispatcher) ( MessageIDHandler) {
	.state.set(UpdateMessageIDTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateMessageID))
	})
}

// DeleteMessagesHandler is a DeleteMessages event handler.
type DeleteMessagesHandler func(ctx context.Context, e Entities, update *UpdateDeleteMessages) error

// OnDeleteMessages sets DeleteMessages handler.
func ( UpdateDispatcher) ( DeleteMessagesHandler) {
	.state.set(UpdateDeleteMessagesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDeleteMessages))
	})
}

// UserTypingHandler is a UserTyping event handler.
type UserTypingHandler func(ctx context.Context, e Entities, update *UpdateUserTyping) error

// OnUserTyping sets UserTyping handler.
func ( UpdateDispatcher) ( UserTypingHandler) {
	.state.set(UpdateUserTypingTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateUserTyping))
	})
}

// ChatUserTypingHandler is a ChatUserTyping event handler.
type ChatUserTypingHandler func(ctx context.Context, e Entities, update *UpdateChatUserTyping) error

// OnChatUserTyping sets ChatUserTyping handler.
func ( UpdateDispatcher) ( ChatUserTypingHandler) {
	.state.set(UpdateChatUserTypingTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChatUserTyping))
	})
}

// ChatParticipantsHandler is a ChatParticipants event handler.
type ChatParticipantsHandler func(ctx context.Context, e Entities, update *UpdateChatParticipants) error

// OnChatParticipants sets ChatParticipants handler.
func ( UpdateDispatcher) ( ChatParticipantsHandler) {
	.state.set(UpdateChatParticipantsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChatParticipants))
	})
}

// UserStatusHandler is a UserStatus event handler.
type UserStatusHandler func(ctx context.Context, e Entities, update *UpdateUserStatus) error

// OnUserStatus sets UserStatus handler.
func ( UpdateDispatcher) ( UserStatusHandler) {
	.state.set(UpdateUserStatusTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateUserStatus))
	})
}

// UserNameHandler is a UserName event handler.
type UserNameHandler func(ctx context.Context, e Entities, update *UpdateUserName) error

// OnUserName sets UserName handler.
func ( UpdateDispatcher) ( UserNameHandler) {
	.state.set(UpdateUserNameTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateUserName))
	})
}

// NewAuthorizationHandler is a NewAuthorization event handler.
type NewAuthorizationHandler func(ctx context.Context, e Entities, update *UpdateNewAuthorization) error

// OnNewAuthorization sets NewAuthorization handler.
func ( UpdateDispatcher) ( NewAuthorizationHandler) {
	.state.set(UpdateNewAuthorizationTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNewAuthorization))
	})
}

// NewEncryptedMessageHandler is a NewEncryptedMessage event handler.
type NewEncryptedMessageHandler func(ctx context.Context, e Entities, update *UpdateNewEncryptedMessage) error

// OnNewEncryptedMessage sets NewEncryptedMessage handler.
func ( UpdateDispatcher) ( NewEncryptedMessageHandler) {
	.state.set(UpdateNewEncryptedMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNewEncryptedMessage))
	})
}

// EncryptedChatTypingHandler is a EncryptedChatTyping event handler.
type EncryptedChatTypingHandler func(ctx context.Context, e Entities, update *UpdateEncryptedChatTyping) error

// OnEncryptedChatTyping sets EncryptedChatTyping handler.
func ( UpdateDispatcher) ( EncryptedChatTypingHandler) {
	.state.set(UpdateEncryptedChatTypingTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateEncryptedChatTyping))
	})
}

// EncryptionHandler is a Encryption event handler.
type EncryptionHandler func(ctx context.Context, e Entities, update *UpdateEncryption) error

// OnEncryption sets Encryption handler.
func ( UpdateDispatcher) ( EncryptionHandler) {
	.state.set(UpdateEncryptionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateEncryption))
	})
}

// EncryptedMessagesReadHandler is a EncryptedMessagesRead event handler.
type EncryptedMessagesReadHandler func(ctx context.Context, e Entities, update *UpdateEncryptedMessagesRead) error

// OnEncryptedMessagesRead sets EncryptedMessagesRead handler.
func ( UpdateDispatcher) ( EncryptedMessagesReadHandler) {
	.state.set(UpdateEncryptedMessagesReadTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateEncryptedMessagesRead))
	})
}

// ChatParticipantAddHandler is a ChatParticipantAdd event handler.
type ChatParticipantAddHandler func(ctx context.Context, e Entities, update *UpdateChatParticipantAdd) error

// OnChatParticipantAdd sets ChatParticipantAdd handler.
func ( UpdateDispatcher) ( ChatParticipantAddHandler) {
	.state.set(UpdateChatParticipantAddTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChatParticipantAdd))
	})
}

// ChatParticipantDeleteHandler is a ChatParticipantDelete event handler.
type ChatParticipantDeleteHandler func(ctx context.Context, e Entities, update *UpdateChatParticipantDelete) error

// OnChatParticipantDelete sets ChatParticipantDelete handler.
func ( UpdateDispatcher) ( ChatParticipantDeleteHandler) {
	.state.set(UpdateChatParticipantDeleteTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChatParticipantDelete))
	})
}

// DCOptionsHandler is a DCOptions event handler.
type DCOptionsHandler func(ctx context.Context, e Entities, update *UpdateDCOptions) error

// OnDCOptions sets DCOptions handler.
func ( UpdateDispatcher) ( DCOptionsHandler) {
	.state.set(UpdateDCOptionsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDCOptions))
	})
}

// NotifySettingsHandler is a NotifySettings event handler.
type NotifySettingsHandler func(ctx context.Context, e Entities, update *UpdateNotifySettings) error

// OnNotifySettings sets NotifySettings handler.
func ( UpdateDispatcher) ( NotifySettingsHandler) {
	.state.set(UpdateNotifySettingsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNotifySettings))
	})
}

// ServiceNotificationHandler is a ServiceNotification event handler.
type ServiceNotificationHandler func(ctx context.Context, e Entities, update *UpdateServiceNotification) error

// OnServiceNotification sets ServiceNotification handler.
func ( UpdateDispatcher) ( ServiceNotificationHandler) {
	.state.set(UpdateServiceNotificationTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateServiceNotification))
	})
}

// PrivacyHandler is a Privacy event handler.
type PrivacyHandler func(ctx context.Context, e Entities, update *UpdatePrivacy) error

// OnPrivacy sets Privacy handler.
func ( UpdateDispatcher) ( PrivacyHandler) {
	.state.set(UpdatePrivacyTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePrivacy))
	})
}

// UserPhoneHandler is a UserPhone event handler.
type UserPhoneHandler func(ctx context.Context, e Entities, update *UpdateUserPhone) error

// OnUserPhone sets UserPhone handler.
func ( UpdateDispatcher) ( UserPhoneHandler) {
	.state.set(UpdateUserPhoneTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateUserPhone))
	})
}

// ReadHistoryInboxHandler is a ReadHistoryInbox event handler.
type ReadHistoryInboxHandler func(ctx context.Context, e Entities, update *UpdateReadHistoryInbox) error

// OnReadHistoryInbox sets ReadHistoryInbox handler.
func ( UpdateDispatcher) ( ReadHistoryInboxHandler) {
	.state.set(UpdateReadHistoryInboxTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadHistoryInbox))
	})
}

// ReadHistoryOutboxHandler is a ReadHistoryOutbox event handler.
type ReadHistoryOutboxHandler func(ctx context.Context, e Entities, update *UpdateReadHistoryOutbox) error

// OnReadHistoryOutbox sets ReadHistoryOutbox handler.
func ( UpdateDispatcher) ( ReadHistoryOutboxHandler) {
	.state.set(UpdateReadHistoryOutboxTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadHistoryOutbox))
	})
}

// WebPageHandler is a WebPage event handler.
type WebPageHandler func(ctx context.Context, e Entities, update *UpdateWebPage) error

// OnWebPage sets WebPage handler.
func ( UpdateDispatcher) ( WebPageHandler) {
	.state.set(UpdateWebPageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateWebPage))
	})
}

// ReadMessagesContentsHandler is a ReadMessagesContents event handler.
type ReadMessagesContentsHandler func(ctx context.Context, e Entities, update *UpdateReadMessagesContents) error

// OnReadMessagesContents sets ReadMessagesContents handler.
func ( UpdateDispatcher) ( ReadMessagesContentsHandler) {
	.state.set(UpdateReadMessagesContentsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadMessagesContents))
	})
}

// ChannelTooLongHandler is a ChannelTooLong event handler.
type ChannelTooLongHandler func(ctx context.Context, e Entities, update *UpdateChannelTooLong) error

// OnChannelTooLong sets ChannelTooLong handler.
func ( UpdateDispatcher) ( ChannelTooLongHandler) {
	.state.set(UpdateChannelTooLongTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelTooLong))
	})
}

// ChannelHandler is a Channel event handler.
type ChannelHandler func(ctx context.Context, e Entities, update *UpdateChannel) error

// OnChannel sets Channel handler.
func ( UpdateDispatcher) ( ChannelHandler) {
	.state.set(UpdateChannelTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannel))
	})
}

// NewChannelMessageHandler is a NewChannelMessage event handler.
type NewChannelMessageHandler func(ctx context.Context, e Entities, update *UpdateNewChannelMessage) error

// OnNewChannelMessage sets NewChannelMessage handler.
func ( UpdateDispatcher) ( NewChannelMessageHandler) {
	.state.set(UpdateNewChannelMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNewChannelMessage))
	})
}

// ReadChannelInboxHandler is a ReadChannelInbox event handler.
type ReadChannelInboxHandler func(ctx context.Context, e Entities, update *UpdateReadChannelInbox) error

// OnReadChannelInbox sets ReadChannelInbox handler.
func ( UpdateDispatcher) ( ReadChannelInboxHandler) {
	.state.set(UpdateReadChannelInboxTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadChannelInbox))
	})
}

// DeleteChannelMessagesHandler is a DeleteChannelMessages event handler.
type DeleteChannelMessagesHandler func(ctx context.Context, e Entities, update *UpdateDeleteChannelMessages) error

// OnDeleteChannelMessages sets DeleteChannelMessages handler.
func ( UpdateDispatcher) ( DeleteChannelMessagesHandler) {
	.state.set(UpdateDeleteChannelMessagesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDeleteChannelMessages))
	})
}

// ChannelMessageViewsHandler is a ChannelMessageViews event handler.
type ChannelMessageViewsHandler func(ctx context.Context, e Entities, update *UpdateChannelMessageViews) error

// OnChannelMessageViews sets ChannelMessageViews handler.
func ( UpdateDispatcher) ( ChannelMessageViewsHandler) {
	.state.set(UpdateChannelMessageViewsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelMessageViews))
	})
}

// ChatParticipantAdminHandler is a ChatParticipantAdmin event handler.
type ChatParticipantAdminHandler func(ctx context.Context, e Entities, update *UpdateChatParticipantAdmin) error

// OnChatParticipantAdmin sets ChatParticipantAdmin handler.
func ( UpdateDispatcher) ( ChatParticipantAdminHandler) {
	.state.set(UpdateChatParticipantAdminTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChatParticipantAdmin))
	})
}

// NewStickerSetHandler is a NewStickerSet event handler.
type NewStickerSetHandler func(ctx context.Context, e Entities, update *UpdateNewStickerSet) error

// OnNewStickerSet sets NewStickerSet handler.
func ( UpdateDispatcher) ( NewStickerSetHandler) {
	.state.set(UpdateNewStickerSetTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNewStickerSet))
	})
}

// StickerSetsOrderHandler is a StickerSetsOrder event handler.
type StickerSetsOrderHandler func(ctx context.Context, e Entities, update *UpdateStickerSetsOrder) error

// OnStickerSetsOrder sets StickerSetsOrder handler.
func ( UpdateDispatcher) ( StickerSetsOrderHandler) {
	.state.set(UpdateStickerSetsOrderTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateStickerSetsOrder))
	})
}

// StickerSetsHandler is a StickerSets event handler.
type StickerSetsHandler func(ctx context.Context, e Entities, update *UpdateStickerSets) error

// OnStickerSets sets StickerSets handler.
func ( UpdateDispatcher) ( StickerSetsHandler) {
	.state.set(UpdateStickerSetsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateStickerSets))
	})
}

// SavedGifsHandler is a SavedGifs event handler.
type SavedGifsHandler func(ctx context.Context, e Entities, update *UpdateSavedGifs) error

// OnSavedGifs sets SavedGifs handler.
func ( UpdateDispatcher) ( SavedGifsHandler) {
	.state.set(UpdateSavedGifsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateSavedGifs))
	})
}

// BotInlineQueryHandler is a BotInlineQuery event handler.
type BotInlineQueryHandler func(ctx context.Context, e Entities, update *UpdateBotInlineQuery) error

// OnBotInlineQuery sets BotInlineQuery handler.
func ( UpdateDispatcher) ( BotInlineQueryHandler) {
	.state.set(UpdateBotInlineQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotInlineQuery))
	})
}

// BotInlineSendHandler is a BotInlineSend event handler.
type BotInlineSendHandler func(ctx context.Context, e Entities, update *UpdateBotInlineSend) error

// OnBotInlineSend sets BotInlineSend handler.
func ( UpdateDispatcher) ( BotInlineSendHandler) {
	.state.set(UpdateBotInlineSendTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotInlineSend))
	})
}

// EditChannelMessageHandler is a EditChannelMessage event handler.
type EditChannelMessageHandler func(ctx context.Context, e Entities, update *UpdateEditChannelMessage) error

// OnEditChannelMessage sets EditChannelMessage handler.
func ( UpdateDispatcher) ( EditChannelMessageHandler) {
	.state.set(UpdateEditChannelMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateEditChannelMessage))
	})
}

// BotCallbackQueryHandler is a BotCallbackQuery event handler.
type BotCallbackQueryHandler func(ctx context.Context, e Entities, update *UpdateBotCallbackQuery) error

// OnBotCallbackQuery sets BotCallbackQuery handler.
func ( UpdateDispatcher) ( BotCallbackQueryHandler) {
	.state.set(UpdateBotCallbackQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotCallbackQuery))
	})
}

// EditMessageHandler is a EditMessage event handler.
type EditMessageHandler func(ctx context.Context, e Entities, update *UpdateEditMessage) error

// OnEditMessage sets EditMessage handler.
func ( UpdateDispatcher) ( EditMessageHandler) {
	.state.set(UpdateEditMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateEditMessage))
	})
}

// InlineBotCallbackQueryHandler is a InlineBotCallbackQuery event handler.
type InlineBotCallbackQueryHandler func(ctx context.Context, e Entities, update *UpdateInlineBotCallbackQuery) error

// OnInlineBotCallbackQuery sets InlineBotCallbackQuery handler.
func ( UpdateDispatcher) ( InlineBotCallbackQueryHandler) {
	.state.set(UpdateInlineBotCallbackQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateInlineBotCallbackQuery))
	})
}

// ReadChannelOutboxHandler is a ReadChannelOutbox event handler.
type ReadChannelOutboxHandler func(ctx context.Context, e Entities, update *UpdateReadChannelOutbox) error

// OnReadChannelOutbox sets ReadChannelOutbox handler.
func ( UpdateDispatcher) ( ReadChannelOutboxHandler) {
	.state.set(UpdateReadChannelOutboxTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadChannelOutbox))
	})
}

// DraftMessageHandler is a DraftMessage event handler.
type DraftMessageHandler func(ctx context.Context, e Entities, update *UpdateDraftMessage) error

// OnDraftMessage sets DraftMessage handler.
func ( UpdateDispatcher) ( DraftMessageHandler) {
	.state.set(UpdateDraftMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDraftMessage))
	})
}

// ReadFeaturedStickersHandler is a ReadFeaturedStickers event handler.
type ReadFeaturedStickersHandler func(ctx context.Context, e Entities, update *UpdateReadFeaturedStickers) error

// OnReadFeaturedStickers sets ReadFeaturedStickers handler.
func ( UpdateDispatcher) ( ReadFeaturedStickersHandler) {
	.state.set(UpdateReadFeaturedStickersTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadFeaturedStickers))
	})
}

// RecentStickersHandler is a RecentStickers event handler.
type RecentStickersHandler func(ctx context.Context, e Entities, update *UpdateRecentStickers) error

// OnRecentStickers sets RecentStickers handler.
func ( UpdateDispatcher) ( RecentStickersHandler) {
	.state.set(UpdateRecentStickersTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateRecentStickers))
	})
}

// ConfigHandler is a Config event handler.
type ConfigHandler func(ctx context.Context, e Entities, update *UpdateConfig) error

// OnConfig sets Config handler.
func ( UpdateDispatcher) ( ConfigHandler) {
	.state.set(UpdateConfigTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateConfig))
	})
}

// PtsChangedHandler is a PtsChanged event handler.
type PtsChangedHandler func(ctx context.Context, e Entities, update *UpdatePtsChanged) error

// OnPtsChanged sets PtsChanged handler.
func ( UpdateDispatcher) ( PtsChangedHandler) {
	.state.set(UpdatePtsChangedTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePtsChanged))
	})
}

// ChannelWebPageHandler is a ChannelWebPage event handler.
type ChannelWebPageHandler func(ctx context.Context, e Entities, update *UpdateChannelWebPage) error

// OnChannelWebPage sets ChannelWebPage handler.
func ( UpdateDispatcher) ( ChannelWebPageHandler) {
	.state.set(UpdateChannelWebPageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelWebPage))
	})
}

// DialogPinnedHandler is a DialogPinned event handler.
type DialogPinnedHandler func(ctx context.Context, e Entities, update *UpdateDialogPinned) error

// OnDialogPinned sets DialogPinned handler.
func ( UpdateDispatcher) ( DialogPinnedHandler) {
	.state.set(UpdateDialogPinnedTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDialogPinned))
	})
}

// PinnedDialogsHandler is a PinnedDialogs event handler.
type PinnedDialogsHandler func(ctx context.Context, e Entities, update *UpdatePinnedDialogs) error

// OnPinnedDialogs sets PinnedDialogs handler.
func ( UpdateDispatcher) ( PinnedDialogsHandler) {
	.state.set(UpdatePinnedDialogsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePinnedDialogs))
	})
}

// BotWebhookJSONHandler is a BotWebhookJSON event handler.
type BotWebhookJSONHandler func(ctx context.Context, e Entities, update *UpdateBotWebhookJSON) error

// OnBotWebhookJSON sets BotWebhookJSON handler.
func ( UpdateDispatcher) ( BotWebhookJSONHandler) {
	.state.set(UpdateBotWebhookJSONTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotWebhookJSON))
	})
}

// BotWebhookJSONQueryHandler is a BotWebhookJSONQuery event handler.
type BotWebhookJSONQueryHandler func(ctx context.Context, e Entities, update *UpdateBotWebhookJSONQuery) error

// OnBotWebhookJSONQuery sets BotWebhookJSONQuery handler.
func ( UpdateDispatcher) ( BotWebhookJSONQueryHandler) {
	.state.set(UpdateBotWebhookJSONQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotWebhookJSONQuery))
	})
}

// BotShippingQueryHandler is a BotShippingQuery event handler.
type BotShippingQueryHandler func(ctx context.Context, e Entities, update *UpdateBotShippingQuery) error

// OnBotShippingQuery sets BotShippingQuery handler.
func ( UpdateDispatcher) ( BotShippingQueryHandler) {
	.state.set(UpdateBotShippingQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotShippingQuery))
	})
}

// BotPrecheckoutQueryHandler is a BotPrecheckoutQuery event handler.
type BotPrecheckoutQueryHandler func(ctx context.Context, e Entities, update *UpdateBotPrecheckoutQuery) error

// OnBotPrecheckoutQuery sets BotPrecheckoutQuery handler.
func ( UpdateDispatcher) ( BotPrecheckoutQueryHandler) {
	.state.set(UpdateBotPrecheckoutQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotPrecheckoutQuery))
	})
}

// PhoneCallHandler is a PhoneCall event handler.
type PhoneCallHandler func(ctx context.Context, e Entities, update *UpdatePhoneCall) error

// OnPhoneCall sets PhoneCall handler.
func ( UpdateDispatcher) ( PhoneCallHandler) {
	.state.set(UpdatePhoneCallTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePhoneCall))
	})
}

// LangPackTooLongHandler is a LangPackTooLong event handler.
type LangPackTooLongHandler func(ctx context.Context, e Entities, update *UpdateLangPackTooLong) error

// OnLangPackTooLong sets LangPackTooLong handler.
func ( UpdateDispatcher) ( LangPackTooLongHandler) {
	.state.set(UpdateLangPackTooLongTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateLangPackTooLong))
	})
}

// LangPackHandler is a LangPack event handler.
type LangPackHandler func(ctx context.Context, e Entities, update *UpdateLangPack) error

// OnLangPack sets LangPack handler.
func ( UpdateDispatcher) ( LangPackHandler) {
	.state.set(UpdateLangPackTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateLangPack))
	})
}

// FavedStickersHandler is a FavedStickers event handler.
type FavedStickersHandler func(ctx context.Context, e Entities, update *UpdateFavedStickers) error

// OnFavedStickers sets FavedStickers handler.
func ( UpdateDispatcher) ( FavedStickersHandler) {
	.state.set(UpdateFavedStickersTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateFavedStickers))
	})
}

// ChannelReadMessagesContentsHandler is a ChannelReadMessagesContents event handler.
type ChannelReadMessagesContentsHandler func(ctx context.Context, e Entities, update *UpdateChannelReadMessagesContents) error

// OnChannelReadMessagesContents sets ChannelReadMessagesContents handler.
func ( UpdateDispatcher) ( ChannelReadMessagesContentsHandler) {
	.state.set(UpdateChannelReadMessagesContentsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelReadMessagesContents))
	})
}

// ContactsResetHandler is a ContactsReset event handler.
type ContactsResetHandler func(ctx context.Context, e Entities, update *UpdateContactsReset) error

// OnContactsReset sets ContactsReset handler.
func ( UpdateDispatcher) ( ContactsResetHandler) {
	.state.set(UpdateContactsResetTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateContactsReset))
	})
}

// ChannelAvailableMessagesHandler is a ChannelAvailableMessages event handler.
type ChannelAvailableMessagesHandler func(ctx context.Context, e Entities, update *UpdateChannelAvailableMessages) error

// OnChannelAvailableMessages sets ChannelAvailableMessages handler.
func ( UpdateDispatcher) ( ChannelAvailableMessagesHandler) {
	.state.set(UpdateChannelAvailableMessagesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelAvailableMessages))
	})
}

// DialogUnreadMarkHandler is a DialogUnreadMark event handler.
type DialogUnreadMarkHandler func(ctx context.Context, e Entities, update *UpdateDialogUnreadMark) error

// OnDialogUnreadMark sets DialogUnreadMark handler.
func ( UpdateDispatcher) ( DialogUnreadMarkHandler) {
	.state.set(UpdateDialogUnreadMarkTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDialogUnreadMark))
	})
}

// MessagePollHandler is a MessagePoll event handler.
type MessagePollHandler func(ctx context.Context, e Entities, update *UpdateMessagePoll) error

// OnMessagePoll sets MessagePoll handler.
func ( UpdateDispatcher) ( MessagePollHandler) {
	.state.set(UpdateMessagePollTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateMessagePoll))
	})
}

// ChatDefaultBannedRightsHandler is a ChatDefaultBannedRights event handler.
type ChatDefaultBannedRightsHandler func(ctx context.Context, e Entities, update *UpdateChatDefaultBannedRights) error

// OnChatDefaultBannedRights sets ChatDefaultBannedRights handler.
func ( UpdateDispatcher) ( ChatDefaultBannedRightsHandler) {
	.state.set(UpdateChatDefaultBannedRightsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChatDefaultBannedRights))
	})
}

// FolderPeersHandler is a FolderPeers event handler.
type FolderPeersHandler func(ctx context.Context, e Entities, update *UpdateFolderPeers) error

// OnFolderPeers sets FolderPeers handler.
func ( UpdateDispatcher) ( FolderPeersHandler) {
	.state.set(UpdateFolderPeersTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateFolderPeers))
	})
}

// PeerSettingsHandler is a PeerSettings event handler.
type PeerSettingsHandler func(ctx context.Context, e Entities, update *UpdatePeerSettings) error

// OnPeerSettings sets PeerSettings handler.
func ( UpdateDispatcher) ( PeerSettingsHandler) {
	.state.set(UpdatePeerSettingsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePeerSettings))
	})
}

// PeerLocatedHandler is a PeerLocated event handler.
type PeerLocatedHandler func(ctx context.Context, e Entities, update *UpdatePeerLocated) error

// OnPeerLocated sets PeerLocated handler.
func ( UpdateDispatcher) ( PeerLocatedHandler) {
	.state.set(UpdatePeerLocatedTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePeerLocated))
	})
}

// NewScheduledMessageHandler is a NewScheduledMessage event handler.
type NewScheduledMessageHandler func(ctx context.Context, e Entities, update *UpdateNewScheduledMessage) error

// OnNewScheduledMessage sets NewScheduledMessage handler.
func ( UpdateDispatcher) ( NewScheduledMessageHandler) {
	.state.set(UpdateNewScheduledMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNewScheduledMessage))
	})
}

// DeleteScheduledMessagesHandler is a DeleteScheduledMessages event handler.
type DeleteScheduledMessagesHandler func(ctx context.Context, e Entities, update *UpdateDeleteScheduledMessages) error

// OnDeleteScheduledMessages sets DeleteScheduledMessages handler.
func ( UpdateDispatcher) ( DeleteScheduledMessagesHandler) {
	.state.set(UpdateDeleteScheduledMessagesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDeleteScheduledMessages))
	})
}

// ThemeHandler is a Theme event handler.
type ThemeHandler func(ctx context.Context, e Entities, update *UpdateTheme) error

// OnTheme sets Theme handler.
func ( UpdateDispatcher) ( ThemeHandler) {
	.state.set(UpdateThemeTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateTheme))
	})
}

// GeoLiveViewedHandler is a GeoLiveViewed event handler.
type GeoLiveViewedHandler func(ctx context.Context, e Entities, update *UpdateGeoLiveViewed) error

// OnGeoLiveViewed sets GeoLiveViewed handler.
func ( UpdateDispatcher) ( GeoLiveViewedHandler) {
	.state.set(UpdateGeoLiveViewedTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateGeoLiveViewed))
	})
}

// LoginTokenHandler is a LoginToken event handler.
type LoginTokenHandler func(ctx context.Context, e Entities, update *UpdateLoginToken) error

// OnLoginToken sets LoginToken handler.
func ( UpdateDispatcher) ( LoginTokenHandler) {
	.state.set(UpdateLoginTokenTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateLoginToken))
	})
}

// MessagePollVoteHandler is a MessagePollVote event handler.
type MessagePollVoteHandler func(ctx context.Context, e Entities, update *UpdateMessagePollVote) error

// OnMessagePollVote sets MessagePollVote handler.
func ( UpdateDispatcher) ( MessagePollVoteHandler) {
	.state.set(UpdateMessagePollVoteTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateMessagePollVote))
	})
}

// DialogFilterHandler is a DialogFilter event handler.
type DialogFilterHandler func(ctx context.Context, e Entities, update *UpdateDialogFilter) error

// OnDialogFilter sets DialogFilter handler.
func ( UpdateDispatcher) ( DialogFilterHandler) {
	.state.set(UpdateDialogFilterTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDialogFilter))
	})
}

// DialogFilterOrderHandler is a DialogFilterOrder event handler.
type DialogFilterOrderHandler func(ctx context.Context, e Entities, update *UpdateDialogFilterOrder) error

// OnDialogFilterOrder sets DialogFilterOrder handler.
func ( UpdateDispatcher) ( DialogFilterOrderHandler) {
	.state.set(UpdateDialogFilterOrderTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDialogFilterOrder))
	})
}

// DialogFiltersHandler is a DialogFilters event handler.
type DialogFiltersHandler func(ctx context.Context, e Entities, update *UpdateDialogFilters) error

// OnDialogFilters sets DialogFilters handler.
func ( UpdateDispatcher) ( DialogFiltersHandler) {
	.state.set(UpdateDialogFiltersTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDialogFilters))
	})
}

// PhoneCallSignalingDataHandler is a PhoneCallSignalingData event handler.
type PhoneCallSignalingDataHandler func(ctx context.Context, e Entities, update *UpdatePhoneCallSignalingData) error

// OnPhoneCallSignalingData sets PhoneCallSignalingData handler.
func ( UpdateDispatcher) ( PhoneCallSignalingDataHandler) {
	.state.set(UpdatePhoneCallSignalingDataTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePhoneCallSignalingData))
	})
}

// ChannelMessageForwardsHandler is a ChannelMessageForwards event handler.
type ChannelMessageForwardsHandler func(ctx context.Context, e Entities, update *UpdateChannelMessageForwards) error

// OnChannelMessageForwards sets ChannelMessageForwards handler.
func ( UpdateDispatcher) ( ChannelMessageForwardsHandler) {
	.state.set(UpdateChannelMessageForwardsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelMessageForwards))
	})
}

// ReadChannelDiscussionInboxHandler is a ReadChannelDiscussionInbox event handler.
type ReadChannelDiscussionInboxHandler func(ctx context.Context, e Entities, update *UpdateReadChannelDiscussionInbox) error

// OnReadChannelDiscussionInbox sets ReadChannelDiscussionInbox handler.
func ( UpdateDispatcher) ( ReadChannelDiscussionInboxHandler) {
	.state.set(UpdateReadChannelDiscussionInboxTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadChannelDiscussionInbox))
	})
}

// ReadChannelDiscussionOutboxHandler is a ReadChannelDiscussionOutbox event handler.
type ReadChannelDiscussionOutboxHandler func(ctx context.Context, e Entities, update *UpdateReadChannelDiscussionOutbox) error

// OnReadChannelDiscussionOutbox sets ReadChannelDiscussionOutbox handler.
func ( UpdateDispatcher) ( ReadChannelDiscussionOutboxHandler) {
	.state.set(UpdateReadChannelDiscussionOutboxTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadChannelDiscussionOutbox))
	})
}

// PeerBlockedHandler is a PeerBlocked event handler.
type PeerBlockedHandler func(ctx context.Context, e Entities, update *UpdatePeerBlocked) error

// OnPeerBlocked sets PeerBlocked handler.
func ( UpdateDispatcher) ( PeerBlockedHandler) {
	.state.set(UpdatePeerBlockedTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePeerBlocked))
	})
}

// ChannelUserTypingHandler is a ChannelUserTyping event handler.
type ChannelUserTypingHandler func(ctx context.Context, e Entities, update *UpdateChannelUserTyping) error

// OnChannelUserTyping sets ChannelUserTyping handler.
func ( UpdateDispatcher) ( ChannelUserTypingHandler) {
	.state.set(UpdateChannelUserTypingTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelUserTyping))
	})
}

// PinnedMessagesHandler is a PinnedMessages event handler.
type PinnedMessagesHandler func(ctx context.Context, e Entities, update *UpdatePinnedMessages) error

// OnPinnedMessages sets PinnedMessages handler.
func ( UpdateDispatcher) ( PinnedMessagesHandler) {
	.state.set(UpdatePinnedMessagesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePinnedMessages))
	})
}

// PinnedChannelMessagesHandler is a PinnedChannelMessages event handler.
type PinnedChannelMessagesHandler func(ctx context.Context, e Entities, update *UpdatePinnedChannelMessages) error

// OnPinnedChannelMessages sets PinnedChannelMessages handler.
func ( UpdateDispatcher) ( PinnedChannelMessagesHandler) {
	.state.set(UpdatePinnedChannelMessagesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePinnedChannelMessages))
	})
}

// ChatHandler is a Chat event handler.
type ChatHandler func(ctx context.Context, e Entities, update *UpdateChat) error

// OnChat sets Chat handler.
func ( UpdateDispatcher) ( ChatHandler) {
	.state.set(UpdateChatTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChat))
	})
}

// GroupCallParticipantsHandler is a GroupCallParticipants event handler.
type GroupCallParticipantsHandler func(ctx context.Context, e Entities, update *UpdateGroupCallParticipants) error

// OnGroupCallParticipants sets GroupCallParticipants handler.
func ( UpdateDispatcher) ( GroupCallParticipantsHandler) {
	.state.set(UpdateGroupCallParticipantsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateGroupCallParticipants))
	})
}

// GroupCallHandler is a GroupCall event handler.
type GroupCallHandler func(ctx context.Context, e Entities, update *UpdateGroupCall) error

// OnGroupCall sets GroupCall handler.
func ( UpdateDispatcher) ( GroupCallHandler) {
	.state.set(UpdateGroupCallTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateGroupCall))
	})
}

// PeerHistoryTTLHandler is a PeerHistoryTTL event handler.
type PeerHistoryTTLHandler func(ctx context.Context, e Entities, update *UpdatePeerHistoryTTL) error

// OnPeerHistoryTTL sets PeerHistoryTTL handler.
func ( UpdateDispatcher) ( PeerHistoryTTLHandler) {
	.state.set(UpdatePeerHistoryTTLTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePeerHistoryTTL))
	})
}

// ChatParticipantHandler is a ChatParticipant event handler.
type ChatParticipantHandler func(ctx context.Context, e Entities, update *UpdateChatParticipant) error

// OnChatParticipant sets ChatParticipant handler.
func ( UpdateDispatcher) ( ChatParticipantHandler) {
	.state.set(UpdateChatParticipantTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChatParticipant))
	})
}

// ChannelParticipantHandler is a ChannelParticipant event handler.
type ChannelParticipantHandler func(ctx context.Context, e Entities, update *UpdateChannelParticipant) error

// OnChannelParticipant sets ChannelParticipant handler.
func ( UpdateDispatcher) ( ChannelParticipantHandler) {
	.state.set(UpdateChannelParticipantTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelParticipant))
	})
}

// BotStoppedHandler is a BotStopped event handler.
type BotStoppedHandler func(ctx context.Context, e Entities, update *UpdateBotStopped) error

// OnBotStopped sets BotStopped handler.
func ( UpdateDispatcher) ( BotStoppedHandler) {
	.state.set(UpdateBotStoppedTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotStopped))
	})
}

// GroupCallConnectionHandler is a GroupCallConnection event handler.
type GroupCallConnectionHandler func(ctx context.Context, e Entities, update *UpdateGroupCallConnection) error

// OnGroupCallConnection sets GroupCallConnection handler.
func ( UpdateDispatcher) ( GroupCallConnectionHandler) {
	.state.set(UpdateGroupCallConnectionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateGroupCallConnection))
	})
}

// BotCommandsHandler is a BotCommands event handler.
type BotCommandsHandler func(ctx context.Context, e Entities, update *UpdateBotCommands) error

// OnBotCommands sets BotCommands handler.
func ( UpdateDispatcher) ( BotCommandsHandler) {
	.state.set(UpdateBotCommandsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotCommands))
	})
}

// PendingJoinRequestsHandler is a PendingJoinRequests event handler.
type PendingJoinRequestsHandler func(ctx context.Context, e Entities, update *UpdatePendingJoinRequests) error

// OnPendingJoinRequests sets PendingJoinRequests handler.
func ( UpdateDispatcher) ( PendingJoinRequestsHandler) {
	.state.set(UpdatePendingJoinRequestsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePendingJoinRequests))
	})
}

// BotChatInviteRequesterHandler is a BotChatInviteRequester event handler.
type BotChatInviteRequesterHandler func(ctx context.Context, e Entities, update *UpdateBotChatInviteRequester) error

// OnBotChatInviteRequester sets BotChatInviteRequester handler.
func ( UpdateDispatcher) ( BotChatInviteRequesterHandler) {
	.state.set(UpdateBotChatInviteRequesterTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotChatInviteRequester))
	})
}

// MessageReactionsHandler is a MessageReactions event handler.
type MessageReactionsHandler func(ctx context.Context, e Entities, update *UpdateMessageReactions) error

// OnMessageReactions sets MessageReactions handler.
func ( UpdateDispatcher) ( MessageReactionsHandler) {
	.state.set(UpdateMessageReactionsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateMessageReactions))
	})
}

// AttachMenuBotsHandler is a AttachMenuBots event handler.
type AttachMenuBotsHandler func(ctx context.Context, e Entities, update *UpdateAttachMenuBots) error

// OnAttachMenuBots sets AttachMenuBots handler.
func ( UpdateDispatcher) ( AttachMenuBotsHandler) {
	.state.set(UpdateAttachMenuBotsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateAttachMenuBots))
	})
}

// WebViewResultSentHandler is a WebViewResultSent event handler.
type WebViewResultSentHandler func(ctx context.Context, e Entities, update *UpdateWebViewResultSent) error

// OnWebViewResultSent sets WebViewResultSent handler.
func ( UpdateDispatcher) ( WebViewResultSentHandler) {
	.state.set(UpdateWebViewResultSentTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateWebViewResultSent))
	})
}

// BotMenuButtonHandler is a BotMenuButton event handler.
type BotMenuButtonHandler func(ctx context.Context, e Entities, update *UpdateBotMenuButton) error

// OnBotMenuButton sets BotMenuButton handler.
func ( UpdateDispatcher) ( BotMenuButtonHandler) {
	.state.set(UpdateBotMenuButtonTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotMenuButton))
	})
}

// SavedRingtonesHandler is a SavedRingtones event handler.
type SavedRingtonesHandler func(ctx context.Context, e Entities, update *UpdateSavedRingtones) error

// OnSavedRingtones sets SavedRingtones handler.
func ( UpdateDispatcher) ( SavedRingtonesHandler) {
	.state.set(UpdateSavedRingtonesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateSavedRingtones))
	})
}

// TranscribedAudioHandler is a TranscribedAudio event handler.
type TranscribedAudioHandler func(ctx context.Context, e Entities, update *UpdateTranscribedAudio) error

// OnTranscribedAudio sets TranscribedAudio handler.
func ( UpdateDispatcher) ( TranscribedAudioHandler) {
	.state.set(UpdateTranscribedAudioTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateTranscribedAudio))
	})
}

// ReadFeaturedEmojiStickersHandler is a ReadFeaturedEmojiStickers event handler.
type ReadFeaturedEmojiStickersHandler func(ctx context.Context, e Entities, update *UpdateReadFeaturedEmojiStickers) error

// OnReadFeaturedEmojiStickers sets ReadFeaturedEmojiStickers handler.
func ( UpdateDispatcher) ( ReadFeaturedEmojiStickersHandler) {
	.state.set(UpdateReadFeaturedEmojiStickersTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadFeaturedEmojiStickers))
	})
}

// UserEmojiStatusHandler is a UserEmojiStatus event handler.
type UserEmojiStatusHandler func(ctx context.Context, e Entities, update *UpdateUserEmojiStatus) error

// OnUserEmojiStatus sets UserEmojiStatus handler.
func ( UpdateDispatcher) ( UserEmojiStatusHandler) {
	.state.set(UpdateUserEmojiStatusTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateUserEmojiStatus))
	})
}

// RecentEmojiStatusesHandler is a RecentEmojiStatuses event handler.
type RecentEmojiStatusesHandler func(ctx context.Context, e Entities, update *UpdateRecentEmojiStatuses) error

// OnRecentEmojiStatuses sets RecentEmojiStatuses handler.
func ( UpdateDispatcher) ( RecentEmojiStatusesHandler) {
	.state.set(UpdateRecentEmojiStatusesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateRecentEmojiStatuses))
	})
}

// RecentReactionsHandler is a RecentReactions event handler.
type RecentReactionsHandler func(ctx context.Context, e Entities, update *UpdateRecentReactions) error

// OnRecentReactions sets RecentReactions handler.
func ( UpdateDispatcher) ( RecentReactionsHandler) {
	.state.set(UpdateRecentReactionsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateRecentReactions))
	})
}

// MoveStickerSetToTopHandler is a MoveStickerSetToTop event handler.
type MoveStickerSetToTopHandler func(ctx context.Context, e Entities, update *UpdateMoveStickerSetToTop) error

// OnMoveStickerSetToTop sets MoveStickerSetToTop handler.
func ( UpdateDispatcher) ( MoveStickerSetToTopHandler) {
	.state.set(UpdateMoveStickerSetToTopTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateMoveStickerSetToTop))
	})
}

// MessageExtendedMediaHandler is a MessageExtendedMedia event handler.
type MessageExtendedMediaHandler func(ctx context.Context, e Entities, update *UpdateMessageExtendedMedia) error

// OnMessageExtendedMedia sets MessageExtendedMedia handler.
func ( UpdateDispatcher) ( MessageExtendedMediaHandler) {
	.state.set(UpdateMessageExtendedMediaTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateMessageExtendedMedia))
	})
}

// UserHandler is a User event handler.
type UserHandler func(ctx context.Context, e Entities, update *UpdateUser) error

// OnUser sets User handler.
func ( UpdateDispatcher) ( UserHandler) {
	.state.set(UpdateUserTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateUser))
	})
}

// AutoSaveSettingsHandler is a AutoSaveSettings event handler.
type AutoSaveSettingsHandler func(ctx context.Context, e Entities, update *UpdateAutoSaveSettings) error

// OnAutoSaveSettings sets AutoSaveSettings handler.
func ( UpdateDispatcher) ( AutoSaveSettingsHandler) {
	.state.set(UpdateAutoSaveSettingsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateAutoSaveSettings))
	})
}

// StoryHandler is a Story event handler.
type StoryHandler func(ctx context.Context, e Entities, update *UpdateStory) error

// OnStory sets Story handler.
func ( UpdateDispatcher) ( StoryHandler) {
	.state.set(UpdateStoryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateStory))
	})
}

// ReadStoriesHandler is a ReadStories event handler.
type ReadStoriesHandler func(ctx context.Context, e Entities, update *UpdateReadStories) error

// OnReadStories sets ReadStories handler.
func ( UpdateDispatcher) ( ReadStoriesHandler) {
	.state.set(UpdateReadStoriesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadStories))
	})
}

// StoryIDHandler is a StoryID event handler.
type StoryIDHandler func(ctx context.Context, e Entities, update *UpdateStoryID) error

// OnStoryID sets StoryID handler.
func ( UpdateDispatcher) ( StoryIDHandler) {
	.state.set(UpdateStoryIDTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateStoryID))
	})
}

// StoriesStealthModeHandler is a StoriesStealthMode event handler.
type StoriesStealthModeHandler func(ctx context.Context, e Entities, update *UpdateStoriesStealthMode) error

// OnStoriesStealthMode sets StoriesStealthMode handler.
func ( UpdateDispatcher) ( StoriesStealthModeHandler) {
	.state.set(UpdateStoriesStealthModeTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateStoriesStealthMode))
	})
}

// SentStoryReactionHandler is a SentStoryReaction event handler.
type SentStoryReactionHandler func(ctx context.Context, e Entities, update *UpdateSentStoryReaction) error

// OnSentStoryReaction sets SentStoryReaction handler.
func ( UpdateDispatcher) ( SentStoryReactionHandler) {
	.state.set(UpdateSentStoryReactionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateSentStoryReaction))
	})
}

// BotChatBoostHandler is a BotChatBoost event handler.
type BotChatBoostHandler func(ctx context.Context, e Entities, update *UpdateBotChatBoost) error

// OnBotChatBoost sets BotChatBoost handler.
func ( UpdateDispatcher) ( BotChatBoostHandler) {
	.state.set(UpdateBotChatBoostTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotChatBoost))
	})
}

// ChannelViewForumAsMessagesHandler is a ChannelViewForumAsMessages event handler.
type ChannelViewForumAsMessagesHandler func(ctx context.Context, e Entities, update *UpdateChannelViewForumAsMessages) error

// OnChannelViewForumAsMessages sets ChannelViewForumAsMessages handler.
func ( UpdateDispatcher) ( ChannelViewForumAsMessagesHandler) {
	.state.set(UpdateChannelViewForumAsMessagesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelViewForumAsMessages))
	})
}

// PeerWallpaperHandler is a PeerWallpaper event handler.
type PeerWallpaperHandler func(ctx context.Context, e Entities, update *UpdatePeerWallpaper) error

// OnPeerWallpaper sets PeerWallpaper handler.
func ( UpdateDispatcher) ( PeerWallpaperHandler) {
	.state.set(UpdatePeerWallpaperTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePeerWallpaper))
	})
}

// BotMessageReactionHandler is a BotMessageReaction event handler.
type BotMessageReactionHandler func(ctx context.Context, e Entities, update *UpdateBotMessageReaction) error

// OnBotMessageReaction sets BotMessageReaction handler.
func ( UpdateDispatcher) ( BotMessageReactionHandler) {
	.state.set(UpdateBotMessageReactionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotMessageReaction))
	})
}

// BotMessageReactionsHandler is a BotMessageReactions event handler.
type BotMessageReactionsHandler func(ctx context.Context, e Entities, update *UpdateBotMessageReactions) error

// OnBotMessageReactions sets BotMessageReactions handler.
func ( UpdateDispatcher) ( BotMessageReactionsHandler) {
	.state.set(UpdateBotMessageReactionsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotMessageReactions))
	})
}

// SavedDialogPinnedHandler is a SavedDialogPinned event handler.
type SavedDialogPinnedHandler func(ctx context.Context, e Entities, update *UpdateSavedDialogPinned) error

// OnSavedDialogPinned sets SavedDialogPinned handler.
func ( UpdateDispatcher) ( SavedDialogPinnedHandler) {
	.state.set(UpdateSavedDialogPinnedTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateSavedDialogPinned))
	})
}

// PinnedSavedDialogsHandler is a PinnedSavedDialogs event handler.
type PinnedSavedDialogsHandler func(ctx context.Context, e Entities, update *UpdatePinnedSavedDialogs) error

// OnPinnedSavedDialogs sets PinnedSavedDialogs handler.
func ( UpdateDispatcher) ( PinnedSavedDialogsHandler) {
	.state.set(UpdatePinnedSavedDialogsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePinnedSavedDialogs))
	})
}

// SavedReactionTagsHandler is a SavedReactionTags event handler.
type SavedReactionTagsHandler func(ctx context.Context, e Entities, update *UpdateSavedReactionTags) error

// OnSavedReactionTags sets SavedReactionTags handler.
func ( UpdateDispatcher) ( SavedReactionTagsHandler) {
	.state.set(UpdateSavedReactionTagsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateSavedReactionTags))
	})
}

// SMSJobHandler is a SMSJob event handler.
type SMSJobHandler func(ctx context.Context, e Entities, update *UpdateSMSJob) error

// OnSMSJob sets SMSJob handler.
func ( UpdateDispatcher) ( SMSJobHandler) {
	.state.set(UpdateSMSJobTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateSMSJob))
	})
}

// QuickRepliesHandler is a QuickReplies event handler.
type QuickRepliesHandler func(ctx context.Context, e Entities, update *UpdateQuickReplies) error

// OnQuickReplies sets QuickReplies handler.
func ( UpdateDispatcher) ( QuickRepliesHandler) {
	.state.set(UpdateQuickRepliesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateQuickReplies))
	})
}

// NewQuickReplyHandler is a NewQuickReply event handler.
type NewQuickReplyHandler func(ctx context.Context, e Entities, update *UpdateNewQuickReply) error

// OnNewQuickReply sets NewQuickReply handler.
func ( UpdateDispatcher) ( NewQuickReplyHandler) {
	.state.set(UpdateNewQuickReplyTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNewQuickReply))
	})
}

// DeleteQuickReplyHandler is a DeleteQuickReply event handler.
type DeleteQuickReplyHandler func(ctx context.Context, e Entities, update *UpdateDeleteQuickReply) error

// OnDeleteQuickReply sets DeleteQuickReply handler.
func ( UpdateDispatcher) ( DeleteQuickReplyHandler) {
	.state.set(UpdateDeleteQuickReplyTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDeleteQuickReply))
	})
}

// QuickReplyMessageHandler is a QuickReplyMessage event handler.
type QuickReplyMessageHandler func(ctx context.Context, e Entities, update *UpdateQuickReplyMessage) error

// OnQuickReplyMessage sets QuickReplyMessage handler.
func ( UpdateDispatcher) ( QuickReplyMessageHandler) {
	.state.set(UpdateQuickReplyMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateQuickReplyMessage))
	})
}

// DeleteQuickReplyMessagesHandler is a DeleteQuickReplyMessages event handler.
type DeleteQuickReplyMessagesHandler func(ctx context.Context, e Entities, update *UpdateDeleteQuickReplyMessages) error

// OnDeleteQuickReplyMessages sets DeleteQuickReplyMessages handler.
func ( UpdateDispatcher) ( DeleteQuickReplyMessagesHandler) {
	.state.set(UpdateDeleteQuickReplyMessagesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDeleteQuickReplyMessages))
	})
}

// BotBusinessConnectHandler is a BotBusinessConnect event handler.
type BotBusinessConnectHandler func(ctx context.Context, e Entities, update *UpdateBotBusinessConnect) error

// OnBotBusinessConnect sets BotBusinessConnect handler.
func ( UpdateDispatcher) ( BotBusinessConnectHandler) {
	.state.set(UpdateBotBusinessConnectTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotBusinessConnect))
	})
}

// BotNewBusinessMessageHandler is a BotNewBusinessMessage event handler.
type BotNewBusinessMessageHandler func(ctx context.Context, e Entities, update *UpdateBotNewBusinessMessage) error

// OnBotNewBusinessMessage sets BotNewBusinessMessage handler.
func ( UpdateDispatcher) ( BotNewBusinessMessageHandler) {
	.state.set(UpdateBotNewBusinessMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotNewBusinessMessage))
	})
}

// BotEditBusinessMessageHandler is a BotEditBusinessMessage event handler.
type BotEditBusinessMessageHandler func(ctx context.Context, e Entities, update *UpdateBotEditBusinessMessage) error

// OnBotEditBusinessMessage sets BotEditBusinessMessage handler.
func ( UpdateDispatcher) ( BotEditBusinessMessageHandler) {
	.state.set(UpdateBotEditBusinessMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotEditBusinessMessage))
	})
}

// BotDeleteBusinessMessageHandler is a BotDeleteBusinessMessage event handler.
type BotDeleteBusinessMessageHandler func(ctx context.Context, e Entities, update *UpdateBotDeleteBusinessMessage) error

// OnBotDeleteBusinessMessage sets BotDeleteBusinessMessage handler.
func ( UpdateDispatcher) ( BotDeleteBusinessMessageHandler) {
	.state.set(UpdateBotDeleteBusinessMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotDeleteBusinessMessage))
	})
}

// NewStoryReactionHandler is a NewStoryReaction event handler.
type NewStoryReactionHandler func(ctx context.Context, e Entities, update *UpdateNewStoryReaction) error

// OnNewStoryReaction sets NewStoryReaction handler.
func ( UpdateDispatcher) ( NewStoryReactionHandler) {
	.state.set(UpdateNewStoryReactionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNewStoryReaction))
	})
}

// StarsBalanceHandler is a StarsBalance event handler.
type StarsBalanceHandler func(ctx context.Context, e Entities, update *UpdateStarsBalance) error

// OnStarsBalance sets StarsBalance handler.
func ( UpdateDispatcher) ( StarsBalanceHandler) {
	.state.set(UpdateStarsBalanceTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateStarsBalance))
	})
}

// BusinessBotCallbackQueryHandler is a BusinessBotCallbackQuery event handler.
type BusinessBotCallbackQueryHandler func(ctx context.Context, e Entities, update *UpdateBusinessBotCallbackQuery) error

// OnBusinessBotCallbackQuery sets BusinessBotCallbackQuery handler.
func ( UpdateDispatcher) ( BusinessBotCallbackQueryHandler) {
	.state.set(UpdateBusinessBotCallbackQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBusinessBotCallbackQuery))
	})
}

// StarsRevenueStatusHandler is a StarsRevenueStatus event handler.
type StarsRevenueStatusHandler func(ctx context.Context, e Entities, update *UpdateStarsRevenueStatus) error

// OnStarsRevenueStatus sets StarsRevenueStatus handler.
func ( UpdateDispatcher) ( StarsRevenueStatusHandler) {
	.state.set(UpdateStarsRevenueStatusTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateStarsRevenueStatus))
	})
}

// BotPurchasedPaidMediaHandler is a BotPurchasedPaidMedia event handler.
type BotPurchasedPaidMediaHandler func(ctx context.Context, e Entities, update *UpdateBotPurchasedPaidMedia) error

// OnBotPurchasedPaidMedia sets BotPurchasedPaidMedia handler.
func ( UpdateDispatcher) ( BotPurchasedPaidMediaHandler) {
	.state.set(UpdateBotPurchasedPaidMediaTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotPurchasedPaidMedia))
	})
}

// PaidReactionPrivacyHandler is a PaidReactionPrivacy event handler.
type PaidReactionPrivacyHandler func(ctx context.Context, e Entities, update *UpdatePaidReactionPrivacy) error

// OnPaidReactionPrivacy sets PaidReactionPrivacy handler.
func ( UpdateDispatcher) ( PaidReactionPrivacyHandler) {
	.state.set(UpdatePaidReactionPrivacyTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePaidReactionPrivacy))
	})
}

// SentPhoneCodeHandler is a SentPhoneCode event handler.
type SentPhoneCodeHandler func(ctx context.Context, e Entities, update *UpdateSentPhoneCode) error

// OnSentPhoneCode sets SentPhoneCode handler.
func ( UpdateDispatcher) ( SentPhoneCodeHandler) {
	.state.set(UpdateSentPhoneCodeTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateSentPhoneCode))
	})
}

// GroupCallChainBlocksHandler is a GroupCallChainBlocks event handler.
type GroupCallChainBlocksHandler func(ctx context.Context, e Entities, update *UpdateGroupCallChainBlocks) error

// OnGroupCallChainBlocks sets GroupCallChainBlocks handler.
func ( UpdateDispatcher) ( GroupCallChainBlocksHandler) {
	.state.set(UpdateGroupCallChainBlocksTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateGroupCallChainBlocks))
	})
}

// ReadMonoForumInboxHandler is a ReadMonoForumInbox event handler.
type ReadMonoForumInboxHandler func(ctx context.Context, e Entities, update *UpdateReadMonoForumInbox) error

// OnReadMonoForumInbox sets ReadMonoForumInbox handler.
func ( UpdateDispatcher) ( ReadMonoForumInboxHandler) {
	.state.set(UpdateReadMonoForumInboxTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadMonoForumInbox))
	})
}

// ReadMonoForumOutboxHandler is a ReadMonoForumOutbox event handler.
type ReadMonoForumOutboxHandler func(ctx context.Context, e Entities, update *UpdateReadMonoForumOutbox) error

// OnReadMonoForumOutbox sets ReadMonoForumOutbox handler.
func ( UpdateDispatcher) ( ReadMonoForumOutboxHandler) {
	.state.set(UpdateReadMonoForumOutboxTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateReadMonoForumOutbox))
	})
}

// MonoForumNoPaidExceptionHandler is a MonoForumNoPaidException event handler.
type MonoForumNoPaidExceptionHandler func(ctx context.Context, e Entities, update *UpdateMonoForumNoPaidException) error

// OnMonoForumNoPaidException sets MonoForumNoPaidException handler.
func ( UpdateDispatcher) ( MonoForumNoPaidExceptionHandler) {
	.state.set(UpdateMonoForumNoPaidExceptionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateMonoForumNoPaidException))
	})
}

// GroupCallMessageHandler is a GroupCallMessage event handler.
type GroupCallMessageHandler func(ctx context.Context, e Entities, update *UpdateGroupCallMessage) error

// OnGroupCallMessage sets GroupCallMessage handler.
func ( UpdateDispatcher) ( GroupCallMessageHandler) {
	.state.set(UpdateGroupCallMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateGroupCallMessage))
	})
}

// GroupCallEncryptedMessageHandler is a GroupCallEncryptedMessage event handler.
type GroupCallEncryptedMessageHandler func(ctx context.Context, e Entities, update *UpdateGroupCallEncryptedMessage) error

// OnGroupCallEncryptedMessage sets GroupCallEncryptedMessage handler.
func ( UpdateDispatcher) ( GroupCallEncryptedMessageHandler) {
	.state.set(UpdateGroupCallEncryptedMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateGroupCallEncryptedMessage))
	})
}

// PinnedForumTopicHandler is a PinnedForumTopic event handler.
type PinnedForumTopicHandler func(ctx context.Context, e Entities, update *UpdatePinnedForumTopic) error

// OnPinnedForumTopic sets PinnedForumTopic handler.
func ( UpdateDispatcher) ( PinnedForumTopicHandler) {
	.state.set(UpdatePinnedForumTopicTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePinnedForumTopic))
	})
}

// PinnedForumTopicsHandler is a PinnedForumTopics event handler.
type PinnedForumTopicsHandler func(ctx context.Context, e Entities, update *UpdatePinnedForumTopics) error

// OnPinnedForumTopics sets PinnedForumTopics handler.
func ( UpdateDispatcher) ( PinnedForumTopicsHandler) {
	.state.set(UpdatePinnedForumTopicsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdatePinnedForumTopics))
	})
}

// DeleteGroupCallMessagesHandler is a DeleteGroupCallMessages event handler.
type DeleteGroupCallMessagesHandler func(ctx context.Context, e Entities, update *UpdateDeleteGroupCallMessages) error

// OnDeleteGroupCallMessages sets DeleteGroupCallMessages handler.
func ( UpdateDispatcher) ( DeleteGroupCallMessagesHandler) {
	.state.set(UpdateDeleteGroupCallMessagesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDeleteGroupCallMessages))
	})
}

// StarGiftAuctionStateHandler is a StarGiftAuctionState event handler.
type StarGiftAuctionStateHandler func(ctx context.Context, e Entities, update *UpdateStarGiftAuctionState) error

// OnStarGiftAuctionState sets StarGiftAuctionState handler.
func ( UpdateDispatcher) ( StarGiftAuctionStateHandler) {
	.state.set(UpdateStarGiftAuctionStateTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateStarGiftAuctionState))
	})
}

// StarGiftAuctionUserStateHandler is a StarGiftAuctionUserState event handler.
type StarGiftAuctionUserStateHandler func(ctx context.Context, e Entities, update *UpdateStarGiftAuctionUserState) error

// OnStarGiftAuctionUserState sets StarGiftAuctionUserState handler.
func ( UpdateDispatcher) ( StarGiftAuctionUserStateHandler) {
	.state.set(UpdateStarGiftAuctionUserStateTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateStarGiftAuctionUserState))
	})
}

// EmojiGameInfoHandler is a EmojiGameInfo event handler.
type EmojiGameInfoHandler func(ctx context.Context, e Entities, update *UpdateEmojiGameInfo) error

// OnEmojiGameInfo sets EmojiGameInfo handler.
func ( UpdateDispatcher) ( EmojiGameInfoHandler) {
	.state.set(UpdateEmojiGameInfoTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateEmojiGameInfo))
	})
}

// StarGiftCraftFailHandler is a StarGiftCraftFail event handler.
type StarGiftCraftFailHandler func(ctx context.Context, e Entities, update *UpdateStarGiftCraftFail) error

// OnStarGiftCraftFail sets StarGiftCraftFail handler.
func ( UpdateDispatcher) ( StarGiftCraftFailHandler) {
	.state.set(UpdateStarGiftCraftFailTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateStarGiftCraftFail))
	})
}

// ChatParticipantRankHandler is a ChatParticipantRank event handler.
type ChatParticipantRankHandler func(ctx context.Context, e Entities, update *UpdateChatParticipantRank) error

// OnChatParticipantRank sets ChatParticipantRank handler.
func ( UpdateDispatcher) ( ChatParticipantRankHandler) {
	.state.set(UpdateChatParticipantRankTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChatParticipantRank))
	})
}

// ManagedBotHandler is a ManagedBot event handler.
type ManagedBotHandler func(ctx context.Context, e Entities, update *UpdateManagedBot) error

// OnManagedBot sets ManagedBot handler.
func ( UpdateDispatcher) ( ManagedBotHandler) {
	.state.set(UpdateManagedBotTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateManagedBot))
	})
}

// BotGuestChatQueryHandler is a BotGuestChatQuery event handler.
type BotGuestChatQueryHandler func(ctx context.Context, e Entities, update *UpdateBotGuestChatQuery) error

// OnBotGuestChatQuery sets BotGuestChatQuery handler.
func ( UpdateDispatcher) ( BotGuestChatQueryHandler) {
	.state.set(UpdateBotGuestChatQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotGuestChatQuery))
	})
}

// AiComposeTonesHandler is a AiComposeTones event handler.
type AiComposeTonesHandler func(ctx context.Context, e Entities, update *UpdateAiComposeTones) error

// OnAiComposeTones sets AiComposeTones handler.
func ( UpdateDispatcher) ( AiComposeTonesHandler) {
	.state.set(UpdateAiComposeTonesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateAiComposeTones))
	})
}

// JoinChatWebViewDecisionHandler is a JoinChatWebViewDecision event handler.
type JoinChatWebViewDecisionHandler func(ctx context.Context, e Entities, update *UpdateJoinChatWebViewDecision) error

// OnJoinChatWebViewDecision sets JoinChatWebViewDecision handler.
func ( UpdateDispatcher) ( JoinChatWebViewDecisionHandler) {
	.state.set(UpdateJoinChatWebViewDecisionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateJoinChatWebViewDecision))
	})
}

// NewBotConnectionHandler is a NewBotConnection event handler.
type NewBotConnectionHandler func(ctx context.Context, e Entities, update *UpdateNewBotConnection) error

// OnNewBotConnection sets NewBotConnection handler.
func ( UpdateDispatcher) ( NewBotConnectionHandler) {
	.state.set(UpdateNewBotConnectionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNewBotConnection))
	})
}

// WebBrowserSettingsHandler is a WebBrowserSettings event handler.
type WebBrowserSettingsHandler func(ctx context.Context, e Entities, update *UpdateWebBrowserSettings) error

// OnWebBrowserSettings sets WebBrowserSettings handler.
func ( UpdateDispatcher) ( WebBrowserSettingsHandler) {
	.state.set(UpdateWebBrowserSettingsTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateWebBrowserSettings))
	})
}

// WebBrowserExceptionHandler is a WebBrowserException event handler.
type WebBrowserExceptionHandler func(ctx context.Context, e Entities, update *UpdateWebBrowserException) error

// OnWebBrowserException sets WebBrowserException handler.
func ( UpdateDispatcher) ( WebBrowserExceptionHandler) {
	.state.set(UpdateWebBrowserExceptionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateWebBrowserException))
	})
}

// NewEphemeralMessageHandler is a NewEphemeralMessage event handler.
type NewEphemeralMessageHandler func(ctx context.Context, e Entities, update *UpdateNewEphemeralMessage) error

// OnNewEphemeralMessage sets NewEphemeralMessage handler.
func ( UpdateDispatcher) ( NewEphemeralMessageHandler) {
	.state.set(UpdateNewEphemeralMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateNewEphemeralMessage))
	})
}

// DeleteEphemeralMessagesHandler is a DeleteEphemeralMessages event handler.
type DeleteEphemeralMessagesHandler func(ctx context.Context, e Entities, update *UpdateDeleteEphemeralMessages) error

// OnDeleteEphemeralMessages sets DeleteEphemeralMessages handler.
func ( UpdateDispatcher) ( DeleteEphemeralMessagesHandler) {
	.state.set(UpdateDeleteEphemeralMessagesTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateDeleteEphemeralMessages))
	})
}

// EditEphemeralMessageHandler is a EditEphemeralMessage event handler.
type EditEphemeralMessageHandler func(ctx context.Context, e Entities, update *UpdateEditEphemeralMessage) error

// OnEditEphemeralMessage sets EditEphemeralMessage handler.
func ( UpdateDispatcher) ( EditEphemeralMessageHandler) {
	.state.set(UpdateEditEphemeralMessageTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateEditEphemeralMessage))
	})
}

// EphemeralBotCallbackQueryHandler is a EphemeralBotCallbackQuery event handler.
type EphemeralBotCallbackQueryHandler func(ctx context.Context, e Entities, update *UpdateEphemeralBotCallbackQuery) error

// OnEphemeralBotCallbackQuery sets EphemeralBotCallbackQuery handler.
func ( UpdateDispatcher) ( EphemeralBotCallbackQueryHandler) {
	.state.set(UpdateEphemeralBotCallbackQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateEphemeralBotCallbackQuery))
	})
}

// BotStarsSubscriptionHandler is a BotStarsSubscription event handler.
type BotStarsSubscriptionHandler func(ctx context.Context, e Entities, update *UpdateBotStarsSubscription) error

// OnBotStarsSubscription sets BotStarsSubscription handler.
func ( UpdateDispatcher) ( BotStarsSubscriptionHandler) {
	.state.set(UpdateBotStarsSubscriptionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotStarsSubscription))
	})
}

// WalletStateHandler is a WalletState event handler.
type WalletStateHandler func(ctx context.Context, e Entities, update *UpdateWalletState) error

// OnWalletState sets WalletState handler.
func ( UpdateDispatcher) ( WalletStateHandler) {
	.state.set(UpdateWalletStateTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateWalletState))
	})
}

// SentWalletTransactionHandler is a SentWalletTransaction event handler.
type SentWalletTransactionHandler func(ctx context.Context, e Entities, update *UpdateSentWalletTransaction) error

// OnSentWalletTransaction sets SentWalletTransaction handler.
func ( UpdateDispatcher) ( SentWalletTransactionHandler) {
	.state.set(UpdateSentWalletTransactionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateSentWalletTransaction))
	})
}

// WalletGaslessInfoHandler is a WalletGaslessInfo event handler.
type WalletGaslessInfoHandler func(ctx context.Context, e Entities, update *UpdateWalletGaslessInfo) error

// OnWalletGaslessInfo sets WalletGaslessInfo handler.
func ( UpdateDispatcher) ( WalletGaslessInfoHandler) {
	.state.set(UpdateWalletGaslessInfoTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateWalletGaslessInfo))
	})
}

// WalletTonConnectSessionHandler is a WalletTonConnectSession event handler.
type WalletTonConnectSessionHandler func(ctx context.Context, e Entities, update *UpdateWalletTonConnectSession) error

// OnWalletTonConnectSession sets WalletTonConnectSession handler.
func ( UpdateDispatcher) ( WalletTonConnectSessionHandler) {
	.state.set(UpdateWalletTonConnectSessionTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateWalletTonConnectSession))
	})
}

// WalletTonConnectPendingDisconnectHandler is a WalletTonConnectPendingDisconnect event handler.
type WalletTonConnectPendingDisconnectHandler func(ctx context.Context, e Entities, update *UpdateWalletTonConnectPendingDisconnect) error

// OnWalletTonConnectPendingDisconnect sets WalletTonConnectPendingDisconnect handler.
func ( UpdateDispatcher) ( WalletTonConnectPendingDisconnectHandler) {
	.state.set(UpdateWalletTonConnectPendingDisconnectTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateWalletTonConnectPendingDisconnect))
	})
}

// EditForumTopicHandler is a EditForumTopic event handler.
type EditForumTopicHandler func(ctx context.Context, e Entities, update *UpdateEditForumTopic) error

// OnEditForumTopic sets EditForumTopic handler.
func ( UpdateDispatcher) ( EditForumTopicHandler) {
	.state.set(UpdateEditForumTopicTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateEditForumTopic))
	})
}

// BotWidgetQueryHandler is a BotWidgetQuery event handler.
type BotWidgetQueryHandler func(ctx context.Context, e Entities, update *UpdateBotWidgetQuery) error

// OnBotWidgetQuery sets BotWidgetQuery handler.
func ( UpdateDispatcher) ( BotWidgetQueryHandler) {
	.state.set(UpdateBotWidgetQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotWidgetQuery))
	})
}

// InlineBotWidgetQueryHandler is a InlineBotWidgetQuery event handler.
type InlineBotWidgetQueryHandler func(ctx context.Context, e Entities, update *UpdateInlineBotWidgetQuery) error

// OnInlineBotWidgetQuery sets InlineBotWidgetQuery handler.
func ( UpdateDispatcher) ( InlineBotWidgetQueryHandler) {
	.state.set(UpdateInlineBotWidgetQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateInlineBotWidgetQuery))
	})
}

// BotWidgetCopyQueryHandler is a BotWidgetCopyQuery event handler.
type BotWidgetCopyQueryHandler func(ctx context.Context, e Entities, update *UpdateBotWidgetCopyQuery) error

// OnBotWidgetCopyQuery sets BotWidgetCopyQuery handler.
func ( UpdateDispatcher) ( BotWidgetCopyQueryHandler) {
	.state.set(UpdateBotWidgetCopyQueryTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotWidgetCopyQuery))
	})
}

// MessageWidgetDataHandler is a MessageWidgetData event handler.
type MessageWidgetDataHandler func(ctx context.Context, e Entities, update *UpdateMessageWidgetData) error

// OnMessageWidgetData sets MessageWidgetData handler.
func ( UpdateDispatcher) ( MessageWidgetDataHandler) {
	.state.set(UpdateMessageWidgetDataTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateMessageWidgetData))
	})
}

// TranscribedAudioFileHandler is a TranscribedAudioFile event handler.
type TranscribedAudioFileHandler func(ctx context.Context, e Entities, update *UpdateTranscribedAudioFile) error

// OnTranscribedAudioFile sets TranscribedAudioFile handler.
func ( UpdateDispatcher) ( TranscribedAudioFileHandler) {
	.state.set(UpdateTranscribedAudioFileTypeID, func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateTranscribedAudioFile))
	})
}

// OnFallback sets fallback handler, called for updates without handler.
func ( UpdateDispatcher) ( Handler) {
	.state.setFallback()
}