Documentation
¶
Index ¶
- type AdminPlugin
- type AliasPlugin
- type AutofixPlugin
- type BFPlugin
- type CorePlugin
- type CronPlugin
- type DebugPlugin
- type ExecPlugin
- type FunPlugin
- type GrowthStatus
- type HealthConfig
- type HealthPlugin
- type HelpPlugin
- type InfoPlugin
- type KittPlugin
- type KittTask
- type LeechDB
- type LeechJob
- type LeechMessage
- type LeechPlugin
- type LogLevelPlugin
- type LogPlugin
- type MemInfo
- type NotePlugin
- type PPMPlugin
- type PrefixPlugin
- type RePlugin
- type ReloadPlugin
- type RemindPlugin
- type SaveDB
- type SavePlugin
- type SavedFile
- type SendLogConfig
- type SendLogPlugin
- type StatusPlugin
- type SudoPlugin
- type UserConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminPlugin ¶
type AdminPlugin struct {
// contains filtered or unexported fields
}
AdminPlugin provides owner-only system commands.
func NewAdmin ¶
func NewAdmin() *AdminPlugin
func (*AdminPlugin) Description ¶
func (p *AdminPlugin) Description() string
func (*AdminPlugin) Name ¶
func (p *AdminPlugin) Name() string
type AliasPlugin ¶
type AliasPlugin struct {
// contains filtered or unexported fields
}
AliasPlugin manages command aliases with persistent storage.
func NewAlias ¶
func NewAlias() *AliasPlugin
func (*AliasPlugin) Description ¶
func (p *AliasPlugin) Description() string
func (*AliasPlugin) Name ¶
func (p *AliasPlugin) Name() string
type AutofixPlugin ¶
type AutofixPlugin struct {
// contains filtered or unexported fields
}
AutofixPlugin provides one-click fix: git sync + restart. Inspired by TeleBox's autofix plugin.
func NewAutofix ¶
func NewAutofix() *AutofixPlugin
func (*AutofixPlugin) Description ¶
func (p *AutofixPlugin) Description() string
func (*AutofixPlugin) Name ¶
func (p *AutofixPlugin) Name() string
type BFPlugin ¶
type BFPlugin struct {
// contains filtered or unexported fields
}
BFPlugin provides backup and restore functionality.
func (*BFPlugin) Description ¶
type CorePlugin ¶
type CorePlugin struct {
// contains filtered or unexported fields
}
CorePlugin provides fundamental startup/shutdown commands. This is the minimal core — help, status, ppm are separate plugins.
func NewCore ¶
func NewCore(version string) *CorePlugin
func (*CorePlugin) Description ¶
func (p *CorePlugin) Description() string
func (*CorePlugin) Name ¶
func (p *CorePlugin) Name() string
type CronPlugin ¶
type CronPlugin struct {
// contains filtered or unexported fields
}
CronPlugin provides cron management commands.
func NewCron ¶
func NewCron(cronMgr *cron.Manager) *CronPlugin
func (*CronPlugin) Description ¶
func (p *CronPlugin) Description() string
func (*CronPlugin) Name ¶
func (p *CronPlugin) Name() string
type DebugPlugin ¶
type DebugPlugin struct{}
DebugPlugin provides debugging and profiling commands.
func NewDebug ¶
func NewDebug() *DebugPlugin
func (*DebugPlugin) Description ¶
func (p *DebugPlugin) Description() string
func (*DebugPlugin) Name ¶
func (p *DebugPlugin) Name() string
type ExecPlugin ¶
type ExecPlugin struct{}
ExecPlugin executes system commands (owner only).
func NewExec ¶
func NewExec() *ExecPlugin
func (*ExecPlugin) Description ¶
func (p *ExecPlugin) Description() string
func (*ExecPlugin) Name ¶
func (p *ExecPlugin) Name() string
type FunPlugin ¶
type FunPlugin struct{}
FunPlugin provides entertainment commands.
func (*FunPlugin) Description ¶
type GrowthStatus ¶
type HealthConfig ¶
type HealthConfig struct {
Enabled bool `json:"enabled"`
MemoryThresholdMB float64 `json:"memory_threshold_mb"` // Heap threshold
RSSThresholdMB float64 `json:"rss_threshold_mb"` // RSS threshold
GrowthThresholdMB float64 `json:"growth_threshold_mb"` // Growth from baseline
BaselineHeapMB float64 `json:"baseline_heap_mb"` // Baseline heap
BaselineRSSMB float64 `json:"baseline_rss_mb"` // Baseline RSS
BaselineMode string `json:"baseline_mode"` // "on-enable", "manual", "on-reload"
SilentEnabled bool `json:"silent_enabled"` // Silent notifications
SoftStreak int `json:"soft_streak"` // Consecutive samples before GC/reload
HardStreak int `json:"hard_streak"` // Consecutive samples before restart
ActionCooldownMin int `json:"action_cooldown_min"` // Cooldown between actions (minutes)
BusyDeferMaxMin int `json:"busy_defer_max_min"` // Max defer when busy (minutes)
LastActionAt int64 `json:"last_action_at"` // Unix timestamp
OverThresholdStreak int `json:"-"` // Runtime state
BusyDeferSince int64 `json:"-"` // Runtime state
LastGcAt int64 `json:"-"` // Runtime state
LastSample MemInfo `json:"-"` // Runtime state
}
type HealthPlugin ¶
type HealthPlugin struct {
// contains filtered or unexported fields
}
HealthPlugin provides memory monitoring with auto GC/reload/restart. Inspired by TeleBox's Health plugin but implemented in Go.
func NewHealth ¶
func NewHealth() *HealthPlugin
func (*HealthPlugin) Description ¶
func (p *HealthPlugin) Description() string
func (*HealthPlugin) Name ¶
func (p *HealthPlugin) Name() string
type HelpPlugin ¶
type HelpPlugin struct {
// contains filtered or unexported fields
}
HelpPlugin provides help and command discovery. This is the primary user-facing help system and MUST be built-in.
func NewHelp ¶
func NewHelp() *HelpPlugin
func (*HelpPlugin) Description ¶
func (p *HelpPlugin) Description() string
func (*HelpPlugin) Name ¶
func (p *HelpPlugin) Name() string
type InfoPlugin ¶
type InfoPlugin struct{}
InfoPlugin shows user/chat info.
func NewInfo ¶
func NewInfo() *InfoPlugin
func (*InfoPlugin) Description ¶
func (p *InfoPlugin) Description() string
func (*InfoPlugin) Name ¶
func (p *InfoPlugin) Name() string
type KittPlugin ¶
type KittPlugin struct {
// contains filtered or unexported fields
}
KittPlugin provides advanced trigger system (match -> execute). Inspired by TeleBox's Kitt plugin but implemented in Go.
func NewKitt ¶
func NewKitt() *KittPlugin
func (*KittPlugin) Description ¶
func (p *KittPlugin) Description() string
func (*KittPlugin) Name ¶
func (p *KittPlugin) Name() string
type LeechDB ¶
type LeechDB struct {
Jobs []LeechJob `json:"jobs"`
Messages []LeechMessage `json:"messages"`
}
type LeechJob ¶
type LeechJob struct {
ID string `json:"id"`
Target string `json:"target"`
ChatTitle string `json:"chat_title"`
ChatType string `json:"chat_type"`
FromDate time.Time `json:"from_date"`
ToDate time.Time `json:"to_date"`
BatchSize int `json:"batch_size"`
Limit int `json:"limit"`
Status string `json:"status"` // running, completed, failed, stopped
SavedCount int `json:"saved_count"`
ScannedCount int `json:"scanned_count"`
StoppedReason string `json:"stopped_reason,omitempty"`
StartedAt time.Time `json:"started_at"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
}
type LeechMessage ¶
type LeechMessage struct {
JobID string `json:"job_id"`
MessageID int64 `json:"message_id"`
ChatID string `json:"chat_id"`
SenderID string `json:"sender_id"`
Text string `json:"text"`
Date time.Time `json:"date"`
HasMedia bool `json:"has_media"`
MediaType string `json:"media_type,omitempty"`
MediaFilePath string `json:"media_file_path,omitempty"`
}
type LeechPlugin ¶
type LeechPlugin struct {
// contains filtered or unexported fields
}
LeechPlugin archives messages from chats/groups/channels to local SQLite. Inspired by TeleBox's leech plugin.
func NewLeech ¶
func NewLeech() *LeechPlugin
func (*LeechPlugin) Description ¶
func (p *LeechPlugin) Description() string
func (*LeechPlugin) Name ¶
func (p *LeechPlugin) Name() string
type LogLevelPlugin ¶
type LogLevelPlugin struct {
// contains filtered or unexported fields
}
LogLevelPlugin provides runtime log level changes. Inspired by TeleBox's loglevel plugin.
func NewLogLevel ¶
func NewLogLevel() *LogLevelPlugin
func (*LogLevelPlugin) Description ¶
func (p *LogLevelPlugin) Description() string
func (*LogLevelPlugin) Name ¶
func (p *LogLevelPlugin) Name() string
type LogPlugin ¶
type LogPlugin struct {
// contains filtered or unexported fields
}
LogPlugin provides log viewing and management commands.
func (*LogPlugin) Description ¶
type NotePlugin ¶
type NotePlugin struct {
// contains filtered or unexported fields
}
NotePlugin provides simple notes.
func NewNote ¶
func NewNote() *NotePlugin
func (*NotePlugin) Description ¶
func (p *NotePlugin) Description() string
func (*NotePlugin) Name ¶
func (p *NotePlugin) Name() string
type PPMPlugin ¶
type PPMPlugin struct {
// contains filtered or unexported fields
}
PPMPlugin — Plugin Package Manager. Full lifecycle: search, install, remove, load, unload, reload, list, info.
func (*PPMPlugin) Description ¶
type PrefixPlugin ¶
type PrefixPlugin struct {
// contains filtered or unexported fields
}
PrefixPlugin manages command prefixes with persistent storage.
func NewPrefix ¶
func NewPrefix() *PrefixPlugin
func (*PrefixPlugin) Description ¶
func (p *PrefixPlugin) Description() string
func (*PrefixPlugin) Name ¶
func (p *PrefixPlugin) Name() string
type RePlugin ¶
type RePlugin struct{}
RePlugin repeats messages (复读机).
func (*RePlugin) Description ¶
type ReloadPlugin ¶
type ReloadPlugin struct {
// contains filtered or unexported fields
}
ReloadPlugin provides hot-reload functionality for external plugins.
func NewReload ¶
func NewReload(pluginLoader *loader.Loader) *ReloadPlugin
func (*ReloadPlugin) Description ¶
func (p *ReloadPlugin) Description() string
func (*ReloadPlugin) Name ¶
func (p *ReloadPlugin) Name() string
type RemindPlugin ¶
type RemindPlugin struct {
// contains filtered or unexported fields
}
RemindPlugin provides reminder functionality.
func NewRemind ¶
func NewRemind() *RemindPlugin
func (*RemindPlugin) Description ¶
func (p *RemindPlugin) Description() string
func (*RemindPlugin) Name ¶
func (p *RemindPlugin) Name() string
type SaveDB ¶
type SaveDB struct {
Users map[string]UserConfig `json:"users"`
}
type SavePlugin ¶
type SavePlugin struct {
// contains filtered or unexported fields
}
SavePlugin saves/forwards messages with metadata, bypassing forward limits. Inspired by TeleBox's save plugin.
func NewSave ¶
func NewSave() *SavePlugin
func (*SavePlugin) Description ¶
func (p *SavePlugin) Description() string
func (*SavePlugin) Name ¶
func (p *SavePlugin) Name() string
type SavedFile ¶
type SavedFile struct {
FilePath string `json:"file_path"`
MetadataPath string `json:"metadata_path"`
RelativeFilePath string `json:"relative_file_path"`
SourceChatID string `json:"source_chat_id"`
SourceChatTitle string `json:"source_chat_title"`
SourceMessageID int64 `json:"source_message_id"`
SourceLink string `json:"source_link"`
MediaType string `json:"media_type"`
GroupedID string `json:"grouped_id,omitempty"`
SavedAt time.Time `json:"saved_at"`
}
type SendLogConfig ¶
type SendLogConfig struct {
Target string `json:"target"` // "me", chatID, or @username
}
type SendLogPlugin ¶
type SendLogPlugin struct {
// contains filtered or unexported fields
}
SendLogPlugin sends log files to chat. Inspired by TeleBox's sendlog plugin.
func NewSendLog ¶
func NewSendLog() *SendLogPlugin
func (*SendLogPlugin) Description ¶
func (p *SendLogPlugin) Description() string
func (*SendLogPlugin) Name ¶
func (p *SendLogPlugin) Name() string
type StatusPlugin ¶
type StatusPlugin struct {
// contains filtered or unexported fields
}
StatusPlugin provides detailed system status and metrics.
func NewStatus ¶
func NewStatus(version string) *StatusPlugin
func (*StatusPlugin) Description ¶
func (p *StatusPlugin) Description() string
func (*StatusPlugin) Name ¶
func (p *StatusPlugin) Name() string
type SudoPlugin ¶
type SudoPlugin struct{}
SudoPlugin executes commands with sudo (owner only).
func NewSudo ¶
func NewSudo() *SudoPlugin
func (*SudoPlugin) Description ¶
func (p *SudoPlugin) Description() string
func (*SudoPlugin) Name ¶
func (p *SudoPlugin) Name() string