2021-09-06 12:38:25 +02:00
|
|
|
const { MessageEmbed } = require("discord.js");
|
|
|
|
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;
|
2021-11-18 18:56:42 +01:00
|
|
|
const pre_embed = new MessageEmbed()
|
|
|
|
.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)
|
2021-11-18 18:56:42 +01:00
|
|
|
.setFooter(`Made by ${client.author}`, 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;
|
2021-11-18 18:56:42 +01:00
|
|
|
const norm_embed = new MessageEmbed()
|
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)
|
2021-11-18 18:56:42 +01:00
|
|
|
.setFooter(`Made by ${client.author}`, 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
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|