mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 00:40:07 +00:00
test(api): delete all guilds if the guilds count >= 10
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
deleteServer,
|
||||
getChannel,
|
||||
} from "../src/api/handlers/guild.ts";
|
||||
import { eventHandlers } from "../src/bot.ts";
|
||||
import {
|
||||
addReaction,
|
||||
assertEquals,
|
||||
@@ -58,6 +59,12 @@ Deno.test({
|
||||
intents: ["GUILD_MESSAGES", "GUILDS"],
|
||||
});
|
||||
|
||||
eventHandlers.ready = () => {
|
||||
if (cache.guilds.size >= 10) {
|
||||
cache.guilds.map((guild) => deleteServer(guild.id));
|
||||
}
|
||||
};
|
||||
|
||||
// Delay the execution by 5 seconds
|
||||
await delay(5000);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user