events

package
v0.0.0-...-889dc0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 2 Imported by: 0

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

type UpdateEvent struct {
	// Update is the received update.
	Update *client.Update
}

UpdateEvent is emitted when a new update is received.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL