From 69e5a31808893c188cfe1be91389bd36dc084a8c Mon Sep 17 00:00:00 2001 From: Yessiest Date: Mon, 18 Apr 2022 23:27:12 +0400 Subject: [PATCH] Fixed multiple issues relating to aliases --- libraries/fake_message.lua | 4 ++-- plugins/meta/init.lua | 1 + plugins/security/init.lua | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libraries/fake_message.lua b/libraries/fake_message.lua index aabb107..c912305 100644 --- a/libraries/fake_message.lua +++ b/libraries/fake_message.lua @@ -33,10 +33,10 @@ return function(message,overrides) tts = message.tts, type = message.type, webhookId = message.webhookId, - addReaction = function(...) + addReaction = function(self,...) message:addReaction(...) end, - removeReaction = function(...) + removeReaction = function(self,...) message:removeReaction(...) end, emulated = true diff --git a/plugins/meta/init.lua b/plugins/meta/init.lua index 8c2ecf1..9aedbe5 100644 --- a/plugins/meta/init.lua +++ b/plugins/meta/init.lua @@ -56,6 +56,7 @@ local function remove_alias(name) if config.aliases[name] then config.aliases[name] = nil plugin:remove_command(aliases[name]) + aliases[name] = nil return true else return false diff --git a/plugins/security/init.lua b/plugins/security/init.lua index a0451df..85134e5 100644 --- a/plugins/security/init.lua +++ b/plugins/security/init.lua @@ -28,7 +28,9 @@ local grantrole = command("grant-role",{ "role" }, exec = function(msg,args,opts) - return ((args[2] and msg.guild:getMember(args[2])) or msg.member):addRole(args[1]) + return ((args[2] and + msg.guild:getMember(args[2]:match("%d+")) + ) or msg.member):addRole(args[1]) end }) plugin:add_command(grantrole) @@ -50,7 +52,9 @@ local revokerole = command("revoke-role",{ "role" }, exec = function(msg,args,opts) - return ((args[2] and msg.guild:getMember(args[2])) or msg.member):removeRole(args[1]) + return ((args[2] and + msg.guild:getMember(args[2]:match("%d+"))) + or msg.member):removeRole(args[1]) end }) plugin:add_command(revokerole)