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)