Skip to content

Commit

Permalink
Big update
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Wood committed Nov 14, 2024
1 parent db3eb71 commit 4a6a484
Show file tree
Hide file tree
Showing 12 changed files with 218 additions and 218 deletions.
10 changes: 5 additions & 5 deletions src/commands/economy/addmoney.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to use it.`)
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to use it.`)
]
});
} else {
await Profile.updateOne({
userID: user.id, guildId: message.guild.id
},
{ $inc: { wallet: amount} });
{ $inc: { wallet: amount } });
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`Added $${amount} to ${user}`)
.setColor("BLURPLE")
.setDescription(`Added $${amount} to ${user}`)
]
});
}
Expand Down
14 changes: 7 additions & 7 deletions src/commands/economy/balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ module.exports = class extends Command {
guildId: message.guild.id
});
if (!profile) {
if(user.id !== message.author.id) return message.channel.sendCustom(`${user} doesn't have a profile!`);
if (user.id !== message.author.id) return message.channel.sendCustom(`${user} doesn't have a profile!`);

await createProfile(user, message.guild);
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to check your balance.`)
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to check your balance.`)
]
});
} else {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setTitle(`${user.username}'s Balance`)
.setDescription(`**Wallet:** $${profile.wallet}\n**Bank:** $${profile.bank}`)
.setColor("BLURPLE")
.setTitle(`${user.username}'s Balance`)
.setDescription(`**Wallet:** $${profile.wallet}\n**Bank:** $${profile.bank}`)
]
});
}
Expand Down
24 changes: 12 additions & 12 deletions src/commands/economy/beg.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to beg for money.`)
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to beg for money.`)
]
});
} else {
if (!profile.lastBeg) {
await Profile.updateOne(
{
userID: message.author.id,
guildId: message.guild.id
guildId: message.guild.id
},
{ $set: { lastBeg: Date.now() } }
);
await Profile.updateOne({ userID: message.author.id, guildId: message.guild.id })
await message.channel.sendCustomn({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Beg`)
.setDescription(`You have begged ($${amount}).\nCome back in 3 minutes to beg again.`)
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Beg`)
.setDescription(`You have begged ($${amount}).\nCome back in 3 minutes to beg again.`)
]
});
} else if (Date.now() - profile.lastBeg > 180000) {
Expand All @@ -51,9 +51,9 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Beg`)
.setDescription(`You begged for a total of $${amount}.`)
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Beg`)
.setDescription(`You begged for a total of $${amount}.`)
]
});
} else {
Expand All @@ -64,9 +64,9 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Beg`)
.setDescription(`You have to wait ${minutes}m ${seconds}s before you can beg again!`)
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Beg`)
.setDescription(`You have to wait ${minutes}m ${seconds}s before you can beg again!`)
]
});
}
Expand Down
24 changes: 12 additions & 12 deletions src/commands/economy/daily.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to collect your daily earnings.`)
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to collect your daily earnings.`)
]
});
} else {
if (!profile.lastDaily) {
await Profile.updateOne(
{
userID: message.author.id, guildId: message.guild.id
},
},
{ $set: { lastDaily: Date.now() } }
);
await Profile.updateOne({ userID: message.author.id, guildId: message.guild.id })
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Daily`)
.setDescription(`You have collected todays earnings ($50000).\nCome back tommorow to collect more.`)
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Daily`)
.setDescription(`You have collected todays earnings ($50000).\nCome back tommorow to collect more.`)
]
});
} else if (Date.now() - profile.lastDaily > 86400000) {
Expand All @@ -49,9 +49,9 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Daily`)
.setDescription(`You have collected your daily earnings of $50000.`)
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Daily`)
.setDescription(`You have collected your daily earnings of $50000.`)
]
});
} else {
Expand All @@ -63,9 +63,9 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Daily`)
.setDescription(`You have to wait ${hours}h ${minutes}m ${seconds}s before you can collect your daily earnings!`)
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Daily`)
.setDescription(`You have to wait ${hours}h ${minutes}m ${seconds}s before you can collect your daily earnings!`)
]
});
}
Expand Down
14 changes: 7 additions & 7 deletions src/commands/economy/deposit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to deposit your money.`)
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to deposit your money.`)
]
});
} else {
Expand All @@ -32,20 +32,20 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`You don't have enough money to deposit!`)
.setColor("BLURPLE")
.setDescription(`You don't have enough money to deposit!`)
]
});
} else {
await Profile.updateOne({
userID: message.author.id, guildId: message.guild.id
},
{ $inc: { wallet: -amount, bank: amount } });
{ $inc: { wallet: -amount, bank: amount } });
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`Deposited $${amount} to the bank.`)
.setColor("BLURPLE")
.setDescription(`Deposited $${amount} to the bank.`)
]
});
}
Expand Down
22 changes: 11 additions & 11 deletions src/commands/economy/monthly.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to collect your monthly earnings`)
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to collect your monthly earnings`)
]
});
} else {
Expand All @@ -35,9 +35,9 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Monthly`)
.setDescription(`You have collected this month's earnings ($2,500,000).\nCome back next month to collect more`)
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Monthly`)
.setDescription(`You have collected this month's earnings ($2,500,000).\nCome back next month to collect more`)
]
});
} else if (Date.now() - profile.lastMonthly > 2592000000) {
Expand All @@ -48,9 +48,9 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Monthly`)
.setDescription(`You have collected your monthly earnings of $2,500,000.`)
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Monthly`)
.setDescription(`You have collected your monthly earnings of $2,500,000.`)
]
});
} else {
Expand All @@ -63,9 +63,9 @@ module.exports = class extends Command {
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Monthly`)
.setDescription(`You have to wait ${days}d ${hours}h ${minutes}m ${seconds}s before you can collect your monthly earnings!`)
.setColor("BLURPLE")
.setTitle(`${message.author.username}'s Monthly`)
.setDescription(`You have to wait ${days}d ${hours}h ${minutes}m ${seconds}s before you can collect your monthly earnings!`)
]
})
}
Expand Down
110 changes: 55 additions & 55 deletions src/commands/economy/pay.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,61 @@ const Profile = require("../../database/models/economy/profile");
const { createProfile } = require("../../utils/utils.js");

