1
bot/models/update.go
2025-01-24 17:17:17 +08:00

59 lines
3.9 KiB
Go

package models
// Update https://core.telegram.org/bots/api#update
type Update struct {
ID int64 `json:"update_id"`
Message *Message `json:"message,omitempty"`
EditedMessage *Message `json:"edited_message,omitempty"`
ChannelPost *Message `json:"channel_post,omitempty"`
EditedChannelPost *Message `json:"edited_channel_post,omitempty"`
BusinessConnection *BusinessConnection `json:"business_connection,omitempty"`
BusinessMessage *Message `json:"business_message,omitempty"`
EditedBusinessMessage *Message `json:"edited_business_message,omitempty"`
DeletedBusinessMessages *BusinessMessagesDeleted `json:"deleted_business_messages,omitempty"`
MessageReaction *MessageReactionUpdated `json:"message_reaction,omitempty"`
MessageReactionCount *MessageReactionCountUpdated `json:"message_reaction_count,omitempty"`
InlineQuery *InlineQuery `json:"inline_query,omitempty"`
ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"`
CallbackQuery *CallbackQuery `json:"callback_query,omitempty"`
ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"`
PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"`
PurchasedPaidMedia *PaidMediaPurchased `json:"purchased_paid_media,omitempty"`
Poll *Poll `json:"poll,omitempty"`
PollAnswer *PollAnswer `json:"poll_answer,omitempty"`
MyChatMember *ChatMemberUpdated `json:"my_chat_member,omitempty"`
ChatMember *ChatMemberUpdated `json:"chat_member,omitempty"`
ChatJoinRequest *ChatJoinRequest `json:"chat_join_request,omitempty"`
ChatBoost *ChatBoostUpdated `json:"chat_boost,omitempty"`
RemovedChatBoost *ChatBoostRemoved `json:"removed_chat_boost,omitempty"`
}
type AllowedUpdate string
// allowed_updates https://core.telegram.org/bots/api#update
const (
AllowedUpdateMessage AllowedUpdate = "message"
AllowedUpdateEditedMessage AllowedUpdate = "edited_message"
AllowedUpdateChannelPost AllowedUpdate = "channel_post"
AllowedUpdateEditedChannelPost AllowedUpdate = "edited_channel_post"
AllowedUpdateBusinessConnection AllowedUpdate = "business_connection"
AllowedUpdateBusinessMessage AllowedUpdate = "business_message"
AllowedUpdateEditedBusinessMessage AllowedUpdate = "edited_business_message"
AllowedUpdateDeletedBusinessMessages AllowedUpdate = "deleted_business_messages"
AllowedUpdateMessageReaction AllowedUpdate = "message_reaction"
AllowedUpdateMessageReactionCount AllowedUpdate = "message_reaction_count"
AllowedUpdateInlineQuery AllowedUpdate = "inline_query"
AllowedUpdateChosenInlineResult AllowedUpdate = "chosen_inline_result"
AllowedUpdateCallbackQuery AllowedUpdate = "callback_query"
AllowedUpdateShippingQuery AllowedUpdate = "shipping_query"
AllowedUpdatePreCheckoutQuery AllowedUpdate = "pre_checkout_query"
AllowedUpdatePurchasedPaidMedia AllowedUpdate = "purchased_paid_media"
AllowedUpdatePoll AllowedUpdate = "poll"
AllowedUpdatePollAnswer AllowedUpdate = "poll_answer"
AllowedUpdateMyChatMember AllowedUpdate = "my_chat_member"
AllowedUpdateChatMember AllowedUpdate = "chat_member"
AllowedUpdateChatJoinRequest AllowedUpdate = "chat_join_request"
AllowedUpdateChatBoost AllowedUpdate = "chat_boost"
AllowedUpdateRemovedChatBoost AllowedUpdate = "removed_chat_boost"
)