diff --git a/plugins/about.lua b/plugins/about.lua index 0c00ac9..047e071 100755 --- a/plugins/about.lua +++ b/plugins/about.lua @@ -8,7 +8,7 @@ local triggers = { local action = function(msg) -- Filthy hack, but here is where we'll stop forwarded messages from hitting - -- Other plugins. + -- other plugins. if msg.forward_from then return end local output = config.about_text .. '\nBased on @otouto v'..version..' by topkecleon.' diff --git a/plugins/bandersnatch.lua b/plugins/bandersnatch.lua index ae588ae..10fe04b 100755 --- a/plugins/bandersnatch.lua +++ b/plugins/bandersnatch.lua @@ -25,6 +25,8 @@ local action = function(msg) output = firstnames[math.random(#firstnames)] .. ' ' .. lastnames[math.random(#lastnames)] end + output = '_' .. output .. '_' + sendMessage(msg.chat.id, output, true, nil, true) end diff --git a/plugins/calc.lua b/plugins/calc.lua index e6995c7..0d854d1 100755 --- a/plugins/calc.lua +++ b/plugins/calc.lua @@ -28,7 +28,7 @@ local action = function(msg) return end - output = '*Result:* `' .. output .. '`' + output = '`' .. output .. '`' sendMessage(msg.chat.id, output, true, msg.message_id, true) diff --git a/plugins/commit.lua b/plugins/commit.lua index d69bf71..fde1466 100755 --- a/plugins/commit.lua +++ b/plugins/commit.lua @@ -418,7 +418,7 @@ local commits = { 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) end diff --git a/plugins/echo.lua b/plugins/echo.lua index a50639a..fcb1ceb 100755 --- a/plugins/echo.lua +++ b/plugins/echo.lua @@ -15,13 +15,14 @@ local action = function(msg) if not input then sendMessage(msg.chat.id, doc, true, msg.message_id, true) else + input = markdown_escape(input) local output if msg.chat.type == 'supergroup' then - output = 'Echo:\n"' .. markdown_escape(input) .. '"' + output = '*Echo:*\n"' .. input .. '"' else output = latcyr(input) end - sendMessage(msg.chat.id, output, true) + sendMessage(msg.chat.id, output, true, nil, true) end diff --git a/plugins/gImages.lua b/plugins/gImages.lua index 170e29e..7ca7da5 100755 --- a/plugins/gImages.lua +++ b/plugins/gImages.lua @@ -64,7 +64,7 @@ local action = function(msg) if msg.text:match('nsfw') then - output = 'NSFW Image ' .. output + output = '*NSFW*\n' .. output sendMessage(msg.chat.id, output, true, nil, true) else sendMessage(msg.chat.id, output, false, nil, true) diff --git a/plugins/gMaps.lua b/plugins/gMaps.lua index e830e28..b2acc34 100755 --- a/plugins/gMaps.lua +++ b/plugins/gMaps.lua @@ -13,8 +13,6 @@ local triggers = { local action = function(msg) - sendChatAction(msg.chat.id, "find_location") - local input = msg.text:input() if not input then if msg.reply_to_message and msg.reply_to_message.text then diff --git a/plugins/hackernews.lua b/plugins/hackernews.lua index 342be1e..1747bc8 100755 --- a/plugins/hackernews.lua +++ b/plugins/hackernews.lua @@ -11,6 +11,8 @@ local triggers = { local action = function(msg) + sendChatAction(msg.chat.id, 'typing') + local jstr, res = HTTPS.request('https://hacker-news.firebaseio.com/v0/topstories.json') if res ~= 200 then sendReply(msg, config.errors.connection) diff --git a/plugins/imdb.lua b/plugins/imdb.lua index b59d216..f1bd830 100755 --- a/plugins/imdb.lua +++ b/plugins/imdb.lua @@ -35,10 +35,10 @@ local action = function(msg) return end - local output = '[' .. jdat.Title .. '](http://imdb.com/title/' - output = output .. jdat.imdbID .. ') ('.. jdat.Year ..')\n' + local output = '*' .. jdat.Title .. ' ('.. jdat.Year ..')*\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) diff --git a/plugins/nick.lua b/plugins/nick.lua index 5756bfd..d8b97a1 100755 --- a/plugins/nick.lua +++ b/plugins/nick.lua @@ -39,7 +39,7 @@ local action = function(msg) output = target.name .. '\'s nickname has been set to "' .. input .. '".' end - sendMessage(msg.chat.id, output, true, nil, true) + sendReply(msg, output) end diff --git a/plugins/patterns.lua b/plugins/patterns.lua index bbe298a..74c024c 100644 --- a/plugins/patterns.lua +++ b/plugins/patterns.lua @@ -12,8 +12,8 @@ local action = function(msg) local m1, m2 = msg.text:match('^/?s/(.-)/(.-)/?$') if not m2 then return true end output = output:gsub(m1, m2) - output = '*Did you mean:*\n"' .. output:sub(1, 4000) .. '"' - sendMessage(msg.chat.id, output, true, msg.message_id, true) + output = 'Did you mean:\n"' .. output:sub(1, 4000) .. '"' + sendReply(msg.reply_to_message, output) end diff --git a/plugins/ping.lua b/plugins/ping.lua index 323f87c..e6bdee1 100755 --- a/plugins/ping.lua +++ b/plugins/ping.lua @@ -6,7 +6,8 @@ local triggers = { } 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 return { diff --git a/plugins/time.lua b/plugins/time.lua index fc78658..94f1b33 100755 --- a/plugins/time.lua +++ b/plugins/time.lua @@ -43,7 +43,7 @@ local action = function(msg) end 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 diff --git a/plugins/translate.lua b/plugins/translate.lua index 95c59b8..1200a49 100755 --- a/plugins/translate.lua +++ b/plugins/translate.lua @@ -36,7 +36,7 @@ local action = function(msg) end 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) diff --git a/plugins/weather.lua b/plugins/weather.lua index 1c25957..beacdde 100755 --- a/plugins/weather.lua +++ b/plugins/weather.lua @@ -48,7 +48,7 @@ local action = function(msg) local celsius = string.format('%.2f', jdat.main.temp - 273.15) 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)