Merge branch 'main' into dev

This commit is contained in:
Night Kaly 2022-03-24 17:20:31 +00:00 committed by GitHub
commit 4f60a07863
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 175 additions and 145 deletions

View file

@ -6,5 +6,5 @@ SPOTIFY_ID =
SPOTIFY_SECRET = SPOTIFY_SECRET =
host = lavalink.darrennathanael.com host = lavalink.darrennathanael.com
port = 2095 port = 2095
password = whatwasthelastingyousaid password = whatwasthelastthingyousaid
api = http://api.cath.gq api = http://api.cath.gq

View file

@ -1,6 +1,6 @@
const { MessageEmbed } = require("discord.js"); const { MessageEmbed } = require("discord.js");
module.exports = { module.exports = {
name: "class", name: "sensitivity",
description: "Get the perfect sensitivity for APEXM", description: "Get the perfect sensitivity for APEXM",
category: "APEX", category: "APEX",
usage: "[Ironsight Sensitivity]", usage: "[Ironsight Sensitivity]",

View file

@ -18,7 +18,7 @@ module.exports = {
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({
text: member.user.tag, name: member.user.tag,
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 1024 }), iconURL: member.user.displayAvatarURL({ dynamic: true, size: 1024 }),
}) })
.setColor(client.color) .setColor(client.color)

View file

@ -1,5 +1,5 @@
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");
module.exports = { module.exports = {
name: "botinfo", name: "botinfo",
@ -36,7 +36,7 @@ module.exports = {
.reduce((a, b) => a + b.memberCount, 0) .reduce((a, b) => a + b.memberCount, 0)
.toLocaleString()} .toLocaleString()}
Channels \`${client.channels.cache.size.toLocaleString()}\` Channels \`${client.channels.cache.size.toLocaleString()}\`
Commands \`${client.commands.size}\` Commands \`${client.slashCommands.size}\`
`, `,
inline: true, inline: true,
} }

View file

@ -80,10 +80,10 @@ module.exports = {
.setThumbnail( .setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp" "https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
) )
.setFooter( .setFooter({
`Requested by ${interaction.user.tag}`, text: `Requested by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true }) iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
); });
const components = state => [ const components = state => [
new Discord.MessageActionRow().addComponents( new Discord.MessageActionRow().addComponents(
new Discord.MessageSelectMenu() new Discord.MessageSelectMenu()

View file

@ -1,6 +1,6 @@
const common = require("../util/functions/common"); const common = require("../../util/functions/common");
const data = require("../util/Data/data.json"); const data = require("../../util/Data/data.json");
const Discord = require("discord.js"); const { MessageEmbed } = require("discord.js");
let currGun, let currGun,
currStats, currStats,
@ -11,25 +11,57 @@ 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 statistics",
usage: "(Gun)", usage: "(Gun)",
category: "CODM", category: "CODM",
/** options: [
* @param {Client} client {
* @param {Message} message type: 3,
* @param {String[]} args name: "gun_name",
*/ description: "Name of the gun",
run: async (client, message, args) => { required: true,
choices: [],
},
{
type: 3,
name: "1st_attchment",
description: "First attachment",
},
{
type: 3,
name: "2nd_attchment",
description: "Second attachment",
},
{
type: 3,
name: "3rd_attchment",
description: "Third attachment",
},
{
type: 3,
name: "4th_attchment",
description: "Forth attachment",
},
{
type: 3,
name: "5th_attchment",
description: "Fifth attachment",
},
],
run: async (client, interaction, args) => {
repEmb = null;
recoilAvailable = false; recoilAvailable = false;
hasError = false; hasError = false;
const repEmb = statsHandler(args.join(" ").replace("\n", " ")); if (args.length == 1)
repEmb = statsHandler(args.join(" ").replace("\n", " "));
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
if (hasError) { if (hasError) {
message.reply({ embeds: [repEmb] }); interaction.followUp({
} content: `**${repEmb || "An error has occured"}**`,
});
} else {
if (recoilAvailable) { if (recoilAvailable) {
repEmb.fields.push({ repEmb.fields.push({
name: "**Recoil Graph**", name: "**Recoil Graph**",
@ -39,7 +71,8 @@ module.exports = {
const recoilImageLink = await chart.getShortUrl(); const recoilImageLink = await chart.getShortUrl();
repEmb.image = { url: recoilImageLink }; repEmb.image = { url: recoilImageLink };
} }
message.reply({ embeds: [repEmb] }); interaction.followUp({ embeds: [new MessageEmbed(repEmb)] });
}
}, },
}; };
@ -49,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",
@ -95,7 +128,7 @@ function statsHandler(inpmsg) {
return currGun; return currGun;
} }
currStats = currGun.stats; currStats = currGun.stats;
currDRM = currGun.drm[0]; currDRM = currGun.drm[0]; // base mag. currGun.drm[1] for more vairents
currAttachments = []; currAttachments = [];
currAttachments = common.attachmentsIdentifier(inpmsg, currGun); currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
if (typeof currAttachments == "string") { if (typeof currAttachments == "string") {
@ -155,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")}\`\`\``,
} }
: ""; : "";
} }
@ -187,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:
@ -205,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 "";
@ -224,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,
@ -249,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 },
@ -261,10 +289,9 @@ function statsHandler(inpmsg) {
color: 5814783, color: 5814783,
fields: out, fields: out,
footer: { footer: {
text: "All data courtesy of Project Lighthouse and CoDM Research Crew", text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
icon_url: icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638", "https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
}, },
}; };
} }
// console.log(statsHandler("Holger").fields);

