package handler_router import ( "context" "github.com/go-telegram/bot" "github.com/go-telegram/bot/models" "trle5.xyz/trbot/utils/type/update_utils" ) func (r *Router) Dispatcher(ctx context.Context, thebot *bot.Bot, update *models.Update) { var handler bot.HandlerFunc updateType := update_utils.GetUpdateType(update) switch { case updateType.Message: handler = func(ctx context.Context, bot *bot.Bot, update *models.Update) {} case updateType.EditedMessage: case updateType.ChannelPost: case updateType.EditedChannelPost: case updateType.BusinessConnection: case updateType.BusinessMessage: case updateType.EditedBusinessMessage: case updateType.DeletedBusinessMessages: case updateType.MessageReaction: case updateType.MessageReactionCount: case updateType.InlineQuery: case updateType.ChosenInlineResult: case updateType.CallbackQuery: case updateType.ShippingQuery: case updateType.PreCheckoutQuery: case updateType.PurchasedPaidMedia: case updateType.Poll: case updateType.PollAnswer: case updateType.MyChatMember: case updateType.ChatMember: case updateType.ChatJoinRequest: case updateType.ChatBoost: case updateType.RemovedChatBoost: } r.applyMiddlewares(handler)(ctx, thebot, update) }