birdbot/modules/status.go
Layla 7a01a77986 Update Packages, Add Status Command, and Bugfixes (!8)
Co-authored-by: Layla Manley <layla@layla.gg>
Reviewed-on: #8
2024-01-14 20:17:43 +01:00

32 lines
705 B
Go

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
}