some improvements
This commit is contained in:
parent
c827004bc7
commit
88a506492b
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
plugins/administration.lua
|
@ -9,6 +9,7 @@ return {
|
||||
time_offset = 0,
|
||||
lang = 'en',
|
||||
admin = 00000000,
|
||||
admin_name = 'John Smith',
|
||||
about_text = [[
|
||||
I am otouto, the plugin-wielding, multi-purpose Telegram bot written by topkecleon.
|
||||
|
||||
@ -93,6 +94,7 @@ telegram.me/otouto
|
||||
'bandersnatch.lua',
|
||||
'currency.lua',
|
||||
'cats.lua',
|
||||
'shout.lua',
|
||||
-- Put new plugins here.
|
||||
'help.lua',
|
||||
'greetings.lua'
|
||||
|
@ -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