Skip to content

Commit

Permalink
fix: Corriger les commandes de configuration et d'information
Browse files Browse the repository at this point in the history
Signed-off-by: Wiibleyde <nathan@bonnell.fr>
  • Loading branch information
Wiibleyde committed Sep 15, 2024
1 parent 5fa9c89 commit 9fb21e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/commands/config/channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function execute(interaction: CommandInteraction) {
return
}
switch (interaction.options.get("action")?.value) {
case "view":
case "view": {
const serverConfig = await prisma.config.findMany({
where: {
guildId: interaction.guildId?.toString() as string
Expand All @@ -67,7 +67,8 @@ export async function execute(interaction: CommandInteraction) {

await interaction.editReply({ embeds: [responseEmbed] })
break
case "edit":
}
case "edit": {
const key = interaction.options.get("key")?.value as string
const channel = interaction.options.get("channel")?.value as string
if (!key || !channel) {
Expand Down Expand Up @@ -100,5 +101,6 @@ export async function execute(interaction: CommandInteraction) {
}
await interaction.editReply({ embeds: [successEmbed(interaction, "Configuration mise à jour.")] })
break
}
}
}
9 changes: 6 additions & 3 deletions src/commands/general/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function execute(interaction: CommandInteraction) {
await interaction.deferReply({ ephemeral: true,fetchReply: true })

switch (interaction.options.get("section")?.value) {
case "bot":
case "bot": {
const version = packageJson.version
const libs = Object.keys(packageJson.dependencies).join("\n")
const author = packageJson.author.name
Expand All @@ -48,7 +48,8 @@ export async function execute(interaction: CommandInteraction) {

await interaction.editReply({ embeds: [infoEmbed], files: [{ attachment: infoImage, name: "info.png" }] })
break
case "user":
}
case "user": {
const user = interaction.user
const dbUser = await prisma.globalUserData.findFirst({
where: {
Expand Down Expand Up @@ -76,8 +77,10 @@ export async function execute(interaction: CommandInteraction) {

await interaction.editReply({ embeds: [embed] })
break
default:
}
default: {
await interaction.editReply({ content: "Section inconnue" })
break
}
}
}

0 comments on commit 9fb21e0

Please sign in to comment.