restructure
move to bun workspaces bump zod begin adding fluxer
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
import { type CommandsType, Commands } from "commands";
|
||||
import config from "config";
|
||||
import type { CacheType, ChatInputCommandInteraction, Interaction } from "discord.js";
|
||||
import { checkPermission } from "permissions";
|
||||
|
||||
export class DebugService {
|
||||
|
||||
async handleInteraction(
|
||||
interaction: Interaction<CacheType>
|
||||
) {
|
||||
if (interaction.isChatInputCommand()) {
|
||||
await this.handleChatInputCommand(interaction);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
async handleChatInputCommand(interaction: ChatInputCommandInteraction<CacheType>) {
|
||||
const commandName = interaction.commandName as CommandsType;
|
||||
switch (commandName) {
|
||||
case Commands.Enum.version:
|
||||
await this.version(interaction);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
async version(interaction: ChatInputCommandInteraction<CacheType>) {
|
||||
try {
|
||||
console.log("version command");
|
||||
if (await checkPermission(interaction.member) !== true) {
|
||||
await interaction.reply({
|
||||
content: "du hast keine rechte fuer diesen befehl",
|
||||
ephemeral: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
await interaction.reply({
|
||||
content: "version: " + config.discord.version,
|
||||
});
|
||||
|
||||
}
|
||||
catch (error) {
|
||||
console.error("error while sending version msg:", error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user