commit 98bd127e5e0202c493026b3c623f0eb9b59d2859
parent eb491b23a7dc0ab67d86b7b78313d07471112bfe
Author: night0721 <[email protected]>
Date: Mon, 14 Mar 2022 03:15:09 +0800
.
Diffstat:
38 files changed, 554 insertions(+), 674 deletions(-)
diff --git a/CODM/new-stats.js b/CODM/new-stats.js
@@ -414,8 +414,8 @@ module.exports = {
Authorization: process.env.CODM_API_KEY,
},
})
- .then((res) => res.data)
- .catch((e) => null);
+ .then(res => res.data)
+ .catch(e => null);
if (!data?.ID) {
const embed = new MessageEmbed()
@@ -426,14 +426,10 @@ module.exports = {
interaction.followUp({ embeds: [embed] });
} else {
const embed = new MessageEmbed()
- .setTitle(
- `${data.author} Statistical Breakdown`
- )
+ .setTitle(`${data.author} Statistical Breakdown`)
.setColor(16580400)
.setImage(data.imageUrl)
- .setFooter(
- `Stats Curtosy of Round Table`,
- )
+ .setFooter(`Stats Curtosy of Round Table`)
// .setFooter(
// `Stats Curtosy of Stats on Duty`,
// )
@@ -452,7 +448,7 @@ module.exports = {
"MMMM Do YYYY"
)}\n\`\`\``,
inline: true,
- },
+ },
{
name: "Basic Stats",
value: `\`\`\`\n
@@ -477,7 +473,7 @@ module.exports = {
inline: false,
},
{
- name: "Ammunation Stats",
+ name: "Ammunation Stats",
value: `\`\`\`\n
Magazine : 30
Reserve : 120
@@ -503,9 +499,7 @@ module.exports = {
},
};
-// @night0721 Damage profile will be avalable by different command
-
-
+// @night0721 Damage profile will be avalable by different command
// recoilAvailable = false;
// hasError = false;
@@ -527,7 +521,6 @@ module.exports = {
// },
// }
-
// run: async (client, interaction, args) => {
// recoilAvailable = false;
// hasError = false;
diff --git a/command/CODM/build.js b/command/CODM/build.js
@@ -112,16 +112,16 @@ module.exports = {
required: true,
choices: [
{
- name: "Path.exe",
+ name: "path.exe",
value: "path.exe",
},
{
name: "Jokesta",
- value: "jokesta",
+ value: "Jokesta",
},
// {
// name: "Stats On Duty",
- // value: "sod",
+ // value: "Stats On Duty",
// },
],
},
@@ -133,11 +133,11 @@ module.exports = {
choices: [
{
name: "Aggressive",
- value: "aggressive",
+ value: "Aggressive",
},
{
name: "Passive",
- value: "passive",
+ value: "Passive",
},
{
name: "Search And Destroy",
@@ -145,7 +145,7 @@ module.exports = {
},
{
name: "Respawn",
- value: "respawn",
+ value: "Respawn",
},
],
},
@@ -239,12 +239,12 @@ module.exports = {
required: true,
choices: [
{
- name: "Path.exe",
+ name: "path.exe",
value: "path.exe",
},
{
name: "Jokesta",
- value: "jokesta",
+ value: "Jokesta",
},
],
},
@@ -256,11 +256,11 @@ module.exports = {
choices: [
{
name: "Aggressive",
- value: "aggressive",
+ value: "Aggressive",
},
{
name: "Passive",
- value: "passive",
+ value: "Passive",
},
{
name: "Search And Destroy",
@@ -268,7 +268,7 @@ module.exports = {
},
{
name: "Respawn",
- value: "respawn",
+ value: "Respawn",
},
],
},
@@ -330,7 +330,7 @@ module.exports = {
required: true,
choices: [
{
- name: "Path.exe",
+ name: "path.exe",
value: "path.exe",
},
],
@@ -343,11 +343,11 @@ module.exports = {
choices: [
{
name: "Aggressive",
- value: "aggressive",
+ value: "Aggressive",
},
{
name: "Passive",
- value: "passive",
+ value: "Passive",
},
{
name: "Search And Destroy",
@@ -355,7 +355,7 @@ module.exports = {
},
{
name: "Respawn",
- value: "respawn",
+ value: "Respawn",
},
],
},
@@ -413,7 +413,7 @@ module.exports = {
required: true,
choices: [
{
- name: "Path.exe",
+ name: "path.exe",
value: "path.exe",
},
],
@@ -426,11 +426,11 @@ module.exports = {
choices: [
{
name: "Aggressive",
- value: "aggressive",
+ value: "Aggressive",
},
{
name: "Passive",
- value: "passive",
+ value: "Passive",
},
{
name: "Search And Destroy",
@@ -438,7 +438,7 @@ module.exports = {
},
{
name: "Respawn",
- value: "respawn",
+ value: "Respawn",
},
],
},
@@ -496,7 +496,7 @@ module.exports = {
required: true,
choices: [
{
- name: "Path.exe",
+ name: "path.exe",
value: "path.exe",
},
{
@@ -513,11 +513,11 @@ module.exports = {
choices: [
{
name: "ADS",
- value: "ads",
+ value: "ADS",
},
{
name: "Hipfire",
- value: "hipfire",
+ value: "Hipfire",
},
],
},
@@ -559,12 +559,12 @@ module.exports = {
required: true,
choices: [
{
- name: "Path.exe",
+ name: "path.exe",
value: "path.exe",
},
{
name: "Stats On Duty",
- value: "sod",
+ value: "Stats On Duty",
},
],
},
@@ -576,15 +576,15 @@ module.exports = {
choices: [
{
name: "Aggressive",
- value: "aggressive",
+ value: "Aggressive",
},
{
name: "Passive",
- value: "passive",
+ value: "Passive",
},
{
name: "Respawn",
- value: "respawn",
+ value: "Respawn",
},
],
},
@@ -634,12 +634,12 @@ module.exports = {
required: true,
choices: [
{
- name: "Path.exe",
+ name: "path.exe",
value: "path.exe",
},
// {
// name: "Stats On Duty",
- // value: "sod",
+ // value: "Stats On Duty",
// },
],
},
@@ -651,7 +651,7 @@ module.exports = {
choices: [
{
name: "Respawn",
- value: "respawn",
+ value: "Respawn",
},
],
},
@@ -673,24 +673,10 @@ module.exports = {
)
.then(res => res.data)
.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) {
const embed = new MessageEmbed()
.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);
interaction.followUp({ embeds: [embed] });
@@ -700,9 +686,7 @@ module.exports = {
return arr.push(`**${i + 1}:** ${e}`);
});
const embed = new MessageEmbed()
- .setTitle(
- `${all[tag]} build for ${data.weaponName} from ${data.author}`
- )
+ .setTitle(`${tag} build for ${data.weaponName} from ${data.author}`)
.setDescription(
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${data.notes}\n \`\`\``
)
diff --git a/command/CODM/class.js b/command/CODM/class.js
@@ -8,10 +8,10 @@ module.exports = {
run: async (client, interaction) => {
const data = async () => {
const d = await model.findOne({});
- const types = d.Categories;
- const names = d.Primary;
- const category = types[Math.floor(Math.random() * types.length)];
- const weapons = names[0][category];
+ const weapons =
+ d.Primary[0][
+ d.Categories[Math.floor(Math.random() * d.Categories.length)]
+ ];
return `${weapons[Math.floor(Math.random() * weapons.length)]}`;
};
const primary_weapon = await data();
diff --git a/command/CODM/loadout.js b/command/CODM/loadout.js
@@ -0,0 +1,74 @@
+const { MessageEmbed } = require("discord.js"); //@night0721 You need to make this
+const items = require("../../util/Data/loadout.json");
+module.exports = {
+ name: "loadout",
+ description: "Generate A Random Loadout",
+ category: "CODM",
+ run: async (client, interaction) => {
+ const secondary =
+ items.secondary[Math.floor(Math.random() * items.secondary.length)];
+ const red = items.perk_1[Math.floor(Math.random() * items.perk_1.length)];
+ const green = items.perk_2[Math.floor(Math.random() * items.perk_2.length)];
+ const blue = items.perk_3[Math.floor(Math.random() * items.perk_3.length)];
+ const operator =
+ items.operator_skill[
+ Math.floor(Math.random() * items.operator_skill.length)
+ ];
+ const slots = shuffle(items.scorestreak);
+ const slot_1 = slots.next().value,
+ slot_2 = slots.next().value,
+ slot_3 = slots.next().value;
+ const result = new MessageEmbed()
+ .setColor(client.color)
+ .setFooter({
+ text: `Made by ${client.author}`,
+ iconURL: client.user.displayAvatarURL(),
+ })
+ .setURL(client.web)
+ .setTitle(`π² A Randomly Generated Loadout π²`)
+ .setDescription(
+ `This loadout is a randomly generated, Also try, \`\`\`/class\`\`\` to get a randomally generated primary weapon gunsmith build`
+ )
+ .addFields(
+ {
+ name: "Secondary Weapon",
+ value: secondary,
+ inline: true,
+ },
+ {
+ name: "Operator Skill",
+ value: operator,
+ inline: true,
+ },
+ {
+ name: "Scorestreak",
+ value: `${slot_1}\n${slot_2}\n${slot_3}`,
+ inline: true,
+ },
+ {
+ name: "Red Perk",
+ value: red,
+ inline: true,
+ },
+ {
+ name: "Green Perk",
+ value: green,
+ inline: true,
+ },
+ {
+ name: "Blue Perk",
+ value: blue,
+ inline: true,
+ }
+ )
+ .setTimestamp();
+ interaction.followUp({ embeds: [result] });
+
+ function* shuffle(array) {
+ let i = array.length;
+ while (i--) {
+ yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0];
+ }
+ }
+ },
+};
diff --git a/command/CODM/scorestreak.js b/command/CODM/scorestreak.js
@@ -8,7 +8,7 @@ module.exports = {
category: "CODM",
options: [
{
- type: 1,
+ type: "SUB_COMMAND",
name: "lethal",
description: "Lethal Scorestreak",
options: [
@@ -83,7 +83,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "support",
description: "Support Scorestreak",
options: [
diff --git a/command/CODM/stats.js b/command/CODM/stats.js
@@ -11,7 +11,6 @@ let currGun,
recoilAvailable,
chart,
hasError;
-const errMsg = "*Generic placeholder error message*";
module.exports = {
name: "stats",
description: "Check gun stats",
@@ -58,20 +57,22 @@ module.exports = {
if (args.length == 1)
repEmb = statsHandler(args.join(" ").replace("\n", " "));
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
-
if (hasError) {
- 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)```",
+ interaction.followUp({
+ content: `**${repEmb || "An error has occured"}**`,
});
- const recoilImageLink = await chart.getShortUrl();
- repEmb.image = { url: recoilImageLink };
+ } 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)] });
},
};
@@ -81,38 +82,38 @@ function inpHandler(inpmsg) {
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",
+ "Pellets", //0
+ "Detonation Range", //1
+ "Explosion Radius", //2
+ "Explosion Damage", //3
+ "Firing Mode", //4
+ "Rate of Fire", //5
+ "Bullet in Burst", //6
+ "Time Between Burst", //7
+ "Bullet Speed", //8
+ "Penetration Level", //9
+ "Bullet Spread", //10
+ "Idle Sway", //11
+ "Hipfire Pellet Spread", //12
+ "ADS Pellet Spread", //13
+ "ADS Time", //14
+ "Sprint-to-Fire Time", //15
+ "ADS Zoom", //16
+ "Magazine", //17
+ "Reserve", //18
+ "Reload Type", //19
+ "Cancel Reload Time", //20
+ "Reload Time", //21
+ "Full Reload Time", //22
+ "Drop Time", //23
+ "Raise Time", //24
+ "Sprinting Speed", //25
+ "Walking Speed", //26
+ "Straifing Speed", //27
+ "Damage per Tick", //28
+ "Number of Ticks", //29
+ "Time Between Ticks", //30
+ "Breath Hold Time", //31
"shouldNeverHappen0",
"shouldNeverHappen1",
"shouldNeverHappen2",
@@ -187,8 +188,8 @@ function statsHandler(inpmsg) {
inpIndx = inpIndx.filter(x => outReady[x]);
return inpIndx.length
? {
- name: "**" + inpName + "**",
- value: "```\n" + inpIndx.map(x => outReady[x]).join("\n") + "```",
+ name: `**${inpName}**`,
+ value: `\`\`\`\n${inpIndx.map(x => outReady[x]).join("\n")}\`\`\``,
}
: "";
}
@@ -219,17 +220,17 @@ function statsHandler(inpmsg) {
function addUnit(j) {
switch (j) {
- case 07:
+ case 7:
case 14:
case 15:
case 23:
case 24:
case 31:
return " ms";
- case 27:
- case 28:
case 25:
case 26:
+ case 27:
+ case 28:
return " m/s";
case 20:
case 21:
@@ -237,9 +238,9 @@ function statsHandler(inpmsg) {
return " s";
case 16:
return "%";
- case 06:
+ case 6:
return " Rounds";
- case 05:
+ case 5:
return " RPM";
default:
return "";
@@ -256,16 +257,11 @@ function statsHandler(inpmsg) {
currRecoilArr[2]
);
recoilAvailable = true;
- } else {
- recoilAvailable = false;
- }
- if (chart == "none") {
- recoilAvailable = false;
- }
- if (chart == "err" || currAttachments == "err") {
- hasError = true;
- return "Cocaineeee";
- }
+ } else recoilAvailable = false;
+
+ if (chart == "none") recoilAvailable = false;
+ if (chart == "err") hasError = true;
+
const dmg =
common.damageHandler(
currDRM.damage,
@@ -281,7 +277,7 @@ function statsHandler(inpmsg) {
currGun.description
? {
name: "**Description:**",
- value: "```\n" + currGun.description + "```",
+ value: `\`\`\`\n${currGun.description}\`\`\``,
}
: {},
{ name: "**Damage Profile:**", value: dmg },
diff --git a/command/Config/settings.js b/command/Config/settings.js
@@ -8,7 +8,7 @@ module.exports = {
category: "Config",
options: [
{
- type: 1,
+ type: "SUB_COMMAND",
name: "muterole",
description: "Configure mute role settings for the server",
options: [
@@ -21,7 +21,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "prefix",
description: "Configure prefix settings for the server",
options: [
@@ -35,7 +35,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "welcome",
description: "Configure welcome channel settings for the server",
options: [
@@ -49,7 +49,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "goodbye",
description: "Configure goodbye channel settings for the server",
options: [
@@ -63,7 +63,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "starboard",
description: "Configure starboard channel settings for the server",
options: [
@@ -83,7 +83,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "chatbot",
description: "Configure chatbot channel settings for the server",
options: [
@@ -97,7 +97,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "log",
description: "Configure log channel settings for the server",
options: [
@@ -116,7 +116,7 @@ module.exports = {
description: "Enable commands/category for the server",
options: [
{
- type: 1,
+ type: "SUB_COMMAND",
name: "command",
description: "To enable commands",
options: [
@@ -129,7 +129,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "category",
description: "To enable categories",
options: [
@@ -179,7 +179,7 @@ module.exports = {
description: "Disable commands/category for the server",
options: [
{
- type: 1,
+ type: "SUB_COMMAND",
name: "command",
description: "To disable commands",
options: [
@@ -192,7 +192,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "category",
description: "To disable categories",
options: [
@@ -237,7 +237,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "level",
description: "Configure level settings for the server",
options: [
@@ -250,7 +250,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "nsfw",
description: "Configure nsfw settings for the server",
options: [
@@ -263,7 +263,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "tips",
description: "Configure tips settings for the server",
options: [
@@ -276,7 +276,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "overall",
description: "See overall settings for the server",
options: [],
diff --git a/command/Economy/gun.js b/command/Economy/gun.js
@@ -6,7 +6,7 @@ module.exports = {
description: "Configure Weapon Master System settings",
options: [
{
- type: 1,
+ type: "SUB_COMMAND",
name: "select",
description: "Select the gun for the game",
options: [
@@ -29,13 +29,13 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "list",
description: "See the information for the guns",
options: [],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "info",
description: "See the stats of your gun",
},
diff --git a/command/Fun/dare.js b/command/Fun/dare.js
@@ -9,7 +9,7 @@ module.exports = {
name: interaction.user.tag,
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)
.setFooter({
text: `Made by ${client.author}`,
diff --git a/command/Fun/ship.js b/command/Fun/ship.js
@@ -27,7 +27,7 @@ module.exports = {
const user2 = interaction.guild.members.cache.get(args[1]).user.username;
const loveEmbed = new MessageEmbed()
.setColor("dd2e44")
- .setFooter(`Shipped by ${interaction.user.tag}`)
+ .setFooter({ text: `Shipped by ${interaction.user.tag}` })
.setTimestamp()
.setTitle(`π | Shipping ${user1} and ${user2} | π`)
.setDescription(`π» | ${user1} \n${ship()}\nπΊ | ${user2}`);
diff --git a/command/Fun/simprate.js b/command/Fun/simprate.js
@@ -22,7 +22,10 @@ module.exports = {
.setTitle(`${user.user.username}'s simp rate`)
.setDescription(`${user.user.username} is a ${simp}% simp`)
.setColor(client.color)
- .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
+ .setFooter({
+ text: `Made by ${client.author}`,
+ iconURL: client.user.displayAvatarURL(),
+ })
.setTimestamp(),
],
});
diff --git a/command/Fun/truth.js b/command/Fun/truth.js
@@ -9,7 +9,7 @@ module.exports = {
name: interaction.user.tag,
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)
.setFooter({
text: `Made by ${client.author}`,
diff --git a/command/Fun/wyr.js b/command/Fun/wyr.js
@@ -1,6 +1,5 @@
const { MessageEmbed } = require("discord.js");
const questions = require("../../util/Data/wyr.json");
-
module.exports = {
name: "wyr",
description: "Send some would-you rather questions",
@@ -15,12 +14,15 @@ module.exports = {
.setDescription(
`π¦ ${Option1} \n\n **OR** \n\n :regional_indicator_b: ${Option2}`
)
- .setAuthor(
- interaction.user.tag,
- interaction.user.displayAvatarURL({ dynamic: true })
- )
+ .setAuthor({
+ name: interaction.user.tag,
+ iconURL: interaction.user.displayAvatarURL({ dyamic: true }),
+ })
.setColor(client.color)
- .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
+ .setFooter({
+ text: `Made by ${client.author}`,
+ iconURL: client.user.displayAvatarURL(),
+ })
.setTimestamp();
wyrmessage = await interaction.followUp({ embeds: [embed] });
wyrmessage.react("π¦");
diff --git a/command/Information/avatar.js b/command/Information/avatar.js
@@ -17,10 +17,10 @@ module.exports = {
const member =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const embed = new MessageEmbed()
- .setAuthor(
- member.user.tag,
- member.user.displayAvatarURL({ dynamic: true, size: 1024 })
- )
+ .setAuthor({
+ text: member.user.tag,
+ iconURL: member.user.displayAvatarURL({ dynamic: true, size: 1024 }),
+ })
.setColor(client.color)
.setTitle(`${member.user.username}'s Avatar`)
.setDescription(
@@ -41,7 +41,10 @@ module.exports = {
.setImage(
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)
.setTimestamp();
interaction.followUp({ embeds: [embed] });
diff --git a/command/Information/botinfo.js b/command/Information/botinfo.js
@@ -0,0 +1,64 @@
+const { MessageEmbed, version: djsversion } = require("discord.js");
+const version = require("../../../package.json").version;
+const { utc } = require("moment");
+module.exports = {
+ name: "botinfo",
+ description: "Check the info of the bot",
+ category: "Information",
+ type: "CHAT_INPUT",
+ run: async (client, interaction) => {
+ const embed = new MessageEmbed()
+ .setTitle(`NYX - CODM Gunsmith Bot`)
+ .setURL(
+ `https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands`
+ )
+ .setThumbnail(
+ "https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
+ )
+ .setColor(client.color)
+ .addFields(
+ {
+ name: `General`,
+ value: `
+ <:nyx_owner:897418259433943120> Owner β― <@452076196419600394>
+ Bot β― ${client.user.tag}
+ Bot ID β― \`${client.user.id}\`
+ Created on β― \`${utc(client.user.createdTimestamp).format(
+ "MMMM Do YYYY"
+ )}\``,
+ inline: true,
+ },
+ {
+ name: `Bot Stats`,
+ value: `
+ Servers β― ${client.guilds.cache.size.toLocaleString()}
+ Users β― ${client.guilds.cache
+ .reduce((a, b) => a + b.memberCount, 0)
+ .toLocaleString()}
+ Channels β― \`${client.channels.cache.size.toLocaleString()}\`
+ Commands β― \`${client.commands.size}\`
+ `,
+ inline: true,
+ }
+ )
+ .addFields({
+ name: `Platform`,
+ value: `
+ NYX β― \`v${version}\`
+ Discord.js β― \`v${djsversion}\`
+ Node.js β― \`${process.version}\``,
+ })
+ .addFields({
+ 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
+ **Research & Documentation**\n\u3000ππ»π¦ΰΈππΰΈπ¦ΣΓΈ#0690\n\u3000Thunder#2128\n
+ **Website**\n\u3000Chunchunmaru#8570`,
+ })
+ .setFooter({
+ text: `Made by ${client.author}`,
+ iconURL: client.user.displayAvatarURL(),
+ })
+ .setTimestamp();
+ interaction.followUp({ embeds: [embed] });
+ },
+};
diff --git a/command/Information/help.js b/command/Information/help.js
@@ -122,7 +122,9 @@ module.exports = {
)
.setTimestamp()
.setColor(client.color)
- .setFooter(`Please use /help (Command Name) for more details`)
+ .setFooter({
+ text: `Please use /help (Command Name) for more details`,
+ })
.setDescription(
category.commands
.map(cmd => {
@@ -168,28 +170,26 @@ module.exports = {
"**Command**:",
command.name ? `\`${command.name}\`` : "N/A"
);
- if (command.usage) {
+ if (command.usage)
embed.addField("**Usage**:", `\`/${command.name} ${command.usage}\``);
- } else {
- embed.addField("**Usage**:", `\`/${command.name}\``);
- }
- if (command.description) {
+ else embed.addField("**Usage**:", `\`/${command.name}\``);
+
+ if (command.description)
embed.addField("**Description**:", command.description);
- }
- if (command.timeout) {
+
+ if (command.timeout)
embed.addField("**Cooldown**:", utils.timer(command.timeout));
- }
- if (command.UserPerms) {
+
+ if (command.UserPerms)
embed.addField("**Required User Permission**:", UserPerms);
- }
- if (command.BotPerms) {
+
+ if (command.BotPerms)
embed.addField("**Required Bot Permission**:", BotPerms);
- }
embed
- .setFooter(
- `Requested by ${interaction.user.tag}`,
- interaction.user.displayAvatarURL({ dynamic: true })
- )
+ .setFooter({
+ text: `Requested by ${interaction.user.tag}`,
+ iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
+ })
.setTimestamp()
.setURL(client.web)
.setColor(client.color);
diff --git a/command/Moderation/warn.js b/command/Moderation/warn.js
@@ -8,7 +8,7 @@ module.exports = {
category: "Moderation",
options: [
{
- type: 1,
+ type: "SUB_COMMAND",
name: "add",
description: "Warn a user",
options: [
@@ -27,7 +27,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "list",
description: "Show a list of warnings of an user",
options: [
@@ -40,7 +40,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "remove",
description: "Remove a latest warn for an user",
options: [
@@ -59,7 +59,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "clear",
description: "Clear an user's warns",
options: [
diff --git a/command/Music/loop.js b/command/Music/loop.js
@@ -4,13 +4,13 @@ module.exports = {
category: "Music",
options: [
{
- type: 1,
+ type: "SUB_COMMAND",
name: "track",
description: "Loop the track",
options: [],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "queue",
description: "Loop the whole queue",
options: [],
diff --git a/command/NSFW/ass.js b/command/NSFW/ass.js
@@ -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 }),
- },
- }),
- ],
- });
- }
- },
-};
diff --git a/command/NSFW/blowjob.js b/command/NSFW/blowjob.js
@@ -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 }),
- },
- }),
- ],
- });
- }
- },
-};
diff --git a/command/NSFW/boobs.js b/command/NSFW/boobs.js
@@ -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 }),
- },
- }),
- ],
- });
- }
- },
-};
diff --git a/command/NSFW/hentai.js b/command/NSFW/hentai.js
@@ -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 }),
- },
- }),
- ],
- });
- }
- },
-};
diff --git a/command/NSFW/pussy.js b/command/NSFW/pussy.js
@@ -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 }),
- },
- }),
- ],
- });
- }
- },
-};
diff --git a/command/Owner/add.js b/command/Owner/add.js
@@ -5,7 +5,7 @@ module.exports = {
Owner: true,
options: [
{
- type: 1,
+ type: "SUB_COMMAND",
name: "add",
description: "Remove coins from someone",
options: [
@@ -24,7 +24,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "rmv",
description: "Remove coins from someone",
options: [
diff --git a/command/Owner/nsfw.js b/command/Owner/nsfw.js
@@ -1,137 +0,0 @@
-const { getreddit } = require("cath");
-const { MessageActionRow, MessageButton, MessageEmbed } = require("discord.js");
-module.exports = {
- name: "nsfw",
- description: "nsfw command",
- run: async (client, interaction) => {
- const msg = await interaction.channel.send({ content: "Getting images" });
- async function embed() {
- 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] });
- }
- let subreddits = [
- "GoneWild",
- "WorkGoneWild",
- "GoneWild30Plus",
- "hentai",
- "HentaiAnime",
- "nekogirls",
- "ass",
- "BestBooties",
- "BootyGIFs",
- "booty_queens",
- "BlowJob",
- "blowjobs",
- "blowjobgifs",
- "OralSex",
- "boobs",
- "GrabHerTitties",
- "titfuck",
- "milf",
- "OnlyHotMilfs",
- "realmoms",
- "thighs",
- "PerfectThighs",
- "thickthighs",
- ];
- const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
- const data = await getreddit(reddit);
- let embed1 = null;
- embed1 = 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 }),
- },
- });
- return embed1;
- }
-
- const row = new MessageActionRow().addComponents(
- new MessageButton()
- .setCustomId("reload")
- .setLabel("Reload")
- .setStyle("SUCCESS")
- );
- const disabled = new MessageActionRow().addComponents(
- new MessageButton()
- .setCustomId("reload")
- .setLabel("Reload")
- .setStyle("SECONDARY")
- .setDisabled(true)
- );
- await msg.delete();
- let m = await interaction.followUp({
- embeds: [await embed()],
- components: [row],
- });
-
- const collector = m.createMessageComponentCollector({
- componentType: "BUTTON",
- time: 120000,
- });
- collector.on("collect", async i => {
- if (i.user.id === interaction.user.id) {
- i.deferUpdate();
- await update(m);
- collector.stop();
- } else {
- i.reply({
- content: `These buttons aren't for you!`,
- ephemeral: true,
- });
- }
- });
- collector.on("end", (mes, r) => {
- if (r == "time") {
- m.edit({
- components: [disabled],
- });
- }
- });
-
- async function update(m) {
- m.edit({
- embeds: [await embed()],
- }).catch(null);
-
- const collector = m.createMessageComponentCollector({
- componentType: "BUTTON",
- time: 120000,
- });
- collector.on("collect", async i => {
- if (i.user.id === interaction.user.id) {
- i.deferUpdate();
- await update(m);
- collector.stop();
- } else {
- i.reply({
- content: `These buttons aren't for you!`,
- ephemeral: true,
- });
- }
- });
- collector.on("end", (mes, r) => {
- if (r == "time") {
- m.edit({
- components: [disabled],
- });
- }
- });
- }
- },
-};
diff --git a/command/Utilities/afk.js b/command/Utilities/afk.js
@@ -23,12 +23,15 @@ module.exports = {
`${interaction.user.username} is set into AFK.\nStatus : ${content}`
)
.setTimestamp()
- .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
+ .setFooter({
+ text: `Made by ${client.author}`,
+ iconURL: client.user.displayAvatarURL(),
+ })
.setColor(client.color)
- .setAuthor(
- interaction.user.username,
- interaction.user.displayAvatarURL({ dynamic: true })
- )
+ .setAuthor({
+ text: interaction.user.username,
+ iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
+ })
.setURL(client.web);
interaction.followUp({ embeds: [embed] });
},
diff --git a/command/Utilities/invite.js b/command/Utilities/invite.js
@@ -10,10 +10,10 @@ module.exports = {
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setColor(client.color)
.setTimestamp()
- .setAuthor(
- interaction.user.tag,
- interaction.user.displayAvatarURL({ dynamic: true })
- )
+ .setAuthor({
+ text: interaction.user.tag,
+ iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
+ })
.setTitle(`Support/Invite`)
.setThumbnail(
"https://github.com/night0721/cath.js/blob/master/util/assets/images/nyx_logo_transparent.webp"
diff --git a/command/Utilities/nsfw.js b/command/Utilities/nsfw.js
@@ -0,0 +1,150 @@
+const { getreddit } = require("cath");
+const { MessageActionRow, MessageButton, MessageEmbed } = require("discord.js");
+module.exports = {
+ name: "nsfw",
+ description: "NSFW command",
+ run: async (client, interaction) => {
+ const msg = await interaction.channel.send({ content: "Getting images" });
+ async function embed() {
+ 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({
+ text: `Made by ${client.author}`,
+ iconURL: client.user.displayAvatarURL(),
+ })
+ .setTimestamp();
+ interaction.followUp({ embeds: [embed] });
+ }
+ let subreddits = [
+ "GodPussy",
+ "peachlips",
+ "vagina",
+ "GoneWild",
+ "WorkGoneWild",
+ "GoneWild30Plus",
+ "hentai",
+ "HentaiAnime",
+ "nekogirls",
+ "ass",
+ "BestBooties",
+ "BootyGIFs",
+ "booty_queens",
+ "BlowJob",
+ "blowjobs",
+ "blowjobgifs",
+ "OralSex",
+ "boobs",
+ "GrabHerTitties",
+ "titfuck",
+ "milf",
+ "OnlyHotMilfs",
+ "realmoms",
+ "thighs",
+ "PerfectThighs",
+ "thickthighs",
+ "PushHerHead",
+ "ThroatFuck",
+ ];
+ const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
+ let data = await getreddit(reddit);
+ while (data.length === 0) {
+ while (data.image.length === 0) {
+ data = await getreddit(reddit);
+ }
+ }
+ let embed1 = null;
+ embed1 = 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 }),
+ },
+ });
+ return embed1;
+ }
+
+ const row = new MessageActionRow().addComponents(
+ new MessageButton()
+ .setCustomId("reload")
+ .setLabel("Reload")
+ .setStyle("SUCCESS")
+ );
+ const disabled = new MessageActionRow().addComponents(
+ new MessageButton()
+ .setCustomId("reload")
+ .setLabel("Reload")
+ .setStyle("SECONDARY")
+ .setDisabled(true)
+ );
+ await msg.delete();
+ let m = await interaction.followUp({
+ embeds: [await embed()],
+ components: [row],
+ });
+
+ const collector = m.createMessageComponentCollector({
+ componentType: "BUTTON",
+ time: 120000,
+ });
+ collector.on("collect", async i => {
+ if (i.user.id === interaction.user.id) {
+ i.deferUpdate();
+ await update(m);
+ collector.stop();
+ } else {
+ i.reply({
+ content: `These buttons aren't for you!`,
+ ephemeral: true,
+ });
+ }
+ });
+ collector.on("end", (mes, r) => {
+ if (r == "time") {
+ m.edit({
+ components: [disabled],
+ });
+ }
+ });
+
+ async function update(m) {
+ m.edit({
+ embeds: [await embed()],
+ }).catch(null);
+
+ const collector = m.createMessageComponentCollector({
+ componentType: "BUTTON",
+ time: 120000,
+ });
+ collector.on("collect", async i => {
+ if (i.user.id === interaction.user.id) {
+ i.deferUpdate();
+ await update(m);
+ collector.stop();
+ } else {
+ i.reply({
+ content: `These buttons aren't for you!`,
+ ephemeral: true,
+ });
+ }
+ });
+ collector.on("end", (mes, r) => {
+ if (r == "time") {
+ m.edit({
+ components: [disabled],
+ });
+ }
+ });
+ }
+ },
+};
diff --git a/events/interactionCreate.js b/events/interactionCreate.js
@@ -12,7 +12,7 @@ client.on("interactionCreate", async interaction => {
if (option.type === "SUB_COMMAND_GROUP") {
if (option.name) args.push(option.name);
option.options?.forEach(x => {
- if (x.type === "SUB_COMMAND") {
+ if (x.type === 1) {
if (x.name) args.push(x.name);
x.options?.forEach(y => {
if (y.value) args.push(y.value);
@@ -183,7 +183,7 @@ client.on("interactionCreate", async interaction => {
if (!ownercmd) return;
const args = [];
for (const option of interaction.options.data) {
- if (option.type === "SUB_COMMAND") {
+ if (option.type === 1) {
if (option.name) args.push(option.name);
option.options?.forEach(x => {
if (x.value) args.push(x.value);
diff --git a/package.json b/package.json
@@ -40,15 +40,15 @@
"node": "^17.3.0"
},
"dependencies": {
- "axios": "^0.25.0",
+ "axios": "^0.26.0",
"cath": "^1.4.7",
"discord.js": "^13.6.0",
- "dotenv": "^15.0.0",
+ "dotenv": "^16.0.0",
"erela.js": "^2.3.3",
"erela.js-spotify": "^1.2.0",
"goosecache": "^9.0.14",
"moment": "^2.29.1",
"mongoose": "^5.13.14",
- "quickchart-js": "^2.0.3"
+ "quickchart-js": "^3.0.0"
}
}
diff --git a/unused/commands/Fun/fun.js b/unused/commands/Fun/fun.js
@@ -5,7 +5,7 @@ module.exports = {
description: "Fun commands",
options: [
{
- type: 1,
+ type: "SUB_COMMAND",
name: "8ball",
description: "8ball an answer",
options: [
@@ -18,12 +18,12 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "rickroll",
description: "Rickroll?",
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "emojify",
description: "Emojify a sentence",
options: [
@@ -36,7 +36,7 @@ module.exports = {
],
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "pp",
description: "Check how long is the user",
options: [
diff --git a/unused/commands/Fun/image.js b/unused/commands/Fun/image.js
@@ -5,12 +5,12 @@ module.exports = {
description: "Generate images",
options: [
{
- type: 1,
+ type: "SUB_COMMAND",
name: "meme",
description: "Get a meme from reddit",
},
{
- type: 1,
+ type: "SUB_COMMAND",
name: "cat",
description: "Get a cat from reddit",
},
diff --git a/unused/commands/Information/botinfo.js b/unused/commands/Information/botinfo.js
@@ -1,79 +0,0 @@
-const { MessageEmbed, version: djsversion } = require("discord.js");
-const version = require("../../../package.json").version;
-const { utc } = require("moment");
-// const os = require("os");
-module.exports = {
- name: "botinfo",
- description: "Check the info of the bot",
- category: "Information",
- type: "CHAT_INPUT",
- run: async (client, interaction, args, utils) => {
- // const core = os.cpus()[0];
- const embed = new MessageEmbed()
- .setTitle(`NYX - CODM Gunsmith Bot`)
- .setURL(
- `https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands`
- )
- .setThumbnail(
- "https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
- )
- .setColor(client.color)
- .addFields(
- {
- name: `General`,
- value: `
- <:nyx_owner:897418259433943120> Owner β― <@452076196419600394>
- Bot β― ${client.user.tag}
- Bot ID β― \`${client.user.id}\`
- Created on β― \`${utc(client.user.createdTimestamp).format(
- "MMMM Do YYYY"
- )}\``,
- inline: true,
- },
- {
- name: `Bot Stats`,
- value: `
- Servers β― ${client.guilds.cache.size.toLocaleString()}
- Users β― ${client.guilds.cache
- .reduce((a, b) => a + b.memberCount, 0)
- .toLocaleString()}
- Channels β― \`${client.channels.cache.size.toLocaleString()}\`
- Commands β― \`${client.commands.size}\`
- `,
- inline: true,
- }
- )
- .addFields(
- {
- name: `Platform`,
- value: `
- NYX β― \`v${version}\`
- Discord.js β― \`v${djsversion}\`
- 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({
- 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
- **Research & Documentation**\n\u3000ππ»π¦ΰΈππΰΈπ¦ΣΓΈ#0690\n\u3000Thunder#2128\n
- **Website**\n\u3000Chunchunmaru#8570`,
- })
- .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
- .setTimestamp();
- interaction.followUp({ embeds: [embed] });
- },
-};
diff --git a/util/Data/domains.json b/util/Data/domains.json
@@ -1,5 +1,10 @@
{
"scam": [
+ "disceord.gift",
+ "discode.gift",
+ "discosb.gift",
+ "discorx.gift",
+ "disocrds.gift",
"disocrde.gift",
"discrods.gift",
"discordsgift.com",
@@ -4104,6 +4109,25 @@
"staemporewed.xyz"
],
"iplogger": [
+ "diskerd.gift",
+ "gitdhub.com",
+ "iplogger.org",
+ "2no.co",
+ "iplogger.com",
+ "iplogger.ru",
+ "yip.su",
+ "iplogger.co",
+ "iplogger.info",
+ "ipgrabber.ru",
+ "ipgraber.ru",
+ "iplis.ru",
+ "02ip.ru",
+ "ezstat.ru",
+ "ps3cfw.com",
+ "ythingy.com",
+ "blasze.tk",
+ "fuekos.com",
+ "myiptest.com",
"iplogger.org",
"2no.co",
"iplogger.com",
diff --git a/util/Data/giveaways.json b/util/Data/giveaways.json
@@ -1 +0,0 @@
-[]
diff --git a/util/Data/loadout.json b/util/Data/loadout.json
@@ -1,6 +1,5 @@
{
"secondary": [
- // Doesn't have Pistols becuase it will require Gunsmith Build
"None",
"Knife / Base Melee",
"Axe",
@@ -102,7 +101,7 @@
"TAK-5",
"Munitions Box"
],
- "lethal":[
+ "lethal": [
"None",
"Frag Grenade",
"Sticky Grenade",
@@ -111,7 +110,7 @@
"Thermite",
"Molotov Cocktail"
],
- "tactical":[
+ "tactical": [
"None",
"Flashbang Grenade",
"Smoke Grenade",
diff --git a/util/dist/handler.js b/util/dist/handler.js
@@ -1,4 +1,3 @@
-const { DiscordAPIError, HTTPError } = require("discord.js");
const fs = require("fs");
const cmds = [];
const ownercmds = [];
@@ -29,8 +28,7 @@ module.exports = async client => {
ownercmds.push(file);
});
client.on("ready", async () => {
- const gg = client.guilds.cache.get("840225563193114624");
- await gg.commands.set(ownercmds);
+ await client.guilds.cache.get("840225563193114624").commands.set(ownercmds);
await client.application.commands
.set(cmds)
.then(async cmd => {
diff --git a/util/functions/common.js b/util/functions/common.js
@@ -211,9 +211,9 @@ function attachmentsIdentifier(inpmsg, gun) {
splitAttachmentsDataName[i][j].Simplify();
}
}
- // after loop: ["stippled", "grip", "tape"]
+ // inputAttachmentsNames = [["stippled", "grip", "tape"]
for (let i = 0; i < inputAttachmentsNames.length; i++) {
- const probables = [];
+ let probables = [];
// loop through all the input attachments and split them into words
var splitInputAttachmentsName = inputAttachmentsNames[i]
.split(" ")
@@ -233,13 +233,17 @@ function attachmentsIdentifier(inpmsg, gun) {
// if probables list doesn't include the attachment, push
let probablePushed = false;
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)) {
probables[i4].push(j);
+ // make it true so that it doesn't push again in the next condition
probablePushed = true;
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]);
}
}
@@ -250,40 +254,50 @@ function attachmentsIdentifier(inpmsg, gun) {
// finding magazines attachments
if (
(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].replace(/\D/g, "")
)
) {
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(
x =>
x.type === 8 && x.effects[27] + x.effects[28] + gun.stats[17] === tmp1
);
+ // push if the magazine is found
if (tmp2.length === 1) {
outAttachments.push(tmp2[0]);
continue;
}
}
+ // if probables is empty or there is more than one identified attachment
if (
probables.length === 0 ||
probables[probables.length - 1].length !== 1 ||
probables.length < splitInputAttachmentsName.length
) {
+ // empty probables as can't indentify the attachment
probables = [];
- splitInputAttachmentsName.map((x, i5) =>
- nmDt.attachmentAlliasName[1].map((y, i6) =>
+ // the splitInputAttachmentsName isn't simplified pls rmb
+ splitInputAttachmentsName.map((x, i5) => {
+ // finding aliases
+ nmDt.attachmentAlliasName[1].map((y, i6) => {
y.map(z => {
- if (x.Simplify() === z.Simplify()) {
+ if (z.Simplify().includes(x.Simplify())) {
splitInputAttachmentsName[i5] = nmDt.attachmentActualName[1][i6];
}
- })
- )
- );
+ });
+ });
+ });
+ // simple iteration to make the array again
splitInputAttachmentsName = splitInputAttachmentsName
.join(" ")
.split(" ")
.filter(x => x);
+ // find one more time as we do aliases already
finder();
if (
probables.length === 0 ||
@@ -297,21 +311,26 @@ function attachmentsIdentifier(inpmsg, gun) {
finder();
}
}
-
if (probables.length === 0) {
+ // push to unidentifined list as can't be identified after serveral times
unidentifined.push(inputAttachmentsNames[i]);
continue;
}
-
+ // curr is the most probable attachment
var curr = probables[probables.length - 1];
const temp1 = probables[probables.length - 1].filter(
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(
x =>
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]);
} else if (temp1.length !== 1 && temp2.length === 1) {
probables.push([temp2]);
@@ -326,6 +345,7 @@ function attachmentsIdentifier(inpmsg, gun) {
probables[probables.length - 1].length != 1 ||
probables.length < splitInputAttachmentsName.length
) {
+ // ask the user if he means xxx = which attachment
errors.push(
"`" +
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]]);
}
+
const outAttachmentsTypes = outAttachments.map(x => x.type - 1),
t1 = outAttachments
.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("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("47 + stipplied grip tape", data.cguns[0]));
+// makeError();
function damageHandler(
currDmgs,
currRngs,
@@ -435,22 +458,15 @@ function damageHandler(
}
function stk(dmg) {
let out;
- if (!pellets) {
- out = Math.ceil(hp / dmg);
- } else {
- out = Math.ceil(hp / (dmg * pellets));
- }
- out = out == Infinity ? "β" : out;
- return out;
+ if (!pellets) out = Math.ceil(hp / dmg);
+ else out = Math.ceil(hp / (dmg * pellets));
+ return out == Infinity ? "β" : out;
}
function ttk(dmg) {
const stkVal = stk(dmg);
- if (stkVal == "β") {
- return stkVal;
- }
- if (!bib) {
- return Math.round((stkVal - 1) * tbs);
- }
+ if (stkVal == "β") return stkVal;
+ if (!bib) return Math.round((stkVal - 1) * tbs);
+
let out = 0;
if (dmg > 0) {
if (stkVal % bib == 0) {
@@ -503,13 +519,11 @@ function recoilHandler(
yMultiplier,
bulletCount
) {
- if (xRecoil.length != yRecoil.length) {
- return "err";
- }
+ if (xRecoil.length != yRecoil.length) return "err";
+
const recoilLength = xRecoil.length;
- if (recoilLength == 0) {
- return "none";
- }
+ if (recoilLength == 0) return "none";
+
const recoilPattern = [
{
x: 0,