xkcd.lua: Removed needless require.
administration.lua: Easier for users to get command list. nick.lua: Swap newlines for spaces. lastfm.lua: Someone was tired writing this. utilities.lua: Remove needless console output.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
--[[
|
||||
administration.lua
|
||||
Version 1.8.2
|
||||
Version 1.8.3
|
||||
Part of the otouto project.
|
||||
© 2016 topkecleon <drew@otou.to>
|
||||
GNU General Public License, version 2
|
||||
@ -26,6 +26,8 @@
|
||||
1.8.2 - Will now attempt to unban users kicked from supergroups. Other small
|
||||
changes.
|
||||
|
||||
1.8.3 - Migrated to new plugin standard. Added /ahelp command to /desc.
|
||||
|
||||
]]--
|
||||
|
||||
local JSON = require('dkjson')
|
||||
@ -222,6 +224,7 @@ function administration:get_desc(chat_id)
|
||||
if modstring ~= '' then
|
||||
table.insert(t, '*Moderators:*\n' .. utilities.trim(modstring))
|
||||
end
|
||||
table.insert(t, 'Run /ahelp@' .. self.info.username .. ' for a list of commands.')
|
||||
return table.concat(t, '\n\n')
|
||||
|
||||
end
|
||||
|
@ -16,8 +16,8 @@ function lastfm:init()
|
||||
lastfm.triggers = utilities.triggers(self.info.username):t('lastfm', true):t('np', true):t('fmset', true).table
|
||||
end
|
||||
|
||||
bindings.command = 'lastfm'
|
||||
bindings.doc = [[```
|
||||
lastfm.command = 'lastfm'
|
||||
lastfm.doc = [[```
|
||||
/np [username]
|
||||
Returns what you are or were last listening to. If you specify a username, info will be returned for that username.
|
||||
|
||||
|
@ -40,6 +40,7 @@ function nick:action(msg)
|
||||
self.database.users[target.id_str].nickname = nil
|
||||
output = target.name .. '\'s nickname has been deleted.'
|
||||
else
|
||||
input = input:gsub('\n', ' ')
|
||||
self.database.users[target.id_str].nickname = input
|
||||
output = target.name .. '\'s nickname has been set to "' .. input .. '".'
|
||||
end
|
||||
|
@ -1,7 +1,6 @@
|
||||
local xkcd = {}
|
||||
|
||||
local HTTP = require('socket.http')
|
||||
local HTTPS = require('ssl.https')
|
||||
local URL = require('socket.url')
|
||||
local JSON = require('dkjson')
|
||||
local bindings = require('bindings')
|
||||
@ -29,7 +28,10 @@ function xkcd:action(msg)
|
||||
|
||||
local input = utilities.input(msg.text)
|
||||
if input then
|
||||
if tonumber(input) then
|
||||
if input == '404' then
|
||||
bindings.sendMessage(self, msg.chat.id, '*404*\nNot found.', false, nil, true)
|
||||
return
|
||||
elseif tonumber(input) then
|
||||
if tonumber(input) > latest then
|
||||
strip_num = latest
|
||||
else
|
||||
@ -49,7 +51,7 @@ function xkcd:action(msg)
|
||||
end
|
||||
local jdat = JSON.decode(jstr)
|
||||
|
||||
local output = '[' .. jdat.num .. '](' .. jdat.img .. ')\n' .. jdat.alt
|
||||
local output = '*' .. jdat.safe_title .. '* ([' .. jdat.num .. '](' .. jdat.img .. '))\n' .. jdat.alt
|
||||
|
||||
bindings.sendMessage(self, msg.chat.id, output, false, nil, true)
|
||||
|
||||
|
Reference in New Issue
Block a user