Browse Source

fix index issue

master
David Haukeness 5 years ago
parent
commit
d7e2881354
No known key found for this signature in database
GPG Key ID: 453579B6E4AF3D06
  1. 5
      handlers.go

5
handlers.go

@ -65,7 +65,10 @@ func (b *bot) chatHandler(m chat1.MsgSummary) {
words := strings.Fields(m.Content.Text.Body) words := strings.Fields(m.Content.Text.Body)
// strip the ! from the first word, and lowercase to derive the command // strip the ! from the first word, and lowercase to derive the command
thisCommand := strings.ToLower(strings.Replace(words[0], "!", "", 1)) thisCommand := strings.ToLower(strings.Replace(words[0], "!", "", 1))
maybeSubCommand := strings.ToLower(words[1]) maybeSubCommand := ""
if len(words) > 1 {
maybeSubCommand = strings.ToLower(words[1])
}
// decide if this is askind for extended commands // decide if this is askind for extended commands
switch thisCommand { switch thisCommand {
case "jitsi": case "jitsi":

Loading…
Cancel
Save