client.ts
if (globalThis._$clientLoaded) throw new Error("The client was loaded twice. This should never happen.");
globalThis._$clientLoaded = true;

export const client = new Client < true > ({
   shards: "auto",
   intents: ["GUILD_MEMBERS", "GUILDS"],
   presence: {
      activities: [text.bot.status],
      status: development ? "idle" : "online",
   },
   partials: [
      "CHANNEL", "USER"
   ]
});

export const rest = new REST({
   version: "9"
}).setToken(config.token);

client.login(config.token);

const eventsFolder = join(__dirname, "../events/**/*.js").replaceAll(win32.sep, posix.sep);
sync(eventsFolder).forEach(x => import(x) as unknown);