Nothing important.

Old local changes I never committed.
This commit is contained in:
topkecleon 2016-02-14 03:47:02 -05:00
parent 7d23fc240e
commit b1b4a0be6c
6 changed files with 21 additions and 6 deletions

View File

@ -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 i,v in ipairs(plugins) do
for k,w in pairs(v.triggers) do for k,w in pairs(v.triggers) do
if string.match(msg.text:lower(), w) then if string.match(msg.text:lower(), w) then
-- a few shortcuts -- a few shortcuts
msg.chat.id_str = tostring(msg.chat.id) msg.chat.id_str = tostring(msg.chat.id)
msg.from.id_str = tostring(msg.from.id) msg.from.id_str = tostring(msg.from.id)

View File

@ -407,7 +407,13 @@ local commits = {
"First Blood", "First Blood",
"Fixed the fuck out of #526!", "Fixed the fuck out of #526!",
"I'm too old for this shit!", "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) local action = function(msg)

View File

@ -27,6 +27,11 @@ local triggers = {
local action = function(msg) local action = function(msg)
do
sendReply(msg, 'This feature is deprecated! Please use @pic or @bing instead.')
return
end
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

@ -8,7 +8,7 @@ Sets your libre.fm username. Otherwise, /np will use your Telegram username. Use
```]] ```]]
local triggers = { local triggers = {
'^/libre[@'..bot.username..']*', '^/librefm[@'..bot.username..']*',
'^/lnp[@'..bot.username..']*', '^/lnp[@'..bot.username..']*',
'^/lfmset[@'..bot.username..']*' '^/lfmset[@'..bot.username..']*'
} }

View File

@ -41,6 +41,10 @@ local action = function(msg)
end end
local jdat = JSON.decode(jstr) 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 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)

View File

@ -1,9 +1,10 @@
-- utilities.lua -- utilities.lua
-- Functions shared among plugins. -- Functions shared among plugins.
HTTP = require('socket.http') -- you're welcome, brayden :^)
HTTPS = require('ssl.https') local HTTP = HTTP or require('socket.http')
JSON = require('dkjson') local HTTPS = HTTPS or require('ssl.https')
local JSON = JSON or require('dkjson')
-- get the indexed word in a string -- get the indexed word in a string
get_word = function(s, i) get_word = function(s, i)