nyx/util/Data/CODM/loadout.js

79 lines
2.4 KiB
JavaScript
Raw Normal View History

2022-10-26 12:38:28 +02:00
const { EmbedBuilder } = require("discord.js"); //@night0721 You need to make this
2022-02-01 15:00:50 +01:00
const items = require("../../util/Data/loadout.json");
module.exports = {
name: "class",
description: "Generate A Random Loadout",
category: "CODM",
run: async (client, interaction) => {
// const data = async () => {
// const d = await model.findOne({});
// const types = d.Categories;
// const names = d.Primary;
// const category = types[Math.floor(Math.random() * types.length)];
// const weapons = names[0][category];
// return `${weapons[Math.floor(Math.random() * weapons.length)]}`;
// };
// const primary_weapon = await data();
// const primary = primary_weapon.replace(/[ -]/g, "_").replace(/\./g, "");
// const slots = shuffle(Object.keys(Attachments[primary][0]));
// const slot_1 = slots.next().value,
// slot_2 = slots.next().value,
// slot_3 = slots.next().value,
// slot_4 = slots.next().value,
// slot_5 = slots.next().value;
2022-10-26 12:38:28 +02:00
const result = new EmbedBuilder()
2022-02-01 15:00:50 +01:00
.setColor(client.color)
2022-10-26 12:38:28 +02:00
.setFooter({ text: `Made by ${client.author}` })
2022-02-01 15:00:50 +01:00
.setURL(client.web)
.setTitle(`🎲 A Randomly Generated Loadout 🎲`)
.setDescription(
2022-03-10 18:57:40 +01:00
`This loadout is a randomly generated, Also try, \`/class\` to get a randomally generated primary weapon gunsmith build`
2022-02-01 15:00:50 +01:00
)
.addFields(
{
name: `Secondary Weapon`,
value: ``,
inline: true,
},
{
name: `Operator Skill`,
value: ``,
inline: true,
},
{
name: `Scorestreak`, // 3 perks
value: ``,
inline: true,
},
{
2022-03-10 18:57:40 +01:00
name: `🔴 Red Perk`,
2022-02-01 15:00:50 +01:00
value: ``,
inline: true,
},
{
2022-03-10 18:57:40 +01:00
name: `🟢 Green Perk`,
2022-02-01 15:00:50 +01:00
value: ``,
inline: true,
},
{
2022-03-10 18:57:40 +01:00
name: `🔵 Blue Perk`,
2022-02-01 15:00:50 +01:00
value: ``,
inline: true,
}
)
.setTimestamp();
interaction.followUp({ embeds: [result] });
// function* shuffle(array) {
// let i = array.length;
// while (i--) {
// yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0];
// }
// }
// function getAttachment(gun, slot) {
// const ca = Attachments[gun][0][slot];
// return ca[Math.floor(Math.random() * ca.length)];
// }
},
};