mirror of
https://github.com/SEPPDROID/zoizbot.git
synced 2025-10-22 07:54:28 +00:00
Last commit. Now it's your turn
This commit is contained in:
22
zoizbot/commands/moderation/addrole.js
Normal file
22
zoizbot/commands/moderation/addrole.js
Normal file
@@ -0,0 +1,22 @@
|
||||
//simple add role to user command.
|
||||
// im done. im not going to finish it, Adios see you in another project
|
||||
exports.run = async (zoizbot, message, args) => {
|
||||
|
||||
if (!message.member.hasPermission("MANAGE_ROLES"))
|
||||
return message.reply("Sorry, you don't have permissions to use this!")
|
||||
|
||||
let member = message.mentions.members.first();
|
||||
let role = message.mentions.roles.first();
|
||||
|
||||
if (!member)
|
||||
return message.reply("Please mention a valid member of this server");
|
||||
if (!role || role.length < 1)
|
||||
return message.reply("Please provide the role you want to add.");
|
||||
|
||||
member.roles.add(role).catch(console.error);
|
||||
|
||||
// TODO: catch the errors and reply . cant be bothered at the moment
|
||||
|
||||
//member.roles.remove(role).catch(console.error); //remove
|
||||
|
||||
}
|
@@ -53,6 +53,9 @@
|
||||
<SubType>Code</SubType>
|
||||
</Content>
|
||||
<Content Include="commands\general\reloadgeneral.js" />
|
||||
<Content Include="commands\moderation\addrole.js">
|
||||
<SubType>Code</SubType>
|
||||
</Content>
|
||||
<Content Include="commands\moderation\ban.js">
|
||||
<SubType>Code</SubType>
|
||||
</Content>
|
||||
|
Reference in New Issue
Block a user