Fix messages, durr

This commit is contained in:
Christopher Cookman 2024-08-20 14:36:16 -06:00
parent c0ed2bf7b2
commit 78c22c3075
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -193,7 +193,6 @@ Client.on("interactionCreate", async (interaction) => {
userId = interaction.options.get("user").value userId = interaction.options.get("user").value
reason = interaction.options.get("reason").value reason = interaction.options.get("reason").value
userInfo = await noblox.getPlayerInfo(userId) userInfo = await noblox.getPlayerInfo(userId)
console.log(userInfo)
userThumbnail = await noblox.getPlayerThumbnail([userId], 720, "png", false, "body") userThumbnail = await noblox.getPlayerThumbnail([userId], 720, "png", false, "body")
db.get("SELECT * FROM bans WHERE userId = ?", [userId], (err, row) => { db.get("SELECT * FROM bans WHERE userId = ?", [userId], (err, row) => {
if (err) { if (err) {
@ -234,7 +233,7 @@ Client.on("interactionCreate", async (interaction) => {
} }
] ]
} }
return interaction.reply({ embeds: [embed] }); return interaction.reply({ embeds: [embed], ephemeral: true });
} }
}) })
} else if(row.banned === 0) { } else if(row.banned === 0) {
@ -268,11 +267,11 @@ Client.on("interactionCreate", async (interaction) => {
} }
] ]
} }
return interaction.reply({ embeds: [embed] }); return interaction.reply({ embeds: [embed], ephemeral: true });
} }
}) })
} else { } else {
interaction.repl({ interaction.reply({
content: "User is already banned.", content: "User is already banned.",
ephemeral: true ephemeral: true
}) })
@ -284,7 +283,6 @@ Client.on("interactionCreate", async (interaction) => {
// If the user is banned, unban them // If the user is banned, unban them
userId = await interaction.options.get("user").value userId = await interaction.options.get("user").value
userInfo = await noblox.getPlayerInfo(userId) userInfo = await noblox.getPlayerInfo(userId)
console.log(userInfo)
userThumbnail = await noblox.getPlayerThumbnail([userId], 720, "png", false, "body") userThumbnail = await noblox.getPlayerThumbnail([userId], 720, "png", false, "body")
db.get("SELECT * FROM bans WHERE userId = ?", [userId], (err, row) => { db.get("SELECT * FROM bans WHERE userId = ?", [userId], (err, row) => {
@ -333,6 +331,7 @@ Client.on("interactionCreate", async (interaction) => {
} }
] ]
} }
return interaction.reply({ embeds: [embed], ephemeral: true });
} }
}) })
} else { } else {
@ -383,9 +382,7 @@ Client.on("interactionCreate", async (interaction) => {
} }
] ]
} }
console.log(row) interaction.editReply({ embeds: [embed], ephemeral: true})
console.log(`<t:${Math.floor(new Date(row.timestamp) / 1000)}:R>`)
interaction.editReply({ embeds: [embed] })
} else { } else {
embed = { embed = {
title: "User is not banned", title: "User is not banned",
@ -409,7 +406,7 @@ Client.on("interactionCreate", async (interaction) => {
} }
] ]
} }
interaction.editReply({ embeds: [embed] }) interaction.editReply({ embeds: [embed], ephemeral: true})
} }
} else { } else {
embed = { embed = {
@ -429,7 +426,7 @@ Client.on("interactionCreate", async (interaction) => {
} }
] ]
} }
interaction.editReply({ embeds: [embed] }) interaction.editReply({ embeds: [embed], ephemeral: true })
} }
} }
}) })