From c84befa6b23bf9fb2e7250d118964489e40f8149 Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Wed, 13 Jul 2016 02:01:02 +0200 Subject: [PATCH] Username des Bots wird jetzt nur noch einmal korrekt rausgeschnitten --- otouto/bot.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/otouto/bot.lua b/otouto/bot.lua index e0b16f0..b715748 100644 --- a/otouto/bot.lua +++ b/otouto/bot.lua @@ -104,8 +104,10 @@ function bot:on_msg_receive(msg, config) -- The fn run whenever a message is rec end -- gsub out user name if multiple bots are in the same group - msg.text = string.gsub(msg.text, '@'..self.info.username, "") - msg.text_lower = string.gsub(msg.text, '@'..string.lower(self.info.username), "") + if msg.text:match(config.cmd_pat..'([A-Za-z0-9-_-]+)@'..self.info.username) then + msg.text = string.gsub(msg.text, '@'..self.info.username, "") + msg.text_lower = msg.text:lower() + end msg = pre_process_msg(self, msg, config)