handlers

package
v1.0.0-beta17 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPrefix = []rune{'!', '/'}

DefaultPrefix is the global variable consisting all the prefixes which will trigger the command.

Functions

This section is empty.

Types

type AnyUpdate

type AnyUpdate struct {
	Callback CallbackResponse
}

AnyUpdate handler is executed on all type of incoming updates.

func NewAnyUpdate

func NewAnyUpdate(response CallbackResponse) AnyUpdate

NewAnyUpdate creates a new AnyUpdate handler bound to call its response.

func (AnyUpdate) CheckUpdate

func (au AnyUpdate) CheckUpdate(ctx *ext.Context, u *ext.Update) error

type CallbackQuery

type CallbackQuery struct {
	Filters       filters.CallbackQueryFilter
	Callback      CallbackResponse
	UpdateFilters filters.UpdateFilter
}

CallbackQuery handler is executed when the update consists of tg.UpdateBotCallbackQuery.

func NewCallbackQuery

func NewCallbackQuery(filters filters.CallbackQueryFilter, response CallbackResponse) CallbackQuery

NewCallbackQuery creates a new CallbackQuery handler bound to call its response.

func (CallbackQuery) CheckUpdate

func (c CallbackQuery) CheckUpdate(ctx *ext.Context, u *ext.Update) error

type CallbackResponse

type CallbackResponse func(*ext.Context, *ext.Update) error

CallbackResponse is the function which will be called on a handler's execution.

type ChatMemberUpdated

type ChatMemberUpdated struct {
	Callback CallbackResponse
	Filters  filters.ChatMemberUpdatedFilter
}

ChatMemberUpdated handler is executed on all type of incoming updates.

func NewChatMemberUpdated

func NewChatMemberUpdated(filters filters.ChatMemberUpdatedFilter, response CallbackResponse) ChatMemberUpdated

NewChatMemberUpdated creates a new ChatMemberUpdated handler bound to call its response.

func (ChatMemberUpdated) CheckUpdate

func (cm ChatMemberUpdated) CheckUpdate(ctx *ext.Context, u *ext.Update) error

type Command

type Command struct {
	Prefix        []rune
	Name          string
	Callback      CallbackResponse
	Outgoing      bool
	UpdateFilters filters.UpdateFilter
}

Command handler is executed when the update consists of tg.Message provided it is a command and satisfies all the conditions.

func NewCommand

func NewCommand(name string, response CallbackResponse) Command

NewCommand creates a new Command handler with default fields, bound to call its response

func (Command) CheckUpdate

func (c Command) CheckUpdate(ctx *ext.Context, u *ext.Update) error

type InlineQuery

type InlineQuery struct {
	Callback      CallbackResponse
	Filters       filters.InlineQueryFilter
	UpdateFilters filters.UpdateFilter
}

InlineQuery handler is executed when the update consists of tg.UpdateInlineBotCallbackQuery.

func NewInlineQuery

func NewInlineQuery(filters filters.InlineQueryFilter, response CallbackResponse) InlineQuery

NewInlineQuery creates a new InlineQuery handler bound to call its response.

func (InlineQuery) CheckUpdate

func (c InlineQuery) CheckUpdate(ctx *ext.Context, u *ext.Update) error

type Message

type Message struct {
	Callback      CallbackResponse
	Filters       filters.MessageFilter
	UpdateFilters filters.UpdateFilter
	Outgoing      bool
}

Message handler is executed when the update consists of tg.Message with provided conditions.

func NewMessage

func NewMessage(filters filters.MessageFilter, response CallbackResponse) Message

NewMessage creates a new Message handler bound to call its response.

func (Message) CheckUpdate

func (m Message) CheckUpdate(ctx *ext.Context, u *ext.Update) error

type PendingJoinRequests

type PendingJoinRequests struct {
	Callback CallbackResponse
	Filters  filters.PendingJoinRequestsFilter
}

PendingJoinRequests handler is executed on all type of incoming updates.

func NewChatJoinRequest

func NewChatJoinRequest(filters filters.PendingJoinRequestsFilter, response CallbackResponse) PendingJoinRequests

NewChatJoinRequest creates a new AnyUpdate handler bound to call its response.

func (PendingJoinRequests) CheckUpdate

func (c PendingJoinRequests) CheckUpdate(ctx *ext.Context, u *ext.Update) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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