From e7589c418878b130afa07e1dadbbae3c578ff0aa Mon Sep 17 00:00:00 2001 From: Daniel Tam Date: Wed, 10 Jun 2020 01:57:10 -0500 Subject: [PATCH] fixed checking message token and set to correct message token --- bunnybot.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bunnybot.go b/bunnybot.go index a8d9521..f0b88af 100644 --- a/bunnybot.go +++ b/bunnybot.go @@ -65,10 +65,22 @@ func message_create (s *discordgo.Session, m *discordgo.MessageCreate) { // make sure we match our bot's message token if len(m.Content) > 2 { + // get the input token input_token := m.Content[0:2] - if strings.ToLower(string(input_token)) != "t." { + + // check if we match our token + found := false + + // try to find our token + if strings.ToLower(string(input_token)) == "b." || strings.ToLower(string(input_token)) == "//" { + found = true + } + + // return if this message isn't for us + if found == false { return } + } // get our message without our bot's token