Fix muted command not working
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Ethan Lane 2023-08-15 17:59:57 +01:00
parent 2d48a6fde2
commit 456469618b
2 changed files with 16 additions and 2 deletions

View file

@ -54,7 +54,14 @@ export default class Mute extends Command {
}, },
]); ]);
const mutedRole = interaction.guild.roles.cache.find(role => role.name == process.env.ROLES_MUTED); const mutedRoleName = await SettingsHelper.GetSetting('role.muted', interaction.guildId);
if (!mutedRoleName) {
await interaction.reply('Unable to find configuration. Please contact the bot author.');
return;
}
const mutedRole = interaction.guild.roles.cache.find(role => role.name == mutedRoleName);
if (!mutedRole) { if (!mutedRole) {
await interaction.reply('Muted role not found.'); await interaction.reply('Muted role not found.');

View file

@ -52,7 +52,14 @@ export default class Unmute extends Command {
}, },
]); ]);
const mutedRole = interaction.guild.roles.cache.find(role => role.name == process.env.ROLES_MUTED); const mutedRoleName = await SettingsHelper.GetSetting('role.muted', interaction.guildId);
if (!mutedRoleName) {
await interaction.reply('Unable to find configuration. Please contact the bot author.');
return;
}
const mutedRole = interaction.guild.roles.cache.find(role => role.name == mutedRoleName);
if (!mutedRole) { if (!mutedRole) {
await interaction.reply('Muted role not found.'); await interaction.reply('Muted role not found.');