removed spaghetti code

updated version number
This commit is contained in:
topkecleon
2015-09-24 19:44:43 -04:00
parent a4b0a7ebed
commit 9a7f166fd4
3 changed files with 8 additions and 27 deletions

View File

@ -14,7 +14,7 @@ function PLUGIN.action(msg)
local message = [[
I am ]] .. bot.first_name .. [[: a plugin-wielding, multi-purpose Telegram bot.
Use /help for a list of commands.
Send /help for a list of commands.
Based on otouto v]] .. VERSION .. [[ by @topkecleon.
otouto v2 is licensed under the GPLv2.

View File

@ -8,7 +8,8 @@ PLUGIN.doc = [[
]]
PLUGIN.triggers = {
'^/youtube'
'^/youtube',
'^/yt'
}
function PLUGIN.action(msg)
@ -28,7 +29,7 @@ function PLUGIN.action(msg)
-- Print Items
local text = ""
for k,item in pairs(data_JSON.items) do
text = text..'http://youtu.be/'..item.id.videoId..' '..item.snippet.title..'\n\n'
text = text .. item.snippet.title .. '\n' .. 'http://youtu.be/' .. item.id.videoId .. '\n\n'
end
-- END - ERRO 404
local text_end = text