nyx

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

commit 0043da66dfcd60f703337809efcf39b2931ba162
parent 04fc41214728a69324a2a2817309a5b50865b0e7
Author: ThunderE75 <[email protected]>
Date:   Sat, 22 Jan 2022 18:46:16 +0530

Merge branch 'main' into dev

Diffstat:
M.github/README.md | 15++++++++-------
DCODM/class.js | 55-------------------------------------------------------
DCODM/damage.js | 118-------------------------------------------------------------------------------
DCODM/effects.js | 168-------------------------------------------------------------------------------
DCODM/sgrelo.js | 111-------------------------------------------------------------------------------
Mclient/NYX.js | 2+-
Mcommand/CODM/build.js | 8++++----
Mcommand/CODM/damage.js | 2+-
Acommand/CODM/watermark.js | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dcommand/Giveaway/giveaway.js | 144-------------------------------------------------------------------------------
Dcommand/Information/botinfo.js | 79-------------------------------------------------------------------------------
Dcommand/NSFW/milf.js | 40----------------------------------------
Dcommand/NSFW/thighs.js | 42------------------------------------------
Mcommand/Owner/guilds.js | 12++++++++++++
Dcommand/Utilities/codebin.js | 17-----------------
Dcommand/Utilities/shorturl.js | 35-----------------------------------
Mconfig.js | 6+++---
Mevents/ready.js | 2+-
Mpackage.json | 12++++++------
Ascorestreak.js | 181+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rcommand/Fun/choose.js -> unused/commands/Fun/choose.js | 0
Rcommand/Fun/fun.js -> unused/commands/Fun/fun.js | 0
Rcommand/Fun/hack.js -> unused/commands/Fun/hack.js | 0
Rcommand/Fun/image.js -> unused/commands/Fun/image.js | 0
Rcommand/Fun/kiss.js -> unused/commands/Fun/kiss.js | 0
Rcommand/Fun/rps.js -> unused/commands/Fun/rps.js | 0
Aunused/commands/Giveaway/giveaway.js | 144+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rcommand/Information/banner.js -> unused/commands/Information/banner.js | 0
Aunused/commands/Information/botinfo.js | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rcommand/Information/serverinfo.js -> unused/commands/Information/serverinfo.js | 0
Aunused/commands/Utilities/codebin.js | 17+++++++++++++++++
Rcommand/Utilities/docs.js -> unused/commands/Utilities/docs.js | 0
Aunused/commands/Utilities/shorturl.js | 35+++++++++++++++++++++++++++++++++++
Mutil/Data/scam.json | 1+
34 files changed, 599 insertions(+), 832 deletions(-)

