Documentation
¶
Overview ¶
Package events defines the events emitted by the bot and their associated payload types.
Index ¶
Constants ¶
View Source
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" // OnCommand is emitted when a command is received from a text message. OnCommand = "onCommand" )
Constants for event names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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 UpdateEvent ¶
UpdateEvent is emitted when a new update is received.
Click to show internal directories.
Click to hide internal directories.