Documentation
¶
Index ¶
- func FinishRestart(ctx context.Context, api *tg.Client, ...)
- type AliasPlugin
- type AptPlugin
- type BackupPlugin
- func (p *BackupPlugin) DescEN() string
- func (p *BackupPlugin) Description() string
- func (p *BackupPlugin) Init(_ context.Context, mgr plugin.Manager) error
- func (p *BackupPlugin) Name() string
- func (p *BackupPlugin) SetConfig(path string)
- func (p *BackupPlugin) Start(_ context.Context) error
- func (p *BackupPlugin) Stop(_ context.Context) error
- type DCPlugin
- type ExecPlugin
- type HelpPlugin
- type InfoPlugin
- type LanguagePlugin
- func (p *LanguagePlugin) DescEN() string
- func (p *LanguagePlugin) Description() string
- func (p *LanguagePlugin) Init(_ context.Context, mgr plugin.Manager) error
- func (p *LanguagePlugin) Name() string
- func (p *LanguagePlugin) Start(_ context.Context) error
- func (p *LanguagePlugin) Stop(_ context.Context) error
- type LogPlugin
- type PingPlugin
- type PrefixPlugin
- func (p *PrefixPlugin) DescEN() string
- func (p *PrefixPlugin) Description() string
- func (p *PrefixPlugin) Init(_ context.Context, mgr plugin.Manager) error
- func (p *PrefixPlugin) Name() string
- func (p *PrefixPlugin) Prefixes() []string
- func (p *PrefixPlugin) Start(_ context.Context) error
- func (p *PrefixPlugin) Stop(_ context.Context) error
- type PrunePlugin
- type RePlugin
- type ReloadPlugin
- type RestartPlugin
- func (p *RestartPlugin) DescEN() string
- func (p *RestartPlugin) Description() string
- func (p *RestartPlugin) Init(_ context.Context, mgr plugin.Manager) error
- func (p *RestartPlugin) Name() string
- func (p *RestartPlugin) Restart(ctx *interfaces.CommandContext) error
- func (p *RestartPlugin) Start(_ context.Context) error
- func (p *RestartPlugin) Stop(_ context.Context) error
- type StatusPlugin
- type SudoPlugin
- func (p *SudoPlugin) DescEN() string
- func (p *SudoPlugin) Description() string
- func (p *SudoPlugin) Init(_ context.Context, mgr plugin.Manager) error
- func (p *SudoPlugin) IsSudoUser(userID int64) bool
- func (p *SudoPlugin) Name() string
- func (p *SudoPlugin) Start(_ context.Context) error
- func (p *SudoPlugin) Stop(_ context.Context) error
- type UpdatePlugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AliasPlugin ¶
type AliasPlugin struct {
// contains filtered or unexported fields
}
AliasPlugin manages runtime command aliases with persistent storage. Aliases are expanded once during command parsing; they do not nest.
func NewAlias ¶
func NewAlias() *AliasPlugin
func (*AliasPlugin) DescEN ¶ added in v0.1.1
func (p *AliasPlugin) DescEN() string
func (*AliasPlugin) Description ¶
func (p *AliasPlugin) Description() string
func (*AliasPlugin) Name ¶
func (p *AliasPlugin) Name() string
type AptPlugin ¶
type AptPlugin struct {
// contains filtered or unexported fields
}
AptPlugin manages external plugins. Installed always means loaded.
func (*AptPlugin) Description ¶
type BackupPlugin ¶
type BackupPlugin struct {
// contains filtered or unexported fields
}
BackupPlugin packs bot configuration (config + plugin data) and ships it to Saved Messages; restore reads an archive from a replied message.
func NewBackup ¶
func NewBackup() *BackupPlugin
func (*BackupPlugin) DescEN ¶ added in v0.1.1
func (p *BackupPlugin) DescEN() string
func (*BackupPlugin) Description ¶
func (p *BackupPlugin) Description() string
func (*BackupPlugin) Name ¶
func (p *BackupPlugin) Name() string
func (*BackupPlugin) SetConfig ¶
func (p *BackupPlugin) SetConfig(path string)
SetConfig wires the active config path into backups.
type DCPlugin ¶ added in v0.1.2
type DCPlugin struct{}
DCPlugin tells which data center a user, group or channel lives on. The DC of a profile photo is the only public hint, so targets without a photo cannot be located.
func (*DCPlugin) Description ¶ added in v0.1.2
type ExecPlugin ¶
type ExecPlugin struct{}
ExecPlugin executes shell commands (owner only).
func NewExec ¶
func NewExec() *ExecPlugin
func (*ExecPlugin) DescEN ¶ added in v0.1.1
func (p *ExecPlugin) DescEN() string
func (*ExecPlugin) Description ¶
func (p *ExecPlugin) Description() string
func (*ExecPlugin) Name ¶
func (p *ExecPlugin) Name() string
type HelpPlugin ¶
type HelpPlugin struct {
// contains filtered or unexported fields
}
HelpPlugin lists commands grouped by plugin and shows detailed usage.
func NewHelp ¶
func NewHelp() *HelpPlugin
func (*HelpPlugin) DescEN ¶ added in v0.1.1
func (p *HelpPlugin) DescEN() string
func (*HelpPlugin) Description ¶
func (p *HelpPlugin) Description() string
func (*HelpPlugin) Name ¶
func (p *HelpPlugin) Name() string
type InfoPlugin ¶
type InfoPlugin struct{}
InfoPlugin shows a detailed profile card for a user plus the current chat and message IDs, modeled on TeleBox's ids plugin.
func NewInfo ¶
func NewInfo() *InfoPlugin
func (*InfoPlugin) DescEN ¶ added in v0.1.1
func (p *InfoPlugin) DescEN() string
func (*InfoPlugin) Description ¶
func (p *InfoPlugin) Description() string
func (*InfoPlugin) Name ¶
func (p *InfoPlugin) Name() string
type LanguagePlugin ¶ added in v0.1.1
type LanguagePlugin struct {
// contains filtered or unexported fields
}
LanguagePlugin holds the interface language. It has no command: the language is a setting, switched in the bot panel. The choice is global (one person's userbot) and persists across restarts.
func NewLanguage ¶ added in v0.1.1
func NewLanguage(mgr *i18n.Manager) *LanguagePlugin
func (*LanguagePlugin) DescEN ¶ added in v0.1.1
func (p *LanguagePlugin) DescEN() string
func (*LanguagePlugin) Description ¶ added in v0.1.1
func (p *LanguagePlugin) Description() string
func (*LanguagePlugin) Name ¶ added in v0.1.1
func (p *LanguagePlugin) Name() string
type LogPlugin ¶
type LogPlugin struct {
// contains filtered or unexported fields
}
LogPlugin delivers log files. The level and the delivery target are settings in the bot panel; the command only performs actions.
func (*LogPlugin) Description ¶
type PingPlugin ¶ added in v0.1.1
type PingPlugin struct{}
PingPlugin measures latency to Telegram, its data centers and any host.
func NewPing ¶ added in v0.1.1
func NewPing() *PingPlugin
func (*PingPlugin) DescEN ¶ added in v0.1.1
func (p *PingPlugin) DescEN() string
func (*PingPlugin) Description ¶ added in v0.1.1
func (p *PingPlugin) Description() string
func (*PingPlugin) Name ¶ added in v0.1.1
func (p *PingPlugin) Name() string
type PrefixPlugin ¶
type PrefixPlugin struct {
// contains filtered or unexported fields
}
PrefixPlugin holds the command prefixes. It has no command: prefixes are settings, changed in the bot panel. Defaults come from config.json.
func NewPrefix ¶
func NewPrefix() *PrefixPlugin
func (*PrefixPlugin) DescEN ¶ added in v0.1.1
func (p *PrefixPlugin) DescEN() string
func (*PrefixPlugin) Description ¶
func (p *PrefixPlugin) Description() string
func (*PrefixPlugin) Name ¶
func (p *PrefixPlugin) Name() string
func (*PrefixPlugin) Prefixes ¶ added in v0.1.1
func (p *PrefixPlugin) Prefixes() []string
Prefixes returns main first, then the extras without duplicates.
type PrunePlugin ¶
type PrunePlugin struct {
// contains filtered or unexported fields
}
PrunePlugin deletes messages in the current chat, TeleBox-dme style.
func NewPrune ¶
func NewPrune() *PrunePlugin
func (*PrunePlugin) DescEN ¶ added in v0.1.1
func (p *PrunePlugin) DescEN() string
func (*PrunePlugin) Description ¶
func (p *PrunePlugin) Description() string
func (*PrunePlugin) Name ¶
func (p *PrunePlugin) Name() string
type RePlugin ¶ added in v0.1.1
type RePlugin struct{}
RePlugin repeats replied messages: delete the command, forward the target into this chat, and copy it verbatim where forwarding is banned.
func (*RePlugin) Description ¶ added in v0.1.1
type ReloadPlugin ¶
type ReloadPlugin struct {
// contains filtered or unexported fields
}
ReloadPlugin hot-reloads every external plugin.
func NewReload ¶
func NewReload(pluginLoader *loader.Loader) *ReloadPlugin
func (*ReloadPlugin) DescEN ¶ added in v0.1.1
func (p *ReloadPlugin) DescEN() string
func (*ReloadPlugin) Description ¶
func (p *ReloadPlugin) Description() string
func (*ReloadPlugin) Name ¶
func (p *ReloadPlugin) Name() string
type RestartPlugin ¶ added in v0.1.1
type RestartPlugin struct {
// BeforeRestart lets the app flush state (session, plugins) before the
// process image is replaced.
BeforeRestart func()
}
RestartPlugin re-executes the bot in place.
func NewRestart ¶ added in v0.1.1
func NewRestart() *RestartPlugin
func (*RestartPlugin) DescEN ¶ added in v0.1.1
func (p *RestartPlugin) DescEN() string
func (*RestartPlugin) Description ¶ added in v0.1.1
func (p *RestartPlugin) Description() string
func (*RestartPlugin) Name ¶ added in v0.1.1
func (p *RestartPlugin) Name() string
func (*RestartPlugin) Restart ¶ added in v0.1.1
func (p *RestartPlugin) Restart(ctx *interfaces.CommandContext) error
Restart is exported so update can reuse the same restart flow.
type StatusPlugin ¶
type StatusPlugin struct {
// contains filtered or unexported fields
}
StatusPlugin reports version, host and resource usage.
func (*StatusPlugin) DescEN ¶ added in v0.1.1
func (p *StatusPlugin) DescEN() string
func (*StatusPlugin) Description ¶
func (p *StatusPlugin) Description() string
func (*StatusPlugin) Name ¶
func (p *StatusPlugin) Name() string
type SudoPlugin ¶
type SudoPlugin struct {
// contains filtered or unexported fields
}
SudoPlugin implements permission delegation: the owner can let other Telegram users run the userbot's commands. Granting needs a person from the chat, so add/remove stay commands; the master switch and the list live in the bot panel.
func NewSudo ¶
func NewSudo() *SudoPlugin
func (*SudoPlugin) DescEN ¶ added in v0.1.1
func (p *SudoPlugin) DescEN() string
func (*SudoPlugin) Description ¶
func (p *SudoPlugin) Description() string
func (*SudoPlugin) IsSudoUser ¶
func (p *SudoPlugin) IsSudoUser(userID int64) bool
IsSudoUser reports whether the given user is permitted. Delegation only works while the switch is on.
func (*SudoPlugin) Name ¶
func (p *SudoPlugin) Name() string
type UpdatePlugin ¶
type UpdatePlugin struct {
// contains filtered or unexported fields
}
UpdatePlugin upgrades the running binary from GitHub Releases.
func NewUpdate ¶
func NewUpdate(version string, restart func(*interfaces.CommandContext) error) *UpdatePlugin
func (*UpdatePlugin) DescEN ¶ added in v0.1.1
func (p *UpdatePlugin) DescEN() string
func (*UpdatePlugin) Description ¶
func (p *UpdatePlugin) Description() string
func (*UpdatePlugin) Name ¶
func (p *UpdatePlugin) Name() string