Update Packages, Add Status Command, and Bugfixes

This commit is contained in:
2024-01-14 20:14:02 +01:00
parent 44d45b7394
commit a869b8529e
9 changed files with 119 additions and 41 deletions

31
modules/status.go Normal file
View File

@@ -0,0 +1,31 @@
package modules
import (
"fmt"
"github.com/yeslayla/birdbot-common/common"
)
type statusModule struct {
portalURL string
}
// NewStatusComponent creates a new component
func NewStatusComponent(portalURL string) common.Module {
m := &statusModule{
portalURL: portalURL,
}
return m
}
func (c *statusModule) Initialize(birdbot common.ModuleManager) error {
birdbot.RegisterCommand("status", common.ChatCommandConfiguration{
Description: "Gets the current status of the bot",
EphemeralResponse: false,
}, func(user common.User, args map[string]any) string {
return fmt.Sprintf("The bot is currently OK.\nSee Status Portal for more information: %s", c.portalURL)
})
return nil
}