Fixed multiple issues relating to aliases
This commit is contained in:
parent
559d6d3063
commit
69e5a31808
|
@ -33,10 +33,10 @@ return function(message,overrides)
|
||||||
tts = message.tts,
|
tts = message.tts,
|
||||||
type = message.type,
|
type = message.type,
|
||||||
webhookId = message.webhookId,
|
webhookId = message.webhookId,
|
||||||
addReaction = function(...)
|
addReaction = function(self,...)
|
||||||
message:addReaction(...)
|
message:addReaction(...)
|
||||||
end,
|
end,
|
||||||
removeReaction = function(...)
|
removeReaction = function(self,...)
|
||||||
message:removeReaction(...)
|
message:removeReaction(...)
|
||||||
end,
|
end,
|
||||||
emulated = true
|
emulated = true
|
||||||
|
|
|
@ -56,6 +56,7 @@ local function remove_alias(name)
|
||||||
if config.aliases[name] then
|
if config.aliases[name] then
|
||||||
config.aliases[name] = nil
|
config.aliases[name] = nil
|
||||||
plugin:remove_command(aliases[name])
|
plugin:remove_command(aliases[name])
|
||||||
|
aliases[name] = nil
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -28,7 +28,9 @@ local grantrole = command("grant-role",{
|
||||||
"role"
|
"role"
|
||||||
},
|
},
|
||||||
exec = function(msg,args,opts)
|
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
|
end
|
||||||
})
|
})
|
||||||
plugin:add_command(grantrole)
|
plugin:add_command(grantrole)
|
||||||
|
@ -50,7 +52,9 @@ local revokerole = command("revoke-role",{
|
||||||
"role"
|
"role"
|
||||||
},
|
},
|
||||||
exec = function(msg,args,opts)
|
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
|
end
|
||||||
})
|
})
|
||||||
plugin:add_command(revokerole)
|
plugin:add_command(revokerole)
|
||||||
|
|
Loading…
Reference in New Issue