nyx

The first CODM discrod bot -- cath.exe Template
git clone https://codeberg.org/night0721/nyx
Log | Files | Refs | LICENSE

commit 40c6e29df153dd52a3082bc10a921d6d363f64cc
parent 7d986ffdef356928a27b389625feec11d484c9db
Author: night0721 <[email protected]>
Date:   Tue,  1 Feb 2022 08:29:22 +0800

stats update

Diffstat:
MCODM/stats.js | 6+-----
Mcommand/CODM/damage.js | 6+-----
Mcommand/CODM/effects.js | 6+-----
Mcommand/CODM/stats.js | 6+-----
Dipgrabber-blacklist.js | 144-------------------------------------------------------------------------------
Mutil/functions/common.js | 29++++++++++++++---------------
6 files changed, 18 insertions(+), 179 deletions(-)

diff --git a/CODM/stats.js b/CODM/stats.js @@ -97,11 +97,7 @@ function statsHandler(inpmsg) { currStats = currGun.stats; currDRM = currGun.drm[0]; currAttachments = []; - currAttachments = common.attachmentsIdentifier( - inpmsg, - currGun.aments, - currStats - ); + currAttachments = common.attachmentsIdentifier(inpmsg, currGun); if (typeof currAttachments == "string") { hasError = true; return currAttachments; diff --git a/command/CODM/damage.js b/command/CODM/damage.js @@ -39,11 +39,7 @@ function dmg(inpmsg) { } currDRM = currGun.drm[0]; currStats = currGun.stats; - currAttachments = common.attachmentsIdentifier( - inpmsg, - currGun.aments, - currStats - ); + currAttachments = common.attachmentsIdentifier(inpmsg, currGun); if (typeof currAttachments == "string") { hasError = true; return currAttachments; diff --git a/command/CODM/effects.js b/command/CODM/effects.js @@ -114,11 +114,7 @@ function attachments(inpmsg) { hasAttachments = common.hasAttachments(inpmsg); currAttachments = []; if (hasAttachments) { - currAttachments = common.attachmentsIdentifier( - inpmsg, - currGun.aments, - currGun.stats - ); + currAttachments = common.attachmentsIdentifier(inpmsg, currGun); if (typeof currAttachments == "string") { hasError = true; return currAttachments; diff --git a/command/CODM/stats.js b/command/CODM/stats.js @@ -129,11 +129,7 @@ function statsHandler(inpmsg) { currStats = currGun.stats; currDRM = currGun.drm[0]; currAttachments = []; - currAttachments = common.attachmentsIdentifier( - inpmsg, - currGun.aments, - currStats - ); + currAttachments = common.attachmentsIdentifier(inpmsg, currGun); if (typeof currAttachments == "string") { hasError = true; return currAttachments; diff --git a/ipgrabber-blacklist.js b/ipgrabber-blacklist.js @@ -1,144 +0,0 @@ -//made by the shadow himself. - -client.on('message', message => { - - const grabifyEmbed = new Discord.MessageEmbed() - grabifyEmbed.setTitle("**IP Grabber Detected!**") - grabifyEmbed.addField("**Username :** ", `${message.author.username}`) - grabifyEmbed.addField("**User ID :** ", `${message.author.id}`) - grabifyEmbed.addField("**Domain :** Grabify", `**Link sent :** ||${message}||`) - grabifyEmbed.setTimestamp() - grabifyEmbed.addField("`Tactical Protection by`", "`Team NYX`") - - const discordEmbed = new Discord.MessageEmbed() - discordEmbed.setTitle("**IP Grabber Detected!**") - discordEmbed.addField("**Username :** ", `${message.author.username}`) - discordEmbed.addField("**User ID :** ", `${message.author.id}`) - discordEmbed.addField("**Domain :** Discord", `**Link sent :** ||${message}||`) - discordEmbed.setTimestamp() - discordEmbed.addField("`Tactical Protection by`", "`Team NYX`") - - - if ((message.content.includes("https://dlscord.org/nitro-gift")) || (message.content.includes("http://dlscord.org/nitro-gift"))) { - message.delete(); - message.channel.send(discordEmbed) - } - - if ((message.content.includes("https://lovebird.guru")) || (message.content.includes("http://lovebird.guru"))) { - message.delete(); - message.channel.send(grabifyEmbed) - } - -if ((message.content.includes("https://trulove.guru")) || (message.content.includes("http://trulove.guru"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://dateing.club")) || (message.content.includes("http://dateing.club"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://shrekis.life")) || (message.content.includes("http://shrekis.life"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - -if ((message.content.includes("https://headshot.monster")) || (message.content.includes("http://headshot.monster"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://gamihg-at-my.best")) || (message.content.includes("http://gaming-at-my.best"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://progaming.monster")) || (message.content.includes("http://programing.monster"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://yourmy.monster")) || (message.content.includes("http://yourmg.monster"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://imageshare.best")) || (message.content.includes("http://imageshere.best"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - -if ((message.content.startsWith("https://screenshot.best")) || (message.content.includes("http://screenshot.best"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } -if ((message.content.includes("https://gamingfun.me")) || (message.content.includes("http://gamingfun.me"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://catsnthing.com")) || (message.content.includes("http://catsnthing.com"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - -if ((message.content.includes("https://catsnthings.fun")) || (message.content.includes("http://catsnthings.fun"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - -if ((message.content.includes("https://joinmy.site")) || (message.content.includes("http://joinmy.site"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - -if ((message.content.includes("https://fortnitechat.site")) || (message.content.includes("http://fortnitechat.site"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - -if ((message.content.includes("https://fortnight.space")) || (message.content.includes("http://fortnight.space"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - -if ((message.content.includes("https://freegiftcards.co")) || (message.content.includes("http://freegiftcards.co"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://grabify.link")) || (message.content.includes("http://grabify.link"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - -if ((message.content.includes("https://partpicker.shop")) || (message.content.includes("http://partpicker.shop"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://websafe.online")) || (message.content.includes("http://websafe.online"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://sportshub.bar")) || (message.content.includes("http://sportshub.bar"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://herald.sbs")) || (message.content.includes("http://herald.sbs"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - - if ((message.content.includes("https://locations.quest")) || (message.content.includes("http://locations.quest"))) { - message.delete(); - message.channel.send(grabifyEmbed); - } - -}); - -//MORE DOMAINS COMING IN A WEEK HEHE BOI diff --git a/util/functions/common.js b/util/functions/common.js @@ -170,13 +170,15 @@ function weaponIdentifier(inpmsg) { } else return `Couldn't identify the weapon: "${inpWeaponName}"`; } // identifying attachments and return array or error -function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) { +function attachmentsIdentifier(inpmsg, gun) { if (!hasAttachments(inpmsg)) return []; // no need for isolator because using slash commands, we get individual attachment let inputAttachmentsNames = isolator(inpmsg)[1] .split(/ & |, |,| and /) .filter(x => x); + const tooSmall = inputAttachmentsNames.filter(x => x.length < 3); + // filter all elements thats shorter than 2 characters inputAttachmentsNames = inputAttachmentsNames.filter(x => !(x.length < 3)); let errorMsgs = "", errors = [], @@ -184,25 +186,24 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) { if (inputAttachmentsNames.length == 0) errorMsgs += "\nAttachments are missing!\n"; - - if (inputAttachmentsNames.length >= 10) return "Cocaineeeeee"; + // if (inputAttachmentsNames.length >= 10) return "Cocaineeeeee"; ????????? // Can directly use args[] to return, no need for isolator, partExtractor, inpFixer const splitAttachmentsDataName = [], outAttachments = []; - for (let i = 0; i < attachmentsData.length; i++) { + for (let i = 0; i < gun.aments.length; i++) { splitAttachmentsDataName.push([ ...new Set( - attachmentsData[i].name + gun.aments[i].name .split(" ") .filter(x => x) .map(x => x.trim()) ), ]); - if (Math.max(...splitAttachmentsDataName.map(x => x.length)) > 6) { - return "Cocaineeeeee"; - } + // if (Math.max(...splitAttachmentsDataName.map(x => x.length)) > 6) { + // return "Cocaineeeeee"; + // } ??????????????????? Thats not gonna happen right? for (let j = 0; j < splitAttachmentsDataName[i].length; j++) { splitAttachmentsDataName[i][j] = splitAttachmentsDataName[i][j].Simplify(); @@ -249,9 +250,9 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) { ) ) { var tmp1 = parseInt(inputAttachmentsNames[i]); - const tmp2 = attachmentsData.filter( + const tmp2 = gun.aments.filter( x => - x.type === 8 && x.effects[27] + x.effects[28] + inpStats[17] === tmp1 + x.type === 8 && x.effects[27] + x.effects[28] + gun.stats[17] === tmp1 ); if (tmp2.length === 1) { outAttachments.push(tmp2[0]); @@ -298,9 +299,7 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) { var curr = probables[probables.length - 1]; const temp1 = probables[probables.length - 1].filter( - x => - attachmentsData[x].name.Simplify() == - inputAttachmentsNames[i].Simplify() + x => gun.aments[x].name.Simplify() == inputAttachmentsNames[i].Simplify() ); const temp2 = probables[probables.length - 1].filter( x => @@ -324,7 +323,7 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) { errors.push( "`" + curr - .map(x => attachmentsData[x].name) + .map(x => gun.aments[x].name) .reduce((out, x, i) => [out, x].join(i === curr.length - 1 ? "` or `" : "`, `") ) + @@ -333,7 +332,7 @@ function attachmentsIdentifier(inpmsg, attachmentsData, inpStats) { '"`' ); } - outAttachments.push(attachmentsData[probables[probables.length - 1][0]]); + outAttachments.push(gun.aments[probables[probables.length - 1][0]]); } const outAttachmentsTypes = outAttachments.map(x => x.type - 1), t1 = outAttachments