mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 05:54:33 +02:00
Fix Double Error on Single Role
This commit is contained in:
@@ -69,10 +69,8 @@ client.on('message', async (msg) => {
|
|||||||
if (msg.author.bot) return;
|
if (msg.author.bot) return;
|
||||||
if (msg.channel.type !== 'dm') {
|
if (msg.channel.type !== 'dm') {
|
||||||
if (!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES')) return;
|
if (!msg.channel.permissionsFor(client.user).has('SEND_MESSAGES')) return;
|
||||||
const singleRole = msg.guild.settings.get('singleRole');
|
const role = msg.guild.settings.get('singleRole');
|
||||||
if (singleRole)
|
if (role && !msg.member.roles.has(role)) return;
|
||||||
if (!msg.member.roles.has(singleRole))
|
|
||||||
return msg.reply(`Only the ${msg.guild.roles.get(singleRole).name} role may use commands.`);
|
|
||||||
}
|
}
|
||||||
msg.channel.startTyping();
|
msg.channel.startTyping();
|
||||||
const message = msg.content.replace(mention, '');
|
const message = msg.content.replace(mention, '');
|
||||||
|
|||||||
Reference in New Issue
Block a user