Browse Source

changed command availability

master
David Haukeness 5 years ago
parent
commit
8b9d5897bd
No known key found for this signature in database
GPG Key ID: 54F2372DDB7F9462
  1. 5
      handlers.go
  2. 5
      main.go

5
handlers.go

@ -50,8 +50,11 @@ func (b *bot) chatHandler(m chat1.MsgSummary) { @@ -50,8 +50,11 @@ func (b *bot) chatHandler(m chat1.MsgSummary) {
// if the message is @myusername just perform the default function
if strings.HasPrefix(m.Content.Text.Body, fmt.Sprintf("@%s", b.k.Username)) {
words := strings.Fields(m.Content.Text.Body)
switch words[0] {
case "meet":
b.setupMeeting(m.ConvID, m.Id, words, m.Channel.MembersType)
}
}
// its a command for me, iterate through extended commands
if strings.HasPrefix(m.Content.Text.Body, "!") {
// break up the message into words
@ -60,8 +63,6 @@ func (b *bot) chatHandler(m chat1.MsgSummary) { @@ -60,8 +63,6 @@ func (b *bot) chatHandler(m chat1.MsgSummary) {
thisCommand := strings.ToLower(strings.Replace(words[0], "!", "", 1))
// decide if this is askind for extended commands
switch thisCommand {
case "meeting":
fallthrough
case "jitsi":
b.setupMeeting(m.ConvID, m.Id, words, m.Channel.MembersType)
default:

5
main.go

@ -62,11 +62,6 @@ func (b *bot) registerCommands() { @@ -62,11 +62,6 @@ func (b *bot) registerCommands() {
Description: "Starts a meet.jit.si meeting",
Usage: "",
},
{
Name: "meeting",
Description: "Starts a meet.jit.si meeting",
Usage: "",
},
},
},
},

Loading…
Cancel
Save