// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

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

type UpdateDispatcher struct {
	handlers map[uint32]handler
}

func () UpdateDispatcher {
	return UpdateDispatcher{
		handlers: map[uint32]handler{},
	}
}

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

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
		.Users = .MapUsers().NotEmptyToMap()
		 := .MapChats()
		.Chats = .ChatToMap()
		.Channels = .ChannelToMap()
	case *UpdatesCombined:
		 = .Updates
		.Users = .MapUsers().NotEmptyToMap()
		 := .MapChats()
		.Chats = .ChatToMap()
		.Channels = .ChannelToMap()
	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
	}
	 := .TypeID()
	,  := .handlers[]
	if ! {
		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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[UpdateMessageExtendedMediaTypeID] = func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateMessageExtendedMedia))
	}
}

// ChannelPinnedTopicHandler is a ChannelPinnedTopic event handler.
type ChannelPinnedTopicHandler func(ctx context.Context, e Entities, update *UpdateChannelPinnedTopic) error

// OnChannelPinnedTopic sets ChannelPinnedTopic handler.
func ( UpdateDispatcher) ( ChannelPinnedTopicHandler) {
	.handlers[UpdateChannelPinnedTopicTypeID] = func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelPinnedTopic))
	}
}

// ChannelPinnedTopicsHandler is a ChannelPinnedTopics event handler.
type ChannelPinnedTopicsHandler func(ctx context.Context, e Entities, update *UpdateChannelPinnedTopics) error

// OnChannelPinnedTopics sets ChannelPinnedTopics handler.
func ( UpdateDispatcher) ( ChannelPinnedTopicsHandler) {
	.handlers[UpdateChannelPinnedTopicsTypeID] = func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateChannelPinnedTopics))
	}
}

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

// OnUser sets User handler.
func ( UpdateDispatcher) ( UserHandler) {
	.handlers[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) {
	.handlers[UpdateAutoSaveSettingsTypeID] = func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateAutoSaveSettings))
	}
}

// GroupInvitePrivacyForbiddenHandler is a GroupInvitePrivacyForbidden event handler.
type GroupInvitePrivacyForbiddenHandler func(ctx context.Context, e Entities, update *UpdateGroupInvitePrivacyForbidden) error

// OnGroupInvitePrivacyForbidden sets GroupInvitePrivacyForbidden handler.
func ( UpdateDispatcher) ( GroupInvitePrivacyForbiddenHandler) {
	.handlers[UpdateGroupInvitePrivacyForbiddenTypeID] = func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateGroupInvitePrivacyForbidden))
	}
}

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

// OnStory sets Story handler.
func ( UpdateDispatcher) ( StoryHandler) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[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) {
	.handlers[UpdateBotMessageReactionsTypeID] = func( context.Context,  Entities,  UpdateClass) error {
		return (, , .(*UpdateBotMessageReactions))
	}
}