This commit is contained in:
night0721 2022-03-14 03:15:09 +08:00
commit 98bd127e5e
36 changed files with 365 additions and 485 deletions

View file

@ -414,8 +414,8 @@ module.exports = {
Authorization: process.env.CODM_API_KEY, Authorization: process.env.CODM_API_KEY,
}, },
}) })
.then((res) => res.data) .then(res => res.data)
.catch((e) => null); .catch(e => null);
if (!data?.ID) { if (!data?.ID) {
const embed = new MessageEmbed() const embed = new MessageEmbed()
@ -426,14 +426,10 @@ module.exports = {
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
} else { } else {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle( .setTitle(`${data.author} Statistical Breakdown`)
`${data.author} Statistical Breakdown`
)
.setColor(16580400) .setColor(16580400)
.setImage(data.imageUrl) .setImage(data.imageUrl)
.setFooter( .setFooter(`Stats Curtosy of Round Table`)
`Stats Curtosy of Round Table`,
)
// .setFooter( // .setFooter(
// `Stats Curtosy of Stats on Duty`, // `Stats Curtosy of Stats on Duty`,
// ) // )
@ -505,8 +501,6 @@ module.exports = {
// @night0721 Damage profile will be avalable by different command // @night0721 Damage profile will be avalable by different command
// recoilAvailable = false; // recoilAvailable = false;
// hasError = false; // hasError = false;
// console.log(args); // console.log(args);
@ -527,7 +521,6 @@ module.exports = {
// }, // },
// } // }
// run: async (client, interaction, args) => { // run: async (client, interaction, args) => {
// recoilAvailable = false; // recoilAvailable = false;
// hasError = false; // hasError = false;

View file

@ -112,16 +112,16 @@ module.exports = {
required: true, required: true,
choices: [ choices: [
{ {
name: "Path.exe", name: "path.exe",
value: "path.exe", value: "path.exe",
}, },
{ {
name: "Jokesta", name: "Jokesta",
value: "jokesta", value: "Jokesta",
}, },
// { // {
// name: "Stats On Duty", // name: "Stats On Duty",
// value: "sod", // value: "Stats On Duty",
// }, // },
], ],
}, },
@ -133,11 +133,11 @@ module.exports = {
choices: [ choices: [
{ {
name: "Aggressive", name: "Aggressive",
value: "aggressive", value: "Aggressive",
}, },
{ {
name: "Passive", name: "Passive",
value: "passive", value: "Passive",
}, },
{ {
name: "Search And Destroy", name: "Search And Destroy",
@ -145,7 +145,7 @@ module.exports = {
}, },
{ {
name: "Respawn", name: "Respawn",
value: "respawn", value: "Respawn",
}, },
], ],
}, },
@ -239,12 +239,12 @@ module.exports = {
required: true, required: true,
choices: [ choices: [
{ {
name: "Path.exe", name: "path.exe",
value: "path.exe", value: "path.exe",
}, },
{ {
name: "Jokesta", name: "Jokesta",
value: "jokesta", value: "Jokesta",
}, },
], ],
}, },
@ -256,11 +256,11 @@ module.exports = {
choices: [ choices: [
{ {
name: "Aggressive", name: "Aggressive",
value: "aggressive", value: "Aggressive",
}, },
{ {
name: "Passive", name: "Passive",
value: "passive", value: "Passive",
}, },
{ {
name: "Search And Destroy", name: "Search And Destroy",
@ -268,7 +268,7 @@ module.exports = {
}, },
{ {
name: "Respawn", name: "Respawn",
value: "respawn", value: "Respawn",
}, },
], ],
}, },
@ -330,7 +330,7 @@ module.exports = {
required: true, required: true,
choices: [ choices: [
{ {
name: "Path.exe", name: "path.exe",
value: "path.exe", value: "path.exe",
}, },
], ],
@ -343,11 +343,11 @@ module.exports = {
choices: [ choices: [
{ {
name: "Aggressive", name: "Aggressive",
value: "aggressive", value: "Aggressive",
}, },
{ {
name: "Passive", name: "Passive",
value: "passive", value: "Passive",
}, },
{ {
name: "Search And Destroy", name: "Search And Destroy",
@ -355,7 +355,7 @@ module.exports = {
}, },
{ {
name: "Respawn", name: "Respawn",
value: "respawn", value: "Respawn",
}, },
], ],
}, },
@ -413,7 +413,7 @@ module.exports = {
required: true, required: true,
choices: [ choices: [
{ {
name: "Path.exe", name: "path.exe",
value: "path.exe", value: "path.exe",
}, },
], ],
@ -426,11 +426,11 @@ module.exports = {
choices: [ choices: [
{ {
name: "Aggressive", name: "Aggressive",
value: "aggressive", value: "Aggressive",
}, },
{ {
name: "Passive", name: "Passive",
value: "passive", value: "Passive",
}, },
{ {
name: "Search And Destroy", name: "Search And Destroy",
@ -438,7 +438,7 @@ module.exports = {
}, },
{ {
name: "Respawn", name: "Respawn",
value: "respawn", value: "Respawn",
}, },
], ],
}, },
@ -496,7 +496,7 @@ module.exports = {
required: true, required: true,
choices: [ choices: [
{ {
name: "Path.exe", name: "path.exe",
value: "path.exe", value: "path.exe",
}, },
{ {
@ -513,11 +513,11 @@ module.exports = {
choices: [ choices: [
{ {
name: "ADS", name: "ADS",
value: "ads", value: "ADS",
}, },
{ {
name: "Hipfire", name: "Hipfire",
value: "hipfire", value: "Hipfire",
}, },
], ],
}, },
@ -559,12 +559,12 @@ module.exports = {
required: true, required: true,
choices: [ choices: [
{ {
name: "Path.exe", name: "path.exe",
value: "path.exe", value: "path.exe",
}, },
{ {
name: "Stats On Duty", name: "Stats On Duty",
value: "sod", value: "Stats On Duty",
}, },
], ],
}, },
@ -576,15 +576,15 @@ module.exports = {
choices: [ choices: [
{ {
name: "Aggressive", name: "Aggressive",
value: "aggressive", value: "Aggressive",
}, },
{ {
name: "Passive", name: "Passive",
value: "passive", value: "Passive",
}, },
{ {
name: "Respawn", name: "Respawn",
value: "respawn", value: "Respawn",
}, },
], ],
}, },
@ -634,12 +634,12 @@ module.exports = {
required: true, required: true,
choices: [ choices: [
{ {
name: "Path.exe", name: "path.exe",
value: "path.exe", value: "path.exe",
}, },
// { // {
// name: "Stats On Duty", // name: "Stats On Duty",
// value: "sod", // value: "Stats On Duty",
// }, // },
], ],
}, },
@ -651,7 +651,7 @@ module.exports = {
choices: [ choices: [
{ {
name: "Respawn", name: "Respawn",
value: "respawn", value: "Respawn",
}, },
], ],
}, },
@ -673,24 +673,10 @@ module.exports = {
) )
.then(res => res.data) .then(res => res.data)
.catch(e => null); .catch(e => null);
var all = {
"path.exe": "Path.exe",
dhitman: "dHitman",
jokesta: "Jokesta",
sod: "Stats On Duty",
aggressive: "Aggressive",
passive: "Passive",
respawn: "Respawn",
"Search And Destroy": "Search And Destroy",
ads: "ADS",
hipfire: "Hipfire",
};
if (!data?.cwts) { if (!data?.cwts) {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setDescription( .setDescription(
`<: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` `<:nyx_not_available:897378400031879188> We don't have a **${tag}** gunsmith build for the gun with **CWTS 🆔 ${cwts}** by **${cc}**, Please try another tag or a differnt content creator`
) )
.setColor(client.color); .setColor(client.color);
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
@ -700,9 +686,7 @@ module.exports = {
return arr.push(`**${i + 1}:** ${e}`); return arr.push(`**${i + 1}:** ${e}`);
}); });
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle( .setTitle(`${tag} build for ${data.weaponName} from ${data.author}`)
`${all[tag]} build for ${data.weaponName} from ${data.author}`
)
.setDescription( .setDescription(
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${data.notes}\n \`\`\`` `<:nyx_description:897379659665264650> **Description** \`\`\`\n${data.notes}\n \`\`\``
) )

View file

@ -8,10 +8,10 @@ module.exports = {
run: async (client, interaction) => { run: async (client, interaction) => {
const data = async () => { const data = async () => {
const d = await model.findOne({}); const d = await model.findOne({});
const types = d.Categories; const weapons =
const names = d.Primary; d.Primary[0][
const category = types[Math.floor(Math.random() * types.length)]; d.Categories[Math.floor(Math.random() * d.Categories.length)]
const weapons = names[0][category]; ];
return `${weapons[Math.floor(Math.random() * weapons.length)]}`; return `${weapons[Math.floor(Math.random() * weapons.length)]}`;
}; };
const primary_weapon = await data(); const primary_weapon = await data();

74
command/CODM/loadout.js Normal file
View file

@ -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];
}
}
},
};

View file

@ -8,7 +8,7 @@ module.exports = {
category: "CODM", category: "CODM",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "lethal", name: "lethal",
description: "Lethal Scorestreak", description: "Lethal Scorestreak",
options: [ options: [
@ -83,7 +83,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "support", name: "support",
description: "Support Scorestreak", description: "Support Scorestreak",
options: [ options: [

View file

@ -11,7 +11,6 @@ let currGun,
recoilAvailable, recoilAvailable,
chart, chart,
hasError; hasError;
const errMsg = "*Generic placeholder error message*";
module.exports = { module.exports = {
name: "stats", name: "stats",
description: "Check gun stats", description: "Check gun stats",
@ -58,20 +57,22 @@ module.exports = {
if (args.length == 1) if (args.length == 1)
repEmb = statsHandler(args.join(" ").replace("\n", " ")); repEmb = statsHandler(args.join(" ").replace("\n", " "));
else repEmb = statsHandler(args.join(" + ").replace("\n", " ")); else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
if (hasError) { if (hasError) {
interaction.followUp({
content: `**${repEmb || "An error has occured"}**`,
});
} else {
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: [new MessageEmbed(repEmb)] }); interaction.followUp({ embeds: [new MessageEmbed(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: [new MessageEmbed(repEmb)] });
}, },
}; };
@ -81,38 +82,38 @@ function inpHandler(inpmsg) {
function statsHandler(inpmsg) { function statsHandler(inpmsg) {
let statsNames = [ let statsNames = [
"Pellets", "Pellets", //0
"Detonation Range", "Detonation Range", //1
"Explosion Radius", "Explosion Radius", //2
"Explosion Damage", "Explosion Damage", //3
"Firing Mode", "Firing Mode", //4
"Rate of Fire", "Rate of Fire", //5
"Bullet in Burst", "Bullet in Burst", //6
"Time Between Burst", "Time Between Burst", //7
"Bullet Speed", "Bullet Speed", //8
"Penetration Level", "Penetration Level", //9
"Bullet Spread", "Bullet Spread", //10
"Idle Sway", "Idle Sway", //11
"Hipfire Pellet Spread", "Hipfire Pellet Spread", //12
"ADS Pellet Spread", "ADS Pellet Spread", //13
"ADS Time", "ADS Time", //14
"Sprint-to-Fire Time", "Sprint-to-Fire Time", //15
"ADS Zoom", "ADS Zoom", //16
"Magazine", "Magazine", //17
"Reserve", "Reserve", //18
"Reload Type", "Reload Type", //19
"Cancel Reload Time", "Cancel Reload Time", //20
"Reload Time", "Reload Time", //21
"Full Reload Time", "Full Reload Time", //22
"Drop Time", "Drop Time", //23
"Raise Time", "Raise Time", //24
"Sprinting Speed", "Sprinting Speed", //25
"Walking Speed", "Walking Speed", //26
"Straifing Speed", "Straifing Speed", //27
"Damage per Tick", "Damage per Tick", //28
"Number of Ticks", "Number of Ticks", //29
"Time Between Ticks", "Time Between Ticks", //30
"Breath Hold Time", "Breath Hold Time", //31
"shouldNeverHappen0", "shouldNeverHappen0",
"shouldNeverHappen1", "shouldNeverHappen1",
"shouldNeverHappen2", "shouldNeverHappen2",
@ -187,8 +188,8 @@ function statsHandler(inpmsg) {
inpIndx = inpIndx.filter(x => outReady[x]); inpIndx = inpIndx.filter(x => outReady[x]);
return inpIndx.length return inpIndx.length
? { ? {
name: "**" + inpName + "**", name: `**${inpName}**`,
value: "```\n" + inpIndx.map(x => outReady[x]).join("\n") + "```", value: `\`\`\`\n${inpIndx.map(x => outReady[x]).join("\n")}\`\`\``,
} }
: ""; : "";
} }
@ -219,17 +220,17 @@ function statsHandler(inpmsg) {
function addUnit(j) { function addUnit(j) {
switch (j) { switch (j) {
case 07: case 7:
case 14: case 14:
case 15: case 15:
case 23: case 23:
case 24: case 24:
case 31: case 31:
return " ms"; return " ms";
case 27:
case 28:
case 25: case 25:
case 26: case 26:
case 27:
case 28:
return " m/s"; return " m/s";
case 20: case 20:
case 21: case 21:
@ -237,9 +238,9 @@ function statsHandler(inpmsg) {
return " s"; return " s";
case 16: case 16:
return "%"; return "%";
case 06: case 6:
return " Rounds"; return " Rounds";
case 05: case 5:
return " RPM"; return " RPM";
default: default:
return ""; return "";
@ -256,16 +257,11 @@ function statsHandler(inpmsg) {
currRecoilArr[2] currRecoilArr[2]
); );
recoilAvailable = true; recoilAvailable = true;
} else { } else recoilAvailable = false;
recoilAvailable = false;
} if (chart == "none") recoilAvailable = false;
if (chart == "none") { if (chart == "err") hasError = true;
recoilAvailable = false;
}
if (chart == "err" || currAttachments == "err") {
hasError = true;
return "Cocaineeee";
}
const dmg = const dmg =
common.damageHandler( common.damageHandler(
currDRM.damage, currDRM.damage,
@ -281,7 +277,7 @@ function statsHandler(inpmsg) {
currGun.description currGun.description
? { ? {
name: "**Description:**", name: "**Description:**",
value: "```\n" + currGun.description + "```", value: `\`\`\`\n${currGun.description}\`\`\``,
} }
: {}, : {},
{ name: "**Damage Profile:**", value: dmg }, { name: "**Damage Profile:**", value: dmg },

View file

@ -8,7 +8,7 @@ module.exports = {
category: "Config", category: "Config",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "muterole", name: "muterole",
description: "Configure mute role settings for the server", description: "Configure mute role settings for the server",
options: [ options: [
@ -21,7 +21,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "prefix", name: "prefix",
description: "Configure prefix settings for the server", description: "Configure prefix settings for the server",
options: [ options: [
@ -35,7 +35,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "welcome", name: "welcome",
description: "Configure welcome channel settings for the server", description: "Configure welcome channel settings for the server",
options: [ options: [
@ -49,7 +49,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "goodbye", name: "goodbye",
description: "Configure goodbye channel settings for the server", description: "Configure goodbye channel settings for the server",
options: [ options: [
@ -63,7 +63,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "starboard", name: "starboard",
description: "Configure starboard channel settings for the server", description: "Configure starboard channel settings for the server",
options: [ options: [
@ -83,7 +83,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "chatbot", name: "chatbot",
description: "Configure chatbot channel settings for the server", description: "Configure chatbot channel settings for the server",
options: [ options: [
@ -97,7 +97,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "log", name: "log",
description: "Configure log channel settings for the server", description: "Configure log channel settings for the server",
options: [ options: [
@ -116,7 +116,7 @@ module.exports = {
description: "Enable commands/category for the server", description: "Enable commands/category for the server",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "command", name: "command",
description: "To enable commands", description: "To enable commands",
options: [ options: [
@ -129,7 +129,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "category", name: "category",
description: "To enable categories", description: "To enable categories",
options: [ options: [
@ -179,7 +179,7 @@ module.exports = {
description: "Disable commands/category for the server", description: "Disable commands/category for the server",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "command", name: "command",
description: "To disable commands", description: "To disable commands",
options: [ options: [
@ -192,7 +192,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "category", name: "category",
description: "To disable categories", description: "To disable categories",
options: [ options: [
@ -237,7 +237,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "level", name: "level",
description: "Configure level settings for the server", description: "Configure level settings for the server",
options: [ options: [
@ -250,7 +250,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "nsfw", name: "nsfw",
description: "Configure nsfw settings for the server", description: "Configure nsfw settings for the server",
options: [ options: [
@ -263,7 +263,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "tips", name: "tips",
description: "Configure tips settings for the server", description: "Configure tips settings for the server",
options: [ options: [
@ -276,7 +276,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "overall", name: "overall",
description: "See overall settings for the server", description: "See overall settings for the server",
options: [], options: [],

View file

@ -6,7 +6,7 @@ module.exports = {
description: "Configure Weapon Master System settings", description: "Configure Weapon Master System settings",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "select", name: "select",
description: "Select the gun for the game", description: "Select the gun for the game",
options: [ options: [
@ -29,13 +29,13 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "list", name: "list",
description: "See the information for the guns", description: "See the information for the guns",
options: [], options: [],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "info", name: "info",
description: "See the stats of your gun", description: "See the stats of your gun",
}, },

View file

@ -9,7 +9,7 @@ module.exports = {
name: interaction.user.tag, name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dyamic: true }), iconURL: interaction.user.displayAvatarURL({ dyamic: true }),
}) })
.setTitle(dares[Math.round(Math.random() * tnd.dare.length - 1)]) .setTitle(tnd.dare[Math.round(Math.random() * tnd.dare.length - 1)])
.setColor(client.color) .setColor(client.color)
.setFooter({ .setFooter({
text: `Made by ${client.author}`, text: `Made by ${client.author}`,

View file

@ -27,7 +27,7 @@ module.exports = {
const user2 = interaction.guild.members.cache.get(args[1]).user.username; const user2 = interaction.guild.members.cache.get(args[1]).user.username;
const loveEmbed = new MessageEmbed() const loveEmbed = new MessageEmbed()
.setColor("dd2e44") .setColor("dd2e44")
.setFooter(`Shipped by ${interaction.user.tag}`) .setFooter({ text: `Shipped by ${interaction.user.tag}` })
.setTimestamp() .setTimestamp()
.setTitle(`💘 | Shipping ${user1} and ${user2} | 💘`) .setTitle(`💘 | Shipping ${user1} and ${user2} | 💘`)
.setDescription(`🔻 | ${user1} \n${ship()}\n🔺 | ${user2}`); .setDescription(`🔻 | ${user1} \n${ship()}\n🔺 | ${user2}`);

View file

@ -22,7 +22,10 @@ module.exports = {
.setTitle(`${user.user.username}'s simp rate`) .setTitle(`${user.user.username}'s simp rate`)
.setDescription(`${user.user.username} is a ${simp}% simp`) .setDescription(`${user.user.username} is a ${simp}% simp`)
.setColor(client.color) .setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp(), .setTimestamp(),
], ],
}); });

View file

@ -9,7 +9,7 @@ module.exports = {
name: interaction.user.tag, name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dyamic: true }), iconURL: interaction.user.displayAvatarURL({ dyamic: true }),
}) })
.setTitle(truth[Math.round(Math.random() * tnd.truth.length)]) .setTitle(tnd.truth[Math.round(Math.random() * tnd.truth.length - 1)])
.setColor(client.color) .setColor(client.color)
.setFooter({ .setFooter({
text: `Made by ${client.author}`, text: `Made by ${client.author}`,

View file

@ -1,6 +1,5 @@
const { MessageEmbed } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const questions = require("../../util/Data/wyr.json"); const questions = require("../../util/Data/wyr.json");
module.exports = { module.exports = {
name: "wyr", name: "wyr",
description: "Send some would-you rather questions", description: "Send some would-you rather questions",
@ -15,12 +14,15 @@ module.exports = {
.setDescription( .setDescription(
`🇦 ${Option1} \n\n **OR** \n\n :regional_indicator_b: ${Option2}` `🇦 ${Option1} \n\n **OR** \n\n :regional_indicator_b: ${Option2}`
) )
.setAuthor( .setAuthor({
interaction.user.tag, name: interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true }) iconURL: interaction.user.displayAvatarURL({ dyamic: true }),
) })
.setColor(client.color) .setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp(); .setTimestamp();
wyrmessage = await interaction.followUp({ embeds: [embed] }); wyrmessage = await interaction.followUp({ embeds: [embed] });
wyrmessage.react("🇦"); wyrmessage.react("🇦");

View file

@ -17,10 +17,10 @@ module.exports = {
const member = const member =
interaction.guild.members.cache.get(args[0]) || interaction.member; interaction.guild.members.cache.get(args[0]) || interaction.member;
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setAuthor( .setAuthor({
member.user.tag, text: member.user.tag,
member.user.displayAvatarURL({ dynamic: true, size: 1024 }) iconURL: member.user.displayAvatarURL({ dynamic: true, size: 1024 }),
) })
.setColor(client.color) .setColor(client.color)
.setTitle(`${member.user.username}'s Avatar`) .setTitle(`${member.user.username}'s Avatar`)
.setDescription( .setDescription(
@ -41,7 +41,10 @@ module.exports = {
.setImage( .setImage(
member.user.avatarURL({ size: 2048, dynamic: true, format: "png" }) member.user.avatarURL({ size: 2048, dynamic: true, format: "png" })
) )
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setURL(client.web) .setURL(client.web)
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });

View file

@ -1,14 +1,12 @@
const { MessageEmbed, version: djsversion } = require("discord.js"); const { MessageEmbed, version: djsversion } = require("discord.js");
const version = require("../../../package.json").version; const version = require("../../../package.json").version;
const { utc } = require("moment"); const { utc } = require("moment");
// const os = require("os");
module.exports = { module.exports = {
name: "botinfo", name: "botinfo",
description: "Check the info of the bot", description: "Check the info of the bot",
category: "Information", category: "Information",
type: "CHAT_INPUT", type: "CHAT_INPUT",
run: async (client, interaction, args, utils) => { run: async (client, interaction) => {
// const core = os.cpus()[0];
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle(`NYX - CODM Gunsmith Bot`) .setTitle(`NYX - CODM Gunsmith Bot`)
.setURL( .setURL(
@ -43,36 +41,23 @@ module.exports = {
inline: true, inline: true,
} }
) )
.addFields( .addFields({
{ name: `Platform`,
name: `Platform`, value: `
value: `
NYX \`v${version}\` NYX \`v${version}\`
Discord.js \`v${djsversion}\` Discord.js \`v${djsversion}\`
Node.js \`${process.version}\``, Node.js \`${process.version}\``,
} })
// Removed OS Info for troubleshooting.
//
// {
// name: `Hardware`,
// value: `
// Uptime:** ${utils.timer(os.uptime() * 1000, { long: true })}
// Platform:** ${process.platform}
// CPU:**
// \u3000 Cores: ${os.cpus().length}
// \u3000 Model: ${core.model}
// \u3000 Speed: ${core.speed}MHz
// **`,
// inline: true,
// }
)
.addFields({ .addFields({
name: `**${client.author}**`, name: `**${client.author}**`,
value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n
**Research & Documentation**\n\u3000𝔔𝓻𝔦𝔁𝔖𝔦ӄø#0690\n\u3000Thunder#2128\n **Research & Documentation**\n\u3000𝔔𝓻𝔦𝔁𝔖𝔦ӄø#0690\n\u3000Thunder#2128\n
**Website**\n\u3000Chunchunmaru#8570`, **Website**\n\u3000Chunchunmaru#8570`,
}) })
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
}, },

View file

@ -122,7 +122,9 @@ module.exports = {
) )
.setTimestamp() .setTimestamp()
.setColor(client.color) .setColor(client.color)
.setFooter(`Please use /help (Command Name) for more details`) .setFooter({
text: `Please use /help (Command Name) for more details`,
})
.setDescription( .setDescription(
category.commands category.commands
.map(cmd => { .map(cmd => {
@ -168,28 +170,26 @@ module.exports = {
"**Command**:", "**Command**:",
command.name ? `\`${command.name}\`` : "N/A" command.name ? `\`${command.name}\`` : "N/A"
); );
if (command.usage) { if (command.usage)
embed.addField("**Usage**:", `\`/${command.name} ${command.usage}\``); embed.addField("**Usage**:", `\`/${command.name} ${command.usage}\``);
} else { else embed.addField("**Usage**:", `\`/${command.name}\``);
embed.addField("**Usage**:", `\`/${command.name}\``);
} if (command.description)
if (command.description) {
embed.addField("**Description**:", command.description); embed.addField("**Description**:", command.description);
}
if (command.timeout) { if (command.timeout)
embed.addField("**Cooldown**:", utils.timer(command.timeout)); embed.addField("**Cooldown**:", utils.timer(command.timeout));
}
if (command.UserPerms) { if (command.UserPerms)
embed.addField("**Required User Permission**:", UserPerms); embed.addField("**Required User Permission**:", UserPerms);
}
if (command.BotPerms) { if (command.BotPerms)
embed.addField("**Required Bot Permission**:", BotPerms); embed.addField("**Required Bot Permission**:", BotPerms);
}
embed embed
.setFooter( .setFooter({
`Requested by ${interaction.user.tag}`, text: `Requested by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true }) iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
) })
.setTimestamp() .setTimestamp()
.setURL(client.web) .setURL(client.web)
.setColor(client.color); .setColor(client.color);

View file

@ -8,7 +8,7 @@ module.exports = {
category: "Moderation", category: "Moderation",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "add", name: "add",
description: "Warn a user", description: "Warn a user",
options: [ options: [
@ -27,7 +27,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "list", name: "list",
description: "Show a list of warnings of an user", description: "Show a list of warnings of an user",
options: [ options: [
@ -40,7 +40,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "remove", name: "remove",
description: "Remove a latest warn for an user", description: "Remove a latest warn for an user",
options: [ options: [
@ -59,7 +59,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "clear", name: "clear",
description: "Clear an user's warns", description: "Clear an user's warns",
options: [ options: [

View file

@ -4,13 +4,13 @@ module.exports = {
category: "Music", category: "Music",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "track", name: "track",
description: "Loop the track", description: "Loop the track",
options: [], options: [],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "queue", name: "queue",
description: "Loop the whole queue", description: "Loop the whole queue",
options: [], options: [],

View file

@ -1,40 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "ass",
description: "Get some ass images",
run: async (client, interaction) => {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = ["ass", "BestBooties", "BootyGIFs", "booty_queens"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
interaction.followUp({
embeds: [
new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
}),
],
});
}
},
};

View file

@ -1,48 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "blowjob",
description: "Get some blowjob images",
run: async (client, interaction) => {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = [
"BlowJob",
"blowjobs",
"blowjobgifs",
"OralSex",
"PushHerHead",
"ThroatFuck",
];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
interaction.followUp({
embeds: [
new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
}),
],
});
}
},
};

View file

@ -1,40 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "boobs",
description: "Get some boobie images",
run: async (client, interaction) => {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = ["boobs", "GrabHerTitties", "titfuck"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
interaction.followUp({
embeds: [
new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
}),
],
});
}
},
};

View file

@ -1,40 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "hentai",
description: "Get some hentai images",
run: async (client, interaction) => {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = ["hentai", "HentaiAnime", "nekogirls"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
interaction.followUp({
embeds: [
new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
}),
],
});
}
},
};

View file

@ -1,42 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "pussy",
description: "Get some vagina images",
run: async (client, interaction) => {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
return;
} else {
const subreddits = ["vagina", "GodPussy", "peachlips"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
interaction.followUp({
embeds: [
new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
}),
],
});
}
},
};

View file

@ -5,7 +5,7 @@ module.exports = {
Owner: true, Owner: true,
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "add", name: "add",
description: "Remove coins from someone", description: "Remove coins from someone",
options: [ options: [
@ -24,7 +24,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "rmv", name: "rmv",
description: "Remove coins from someone", description: "Remove coins from someone",
options: [ options: [

View file

@ -23,12 +23,15 @@ module.exports = {
`${interaction.user.username} is set into AFK.\nStatus : ${content}` `${interaction.user.username} is set into AFK.\nStatus : ${content}`
) )
.setTimestamp() .setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setColor(client.color) .setColor(client.color)
.setAuthor( .setAuthor({
interaction.user.username, text: interaction.user.username,
interaction.user.displayAvatarURL({ dynamic: true }) iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
) })
.setURL(client.web); .setURL(client.web);
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
}, },

View file

@ -10,10 +10,10 @@ module.exports = {
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setColor(client.color) .setColor(client.color)
.setTimestamp() .setTimestamp()
.setAuthor( .setAuthor({
interaction.user.tag, text: interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true }) iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
) })
.setTitle(`Support/Invite`) .setTitle(`Support/Invite`)
.setThumbnail( .setThumbnail(
"https://github.com/night0721/cath.js/blob/master/util/assets/images/nyx_logo_transparent.webp" "https://github.com/night0721/cath.js/blob/master/util/assets/images/nyx_logo_transparent.webp"

View file

@ -2,7 +2,7 @@ const { getreddit } = require("cath");
const { MessageActionRow, MessageButton, MessageEmbed } = require("discord.js"); const { MessageActionRow, MessageButton, MessageEmbed } = require("discord.js");
module.exports = { module.exports = {
name: "nsfw", name: "nsfw",
description: "nsfw command", description: "NSFW command",
run: async (client, interaction) => { run: async (client, interaction) => {
const msg = await interaction.channel.send({ content: "Getting images" }); const msg = await interaction.channel.send({ content: "Getting images" });
async function embed() { async function embed() {
@ -14,11 +14,17 @@ module.exports = {
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif" "https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
) )
.setColor(client.color) .setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
} }
let subreddits = [ let subreddits = [
"GodPussy",
"peachlips",
"vagina",
"GoneWild", "GoneWild",
"WorkGoneWild", "WorkGoneWild",
"GoneWild30Plus", "GoneWild30Plus",
@ -42,9 +48,16 @@ module.exports = {
"thighs", "thighs",
"PerfectThighs", "PerfectThighs",
"thickthighs", "thickthighs",
"PushHerHead",
"ThroatFuck",
]; ];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)]; const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit); let data = await getreddit(reddit);
while (data.length === 0) {
while (data.image.length === 0) {
data = await getreddit(reddit);
}
}
let embed1 = null; let embed1 = null;
embed1 = new MessageEmbed({ embed1 = new MessageEmbed({
title: data.title, title: data.title,

View file

@ -12,7 +12,7 @@ client.on("interactionCreate", async interaction => {
if (option.type === "SUB_COMMAND_GROUP") { if (option.type === "SUB_COMMAND_GROUP") {
if (option.name) args.push(option.name); if (option.name) args.push(option.name);
option.options?.forEach(x => { option.options?.forEach(x => {
if (x.type === "SUB_COMMAND") { if (x.type === 1) {
if (x.name) args.push(x.name); if (x.name) args.push(x.name);
x.options?.forEach(y => { x.options?.forEach(y => {
if (y.value) args.push(y.value); if (y.value) args.push(y.value);
@ -183,7 +183,7 @@ client.on("interactionCreate", async interaction => {
if (!ownercmd) return; if (!ownercmd) return;
const args = []; const args = [];
for (const option of interaction.options.data) { for (const option of interaction.options.data) {
if (option.type === "SUB_COMMAND") { if (option.type === 1) {
if (option.name) args.push(option.name); if (option.name) args.push(option.name);
option.options?.forEach(x => { option.options?.forEach(x => {
if (x.value) args.push(x.value); if (x.value) args.push(x.value);

View file

@ -40,15 +40,15 @@
"node": "^17.3.0" "node": "^17.3.0"
}, },
"dependencies": { "dependencies": {
"axios": "^0.25.0", "axios": "^0.26.0",
"cath": "^1.4.7", "cath": "^1.4.7",
"discord.js": "^13.6.0", "discord.js": "^13.6.0",
"dotenv": "^15.0.0", "dotenv": "^16.0.0",
"erela.js": "^2.3.3", "erela.js": "^2.3.3",
"erela.js-spotify": "^1.2.0", "erela.js-spotify": "^1.2.0",
"goosecache": "^9.0.14", "goosecache": "^9.0.14",
"moment": "^2.29.1", "moment": "^2.29.1",
"mongoose": "^5.13.14", "mongoose": "^5.13.14",
"quickchart-js": "^2.0.3" "quickchart-js": "^3.0.0"
} }
} }

View file

@ -5,7 +5,7 @@ module.exports = {
description: "Fun commands", description: "Fun commands",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "8ball", name: "8ball",
description: "8ball an answer", description: "8ball an answer",
options: [ options: [
@ -18,12 +18,12 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "rickroll", name: "rickroll",
description: "Rickroll?", description: "Rickroll?",
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "emojify", name: "emojify",
description: "Emojify a sentence", description: "Emojify a sentence",
options: [ options: [
@ -36,7 +36,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "pp", name: "pp",
description: "Check how long is the user", description: "Check how long is the user",
options: [ options: [

View file

@ -5,12 +5,12 @@ module.exports = {
description: "Generate images", description: "Generate images",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "meme", name: "meme",
description: "Get a meme from reddit", description: "Get a meme from reddit",
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "cat", name: "cat",
description: "Get a cat from reddit", description: "Get a cat from reddit",
}, },

View file

@ -1,5 +1,10 @@
{ {
"scam": [ "scam": [
"disceord.gift",
"discode.gift",
"discosb.gift",
"discorx.gift",
"disocrds.gift",
"disocrde.gift", "disocrde.gift",
"discrods.gift", "discrods.gift",
"discordsgift.com", "discordsgift.com",
@ -4104,6 +4109,25 @@
"staemporewed.xyz" "staemporewed.xyz"
], ],
"iplogger": [ "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", "iplogger.org",
"2no.co", "2no.co",
"iplogger.com", "iplogger.com",

View file

@ -1 +0,0 @@
[]

View file

@ -1,6 +1,5 @@
{ {
"secondary": [ "secondary": [
// Doesn't have Pistols becuase it will require Gunsmith Build
"None", "None",
"Knife / Base Melee", "Knife / Base Melee",
"Axe", "Axe",
@ -102,7 +101,7 @@
"TAK-5", "TAK-5",
"Munitions Box" "Munitions Box"
], ],
"lethal":[ "lethal": [
"None", "None",
"Frag Grenade", "Frag Grenade",
"Sticky Grenade", "Sticky Grenade",
@ -111,7 +110,7 @@
"Thermite", "Thermite",
"Molotov Cocktail" "Molotov Cocktail"
], ],
"tactical":[ "tactical": [
"None", "None",
"Flashbang Grenade", "Flashbang Grenade",
"Smoke Grenade", "Smoke Grenade",

View file

@ -1,4 +1,3 @@
const { DiscordAPIError, HTTPError } = require("discord.js");
const fs = require("fs"); const fs = require("fs");
const cmds = []; const cmds = [];
const ownercmds = []; const ownercmds = [];
@ -29,8 +28,7 @@ module.exports = async client => {
ownercmds.push(file); ownercmds.push(file);
}); });
client.on("ready", async () => { client.on("ready", async () => {
const gg = client.guilds.cache.get("840225563193114624"); await client.guilds.cache.get("840225563193114624").commands.set(ownercmds);
await gg.commands.set(ownercmds);
await client.application.commands await client.application.commands
.set(cmds) .set(cmds)
.then(async cmd => { .then(async cmd => {

View file

@ -211,9 +211,9 @@ function attachmentsIdentifier(inpmsg, gun) {
splitAttachmentsDataName[i][j].Simplify(); splitAttachmentsDataName[i][j].Simplify();
} }
} }
// after loop: ["stippled", "grip", "tape"] // inputAttachmentsNames = [["stippled", "grip", "tape"]
for (let i = 0; i < inputAttachmentsNames.length; i++) { for (let i = 0; i < inputAttachmentsNames.length; i++) {
const probables = []; let probables = [];
// loop through all the input attachments and split them into words // loop through all the input attachments and split them into words
var splitInputAttachmentsName = inputAttachmentsNames[i] var splitInputAttachmentsName = inputAttachmentsNames[i]
.split(" ") .split(" ")
@ -233,13 +233,17 @@ function attachmentsIdentifier(inpmsg, gun) {
// if probables list doesn't include the attachment, push // if probables list doesn't include the attachment, push
let probablePushed = false; let probablePushed = false;
for (let i4 = 0; i4 < probables.length; i4++) { for (let i4 = 0; i4 < probables.length; i4++) {
// push another attachment that also probable to the probables list to the same array that identified last loop
// Eg: probables = [ [32]] // as user input mag and first loop it identfified extended mag
// then as it got more possible, it will push large extended mag to the same array -> [ [32,33] ]
if (!probables[i4].includes(j)) { if (!probables[i4].includes(j)) {
probables[i4].push(j); probables[i4].push(j);
// make it true so that it doesn't push again in the next condition
probablePushed = true; probablePushed = true;
break; break;
} }
} }
// for the first loop as the probables array is emrpty // push if the attachment isn't been identified yet
if (!probablePushed) probables.push([j]); if (!probablePushed) probables.push([j]);
} }
} }
@ -250,40 +254,50 @@ function attachmentsIdentifier(inpmsg, gun) {
// finding magazines attachments // finding magazines attachments
if ( if (
(inputAttachmentsNames[i].includes(" rounds mag") || (inputAttachmentsNames[i].includes(" rounds mag") ||
inputAttachmentsNames[i].includes(" round mag")) && inputAttachmentsNames[i].includes(" round mag") ||
inputAttachmentsNames[i].includes(" round") ||
inputAttachmentsNames[i].includes(" rounds")) &&
inputAttachmentsNames[i].startsWith( inputAttachmentsNames[i].startsWith(
inputAttachmentsNames[i].replace(/\D/g, "") inputAttachmentsNames[i].replace(/\D/g, "")
) )
) { ) {
var tmp1 = parseInt(inputAttachmentsNames[i]); var tmp1 = parseInt(inputAttachmentsNames[i]);
// calculating the sum of number of rounds and see if it matches the input number of rounds
const tmp2 = gun.aments.filter( const tmp2 = gun.aments.filter(
x => x =>
x.type === 8 && x.effects[27] + x.effects[28] + gun.stats[17] === tmp1 x.type === 8 && x.effects[27] + x.effects[28] + gun.stats[17] === tmp1
); );
// push if the magazine is found
if (tmp2.length === 1) { if (tmp2.length === 1) {
outAttachments.push(tmp2[0]); outAttachments.push(tmp2[0]);
continue; continue;
} }
} }
// if probables is empty or there is more than one identified attachment
if ( if (
probables.length === 0 || probables.length === 0 ||
probables[probables.length - 1].length !== 1 || probables[probables.length - 1].length !== 1 ||
probables.length < splitInputAttachmentsName.length probables.length < splitInputAttachmentsName.length
) { ) {
// empty probables as can't indentify the attachment
probables = []; probables = [];
splitInputAttachmentsName.map((x, i5) => // the splitInputAttachmentsName isn't simplified pls rmb
nmDt.attachmentAlliasName[1].map((y, i6) => splitInputAttachmentsName.map((x, i5) => {
// finding aliases
nmDt.attachmentAlliasName[1].map((y, i6) => {
y.map(z => { y.map(z => {
if (x.Simplify() === z.Simplify()) { if (z.Simplify().includes(x.Simplify())) {
splitInputAttachmentsName[i5] = nmDt.attachmentActualName[1][i6]; splitInputAttachmentsName[i5] = nmDt.attachmentActualName[1][i6];
} }
}) });
) });
); });
// simple iteration to make the array again
splitInputAttachmentsName = splitInputAttachmentsName splitInputAttachmentsName = splitInputAttachmentsName
.join(" ") .join(" ")
.split(" ") .split(" ")
.filter(x => x); .filter(x => x);
// find one more time as we do aliases already
finder(); finder();
if ( if (
probables.length === 0 || probables.length === 0 ||
@ -297,21 +311,26 @@ function attachmentsIdentifier(inpmsg, gun) {
finder(); finder();
} }
} }
if (probables.length === 0) { if (probables.length === 0) {
// push to unidentifined list as can't be identified after serveral times
unidentifined.push(inputAttachmentsNames[i]); unidentifined.push(inputAttachmentsNames[i]);
continue; continue;
} }
// curr is the most probable attachment
var curr = probables[probables.length - 1]; var curr = probables[probables.length - 1];
const temp1 = probables[probables.length - 1].filter( const temp1 = probables[probables.length - 1].filter(
x => gun.aments[x].name.Simplify() == inputAttachmentsNames[i].Simplify() x => gun.aments[x].name.Simplify() == inputAttachmentsNames[i].Simplify()
); );
// see if the length of the array is the same or not
// Eg: splitAttachmentsDataName[x] = ["stippled", "grip", "tape"] and splitInputAttachmentsName = ["stippled", "grip", "tape"]
// then it it equal
const temp2 = probables[probables.length - 1].filter( const temp2 = probables[probables.length - 1].filter(
x => x =>
splitAttachmentsDataName[x].length == splitInputAttachmentsName.length splitAttachmentsDataName[x].length == splitInputAttachmentsName.length
); );
/**/ if (temp1.length === 1 && temp2.length !== 1) {
// if found probable, push it
if (temp1.length === 1 && temp2.length !== 1) {
probables.push([temp1]); probables.push([temp1]);
} else if (temp1.length !== 1 && temp2.length === 1) { } else if (temp1.length !== 1 && temp2.length === 1) {
probables.push([temp2]); probables.push([temp2]);
@ -326,6 +345,7 @@ function attachmentsIdentifier(inpmsg, gun) {
probables[probables.length - 1].length != 1 || probables[probables.length - 1].length != 1 ||
probables.length < splitInputAttachmentsName.length probables.length < splitInputAttachmentsName.length
) { ) {
// ask the user if he means xxx = which attachment
errors.push( errors.push(
"`" + "`" +
curr curr
@ -338,8 +358,10 @@ function attachmentsIdentifier(inpmsg, gun) {
'"`' '"`'
); );
} }
// push the attachment to the output list
outAttachments.push(gun.aments[probables[probables.length - 1][0]]); outAttachments.push(gun.aments[probables[probables.length - 1][0]]);
} }
const outAttachmentsTypes = outAttachments.map(x => x.type - 1), const outAttachmentsTypes = outAttachments.map(x => x.type - 1),
t1 = outAttachments t1 = outAttachments
.map(x => x.effects[35]) .map(x => x.effects[35])
@ -401,7 +423,8 @@ function attachmentsIdentifier(inpmsg, gun) {
// 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 + 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(); // console.log(attachmentsIdentifier("117 + rtc muzzle brake, rubberized griptape, tac lazer sight, 40 round mag, no stock", data.cguns[1].aments)); makeError();
// console.log(attachmentsIdentifier("47 + stipplied grip tape", data.cguns[0]));
// makeError();
function damageHandler( function damageHandler(
currDmgs, currDmgs,
currRngs, currRngs,
@ -435,22 +458,15 @@ function damageHandler(
} }
function stk(dmg) { function stk(dmg) {
let out; let out;
if (!pellets) { if (!pellets) out = Math.ceil(hp / dmg);
out = Math.ceil(hp / dmg); else out = Math.ceil(hp / (dmg * pellets));
} else { return out == Infinity ? "∞" : out;
out = Math.ceil(hp / (dmg * pellets));
}
out = out == Infinity ? "∞" : out;
return out;
} }
function ttk(dmg) { function ttk(dmg) {
const stkVal = stk(dmg); const stkVal = stk(dmg);
if (stkVal == "∞") { if (stkVal == "∞") return stkVal;
return stkVal; if (!bib) return Math.round((stkVal - 1) * tbs);
}
if (!bib) {
return Math.round((stkVal - 1) * tbs);
}
let out = 0; let out = 0;
if (dmg > 0) { if (dmg > 0) {
if (stkVal % bib == 0) { if (stkVal % bib == 0) {
@ -503,13 +519,11 @@ function recoilHandler(
yMultiplier, yMultiplier,
bulletCount bulletCount
) { ) {
if (xRecoil.length != yRecoil.length) { if (xRecoil.length != yRecoil.length) return "err";
return "err";
}
const recoilLength = xRecoil.length; const recoilLength = xRecoil.length;
if (recoilLength == 0) { if (recoilLength == 0) return "none";
return "none";
}
const recoilPattern = [ const recoilPattern = [
{ {
x: 0, x: 0,