Tried searching about mute commands, but they were all role based and as I understand setMute is what i need. Which is to mute a specific member without having to mess with any roles, just can't figure how to use the command as anything i try it's either not a function or something is undefined. This is what i have now
let person = message.Client.users.fetch('id');
let reason = ''
person.then(function(personuser) {
personuser.setMute(true, reason);
});
To mute someone, fetch him as a "Guild Member", not "User".
message.guild?.members.fetch("userid").then(member => {
const reason = "reason"
member.voice.setMute(true, reason);
})
If you don't want roles, you can just use time out.
const member = await message.guild.members.fetch(message.author.id);
const time = 60; // Duration for timeout in milliseconds
const reason = 'Deserved it?' // reason for timeout if you have one
await member.timeout(time, reason);
timeouts are handy. u dont have to keep a db for finding out when to unmute/remove role from a user. discord does it for you.