Browse Source

Fixed multiple issues relating to aliases

main
Yessiest 2 years ago
parent
commit
69e5a31808
  1. 4
      libraries/fake_message.lua
  2. 1
      plugins/meta/init.lua
  3. 8
      plugins/security/init.lua

4
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

1
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

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

Loading…
Cancel
Save