Fixed multiple issues relating to aliases

This commit is contained in:
Yessiest 2022-04-18 23:27:12 +04:00
parent 559d6d3063
commit 69e5a31808
3 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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)