mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 01:53:51 +02:00
Clean-ups
This commit is contained in:
@@ -16,24 +16,20 @@ class XiaoCommand extends Command {
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
if (this.ownerOnly && !this.client.isOwner(msg.author)) {
|
||||
return 'This Command can only be used by the bot owner.';
|
||||
}
|
||||
if (this.nsfw && !msg.channel.nsfw) {
|
||||
return 'This Command can only be used in NSFW Channels.';
|
||||
}
|
||||
if (msg.channel.type !== 'dm') {
|
||||
if (this.ownerOnly && !this.client.isOwner(msg.author)) return 'This Command can only be used by the bot owner.';
|
||||
if (this.nsfw && !msg.channel.nsfw) return 'This Command can only be used in NSFW Channels.';
|
||||
if (msg.channel.type === 'text') {
|
||||
if (this.clientPermissions) {
|
||||
for (const permission of this.clientPermissions) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has(permission)) {
|
||||
return `This Command requires the \`${perms[permission]}\` Permission.`;
|
||||
return `This Command requires me to have the \`${perms[permission]}\` Permission.`;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.userPermissions) {
|
||||
for (const permission of this.userPermissions) {
|
||||
if (!msg.channel.permissionsFor(msg.author).has(permission)) {
|
||||
return `You do not have the \`${perms[permission]}\` Permission.`;
|
||||
return `This Command requires you to have the \`${perms[permission]}\` Permission.`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user