diff --git a/plugins/administration.lua b/plugins/administration.lua index d6f551e..277c816 100644 --- a/plugins/administration.lua +++ b/plugins/administration.lua @@ -594,6 +594,25 @@ function administration.init_command(self_) 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 triggers = utilities.triggers(self_.info.username):t('kick', true).table, @@ -637,6 +656,9 @@ function administration.init_command(self_) end if group.bans[target.id_str] then 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.') else group.bans[target.id_str] = true diff --git a/plugins/help.lua b/plugins/help.lua index 0e99280..ca81ed9 100755 --- a/plugins/help.lua +++ b/plugins/help.lua @@ -9,19 +9,23 @@ local utilities = require('utilities') local help_text function help:init() - help_text = '*Available commands:*' + + local commandlist = {} + help_text = '*Available commands:*\n• /' for _,plugin in ipairs(self.plugins) do 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 - help_text = help_text .. [[ + table.insert(commandlist, 'help [command]') + table.sort(commandlist) -• /help -Arguments: \[optional] -]] + help_text = help_text .. table.concat(commandlist, '\n• /') .. '\nArguments: [optional]' + + help_text = help_text:gsub('%[', '\\[') help.triggers = utilities.triggers(self.info.username):t('help', true):t('h', true).table