2022-10-26 12:38:28 +02:00
|
|
|
const { EmbedBuilder } = require("discord.js");
|
2021-09-06 12:38:25 +02:00
|
|
|
module.exports = {
|
|
|
|
name: "daily",
|
|
|
|
description: "Earns daily money",
|
|
|
|
category: "Economy",
|
|
|
|
timeout: 1000 * 60 * 60 * 24,
|
|
|
|
run: async (client, interaction, args) => {
|
2021-11-18 18:56:42 +01:00
|
|
|
let money;
|
2021-09-06 12:38:25 +02:00
|
|
|
const user = await client.data.getUser(interaction.user.id);
|
|
|
|
if (user) {
|
|
|
|
if (user.Premium == true) {
|
|
|
|
money = 20000;
|
2022-10-26 12:38:28 +02:00
|
|
|
const pre_embed = new EmbedBuilder()
|
2021-11-18 18:56:42 +01:00
|
|
|
.setTitle(`${user.username}'s profile`)
|
2021-09-06 12:38:25 +02:00
|
|
|
.setDescription(
|
2021-11-18 18:56:42 +01:00
|
|
|
`Here is your daily **${money}** ${client.currency}\nYou can use this again in 24hrs`
|
2021-09-06 12:38:25 +02:00
|
|
|
)
|
|
|
|
.setURL(client.web)
|
|
|
|
.setColor(client.color)
|
2022-10-26 12:38:28 +02:00
|
|
|
.setFooter({
|
|
|
|
text: `Made by ${client.author}`,
|
|
|
|
iconURL: client.user.displayAvatarURL(),
|
|
|
|
})
|
2021-09-06 12:38:25 +02:00
|
|
|
.setTimestamp();
|
|
|
|
await client.add(interaction.user.id, money, interaction);
|
2021-11-18 18:56:42 +01:00
|
|
|
return interaction.followUp({ embeds: [pre_embed] });
|
2021-09-06 12:38:25 +02:00
|
|
|
} else {
|
|
|
|
money = 10000;
|
2022-10-26 12:38:28 +02:00
|
|
|
const norm_embed = new EmbedBuilder()
|
2021-09-06 12:38:25 +02:00
|
|
|
.setAuthor(
|
2021-11-18 18:56:42 +01:00
|
|
|
interaction.user.tag,
|
2021-09-06 12:38:25 +02:00
|
|
|
interaction.user.displayAvatarURL({ dyanmic: true })
|
|
|
|
)
|
|
|
|
.setDescription(
|
|
|
|
`Here is your daily ${money}${client.currency}!\nBe [premium](https://discord.gg/SbQHChmGcp) user, you can get more coins everyday!`
|
|
|
|
)
|
|
|
|
.setURL(client.web)
|
|
|
|
.setColor(client.color)
|
2022-10-26 12:38:28 +02:00
|
|
|
.setFooter({
|
|
|
|
text: `Made by ${client.author}`,
|
|
|
|
iconURL: client.user.displayAvatarURL(),
|
|
|
|
})
|
2021-09-06 12:38:25 +02:00
|
|
|
.setTimestamp();
|
|
|
|
await client.add(interaction.user.id, money, interaction);
|
2021-11-18 18:56:42 +01:00
|
|
|
return interaction.followUp({ embeds: [norm_embed] });
|
2021-09-06 12:38:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|