v3.0 #145

Merged
Vylpes merged 44 commits from develop into main 2022-04-24 14:46:37 +01:00
Showing only changes of commit 2dc5d0397b - Show all commits

View file

@ -40,18 +40,20 @@ export class Util {
const requiredRoles = itemToUse.Command.Roles; const requiredRoles = itemToUse.Command.Roles;
for (const i in requiredRoles) { if (message.author.id != process.env.BOT_OWNERID && message.author.id != message.guild.ownerId) {
if (message.guild) { for (const i in requiredRoles) {
const setting = await SettingsHelper.GetSetting(`role.${requiredRoles[i]}`, message.guild?.id); if (message.guild) {
const setting = await SettingsHelper.GetSetting(`role.${requiredRoles[i]}`, message.guild?.id);
if (!setting) {
message.reply("Unable to verify if you have this role, please contact your bot administrator"); if (!setting) {
return; message.reply("Unable to verify if you have this role, please contact your bot administrator");
} return;
}
if (!message.member.roles.cache.find(role => role.name == setting)) {
message.reply(`You require the \`${StringTools.Capitalise(setting)}\` role to run this command`); if (!message.member.roles.cache.find(role => role.name == setting)) {
return; message.reply(`You require the \`${StringTools.Capitalise(setting)}\` role to run this command`);
return;
}
} }
} }
} }