From 6f74268546ae4eee537c5acc21aa4c8fa03be55f Mon Sep 17 00:00:00 2001 From: Brayden Date: Fri, 15 Jul 2016 12:12:58 -0700 Subject: [PATCH 1/3] Fix your database serialization, Drew --- otouto/plugins/pokemon-go.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/otouto/plugins/pokemon-go.lua b/otouto/plugins/pokemon-go.lua index c2b0a8b..9ded32b 100644 --- a/otouto/plugins/pokemon-go.lua +++ b/otouto/plugins/pokemon-go.lua @@ -21,6 +21,9 @@ Set your Pokémon Go team for statistical purposes. The team must be valid, and if not db.membership then db.membership = {} end + for _, set in pairs(db.membership) do + setmetatable(set, utilities.set_meta) + end end local team_ref = { From 8b6bf53ccaadd27608ff97d451a734cf7530c72b Mon Sep 17 00:00:00 2001 From: topkecleon Date: Fri, 15 Jul 2016 15:24:20 -0400 Subject: [PATCH 2/3] blacklist.lua: Will now leave a blacklisted group. --- otouto/bot.lua | 4 ++++ otouto/plugins/blacklist.lua | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/otouto/bot.lua b/otouto/bot.lua index 6569714..0756878 100755 --- a/otouto/bot.lua +++ b/otouto/bot.lua @@ -88,6 +88,10 @@ function bot:on_msg_receive(msg, config) -- The fn run whenever a message is rec msg.text = msg.text or msg.caption or '' msg.text_lower = msg.text:lower() + if msg.reply_to_message then + msg.reply_to_message.text = msg.reply_to_message.text or msg.reply_to_message.caption or '' + end + -- Support deep linking. if msg.text:match('^'..config.cmd_pat..'start .+') then msg.text = config.cmd_pat .. utilities.input(msg.text) diff --git a/otouto/plugins/blacklist.lua b/otouto/plugins/blacklist.lua index 33cebb7..281ddb5 100755 --- a/otouto/plugins/blacklist.lua +++ b/otouto/plugins/blacklist.lua @@ -4,6 +4,7 @@ local blacklist = {} local utilities = require('otouto.utilities') +local bindings = require('otouto.bindings') function blacklist:init() if not self.database.blacklist then @@ -15,8 +16,13 @@ blacklist.triggers = { '' } +blacklist.error = false + function blacklist:action(msg, config) - if self.database.blacklist[tostring(msg.from.id)] or self.database.blacklist[tostring(msg.chat.id)] then + if self.database.blacklist[tostring(msg.from.id)] then + return + elseif self.database.blacklist[tostring(msg.chat.id)] then + bindings.leaveChat(self, { chat_id = msg.chat.id }) return end if not ( From 22e41ee2fe7266218b1619a782d43034e0355be0 Mon Sep 17 00:00:00 2001 From: topkecleon Date: Fri, 15 Jul 2016 15:36:33 -0400 Subject: [PATCH 3/3] blacklist.lua bugfix --- otouto/plugins/blacklist.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/otouto/plugins/blacklist.lua b/otouto/plugins/blacklist.lua index 281ddb5..4feab99 100755 --- a/otouto/plugins/blacklist.lua +++ b/otouto/plugins/blacklist.lua @@ -37,6 +37,7 @@ function blacklist:action(msg, config) local targets = {} if msg.reply_to_message then table.insert(targets, { + id = msg.reply_to_message.from.id, id_str = tostring(msg.reply_to_message.from.id), name = utilities.build_name(msg.reply_to_message.from.first_name, msg.reply_to_message.from.last_name) })