getMembers test i hope

This commit is contained in:
Hugo Chretien
2021-11-26 08:27:46 +01:00
parent fd88ef84e7
commit 3833f29c4b
3 changed files with 11 additions and 3 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
export const CACHED_COMMUNITY_GUILD_ID = 907350958810480671n;
export const CACHED_COMMUNITY_GUILD_ID = 907350958810480671n; // revert back to 907350958810480671n when testing is finished
// CHANGE TO TRUE WHEN DEBUGGING SANITIZATION ERRORS
export const sanitizeMode = {
@@ -10,4 +10,4 @@ export const sanitizeMode = {
// USED FOR ROLE CHANGE EVENTS
export const roleChanges = new Map<bigint, bigint[]>();
export const banCounters = new Map<bigint, boolean>();
export const banCounters = new Map<bigint, boolean>();
+8
View File
@@ -0,0 +1,8 @@
import { bot } from "../mod.ts";
import { CACHED_COMMUNITY_GUILD_ID } from "../constants.ts";
import { assertEquals } from "../deps.ts";
Deno.test("[member] Gets a member list and checks if the bot is in the member list", async () => {
const members = await bot.helpers.getMembers(CACHED_COMMUNITY_GUILD_ID, { memberCount: 10 });
assertEquals(members.has(bot.id), true);
});
+1 -1
View File
@@ -86,7 +86,7 @@ if (bot.cache.guilds.size() <= 10) {
await delayUntil(10000, () => Boolean(startedAt));
// CREATE ONE GUILD SO WE CAN REUSE LATER TO SAVE RATE LIMITS
export const guild = await bot.helpers.createGuild({ name: "Discordeno Test" });
export const guild = await bot.helpers.getGuild(CACHED_COMMUNITY_GUILD_ID);
// Assertions
assertExists(guild);