nyx/unused/commands/Economy/daily.js

50 lines
1.7 KiB
JavaScript
Raw Normal View History

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) => {
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()
.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)
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);
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(
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);
return interaction.followUp({ embeds: [norm_embed] });
2021-09-06 12:38:25 +02:00
}
}
},
};