From 4c222883967ce04cdfc0200f8a421601cb17756c Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Thu, 23 Jun 2016 21:34:54 +0200 Subject: [PATCH] =?UTF-8?q?-=20Deaktiviere=20"Loading=20plugin"=20Meldung,?= =?UTF-8?q?=20da=20diese=20den=20Start=20und=20Reload=20des=20Bots=20verz?= =?UTF-8?q?=C3=B6gert=20-=20Facebook:=20Wenn=20Bild=20privat=20ist,=20igno?= =?UTF-8?q?riere=20es=20einfach?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- otouto/bot.lua | 2 +- otouto/plugins/facebook.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/otouto/bot.lua b/otouto/bot.lua index 1014bfa..6ec117e 100644 --- a/otouto/bot.lua +++ b/otouto/bot.lua @@ -39,7 +39,7 @@ function bot:init(config) -- The function run when the bot is started or reloade enabled_plugins = load_plugins() for k,v in pairs(enabled_plugins) do local p = require('otouto.plugins.'..v) - print('loading plugin',v) + -- print('loading plugin',v) table.insert(self.plugins, p) self.plugins[k].name = v if p.init then p.init(self, config) end diff --git a/otouto/plugins/facebook.lua b/otouto/plugins/facebook.lua index 17d11cc..cadd012 100644 --- a/otouto/plugins/facebook.lua +++ b/otouto/plugins/facebook.lua @@ -156,8 +156,9 @@ function facebook:action(msg, config, matches) else photo_id = matches[4] end - utilities.send_typing(self, msg.chat.id, 'upload_photo') local text, image_url = facebook:send_facebook_photo(photo_id, receiver) + if not image_url then return end + utilities.send_typing(self, msg.chat.id, 'upload_photo') local file = download_to_file(image_url) utilities.send_reply(self, msg, text, true) utilities.send_photo(self, msg.chat.id, file, nil, msg.message_id)