fix: addBot

#452
This commit is contained in:
March 7th 2022-12-22 12:03:50 +07:00
parent 1a26cc4c3e
commit bee76dbf9e

View File

@ -1517,7 +1517,7 @@ class Guild extends AnonymousGuild {
if (!botId) throw new TypeError('INVALID_BOT_ID'); if (!botId) throw new TypeError('INVALID_BOT_ID');
// Check permission // Check permission
const selfPerm = this.me.permissions.toArray(); const selfPerm = this.me.permissions.toArray();
const missingPerms = permission.toArray().filter(x => selfPerm.includes(x)); const missingPerms = permission.toArray().filter(x => !selfPerm.includes(x));
if (missingPerms.length) { if (missingPerms.length) {
throw new Error('MISSING_PERMISSIONS', missingPerms.join(', ')); throw new Error('MISSING_PERMISSIONS', missingPerms.join(', '));
} }