Move terminal.service.ts and prune.service.ts entirely to bot/modules/ since they are Discord-specific. Split lootdrop.service.ts: pure logic (activity tracking, DB ops, claim) stays in shared/, Discord operations (message sending, channel interactions) move to bot/modules/economy/ lootdrop.handler.ts. Move effect registry/handlers/types from bot/ to shared/modules/inventory/ since they contain no Discord.js imports and are needed by inventory.service.ts in shared. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
38 lines
1.5 KiB
TypeScript
38 lines
1.5 KiB
TypeScript
|
|
import { createCommand } from "@shared/lib/utils";
|
|
import { SlashCommandBuilder, PermissionFlagsBits, ChannelType, TextChannel } from "discord.js";
|
|
import { terminalService } from "@modules/system/terminal.service";
|
|
import { createErrorEmbed } from "@/lib/embeds";
|
|
import { withCommandErrorHandling } from "@lib/commandUtils";
|
|
|
|
export const terminal = createCommand({
|
|
data: new SlashCommandBuilder()
|
|
.setName("terminal")
|
|
.setDescription("Manage the Aurora Terminal")
|
|
.addSubcommand(sub =>
|
|
sub.setName("init")
|
|
.setDescription("Initialize the terminal in the current channel")
|
|
)
|
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
|
execute: async (interaction) => {
|
|
const subcommand = interaction.options.getSubcommand();
|
|
|
|
if (subcommand === "init") {
|
|
const channel = interaction.channel;
|
|
if (!channel || channel.type !== ChannelType.GuildText) {
|
|
await interaction.reply({ embeds: [createErrorEmbed("Terminal can only be initialized in text channels.")] });
|
|
return;
|
|
}
|
|
|
|
await withCommandErrorHandling(
|
|
interaction,
|
|
async () => {
|
|
await terminalService.init(channel as TextChannel);
|
|
await interaction.editReply({ content: "✅ Terminal initialized!" });
|
|
},
|
|
{ ephemeral: true }
|
|
);
|
|
}
|
|
}
|
|
});
|