Description

client.on('message', message =>{
//React
  const reactEmojiTick = message.guild.emojis.cache.find(tick => tick.name === 'YourEmojiHere')

//Code
  if (message.content.toLocaleLowerCase().startsWith('mute')){

    if (!message.member.hasPermission('MANAGE_ROLES'))return message.channel.send('You dont have permission to `Mute`');

    let MentionUser = message.mentions.members.first()

    if (!MentionUser) 
    return message.channel.send ('>>> Please mention someone to `Mute` him');

    if (MentionUser){

      const muteRole = message.guild.roles.cache.find(role => role.name === 'Muted')

      if (muteRole){
        
        MentionUser.roles.add(muteRole)
        message.channel.send(new Discord.MessageEmbed()
        .setTitle (`${message.member.guild.name} | Mods`)
        .setColor ('#47ffb3')
        .addFields (
          {name: '❎ | User :', value: '<@' + MentionUser.user.id + '>', inline: true},
          {name: '???? | Server :', value: '`' + MentionUser.guild.name + '`',inline: true},
          {name: '???? | Author :', value: '<@' + message.member.user.id + '>', inline: true}
        )).then(message =>{
          message.react(reactEmojiTick)
          message.delete({timeout: 20000})
       
        
        })
        message.delete({timeout: 30000})
      }

      if (!muteRole){

        message.member.send('Muted role not found | Please use command again (I created `Mute` role)')
        if (message.guild.me.hasPermission('MANAGE_ROLES')){
           return message.guild.roles.create({
            data: {
              name: 'Muted',
              color: 'RED',
              permissions: 'VIEW_CHANNEL'
            }
          })
        }

        if (!message.guild.me.hasPermission('MANAGE_ROLES')) 
        return message.channel.send('somethings is wrong please check my permissions') 
      }
      
  }
}
})







p.n : Thanks for help : Hamburger#9999 

Recent Pastes

Discord.js Meme command

javascript | 6 views | 16 hours, 23 minutes ago

Discord NitroCode Bot || No rate limit

python | 32 views | 2 days, 12 hours ago

fake tst

javascript | 27 views | 3 days, 10 hours ago

VF AntiVirus V2.0

python | 24 views | 4 days, 12 hours ago

Fast Nitro

python | 29 views | 4 days, 15 hours ago