commit b61b6887c4fc1dd005e42a2e610e593471996392
parent 66fd0179280f80ea7953a3e9b9ac75a0994160b1
Author: night0721 <[email protected]>
Date: Wed, 2 Mar 2022 19:12:53 +0800
update and fix, loadout command
Diffstat:
5 files changed, 98 insertions(+), 83 deletions(-)
diff --git a/CODM/loadout.js b/CODM/loadout.js
@@ -1,78 +0,0 @@
-const { MessageEmbed } = require("discord.js"); //@night0721 You need to make this
-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;
- const result = new MessageEmbed()
- .setColor(client.color)
- .setFooter(`Made by ${client.author}`)
- .setURL(client.web)
- .setTitle(`🎲 A Randomly Generated Loadout 🎲`)
- .setDescription(
- `This loadout is a randomly generated, Also try, \`\`\`\`/gun\`\`\`\` to get a randomally generated primary weapon gunsmith build`
- )
- .addFields(
- {
- name: `Secondary Weapon`,
- value: ``,
- inline: true,
- },
- {
- name: `Operator Skill`,
- value: ``,
- inline: true,
- },
- {
- name: `Scorestreak`, // 3 perks
- value: ``,
- inline: true,
- },
- {
- name: `Red Perk`,
- value: ``,
- inline: true,
- },
- {
- name: `Green Perk`,
- value: ``,
- inline: true,
- },
- {
- name: `Blue Perk`,
- 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)];
- // }
- },
-};
diff --git a/command/CODM/class.js b/command/CODM/class.js
@@ -8,10 +8,10 @@ module.exports = {
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];
+ const weapons =
+ d.Primary[0][
+ d.Categories[Math.floor(Math.random() * d.Categories.length)]
+ ];
return `${weapons[Math.floor(Math.random() * weapons.length)]}`;
};
const primary_weapon = await data();
diff --git a/command/CODM/loadout.js b/command/CODM/loadout.js
@@ -0,0 +1,74 @@
+const { MessageEmbed } = require("discord.js"); //@night0721 You need to make this
+const items = require("../../util/Data/loadout.json");
+module.exports = {
+ name: "loadout",
+ description: "Generate A Random Loadout",
+ category: "CODM",
+ run: async (client, interaction) => {
+ const secondary =
+ items.secondary[Math.floor(Math.random() * items.secondary.length)];
+ const red = items.perk_1[Math.floor(Math.random() * items.perk_1.length)];
+ const green = items.perk_2[Math.floor(Math.random() * items.perk_2.length)];
+ const blue = items.perk_3[Math.floor(Math.random() * items.perk_3.length)];
+ const operator =
+ items.operator_skill[
+ Math.floor(Math.random() * items.operator_skill.length)
+ ];
+ const slots = shuffle(items.scorestreak);
+ const slot_1 = slots.next().value,
+ slot_2 = slots.next().value,
+ slot_3 = slots.next().value;
+ const result = new MessageEmbed()
+ .setColor(client.color)
+ .setFooter({
+ text: `Made by ${client.author}`,
+ iconURL: client.user.displayAvatarURL(),
+ })
+ .setURL(client.web)
+ .setTitle(`🎲 A Randomly Generated Loadout 🎲`)
+ .setDescription(
+ `This loadout is a randomly generated, Also try, \`\`\`/class\`\`\` to get a randomally generated primary weapon gunsmith build`
+ )
+ .addFields(
+ {
+ name: "Secondary Weapon",
+ value: secondary,
+ inline: true,
+ },
+ {
+ name: "Operator Skill",
+ value: operator,
+ inline: true,
+ },
+ {
+ name: "Scorestreak",
+ value: `${slot_1}\n${slot_2}\n${slot_3}`,
+ inline: true,
+ },
+ {
+ name: "Red Perk",
+ value: red,
+ inline: true,
+ },
+ {
+ name: "Green Perk",
+ value: green,
+ inline: true,
+ },
+ {
+ name: "Blue Perk",
+ value: blue,
+ 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];
+ }
+ }
+ },
+};
diff --git a/util/Data/domains.json b/util/Data/domains.json
@@ -4109,6 +4109,25 @@
"staemporewed.xyz"
],
"iplogger": [
+ "diskerd.gift",
+ "gitdhub.com",
+ "iplogger.org",
+ "2no.co",
+ "iplogger.com",
+ "iplogger.ru",
+ "yip.su",
+ "iplogger.co",
+ "iplogger.info",
+ "ipgrabber.ru",
+ "ipgraber.ru",
+ "iplis.ru",
+ "02ip.ru",
+ "ezstat.ru",
+ "ps3cfw.com",
+ "ythingy.com",
+ "blasze.tk",
+ "fuekos.com",
+ "myiptest.com",
"iplogger.org",
"2no.co",
"iplogger.com",
diff --git a/util/Data/loadout.json b/util/Data/loadout.json
@@ -51,7 +51,7 @@
"Hard Alert",
"Launcher Plus"
],
- "scorestreek": [
+ "scorestreak": [
"Shield Turret",
"UAV",
"Shock RC",