more bugfixes, yay

This commit is contained in:
topkecleon 2016-06-07 02:22:01 -04:00
parent 6fc5320198
commit c6f6fe96b8
3 changed files with 7 additions and 8 deletions

View File

@ -66,7 +66,7 @@ function administration:init(config)
drua.PORT = config.cli_port or 4567
administration.init_flags(config.cmd_pat)
administration.flags = administration.init_flags(config.cmd_pat)
administration.init_command(self, config)
administration.doc = '`Returns a list of administrated groups.\nUse '..config.cmd_pat..'ahelp for more administrative commands.`'
@ -240,7 +240,7 @@ function administration:get_desc(chat_id, config)
if modstring ~= '' then
table.insert(t, '*Moderators:*\n' .. utilities.trim(modstring))
end
table.insert(t, 'Run '..config..'ahelp@' .. self.info.username .. ' for a list of commands.')
table.insert(t, 'Run '..config.cmd_pat..'ahelp@' .. self.info.username .. ' for a list of commands.')
return table.concat(t, '\n\n')
end
@ -282,7 +282,6 @@ function administration.init_command(self_, config)
action = function(self, msg, group, config)
local rank = administration.get_rank(self, msg.from.id, msg.chat.id)
local rank = administration.get_rank(self, msg.from.id, msg.chat.id, config)
local user = {}

View File

@ -19,13 +19,13 @@ Aliases: /g, /google
bing.search_url = 'https://api.datamarket.azure.com/Data.ashx/Bing/Search/Web?Query=\'%s\'&$format=json'
function bing:init()
if not self.config.bing_api_key then
function bing:init(config)
if not config.bing_api_key then
print('Missing config value: bing_api_key.')
print('bing.lua will not be enabled.')
return
end
bing.triggers = utilities.triggers(self.info.username):t('bing', true):t('g', true):t('google', true).table
bing.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('bing', true):t('g', true):t('google', true).table
end
function bing:action(msg)

View File

@ -20,8 +20,8 @@ The following markdown syntax is supported:
Due to the frequent dysfunction and incompletion of the API method used to determine the administrators of a channel, this command may not work for the owners of some channels.
```]]
function channel:init()
channel.triggers = utilities.triggers(self.info.username):t('ch', true).table
function channel:init(config)
channel.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('ch', true).table
end
function channel:action(msg)