some improvements
This commit is contained in:
@ -10,6 +10,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)
|
||||
|
@ -15,8 +15,12 @@ local action = function(msg)
|
||||
end
|
||||
|
||||
local output = loadstring(input)()
|
||||
if not output then output = 'Done!' end
|
||||
sendReply(msg, output)
|
||||
if not output then
|
||||
output = 'Done!'
|
||||
else
|
||||
output = '```\n' .. output .. '\n```'
|
||||
end
|
||||
sendMessage(msg.chat.id, output, true, msg.message_id, true)
|
||||
|
||||
end
|
||||
|
||||
|
@ -15,8 +15,12 @@ local action = function(msg)
|
||||
end
|
||||
|
||||
local output = io.popen(input):read('*all')
|
||||
if output:len() == 0 then output = 'Done!' end
|
||||
sendReply(msg, output)
|
||||
if output:len() == 0 then
|
||||
output = 'Done!'
|
||||
else
|
||||
output = '```\n' .. output .. '\n```'
|
||||
end
|
||||
sendMessage(msg.chat.id, output, true, msg.message_id, true)
|
||||
|
||||
end
|
||||
|
||||
|
@ -15,6 +15,11 @@ local action = function(msg)
|
||||
sendReply(msg, doc)
|
||||
return
|
||||
end
|
||||
input = input:trim()
|
||||
|
||||
if input:len() > 20 then
|
||||
input = input:sub(1,20)
|
||||
end
|
||||
|
||||
input = input:upper()
|
||||
local output = ''
|
||||
|
Reference in New Issue
Block a user