Use unique user in unknown command test to avoid last-command fallback interference. Add plugin architecture with registered commands. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
13 lines
364 B
Go
13 lines
364 B
Go
package main
|
|
|
|
type PingPlugin struct{}
|
|
|
|
func (p PingPlugin) Name() string { return "ping" }
|
|
func (p PingPlugin) ShortHelp() string { return "Check if I'm alive" }
|
|
func (p PingPlugin) DetailedHelp() string {
|
|
return "ping\n\nResponds with 'Pong!' to confirm the bot is running."
|
|
}
|
|
func (p PingPlugin) Execute(msg BotMessage, args string) string {
|
|
return "Pong!"
|
|
}
|