nyx/command/Economy/daily.js

44 lines
1.6 KiB
JavaScript
Raw Normal View History

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) => {
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;
const pre_embed = new MessageEmbed()
.setTitle(`${user.username}'s profile`)
2021-09-06 12:38:25 +02:00
.setDescription(
`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)
.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);
return interaction.followUp({ embeds: [pre_embed] });
2021-09-06 12:38:25 +02:00
} else {
money = 10000;
const norm_embed = new MessageEmbed()
2021-09-06 12:38:25 +02:00
.setAuthor(
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)
.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);
return interaction.followUp({ embeds: [norm_embed] });
2021-09-06 12:38:25 +02:00
}
}
},
};