mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-12-29 23:03:02 +05:00
Compare commits
2 commits
2f3eabb3f3
...
d348260504
Author | SHA1 | Date | |
---|---|---|---|
d348260504 | |||
d92c25228b |
5 changed files with 11 additions and 7 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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 });
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -44,6 +44,7 @@ class Clearwarns extends BaseCommand {
|
|||
|
||||
memberData.sanctions = [];
|
||||
|
||||
memberData.markModified("sanctions");
|
||||
await memberData.save();
|
||||
|
||||
interaction.success("moderation/clearwarns:SUCCESS", {
|
||||
|
|
|
@ -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": {
|
||||
|
|
Loading…
Reference in a new issue