Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // If the command is like: -tempMute <mention> <minutes> [reason]
- exports.run = (client, message, [mention, minutes, ...reason]) => {
- // You need to parse those arguments, I'll leave that to you
- // This is the role you want to assign to the user
- let mutedRole = message.guild.roles.find(role => role.name == "Muted");
- // This is the member you want to mute
- let member = message.mentions.members.first();
- // Mute the user
- member.addRole(mutedRole, `Muted by ${message.author.tag} for ${minutes} minutes. Reason: ${reason}`);
- // Unmute them after x minutes
- setTimeout(() => {
- member.removeRole(mutedRole, `Temporary mute expired.`);
- }, minutes * 60000);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement