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
382 B
Go
13 lines
382 B
Go
package main
|
|
|
|
type HiPlugin struct{}
|
|
|
|
func (p HiPlugin) Name() string { return "hi" }
|
|
func (p HiPlugin) ShortHelp() string { return "Get a friendly greeting" }
|
|
func (p HiPlugin) DetailedHelp() string {
|
|
return "hi\n\nSays hello back to you by name."
|
|
}
|
|
func (p HiPlugin) Execute(msg BotMessage, args string) string {
|
|
return "Hello " + msg.User.Name + "! How are you doing today?"
|
|
}
|