Merge pull request #51 from night0721/main

ipgrabber-domains.json
This commit is contained in:
Night Kaly 2022-02-02 17:24:34 +00:00 committed by GitHub
commit e4308a2783
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 5746 additions and 4991 deletions

View file

@ -1,85 +0,0 @@
const builds = require("../util/Data/builds.json");
const guns = builds.Main;
const Discord = require("discord.js");
const nmDt = require("../util/Data/aliases.json");
const weaponActualName = nmDt.weaponActualName;
const weaponAlliasName = nmDt.weaponAlliasName;
module.exports = {
name: "build",
description: "Check gun builds",
usage: "(Gun)",
category: "CODM",
status: false,
Owner: true,
run: async (client, message, args) => {
const currGun = weaponIdentifier(args.join(" ").replace("\n", " "));
if (!currGun) message.reply({ content: "Please specify a gun" });
if (typeof currGun == "string") {
message.reply({ embeds: [currGun] });
} else {
const attachNames = currGun.Attachments.map(
x => `**${x.Name}** [${builds.AttachmentTypes[x.Type]}]`
);
const embed = new Discord.MessageEmbed()
.setTitle(
`Build for ${currGun.Name} (${builds.WeaponTypes[currGun.Type]})`
)
.setColor(16580400)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setURL(client.web)
.setDescription(
attachNames.reduce(
(t, x, i, a) => t + (i < a.length - 1 ? "\n" : " \n") + x
)
)
.setImage(currGun.URL);
return message.reply({ embeds: [embed] });
}
},
};
function weaponIdentifier(inpWeaponName) {
if (inpWeaponName.length < 2) {
return "The name `" + inpWeaponName + "` is too short.";
}
let probableWeapons = [];
for (let i = 0; i < guns.length; i++) {
if (inpWeaponName.Simplify() == guns[i].Name.Simplify()) {
return guns[i];
} else if (guns[i].Name.Simplify().includes(inpWeaponName.Simplify())) {
probableWeapons.push(i);
}
}
if (probableWeapons.length == 1) {
return guns[probableWeapons[0]];
}
for (let i = 0; i < weaponAlliasName.length; i++) {
for (let j = 0; j < weaponAlliasName[i].length; j++) {
if (weaponAlliasName[i][j].Simplify() == inpWeaponName.Simplify()) {
for (let i2 = 0; i2 < guns.length; i2++) {
if (weaponActualName[i].Simplify() == guns[i2].Name.Simplify()) {
return guns[i2];
}
}
}
}
}
probableWeapons = [...new Set(probableWeapons)];
if (probableWeapons.length == 1) {
return guns[probableWeapons[0]];
}
if (probableWeapons.length > 1) {
return (
"Did you mean `" +
probableWeapons
.map(x => guns[x].Name)
.reduce((out, x, i) =>
[out, x].join(i === probableWeapons.length - 1 ? "` or `" : "`, `")
) +
"`?"
);
}
return "Couldn't identify the weapon: `" + '"' + inpWeaponName + '"`';
}

78
CODM/loadout.js Normal file
View file

@ -0,0 +1,78 @@
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)];
// }
},
};

774
CODM/new-stats.js Normal file
View file

