From a49853d79bfa98180c8cd0d55624d2a64671fedd Mon Sep 17 00:00:00 2001 From: ayntee Date: Wed, 18 Nov 2020 10:43:48 +0400 Subject: [PATCH 1/2] Bug fix --- src/utils/permissions.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/permissions.ts b/src/utils/permissions.ts index 1623c6451..fc2c86069 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; From 041e666868eed8b28d142d9d9762bec23e3e04c0 Mon Sep 17 00:00:00 2001 From: Skillz Date: Wed, 18 Nov 2020 09:32:38 -0500 Subject: [PATCH 2/2] fix tests going tooo fast --- tests/mod.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/mod.test.ts b/tests/mod.test.ts index 263519312..0ac8de2bb 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);