Advertisement
ii_kinqm1ke

Mute.Unmute script

Jun 5th, 2020
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. commands.on(
  2.   { name: 'mute', filters: discord.command.filters.canMuteMembers() },
  3.  
  4.   (args) => ({
  5.     member: args.guildMember(),
  6.     dur: args.textOptional()
  7.   }),
  8.   async (message, { member, dur }) => {
  9.     await message.delete();
  10.     if (message.author.id === member.user.id) return;
  11.     await member.addRole('Mute Role ID here');
  12.     // if a reason was provided, broadcast it
  13.     if (dur !== null) {
  14.       await message.reply({
  15.         embed: new discord.Embed().setDescription(
  16.           `🔇 **Mute** \n\n**Offender:** ${member.toMention()} \n**Duration:** ${dur} \n**Responsible Moderator:** <@270148059269300224>`
  17.         )
  18.       });
  19.     }
  20.   }
  21. );
  22.  
  23. commands.on(
  24.   { name: 'unmute', filters: discord.command.filters.canMuteMembers() },
  25.  
  26.   (args) => ({
  27.     member: args.guildMember()
  28.   }),
  29.   async (message, { member }) => {
  30.     await message.delete();
  31.     if (message.author.id === member.user.id) return;
  32.     await member.removeRole('Mute ID role here');
  33.     // if a reason was provided, broadcast it
  34.     await message.reply({
  35.       embed: new discord.Embed().setDescription(
  36.         `🔊 **unmute** \n\n**Offender:** ${member.toMention()} \n**Reason:** Automatic unmute made by <@270148059269300224>`
  37.       )
  38.     });
  39.   }
  40. );
  41.  
  42. commands.raw('role', async (message) => {
  43.   // Get the author of the message
  44.   const user = message.author;
  45.  
  46.   // Fetch the guild this message was sent in
  47.   const guild = await message.getGuild();
  48.  
  49.   // Get the channel the message was sent in, note the 'await' keyword
  50.   const channel = await message.getChannel();
  51.  
  52.   // Fetch role data from the guild for all the roles the user has assigned
  53.   const roles = await Promise.all(
  54.     message.member.roles.map((716758432622968926) => guild.getRole(716758432622968926))
  55.   );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement