Documentation
¶
Overview ¶
Package events defines the events emitted by the bot and their associated payload types.
Index ¶
- Constants
- type BusinessConnectionEvent
- type CallbackQueryEvent
- type ChatBoostEvent
- type ChatJoinRequestEvent
- type ChatMemberEvent
- type ChosenInlineResultEvent
- type CommandEvent
- type DeletedBusinessMessagesEvent
- type InlineQueryEvent
- type ManagedBotEvent
- type MessageEvent
- type MessageReactionCountEvent
- type MessageReactionEvent
- type PollAnswerEvent
- type PollEvent
- type PreCheckoutQueryEvent
- type PurchasedPaidMediaEvent
- type RemovedChatBoostEvent
- type ShippingQueryEvent
- type UpdateEvent
Constants ¶
const ( // OnUpdate is emitted when a new update is received from Telegram. OnUpdate = "onUpdate" // OnMessage is emitted when a new message is received, regardless of its type. // The specific type is available in the MessageEvent.Type field. OnMessage = "onMessage" // OnEditedMessage is emitted when a message is edited. OnEditedMessage = "onEditedMessage" // OnChannelPost is emitted when a new channel post is received. OnChannelPost = "onChannelPost" // OnEditedChannelPost is emitted when a channel post is edited. OnEditedChannelPost = "onEditedChannelPost" // OnBusinessMessage is emitted when a business message is received. OnBusinessMessage = "onBusinessMessage" // OnEditedBusinessMessage is emitted when a business message is edited. OnEditedBusinessMessage = "onEditedBusinessMessage" // OnGuestMessage is emitted when a guest message is received. OnGuestMessage = "onGuestMessage" // OnCommand is emitted when a command is received from a text message. OnCommand = "onCommand" // OnCallbackQuery is emitted when a callback query is received. OnCallbackQuery = "onCallbackQuery" // OnInlineQuery is emitted when an inline query is received. OnInlineQuery = "onInlineQuery" // OnChosenInlineResult is emitted when an inline result is chosen. OnChosenInlineResult = "onChosenInlineResult" // OnShippingQuery is emitted when a shipping query is received. OnShippingQuery = "onShippingQuery" // OnPreCheckoutQuery is emitted when a pre-checkout query is received. OnPreCheckoutQuery = "onPreCheckoutQuery" // OnPoll is emitted when a poll update is received. OnPoll = "onPoll" // OnPollAnswer is emitted when a poll answer update is received. OnPollAnswer = "onPollAnswer" // OnChatMember is emitted when a chat member update is received. OnChatMember = "onChatMember" // OnMyChatMember is emitted when the bot's chat member state changes. OnMyChatMember = "onMyChatMember" // OnChatJoinRequest is emitted when a chat join request is received. OnChatJoinRequest = "onChatJoinRequest" // OnChatBoost is emitted when a chat boost update is received. OnChatBoost = "onChatBoost" // OnRemovedChatBoost is emitted when a chat boost is removed. OnRemovedChatBoost = "onRemovedChatBoost" // OnMessageReaction is emitted when a message reaction update is received. OnMessageReaction = "onMessageReaction" // OnMessageReactionCount is emitted when a reaction-count update is received. OnMessageReactionCount = "onMessageReactionCount" // OnBusinessConnection is emitted when a business connection changes. OnBusinessConnection = "onBusinessConnection" // OnDeletedBusinessMessages is emitted when business messages are deleted. OnDeletedBusinessMessages = "onDeletedBusinessMessages" // OnPurchasedPaidMedia is emitted when paid media is purchased. OnPurchasedPaidMedia = "onPurchasedPaidMedia" // OnManagedBot is emitted when a managed bot update is received. OnManagedBot = "onManagedBot" )
Constants for event names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BusinessConnectionEvent ¶
type BusinessConnectionEvent struct {
BusinessConnection *client.BusinessConnection
}
BusinessConnectionEvent is emitted when a business connection changes.
type CallbackQueryEvent ¶
type CallbackQueryEvent struct {
CallbackQuery *client.CallbackQuery
}
CallbackQueryEvent is emitted when a callback query is received.
type ChatBoostEvent ¶
type ChatBoostEvent struct {
ChatBoost *client.ChatBoostUpdated
}
ChatBoostEvent is emitted when a chat boost update is received.
type ChatJoinRequestEvent ¶
type ChatJoinRequestEvent struct {
ChatJoinRequest *client.ChatJoinRequest
}
ChatJoinRequestEvent is emitted when a chat join request is received.
type ChatMemberEvent ¶
type ChatMemberEvent struct {
ChatMember *client.ChatMemberUpdated
}
ChatMemberEvent is emitted when a chat member update is received.
type ChosenInlineResultEvent ¶
type ChosenInlineResultEvent struct {
ChosenInlineResult *client.ChosenInlineResult
}
ChosenInlineResultEvent is emitted when an inline result is chosen.
type CommandEvent ¶
type CommandEvent struct {
// Message is the received message.
Message *client.Message
// Command is the received command name (without /).
Command string
// Args is the text following the command.
Args string
}
CommandEvent is emitted when a command is received.
type DeletedBusinessMessagesEvent ¶
type DeletedBusinessMessagesEvent struct {
DeletedBusinessMessages *client.BusinessMessagesDeleted
}
DeletedBusinessMessagesEvent is emitted when business messages are deleted.
type InlineQueryEvent ¶
type InlineQueryEvent struct {
InlineQuery *client.InlineQuery
}
InlineQueryEvent is emitted when an inline query is received.
type ManagedBotEvent ¶
type ManagedBotEvent struct {
ManagedBot *client.ManagedBotUpdated
}
ManagedBotEvent is emitted when a managed bot update is received.
type MessageEvent ¶
type MessageEvent struct {
// Message is the received message.
Message *client.Message
// Type is the type of the message.
Type messagetype.MessageType
}
MessageEvent is emitted when a new message is received.
type MessageReactionCountEvent ¶
type MessageReactionCountEvent struct {
MessageReactionCount *client.MessageReactionCountUpdated
}
MessageReactionCountEvent is emitted when a reaction-count update is received.
type MessageReactionEvent ¶
type MessageReactionEvent struct {
MessageReaction *client.MessageReactionUpdated
}
MessageReactionEvent is emitted when a message reaction update is received.
type PollAnswerEvent ¶
type PollAnswerEvent struct {
PollAnswer *client.PollAnswer
}
PollAnswerEvent is emitted when a poll answer update is received.
type PreCheckoutQueryEvent ¶
type PreCheckoutQueryEvent struct {
PreCheckoutQuery *client.PreCheckoutQuery
}
PreCheckoutQueryEvent is emitted when a pre-checkout query is received.
type PurchasedPaidMediaEvent ¶
type PurchasedPaidMediaEvent struct {
PurchasedPaidMedia *client.PaidMediaPurchased
}
PurchasedPaidMediaEvent is emitted when paid media is purchased.
type RemovedChatBoostEvent ¶
type RemovedChatBoostEvent struct {
RemovedChatBoost *client.ChatBoostRemoved
}
RemovedChatBoostEvent is emitted when a chat boost is removed.
type ShippingQueryEvent ¶
type ShippingQueryEvent struct {
ShippingQuery *client.ShippingQuery
}
ShippingQueryEvent is emitted when a shipping query is received.
type UpdateEvent ¶
UpdateEvent is emitted when a new update is received.