diff --git a/commands/teams admin/twithdraw.js b/commands/teams admin/twithdraw.js index 1aefb91..0afb924 100644 --- a/commands/teams admin/twithdraw.js +++ b/commands/teams admin/twithdraw.js @@ -97,7 +97,7 @@ module.exports = { amount = args[0]; } - db.run(`UPDATE users SET pocket = pocket + ? WHERE guildId = ? AND userId = ?`, [amount, message.guild.id, message.author.id]); + db.run(`UPDATE users SET pocket = pocket + ?, teamDroper = teamDroper - ? WHERE guildId = ? AND userId = ?`, [amount, amount, message.guild.id, message.author.id]); db.run(`UPDATE teams SET bank = bank - ? WHERE id = ? AND guildId = ?`, [amount, team, message.guild.id]); const embed = new EmbedBuilder() diff --git a/commands/teams/tdeposit.js b/commands/teams/tdeposit.js index 992eae1..963c7d5 100644 --- a/commands/teams/tdeposit.js +++ b/commands/teams/tdeposit.js @@ -78,7 +78,7 @@ module.exports = { return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } }); } else { - db.run(`UPDATE users SET pocket = pocket - ? WHERE guildId = ? AND userId = ?`, [amout, message.guild.id, message.author.id]); + db.run(`UPDATE users SET pocket = pocket - ?, teamDroper = teamDroper + ? WHERE guildId = ? AND userId = ?`, [amout, amout, message.guild.id, message.author.id]); db.run(`UPDATE teams SET bank = bank + ? WHERE id = ?`, [amout, team]); const embed = new EmbedBuilder() diff --git a/fonctions/database.js b/fonctions/database.js index 34045b2..266552c 100644 --- a/fonctions/database.js +++ b/fonctions/database.js @@ -35,6 +35,7 @@ db.run(`CREATE TABLE IF NOT EXISTS users ( job TEXT, teamId TEXT, teamRole TEXT, + teamDroper INTERGER DEFAULT 0, embed TEXT, PRIMARY KEY (guildId, userId) )`);