View file

@ -63,19 +63,19 @@ client.on("interactionCreate", async interaction => {
embeds: [ embeds: [
new MessageEmbed() new MessageEmbed()
.setURL(client.web) .setURL(client.web)
.setAuthor( .setAuthor({
interaction.user.tag, name: interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true }) iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
) })
.setColor(client.color) .setColor(client.color)
.setDescription( .setDescription(
`You aren't a premium user. You can either boost support server or subscribe to developer's team [Ko-fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team to be premium user` `You aren't a premium user. You can either boost support server or subscribe to developer's team [Ko-fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team to be premium user`
) )
.setTimestamp() .setTimestamp()
.setFooter( .setFooter({
`Made by ${client.author}`, text: `Made by ${client.author}`,
client.user.displayAvatarURL() iconURL: client.user.displayAvatarURL(),
), }),
], ],
}); });
} }
@ -209,5 +209,6 @@ function sendE(e) {
.setTimestamp() .setTimestamp()
.setColor(client.color) .setColor(client.color)
.setFooter({ text: client.user.username }); .setFooter({ text: client.user.username });
interaction.channel.send({ embeds: [embed] });
client.channels.cache.get(client.config.ErrorLog).send({ embeds: [embed] }); client.channels.cache.get(client.config.ErrorLog).send({ embeds: [embed] });
} }

View file

@ -47,7 +47,7 @@ client.on("messageCreate", async message => {
}, },
{ {
name: "<a:booster:896527475063025704> **Premium**", name: "<a:booster:896527475063025704> **Premium**",
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`, value: `You can either boost the support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam).\n Another option would be to gift a nitro subscription to one of the developers.`,
inline: false, inline: false,
} }
) )

View file

@ -1,5 +1,5 @@
const NYX = require("./client/NYX"); const NYX = require("./client/NYX");
const client = new NYX(); const client = new NYX();
module.exports = client; module.exports = client;
process.on("unhandledRejection", () => {}); process.on("unhandledRejection", () => {}); // add // when need to debug
client.start(); client.start();

View file

@ -1,5 +1,7 @@
{ {
"scam": [ "scam": [
"gibthub.com",
"egift-premium.com",
"disceord.gift", "disceord.gift",
"discode.gift", "discode.gift",
"discosb.gift", "discosb.gift",