From cc01522b33e74b450c80eaafcf5df3939f0aab3f Mon Sep 17 00:00:00 2001 From: ThunderE75 <74486623+ThunderE75@users.noreply.github.com> Date: Wed, 26 Jan 2022 21:06:17 +0530 Subject: [PATCH 1/6] [Dont PULL] Added Most of the attachments of Kilo & updated alias to avoid conflict --- command/CODM/build.js | 2 +- command/CODM/stats.js | 2 +- util/Data/aliases.json | 8 ++++-- util/Data/attachments.json | 58 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/command/CODM/build.js b/command/CODM/build.js index 645924d..5f3a97f 100644 --- a/command/CODM/build.js +++ b/command/CODM/build.js @@ -787,7 +787,7 @@ module.exports = { `${data.weaponName}(${data.weaponType})'s ${all[tag]} build from ${data.author}` ) .setDescription( - `<:nyx_description:897379659665264650> **Description** \`\`\`\n ${data.notes}\n\`\`\`` + `<:nyx_description:897379659665264650> **Description** \`\`\` \n${data.notes} \n\`\`\`` ) .setColor(16580400) .setImage(data.imageUrl) diff --git a/command/CODM/stats.js b/command/CODM/stats.js index b506d42..fea4bca 100644 --- a/command/CODM/stats.js +++ b/command/CODM/stats.js @@ -296,7 +296,7 @@ function statsHandler(inpmsg) { footer: { text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew", icon_url: - "https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638", + "https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png", }, }; } diff --git a/util/Data/aliases.json b/util/Data/aliases.json index 6b7342b..651697f 100644 --- a/util/Data/aliases.json +++ b/util/Data/aliases.json @@ -26,7 +26,8 @@ "CR-56 AMAX", "Shorty", "Crossbow", - "R9-0" + "R9-0", + "PPSh-41" ], "weaponAlliasName": [ ["MoW"], @@ -48,14 +49,15 @@ ["Slow Outlaw", "Slower Outlaw"], ["bae"], ["Reneti", "Renneti", "Rennetti", "Burst Pistol"], - ["pp bizon", "pp"], + ["pp bizon", "pp19"], ["AUG"], ["AKBP", "Vepr"], ["AN94"], ["CR56", "AMAX"], ["725"], ["cb", "bow"], - ["r9", "R9-O"] + ["r9", "R9-O"], + ["ppsh", "pp41"] ], "attachmentActualName": [ ["akimbo", "Stopping Power"], diff --git a/util/Data/attachments.json b/util/Data/attachments.json index a88db9a..efd1c75 100644 --- a/util/Data/attachments.json +++ b/util/Data/attachments.json @@ -1051,6 +1051,64 @@ ] } ], + "Kilo_141": [ + { + "muzzle": [ + "Tactical Suppressor", + "OWC Light Suppressor", + "OWC Light Compensator", + "Monolithic Suppressor", + "MIP Light FLash Guard", + "RTC Light Muzzle Brake" + ], + "barrel": [ + "RTC Silencer Barrel", + "MIP Light Extended Barrel", + "OWC Marksman" + ], + "optic": [ + "Red Dot Sight", + "Holographic Sight", + "3x Tactical Scope", + "4x Tactical Scope", + "4.4x Tactical Scope" + ], + "stock": [ + "No Stock", + "YKM Combat Stock", + "OWC Skeleton Stock", + "RTC Steady Stock" + ], + "perk": [ + "FMJ", + "Sleight of Hand", + "Wounding", + "Full Ammo", + "Disable", + "Tough", + "Long Shot", + "Melee Master" + ], + "laser": ["RTC Laser 1mW", "MIP Laser 5mW", "OWC Laser - Tactical"], + "underbarrel": [ + "Strike Foregrip", + "Merc Foregrip", + "Operator Foregrip", + "Ranger Foregrip", + "Tactical Foregrip A" + ], + "ammo": [ + "Extended Mag A", + "Large Extended Mag B", + "100 round LMG Drum Mag" + ], + "rear_grip": [ + "Granulated Grip Tape", + "Ruberized Grip Tape", + "Stippled Grip Tape" + ] + } + ], "XPR_50": [ { "muzzle": [ From f672b78b08f64b8bbebf2ef627c4fcf72a01b18f Mon Sep 17 00:00:00 2001 From: ThunderE75 <74486623+ThunderE75@users.noreply.github.com> Date: Fri, 28 Jan 2022 13:30:28 +0530 Subject: [PATCH 2/6] [DONT PULL] updated buillds.js for api changes --- command/CODM/build.js | 362 +++++++++++++++--------------------------- 1 file changed, 127 insertions(+), 235 deletions(-) diff --git a/command/CODM/build.js b/command/CODM/build.js index 5f3a97f..df1727b 100644 --- a/command/CODM/build.js +++ b/command/CODM/build.js @@ -1,6 +1,7 @@ const { MessageEmbed } = require("discord.js"); -const axios = require("axios"); +const c = new CODMClient("Gae"); const moment = require("moment"); +const axios = require("axios"); module.exports = { name: "build", description: "Get gunsmith builds", @@ -19,89 +20,89 @@ module.exports = { required: true, choices: [ { - name: "AK117", - value: "ak117", + name: "Type 25", + value: "A03", }, { name: "M16", - value: "m16", + value: "A02", }, { - name: "Type 25", - value: "type25", + name: "AK117", + value: "A03", }, { name: "AK-47", - value: "ak47", + value: "A04", }, { name: "ASM10", - value: "asm10", + value: "A05", }, { name: "M4", - value: "m4", + value: "A06", }, { name: "BK57", - value: "bk57", + value: "A07", }, { name: "LK24", - value: "lk24", - }, - { - name: "Man-o-War", - value: "manowar", + value: "A08", }, { name: "ICR-1", - value: "icr1", + value: "A09", + }, + { + name: "Man-o-War", + value: "A10", }, { name: "KN-44", - value: "kn44", + value: "A11", }, { name: "HBRa3", - value: "hbra3", + value: "A12", }, { name: "HVK-30", - value: "hvk30", + value: "A13", }, { name: "DR-H", - value: "drh", + value: "A14", }, { name: "Peacekeeper MK2", - value: "peacekeepermk2", + value: "A15", }, { name: "FR .556", - value: "fr556", + value: "A16", }, { name: "AS VAL", - value: "asval", + value: "A17", }, { name: "CR-56 AMAX", - value: "cr56amax", + value: "A18", }, { name: "M13", - value: "m13", + value: "A19", }, { name: "Swordfish", - value: "swordfish", + value: "A20", + }, + { + name: "Kilo 141", + value: "A21", }, - // { - // name: "Kilo 141", - // value: "kilo", - // }, ], }, { @@ -163,71 +164,71 @@ module.exports = { choices: [ { name: "RUS-79u", - value: "rus79u", - }, - { - name: "PDW-57", - value: "pdw57", - }, - { - name: "Razorback", - value: "razorback", - }, - { - name: "MSMC", - value: "msmc", - }, - { - name: "HG40", - value: "hg40", - }, - { - name: "Pharo", - value: "pharo", - }, - { - name: "GKS", - value: "gks", - }, - { - name: "Cordite", - value: "cordite", - }, - { - name: "QQ9", - value: "qq9", - }, - { - name: "Fennec", - value: "fennec", + value: "D01", }, { name: "Chicom", - value: "chicom", + value: "D02", + }, + { + name: "PDW-57", + value: "D03", + }, + { + name: "Razorback", + value: "D04", + }, + { + name: "MSMC", + value: "D05", + }, + { + name: "HG40", + value: "D06", + }, + { + name: "Pharo", + value: "D07", + }, + { + name: "GKS", + value: "D08", + }, + { + name: "Cordite", + value: "D09", + }, + { + name: "QQ9", + value: "D10", + }, + { + name: "Fennec", + value: "D11", }, { name: "AGR 556", - value: "agr556", + value: "D12", }, { name: "QXR", - value: "qxr", + value: "D13", }, { name: "PP19 Bizon", - value: "pp19bizon", + value: "D14", }, { name: "MX9", - value: "mx9", + value: "D15", }, { name: "CBR4", - value: "cbr4", + value: "D16", }, { name: "PPSh 41", - value: "ppsh", + value: "D17", }, ], }, @@ -284,41 +285,41 @@ module.exports = { description: "Name of the Gun", required: true, choices: [ + // { + // name: "XPR-50", + // value: "B01", + // }, { name: "Arctic .50", - value: "arctic50", + value: "B02", }, { name: "M21 EBR", - value: "m21ebr", + value: "B03", }, { name: "DL Q33", - value: "dlq33", + value: "B04", }, { name: "Locus", - value: "locus", + value: "B05", }, // { - // name: "XPR-50", - // value: "xpr50", - // }, - // { // name: "NA-45", - // value: "na45", + // value: "B06", // }, { name: "Outlaw", - value: "outlaw", + value: "B07", }, { name: "Rytec AMR", - value: "rytecamr", + value: "B08", }, { name: "SVD", - value: "svd", + value: "B09", }, ], }, @@ -332,10 +333,6 @@ module.exports = { name: "Path.exe", value: "path", }, - // { - // name: "little_b", - // value: "littleb", - // }, ], }, { @@ -377,35 +374,35 @@ module.exports = { choices: [ { name: "S36", - value: "s36", + value: "C01", }, { name: "UL736", - value: "ul736", + value: "C02", }, { name: "RPD", - value: "rpd", + value: "C03", }, { name: "M4 LMG", - value: "m4lmg", + value: "C04", }, { name: "Chopper", - value: "chopper", + value: "C05", }, { name: "Holger 26", - value: "holger26", + value: "C06", }, { name: "Hades", - value: "hades", + value: "C07", }, { name: "PKM", - value: "pkm", + value: "C08", }, ], }, @@ -460,31 +457,31 @@ module.exports = { choices: [ { name: "HS2126", - value: "hs2126", + value: "E01", }, { name: "BY15", - value: "by15", - }, - { - name: "Striker", - value: "striker", - }, - { - name: "KRM_262", - value: "krm262", - }, - { - name: "Echo", - value: "echo", + value: "E02", }, { name: "HS0405", - value: "hs0405", + value: "E03", + }, + { + name: "Striker", + value: "E04", + }, + { + name: "KRM_262", + value: "E05", + }, + { + name: "Echo", + value: "E06", }, { name: "R9-0", - value: "r90", + value: "E07", }, ], }, @@ -535,19 +532,19 @@ module.exports = { choices: [ { name: "Kilo Bolt-Action", - value: "kiloboltaction", + value: "F01", }, { name: "SKS", - value: "sks", + value: "F02", }, { name: "SP-R 208", - value: "spr208", + value: "F03", }, { name: "MK2", - value: "mk2", + value: "F04", }, ], }, @@ -561,10 +558,6 @@ module.exports = { name: "Path.exe", value: "path", }, - // { - // name: "Little_b", - // value: "littleb", - // }, ], }, { @@ -602,27 +595,27 @@ module.exports = { choices: [ { name: "J358", - value: "j358", + value: "G01", }, { name: "MW11", - value: "mw11", + value: "G02", }, { name: ".50 GS", - value: "gs50", + value: "G03", }, { name: "Renetti", - value: "renetti", + value: "G04", }, { name: "Shorty", - value: "shorty", + value: "G05", }, { name: "Crossbow", - value: "crossbow", + value: "G06", }, ], }, @@ -654,115 +647,13 @@ module.exports = { }, ], run: async (client, interaction, args) => { - const allguns = { - ak117: "AK117", - m16: "M16", - type25: "Type 25", - ak47: "AK-47", - asm10: "ASM10", - m4: "M4", - bk57: "BK57", - lk24: "LK24", - manowar: "Man-O-War", - icr1: "ICR-1", - kn44: "KN-44", - hbra3: "HBRa3", - hvk30: "HVK-30", - drh: "DR-H", - peacekeepermk2: "Peacekeeper MK2", - fr556: "FR .556", - asval: "AS VAL", - cr56amax: "CR-56 AMAX", - m13: "M13", - swordfish: "Swordfish", - // kilo: "Kilo 141", - - j358: "J358", - gs50: ".50 GS", - mw11: "MW11", - renetti: "Renetti", - shorty: "Shorty", - crossbow: "Crossbow", - - kiloboltaction: "Kilo Bolt-Action", - sks: "SKS", - spr208: "SP-R 208", - mk2: "MK2", - - s36: "S36", - ul736: "UL736", - rpd: "RPD", - m4lmg: "M4LMG", - chopper: "Chopper", - holger26: "Holger 26", - hades: "Hades", - pkm: "PKM", - - arctic50: "Arctic .50", - m21ebr: "M21 EBR", - dlq33: "DL Q33", - locus: "Locus", - // na45: "NA 45", - // xpr50: "XPR-50", - locus: "Locus", - outlaw: "Outlaw", - rytecamr: "Rytec AMR", - svd: "SVD", - - hs2126: "HS2126", - by15: "BY15", - striker: "Striker", - krm262: "KRM 262", - echo: "Echo", - hs0405: "HS0405", - r90: "R9-0", - - rus79u: "RUS-79U", - hg40: "HG-40", - pdw57: "PDW-57", - chicom: "Chicom", - razorback: "Razorback", - msmc: "MSMC", - pharo: "Pharo", - gks: "GKS", - cordite: "Cordite", - qq9: "QQ9", - fennec: "Fennec", - agr556: "AGR 556", - qxr: "QXR", - pp19bizon: "PP19 Bizon", - mx9: "MX9", - cbr4: "CBR4", - ppsh: "PPSh-41", - }; - const all = { - assault_rifle: "Assault Rifle", - sniper_rifle: "Sniper Rifle", - marksman_rifle: "Marksman Rifle", - shotgun: "Shotgun", - light_machine_gun: "Light Machine Gun", - sub_machine_gun: "Sub Machine Gun", - - path: "Path.exe", - dhitman: "dHitman", - jokesta: "Jokesta", - sod: "Stats On Duty", - // littleb:"Little B", - - aggressive: "Aggressive", - passive: "Passive", - snd: "Search And Destroy", - respawn: "Respawn", - ads: "ADS", - hipfire: "Hipfire", - }; - const gun = args[1]; + const cwts = args[1]; const cc = args[2]; const tag = args[3]; const data = await axios .get( - `${process.env.api}/api/v1/codm/builds?name=${gun}&cc=${cc}&tag=${tag}`, - { + `${process.env.api}/api/v1/codm/builds?cwts=${cwts}&cc=${cc}&tag=${tag}`, + { //Use the new auth methord headers: { Authorization: "Gae", }, @@ -770,7 +661,8 @@ module.exports = { ) .then(res => res.data) .catch(e => null); - if (!data?.ID) { + + if (!data?.ID) { //x what does ?. do 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` @@ -784,7 +676,7 @@ module.exports = { }); const embed = new MessageEmbed() .setTitle( - `${data.weaponName}(${data.weaponType})'s ${all[tag]} build from ${data.author}` + `${all[tag]} for ${data.weaponName} from ${data.author}` ) .setDescription( `<:nyx_description:897379659665264650> **Description** \`\`\` \n${data.notes} \n\`\`\`` From 0dee818135634d690f224d65c5f2e975afe7874a Mon Sep 17 00:00:00 2001 From: ThunderE75 <74486623+ThunderE75@users.noreply.github.com> Date: Fri, 28 Jan 2022 13:54:01 +0530 Subject: [PATCH 3/6] typo --- command/CODM/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/CODM/build.js b/command/CODM/build.js index df1727b..e94d7ac 100644 --- a/command/CODM/build.js +++ b/command/CODM/build.js @@ -21,7 +21,7 @@ module.exports = { choices: [ { name: "Type 25", - value: "A03", + value: "A01", }, { name: "M16", From ce136dc3800b8f9150a6098eb2095cbb84fc2fd1 Mon Sep 17 00:00:00 2001 From: ThunderE75 <74486623+ThunderE75@users.noreply.github.com> Date: Fri, 28 Jan 2022 14:51:37 +0530 Subject: [PATCH 4/6] bug fix --- command/CODM/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/CODM/build.js b/command/CODM/build.js index e94d7ac..36b18df 100644 --- a/command/CODM/build.js +++ b/command/CODM/build.js @@ -1,5 +1,5 @@ const { MessageEmbed } = require("discord.js"); -const c = new CODMClient("Gae"); +const { CODMClient } = require("cath"); const moment = require("moment"); const axios = require("axios"); module.exports = { From 70c7a1f6f44d26e834c347c666d0c9d64419a4f2 Mon Sep 17 00:00:00 2001 From: mightyful <88110210+mightyful@users.noreply.github.com> Date: Fri, 28 Jan 2022 20:36:42 +0100 Subject: [PATCH 5/6] added advanced poll command, adjust it to fit --- command/Utilities/poll.js | 119 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 command/Utilities/poll.js diff --git a/command/Utilities/poll.js b/command/Utilities/poll.js new file mode 100644 index 0000000..b8a0bee --- /dev/null +++ b/command/Utilities/poll.js @@ -0,0 +1,119 @@ +const { Client, CommandInteraction, MessageEmbed } = require('discord.js'); + +module.exports = { + name: 'poll', + category: "SUB_COMMAND", + description: 'Creates a poll with many options', + options: [ + { + name: 'create', + description: 'Creates An Interactive Poll', + type: 'SUB_COMMAND', + options: [ + { + name: 'question', + description: 'The question of the poll', + type: 'STRING', + required: true, + }, + { + name: 'choice1', + description: 'Choice 1', + type: 'STRING', + required: true, + }, + { + name: 'choice2', + description: 'Choice 2', + type: 'STRING', + required: true, + }, + { + name: 'choice3', + description: 'Choice 3', + type: 'STRING', + required: false, + }, + { + name: 'choice4', + description: 'Choice 4', + type: 'STRING', + required: false, + }, + { + name: 'choice5', + description: 'Choice 5', + type: 'STRING', + required: false, + }, + { + name: 'choice6', + description: 'Choice 6', + type: 'STRING', + required: false, + }, + ], + }, + ], + /** + * @param {Client} client + * @param {CommandInteraction} interaction + * @param {String[]} args + */ + run: async(client, interaction, args) => { + if (interaction.options.getSubcommand() == 'create') { + const title = interaction.options.getString('question') + const c1 = interaction.options.getString('choice1'); + const c2 = interaction.options.getString('choice2'); + const c3 = interaction.options.getString('choice3'); + const c4 = interaction.options.getString('choice4'); + const c5 = interaction.options.getString('choice5'); + const c6 = interaction.options.getString('choice6'); + const pollCreateEmbed = new MessageEmbed() + .setTitle(`${title}`) + .setColor("RED") + .addFields( + { name: "⠀", value: `🇦 ${c1}`}, + { name: "⠀", value: `🇧 ${c2}`} + ) + .setFooter(`Poll By ${interaction.user.tag}`) + .setTimestamp(); + + + if (interaction.options.getString('choice3')) { + pollCreateEmbed.addFields({ name: "⠀", value: `🇨 ${c3}`}); + } + if (interaction.options.getString('choice4')) { + pollCreateEmbed.addFields({ name: "⠀", value: `🇩 ${c4}`}); + } + if (interaction.options.getString('choice5')) { + pollCreateEmbed.addFields({ name: "⠀", value: `🇪 ${c5}`}); + } + if (interaction.options.getString('choice6')) { + pollCreateEmbed.addFields({ name: "⠀", value: `🇫 ${c6}`}); + } + + embedMessage = await interaction.followUp({ + embeds: [pollCreateEmbed], + //fetchReply: true, + }); + embedMessage.react('🇦'); + embedMessage.react('🇧'); + + if (interaction.options.getString('choice3')) { + embedMessage.react('🇨'); + } + if (interaction.options.getString('choice4')) { + embedMessage.react('🇩'); + } + if (interaction.options.getString('choice5')) { + embedMessage.react('🇪'); + } + if (interaction.options.getString('choice6')) { + embedMessage.react('🇫'); + } + } else { + return; + } + }, +}; From b247b0405e26314023e0655d89d1a6016685586f Mon Sep 17 00:00:00 2001 From: night0721 Date: Sat, 29 Jan 2022 04:19:50 +0800 Subject: [PATCH 6/6] fixing bugs and enhancement --- command/CODM/build.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/command/CODM/build.js b/command/CODM/build.js index 36b18df..65088b8 100644 --- a/command/CODM/build.js +++ b/command/CODM/build.js @@ -1,5 +1,4 @@ const { MessageEmbed } = require("discord.js"); -const { CODMClient } = require("cath"); const moment = require("moment"); const axios = require("axios"); module.exports = { @@ -653,16 +652,16 @@ module.exports = { const data = await axios .get( `${process.env.api}/api/v1/codm/builds?cwts=${cwts}&cc=${cc}&tag=${tag}`, - { //Use the new auth methord + { headers: { - Authorization: "Gae", + Authorization: process.env.CODM_API_KEY, }, } ) .then(res => res.data) .catch(e => null); - if (!data?.ID) { //x what does ?. do + 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` @@ -676,7 +675,7 @@ module.exports = { }); const embed = new MessageEmbed() .setTitle( - `${all[tag]} for ${data.weaponName} from ${data.author}` + `${all[tag]} build for ${data.weaponName} from ${data.author}` ) .setDescription( `<:nyx_description:897379659665264650> **Description** \`\`\` \n${data.notes} \n\`\`\`` @@ -721,4 +720,4 @@ module.exports = { }); } }, -}; \ No newline at end of file +};