aboutsummaryrefslogtreecommitdiff
path: root/messagectx.go
diff options
context:
space:
mode:
authorNathan Perry <avaglir@gmail.com>2017-07-27 21:14:04 -0400
committerNathan Perry <avaglir@gmail.com>2017-07-27 21:14:04 -0400
commitc8f28679d10b3004fb7f04f54e625284c93e0c70 (patch)
tree36834e113aa2376989b5d78c383a0ded0136ed8c /messagectx.go
parentc6e5779f22b18b971f82ddd2c5de81015ac9740c (diff)
plenty of updates for today
Diffstat (limited to 'messagectx.go')
-rw-r--r--messagectx.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/messagectx.go b/messagectx.go
index ee38f5f..75d6ce6 100644
--- a/messagectx.go
+++ b/messagectx.go
@@ -25,6 +25,8 @@ func newCtx(s *discordgo.Session, m *discordgo.MessageCreate) (*messageCtx, erro
matches := regex.FindStringSubmatch(m.Content)
command := ""
+ log.Debugf("matches: %v", matches)
+
if len(matches) != 0 {
command = strings.Split(matches[1], " ")[0]
}
@@ -66,7 +68,7 @@ func newCtx(s *discordgo.Session, m *discordgo.MessageCreate) (*messageCtx, erro
MessageCreate: m,
Command: command,
- Matched: len(matches) == 0,
+ Matched: len(matches) != 0,
Channel: channel,
Guild: guild,
@@ -75,7 +77,7 @@ func newCtx(s *discordgo.Session, m *discordgo.MessageCreate) (*messageCtx, erro
}
func (ctx *messageCtx) sendMessage(str string, tts bool) {
- if !ctx.Tts {
+ if !tts {
ctx.ChannelMessageSend(ctx.ChannelID, str)
return
}