Compare commits

...

2 commits

5 changed files with 11 additions and 7 deletions

View file

@ -146,6 +146,8 @@ class Marry extends BaseCommand {
userData.achievements.married.progress.now = 1;
}
userData.markModified("achievements");
otherUserData.markModified("achievements");
await userData.save();
await otherUserData.save();

View file

@ -41,6 +41,7 @@ class Transactions extends BaseCommand {
if (interaction.options.getBoolean("clear")) {
memberData.transactions = [];
memberData.markModified("transactions");
await memberData.save();
return interaction.success("economy/transactions:CLEARED", null, { ephemeral: true });

View file

@ -30,14 +30,14 @@ class Work extends BaseCommand {
const { member: memberData, user: userData } = interaction.data,
isInCooldown = memberData.cooldowns?.work;
if (isInCooldown && isInCooldown > 0 && isInCooldown > Math.floor(Date.now() / 1000))
if (isInCooldown && isInCooldown > Date.now())
return interaction.error("economy/work:COOLDOWN", {
time: `<t:${Math.floor(isInCooldown)}:R>`,
time: `<t:${Math.floor(isInCooldown / 1000)}:R>`,
});
if (Math.floor(Date.now() / 1000) > Math.floor(memberData.cooldowns.work + 30 * 60 * 60)) memberData.workStreak = 0;
if (Date.now() > memberData.cooldowns.work + 30 * 60 * 60 * 1000) memberData.workStreak = 0;
memberData.cooldowns.work = Math.floor(Date.now() / 1000) + 24 * 60 * 60; // 24 hours
memberData.cooldowns.work = Date.now() + 24 * 60 * 60 * 1000;
memberData.workStreak = (memberData.workStreak || 0) + 1;
const embed = client.embed({
@ -113,9 +113,11 @@ class Work extends BaseCommand {
userData.achievements.work.achieved = true;
}
userData.markModified("achievements");
await userData.save();
}
memberData.markModified("cooldowns");
await memberData.save();
interaction.reply(messageOptions);

View file

@ -44,6 +44,7 @@ class Clearwarns extends BaseCommand {
memberData.sanctions = [];
memberData.markModified("sanctions");
await memberData.save();
interaction.success("moderation/clearwarns:SUCCESS", {

View file

@ -4,9 +4,7 @@
"description": "My Discord Bot",
"main": "index.js",
"scripts": {
"preinstall": "npx only-allow pnpm",
"start": "node .",
"lint": "eslint . --ext .js --ignore-pattern \"dashboard-core/\""
"start": "node ."
},
"author": "@jonny_bro",
"dependencies": {