refactor: rename bot client, environment variables, and project name from Kyoko to Aurora.

This commit is contained in:
syntaxbullet
2025-12-20 11:23:39 +01:00
parent 1f7679e5a1
commit 4229e5338f
10 changed files with 27 additions and 68 deletions

View File

@@ -2,7 +2,7 @@ import { createCommand } from "@/lib/utils";
import { SlashCommandBuilder, PermissionFlagsBits, EmbedBuilder, MessageFlags } from "discord.js";
import { configManager } from "@/lib/configManager";
import { config, reloadConfig } from "@/lib/config";
import { KyokoClient } from "@/lib/BotClient"; // Import directly from lib, avoiding circular dep with index
import { AuroraClient } from "@/lib/BotClient";
export const features = createCommand({
data: new SlashCommandBuilder()
@@ -31,7 +31,7 @@ export const features = createCommand({
const subcommand = interaction.options.getSubcommand();
if (subcommand === "list") {
const activeCommands = KyokoClient.commands;
const activeCommands = AuroraClient.commands;
const categories = new Map<string, string[]>();
// Group active commands
@@ -87,8 +87,8 @@ export const features = createCommand({
// Reload config from disk (which was updated by configManager)
reloadConfig();
await KyokoClient.loadCommands(true);
await KyokoClient.deployCommands();
await AuroraClient.loadCommands(true);
await AuroraClient.deployCommands();
await interaction.editReply({ content: `✅ Command **${commandName}** has been ${enabled ? "enabled" : "disabled"}. Commands reloaded!` });
}

View File

@@ -1,5 +1,5 @@
import { createCommand } from "@lib/utils";
import { KyokoClient } from "@/lib/BotClient";
import { AuroraClient } from "@/lib/BotClient";
import { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits, MessageFlags } from "discord.js";
import { createErrorEmbed, createSuccessEmbed, createWarningEmbed } from "@lib/embeds";
@@ -13,14 +13,14 @@ export const refresh = createCommand({
try {
const start = Date.now();
await KyokoClient.loadCommands(true);
await AuroraClient.loadCommands(true);
const duration = Date.now() - start;
// Deploy commands
await KyokoClient.deployCommands();
await AuroraClient.deployCommands();
const embed = createSuccessEmbed(
`Successfully reloaded ${KyokoClient.commands.size} commands in ${duration}ms.`,
`Successfully reloaded ${AuroraClient.commands.size} commands in ${duration}ms.`,
"System Refreshed"
);

View File

@@ -1,5 +1,5 @@
import { Events, MessageFlags } from "discord.js";
import { KyokoClient } from "@/lib/BotClient";
import { AuroraClient } from "@/lib/BotClient";
import { userService } from "@/modules/user/user.service";
import { createErrorEmbed } from "@lib/embeds";
import type { Event } from "@lib/types";
@@ -32,7 +32,7 @@ const event: Event<Events.InteractionCreate> = {
}
if (interaction.isAutocomplete()) {
const command = KyokoClient.commands.get(interaction.commandName);
const command = AuroraClient.commands.get(interaction.commandName);
if (!command || !command.autocomplete) return;
try {
await command.autocomplete(interaction);
@@ -44,7 +44,7 @@ const event: Event<Events.InteractionCreate> = {
if (!interaction.isChatInputCommand()) return;
const command = KyokoClient.commands.get(interaction.commandName);
const command = AuroraClient.commands.get(interaction.commandName);
if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);

View File

@@ -1,14 +1,14 @@
import { KyokoClient } from "@/lib/BotClient";
import { AuroraClient } from "@/lib/BotClient";
import { env } from "@lib/env";
// Load commands & events
await KyokoClient.loadCommands();
await KyokoClient.loadEvents();
await KyokoClient.deployCommands();
await AuroraClient.loadCommands();
await AuroraClient.loadEvents();
await AuroraClient.deployCommands();
// login with the token from .env
if (!env.DISCORD_BOT_TOKEN) {
throw new Error("❌ DISCORD_BOT_TOKEN is not set in environment variables.");
}
KyokoClient.login(env.DISCORD_BOT_TOKEN);
AuroraClient.login(env.DISCORD_BOT_TOKEN);

View File

@@ -185,4 +185,4 @@ class Client extends DiscordClient {
}
}
export const KyokoClient = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMembers] });
export const AuroraClient = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMembers] });

View File

@@ -1,6 +1,6 @@
import { readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
import { KyokoClient } from '@/lib/BotClient';
import { AuroraClient } from '@/lib/BotClient';
const configPath = join(process.cwd(), 'src', 'config', 'config.json');

View File

@@ -1,7 +1,7 @@
import { userTimers } from "@/db/schema";
import { eq, and, lt } from "drizzle-orm";
import { DrizzleClient } from "@/lib/DrizzleClient";
import { KyokoClient } from "@/lib/BotClient";
import { AuroraClient } from "@/lib/BotClient";
import { env } from "@/lib/env";
/**
@@ -51,7 +51,7 @@ export const schedulerService = {
if (guildId) {
// We try to fetch, if bot is not in guild or lacks perms, it will catch
const guild = await KyokoClient.guilds.fetch(guildId);
const guild = await AuroraClient.guilds.fetch(guildId);
const member = await guild.members.fetch(userIdStr);
await member.roles.remove(roleId);
console.log(`👋 Removed temporary role ${roleId} from ${member.user.tag}`);