mirror of
https://github.com/arthur-pbty/bot-discord-coins.git
synced 2026-06-03 23:36:29 +02:00
70 lines
2.1 KiB
JavaScript
70 lines
2.1 KiB
JavaScript
const { EmbedBuilder } = require("discord.js");
|
|
const db = require("../../fonctions/database.js");
|
|
const embedColor = require("../../fonctions/embedColor.js");
|
|
|
|
module.exports = {
|
|
aliases: [],
|
|
description:
|
|
"Reinitialise toutes les données d'un utilisateur (sur ce serveur).",
|
|
emote: "💰",
|
|
utilisation: "<@membre>",
|
|
permission: 10,
|
|
|
|
async execute(message, args, client) {
|
|
const member = message.mentions.users.first();
|
|
if (!member) {
|
|
const embed = new EmbedBuilder()
|
|
.setTitle("Reset :")
|
|
.setDescription(`**Veuillez mentionner un membre valide**`)
|
|
.setColor(await embedColor(message.author.id, message.guild.id))
|
|
.setTimestamp()
|
|
.setFooter({
|
|
text: `Demandé par ${message.author.tag}`,
|
|
iconURL: message.author.displayAvatarURL(),
|
|
});
|
|
|
|
return message.reply({
|
|
embeds: [embed],
|
|
allowedMentions: { repliedUser: false },
|
|
});
|
|
}
|
|
|
|
db.run(`UPDATE users SET pocket = 0 WHERE guildId = ? AND userId = ?`, [
|
|
message.guild.id,
|
|
member.id,
|
|
]);
|
|
db.run(`UPDATE users SET bank = 0 WHERE guildId = ? AND userId = ?`, [
|
|
message.guild.id,
|
|
member.id,
|
|
]);
|
|
db.run(`UPDATE users SET xp = 0 WHERE guildId = ? AND userId = ?`, [
|
|
message.guild.id,
|
|
member.id,
|
|
]);
|
|
db.run(`UPDATE users SET lvl = 0 WHERE guildId = ? AND userId = ?`, [
|
|
message.guild.id,
|
|
member.id,
|
|
]);
|
|
db.run(`UPDATE users SET reputation = 0 WHERE guildId = ? AND userId = ?`, [
|
|
message.guild.id,
|
|
member.id,
|
|
]);
|
|
db.run(
|
|
`UPDATE users SET teamId = NULL, teamRole = NULL WHERE userId = ? AND guildId = ?`,
|
|
[message.author.id, message.guild.id],
|
|
);
|
|
|
|
const embed = new EmbedBuilder()
|
|
.setTitle("Reset :")
|
|
.setDescription(`**<@${member.id}> reinitialiser avec succès !**`)
|
|
.setColor(await embedColor(message.author.id, message.guild.id))
|
|
.setTimestamp()
|
|
.setFooter({
|
|
text: `Demandé par ${message.author.tag}`,
|
|
iconURL: message.author.displayAvatarURL(),
|
|
});
|
|
|
|
message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } });
|
|
},
|
|
};
|