diff --git a/.github/README.md b/.github/README.md @@ -18,18 +18,18 @@ <a href="https://rebrand.ly/cathSupport"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner2" alt="Support Server" /></a> </p> - <!-- description --> -**NYX** *(previously known as Cath)* is a first and only **COD Mobile Statistics & Gunsmith** Bot which also doubles as a multipurpose discord bot with many features that include but are not limited to Moderation, Music and Economy. <br> +**NYX** _(previously known as Cath)_ is a first and only **COD Mobile Statistics & Gunsmith** Bot which also doubles as a multipurpose discord bot with many features that include but are not limited to Moderation, Music and Economy. <br> The Call of Duty Stats are courtesy of **Round Table** by Cygnoux Familia.<br><br> If you like this bot, feel free to :star: **Star** this repository.<br> > ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed -<br> +> <br> + +# Features -# Features -> *This is a Non-Exhaustive list for commands. To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands).* +> _This is a Non-Exhaustive list for commands. To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands)._ <a href="https://thunder75.gitbook.io/cath-bot/core/commands" ><img src="https://img.shields.io/static/v1?label=List %20OF&message=Commands&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a> @@ -60,7 +60,6 @@ If you like this bot, feel free to :star: **Star** this repository.<br> A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment). - <!-- <details> <summary>Made With</summary> @@ -97,7 +96,7 @@ You can report bugs or issues by opening a issue in this repository. Alternateve <a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a> </p> -<h1 align="center"> Contributors </h1> +<h1 align="center"> Contributors </h1> Contributions are always welcomed, but make sure to read [Contributing.md](/CONTRIBUTING.md) first. @@ -108,5 +107,7 @@ Contributions are always welcomed, but make sure to read [Contributing.md](/CONT <p align = "center"> <a href="https://discord.gg/mjVwkCsWY7" target="_blank"><img src="https://discordapp.com/api/guilds/756525751594909797/widget.png?style=banner1"></a> </p> --> + β € + <!-- <img src="https://socialify.git.ci/night0721/cath.exe/image?description=1&descriptionEditable=A%20Discord.js%20v13%20Template%20based%20on%20cath.exe&font=Raleway&forks=1&issues=1&language=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark"> --> diff --git a/CODM/class.js b/CODM/class.js @@ -1,55 +0,0 @@ -const { MessageEmbed } = require("discord.js"); -const model = require("../../models/weapons"); -const Attachments = require("../../util/Data/attachments.json"); -module.exports = { - name: "class", - description: "Generate random class in CODM", - category: "CODM", - run: async (client, message, args) => { - const data = async () => { - const d = await model.findOne({}); - const types = d.Categories; - const names = d.Primary; - const category = types[Math.floor(Math.random() * types.length)]; - const weapons = names[0][category]; - return `${weapons[Math.floor(Math.random() * weapons.length)]}`; - }; - const primary_weapon = await data(); - const primary = primary_weapon.replace(/[ -]/g, "_").replace(/\./g, ""); - const slots = shuffle(Object.keys(Attachments[primary][0])); - const slot_1 = slots.next().value, - slot_2 = slots.next().value, - slot_3 = slots.next().value, - slot_4 = slots.next().value, - slot_5 = slots.next().value; - const result = new MessageEmbed() - .setColor(client.color) - .setTitle(`🎲Random Class of ${primary_weapon}🎲`) - .setDescription( - `**Attachments**\n**${getAttachment( - primary, - slot_1, - )}**\n**${getAttachment(primary, slot_2)}**\n**${getAttachment( - primary, - slot_3, - )}**\n**${getAttachment(primary, slot_4)}**\n**${getAttachment( - primary, - slot_5, - )}**`, - ) - .setURL(client.web) - .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) - .setTimestamp(); - message.reply({ embeds: [result] }); - function* shuffle(array) { - let i = array.length; - while (i--) { - yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0]; - } - } - function getAttachment(gun, slot) { - const ca = Attachments[gun][0][slot]; - return ca[Math.floor(Math.random() * ca.length)]; - } - }, -}; diff --git a/CODM/damage.js b/CODM/damage.js @@ -1,118 +0,0 @@ -const common = require("../../util/functions/common"); -let currGun = {}, - currStats = [], - currAttachments = {}, - currDRM = {}, - totalEffects = [], - interpretion = "", - hasError = false; -const errMsg = "*Generic placeholder error message*"; - -module.exports = { - name: "damage", - description: "Check gun damage", - usage: "(Gun)", - category: "CODM", - run: async (client, message, args) => { - const repEmb = dmg(args.join(" ").replace("\n", " ")); - if (hasError) { - message.reply({ embeds: [repEmb] }); - } - else { - message.channel.send({ embeds: [repEmb] }); - } - }, -}; - -function dmg(inpmsg) { - currGun = common.weaponIdentifier(inpmsg); - if (typeof currGun == "string") { - hasError = true; - return currGun; - } - currDRM = currGun.drm[0]; - currStats = currGun.stats; - currAttachments = common.attachmentsIdentifier( - inpmsg, - currGun.aments, - currStats, - ); - if (typeof currAttachments == "string") { - hasError = true; - return currAttachments; - } - if (currAttachments.length) { - totalEffects = common.totaler(currAttachments); - currDRM = currGun.drm[totalEffects[37]]; - currDRM.range = currDRM.range.map( - x => (x * (totalEffects[13] + 100)) / 100, - ); - currStats = common.updateStatswithEffects(totalEffects, currStats); - } - const mn = [ - "Head", - "Neck", - "Upper Chest", - "Lower Chest", - "Shoulders", - "Upper Arms", - "Lower Arms", - "Stomach", - "Belly Button", - "Crotch", - "Thighs", - "Calf Muscles", - "Feet", - ], - m1 = currDRM.bodymultiplier, - m2 = [...new Set(m1)], // [1.2, 1, 0.9] - m3 = m1.map(x => m2.indexOf(x)), // [0, 1, 1, 1, 1, 1, 2, 2, 2] - m4 = m2 - .map(x => - m3 - .map((y, i) => { - if (x === m2[y]) { - return mn[i]; - } - }) - .filter(y => y), - ) - .map(x => - x.length === m1.length - ? ["All"] - : x.length === m1.length - 1 - ? ["Others"] - : x, - ); - interpretion = currGun.gunname + common.interpretioner(currAttachments); - return { - title: "**" + interpretion + "**", - color: 4849497, - fields: m4.map((x, i) => { - return { - name: x.join(", ") + ":", - value: common.damageHandler( - currDRM.damage, - currDRM.range, - m2[i], - 100, - 60000 / currStats[5], - currStats[7], - currStats[6], - currStats[0], - ), - }; - }), - footer: { - text: "All the stats courtesy of Project Lighthouse", - icon_url: - "https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638", - }, - }; -} -// console.log(dmg("47 + mono")); -/* console.log(dmg("47")); -console.log(dmg("striker + choke")); -console.log(dmg("striker + choke")); -console.log(dmg("striker")); -common.makeError();*/ diff --git a/CODM/effects.js b/CODM/effects.js @@ -1,168 +0,0 @@ -const common = require("../util/functions/common"); -const data = require("../util/Data/data.json"); - -let currGun, currAttachments, interpretion, hasError; -const errMsg = "*Generic placeholder error message*"; - -module.exports = { - name: "effects", - description: "Check gun effects", - usage: "(Gun)", - category: "CODM", - aliases: ["attachements"], - /** - * @param {Client} client - * @param {Message} message - * @param {String[]} args - */ - run: async (client, message, args) => { - const repEmb = attachments(args.join(" ").replace("\n", " ")); - if (hasError) { - message.reply({ embeds: [repEmb] }); - } else { - message.channel.send({ embeds: [repEmb] }); - } - }, -}; - -function attachments(inpmsg) { - const out = "", - at = data.attachmentTypes.map(x => (x.slice(-1) === "s" ? x : x + "s")); - if (inpmsg.includes("+") && inpmsg.includes(":")) { - hasError = true; - return "Bro, can u liek, not do that?"; - } - if (inpmsg.includes(":")) { - const inpAll = inpmsg - .split(":") - .map(x => x.trim()) - .filter(x => x), - inpType = inpAll.length === 2 ? inpAll[1] : null; - if (!inpType) { - hasError = true; - return inpAll.length < 2 - ? "Empty " + (inpAll[0] ? "" : "weapon name and ") + "attachment type" - : "Multiple `:`s detected"; - } - currGun = common.weaponIdentifier(inpAll[0]); - if (typeof currGun == "string") { - hasError = true; - return currGun; - } - let currAttachmentsType = at.filter(x => simplify(x) == simplify(inpType)); - currAttachmentsType = currAttachmentsType.length - ? currAttachmentsType - : at.filter( - x => simplify(x.substring(0, x.length - 1)) == simplify(inpType) - ); - currAttachmentsType = currAttachmentsType.length - ? currAttachmentsType - : at.filter(x => simplify(x).includes(simplify(inpType))); - if (currAttachmentsType.length === 0) { - hasError = true; - return "Couldn't identify `" + inpType + "`"; - } else if (currAttachmentsType.length === 1) { - currAttachmentsType = at.indexOf(currAttachmentsType[0]); - } else { - hasError = true; - return ( - "Did you mean `" + - currAttachmentsType.reduce((out, x, i) => - [out, x].join( - i === currAttachmentsType.length - 1 ? "` or `" : "`, `" - ) - ) + - "`" - ); - } - return { - title: currGun.gunname, - color: 11348938, - fields: [ - { - name: - "**" + - currGun.gunname + - "** has the following " + - at[currAttachmentsType], - value: - "```\n" + - currGun.aments - .filter(x => x.type - 1 === currAttachmentsType) - .map(x => x.name) - .join("\n") + - "```", - }, - ], - footer: { - text: "All the stats courtesy of Project Lighthouse", - icon_url: - "https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638", - }, - }; - function simplify(v) { - return v.toLowerCase().replace(/[^0-9a-z]/g, ""); - } - } - currGun = common.weaponIdentifier(inpmsg); - if (typeof currGun == "string") { - hasError = true; - return currGun; - } - hasAttachments = common.hasAttachments(inpmsg); - currAttachments = []; - if (hasAttachments) { - currAttachments = common.attachmentsIdentifier( - inpmsg, - currGun.aments, - currGun.stats - ); - if (typeof currAttachments == "string") { - hasError = true; - return currAttachments; - } - return { - title: currGun.gunname + common.interpretioner(currAttachments), - color: 11348938, - fields: common.attachmentHandler( - common.totaler(currAttachments), - currGun.stats - ), - footer: { - text: "All the stats courtesy of Project Lighthouse", - icon_url: - "https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638", - }, - }; - } else { - const availableAttachmentTypes = [ - ...new Set(currGun.aments.map(x => x.type)), - ]; - return { - title: currGun.gunname, - color: 11348938, - fields: [ - { - name: - "**" + currGun.gunname + "** has the following attachment types:", - value: - "```\n" + - availableAttachmentTypes.map(x => at[x - 1]).join(",\n") + - "```", - }, - ], - footer: { - text: "All the stats courtesy of Project Lighthouse", - icon_url: - "https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638", - }, - }; - } -} -// console.log(attachments("Peacekeeper:muzzle")); //common.makeError(); -/* console.log(attachments(":")); //common.makeError(); -console.log(attachments("47:optics")); //common.makeError(); -console.log(attachments("47")); //common.makeError(); -console.log(attachments("47 + ")); //common.makeError(); -console.log(attachments("47 + :")); //common.makeError(); -console.log(attachments("47 + red dot")); common.makeError();*/ diff --git a/CODM/sgrelo.js b/CODM/sgrelo.js @@ -1,111 +0,0 @@ -module.exports = { - name: "sgrelo", - descriptiom: "Calculate reload time for shotgun", - run: async (client, message, args) => { - let err = "", - wrn = "", - interpretedAs = []; - function mather(inp) { - const inpArr = interpreter(inp), - outArr = []; - inpArr.map((x, i, a) => { - for (let j = i + 1; j < a.length; j++) { - outArr.push(worker(x, a[j])); - } - }); - const aArr = outArr.map(x => x.a), - iArr = outArr.map(x => x.i); - return ( - "Input: `" + - interpretedAs.join("`, `") + - "`" + - (aArr.length == 1 - ? "\nOpening and Closing Animation Time: " + - beautifier(aArr[0]) + - "\nReload Time: " + - beautifier(iArr[0]) - : "\nAll Opening and Closing Animation Time: " + - aArr.map(x => beautifier(x)).join(", ") + - "\nAll Reload Time: " + - iArr.map(x => beautifier(x)).join(", ") + - "\nAverage Opening and Closing Animation Time: " + - beautifier(aArr.reduce((t, x) => t + x, 0) / aArr.length) + - "\nAverage Reload Time: " + - beautifier(iArr.reduce((t, x) => t + x, 0) / iArr.length)) - ); - } - - function interpreter(inp) { - let out = [ - ...new Set( - inp - .split(/\n|, |,/g) - .filter(x => x) - .map(x => x.toLowerCase().replace(/[^0-9a-z]/g, "")) - ), - ]; - out = out - .map(x => { - interpretedAs.push(x); - const obj = { - b: 0, - f: 0, - }; - if ( - x.split(/b/g).length > 2 || - x.split(/f/g).length > 2 || - x.split(/[a-z]/g).length > 3 - ) { - err += "Unknown identifier `" + x + "`\n"; - } else if (x.indexOf("b") === -1 || x.indexOf("f") === -1) { - err += "Missing identifier `" + x + "`\n"; - } else if (x.indexOf("b") === x.length - 1) { - obj.b = parseFloat(x.split("f")[1].trim()); - obj.f = parseFloat(x.split("f")[0].trim()); - } else if (x.indexOf("f") === x.length - 1) { - obj.b = parseFloat(x.split("b")[0].trim()); - obj.f = parseFloat(x.split("b")[1].trim()); - } else { - err += "Unknown identifier `" + x + "`\n"; - } - if (!obj.b && obj.f) { - err += "Couldn't interpret `" + x + "`\n"; - } else if (!Number.isInteger(obj.b)) { - err += "Decimal bullet count found `" + x + "`\n"; - } else if (!Number.isInteger(obj.f)) { - wrn += "Decimal value found `" + x + "`\n"; - } - return obj; - }) - .filter(x => JSON.stringify(x).length && x); - if (out.length === 1) { - err += "Single equation found\n"; - } - return err || !out.length ? [] : out; - } - - function worker(o1, o2) { - const out = { - i: 0, - a: 0, - }; - out.i = (o1.f - o2.f) / (o1.b - o2.b); - out.a = o1.f - out.i * o1.b; - return out; - } - - function beautifier(num) { - return parseFloat(num.toFixed(2)).toString() + "s"; - } - - const msg = mather(args.join(" ")); - - if (err !== "") { - message.reply(err); - } else if (wrn !== "") { - message.reply({ content: wrn + "\n" + msg }); - } else { - message.channel.send({ content: msg }); - } - }, -}; diff --git a/client/NYX.js b/client/NYX.js @@ -14,7 +14,7 @@ class NYX extends Client { presence: { activities: [ { - name: `v${require("../package.json").version} | /help`, + name: `/help`, type: "STREAMING", url: "https://www.youtube.com/watch?v=YSKDu1gKntY", }, diff --git a/command/CODM/build.js b/command/CODM/build.js @@ -116,7 +116,7 @@ module.exports = { }, { name: "Jokesta", - value: "jokesta", + value: "jokesta",D }, // { // name: "Stats On Duty", @@ -768,9 +768,9 @@ module.exports = { }, } ) - .then((res) => res.data) - .catch(); - if (!data) { + .then(res => res.data) + .catch(e => null); + if (!data?.ID) { const embed = new MessageEmbed() .setDescription( `<:nyx_not_available:897378400031879188> We don't have a ${all[tag]} **${allguns[gun]}** gunsmith build by **${all[cc]}**, Please try another tag or a differnt content creator` diff --git a/command/CODM/damage.js b/command/CODM/damage.js @@ -15,7 +15,7 @@ module.exports = { category: "CODM", options: [ { - type: 7, + type: 3, name: "gun", description: "Gun name", required: true, diff --git a/command/CODM/watermark.js b/command/CODM/watermark.js @@ -0,0 +1,106 @@ +const axios = require("axios"); +const { MessageAttachment } = require("discord.js"); +module.exports = { + name: "watermark", + description: "Add a water to leaks", + options: [ + { + type: 3, + name: "photo", + description: "Link of photo", + required: true, + }, + { + type: 3, + name: "position", + description: "Where you want to place the water mark", + required: true, + choices: [ + { + name: "Middle", + value: "middle", + }, + { + name: "ButtomRight", + value: "buttomright", + }, + ], + }, + { + type: 3, + name: "opacity", + description: + "Opacity of watermark(50 - 100) Lower or higher will be ignored", + required: true, + }, + { + type: 3, + name: "logo", + description: "The Logo you want to use", + required: true, + choices: [ + { + name: "Discord Nicecat", + value: "discord_nicecat", + }, + { + name: "NoLink Leakers", + value: "nolink_leakers", + }, + { + name: "Discord Leakers", + value: "discord_leakers", + }, + { + name: "DogeBeanie", + value: "doge", + }, + { + name: "CODM N3W3", + value: "n3w3", + }, + { + name: "Alyan Gaming", + value: "alyan", + }, + { + name: "Murdablast", + value: "murdablast", + }, + { + name: "Sasha", + value: "sasha", + }, + { + name: "Umair Gamer", + value: "umair", + }, + ], + }, + { + type: 3, + name: "password", + description: "The password in order to use this command", + required: true, + }, + ], + run: async (client, interaction, args) => { + const data = await axios + .get( + `${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&opacity=${args[2]}&logo=${args[3]}&password=${args[4]}` + ) + .then(res => res.data) + .catch(); + if (!data) { + interaction.followUp({ + content: "You have either wrong input or you are unauthorized", + }); + } else { + const ima = new MessageAttachment( + `${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&opacity=${args[2]}&logo=${args[3]}&password=${args[4]}`, + `${args[2]}.png` + ); + interaction.followUp({ files: [ima] }); + } + }, +}; diff --git a/command/Giveaway/giveaway.js b/command/Giveaway/giveaway.js @@ -1,144 +0,0 @@ -const GiveawaysClient = require("../../client/GiveawaysClient"); -module.exports = { - name: "giveaway", - description: "Giveaway", - UserPerms: ["MANAGE_MESSAGES"], - options: [ - { - type: "SUB_COMMAND", - name: "start", - description: "Start a giveaway", - options: [ - { - type: 3, - name: "prize", - description: "The prize of the giveaway", - required: true, - choices: [], - }, - { - type: 4, - name: "winners", - description: "The amount of winners of the giveaway", - required: true, - }, - { - type: 3, - name: "time", - description: "The amount of time of the giveaway", - required: true, - }, - { - type: 7, - name: "channel", - description: "The channel of the giveaway", - required: true, - channelTypes: ["GUILD_TEXT"], - }, - { - type: 8, - name: "role1", - description: "The required role to join the giveaway", - }, - { - type: 8, - name: "role2", - description: "The required role to join the giveaway", - }, - { - type: 8, - name: "role3", - description: "The required role to join the giveaway", - }, - ], - }, - { - type: "SUB_COMMAND", - name: "reroll", - description: "Reroll a giveaway", - options: [ - { - type: 3, - name: "message", - description: "The message ID of the giveaway", - required: true, - choices: [], - }, - ], - }, - { - type: "SUB_COMMAND", - name: "end", - description: "End a giveaway", - options: [ - { - type: 3, - name: "message", - description: "The message ID of the giveaway", - required: true, - choices: [], - }, - ], - }, - ], - run: async (client, interaction, args, utils) => { - if (args[0] == "start") { - const [, prize, winners, time, channel, roles1, roles2, roles3] = args; - if (!utils.ms(time)) { - interaction.followUp({ - content: "Time must be a valid time to parse (Example: 10m, 100s)", - }); - } - await GiveawaysClient.create(client, { - prize, - host: interaction.user.id, - winners, - endAfter: time, - requirements: roles1 - ? { - Enabled: true, - Roles: [roles1], - } - : roles2 && roles1 - ? { - Enabled: true, - Roles: [roles1, roles2], - } - : roles1 && roles2 && roles3 - ? { - Enabled: true, - Roles: [roles1, roles2, roles3], - } - : { Enabled: false }, - Channel: channel, - }); - interaction.followUp({ - content: `Giveaway is started in ${interaction.guild.channels.cache.get( - channel - )}`, - }); - } else if (args[0] == "reroll") { - const giveaway = await GiveawaysClient.getByMessage(args[1]); - const m = await client.guilds.cache - .get(giveaway.Guild) - .channels.cache.get(giveaway.Channel) - .messages.fetch(args[1]); - if (!m) { - interaction.followUp({ content: "Unable to find the giveaway ⚠" }); - } else { - await GiveawaysClient.end(m, giveaway, m); - } - } else { - const giveaway = await GiveawaysClient.getByMessage(args[1]); - const m = await client.guilds.cache - .get(giveaway.Guild) - .channels.cache.get(giveaway.Channel) - .messages.fetch(args[1]); - if (!m) { - interaction.followUp({ content: "Unable to find the giveaway ⚠" }); - } else { - await GiveawaysClient.end(m, giveaway, m); - } - } - }, -}; diff --git a/command/Information/botinfo.js b/command/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/command/NSFW/milf.js b/command/NSFW/milf.js @@ -1,40 +0,0 @@ -const { MessageEmbed } = require("discord.js"); -const { getreddit } = require("cath"); -module.exports = { - name: "milf", - description: "Get some milf 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 = ["milf", "OnlyHotMilfs", "realmoms"]; - 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/thighs.js b/command/NSFW/thighs.js @@ -1,42 +0,0 @@ -const { MessageEmbed } = require("discord.js"); -const { getreddit } = require("cath"); -module.exports = { - name: "thighs", - description: "Get some thighs 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 = ["thighs", "PerfectThighs", "thickthighs"]; - 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/guilds.js b/command/Owner/guilds.js @@ -31,6 +31,18 @@ module.exports = { } ) .setColor(client.color) + .addFields( + { + name: `Total Guilds`, + value: client.guilds.cache.size, + inline: true, + }, + { + name: `Total Members`, + value: client.users.cache.size, + inline: true, + } + ) .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setTimestamp(); interaction.followUp({ embeds: [embed] }); diff --git a/command/Utilities/codebin.js b/command/Utilities/codebin.js @@ -1,17 +0,0 @@ -const CodeClient = require("../../client/CodeClient"); -module.exports = { - name: "Create Code Bin", - type: "MESSAGE", - run: async (client, interaction) => { - const msg = await interaction.channel.messages.fetch(interaction.targetId); - if (!msg.content) { - interaction.followUp({ content: "The message must have a content" }); - } else { - const title = "Code"; - const description = msg.author.tag; - const code = msg.content; - const link = await CodeClient.createBin(title, description, code); - interaction.followUp({ content: link }); - } - }, -}; diff --git a/command/Utilities/shorturl.js b/command/Utilities/shorturl.js @@ -1,35 +0,0 @@ -const URLClient = require("../../client/URLClient"); -module.exports = { - name: "shorten-url", - description: "Shorten a URL", - options: [ - { - type: 3, - name: "short-name", - description: - "The short name that for the shorten-url (For example, https://url.cath.gq/youtube)", - required: true, - }, - { - type: 3, - name: "link", - description: - "The link for the shorten-url (For example, https://youtube.com)", - required: true, - }, - ], - run: async (client, interaction, args) => { - if (!args[1].includes("https://")) { - interaction.followUp({ content: "The link must contain 'https://'" }); - } else { - const shortName = args[0]; - const targetURL = args[1]; - const cc = await URLClient.createShortURL(shortName, targetURL); - if (!cc) { - interaction.followUp({ content: `URL already exist` }); - } else { - interaction.followUp({ content: `https://url.cath.gq/${cc}` }); - } - } - }, -}; diff --git a/config.js b/config.js @@ -10,8 +10,8 @@ module.exports = { ErrorLog: "900509758786773022", ServerLog: "848613714537873518", Lavalink: { - Host: "lavalink.darrennathanael.com", - Port: 2095, - Password: "whatwasthelastingyousaid", + Host: "lavalink-repl.thunderemperor.repl.co", + Port: 443, + Password: "0638xxtXRH887UQQ", }, }; diff --git a/events/ready.js b/events/ready.js @@ -13,5 +13,5 @@ client.on("ready", async () => { }; }) ); - console.log(`${client.user.username} βœ…\nVersion: v${version}`); + console.log(`${client.user.username} βœ…`); }); diff --git a/package.json b/package.json @@ -1,6 +1,6 @@ { "name": "cath.exe", - "version": "3.4.0", + "version": "0.0.1", "description": "NYX bot created by Team NYX", "engines": { "node": "*", @@ -37,18 +37,18 @@ "url": "https://ko-fi.com/cathteam" }, "devDependencies": { - "node": "^17.1.0" + "node": "^17.3.0" }, "dependencies": { "axios": "^0.24.0", "cath": "^1.4.6", - "discord.js": "^13.3.1", - "dotenv": "^10.0.0", + "discord.js": "^13.5.1", + "dotenv": "^11.0.0", "erela.js": "^2.3.3", "erela.js-spotify": "^1.2.0", "goosecache": "^9.0.14", "moment": "^2.29.1", - "mongoose": "^5.13.13", - "quickchart-js": "^1.4.2" + "mongoose": "^5.13.14", + "quickchart-js": "^2.0.3" } } diff --git a/scorestreak.js b/scorestreak.js @@ -0,0 +1,181 @@ +const { MessageEmbed } = require("discord.js"); +const { CODMClient } = require("cath"); +const c = new CODMClient("Gae"); +module.exports = { + name: "scorestreak", + description: "Get Scorestreak stats", + type: "CHAT_INPUT", + usage: "{Scorestreak}", + category: "CODM", + options: [ + { + type: "SUB_COMMAND", + name: "lethal", + description: "Lethal Scorestreak", + options: [ + { + type: 3, + name: "scorestreak", + description: "Select a lethal scorestreak", + required: true, + choices: [ + { + name: "Shield Turret", + value: "shieldturret", + }, + { + name: "Hunter Killer Drone", + value: "hunterkillerdrone", + }, + { + name: "MQ-27 Dragonfire", + value: "mq27dragonfire", + }, + { + name: "Predator Missile", + value: "predatormissile", + }, + { + name: "Hawk X3", + value: "hawkx3", + }, + { + name: "Sentry Gun", + value: "sentrygun", + }, + { + name: "Lightning Strike", + value: "lightningstrike", + }, + { + name: "Orbital Laser", + value: "orbitallaser", + }, + { + name: "XS1 Goliath", + value: "xs1goliath", + }, + { + name: "Cluster Strike", + value: "clusterstrike", + }, + { + name: "XS1 Goliath", + value: "xs1goliath", + }, + { + name: "Stealth Chopper", + value: "stealthchopper", + }, + { + name: "Swarm", + value: "swarm", + }, + { + name: "Napalm", + value: "napalm", + }, + { + name: "VTOL", + value: "vtol", + }, + ], + }, + ], + }, + { + type: "SUB_COMMAND", + name: "support", + description: "Support Scorestreak", + options: [ + { + type: 3, + name: "scorestreak", + description: "Select a Support Scorestreak", + required: true, + choices: [ + { + name: "UAV", + value: "uav", + }, + { + name: "Shock RC", + value: "shockrc", + }, + { + name: "Care Package", + value: "carepackage", + }, + { + name: "Counter UAV", + value: "cuav", + }, + { + name: "SAM Turret", + value: "samturret", + }, + { + name: "Advance UAV", + value: "auav", + }, + { + name: "EMP Systems", + value: "empsystems", + }, + ], + }, + ], + }, + ], + run: async (client, interaction, args) => { + const val = args[1]; + const d = await c.getscorestreak(val); + const embed = new MessageEmbed() + .setTitle(d.scorestreak) + .setURL(d.preview_video) + .setDescription(`\`\`\`${d.description}\`\`\``) + .addFields( + { + name: "Cost", + value: `\`\`\`${d.cost}\`\`\``, + inline: true, + }, + { + name: "Lethal", + value: ` + ${ + d.lethal == true + ? "<a:nyx_checkmark:897240322411724841> Yes" + : "<a:nyx_cross:897244999211696198> No" + }`, + inline: true, + }, + { + name: "AI-Assisted", + value: ` + ${ + d.manual == false + ? "<a:nyx_checkmark:897240322411724841> Yes" + : "<a:nyx_cross:897244999211696198> No" + }`, + inline: true, + }, + { + name: "More Info", + value: `\`\`\`${d.special}\`\`\``, + inline: false, + } + ) + .setThumbnail(`${d.preview}`) + .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) + .setColor( + d.type == "lethal" + ? "FF2222" + : d.type == "support" + ? "22FF4A" + : client.color + ) + .setTimestamp(); + interaction.followUp({ embeds: [embed] }); + }, +}; diff --git a/command/Fun/choose.js b/unused/commands/Fun/choose.js diff --git a/command/Fun/fun.js b/unused/commands/Fun/fun.js diff --git a/command/Fun/hack.js b/unused/commands/Fun/hack.js diff --git a/command/Fun/image.js b/unused/commands/Fun/image.js diff --git a/command/Fun/kiss.js b/unused/commands/Fun/kiss.js diff --git a/command/Fun/rps.js b/unused/commands/Fun/rps.js diff --git a/unused/commands/Giveaway/giveaway.js b/unused/commands/Giveaway/giveaway.js @@ -0,0 +1,144 @@ +const GiveawaysClient = require("../../../client/GiveawaysClient"); +module.exports = { + name: "giveaway", + description: "Giveaway", + UserPerms: ["MANAGE_MESSAGES"], + options: [ + { + type: "SUB_COMMAND", + name: "start", + description: "Start a giveaway", + options: [ + { + type: 3, + name: "prize", + description: "The prize of the giveaway", + required: true, + choices: [], + }, + { + type: 4, + name: "winners", + description: "The amount of winners of the giveaway", + required: true, + }, + { + type: 3, + name: "time", + description: "The amount of time of the giveaway", + required: true, + }, + { + type: 7, + name: "channel", + description: "The channel of the giveaway", + required: true, + channelTypes: ["GUILD_TEXT"], + }, + { + type: 8, + name: "role1", + description: "The required role to join the giveaway", + }, + { + type: 8, + name: "role2", + description: "The required role to join the giveaway", + }, + { + type: 8, + name: "role3", + description: "The required role to join the giveaway", + }, + ], + }, + { + type: "SUB_COMMAND", + name: "reroll", + description: "Reroll a giveaway", + options: [ + { + type: 3, + name: "message", + description: "The message ID of the giveaway", + required: true, + choices: [], + }, + ], + }, + { + type: "SUB_COMMAND", + name: "end", + description: "End a giveaway", + options: [ + { + type: 3, + name: "message", + description: "The message ID of the giveaway", + required: true, + choices: [], + }, + ], + }, + ], + run: async (client, interaction, args, utils) => { + if (args[0] == "start") { + const [, prize, winners, time, channel, roles1, roles2, roles3] = args; + if (!utils.ms(time)) { + interaction.followUp({ + content: "Time must be a valid time to parse (Example: 10m, 100s)", + }); + } + await GiveawaysClient.create(client, { + prize, + host: interaction.user.id, + winners, + endAfter: time, + requirements: roles1 + ? { + Enabled: true, + Roles: [roles1], + } + : roles2 && roles1 + ? { + Enabled: true, + Roles: [roles1, roles2], + } + : roles1 && roles2 && roles3 + ? { + Enabled: true, + Roles: [roles1, roles2, roles3], + } + : { Enabled: false }, + Channel: channel, + }); + interaction.followUp({ + content: `Giveaway is started in ${interaction.guild.channels.cache.get( + channel + )}`, + }); + } else if (args[0] == "reroll") { + const giveaway = await GiveawaysClient.getByMessage(args[1]); + const m = await client.guilds.cache + .get(giveaway.Guild) + .channels.cache.get(giveaway.Channel) + .messages.fetch(args[1]); + if (!m) { + interaction.followUp({ content: "Unable to find the giveaway ⚠" }); + } else { + await GiveawaysClient.end(m, giveaway, m); + } + } else { + const giveaway = await GiveawaysClient.getByMessage(args[1]); + const m = await client.guilds.cache + .get(giveaway.Guild) + .channels.cache.get(giveaway.Channel) + .messages.fetch(args[1]); + if (!m) { + interaction.followUp({ content: "Unable to find the giveaway ⚠" }); + } else { + await GiveawaysClient.end(m, giveaway, m); + } + } + }, +}; diff --git a/command/Information/banner.js b/unused/commands/Information/banner.js diff --git a/unused/commands/Information/botinfo.js b/unused/commands/Information/botinfo.js @@ -0,0 +1,79 @@ +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/command/Information/serverinfo.js b/unused/commands/Information/serverinfo.js diff --git a/unused/commands/Utilities/codebin.js b/unused/commands/Utilities/codebin.js @@ -0,0 +1,17 @@ +const CodeClient = require("../../../client/CodeClient"); +module.exports = { + name: "Create Code Bin", + type: "MESSAGE", + run: async (client, interaction) => { + const msg = await interaction.channel.messages.fetch(interaction.targetId); + if (!msg.content) { + interaction.followUp({ content: "The message must have a content" }); + } else { + const title = "Code"; + const description = msg.author.tag; + const code = msg.content; + const link = await CodeClient.createBin(title, description, code); + interaction.followUp({ content: link }); + } + }, +}; diff --git a/command/Utilities/docs.js b/unused/commands/Utilities/docs.js diff --git a/unused/commands/Utilities/shorturl.js b/unused/commands/Utilities/shorturl.js @@ -0,0 +1,35 @@ +const URLClient = require("../../../client/URLClient"); +module.exports = { + name: "shorten-url", + description: "Shorten a URL", + options: [ + { + type: 3, + name: "short-name", + description: + "The short name that for the shorten-url (For example, https://url.cath.gq/youtube)", + required: true, + }, + { + type: 3, + name: "link", + description: + "The link for the shorten-url (For example, https://youtube.com)", + required: true, + }, + ], + run: async (client, interaction, args) => { + if (!args[1].includes("https://")) { + interaction.followUp({ content: "The link must contain 'https://'" }); + } else { + const shortName = args[0]; + const targetURL = args[1]; + const cc = await URLClient.createShortURL(shortName, targetURL); + if (!cc) { + interaction.followUp({ content: `URL already exist` }); + } else { + interaction.followUp({ content: `https://url.cath.gq/${cc}` }); + } + } + }, +}; diff --git a/util/Data/scam.json b/util/Data/scam.json @@ -1,4 +1,5 @@ [ + "discrods.gift", "discordsgift.com", "steam-sourcecommunity1.xyz", "dlscordnitro.info",