📅  最后修改于: 2022-03-11 14:58:34.047000             🧑  作者: Mango
// get the role by id:
const mutedRole = message.guild.roles.cache.get('');
// or, if you can't get the id:
const mutedRole = message.guild.roles.cache.find(
(role) => role.name === 'Muted'
);
// if there is no `Muted` role, send an error
if (!mutedRole)
return message.channel.send('There is no Muted role on this server');