diff --git a/bot.lua b/bot.lua index 0e40a94..577ef47 100755 --- a/bot.lua +++ b/bot.lua @@ -50,7 +50,6 @@ on_msg_receive = function(msg) -- The fn run whenever a message is received. for i,v in ipairs(plugins) do for k,w in pairs(v.triggers) do if string.match(msg.text:lower(), w) then - -- a few shortcuts msg.chat.id_str = tostring(msg.chat.id) msg.from.id_str = tostring(msg.from.id) diff --git a/plugins/commit.lua b/plugins/commit.lua index 0f4a342..e0e73f4 100755 --- a/plugins/commit.lua +++ b/plugins/commit.lua @@ -407,7 +407,13 @@ local commits = { "First Blood", "Fixed the fuck out of #526!", "I'm too old for this shit!", - "One little whitespace gets its very own commit! Oh, life is so erratic!" + "One little whitespace gets its very own commit! Oh, life is so erratic!", + "please dont let this be the problem", + "good: no crash. bad: nothing happens", + "trying", + "trying harder", + "i tried", + "fml" } local action = function(msg) diff --git a/plugins/gImages.lua b/plugins/gImages.lua index 79fb45d..b284c8f 100755 --- a/plugins/gImages.lua +++ b/plugins/gImages.lua @@ -27,6 +27,11 @@ local triggers = { local action = function(msg) + do + sendReply(msg, 'This feature is deprecated! Please use @pic or @bing instead.') + return + end + 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/librefm.lua b/plugins/librefm.lua index e09ef31..b49f590 100644 --- a/plugins/librefm.lua +++ b/plugins/librefm.lua @@ -8,7 +8,7 @@ Sets your libre.fm username. Otherwise, /np will use your Telegram username. Use ```]] local triggers = { - '^/libre[@'..bot.username..']*', + '^/librefm[@'..bot.username..']*', '^/lnp[@'..bot.username..']*', '^/lfmset[@'..bot.username..']*' } diff --git a/plugins/weather.lua b/plugins/weather.lua index 34ce5b9..3f42618 100755 --- a/plugins/weather.lua +++ b/plugins/weather.lua @@ -41,6 +41,10 @@ local action = function(msg) end local jdat = JSON.decode(jstr) + if jdat.cod ~= 200 then + sendReply(msg, 'Error: City not found.') + return + end local celsius = string.format('%.2f', jdat.main.temp - 273.15) local fahrenheit = string.format('%.2f', celsius * (9/5) + 32) diff --git a/utilities.lua b/utilities.lua index 834e511..e915b08 100755 --- a/utilities.lua +++ b/utilities.lua @@ -1,9 +1,10 @@ -- utilities.lua -- Functions shared among plugins. -HTTP = require('socket.http') -HTTPS = require('ssl.https') -JSON = require('dkjson') + -- you're welcome, brayden :^) +local HTTP = HTTP or require('socket.http') +local HTTPS = HTTPS or require('ssl.https') +local JSON = JSON or require('dkjson') -- get the indexed word in a string get_word = function(s, i)