Merge pull request #200 from Skillz4Killz/perm

feat(utils): check if bot is the owner of the guild
This commit is contained in:
Skillz4Killz
2020-11-18 08:58:09 -05:00
committed by GitHub
+3
View File
@@ -55,6 +55,9 @@ export async function botHasPermission(
const guild = await cacheHandlers.get("guilds", guildID); const guild = await cacheHandlers.get("guilds", guildID);
if (!guild) return false; if (!guild) return false;
// Check if the bot is the owner of the guild, if it is, returns true
if (guild.ownerID === botID) return true;
const member = guild.members.get(botID); const member = guild.members.get(botID);
if (!member) return false; if (!member) return false;