diff options
Diffstat (limited to 'handlers/presence.go')
-rw-r--r-- | handlers/presence.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/handlers/presence.go b/handlers/presence.go new file mode 100644 index 0000000..aae28d0 --- /dev/null +++ b/handlers/presence.go @@ -0,0 +1,28 @@ +package handlers + +import ( + "fmt" + + "github.com/bjc/goctl" +) + +type Presence struct{} + +func (ph Presence) Name() string { + return "presence" +} + +func (ph Presence) Help() string { + return "sends available presence broadcast" +} + +func (ph Presence) Run(_ *goctl.Goctl, args []string) string { + if xb == nil { + return "ERROR: bot is not connected." + } + + if err := xb.Online(); err != nil { + return fmt.Sprintf("ERROR: sending available presence: %s", err) + } + return "ok" +} |