register cmd

This commit is contained in:
grngxd 2025-07-31 19:39:56 +01:00
parent 49d6b51de6
commit 5fd014b677
2 changed files with 12 additions and 6 deletions

View file

@ -1,4 +1,4 @@
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
import { ChatInputCommandInteraction, MessageFlags, SlashCommandBuilder } from "discord.js";
import { db } from "../db/db";
export const data = new SlashCommandBuilder()
@ -8,11 +8,14 @@ export const data = new SlashCommandBuilder()
export const execute = async (interaction: ChatInputCommandInteraction) => {
const existingUser = await db.get<{ id: string }>`SELECT id FROM users WHERE id = ${interaction.user.id}`;
if (existingUser) {
await interaction.reply({ content: "You already have a stereo account.", ephemeral: true });
await interaction.reply({ content: "you already have a stereo account", flags: MessageFlags.Ephemeral });
return;
}
await interaction.reply({ content: "Your stereo account has been created!", ephemeral: true });
}
await interaction.reply({
content: `visit [this link](${process.env.API + "/auth/login"}) to create your stereo account`,
flags: MessageFlags.Ephemeral
})
}
export default [data, execute] as const;