Merge branch 'master' into less-magic

This commit is contained in:
Brayden Banks 2016-04-26 20:43:15 -07:00
commit 08d266178d
2 changed files with 32 additions and 6 deletions

View File

@ -594,6 +594,25 @@ function administration.init_command(self_)
end end
}, },
{ -- kickme
triggers = utilities.triggers(self_.info.username):t('leave'):t('kickme').table,
command = 'kickme',
privilege = 1,
interior = true,
action = function(self, msg)
if administration.get_rank(self, msg.from.id) == 5 then
bindings.sendReply(self, msg, 'I can\'t let you do that, '..msg.from.name..'.')
return
end
drua.kick_user(msg.chat.id, msg.from.id)
if msg.chat.type == 'supergroup' then
bindings.unbanChatMember(self, msg.chat.id, msg.from.id)
end
end
},
{ -- kick { -- kick
triggers = utilities.triggers(self_.info.username):t('kick', true).table, triggers = utilities.triggers(self_.info.username):t('kick', true).table,
@ -637,6 +656,9 @@ function administration.init_command(self_)
end end
if group.bans[target.id_str] then if group.bans[target.id_str] then
group.bans[target.id_str] = nil group.bans[target.id_str] = nil
if msg.chat.type == 'supergroup' then
bindings.unbanChatMember(self, msg.chat.id, target.id)
end
bindings.sendReply(self, msg, target.name .. ' has been unbanned.') bindings.sendReply(self, msg, target.name .. ' has been unbanned.')
else else
group.bans[target.id_str] = true group.bans[target.id_str] = true

View File

@ -9,19 +9,23 @@ local utilities = require('utilities')
local help_text local help_text
function help:init() function help:init()
help_text = '*Available commands:*'
local commandlist = {}
help_text = '*Available commands:*\n• /'
for _,plugin in ipairs(self.plugins) do for _,plugin in ipairs(self.plugins) do
if plugin.command then if plugin.command then
help_text = help_text .. '\n• /' .. plugin.command:gsub('%[', '\\[') table.insert(commandlist, plugin.command)
--help_text = help_text .. '\n• /' .. plugin.command:gsub('%[', '\\[')
end end
end end
help_text = help_text .. [[ table.insert(commandlist, 'help [command]')
table.sort(commandlist)
/help <command> help_text = help_text .. table.concat(commandlist, '\n• /') .. '\nArguments: <required> [optional]'
Arguments: <required> \[optional]
]] help_text = help_text:gsub('%[', '\\[')
help.triggers = utilities.triggers(self.info.username):t('help', true):t('h', true).table help.triggers = utilities.triggers(self.info.username):t('help', true):t('h', true).table