.setDescription("Mutes a user (prevents them from speaking) for a designated amount of time")
.addField("Permissions","You must have Manage Messages in your server in order to mute members.")
.addField("Duration Syntax","By default, a member will be muted for one hour. However, you can specify <x>m or <x>h to mute a user for a set time. Ex: `mute @user 30m` or `mute @user 2h`. Max is 48h.")
if(!message.member.permissions.has("MANAGE_MESSAGES")){returnmessage.reply("You need to have Manage Messages permissions in this server to be able to do that.");}
if(!message.guild.me.permissions.has("MANAGE_ROLES")){returnmessage.reply("I don't have permissions to manage roles in this server, which I need to have in order to mute members.");}
if(message.guild.me.roles.highest.position<=person.roles.highest.position){returnmessage.reply("I don't have permissions to mute that member, as their highest role is equal to or above mine.");}
if(person.roles.cache.has(muted)){returnmessage.reply("That person is already muted!");}
if(message.guild.roles.cache.get(muted).position<=person.roles.highest.position){returnmessage.reply("I don't have permissions to mute that member as their highest role is above or equal to the muted role!");}
if(person.roles.highest.positon>=message.guild.roles.cache.get(muted)){returnmessage.reply("You can't mute that member as their highest role is higher than the muted role (in other words they are a moderator or admin of the server)");}
).catch(()=>message.channel.send("There was an error while trying to mute that member. I may not have the correct permissions, or something else went wrong."));