Add help command

This commit is contained in:
Trevor Slocum 2024-01-19 23:43:10 -08:00
parent 60982417c5
commit 6968c426a4

View file

@ -357,10 +357,16 @@ func (c *Client) HandleEvents() {
log.Printf("*** %s", ev.Message)
case *bgammon.EventSay:
log.Printf("<%s> %s", ev.Player, ev.Message)
if nonAlpha.ReplaceAllString(strings.ToLower(ev.Message), "") == "brb" {
stripped := nonAlpha.ReplaceAllString(strings.ToLower(ev.Message), "")
switch stripped {
case "help":
c.Out <- []byte("say Commands: help, brb, version")
case "brb":
c.lastActivity = time.Now().Add(10 * time.Minute)
c.Out <- []byte("say I will wait 15 minutes for your return.")
} else if nonAlpha.ReplaceAllString(strings.ToLower(ev.Message), "") == "rematch" {
case "version":
c.Out <- []byte("say This bot is running the latest version of Tabula. For more information visit https://code.rocket9labs.com/tslocum/tabula")
case "rematch":
c.Out <- []byte("say Don't forget the slash at the beginning, type: /rematch")
}
case *bgammon.EventList: