nyx/commands/Economy/shop.js

29 lines
946 B
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
const { Client, Message, MessageEmbed } = require("discord.js");
2021-06-24 09:53:19 +02:00
const util = require("../../util/pagination/pagination");
const items = require("../../util/dist/item");
2021-06-12 12:53:51 +02:00
module.exports = {
name: "shop",
description: "Check the items from the shop",
category: "Economy",
run: async (client, message, args) => {
const list = items.map((value, index) => {
return `**${value.item}** — ${value.price.toLocaleString()}${
client.currency
}\nID: \`${value.id}\``;
});
const c = util.chunk(list, 5).map(x => x.join("\n\n"));
const embed = new MessageEmbed()
.setTitle("**cath.exe shop**")
.setTimestamp()
.setDescription(c[0])
.setColor(client.color)
.setFooter(`Page 1 of ${c.length}`);
try {
const msg = await message.channel.send(embed);
if (list.length > 5) await util.pagination(msg, message.author, c);
} catch (e) {
console.log(e);
}
},
};