From 34e88d9a4fc97d1cefa69fc0153e0e2d86924c2b Mon Sep 17 00:00:00 2001 From: Nix Krystik Date: Tue, 11 Aug 2026 19:44:30 +0800 Subject: [PATCH] (rewrite): Updated bot to actually load the commands and events. --- src/bot.ts | 14 ++++++++++++++ src/commands/index.ts | 22 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/commands/index.ts diff --git a/src/bot.ts b/src/bot.ts index a8fe299..6c94f63 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -3,6 +3,8 @@ import { CommandClient, Constants, LRUCollection, Member, User } from "athena-pr // Internal Imports import config from "./config"; +import events from "./events"; +import commands from "./commands"; // --------------- @@ -21,12 +23,24 @@ const client = new CommandClient({ largeBotOptimizations: true, + disableEvents: { + PRESENCE_UPDATE: true, + }, + // TODO: Move caching to Redis. cache: { users: () => new LRUCollection(User, 1024), members: (guild) => new LRUCollection(Member, 1024), + + guildEmojis: false, + guildStickers: false, + transientMembers: false, + userSweepIntervalMs: 3_600_000 // 1hr. } } }); +commands.forEach(command => client.registerCommand(command)); +events.forEach(event => client.registerEvent(event)); + export default client; \ No newline at end of file diff --git a/src/commands/index.ts b/src/commands/index.ts new file mode 100644 index 0000000..fd8489c --- /dev/null +++ b/src/commands/index.ts @@ -0,0 +1,22 @@ +import database from "./admin/database"; +import renameChannel from "./admin/rename-channel"; + +import ban from "./moderation/ban"; +import hardban from "./moderation/hardban"; + +import about from "./utilities/about"; +import nameSync from "./utilities/name-sync"; + +export default [ + // Admin + database, + renameChannel, + + // Moderation + ban, + hardban, + + // Utilities + about, + nameSync +]; \ No newline at end of file