register cmd
This commit is contained in:
parent
49d6b51de6
commit
5fd014b677
2 changed files with 12 additions and 6 deletions
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue