From c8f28679d10b3004fb7f04f54e625284c93e0c70 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Thu, 27 Jul 2017 21:14:04 -0400 Subject: plenty of updates for today --- messagectx.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'messagectx.go') 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 } -- cgit v1.3.1