tapp

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Public = CommandScope{/* contains filtered or unexported fields */}

Functions

func AddDefaultStart

func AddDefaultStart(commands Commands, registry telegram.CommandRegistry, version string)

Types

type CommandScope

type CommandScope struct {
	ChatIDs, UserIDs colf.Set[telegram.ID]
	// contains filtered or unexported fields
}

func (CommandScope) Labels

func (s CommandScope) Labels() me3x.Labels

func (CommandScope) String added in v0.10.5

func (s CommandScope) String() string

func (CommandScope) Transform

func (s CommandScope) Transform(body func(scope telegram.BotCommandScope))

func (CommandScope) Wrap

func (s CommandScope) Wrap(listener telegram.CommandListener) telegram.CommandListenerFunc

type Commands

type Commands map[telegram.BotCommandScope]map[string]string

func (Commands) Add

func (c Commands) Add(scope telegram.BotCommandScope, command, description string)

func (Commands) AddAll

func (c Commands) AddAll(scope telegram.BotCommandScope, commands ...string)

func (Commands) Set

func (c Commands) Set(ctx context.Context, client telegram.Client) error

type Config added in v0.10.9

type Config struct {
	Token string `yaml:"token" doc:"Telegram Bot API token."`
}

type Context added in v0.10.9

type Context interface {
	TelegramConfig() Config
}

type Listener added in v0.10.5

type Listener interface {
	String() string
	Scoped
}

type Mixin added in v0.10.5

type Mixin[C Context] struct {
	// contains filtered or unexported fields
}

func (*Mixin[C]) AfterInclude added in v0.10.5

func (m *Mixin[C]) AfterInclude(ctx context.Context, app apfel.MixinApp[C], mixin apfel.Mixin[C]) error

func (*Mixin[C]) Bot added in v0.10.5

func (m *Mixin[C]) Bot() *telegram.Bot

func (*Mixin[C]) Include added in v0.10.5

func (m *Mixin[C]) Include(ctx context.Context, app apfel.MixinApp[C]) error

func (*Mixin[C]) Run added in v0.10.5

func (m *Mixin[C]) Run(ctx context.Context)

func (*Mixin[C]) String added in v0.10.5

func (m *Mixin[C]) String() string

type Scoped

type Scoped interface {
	CommandScope() CommandScope
}

Jump to

Keyboard shortcuts

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