module.exports = class extends Command {
constructor(...args) {
super(...args, {
name: "pay",
description: "Pay a user some money from your wallet",
category: "Economy",
usage: "pay <user> <amount>",
examples: "pay @Peter 500",
cooldown: 5,
constructor(...args) {
super(...args, {
name: "pay",
description: "Pay a user some money from your wallet",
category: "Economy",
usage: "pay <user> <amount>",
examples: "pay @Peter 500",
cooldown: 5,
});
}
async run(message, args) {
const user = message.mentions.members.first();
const amount = args.slice(1).join("");
const profile = await Profile.findOne({ userID: message.author.id, guildId: message.guild.id });
if (!profile) {
await createProfile(message.author, message.guild);
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to use it.`)
]
});
} else {
if (!user) {
message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor(message.client.color.red)
.setDescription(`Who do I pay?`)
]
});
} else if (user.id == message.author.id) {
message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor(message.client.color.red)
.setDescription(`You can't pay yourself!`)
]
});
} else {
await Profile.updateOne({
userID: message.author.id, guildId: message.guild.id
}, { $inc: { wallet: -amount } });
await Profile.updateOne({
userID: user.id, guildId: message.guild.id
}, { $inc: { wallet: amount } });
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor(message.client.color.green)
.setDescription(`You payed $${amount} to ${user}.`)
]
});
}
}
async run(message, args) {
const user = message.mentions.members.first();
const amount = args.slice(1).join("");
const profile = await Profile.findOne({ userID: message.author.id, guildId: message.guild.id });
if(!profile) {
await createProfile(message.author, message.guild);
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor("BLURPLE")
.setDescription(`Creating profile.\nUse this command again to use it.`)
]
});
} else {
if(!user) {
message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor(message.client.color.red)
.setDescription(`Who do I pay?`)
]
});
} else if(user.id == message.author.id) {
message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor(message.client.color.red)
.setDescription(`You can't pay yourself!`)
]
});
} else {
await Profile.updateOne({
userID: message.author.id, guildId: message.guild.id
}, { $inc: { wallet: -amount } });
await Profile.updateOne({
userID: user.id, guildId: message.guild.id
}, { $inc: { wallet: amount } });
await message.channel.sendCustom({
embeds: [
new MessageEmbed()
.setColor(message.client.color.green)
.setDescription(`You payed $${amount} to ${user}.`)
]
});
}
}
}
}
};
Loading

0 comments on commit 4a6a484

Please sign in to comment.