Mercurial > public > pacobot
view bot/bot.go @ 13:e7ab74d2ad88 default tip
Move to mercurial
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Wed, 04 Jun 2025 09:38:35 +0100 |
parents | 5c124578fed2 |
children |
line wrap: on
line source
package bot import ( "log" "strconv" ) func HandleCmd(cmd []string) { cmdReceived := cmd[0] log.Printf("bot: %s command received", cmdReceived) switch cmdReceived { case "timer": seconds, err := strconv.Atoi(cmd[1]) if err != nil { log.Fatal("bot: invalid command arguments") } startTimer(seconds) } }