diff --git a/src/utils/permissions.ts b/src/utils/permissions.ts index c466a48b8..f009150f3 100644 --- a/src/utils/permissions.ts +++ b/src/utils/permissions.ts @@ -55,6 +55,9 @@ export async function botHasPermission( const guild = await cacheHandlers.get("guilds", guildID); 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); if (!member) return false; diff --git a/tests/mod.test.ts b/tests/mod.test.ts index 498ae37ad..07222afc6 100644 --- a/tests/mod.test.ts +++ b/tests/mod.test.ts @@ -68,6 +68,9 @@ Deno.test({ assert(createdGuild); data.guildID = createdGuild.id; + + // Delay the execution by 5 seconds to allow the guild create event to be received + await delay(5000); }, ...testOptions, }); @@ -82,6 +85,8 @@ Deno.test({ name: "Role 1", }); + console.log(createdRole); + // Check whether the created role is nil or not assert(createdRole);