mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-27 14:17:14 +02:00
correction confession
This commit is contained in:
@@ -7,15 +7,6 @@ module.exports = {
|
||||
name: Events.InteractionCreate,
|
||||
async execute(interaction, client) {
|
||||
const botId = client.user.id;
|
||||
let data = await new Promise((resolve, reject) => {
|
||||
db2.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
reject(err);
|
||||
}
|
||||
resolve(row ? JSON.parse(row.value).owners || {} : {});
|
||||
});
|
||||
});
|
||||
let owners = await new Promise((resolve, reject) => {
|
||||
db2.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => {
|
||||
if (err) {
|
||||
@@ -47,13 +38,14 @@ module.exports = {
|
||||
await PrevnameDb.delete(userId)
|
||||
await interaction.reply({ content: "Vos prevname on etait correctement supprimer.", ephemeral: true });
|
||||
} else if (interaction.customId.startsWith('addconfession_')) {
|
||||
|
||||
let data = await new Promise((resolve, reject) => {
|
||||
db2.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
reject(err);
|
||||
}
|
||||
resolve(row ? JSON.parse(row.value).owners || {} : {});
|
||||
resolve(row ? JSON.parse(row.value) : {});
|
||||
});
|
||||
});
|
||||
const guildId= interaction.customId.split('_')[1];
|
||||
@@ -86,8 +78,8 @@ module.exports = {
|
||||
let ConfessionMessageToSend = reponse.fields.getTextInputValue('messageconfession')
|
||||
let ConfidentielAuthor = reponse.fields.getTextInputValue('status')
|
||||
let isConfidential = !ConfidentielAuthor.toLowerCase().startsWith('n');
|
||||
data.guildId = data.guildId || {};
|
||||
data.guildId.confession = data.guildId.confession || {};
|
||||
data.confession = data.confession || {};
|
||||
data.confession.channel = data.confession.channel || {};
|
||||
|
||||
console.log(guildId);
|
||||
console.log(data.guildId.confession.channel);
|
||||
|
||||
Reference in New Issue
Block a user