Sorry, Tiago. This is why you should use multiple commits.

This commit is contained in:
topkecleon 2016-04-28 14:27:22 -04:00
parent 0483edb0c3
commit f52b255eba
15 changed files with 22 additions and 18 deletions

View File

@ -8,7 +8,7 @@ local triggers = {
local action = function(msg) local action = function(msg)
-- Filthy hack, but here is where we'll stop forwarded messages from hitting -- Filthy hack, but here is where we'll stop forwarded messages from hitting
-- Other plugins. -- other plugins.
if msg.forward_from then return end if msg.forward_from then return end
local output = config.about_text .. '\nBased on @otouto v'..version..' by topkecleon.' local output = config.about_text .. '\nBased on @otouto v'..version..' by topkecleon.'

View File

@ -25,6 +25,8 @@ local action = function(msg)
output = firstnames[math.random(#firstnames)] .. ' ' .. lastnames[math.random(#lastnames)] output = firstnames[math.random(#firstnames)] .. ' ' .. lastnames[math.random(#lastnames)]
end end
output = '_' .. output .. '_'
sendMessage(msg.chat.id, output, true, nil, true) sendMessage(msg.chat.id, output, true, nil, true)
end end

View File

@ -28,7 +28,7 @@ local action = function(msg)
return return
end end
output = '*Result:* `' .. output .. '`' output = '`' .. output .. '`'
sendMessage(msg.chat.id, output, true, msg.message_id, true) sendMessage(msg.chat.id, output, true, msg.message_id, true)

View File

@ -418,7 +418,7 @@ local commits = {
local action = function(msg) local action = function(msg)
local output = '*Commit:* '..commits[math.random(#commits)] local output = '`'..commits[math.random(#commits)]..'`'
sendMessage(msg.chat.id, output, true, nil, true) sendMessage(msg.chat.id, output, true, nil, true)
end end

View File

@ -15,13 +15,14 @@ local action = function(msg)
if not input then if not input then
sendMessage(msg.chat.id, doc, true, msg.message_id, true) sendMessage(msg.chat.id, doc, true, msg.message_id, true)
else else
input = markdown_escape(input)
local output local output
if msg.chat.type == 'supergroup' then if msg.chat.type == 'supergroup' then
output = 'Echo:\n"' .. markdown_escape(input) .. '"' output = '*Echo:*\n"' .. input .. '"'
else else
output = latcyr(input) output = latcyr(input)
end end
sendMessage(msg.chat.id, output, true) sendMessage(msg.chat.id, output, true, nil, true)
end end

View File

@ -64,7 +64,7 @@ local action = function(msg)
if msg.text:match('nsfw') then if msg.text:match('nsfw') then
output = 'NSFW Image ' .. output output = '*NSFW*\n' .. output
sendMessage(msg.chat.id, output, true, nil, true) sendMessage(msg.chat.id, output, true, nil, true)
else else
sendMessage(msg.chat.id, output, false, nil, true) sendMessage(msg.chat.id, output, false, nil, true)

View File

@ -13,8 +13,6 @@ local triggers = {
local action = function(msg) local action = function(msg)
sendChatAction(msg.chat.id, "find_location")
local input = msg.text:input() local input = msg.text:input()
if not input then if not input then
if msg.reply_to_message and msg.reply_to_message.text then if msg.reply_to_message and msg.reply_to_message.text then

View File

@ -11,6 +11,8 @@ local triggers = {
local action = function(msg) local action = function(msg)
sendChatAction(msg.chat.id, 'typing')
local jstr, res = HTTPS.request('https://hacker-news.firebaseio.com/v0/topstories.json') local jstr, res = HTTPS.request('https://hacker-news.firebaseio.com/v0/topstories.json')
if res ~= 200 then if res ~= 200 then
sendReply(msg, config.errors.connection) sendReply(msg, config.errors.connection)

View File

@ -35,10 +35,10 @@ local action = function(msg)
return return
end end
local output = '[' .. jdat.Title .. '](http://imdb.com/title/' local output = '*' .. jdat.Title .. ' ('.. jdat.Year ..')*\n'
output = output .. jdat.imdbID .. ') ('.. jdat.Year ..')\n'
output = output .. jdat.imdbRating ..'/10 | '.. jdat.Runtime ..' | '.. jdat.Genre ..'\n' output = output .. jdat.imdbRating ..'/10 | '.. jdat.Runtime ..' | '.. jdat.Genre ..'\n'
output = output .. '`' .. jdat.Plot .. '`' output = output .. '_' .. jdat.Plot .. '_\n'
output = output .. '[Read more.](http://imdb.com/title/' .. jdat.imdbID .. ')'
sendMessage(msg.chat.id, output, true, nil, true) sendMessage(msg.chat.id, output, true, nil, true)

View File

@ -39,7 +39,7 @@ local action = function(msg)
output = target.name .. '\'s nickname has been set to "' .. input .. '".' output = target.name .. '\'s nickname has been set to "' .. input .. '".'
end end
sendMessage(msg.chat.id, output, true, nil, true) sendReply(msg, output)
end end

View File

@ -12,8 +12,8 @@ local action = function(msg)
local m1, m2 = msg.text:match('^/?s/(.-)/(.-)/?$') local m1, m2 = msg.text:match('^/?s/(.-)/(.-)/?$')
if not m2 then return true end if not m2 then return true end
output = output:gsub(m1, m2) output = output:gsub(m1, m2)
output = '*Did you mean:*\n"' .. output:sub(1, 4000) .. '"' output = 'Did you mean:\n"' .. output:sub(1, 4000) .. '"'
sendMessage(msg.chat.id, output, true, msg.message_id, true) sendReply(msg.reply_to_message, output)
end end

View File

@ -6,7 +6,8 @@ local triggers = {
} }
local action = function(msg) local action = function(msg)
sendMessage(msg.chat.id, msg.text_lower:match('^/ping') and '*Pong!*' or '*Annyong.*', true, nil, true) local output = msg.text_lower:match('^/ping') and 'Pong!' or 'Annyong.'
sendMessage(msg.chat.id, output)
end end
return { return {

View File

@ -43,7 +43,7 @@ local action = function(msg)
end end
local output = '`' .. os.date('%I:%M %p\n', timestamp) .. os.date('%A, %B %d, %Y\n', timestamp) .. jdat.timeZoneName .. ' (UTC' .. utcoff .. ')' .. '`' local output = '`' .. os.date('%I:%M %p\n', timestamp) .. os.date('%A, %B %d, %Y\n', timestamp) .. jdat.timeZoneName .. ' (UTC' .. utcoff .. ')' .. '`'
sendMessage(msg.chat.id, output, true, nil, true) sendMessage(msg.chat.id, output, true, msg.message_id, true)
end end

View File

@ -36,7 +36,7 @@ local action = function(msg)
end end
local output = jdat.text[1] local output = jdat.text[1]
output = '*Translation:*\n"' .. output .. '"' output = '*Translation:*\n"' .. markdown_escape(output) .. '"'
sendMessage(msg.chat.id, output, true, msg.message_id, true) sendMessage(msg.chat.id, output, true, msg.message_id, true)

View File

@ -48,7 +48,7 @@ local action = function(msg)
local celsius = string.format('%.2f', jdat.main.temp - 273.15) local celsius = string.format('%.2f', jdat.main.temp - 273.15)
local fahrenheit = string.format('%.2f', celsius * (9/5) + 32) local fahrenheit = string.format('%.2f', celsius * (9/5) + 32)
local output = celsius .. '°C | ' .. fahrenheit .. '°F, ' .. jdat.weather[1].description .. '.' local output = '`' .. celsius .. '°C | ' .. fahrenheit .. '°F, ' .. jdat.weather[1].description .. '.`'
sendMessage(msg.chat.id, output, true, msg.message_id, true) sendMessage(msg.chat.id, output, true, msg.message_id, true)