feat: rewrite as moderation bot #11

Merged
naomi merged 3 commits from feat/modbot into main 2026-03-24 20:35:26 -07:00
2 changed files with 13 additions and 5 deletions
Showing only changes of commit 679f46c967 - Show all commits
+12 -5
View File
@@ -20,6 +20,7 @@ import { softbanCommand } from "./commands/softban.js";
import { unbanCommand } from "./commands/unban.js";
import { unmuteCommand } from "./commands/unmute.js";
import { warnCommand } from "./commands/warn.js";
import { guildConfig } from "./config/guild.js";
// eslint-disable-next-line stylistic/max-len -- Import path cannot be shortened
import { onGuildAuditLogEntryCreate } from "./events/guildAuditLogEntryCreate.js";
import { onGuildMemberAdd } from "./events/guildMemberAdd.js";
@@ -127,11 +128,17 @@ client.on(Events.GuildAuditLogEntryCreate, (entry, guild) => {
void onGuildAuditLogEntryCreate(entry, guild, client);
});
client.on(Events.ClientReady, () => {
void logger.log(
"debug",
`Keiko is online as ${client.user?.username ?? "unknown"}.`,
);
client.on(Events.ClientReady, (readyClient) => {
void (async(): Promise<void> => {
const guild = readyClient.guilds.cache.get(guildConfig.guildId);
if (guild) {
await guild.members.fetch();
}
await logger.log(
"debug",
`Keiko is online as ${readyClient.user.username}.`,
);
})();
});
await client.login(process.env.DISCORD_TOKEN);
+1
View File
@@ -29,6 +29,7 @@ const commandData = [
const rest = new REST().setToken(process.env.DISCORD_TOKEN ?? "");
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- REST returns unknown; shape is documented by Discord API */
const me = await rest.get(Routes.user()) as { id: string; username: string };
console.log(`Authenticated as: ${me.username} (${me.id})`);