bot

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddApiKeyHandler added in v0.16.0

func AddApiKeyHandler(ctx *ext.Context, update *ext.Update) error

/addapikey <name> <key> <chat_ids...> 仅管理员可用,使用指定明文 key 创建子 API key

func AddHandler

func AddHandler(ctx *ext.Context, update *ext.Update) error

func AddSubHandler

func AddSubHandler(ctx *ext.Context, update *ext.Update) error

func CheckPermission

func CheckPermission(ctx *ext.Context, update *ext.Update) bool

func DelApiKeyHandler added in v0.16.0

func DelApiKeyHandler(ctx *ext.Context, update *ext.Update) error

/delapikey <id>

func DelHandler

func DelHandler(ctx *ext.Context, update *ext.Update) error

func DelSubHandler

func DelSubHandler(ctx *ext.Context, update *ext.Update) error

func DownloadHandler

func DownloadHandler(ctx *ext.Context, update *ext.Update) error

func FilterCallbackHandler

func FilterCallbackHandler(ctx *ext.Context, update *ext.Update) error

func GenApiKeyHandler added in v0.16.0

func GenApiKeyHandler(ctx *ext.Context, update *ext.Update) error

/genapikey

func InlineQueryHandler added in v0.15.0

func InlineQueryHandler(ctx *ext.Context, update *ext.Update) error

func ListApiKeyHandler added in v0.16.0

func ListApiKeyHandler(ctx *ext.Context, update *ext.Update) error

/lsapikey

func ListCallbackHandler added in v1.6.0

func ListCallbackHandler(ctx *ext.Context, update *ext.Update) error

func ListHandler

func ListHandler(ctx *ext.Context, update *ext.Update) error

func ListSubHandler

func ListSubHandler(ctx *ext.Context, update *ext.Update) error

func OcrHandler added in v1.8.0

func OcrHandler(ctx *ext.Context, update *ext.Update) error

func PubHandler

func PubHandler(ctx *ext.Context, update *ext.Update) error

func SearchCallbackHandler

func SearchCallbackHandler(ctx *ext.Context, update *ext.Update) error

func SearchHandler

func SearchHandler(ctx *ext.Context, update *ext.Update) error

func SelectCallbackHandler

func SelectCallbackHandler(ctx *ext.Context, update *ext.Update) error

func SetApiKeyHandler added in v0.16.0

func SetApiKeyHandler(ctx *ext.Context, update *ext.Update) error

/setapikey <id> <chat_ids...>

func StartHandler

func StartHandler(ctx *ext.Context, update *ext.Update) error

func SyncPeersHandler added in v0.13.0

func SyncPeersHandler(ctx *ext.Context, update *ext.Update) error

func UnOcrHandler added in v1.8.0

func UnOcrHandler(ctx *ext.Context, update *ext.Update) error

func UnPubHandler

func UnPubHandler(ctx *ext.Context, update *ext.Update) error

func UnWatchDelHandler

func UnWatchDelHandler(ctx *ext.Context, update *ext.Update) error

func UnWatchHandler

func UnWatchHandler(ctx *ext.Context, update *ext.Update) error

func WatchDelHandler

func WatchDelHandler(ctx *ext.Context, update *ext.Update) error

func WatchHandler

func WatchHandler(ctx *ext.Context, update *ext.Update) error

Types

type Bot

type Bot struct {
	Client     *mygotg.Client
	UserClient *userclient.UserClient
	Engine     engine.Searcher
	// contains filtered or unexported fields
}

func GetBot added in v0.12.0

func GetBot() *Bot

func NewBot

func NewBot(ctx context.Context, userClient *userclient.UserClient, engine engine.Searcher) (*Bot, error)

func (*Bot) GetContext added in v0.12.0

func (b *Bot) GetContext() *ext.Context

func (*Bot) GetUsername added in v0.4.0

func (b *Bot) GetUsername() string

func (*Bot) RegisterHandlers

func (b *Bot) RegisterHandlers(ctx context.Context)

func (*Bot) Start

func (b *Bot) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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