telegram

package
v0.0.0-...-985beeb Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Escape

func Escape(s string) string

Escape Escapes the string (using HTML entities) to make it compatible with Telegram's HTML format.

The API only supports the following entities: `<`, `>` and `&`, therefore only the characters corresponding to those will be escaped

func NotifyAvailable

func NotifyAvailable(user *db.User, reward *patreon.RewardResult, campaign *patreon.Campaign)

func NotifyMissing

func NotifyMissing(user *db.User, missing []*patreon.RewardResult)

func StartBot

func StartBot(ctx context.Context) *bot.Bot

Types

type CommandHandler

type CommandHandler struct {
	Pattern     string
	Description string
	ChatAction  models.ChatAction
	HandlerType bot.HandlerType
	MatchType   bot.MatchType
	HandlerFunc bot.HandlerFunc
}

func (*CommandHandler) ChatActionHandler

func (ch *CommandHandler) ChatActionHandler() bot.HandlerFunc

type ConversationBot

type ConversationBot struct {
	bot.Bot
	// contains filtered or unexported fields
}

type ConversationEnd

type ConversationEnd struct {
	Command  string
	Function bot.HandlerFunc
}

type ConversationHandler

type ConversationHandler struct {
	// contains filtered or unexported fields
}

func NewConversationHandler

func NewConversationHandler(stages ConversationStage, end *ConversationEnd) *ConversationHandler

func (*ConversationHandler) CreateHandlerMiddleware

func (c *ConversationHandler) CreateHandlerMiddleware() bot.Middleware

func (*ConversationHandler) EndConversation

func (c *ConversationHandler) EndConversation(chatId int64)

func (*ConversationHandler) SetActiveConversationStage

func (c *ConversationHandler) SetActiveConversationStage(chatId int64, stageId int)

type ConversationStage

type ConversationStage map[int]bot.HandlerFunc

Jump to

Keyboard shortcuts

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