35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import {
|
|
ChatInputCommandInteraction,
|
|
MessageFlags,
|
|
SlashCommandSubcommandBuilder,
|
|
} from "discord.js";
|
|
import { defineCommand } from "../command";
|
|
import { Voice } from "../../db/generated/prisma/enums";
|
|
import { setUserVoice } from "../db";
|
|
|
|
export default defineCommand(
|
|
new SlashCommandSubcommandBuilder()
|
|
.setName("목소리")
|
|
.setDescription("예주의 목소리를 설정해요")
|
|
.addStringOption((option) =>
|
|
option
|
|
.setName("voice")
|
|
.setDescription("사용할수 있는 목소리들이에요")
|
|
.setRequired(true)
|
|
.addChoices(
|
|
{ name: "TypeCast", value: "TypeCast" },
|
|
{ name: "Papago", value: "Papago" },
|
|
{ name: "Supertonic", value: "Supertonic" },
|
|
),
|
|
),
|
|
async (interaction: ChatInputCommandInteraction): Promise<any> => {
|
|
await interaction.deferReply({
|
|
flags: [MessageFlags.Ephemeral],
|
|
});
|
|
|
|
const voice = interaction.options.getString("voice") as Voice;
|
|
await setUserVoice(interaction.user.id, voice);
|
|
|
|
await interaction.editReply("예주의 목소리를 변경했어요!");
|
|
},
|
|
);
|