@ -0,0 +1,774 @@
const { MessageEmbed } = require("discord.js");
const moment = require("moment");
const axios = require("axios");
module.exports = {
name: "stats",
description: "Check Stats of a Weapon by SOD",
usage: "[Weapon Name]",
category: "CODM",
options: [
{
type: "SUB_COMMAND",
name: "assault_rifle",
description: "Get a Stats for Assault Rifle",
options: [
{
type: 3,
name: "Weapon",
description: "Name of the Gun",
required: true,
choices: [
{
name: "Type 25",
value: "A01",
},
{
name: "M16",
value: "A02",
},
{
name: "AK117",
value: "A03",
},
{
name: "AK-47",
value: "A04",
},
{
name: "ASM10",
value: "A05",
},
{
name: "M4",
value: "A06",
},
{
name: "BK57",
value: "A07",
},
{
name: "LK24",
value: "A08",
},
{
name: "ICR-1",
value: "A09",
},
{
name: "Man-o-War",
value: "A10",
},
{
name: "KN-44",
value: "A11",
},
{
name: "HBRa3",
value: "A12",
},
{
name: "HVK-30",
value: "A13",
},
{
name: "DR-H",
value: "A14",
},
{
name: "Peacekeeper MK2",
value: "A15",
},
{
name: "FR .556",
value: "A16",
},
{
name: "AS VAL",
value: "A17",
},
{
name: "CR-56 AMAX",
value: "A18",
},
{
name: "M13",
value: "A19",
},
{
name: "Swordfish",
value: "A20",
},
{
name: "Kilo 141",
value: "A21",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "sub_machine_gun",
description: "Get a Stats for Sub Machine Gun",
options: [
{
type: 3,
name: "Weapon",
description: "Name of the Gun",
required: true,
choices: [
{
name: "RUS-79u",
value: "D01",
},
{
name: "Chicom",
value: "D02",
},
{
name: "PDW-57",
value: "D03",
},
{
name: "Razorback",
value: "D04",
},
{
name: "MSMC",
value: "D05",
},
{
name: "HG40",
value: "D06",
},
{
name: "Pharo",
value: "D07",
},
{
name: "GKS",
value: "D08",
},
{
name: "Cordite",
value: "D09",
},
{
name: "QQ9",
value: "D10",
},
{
name: "Fennec",
value: "D11",
},
{
name: "AGR 556",
value: "D12",
},
{
name: "QXR",
value: "D13",
},
{
name: "PP19 Bizon",
value: "D14",
},
{
name: "MX9",
value: "D15",
},
{
name: "CBR4",
value: "D16",
},
{
name: "PPSh 41",
value: "D17",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "sniper_rifle",
description: "Get a Stats for Sniper Rifle",
options: [
{
type: 3,
name: "Weapon",
description: "Name of the Gun",
required: true,
choices: [
// {
// name: "XPR-50",
// value: "B01",
// },
{
name: "Arctic .50",
value: "B02",
},
{
name: "M21 EBR",
value: "B03",
},
{
name: "DL Q33",
value: "B04",
},
{
name: "Locus",
value: "B05",
},
// {
// name: "NA-45",
// value: "B06",
// },
{
name: "Outlaw",
value: "B07",
},
{
name: "Rytec AMR",
value: "B08",
},
{
name: "SVD",
value: "B09",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "light_machine_gun",
description: "Get a Stats for Light Machine Gun",
options: [
{
type: 3,
name: "Weapon",
description: "Name of the Gun",
required: true,
choices: [
{
name: "S36",
value: "C01",
},
{
name: "UL736",
value: "C02",
},
{
name: "RPD",
value: "C03",
},
{
name: "M4 LMG",
value: "C04",
},
{
name: "Chopper",
value: "C05",
},
{
name: "Holger 26",
value: "C06",
},
{
name: "Hades",
value: "C07",
},
{
name: "PKM",
value: "C08",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "shotgun",
description: "Get a Stats for Shotgun",
options: [
{
type: 3,
name: "Weapon",
description: "Name of the Gun",
required: true,
choices: [
{
name: "HS2126",
value: "E01",
},
{
name: "BY15",
value: "E02",
},
{
name: "HS0405",
value: "E03",
},
{
name: "Striker",
value: "E04",
},
{
name: "KRM_262",
value: "E05",
},
{
name: "Echo",
value: "E06",
},
{
name: "R9-0",
value: "E07",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "marksman_rifle",
description: "Get a Stats for Marksman Rifle",
options: [
{
type: 3,
name: "Weapon",
description: "Name of the Gun",
required: true,
choices: [
{
name: "Kilo Bolt-Action",
value: "F01",
},
{
name: "SKS",
value: "F02",
},
{
name: "SP-R 208",
value: "F03",
},
{
name: "MK2",
value: "F04",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "pistol",
description: "Get a Stats for Pistol",
options: [
{
type: 3,
name: "Weapon",
description: "Name of the Gun",
required: true,
choices: [
{
name: "J358",
value: "G01",
},
{
name: "MW11",
value: "G02",
},
{
name: ".50 GS",
value: "G03",
},
{
name: "Renetti",
value: "G04",
},
{
name: "Shorty",
value: "G05",
},
{
name: "Crossbow",
value: "G06",
},
],
},
],
},
],
// It's not complete, Still work in progress.
run: async (client, interaction, args) => {
const cwts = args[1];
const data = await axios
.get(`${process.env.api}/api/v1/codm/builds?cwts=${cwts}`, {
headers: {
Authorization: process.env.CODM_API_KEY,
},
})
.then((res) => res.data)
.catch((e) => null);
if (!data?.ID) {
const embed = new MessageEmbed()
.setDescription(
`<:nyx_not_available:897378400031879188> Sorry, We currently don't have Stats for this Weapon`
)
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
} else {
const embed = new MessageEmbed()
.setTitle(
`${data.author} Statistical Breakdown`
)
.setColor(16580400)
.setImage(data.imageUrl)
.setFooter(
`Stats Curtosy of Round Table`,
)
// .setFooter(
// `Stats Curtosy of Stats on Duty`,
// )
.setDescription(
`<:nyx_description:897379659665264650> **Description** \n${data.description}`
)
.addFields(
{
name: ":id: CWTS:",
value: `\`\`\`\n${data.cwts}\n\`\`\``,
inline: true,
},
{
name: "<a:lastupdate:897381474330873887> Last Updated:",
value: `\`\`\`\n${moment(Date.parse(data.lastUpdate)).format(
"MMMM Do YYYY"
)}\n\`\`\``,
inline: true,
},
{
name: "Basic Stats",
value: `\`\`\`\n
BSA Score: ${data.bsa_score}
Hipfire Score: ${data.hipfire_score}
Rate of Fire\t\t\t\t: ${data.rof}
Penetration Level\t\t: ${data.penetration}
Firing Mode\t\t\t\t\t: Full Auto
\n\`\`\``,
inline: false,
},
{
name: "Handling & Mobility",
value: `\`\`\`\n
Drop Time : 416.6 ms
Raise Time : 650 ms
Sprinting Speed : 6.09 m/s
Walking Speed : 4.51 m/s
Sprint-to-Fire Time : 165 ms
\n\`\`\``,
inline: false,
},
{
name: "Ammunation Stats",
value: `\`\`\`\n
Magazine : 30
Reserve : 120
Reload Type : Magazine
Cancel Reload Time : 1.9 s
Reload Time : 2.3 s
Full Reload Time : 3.2 s
\n\`\`\``,
inline: false,
},
{
name: ":paperclip: Attachments:",
value: arr.join("\n"),
},
{
name: "<a:tags:897034924140404776> Tags",
value: data.tags.join(", "),
}
)
.setURL(client.web);
interaction.followUp({ embeds: [embed] });
}
},
};
// @night0721 Damage profile will be avalable by different command
// recoilAvailable = false;
// hasError = false;
// console.log(args);
// const repEmb = statsHandler(args.join(" ").replace("\n", " "));
// if (hasError) {
// interaction.followUp({ embeds: [repEmb] });
// }
// if (recoilAvailable) {
// repEmb.fields.push({
// name: "**Recoil Graph**",
// value:
// "```\nThe Recoil graph below is dynamic (change based on attachment equipped)```",
// });
// const recoilImageLink = await chart.getShortUrl();
// repEmb.image = { url: recoilImageLink };
// }
// interaction.followUp({ embeds: [repEmb] });
// },
// }
// run: async (client, interaction, args) => {
// recoilAvailable = false;
// hasError = false;
// console.log(args);
// const repEmb = statsHandler(args.join(" ").replace("\n", " "));
// if (hasError) {
// interaction.followUp({ embeds: [repEmb] });
// }
// if (recoilAvailable) {
// repEmb.fields.push({
// name: "**Recoil Graph**",
// value:
// "```\nThe Recoil graph below is dynamic (change based on attachment equipped)```",
// });
// const recoilImageLink = await chart.getShortUrl();
// repEmb.image = { url: recoilImageLink };
// }
// interaction.followUp({ embeds: [repEmb] });
// },
// };
// function inpHandler(inpmsg) {
// statsHandler(inpmsg.split("+")[0]);
// }
// function statsHandler(inpmsg) {
// let statsNames = [
// "Pellets",
// "Detonation Range",
// "Explosion Radius",
// "Explosion Damage",
// "Firing Mode",
// "Rate of Fire",
// "Bullet in Burst",
// "Time Between Burst",
// "Bullet Speed",
// "Penetration Level",
// "Bullet Spread",
// "Idle Sway",
// "Hipfire Pellet Spread",
// "ADS Pellet Spread",
// "ADS Time",
// "Sprint-to-Fire Time",
// "ADS Zoom",
// "Magazine",
// "Reserve",
// "Reload Type",
// "Cancel Reload Time",
// "Reload Time",
// "Full Reload Time",
// "Drop Time",
// "Raise Time",
// "Sprinting Speed",
// "Walking Speed",
// "Straifing Speed",
// "Damage per Tick",
// "Number of Ticks",
// "Time Between Ticks",
// "Breath Hold Time",
// "shouldNeverHappen0",
// "shouldNeverHappen1",
// "shouldNeverHappen2",
// "shouldNeverHappen3",
// "shouldNeverHappen4",
// ],
// out = [];
// currGun = common.weaponIdentifier(inpmsg);
// if (typeof currGun == "string") {
// hasError = true;
// return currGun;
// }
// currStats = currGun.stats;
// currDRM = currGun.drm[0];
// currAttachments = [];
// currAttachments = common.attachmentsIdentifier(
// inpmsg,
// currGun.aments,
// currStats
// );
// if (typeof currAttachments == "string") {
// hasError = true;
// return currAttachments;
// }
// currRecoilArr = [1, 1, currGun.stats[17]];
// if (currAttachments.length != 0) {
// const totalEffects = common.totaler(currAttachments);
// currStats = common.updateStatswithEffects(totalEffects, currStats);
// currRecoilArr = [totalEffects[2], totalEffects[3], currGun.stats[17]]; // must happen after currStats update
// currDRM = currGun.drm[totalEffects[37]];
// currDRM.range = currDRM.range.map(x =>
// Math.round(x * (1 + totalEffects[13] / 100))
// );
// out = common.attachmentHandler(totalEffects, currStats);
// }
// function statsWorker() {
// if (currStats[19] === 2) {
// currStats[21] =
// currStats[20] + currStats[21] * currStats[17] + currStats[22];
// currStats[20] = 0;
// currStats[22] = 0;
// }
// currStats[25] = (currStats[25] * currStats[26]) / 100;
// const outReady = currStats.map((x, i) =>
// x ? statsNames[i].padEnd(24) + ":".padEnd(3) + beautifier(i) : ""
// );
// out = [
// ...[
// "Basic Stats",
// "ADS Stats",
// "Bullet Stats",
// "Magazine",
// "Handling Stats",
// "Mobility Stats",
// "Miscellaneous Stats",
// ].map((x, i) =>
// fieldMaker(
// x,
// [
// [04, 05, 09],
// [14, 16, 11, 31],
// [00, 06, 07, 08, 10, 12, 13],
// [17, 18, 19, 20, 21, 22],
// [23, 24],
// [25, 26, 27, 15],
// [28, 29, 30, 01, 02, 03],
// ][i]
// )
// ),
// ...out,
// ];
// function fieldMaker(inpName, inpIndx) {
// inpIndx = inpIndx.filter(x => outReady[x]);
// return inpIndx.length
// ? {
// name: "**" + inpName + "**",
// value: "```\n" + inpIndx.map(x => outReady[x]).join("\n") + "```",
// }
// : "";
// }
// }
// statsWorker();
// function beautifier(j) {
// switch (j) {
// case 04:
// return data.firingModes[currStats[j] - 1];
// case 09:
// return data.penetrationLevels[currStats[j] - 1];
// case 19:
// return data.reloadTypes[currStats[j] - 1];
// case 08:
// if (currStats[j] == -1) {
// return "Infinity";
// } else {
// return parseFloat(currStats[j].toFixed(2)).toString() + " m/s";
// }
// case 03:
// return parseFloat(currStats[j].toFixed(2))
// .toString()
// .replace(".", " ~ ");
// default:
// return parseFloat(currStats[j].toFixed(2)).toString() + addUnit(j);
// }
// function addUnit(j) {
// switch (j) {
// case 07:
// case 14:
// case 15:
// case 23:
// case 24:
// case 31:
// return " ms";
// case 27:
// case 28:
// case 25:
// case 26:
// return " m/s";
// case 20:
// case 21:
// case 22:
// return " s";
// case 16:
// return "%";
// case 06:
// return " Rounds";
// case 05:
// return " RPM";
// default:
// return "";
// }
// }
// }
// interpretion = currGun.gunname + common.interpretioner(currAttachments);
// if (currGun.recoil.hr.length > 2) {
// chart = common.recoilHandler(
// currGun.recoil.hr,
// currGun.recoil.vr,
// currRecoilArr[0],
// currRecoilArr[1],
// currRecoilArr[2]
// );
// recoilAvailable = true;
// } else {
// recoilAvailable = false;
// }
// if (chart == "none") {
// recoilAvailable = false;
// }
// if (chart == "err" || currAttachments == "err") {
// hasError = true;
// return "Cocaineeee";
// }
// const dmg =
// common.damageHandler(
// currDRM.damage,
// currDRM.range,
// 1,
// 100,
// 60000 / currStats[5],
// currStats[7],
// currStats[6],
// currStats[0]
// ) || "```This should never happen```";
// out = [
// currGun.description
// ? {
// name: "**Description:**",
// value: "```\n" + currGun.description + "```",
// }
// : {},
// { name: "**Damage Profile:**", value: dmg },
// ...out,
// ];
// out = out.filter(x => x.value);
// return {
// title: interpretion,
// color: 5814783,
// fields: out,
// footer: {
// text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
// icon_url:
// "https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
// },
// };

View file

@ -97,11 +97,7 @@ function statsHandler(inpmsg) {
currStats = currGun.stats;
currDRM = currGun.drm[0];
currAttachments = [];
currAttachments = common.attachmentsIdentifier(
inpmsg,
currGun.aments,
currStats
);
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;

View file

@ -1,2 +1,2 @@
const { CODMClient } = require("cath");
module.exports = new CODMClient("Gae");
module.exports = new CODMClient(process.env.CODM_API_KEY);

View file

@ -22,6 +22,7 @@ class NYX extends Client {
},
shard: "auto",
restTimeOffset: 0,
restRequestTimeout: 99999,
partials: ["MESSAGE", "CHANNEL", "REACTION", "GUILD_MEMBER"],
intents: 24207,
}

View file

@ -1,10 +1,12 @@
const { MessageEmbed } = require("discord.js");
const axios = require("axios");
const moment = require("moment");
const axios = require("axios");
module.exports = {
name: "build",
description: "Get gunsmith builds",
usage: "[Weapon Name] [Author] [Tag]",
type: "CHAT_INPUT",
usage: "[Weapon Name] [Author] [Tag]",
category: "CODM",
options: [
{
@ -19,100 +21,100 @@ module.exports = {
required: true,
choices: [
{
name: "AK117",
value: "ak117",
name: "Type 25",
value: "A01",
},
{
name: "M16",
value: "m16",
value: "A02",
},
{
name: "Type 25",
value: "type25",
name: "AK117",
value: "A03",
},
{
name: "AK-47",
value: "ak47",
value: "A04",
},
{
name: "ASM10",
value: "asm10",
value: "A05",
},
{
name: "M4",
value: "m4",
value: "A06",
},
{
name: "BK57",
value: "bk57",
value: "A07",
},
{
name: "LK24",
value: "lk24",
},
{
name: "Man-o-War",
value: "manowar",
value: "A08",
},
{
name: "ICR-1",
value: "icr1",
value: "A09",
},
{
name: "Man-o-War",
value: "A10",
},
{
name: "KN-44",
value: "kn44",
value: "A11",
},
{
name: "HBRa3",
value: "hbra3",
value: "A12",
},
{
name: "HVK-30",
value: "hvk30",
value: "A13",
},
{
name: "DR-H",
value: "drh",
value: "A14",
},
{
name: "Peacekeeper MK2",
value: "peacekeepermk2",
value: "A15",
},
{
name: "FR .556",
value: "fr556",
value: "A16",
},
{
name: "AS VAL",
value: "asval",
value: "A17",
},
{
name: "CR-56 AMAX",
value: "cr56amax",
value: "A18",
},
{
name: "M13",
value: "m13",
value: "A19",
},
{
name: "Swordfish",
value: "swordfish",
value: "A20",
},
{
name: "Kilo 141",
value: "A21",
},
// {
// name: "Kilo 141",
// value: "kilo",
// },
],
},
{
type: 3,
name: "youtuber",
name: "Author",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
name: "path.exe",
value: "path.exe",
},
{
name: "Jokesta",
@ -139,8 +141,8 @@ module.exports = {
value: "passive",
},
{
name: "Search & Destroy",
value: "snd",
name: "Search And Destroy",
value: "Search And Destroy",
},
{
name: "Respawn",
@ -163,83 +165,83 @@ module.exports = {
choices: [
{
name: "RUS-79u",
value: "rus79u",
},
{
name: "PDW-57",
value: "pdw57",
},
{
name: "Razorback",
value: "razorback",
},
{
name: "MSMC",
value: "msmc",
},
{
name: "HG40",
value: "hg40",
},
{
name: "Pharo",
value: "pharo",
},
{
name: "GKS",
value: "gks",
},
{
name: "Cordite",
value: "cordite",
},
{
name: "QQ9",
value: "qq9",
},
{
name: "Fennec",
value: "fennec",
value: "D01",
},
{
name: "Chicom",
value: "chicom",
value: "D02",
},
{
name: "PDW-57",
value: "D03",
},
{
name: "Razorback",
value: "D04",
},
{
name: "MSMC",
value: "D05",
},
{
name: "HG40",
value: "D06",
},
{
name: "Pharo",
value: "D07",
},
{
name: "GKS",
value: "D08",
},
{
name: "Cordite",
value: "D09",
},
{
name: "QQ9",
value: "D10",
},
{
name: "Fennec",
value: "D11",
},
{
name: "AGR 556",
value: "agr556",
value: "D12",
},
{
name: "QXR",
value: "qxr",
value: "D13",
},
{
name: "PP19 Bizon",
value: "pp19bizon",
value: "D14",
},
{
name: "MX9",
value: "mx9",
value: "D15",
},
{
name: "CBR4",
value: "cbr4",
value: "D16",
},
{
name: "PPSh 41",
value: "ppsh",
value: "D17",
},
],
},
{
type: 3,
name: "youtuber",
name: "Author",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
name: "path.exe",
value: "path.exe",
},
{
name: "Jokesta",
@ -262,8 +264,8 @@ module.exports = {
value: "passive",
},
{
name: "Search & Destroy",
value: "snd",
name: "Search And Destroy",
value: "Search And Destroy",
},
{
name: "Respawn",
@ -284,58 +286,54 @@ module.exports = {
description: "Name of the Gun",
required: true,
choices: [
// {
// name: "XPR-50",
// value: "B01",
// },
{
name: "Arctic .50",
value: "arctic50",
value: "B02",
},
{
name: "M21 EBR",
value: "m21ebr",
value: "B03",
},
{
name: "DL Q33",
value: "dlq33",
value: "B04",
},
{
name: "Locus",
value: "locus",
value: "B05",
},
// {
// name: "XPR-50",
// value: "xpr50",
// },
// {
// name: "NA-45",
// value: "na45",
// value: "B06",
// },
{
name: "Outlaw",
value: "outlaw",
value: "B07",
},
{
name: "Rytec AMR",
value: "rytecamr",
value: "B08",
},
{
name: "SVD",
value: "svd",
value: "B09",
},
],
},
{
type: 3,
name: "youtuber",
name: "Author",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
name: "path.exe",
value: "path.exe",
},
// {
// name: "little_b",
// value: "littleb",
// },
],
},
{
@ -353,8 +351,8 @@ module.exports = {
value: "passive",
},
{
name: "Search & Destroy",
value: "snd",
name: "Search And Destroy",
value: "Search And Destroy",
},
{
name: "Respawn",
@ -377,47 +375,47 @@ module.exports = {
choices: [
{
name: "S36",
value: "s36",
value: "C01",
},
{
name: "UL736",
value: "ul736",
value: "C02",
},
{
name: "RPD",
value: "rpd",
value: "C03",
},
{
name: "M4 LMG",
value: "m4lmg",
value: "C04",
},
{
name: "Chopper",
value: "chopper",
value: "C05",
},
{
name: "Holger 26",
value: "holger26",
value: "C06",
},
{
name: "Hades",
value: "hades",
value: "C07",
},
{
name: "PKM",
value: "pkm",
value: "C08",
},
],
},
{
type: 3,
name: "youtuber",
name: "Author",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
name: "path.exe",
value: "path.exe",
},
],
},
@ -436,8 +434,8 @@ module.exports = {
value: "passive",
},
{
name: "Search & Destroy",
value: "snd",
name: "Search And Destroy",
value: "Search And Destroy",
},
{
name: "Respawn",
@ -460,43 +458,43 @@ module.exports = {
choices: [
{
name: "HS2126",
value: "hs2126",
value: "E01",
},
{
name: "BY15",
value: "by15",
},
{
name: "Striker",
value: "striker",
},
{
name: "KRM_262",
value: "krm262",
},
{
name: "Echo",
value: "echo",
value: "E02",
},
{
name: "HS0405",
value: "hs0405",
value: "E03",
},
{
name: "Striker",
value: "E04",
},
{
name: "KRM 262",
value: "E05",
},
{
name: "Echo",
value: "E06",
},
{
name: "R9-0",
value: "r90",
value: "E07",
},
],
},
{
type: 3,
name: "youtuber",
name: "Author",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
name: "path.exe",
value: "path.exe",
},
{
name: "dHitman",
@ -535,35 +533,35 @@ module.exports = {
choices: [
{
name: "Kilo Bolt-Action",
value: "kiloboltaction",
value: "F01",
},
{
name: "SKS",
value: "sks",
value: "F02",
},
{
name: "SP-R 208",
value: "spr208",
value: "F03",
},
{
name: "MK2",
value: "mk2",
value: "F04",
},
],
},
{
type: 3,
name: "youtuber",
name: "Author",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
name: "path.exe",
value: "path.exe",
},
// {
// name: "Little_b",
// value: "littleb",
// name: "Stats On Duty",
// value: "sod",
// },
],
},
@ -602,40 +600,44 @@ module.exports = {
choices: [
{
name: "J358",
value: "j358",
value: "G01",
},
{
name: "MW11",
value: "mw11",
value: "G02",
},
{
name: ".50 GS",
value: "gs50",
value: "G03",
},
{
name: "Renetti",
value: "renetti",
value: "G04",
},
{
name: "Shorty",
value: "shorty",
value: "G05",
},
{
name: "Crossbow",
value: "crossbow",
value: "G06",
},
],
},
{
type: 3,
name: "youtuber",
name: "Author",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
name: "path.exe",
value: "path.exe",
},
// {
// name: "Stats On Duty",
// value: "sod",
// },
],
},
{
@ -654,126 +656,38 @@ module.exports = {
},
],
run: async (client, interaction, args) => {
const allguns = {
ak117: "AK117",
m16: "M16",
type25: "Type 25",
ak47: "AK-47",
asm10: "ASM10",
m4: "M4",
bk57: "BK57",
lk24: "LK24",
manowar: "Man-O-War",
icr1: "ICR-1",
kn44: "KN-44",
hbra3: "HBRa3",
hvk30: "HVK-30",
drh: "DR-H",
peacekeepermk2: "Peacekeeper MK2",
fr556: "FR .556",
asval: "AS VAL",
cr56amax: "CR-56 AMAX",
m13: "M13",
swordfish: "Swordfish",
// kilo: "Kilo 141",
j358: "J358",
gs50: ".50 GS",
mw11: "MW11",
renetti: "Renetti",
shorty: "Shorty",
crossbow: "Crossbow",
kiloboltaction: "Kilo Bolt-Action",
sks: "SKS",
spr208: "SP-R 208",
mk2: "MK2",
s36: "S36",
ul736: "UL736",
rpd: "RPD",
m4lmg: "M4LMG",
chopper: "Chopper",
holger26: "Holger 26",
hades: "Hades",
pkm: "PKM",
arctic50: "Arctic .50",
m21ebr: "M21 EBR",
dlq33: "DL Q33",
locus: "Locus",
// na45: "NA 45",
// xpr50: "XPR-50",
locus: "Locus",
outlaw: "Outlaw",
rytecamr: "Rytec AMR",
svd: "SVD",
hs2126: "HS2126",
by15: "BY15",
striker: "Striker",
krm262: "KRM 262",
echo: "Echo",
hs0405: "HS0405",
r90: "R9-0",
rus79u: "RUS-79U",
hg40: "HG-40",
pdw57: "PDW-57",
chicom: "Chicom",
razorback: "Razorback",
msmc: "MSMC",
pharo: "Pharo",
gks: "GKS",
cordite: "Cordite",
qq9: "QQ9",
fennec: "Fennec",
agr556: "AGR 556",
qxr: "QXR",
pp19bizon: "PP19 Bizon",
mx9: "MX9",
cbr4: "CBR4",
ppsh: "PPSh-41",
};
const all = {
assault_rifle: "Assault Rifle",
sniper_rifle: "Sniper Rifle",
marksman_rifle: "Marksman Rifle",
shotgun: "Shotgun",
light_machine_gun: "Light Machine Gun",
sub_machine_gun: "Sub Machine Gun",
path: "Path.exe",
dhitman: "dHitman",
jokesta: "Jokesta",
sod: "Stats On Duty",
// littleb:"Little B",
aggressive: "Aggressive",
passive: "Passive",
snd: "Search And Destroy",
respawn: "Respawn",
ads: "ADS",
hipfire: "Hipfire",
};
const gun = args[1];
const cwts = args[1];
const cc = args[2];
const tag = args[3];
const data = await axios
.get(
`${process.env.api}/api/v1/codm/builds?name=${gun}&cc=${cc}&tag=${tag}`,
`${process.env.api}/api/v1/codm/build?cwts=${cwts}&cc=${cc}&tag=${tag}`,
{
headers: {
Authorization: "Gae",
Authorization: process.env.CODM_API_KEY,
},
}
)
.then(res => res.data)
.catch(e => null);
if (!data?.ID) {
var all = {
"path.exe": "path.exe",
dhitman: "dHitman",
jokesta: "Jokesta",
// littleb:"Little B",
aggressive: "Aggressive",
passive: "Passive",
"Search And Destroy": "Search And Destroy",
respawn: "Respawn",
ads: "ADS",
hipfire: "Hipfire",
};
if (!data?.cwts) {
const embed = new MessageEmbed()
.setDescription(
`<:nyx_not_available:897378400031879188> We don't have a ${all[tag]} **${allguns[gun]}** gunsmith build by **${all[cc]}**, Please try another tag or a differnt content creator`
`<:nyx_not_available:897378400031879188> We don't have a ${all[tag]} gunsmith build for the gun with **CWTS ${cwts}** by **${all[cc]}**, Please try another tag or a differnt content creator`
)
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
@ -784,17 +698,17 @@ module.exports = {
});
const embed = new MessageEmbed()
.setTitle(
`${data.weaponName}(${data.weaponType})'s ${all[tag]} build from ${data.author}`
`${all[tag]} build for ${data.weaponName} from ${data.author}`
)
.setDescription(
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${data.notes} \n\`\`\``
)
.setColor(16580400)
.setImage(data.imageUrl)
.setFooter(
`Builds Aggregated by ${client.author}`,
client.user.displayAvatarURL()
)
.setFooter({
text: `Builds Aggregated by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp()
.addFields(
{

View file

@ -39,11 +39,7 @@ function dmg(inpmsg) {
}
currDRM = currGun.drm[0];
currStats = currGun.stats;
currAttachments = common.attachmentsIdentifier(
inpmsg,
currGun.aments,
currStats
);
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;

View file

@ -114,11 +114,7 @@ function attachments(inpmsg) {
hasAttachments = common.hasAttachments(inpmsg);
currAttachments = [];
if (hasAttachments) {
currAttachments = common.attachmentsIdentifier(
inpmsg,
currGun.aments,
currGun.stats
);
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;

View file

@ -1,6 +1,5 @@
const { MessageEmbed } = require("discord.js");
const { CODMClient } = require("cath");
const c = new CODMClient("Gae");
const c = require("../../client/CODMClient");
module.exports = {
name: "perk",
description: "Get perk stats",

View file

@ -1,6 +1,5 @@
const { MessageEmbed } = require("discord.js");
const { CODMClient } = require("cath");
const c = new CODMClient("Gae");
const c = require("../../client/CODMClient");
module.exports = {
name: "scorestreak",
description: "Get Scorestreak stats",
@ -60,8 +59,8 @@ module.exports = {
value: "clusterstrike",
},
{
name: "XS1 Goliath",
value: "xs1goliath",
name: "Chopper Gunner",
value: "choppergunner",
},
{
name: "Stealth Chopper",
@ -131,47 +130,37 @@ module.exports = {
const val = args[1];
const d = await c.getscorestreak(val);
const embed = new MessageEmbed()
.setTitle(d.scorestreak)
.setTitle(d.name)
.setURL(d.preview_video)
.setDescription(`\`\`\`${d.description}\`\`\``)
.setDescription(
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${d.description}\`\`\``
)
.addFields(
{
name: "Cost",
value: `\`\`\`${d.cost}\`\`\``,
inline: true,
},
{
name: "Lethal",
value: `
${
d.lethal == true
? "<a:nyx_checkmark:897240322411724841> Yes"
: "<a:nyx_cross:897244999211696198> No"
}`,
value: `${d.cost}`,
inline: true,
},
{
name: "AI-Assisted",
value: `
${
d.manual == false
? "<a:nyx_checkmark:897240322411724841> Yes"
: "<a:nyx_cross:897244999211696198> No"
d.manual
? "<a:nyx_cross:897244999211696198> No"
: "<a:nyx_checkmark:897240322411724841> Yes"
}`,
inline: true,
},
{
name: "More Info",
value: `\`\`\`${d.special}\`\`\``,
inline: false,
}
)
.setThumbnail(d.preview)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setColor(
d.type == "lethal"
? "FF2222"
: d.type == "support"
: d.type == "assist"
? "22FF4A"
: client.color
)

View file

@ -129,11 +129,7 @@ function statsHandler(inpmsg) {
currStats = currGun.stats;
currDRM = currGun.drm[0];
currAttachments = [];
currAttachments = common.attachmentsIdentifier(
inpmsg,
currGun.aments,
currStats
);
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;
@ -299,7 +295,7 @@ function statsHandler(inpmsg) {
footer: {
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
},
};
}

View file

@ -1,18 +1,20 @@
const { MessageEmbed } = require("discord.js");
const dares = require("../../util/Data/dares.json");
const tnd = require("../../util/Data/tnd.json");
module.exports = {
name: "dare",
description: "The maturity level of the topics the question can relate to",
run: async (client, interaction) => {
const embed = new MessageEmbed()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dyamic: true })
)
.setTitle(dares[Math.round(Math.random() * (dares.length - 1))])
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dyamic: true }),
})
.setTitle(dares[Math.round(Math.random() * tnd.dare.length - 1)])
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},

View file

@ -1,18 +1,20 @@
const { MessageEmbed } = require("discord.js");
const truth = require("../../util/Data/truth.json");
const tnd = require("../../util/Data/tnd.json");
module.exports = {
name: "truth",
description: "Gives a random question that has to be answered truthfully",
run: async (client, interaction, args) => {
const embed = new MessageEmbed()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dyamic: true })
)
.setTitle(truth[Math.round(Math.random() * truth.length)])
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dyamic: true }),
})
.setTitle(truth[Math.round(Math.random() * tnd.truth.length)])
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},

View file

@ -1,9 +1,13 @@
module.exports = {
name: "add",
name: "economy",
category: "Owner",
usage: "(Number)",
description: "Add coins from someone",
description: "Add/Remove coins from someone",
Owner: true,
options: [
{
type: 1,
name: "add",
description: "Remove coins from someone",
options: [
{
type: 6,
@ -18,7 +22,29 @@ module.exports = {
required: true,
},
],
},
{
type: 1,
name: "rmv",
description: "Remove coins from someone",
options: [
{
type: 6,
name: "user",
description: "The user you want to remove",
required: true,
},
{
type: 4,
name: "cp",
description: "The amount of CP you want to remove",
required: true,
},
],
},
],
run: async (client, interaction, args) => {
if (args[0] === "add") {
await client.add(args[0], args[1], interaction);
interaction.followUp({
content: `<a:nyx_checkmark:897240322411724841> Successfully added **${interaction.options.getInteger(
@ -27,5 +53,16 @@ module.exports = {
interaction.options.getUser("user").username
}**'s balance`,
});
}
if (args[0] === "rmv") {
await client.rmv(args[0], args[1]);
interaction.followUp({
content: `<a:nyx_checkmark:897240322411724841> Successfully removed **${interaction.options.getInteger(
"cp"
)}** ${client.currency} from **${
interaction.options.getUser("user").username
}**'s balance`,
});
}
},
};

View file

@ -47,19 +47,22 @@ module.exports = {
evaled = err;
}
if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
evaled = utils.chunk(evaled, 750);
console.log(evaled);
evaled = chunk([evaled], 750);
console.log(evaled);
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
page = 0,
evaledEmbed = new Discord.MessageEmbed()
.setColor(client.color)
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
.setTimestamp()
.setAuthor(
`Evaled by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true })
)
.addField(`Type of`, `\`\`\`js\n${typeof evaled[0]}\n\`\`\``);
const mainMessage = await interaction.channel.send({ embeds: [evaledEmbed] });
.setAuthor({
name: `Evaled by ${interaction.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
});
const mainMessage = await interaction.channel.send({
embeds: [evaledEmbed],
});
Discord.TextChannel.prototype.send = oldSend;
await Promise.all(
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r =>
@ -112,12 +115,17 @@ module.exports = {
}
evaledEmbed = new Discord.MessageEmbed()
.setColor(interaction.guild.me.displayColor)
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``)
.addField(`Type of`, `\`\`\`js\n${typeof evaled[page]}\n\`\`\``);
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``);
await mainMessage.edit({
embeds: [evaledEmbed],
});
});
},
};
function chunk(arr, size) {
let c;
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
c = arr.slice(i * size, i * size + size);
});
return c;
}

View file

@ -1,31 +0,0 @@
module.exports = {
name: "rmv",
category: "Owner",
usage: "(Number)",
description: "Remove coins from someone",
Owner: true,
options: [
{
type: 6,
name: "user",
description: "The user you want to remove",
required: true,
},
{
type: 4,
name: "cp",
description: "The amount of CP you want to remove",
required: true,
},
],
run: async (client, interaction, args) => {
await client.rmv(args[0], args[1]);
interaction.followUp({
content: `<a:nyx_checkmark:897240322411724841> Successfully removed **${interaction.options.getInteger(
"cp"
)}** ${client.currency} from **${
interaction.options.getUser("user").username
}**'s balance`,
});
},
};

View file

@ -1,177 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { CODMClient } = require("cath");
const c = new CODMClient("Gae");
module.exports = {
name: "scorestreak",
description: "Get Scorestreak stats",
type: "CHAT_INPUT",
usage: "{Scorestreak}",
category: "CODM",
options: [
{
type: "SUB_COMMAND",
name: "lethal",
description: "Lethal Scorestreak",
options: [
{
type: 3,
name: "scorestreak",
description: "Select a lethal scorestreak",
required: true,
choices: [
{
name: "Shield Turret",
value: "shieldturret",
},
{
name: "Hunter Killer Drone",
value: "hunterkillerdrone",
},
{
name: "MQ-27 Dragonfire",
value: "mq27dragonfire",
},
{
name: "Predator Missile",
value: "predatormissile",
},
{
name: "Hawk X3",
value: "hawkx3",
},
{
name: "Sentry Gun",
value: "sentrygun",
},
{
name: "Lightning Strike",
value: "lightningstrike",
},
{
name: "Orbital Laser",
value: "orbitallaser",
},
{
name: "XS1 Goliath",
value: "xs1goliath",
},
{
name: "Cluster Strike",
value: "clusterstrike",
},
{
name: "XS1 Goliath",
value: "xs1goliath",
},
{
name: "Stealth Chopper",
value: "stealthchopper",
},
{
name: "Swarm",
value: "swarm",
},
{
name: "Napalm",
value: "napalm",
},
{
name: "VTOL",
value: "vtol",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "support",
description: "Support Scorestreak",
options: [
{
type: 3,
name: "scorestreak",
description: "Select a Support Scorestreak",
required: true,
choices: [
{
name: "UAV",
value: "uav",
},
{
name: "Shock RC",
value: "shockrc",
},
{
name: "Care Package",
value: "carepackage",
},
{
name: "Counter UAV",
value: "cuav",
},
{
name: "SAM Turret",
value: "samturret",
},
{
name: "Advance UAV",
value: "auav",
},
{
name: "EMP Systems",
value: "empsystems",
},
],
},
],
},
],
run: async (client, interaction, args) => {
const val = args[1];
const d = await c.getscorestreak(val);
const embed = new MessageEmbed()
.setTitle(d.scorestreak)
.setURL(d.preview_video)
.setDescription(`\`\`\`${d.description}\`\`\``)
.addFields(
{
name: "Cost",
value: `\`\`\`${d.cost}\`\`\``,
inline: true
},
{
name: "Lethal",
value: `
${d.lethal == true
? "<a:nyx_checkmark:897240322411724841> Yes"
: "<a:nyx_cross:897244999211696198> No"}`,
inline: true
},
{
name: "AI-Assisted",
value: `
${d.manual == false
? "<a:nyx_checkmark:897240322411724841> Yes"
: "<a:nyx_cross:897244999211696198> No"}`,
inline: true
},
{
name: "More Info",
value: `\`\`\`${d.special}\`\`\``,
inline: false
}
)
.setThumbnail(`${d.preview}`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setColor(
d.type == "lethal"
? "FF2222"
: d.type == "support"
? "22FF4A"
: client.color
)
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};

79
command/Utilities/poll.js Normal file
View file

@ -0,0 +1,79 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "poll",
category: "Utilities",
description: "Creates a poll with many options",
options: [
{
type: 3,
name: "question",
description: "The question of the poll",
required: true,
},
{
type: 3,
name: "choice1",
description: "Choice 1",
required: true,
},
{
type: 3,
name: "choice2",
description: "Choice 2",
required: true,
},
{
type: 3,
name: "choice3",
description: "Choice 3",
required: false,
},
{
type: 3,
name: "choice4",
description: "Choice 4",
required: false,
},
{
type: 3,
name: "choice5",
description: "Choice 5",
required: false,
},
{
type: 3,
name: "choice6",
description: "Choice 6",
required: false,
},
],
run: async (client, interaction, args) => {
const pollCreateEmbed = new MessageEmbed()
.setTitle(`📣 **${args[0]}**`)
.setColor("RED")
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp();
for (let i = 0; i < args.length - 1; i++) {
pollCreateEmbed.addField(
"",
`:regional_indicator_${String.fromCharCode(97 + i)}: ${args[i + 1]}
`
);
}
let embedMessage = await interaction.followUp({
embeds: [pollCreateEmbed],
});
55356;
for (let i = 0; i < args.length - 1; i++) {
if (i === 0) embedMessage.react("\ud83c\udde6");
if (i === 1) embedMessage.react("\ud83c\udde7");
if (i === 2) embedMessage.react("\ud83c\udde8");
if (i === 3) embedMessage.react("\ud83c\udde9");
if (i === 4) embedMessage.react("\ud83c\uddea");
if (i === 5) embedMessage.react("\ud83c\uddeb");
}
},
};

View file

@ -1,7 +1,7 @@
const client = require("..");
const { MessageEmbed } = require("discord.js");
const utils = require("../util/functions/function");
const scams = require("../util/Data/scam.json");
const domains = require("../util/Data/domains.json");
client.on("messageCreate", async message => {
if (message.author.bot || !message.guild) return;
const data = {};
@ -66,7 +66,17 @@ client.on("messageCreate", async message => {
}
if (data.User?.Blacklist) return;
if (
scams.includes(
domains.iplogger.includes(
message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)
) ||
domains.scam.includes(
message.content
.toLowerCase()
.match(
@ -77,14 +87,59 @@ client.on("messageCreate", async message => {
.slice(0, -1)
)
) {
message.delete();
message.channel.send({
content: `**${message.author.tag}** has sent a scam link and I have deleted it to prevent spread`,
});
const _ = new MessageEmbed()
.setTitle(`Scam/IP Grabber detected`)
.setTimestamp()
.setColor(client.color)
.addFields(
{
name: "User",
value: `${message.author.tag} (${message.author.id})`,
inline: true,
},
{
name: "Scam/IP Logger URL",
value: `||https://${message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)}||`,
inline: true,
}
)
.setFooter({
text: `Tactical Protection by ${client.author}`,
icon_url: client.user.displayAvatarURL(),
});
message.channel.send({
embeds: [_],
});
client.channels.cache.get("936986641585799178").send({
embeds: [
_.addFields(
{
name: "Message",
value: message.content,
inline: false,
},
{
name: "Guild",
value: message.guild ? message.guild.name : "None",
inline: true,
}
),
],
});
message.delete().catch(() => {});
}
if (
message?.content.startsWith(data.Guild.Prefix) ||
message?.content.startsWith("C.")
message?.content.startsWith("C.") ||
message?.content.startsWith("c.")
) {
const embed = new MessageEmbed()
.setTitle(`Message commands are now disabled`)
@ -157,7 +212,15 @@ client.on("messageCreate", async message => {
}
if (message.content) {
client.channels.cache.get(client.config.DMLog).send({
content: `\`${message.author.tag}(${message.author.id})\`: ${message.content}`,
embeds: [
new MessageEmbed()
.setDescription(message.content)
.setColor(client.color)
.setAuthor({
name: message.author.tag,
iconURL: message.author.displayAvatarURL({ dynamic: true }),
}),
],
});
}
}

View file

@ -1,144 +0,0 @@
//made by the shadow himself.
client.on('message', message => {
const grabifyEmbed = new Discord.MessageEmbed()
grabifyEmbed.setTitle("**IP Grabber Detected!**")
grabifyEmbed.addField("**Username :** ", `${message.author.username}`)
grabifyEmbed.addField("**User ID :** ", `${message.author.id}`)
grabifyEmbed.addField("**Domain :** Grabify", `**Link sent :** ||${message}||`)
grabifyEmbed.setTimestamp()
grabifyEmbed.addField("`Tactical Protection by`", "`Team NYX`")
const discordEmbed = new Discord.MessageEmbed()
discordEmbed.setTitle("**IP Grabber Detected!**")
discordEmbed.addField("**Username :** ", `${message.author.username}`)
discordEmbed.addField("**User ID :** ", `${message.author.id}`)
discordEmbed.addField("**Domain :** Discord", `**Link sent :** ||${message}||`)
discordEmbed.setTimestamp()
discordEmbed.addField("`Tactical Protection by`", "`Team NYX`")
if ((message.content.includes("https://dlscord.org/nitro-gift")) || (message.content.includes("http://dlscord.org/nitro-gift"))) {
message.delete();
message.channel.send(discordEmbed)
}
if ((message.content.includes("https://lovebird.guru")) || (message.content.includes("http://lovebird.guru"))) {
message.delete();
message.channel.send(grabifyEmbed)
}
if ((message.content.includes("https://trulove.guru")) || (message.content.includes("http://trulove.guru"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://dateing.club")) || (message.content.includes("http://dateing.club"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://shrekis.life")) || (message.content.includes("http://shrekis.life"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://headshot.monster")) || (message.content.includes("http://headshot.monster"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://gamihg-at-my.best")) || (message.content.includes("http://gaming-at-my.best"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://progaming.monster")) || (message.content.includes("http://programing.monster"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://yourmy.monster")) || (message.content.includes("http://yourmg.monster"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://imageshare.best")) || (message.content.includes("http://imageshere.best"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.startsWith("https://screenshot.best")) || (message.content.includes("http://screenshot.best"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://gamingfun.me")) || (message.content.includes("http://gamingfun.me"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://catsnthing.com")) || (message.content.includes("http://catsnthing.com"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://catsnthings.fun")) || (message.content.includes("http://catsnthings.fun"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://joinmy.site")) || (message.content.includes("http://joinmy.site"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://fortnitechat.site")) || (message.content.includes("http://fortnitechat.site"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://fortnight.space")) || (message.content.includes("http://fortnight.space"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://freegiftcards.co")) || (message.content.includes("http://freegiftcards.co"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://grabify.link")) || (message.content.includes("http://grabify.link"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://partpicker.shop")) || (message.content.includes("http://partpicker.shop"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://websafe.online")) || (message.content.includes("http://websafe.online"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://sportshub.bar")) || (message.content.includes("http://sportshub.bar"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://herald.sbs")) || (message.content.includes("http://herald.sbs"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
if ((message.content.includes("https://locations.quest")) || (message.content.includes("http://locations.quest"))) {
message.delete();
message.channel.send(grabifyEmbed);
}
});
//MORE DOMAINS COMING IN A WEEK HEHE BOI

View file

@ -41,9 +41,9 @@
},
"dependencies": {
"axios": "^0.25.0",
"cath": "^1.4.6",
"cath": "^1.4.7",
"discord.js": "^13.6.0",
"dotenv": "^14.2.0",
"dotenv": "^15.0.0",
"erela.js": "^2.3.3",
"erela.js-spotify": "^1.2.0",
"goosecache": "^9.0.14",

View file

@ -1,11 +0,0 @@
//use eval if you wanna.
//this gives you the invite link in a server of a channel.
//code by Tac Shadow#5920
async function asyncCall() {
const result = await client.channels.cache.get("CHANNEL_ID").createInvite();
message.channel.send(`${result}`);
}
asyncCall();

View file

@ -26,7 +26,8 @@
"CR-56 AMAX",
"Shorty",
"Crossbow",
"R9-0"
"R9-0",
"PPSh-41"
],
"weaponAlliasName": [
["MoW"],
@ -48,14 +49,15 @@
["Slow Outlaw", "Slower Outlaw"],
["bae"],
["Reneti", "Renneti", "Rennetti", "Burst Pistol"],
["pp bizon", "pp"],
["pp bizon", "pp19"],
["AUG"],
["AKBP", "Vepr"],
["AN94"],
["CR56", "AMAX"],
["725"],
["cb", "bow"],
["r9", "R9-O"]
["r9", "R9-O"],
["ppsh", "pp41"]
],
"attachmentActualName": [
["akimbo", "Stopping Power"],

View file

@ -1043,6 +1043,65 @@
]
}
],
"Kilo_141": [
{
"muzzle": [
"Tactical Suppressor",
"OWC Light Suppressor",
"OWC Light Compensator",
"Monolithic Suppressor",
"MIP Light FLash Guard",
"RTC Light Muzzle Brake"
],
"barrel": [
"YKM Integral Suppressor Light",
"MIP Light Extended Barrel",
"OWC Marksman"
],
"optic": [
"Red Dot Sight",
"Holographic Sight",
"3x Tactical Scope",
"4x Tactical Scope",
"4.4x Tactical Scope"
],
"stock": [
"No Stock",
"YKM Combat Stock",
"OWC Skeleton Stock",
"RTC Steady Stock"
],
"perk": [
"FMJ",
"Sleight of Hand",
"Wounding",
"Full Ammo",
"Disable",
"Tough",
"Long Shot",
"Melee Master"
],
"laser": ["RTC Laser 1mW", "MIP Laser 5mW", "OWC Laser - Tactical"],
"underbarrel": [
"Strike Foregrip",
"Merc Foregrip",
"Operator Foregrip",
"Ranger Foregrip",
"Tactical Foregrip A",
"Bipod"
],
"ammo": [
"Extended Mag A",
"Large Extended Mag B",
"100 round LMG Drum Mag"
],
"rear_grip": [
"Granulated Grip Tape",
"Ruberized Grip Tape",
"Stippled Grip Tape"
]
}
],
"XPR_50": [
{
"muzzle": [

74
util/Data/cwts.json Normal file
View file

@ -0,0 +1,74 @@
{
"A01": "Type 25",
"A02": "M16",
"A03": "AK117",
"A04": "AK-47",
"A05": "ASM10",
"A06": "M4",
"A07": "BK57",
"A08": "LK24",
"A09": "ICR-1",
"A10": "Man-o-War",
"A11": "KN-44",
"A12": "HBRa3",
"A13": "HVK-30",
"A14": "DR-H",
"A15": "Peacekeeper MK2",
"A16": "FR .556",
"A17": "AS VAL",
"A18": "CR-56 AMAX",
"A19": "M13",
"A20": "Swordfish",
"A21": "Kilo 141",
"B01": "XPR-50",
"B02": "Arctic .50",
"B03": "M21 EBR",
"B04": "DL Q33",
"B05": "Locus",
"B06": "NA-45",
"B07": "Outlaw",
"B08": "Rytec AMR",
"B09": "SVD",
"C01": "S36",
"C02": "UL736",
"C03": "RPD",
"C04": "M4 LMG",
"C05": "Chopper",
"C06": "Holger 26",
"C07": "Hades",
"C08": "PKM",
"D01": "RUS-79u",
"D02": "Chicom",
"D03": "PDW-57",
"D04": "Razorback",
"D05": "MSMC",
"D06": "HG40",
"D07": "Pharo",
"D08": "GKS",
"D09": "Cordite",
"D10": "QQ9",
"D11": "Fennec",
"D12": "AGR 556",
"D13": "QXR",
"D14": "PP19 Bizon",
"D15": "MX9",
"D16": "CBR4",
"D17": "PPSh 41",
"E01": "HS2126",
"E02": "BY15",
"E03": "HS0405",
"E04": "Striker",
"E05": "KRM 262",
"E06": "Echo",
"E07": "R9-0",
"F01": "Kilo Bolt-Action",
"F02": "SKS",
"F03": "SP-R 208",
"F04": "MK2",
"G01": "J358",
"G02": "MW11",
"G03": ".50 GS",
"G04": "Renetti",
"G05": "Shorty",
"G06": "Crossbow"
}

View file

@ -1,26 +0,0 @@
[
"Shave your arms and send me a pic.",
"Record yourself singing a song and post it on YouTube.",
"Try to lick your own foot!",
"Message someone you havent talked to in at least 1 year on Facebook or Instagram and take a screenshot.",
"Text your crush and ask them out on a date.",
"Cut a piece of your hair.",
"List everyone as the emoji(s) you think best fits them.",
"Change your nickname/username to whatever the group wants.",
"Send me a screenshot of your messages with the last person besides me you texted.",
"Brush your teeth with peanut butter or another condiment and send me a pic.",
"Rate everyone here 1-10 in terms of personality.",
"Take a really unflattering picture and make it your profile picture for one full day.",
"Send me a screenshot of your selfies gallery.",
"Text a random number and write “I see dead people”.",
"Tell the group in detail about your first kiss.",
"Tell a joke until it makes everyone laugh.",
"Tell your girlfriend that your friends dont like her so you cant be with her anymore.",
"Brush your teeth with your best friends toothbrush.",
"Show everyone your unshaved legs.",
"Break a raw egg on your forehead.",
"Call 5 different people and talk to them in 5 different accents.",
"Set your crushs picture as your FB profile picture.",
"Show everyone your search history for the past week."
]

4131
util/Data/domains.json Normal file

File diff suppressed because it is too large Load diff

98
util/Data/loadout.json Normal file
View file

@ -0,0 +1,98 @@
{
"secondary": [
"Knife / Base Melee",
"Axe",
"Shovel",
"Baseball Bat",
"Nunchucks",
"Prizefighter",
"Wrench",
"Sickle",
"Machete",
"Katana",
"FHJ-18",
"SMRS",
"D13 Sector",
"Thumper"
],
"perk_1": [
"Fast Recover",
"Persistence",
"Flak Jacket",
"Skulker",
"Agile",
"Lightweight",
"Restock",
"Tactician",
"Overclock",
"Martyrdom",
"Iron Lungs"
],
"perk_2": [
"Vulture",
"Toughness",
"Tracker",
"Ghost",
"Cold Blooded",
"Hard Wired",
"Quick Fix",
"Amped",
"Recon",
"Gung-Ho"
],
"perk_3": [
"Hard Line",
"Demo Expert",
"Tactical Mask",
"Alert",
"Engineer",
"Dead Silence",
"Shrapnel",
"Hard Alert",
"Launcher Plus"
],
"scorestreek": [
"Shield Turret",
"UAV",
"Shock RC",
"Hunter Killer Drone",
"Care Package",
"Counter UAV",
"MQ-27 Dragonfire",
"SAM Turret",
"Predator Missile",
"Hawk X3",
"Sentry Gun",
"Lightning Strike",
"Orbital Laser",
"XS1 Goliath",
"Cluster Strike",
"Chopper Gunner",
"Stealth Chopper",
"Swarm",
"Napalm",
"Advance UAV",
"EMP Systems",
"VTOL"
],
"operator_skill": [
"Purifier",
"War Machine",
"Death Machine",
"Tranform Shield",
"K9 UNIT",
"Sparrow",
"Tempest",
"H.I.V.E. ",
"Gravity Spikes",
"Annihilator",
"Shadow Blade",
"Equalizer",
"Ballistic Shield",
"Gravity Vortex Gun",
"Bull Charge",
"Kinetic Armor",
"TAK-5",
"Munitions Box"
]
}

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
[
{
"truth": [
"When was the last time you lied?",
"When was the last time you cried?",
"What's your biggest fear?",
@ -60,4 +61,30 @@
"What's the silliest reason you've left a club early?",
"What have you purchased that's been the biggest waste of money?",
"If you could swap lives with someone in this room, who would it be?"
],
"dare": [
"Shave your arms and send me a pic.",
"Record yourself singing a song and post it on YouTube.",
"Try to lick your own foot!",
"Message someone you havent talked to in at least 1 year on Facebook or Instagram and take a screenshot.",
"Text your crush and ask them out on a date.",
"Cut a piece of your hair.",
"List everyone as the emoji(s) you think best fits them.",
"Change your nickname/username to whatever the group wants.",
"Send me a screenshot of your messages with the last person besides me you texted.",
"Brush your teeth with peanut butter or another condiment and send me a pic.",
"Rate everyone here 1-10 in terms of personality.",
"Take a really unflattering picture and make it your profile picture for one full day.",
"Send me a screenshot of your selfies gallery.",
"Text a random number and write “I see dead people”.",
"Tell the group in detail about your first kiss.",
"Tell a joke until it makes everyone laugh.",
"Tell your girlfriend that your friends dont like her so you cant be with her anymore.",
"Brush your teeth with your best friends toothbrush.",
"Show everyone your unshaved legs.",
"Break a raw egg on your forehead.",
"Call 5 different people and talk to them in 5 different accents.",
"Set your crushs picture as your FB profile picture.",
"Show everyone your search history for the past week."
]
}

View file

@ -5,6 +5,7 @@ const weaponActualName = nmDt.weaponActualName;
const weaponAlliasName = nmDt.weaponAlliasName;
Object.defineProperty(String.prototype, "Simplify", {
// Function to remove all characters except 0-9 and a-z
// Eg "AK-47" -> "ak47"
value: function Simplify() {
return this.toLowerCase().replace(/[^0-9a-z]/g, "");
},
@ -55,7 +56,7 @@ Object.defineProperty(Number.prototype, "PlusHL", {
/* Function to fix the input statement */
function inpFixer(inpmsg) {
const parts = partExtracter(inpmsg);
const parts = PartSpliter(inpmsg);
// parts will be an array
//eg: ["fennec", "akimbo, mono"]
nmDt.attachmentAlliasName[0].map((x, i) =>
@ -72,8 +73,8 @@ function inpFixer(inpmsg) {
// so it fking only fix akimbo and stopping power wtf
return inpmsg;
}
// Function to extract the attachments from the input statement
function partExtracter(inpmsg) {
// Function to split weapon name and the attachments from the input statement
function PartSpliter(inpmsg) {
if (inpmsg.includes(" + ")) {
// If the input statement has multiple attachments joined by "+", split them and output them as an array of strings [0] is the weapon name, [1] is the attachments
// Eg: "M4A1 + Silencer + Flashlight" -> ["M4A1", "Silencer + Flashlight"]
@ -90,7 +91,7 @@ function partExtracter(inpmsg) {
function hasAttachments(inpmsg) {
inpmsg = inpFixer(inpmsg);
// If
// If the input statement has multiple attachments joined by "+" or "with", split them and output them as an array of strings [0] is the weapon name, [1] is the attachments
if (
inpmsg.split(" with ").filter(x => x.Simplify()).length > 1 ||
inpmsg.split(" + ").filter(x => x.Simplify()).length > 1
@ -101,68 +102,83 @@ function hasAttachments(inpmsg) {
}
function isolator(inpmsg) {
return partExtracter(inpFixer(inpmsg));
return PartSpliter(inpFixer(inpmsg));
}
// identifying the weapon
function weaponIdentifier(inpmsg) {
const inpWeaponName = isolator(inpmsg)[0];
// ["ak", "mono"] -> inpWeaponName: "ak"
// if weapon name is too short, return the error
if (inpWeaponName.length < 2) {
return inpmsg.trim().length
? `The name ${inpmsg.trim()} is too short.`
: "There isn't any weapon name.";
}
let probableWeapons = [];
// Loop through all the weapons to find the probable weapons
// Eg: "ak"
for (let i = 0; i < data.cguns.length; i++) {
if (inpWeaponName.Simplify() == data.cguns[i].gunname.Simplify()) {
// if the simplified name of the weapon is the same as the weapon name in the database, return the only one stats object
return JSON.parse(JSON.stringify(data.cguns[i]));
} else if (
data.cguns[i].gunname.Simplify().includes(inpWeaponName.Simplify())
) {
// If the weapon name is included in the actual name of the weapon
// push the weapon to the probableWeapons array
probableWeapons.push(i);
}
}
// if there is only one probable weapon, mean the gun has already been identified
if (probableWeapons.length == 1) {
// if there is only one probable weapon, return the only one stats object
return JSON.parse(JSON.stringify(data.cguns[probableWeapons[0]]));
}
// continue loop when there is no identified weapons or there are more than one identfied weaponds
// detecting aliases
// getting total number of weapons that had added aliases
for (let i = 0; i < weaponAlliasName.length; i++) {
// getting the number of aliases of each weapon
for (let j = 0; j < weaponAlliasName[i].length; j++) {
// weaponAliases[i][j] is the each alias of each weapon
// finding if simplified alias is same as input weapon name
if (weaponAlliasName[i][j].Simplify() == inpWeaponName.Simplify()) {
// if simplified alias is same as input weapon name
// eg "mow" == "mow", run the loop
for (let i2 = 0; i2 < data.cguns.length; i2++) {
if (
weaponActualName[i].Simplify() == data.cguns[i2].gunname.Simplify()
) {
if (weaponActualName[i] == data.cguns[i2].gunname) {
// use the actual name of the weapon to find the weapon
return JSON.parse(JSON.stringify(data.cguns[i2]));
}
}
}
}
}
// removing duplicates in the array
probableWeapons = [...new Set(probableWeapons)];
if (probableWeapons.length == 1) {
// if there is only one probable weapon, return the only one stats object
if (probableWeapons.length == 1)
return JSON.parse(JSON.stringify(data.cguns[probableWeapons[0]]));
}
if (probableWeapons.length > 1) {
else if (probableWeapons.length > 1) {
// reply with the question of probable weapons
return `Did you mean ${probableWeapons
.map(x => data.cguns[x].gunname)
.reduce((out, x, i) =>
[out, x].join(i === probableWeapons.length - 1 ? "` or `" : "`, `")
)}
?`;
} else return `Couldn't identify the weapon: "${inpWeaponName}"`;
}
return `Couldn't identify the weapon: "${inpWeaponName}"`;
}
function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) {
if (!hasAttachments(inpmsg)) {
return [];
}
// identifying attachments and return array or error
function attachmentsIdentifier(inpmsg, gun) {
if (!hasAttachments(inpmsg)) return [];
// no need for isolator because using slash commands, we get individual attachment
let inputAttachmentsNames = isolator(inpmsg)[1]
.split(/ & |, |,| and /)
.filter(x => x);
const tooSmall = inputAttachmentsNames.filter(x => x.length < 3);
// filter all elements thats shorter than 2 characters
inputAttachmentsNames = inputAttachmentsNames.filter(x => !(x.length < 3));
let errorMsgs = "",
errors = [],
@ -170,25 +186,21 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) {
if (inputAttachmentsNames.length == 0)
errorMsgs += "\nAttachments are missing!\n";
if (inputAttachmentsNames.length >= 10) return "Cocaineeeeee";
// if (inputAttachmentsNames.length >= 10) return "Cocaineeeeee"; ?????????
// Can directly use args[] to return, no need for isolator, partExtractor, inpFixer
const splitAttachmentsDataName = [],
outAttachments = [];
for (let i = 0; i < attachmentsData.length; i++) {
for (let i = 0; i < gun.aments.length; i++) {
splitAttachmentsDataName.push([
...new Set(
attachmentsData[i].name
gun.aments[i].name
.split(" ")
.filter(x => x)
.map(x => x.trim())
),
]);
if (Math.max(...splitAttachmentsDataName.map(x => x.length)) > 6) {
return "Cocaineeeeee";
}
for (let j = 0; j < splitAttachmentsDataName[i].length; j++) {
splitAttachmentsDataName[i][j] =
splitAttachmentsDataName[i][j].Simplify();
@ -235,9 +247,9 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) {
)
) {
var tmp1 = parseInt(inputAttachmentsNames[i]);
const tmp2 = attachmentsData.filter(
const tmp2 = gun.aments.filter(
x =>
x.type === 8 && x.effects[27] + x.effects[28] + inpStats[17] === tmp1
x.type === 8 && x.effects[27] + x.effects[28] + gun.stats[17] === tmp1
);
if (tmp2.length === 1) {
outAttachments.push(tmp2[0]);
@ -284,9 +296,7 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) {
var curr = probables[probables.length - 1];
const temp1 = probables[probables.length - 1].filter(
x =>
attachmentsData[x].name.Simplify() ==
inputAttachmentsNames[i].Simplify()
x => gun.aments[x].name.Simplify() == inputAttachmentsNames[i].Simplify()
);
const temp2 = probables[probables.length - 1].filter(
x =>
@ -310,7 +320,7 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) {
errors.push(
"`" +
curr
.map(x => attachmentsData[x].name)
.map(x => gun.aments[x].name)
.reduce((out, x, i) =>
[out, x].join(i === curr.length - 1 ? "` or `" : "`, `")
) +
@ -319,7 +329,7 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) {
'"`'
);
}
outAttachments.push(attachmentsData[probables[probables.length - 1][0]]);
outAttachments.push(gun.aments[probables[probables.length - 1][0]]);
}
const outAttachmentsTypes = outAttachments.map(x => x.type - 1),
t1 = outAttachments
@ -379,7 +389,7 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) {
return errorMsgs ? errorMsgs.trim() : outAttachments;
}
// console.log(attachmentsIdentifier("chopper with heavy handle, red sight, granulated", data.cguns[38].aments)); makeError();
// console.log(attachmentsIdentifier("ak + 5mw lazer", data.cguns[0].aments)); //makeError();
// console.log(attachmentsIdentifier("ak + 5mw lazer", data.cguns[0].aments)); makeError();
// console.log(attachmentsIdentifier("117 + 40 round mag", data.cguns[0].aments, data.cguns[0].stats)); makeError();
// console.log(attachmentsIdentifier("117 + rtc muzzle brake, rubberized griptape, tac lazer sight, 40 round mag, no stock", data.cguns[1].aments)); makeError();

View file

@ -503,6 +503,7 @@ const leven = (te, t) => {
function chunk(arr, size) {
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
arr.slice(i * size, i * size + size);
return arr;
});
}
function progressBar(value, maxValue, size) {