From 62d17abfb8b8c0bf2efaaf39405fc1085e9fb728 Mon Sep 17 00:00:00 2001 From: Maximus7474 Date: Fri, 16 Aug 2024 20:43:52 +0200 Subject: [PATCH 1/8] feat(dataSearcher): vehicle teams (Axis/Allies) ->Will allow more refined searching later on --- data/vehicleInfo.json | 79 ++++++++++++++++++++++++++++++++++++ src/commands/dataSearcher.js | 14 ++++++- 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/data/vehicleInfo.json b/data/vehicleInfo.json index 1ee3aa9..27f954a 100644 --- a/data/vehicleInfo.json +++ b/data/vehicleInfo.json @@ -1,6 +1,7 @@ { "tanks": { "Matilda Mk. II": { + "team": "Allies", "type": "Heavy Tank", "factions": ["ANZAC", "1st Airborne"], "chapters": ["Mercury", "I", "III"], @@ -16,6 +17,7 @@ } }, "Vickers Mk. VI": { + "team": "Allies", "type": "Medium Tank", "factions": ["ANZAC"], "chapters": ["Mercury"], @@ -27,6 +29,7 @@ } }, "Panhard 178": { + "team": "Allies", "type": "Recon Tank", "factions": ["1ere Armée"], "chapters": ["II"], @@ -38,6 +41,7 @@ } }, "Renault R35": { + "team": "Allies", "type": "Medium Tank", "factions": ["1ere Armée"], "chapters": ["II"], @@ -49,6 +53,7 @@ } }, "Somua S35": { + "team": "Allies", "type": "Medium Tank", "factions": ["1ere Armée"], "chapters": ["II"], @@ -60,6 +65,7 @@ } }, "Renault Char B1 \"Bis\"": { + "team": "Allies", "type": "Heavy Tank", "factions": ["1ere Armée"], "chapters": ["II"], @@ -71,6 +77,7 @@ } }, "Sd.Kfz. 222": { + "team": "Axis", "type": "Recon Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -82,6 +89,7 @@ } }, "Sd.Kfz. 232": { + "team": "Axis", "type": "Recon Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -93,6 +101,7 @@ } }, "Panzer 38(t)": { + "team": "Axis", "type": "Recon/Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "II", "III"], @@ -109,6 +118,7 @@ } }, "Panzer II Ausf. C": { + "team": "Axis", "type": "Recon Tank", "factions": ["Wehrmacht"], "chapters": ["I", "II", "III"], @@ -125,6 +135,7 @@ } }, "Panzer III Ausf. F": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["II"], @@ -141,6 +152,7 @@ } }, "Panzer III Ausf. G": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -157,6 +169,7 @@ } }, "Panzer IV Ausf. D": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -173,6 +186,7 @@ } }, "Panzer IV Ausf. G": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -190,6 +204,7 @@ } }, "Panzer IV Ausf. H": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -207,6 +222,7 @@ } }, "Panzer V Ausf. A \"Panther\"": { + "team": "Axis", "type": "Heavy Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -223,6 +239,7 @@ } }, "Panzerjäger Tiger Ausf. B \"Jagdtiger\"": { + "team": "Axis", "type": "Heavy Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -240,6 +257,7 @@ } }, "Panzer VI Ausf. B \"KönigsTiger\"": { + "team": "Axis", "type": "Heavy Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -256,6 +274,7 @@ } }, "Panzer VI Ausf. E \"Tiger\"": { + "team": "Axis", "type": "Heavy Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -272,6 +291,7 @@ } }, "Sd.Kfz. 234 \"Puma\"": { + "team": "Axis", "type": "Recon Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -288,6 +308,7 @@ } }, "Sd.Kfz. 234/4 \"Stummel\"": { + "team": "Axis", "type": "Recon Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -304,6 +325,7 @@ } }, "Stug III Ausf. G": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -321,6 +343,7 @@ } }, "Stug III A": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -337,6 +360,7 @@ } }, "Jagdpanzer IV L48": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -354,6 +378,7 @@ } }, "Jagdpanzer IV L48 (Late War)": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -371,6 +396,7 @@ } }, "Jagdpanzer IV L70": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -387,6 +413,7 @@ } }, "Nashorn": { + "team": "Axis", "type": "Heavy Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -403,6 +430,7 @@ } }, "Flakpanzer IV Ostwind": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -418,6 +446,7 @@ } }, "Flakpanzer IV OJagdpanzer 38(t) Hetzerstwind": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -435,6 +464,7 @@ } }, "Marder III Ausf. M": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -451,6 +481,7 @@ } }, "Sturmhaubitze 42 \"StuH\"": { + "team": "Axis", "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -467,6 +498,7 @@ } }, "Panzer Selbstfahrlafette \"Sturer Emil\"": { + "team": "Axis", "type": "Heavy Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -482,6 +514,7 @@ } }, "Stuart VI": { + "team": "Allies", "type": "Recon/Light Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -498,6 +531,7 @@ } }, "Churchill Mk. IV": { + "team": "Allies", "type": "Heavy Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -515,6 +549,7 @@ } }, "Churchill Mk. VII": { + "team": "Allies", "type": "Heavy Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -531,6 +566,7 @@ } }, "Cromwell Mk. I": { + "team": "Allies", "type": "Medium Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -548,6 +584,7 @@ } }, "Cromwell Mk. IV": { + "team": "Allies", "type": "Medium Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -564,6 +601,7 @@ } }, "Cromwell Mk. IV CS": { + "team": "Allies", "type": "Medium Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -579,6 +617,7 @@ } }, "Daimler AC": { + "team": "Allies", "type": "Recon Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -594,6 +633,7 @@ } }, "SP M10": { + "team": "Allies", "type": "Medium Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -610,6 +650,7 @@ } }, "17pdr SP M10 Achilles": { + "team": "Allies", "type": "Medium Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -626,6 +667,7 @@ } }, "Sherman Mk. VC Firefly": { + "team": "Allies", "type": "Heavy Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -643,6 +685,7 @@ } }, "Sherman Mk. V": { + "team": "Allies", "type": "Medium Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -659,6 +702,7 @@ } }, "Challenger Mk. VIII": { + "team": "Allies", "type": "Heavy Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -675,6 +719,7 @@ } }, "Comet Mk. I (A34)": { + "team": "Allies", "type": "Medium Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -691,6 +736,7 @@ } }, "Valentine Mk. XI": { + "team": "Allies", "type": "Medium Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -707,6 +753,7 @@ } }, "T17 Staghound": { + "team": "Allies", "type": "Recon Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -723,6 +770,7 @@ } }, "Tetrarch Mk. VII": { + "team": "Allies", "type": "Recon Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -738,6 +786,7 @@ } }, "Tetrarch Mk. VII \"Littlejohn\"": { + "team": "Allies", "type": "Recon Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -753,6 +802,7 @@ } }, "AEC Mk. II Armoured Car": { + "team": "Allies", "type": "Recon Tank", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], @@ -771,6 +821,7 @@ }, "vehicles": { "Universal Carrier": { + "team": "Allies", "class": "Specialized", "type": "Specialized Vehicle", "factions": ["ANZAC", "1st Airborne", "Polish Brigade"], @@ -779,6 +830,7 @@ "weaponry": null }, "Universal Carrier Vickers MG": { + "team": "Allies", "class": "Specialized", "type": "Specialized Vehicle", "factions": ["1st Airborne", "Polish Brigade"], @@ -789,6 +841,7 @@ } }, "Universal Carrier M2 .50cal": { + "team": "Allies", "class": "Specialized", "type": "Specialized Vehicle", "factions": ["1st Airborne", "Polish Brigade"], @@ -799,6 +852,7 @@ } }, "Universal Carrier Boys AT": { + "team": "Allies", "class": "Specialized", "type": "Specialized Vehicle", "factions": ["1st Airborne", "Polish Brigade"], @@ -810,6 +864,7 @@ } }, "Jeep Willys AB Vickers K": { + "team": "Allies", "class": "Specialized", "type": "Specialized Vehicle", "factions": ["1st Airborne", "Polish Brigade"], @@ -820,6 +875,7 @@ } }, "Morris C8": { + "team": "Allies", "class": "Specialized", "type": "Specialized Vehicle", "factions": ["1st Airborne", "Polish Brigade"], @@ -828,6 +884,7 @@ "weaponry": null }, "BMW R75": { + "team": "Axis", "class": "Specialized", "type": "transport", "factions": ["Wehrmacht"], @@ -838,6 +895,7 @@ } }, "Kübelwagen 82 Camo MG42": { + "team": "Axis", "class": "Specialized", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -847,6 +905,7 @@ } }, "Laffly S20TL Transport": { + "team": "Allies", "class": "Specialized", "factions": ["1ere Armée", "21"], "chapters": ["II"], @@ -854,6 +913,7 @@ "weaponry": null }, "Chevrolet G7100 Transport": { + "team": "Allies", "class": "Specialized", "factions": ["1ere Armée"], "chapters": ["II"], @@ -861,6 +921,7 @@ "weaponry": null }, "Sd.Kfz. 2 Kettenkrad": { + "team": "Axis", "class": "Specialized", "factions": ["Wehrmacht"], "chapters": ["II"], @@ -868,6 +929,7 @@ "weaponry": null }, "Kübelwagen 82": { + "team": "Axis", "class": "Specialized", "factions": ["Wehrmacht"], "chapters": ["II"], @@ -875,6 +937,7 @@ "weaponry": null }, "Opel Blitz Transport": { + "team": "Axis", "class": "Specialized", "factions": ["Wehrmacht"], "chapters": ["I", "II", "III", "IV"], @@ -882,6 +945,7 @@ "weaponry": null }, "Sd.Kfz. 7": { + "team": "Axis", "class": "Specialized", "factions": ["Wehrmacht"], "chapters": ["II"], @@ -889,6 +953,7 @@ "weaponry": null }, "Sd.Kfz. 7 Flatbed": { + "team": "Axis", "class": "Specialized", "factions": ["Wehrmacht"], "chapters": ["II"], @@ -896,6 +961,7 @@ "weaponry": null }, "Humber Super Snipe": { + "team": "Allies", "class": "Specialized", "factions": ["1st Airborne"], "chapters": ["I"], @@ -903,6 +969,7 @@ "weaponry": null }, "K5 Austin Logistics": { + "team": "Allies", "class": "Specialized", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I"], @@ -910,6 +977,7 @@ "weaponry": null }, "Bedford Transport": { + "team": "Allies", "class": "Specialized", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I"], @@ -917,6 +985,7 @@ "weaponry": null }, "Laffly W15TCC": { + "team": "Allies", "class": "Mechanized", "type": "Self-Propelled gun", "factions": ["1ere Armée"], @@ -930,6 +999,7 @@ } }, "Sd.Kfz. 7 Flak 38": { + "team": "Axis", "class": "Mechanized", "type": "Self-Propelled anti-air gun", "factions": ["Wehrmacht"], @@ -942,6 +1012,7 @@ } }, "Sd.Kfz. 4/1 Panzerwerfer 42": { + "team": "Axis", "class": "Mechanized", "type": "Self-Propelled mortar launcher", "factions": ["Wehrmacht"], @@ -954,6 +1025,7 @@ } }, "Sd.Kfz. 251": { + "team": "Axis", "class": "Mechanized", "type": "Self-Propelled mortar launcher", "factions": ["Wehrmacht"], @@ -966,6 +1038,7 @@ } }, "Sd.Kfz. 251/22 Pak 40": { + "team": "Axis", "class": "Mechanized", "type": "Self-Propelled mortar launcher", "factions": ["Wehrmacht"], @@ -980,6 +1053,7 @@ }, "canons": { "APX 47mm": { + "team": "Allies", "type": "Anti-Tank Canon", "factions": ["1ere Armée"], "chapters": ["II"], @@ -988,6 +1062,7 @@ } }, "LG40": { + "team": "Axis", "type": "Heavy Support Weapon", "factions": ["Wehrmacht"], "chapters": ["II"], @@ -996,6 +1071,7 @@ } }, "7.5cm Ie.IG 18": { + "team": "Axis", "type": "Anti-Infantry Gun", "factions": ["Wehrmacht"], "chapters": ["II"], @@ -1004,6 +1080,7 @@ } }, "Pak 36": { + "team": "Axis", "type": "Anti-Tank Canon", "factions": ["Wehrmacht"], "chapters": ["II"], @@ -1012,6 +1089,7 @@ } }, "Pak 38": { + "team": "Axis", "type": "Anti-Tank Canon", "factions": ["Wehrmacht"], "chapters": ["I", "III"], @@ -1020,6 +1098,7 @@ } }, "QF. 6 Pounder": { + "team": "Allies", "type": "Anti-Tank Canon", "factions": ["1st Airborne", "Polish Brigade"], "chapters": ["I", "III"], diff --git a/src/commands/dataSearcher.js b/src/commands/dataSearcher.js index 277adf0..8d2d2f5 100644 --- a/src/commands/dataSearcher.js +++ b/src/commands/dataSearcher.js @@ -3,12 +3,19 @@ const { SlashCommandBuilder } = require('@discordjs/builders'); const VehicleData = require('../../data/vehicleInfo.json'); const { EmbedBuilder } = require('discord.js'); +const thumbnailImage = (team) => { + if (team === "Allies") return "https://r2.fivemanage.com/pub/ngxgy4wfhtv7.png"; + if (team === "Axis") return "https://r2.fivemanage.com/pub/tkhmklv1sq92.png"; + return 'https://assets-prd.ignimgs.com/2023/12/15/squad44-1702600459401.jpg' +} + const tankDisplayEmbed = (name, tankData) => { const Embed = new EmbedBuilder() .setTitle(name) + .setThumbnail(thumbnailImage(tankData.team)) .setColor(16316405) .setDescription( - `Tank Type: \`${tankData.type}\`\nAvailable in Chapters: ${tankData.chapters.join(', ')}\nFactions: ${tankData.factions.join(', ')}` + `Side: **${tankData.team}**\nTank Type: \`${tankData.type}\`\nAvailable in Chapters: ${tankData.chapters.join(', ')}\nFactions: ${tankData.factions.join(', ')}` ).setFields( { name: 'Crewing:', value: `- Rôles:\n> ${(tankData.details.crew ?? ['?']).sort().join(', ')}\n- Passagers: \`${tankData.details.passengers ?? '0'}\``, inline: false }, { name: 'Weaponry:', value: `- Main Canon: ${tankData.details.caliber ?? '?'}\n- Main Canon Ammunition:\n> ${Object.keys(tankData.details.shells ?? {'?': '?'}).sort().join(', ')}`, inline: false }, @@ -19,9 +26,10 @@ const tankDisplayEmbed = (name, tankData) => { const canonDisplayEmbed = (name, canonData) => { const Embed = new EmbedBuilder() .setTitle(name) + .setThumbnail(thumbnailImage(tankData.team)) .setColor(16316405) .setDescription( - `Canon Type: \`${canonData.type}\`\nAvailable in Chapters: ${canonData.chapters.join(', ')}\nFactions: ${canonData.factions.join(', ')}` + `Side: **${canonData.team}**Canon Type: \`${canonData.type}\`\nAvailable in Chapters: ${canonData.chapters.join(', ')}\nFactions: ${canonData.factions.join(', ')}` ).setFields( { name: 'Weaponry:', value: Object.entries(canonData.weaponry).map(([weapon, amount]) => `- ${weapon}`).join("\n")} ); @@ -31,8 +39,10 @@ const canonDisplayEmbed = (name, canonData) => { const vehicleDisplayEmbed = (name, vehicleData) => { const Embed = new EmbedBuilder() .setTitle(name) + .setThumbnail(thumbnailImage(tankData.team)) .setColor(16316405) .setDescription( + `Side: **${vehicleData.team}**\n` + `Class: **\`${vehicleData.class}**\`\n` + (vehicleData.class !== undefined ? `Type: ${vehicleData.type}` : '') + '\n' + `Available in Chapters: **\`${vehicleData.chapters.join('`, `')}\`**\n` + From 6da64e9bb65b2b486755ece8ba6086e66024351f Mon Sep 17 00:00:00 2001 From: Maximus7474 Date: Fri, 16 Aug 2024 20:48:10 +0200 Subject: [PATCH 2/8] feat(dataSearcher): image option for vehicles/tanks/canons --- src/commands/dataSearcher.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/commands/dataSearcher.js b/src/commands/dataSearcher.js index 8d2d2f5..07d030b 100644 --- a/src/commands/dataSearcher.js +++ b/src/commands/dataSearcher.js @@ -19,7 +19,8 @@ const tankDisplayEmbed = (name, tankData) => { ).setFields( { name: 'Crewing:', value: `- Rôles:\n> ${(tankData.details.crew ?? ['?']).sort().join(', ')}\n- Passagers: \`${tankData.details.passengers ?? '0'}\``, inline: false }, { name: 'Weaponry:', value: `- Main Canon: ${tankData.details.caliber ?? '?'}\n- Main Canon Ammunition:\n> ${Object.keys(tankData.details.shells ?? {'?': '?'}).sort().join(', ')}`, inline: false }, - ); + ) + .setImage(typeof tankData.image === 'string' ? tankData.image : null); return Embed } @@ -32,7 +33,8 @@ const canonDisplayEmbed = (name, canonData) => { `Side: **${canonData.team}**Canon Type: \`${canonData.type}\`\nAvailable in Chapters: ${canonData.chapters.join(', ')}\nFactions: ${canonData.factions.join(', ')}` ).setFields( { name: 'Weaponry:', value: Object.entries(canonData.weaponry).map(([weapon, amount]) => `- ${weapon}`).join("\n")} - ); + ) + .setImage(typeof tankData.image === 'string' ? tankData.image : null); return Embed } @@ -48,7 +50,8 @@ const vehicleDisplayEmbed = (name, vehicleData) => { `Available in Chapters: **\`${vehicleData.chapters.join('`, `')}\`**\n` + `Factions: \n> ${vehicleData.factions.join(', ')}\n` + `Seats: ${vehicleData.seats}` - ); + ) + .setImage(typeof tankData.image === 'string' ? tankData.image : null); if (vehicleData.weaponry && Object.keys(vehicleData.weaponry).length > 0) { Embed.addFields( From cb80a6dbd80d5d6dbdc9d56b7cbde7eccd6cdc40 Mon Sep 17 00:00:00 2001 From: Maximus7474 Date: Fri, 16 Aug 2024 20:48:25 +0200 Subject: [PATCH 3/8] feat(vehicleInfo): image url for Panzer III G --- data/vehicleInfo.json | 1 + 1 file changed, 1 insertion(+) diff --git a/data/vehicleInfo.json b/data/vehicleInfo.json index 27f954a..6f5221a 100644 --- a/data/vehicleInfo.json +++ b/data/vehicleInfo.json @@ -156,6 +156,7 @@ "type": "Medium Tank", "factions": ["Wehrmacht"], "chapters": ["I", "III"], + "image": "https://static.wikia.nocookie.net/squad44/images/e/ea/Panzer_III_G.jpg", "details": { "crew": [ "Driver", "Gunner", "Hull-Gunner", "Commander" From 6f7cd55933f8be1e8aa574f0043a718b1d4b6d97 Mon Sep 17 00:00:00 2001 From: Maximus7474 Date: Fri, 16 Aug 2024 20:53:58 +0200 Subject: [PATCH 4/8] feat(dataSearcher): added invalid entry handling --- src/commands/dataSearcher.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/commands/dataSearcher.js b/src/commands/dataSearcher.js index 07d030b..347db85 100644 --- a/src/commands/dataSearcher.js +++ b/src/commands/dataSearcher.js @@ -110,7 +110,7 @@ module.exports = { const filtered = searchValues.filter(choice => choice.toLocaleLowerCase().includes(focusedValue.toLocaleLowerCase())); await interaction.respond( - filtered.length > 25 ? [{name: "Too Many Options", value: "N/A"}] : filtered.map(choice => ({ name: choice, value: choice })), + filtered.length > 25 ? [{name: "Too Many Options", value: "Too Many Options"}] : filtered.map(choice => ({ name: choice, value: choice })), ); }, async execute(client, interaction) { @@ -120,6 +120,19 @@ module.exports = { const searchedVehicleData = VehicleData[subcommand][name]; - return interaction.reply({embeds: [functionDistribution[subcommand](name, searchedVehicleData)], ephemeral :true}) + if (searchedVehicleData === undefined) { + const embed = new EmbedBuilder() + .setTitle('Invalid search parameter') + .setDescription(`\`${name}\` isn't a valid name parameter for searching ${subcommand}.`) + .setColor(16711680) + .setThumbnail(client.user.displayAvatarURL({ dynamic: true, size: 256 })); + + return interaction.reply({ + embeds: [embed], + ephemeral :true + }) + } + + return interaction.reply({embeds: [functionDistribution[subcommand](name, searchedVehicleData)], ephemeral: false}); } } \ No newline at end of file From 17bdf539c458729dd3597174570e78c8a4adb187 Mon Sep 17 00:00:00 2001 From: Maximus7474 Date: Fri, 16 Aug 2024 21:45:59 +0200 Subject: [PATCH 5/8] renamed: data searcher to vehicle (includes command) --- src/commands/{dataSearcher.js => vehicleSearcher.js} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/commands/{dataSearcher.js => vehicleSearcher.js} (99%) diff --git a/src/commands/dataSearcher.js b/src/commands/vehicleSearcher.js similarity index 99% rename from src/commands/dataSearcher.js rename to src/commands/vehicleSearcher.js index 347db85..945657f 100644 --- a/src/commands/dataSearcher.js +++ b/src/commands/vehicleSearcher.js @@ -70,7 +70,7 @@ const functionDistribution = { module.exports = { register_command: new SlashCommandBuilder() - .setName('search') + .setName('vehicle-search') .setDescription('Search for information on different aspects of the game!') .addSubcommand(command => command.setName('tanks') From a07dc9f36a5cb156b91b639dc9564a1078245068 Mon Sep 17 00:00:00 2001 From: Maximus7474 Date: Fri, 16 Aug 2024 23:30:31 +0200 Subject: [PATCH 6/8] rm: vehicleDecks --- data/vehicleDecks.json | 1100 ---------------------------------------- 1 file changed, 1100 deletions(-) delete mode 100644 data/vehicleDecks.json diff --git a/data/vehicleDecks.json b/data/vehicleDecks.json deleted file mode 100644 index 3c10693..0000000 --- a/data/vehicleDecks.json +++ /dev/null @@ -1,1100 +0,0 @@ -{ - "Arnehm": { - "Offensive 01": { - "Axis": { - "Faction": "9.SS-Panzer", - "Heavy": { - "Panzer IV Ausf. E Tiger": 3, - "Panzerjäger Tiger Ausf. B Jagdtiger": 2 - }, - "Medium": { - "Panzer IV Ausf. H": 3, - "Marder 3 Ausf. M": 1, - "Stug III Ausf. G": 1, - "Sturmhaubitze 42 \"StuH\"": 1 - }, - "Recon": { - "Panzer 38(t)": 2, - "Sd. Kfz. 222": 1, - "Sd. Kfz. 232": 1 - }, - "Specialized": { - "BMW R75": 2, - "Küblewagen 82 Camo MG42": 1 - }, - "Mechanized": { - "Sd. Kfz. 7 Flak 38": 2, - "Sd. Kfz. 4/1 Panzerwerfger 42": 1, - "Sd. Kfz. 251": 2 - } - }, - "Allies": { - "Faction": "1st Airborne", - "Heavy": null, - "Medium": null, - "Recon": null, - "Specialized": { - "Jeep Willys AB Vickers K": 2, - "Morris C8": 1 - }, - "Mechanized": { - "Universal Carrier Boys AT": 1, - "Universal Carrier M2 .50cal": 2, - "Universal Carrier Vickers MG": 2, - "M3 GMC": 1 - } - } - }, - "Offensive 02": { - "Axis": { - "Faction": "9.SS-Panzer", - "Heavy": { - "Panzer VI Ausf. B \"KönigsTiger\"": 2, - "Panzer V Ausf. A Panther": 1, - "Panzer IV Ausf. E Tiger": 1 - }, - "Medium": { - "Panzer IV Ausf. G": 1, - "Panzer III Ausf. G": 3, - "Jagdpanzer 38(t) Hetzer": 2 - }, - "Recon": { - "Panzer 38(t)": 1, - "Sd. Kfz. 222": 2, - "Sd. Kfz. 232": 2 - }, - "Specialized": { - "BMW R75": 2, - "Küblewagen 82 Camo MG42": 1 - }, - "Mechanized": { - "Sd. Kfz. 7 Flak 38": 2, - "Sd. Kfz. 4/1 Panzerwerfger 42": 1, - "Sd. Kfz. 251": 2 - } - }, - "Allies": { - "Faction": "1st Airborne", - "Heavy": null, - "Medium": null, - "Recon": null, - "Specialized": { - "Jeep Willys AB Vickers K": 2, - "Morris C8": 1 - }, - "Mechanized": { - "Universal Carrier Boys AT": 1, - "Universal Carrier M2 .50cal": 2, - "Universal Carrier Vickers MG": 2, - "M3 GMC": 1 - } - } - }, - "Offensive 03": { - "Axis": { - "Faction": "9.SS-Panzer", - "Heavy": { - "Panzer VI Ausf. B \"KönigsTiger\"": 2, - "Panzer V Ausf. A Panther": 1, - "Panzer IV Ausf. E Tiger": 1 - }, - "Medium": { - "Panzer IV Ausf. G": 2, - "Stug III Ausf. G": 2, - "Panzer III Ausf. G": 2 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 1, - "Sd. Kfz. 222": 1, - "Panzer 38(t)": 1, - "Sd. Kfz. 232": 1 - }, - "Specialized": { - "BMW R75": 2, - "Küblewagen 82 Camo MG42": 1 - }, - "Mechanized": { - "Sd. Kfz. 7 Flak 38": 2, - "Sd. Kfz. 4/1 Panzerwerfger 42": 1, - "Sd. Kfz. 251": 2 - } - }, - "Allies": { - "Faction": "1st Airborne", - "Heavy": null, - "Medium": null, - "Recon": null, - "Specialized": { - "Jeep Willys AB Vickers K": 2, - "Morris C8": 1 - }, - "Mechanized": { - "Universal Carrier Boys AT": 1, - "Universal Carrier M2 .50cal": 2, - "Universal Carrier Vickers MG": 2, - "M3 GMC": 1 - } - } - }, - "RAAS UK": { - "Axis": { - "Faction": "9.SS-Panzer", - "Heavy": { - "Panzer VI Ausf. B \"KönigsTiger\"": 1, - "Panzer V Ausf. A Panther": 2, - "Panzer IV Ausf. E Tiger": 2 - }, - "Medium": { - "Panzer IV Ausf. H": 3, - "Marder 3 Ausf. M": 1, - "Stug III Ausf. G": 1, - "Sturmhaubitze 42 \"StuH\"": 1 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 2, - "Sd. Kfz. 222": 1, - "Sd. Kfz. 232": 1 - }, - "Specialized": { - "BMW R75": 2, - "Küblewagen 82 Camo MG42": 1 - }, - "Mechanized": { - "Sd. Kfz. 7 Flak 38": 2, - "Sd. Kfz. 4/1 Panzerwerfger 42": 1, - "Sd. Kfz. 251": 2 - } - }, - "Allies": { - "Faction": "1st Airborne", - "Heavy": { - "Churchill Mk. IV": 1, - "Challenger Mk. VIII": 2, - "Churchil Mk. VII": 2, - "Sherman Mk. VC Firefly": 2 - }, - "Medium": { - "17pdr SP M10C Achilles": 2, - "Cromwell Mk. IV": 2, - "Sherman Mk. V": 3 - }, - "Recon": { - "T17 Staghound": 1, - "Stuart VI": 3 - }, - "Specialized": { - "Jeep Willys AB Vickers K": 2, - "Morris C8": 1 - }, - "Mechanized": { - "Universal Carrier Boys AT": 1, - "Universal Carrier M2 .50cal": 2, - "Universal Carrier Vickers MG": 2, - "M3 GMC": 1 - } - } - } - }, - "Best": { - "Offensive 01": { - "Axis": { - "Faction": "9.SS-Panzer", - "Heavy": { - "Panzer IV Ausf. E Tiger": 3, - "Panzerjäger Tiger Ausf. B Jagdtiger": 2 - }, - "Medium": { - "Panzer IV Ausf. H": 3, - "Marder 3 Ausf. M": 1, - "Stug III Ausf. G": 1, - "Sturmhaubitze 42 \"StuH\"": 1 - }, - "Recon": { - "Panzer 38(t)": 1, - "Sd. Kfz. 222": 2, - "Sd. Kfz. 232": 2 - } - }, - "Allies": { - "Faction": "101st Airborne", - "Heavy": { - "Churchill Mk. IV": 1, - "Challenger Mk. VIII": 2, - "Churchil Mk. VII": 2, - "Sherman Mk. VC Firefly": 2 - }, - "Medium": { - "17pdr SP M10C Achilles": 1, - "Cromwell Mk. IV": 4, - "Sherman Mk. V": 1 - }, - "Recon": { - "Stuart VI": 1, - "T17 Staghound": 1, - "AEC Mk. II Armoured Car": 1, - "Daimler AC": 1 - } - } - }, - "Offensive 02": { - "Axis": { - "Faction": "9.SS-Panzer", - "Heavy": { - "Panzer VI Ausf. B \"KönigsTiger\"": 2, - "Panzer V Ausf. A Panther": 1, - "Panzer IV Ausf. E Tiger": 1 - }, - "Medium": { - "Panzer IV Ausf. G": 1, - "Panzer III Ausf. G": 3, - "Jagdpanzer 38(t) Hetzer": 2 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 1, - "Sd. Kfz. 222": 1, - "Panzer 38(t)": 3 - } - }, - "Allies": { - "Faction": "101st Airborne", - "Heavy": { - "Churchill Mk. IV": 2, - "Churchil Mk. VII": 3, - "Challenger Mk. VIII": 1 - }, - "Medium": { - "17pdr SP M10C Achilles": 1, - "Cromwell Mk. IV": 4, - "Sherman Mk. V": 1 - }, - "Recon": { - "Daimler AC": 1, - "AEC Mk. II Armoured Car": 1, - "Stuart VI": 2 - } - } - }, - "Offensive 03" : { - "Axis": { - "Faction": "Wehrmacht", - "Heavy": { - "Panzer V Ausf. A Panther": 4, - "Panzer IV Ausf. E Tiger": 1 - }, - "Medium": { - "Panzer IV Ausf. H": 2, - "Jagdpanzer 38(t) Hetzer": 1, - "Jagdpanzer IV L70": 1, - "Jagdpanzer IV L48 Late War": 2, - "Marder 3 Ausf. M": 1 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 1, - "Sd. Kfz. 222": 1, - "Panzer 38(t)": 1, - "Sd. Kfz. 232": 2 - } - }, - "Allies": { - "Faction": "1st Airborne", - "Heavy": { - "Churchill Mk. IV": 1, - "Challenger Mk. VIII": 2, - "Churchil Mk. VII": 2, - "Sherman Mk. VC Firefly": 2 - }, - "Medium": { - "17pdr SP M10C Achilles": 2, - "Cromwell Mk. IV": 1, - "Valentine Mv. XI": 1, - "Sherman Mk. V": 2 - }, - "Recon": { - "Stuart VI": 1, - "AEC Mk. II Armoured Car": 3, - "Daimler AC": 1 - } - } - }, - "Offensive 04": { - "Axis": { - "Faction": "Wehrmacht", - "Heavy": { - "Panzer V Ausf. A Panther": 4, - "Panzer IV Ausf. E Tiger": 1 - }, - "Medium": { - "Panzer IV Ausf. G":2, - "Stug III Ausf. G": 2, - "Panzer III Ausf. G": 2 - }, - "Recon": { - "Sd. Kfz. 222":1, - "Sd. Kfz. 232":3, - "Sd. Kfz. 234 \"Puma\"": 1 - } - }, - "Allies": { - "Faction": "1st Airborne", - "Heavy": { - "Challenger Mk. VIII": 2, - "Churchil Mk. VII":1, - "Sherman Mk. VC Firefly":3 - }, - "Medium": { - "Sherman Mk. V": 6 - }, - "Recon": { - "Daimler AC": 2, - "AEC Mk. II Armoured Car": 2 - } - } - }, - "RAAS UK": { - "Axis": { - "Faction": "9.SS-Panzer", - "Heavy": { - "Panzer VI Ausf. B \"KönigsTiger\"": 2, - "Panzer V Ausf. A Panther": 1, - "Panzer IV Ausf. E Tiger": 2 - }, - "Medium": { - "Panzer IV Ausf. H": 4, - "Stug III Ausf. G":2 - }, - "Recon": { - "Panzer 38(t)":2, - "Sd. Kfz. 222":1, - "Sd. Kfz. 232":1 - } - }, - "Allies": { - "Faction": "1st Airborne", - "Heavy": { - "Challenger Mk. VIII":2, - "Churchill Mk. IV": 1, - "Churchil Mk. VII": 2, - "Sherman Mk. VC Firefly": 2 - }, - "Medium": { - "Cromwell Mk. IV": 2, - "17pdr SP M10C Achilles": 2, - "Sherman Mk. V": 3 - }, - "Recon": { - "Stuart VI": 1, - "T17 Staghound": 1, - "AEC Mk. II Armoured Car": 1, - "Daimler AC": 1 - } - } - }, - "RAAS US": { - "Axis": { - "Faction": "9.SS-Panzer", - "Heavy": { - "Panzer VI Ausf. B \"KönigsTiger\"": 2, - "Panzer V Ausf. A Panther": 1, - "Panzer IV Ausf. E Tiger": 1 - }, - "Medium": { - "Jagdpanzer 38(t) Hetzer": 2, - "Panzer III Ausf. G": 3, - "Panzer IV Ausf. G": 1 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 2, - "Sd. Kfz. 222": 1, - "Panzer 38(t)": 1 - } - }, - "Allies": { - "Faction": "101st Airborne", - "Heavy": { - "Churchill Mk. IV": 1, - "Churchil Mk. VII": 2, - "Challenger Mk. VIII": 2, - "Sherman Mk. VC Firefly": 1 - }, - "Medium": { - "17pdr SP M10C Achilles": 2, - "Cromwell Mk. IV": 1, - "Valentine Mv. XI": 1, - "Sherman Mk. V": 2 - }, - "Recon": { - "Stuart VI": 2, - "AEC Mk. II Armoured Car": 1, - "Daimler AC": 1 - } - } - } - }, - "Carentan": { - "Invasion 01": { - "Axis": { - "Faction": "6 Fallschirmjaeger Regiment", - "Heavy": { - "Panzer V Ausf. A Panther": 3 - }, - "Medium": { - "Panzer IV Ausf. H": 3, - "Stug III Ausf. G": 3, - "Panzer III Ausf. G": 3, - "Marder 3 Ausf. M": 1 - }, - "Recon": { - "Sd. Kfz. 222": 1, - "Panzer II Ausf. C": 1, - "Sd. Kfz. 232": 1, - "Panzer 38(t)": 1 - } - }, - "Allies": { - "Faction": "101st Airborne", - "Heavy": null, - "Medium": { - "M4A3 Sherman Wade": 3, - "M10 GMC": 1, - "M18 Hellcat": 2, - "M4A3 Sherman": 3 - }, - "Recon": { - "M8 Greyhound": 3, - "M5A1 Stuart": 1 - } - } - }, - "Offensive 01": { - "Axis": { - "Faction": "6 Fallschirmjaeger Regiment", - "Heavy": { - "Panzer IV Ausf. E Tiger": 3 - }, - "Medium": { - "Marder 3 Ausf. M": 2, - "Stug III Ausf. G": 2, - "Panzer III Ausf. G": 3 - }, - "Recon": { - "Sd. Kfz. 232": 2 - } - }, - "Allies": { - "Faction": "101st Airborne", - "Heavy": null, - "Medium": { - "M10 GMC": 2, - "M18 Hellcat":2, - "M4A3 Sherman": 2, - "M4A3 Sherman Wade": 3 - }, - "Recon": { - "M5A1 Stuart": 5 - } - } - }, - "Offensive 02": { - "Axis":{ - "Faction": "6 Fallschirmjaeger Regiment", - "Heavy": { - "Panzer V Ausf. A Panther": 3 - }, - "Medium": { - "Stug III Ausf. G": 3, - "Marder 3 Ausf. M": 1, - "Sturmhaubitze 42 \"StuH\"": 1, - "Panzer IV Ausf. G": 2, - "Panzer IV Ausf. H": 1 - }, - "Recon": { - "Sd. Kfz. 232": 2 - } - }, - "Allies":{ - "Faction": "101st Airborne", - "Heavy": null, - "Medium": { - "M10 GMC": 2, - "M18 Hellcat": 2, - "M4A3 Sherman": 2, - "M4A3 Sherman Wade": 3 - }, - "Recon": { - "M8 Greyhound": 1, - "M5A1 Stuart": 3 - } - } - }, - "Offensive 03": { - "Axis":{ - "Faction": "6 Fallschirmjaeger Regiment", - "Heavy": { - "Panzer V Ausf. A Panther": 3 - }, - "Medium": { - "Stug III Ausf. G": 2, - "Marder 3 Ausf. M": 1, - "Panzer III Ausf. G": 3, - "Panzer IV Ausf. H": 3 - }, - "Recon": { - "Sd. Kfz. 222": 1, - "Panzer II Ausf. C": 1, - "Sd. Kfz. 232": 1, - "Panzer 38(t)": 1 - } - }, - "Allies":{ - "Faction": "101st Airborne", - "Heavy": null, - "Medium": { - "M10 GMC": 2, - "M18 Hellcat": 2, - "M4A3 Sherman": 2, - "M4A3 Sherman Wade": 3 - }, - "Recon": { - "M8 Greyhound": 5 - } - } - }, - "RAAS US": { - "Axis":{ - "Faction": "6 Fallschirmjaeger Regiment", - "Heavy": { - "Panzer IV Ausf. E Tiger": 3 - }, - "Medium": { - "Stug III Ausf. G": 3, - "Marder 3 Ausf. M": 1, - "Sturmhaubitze 42 \"StuH\"": 1, - "Panzer IV Ausf. G": 2, - "Panzer IV Ausf. H": 1 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 2, - "Panzer 38(t)": 1 - } - }, - "Allies":{ - "Faction": "101st Airborne", - "Heavy": null, - "Medium": { - "M10 GMC": 1, - "M4A3 Sherman": 3, - "M4A3 Sherman Wade": 5 - }, - "Recon": { - "M8 Greyhound": 5 - } - } - }, - "Supremacy 1944": { - "Axis":{ - "Faction": "6 Fallschirmjaeger Regiment", - "Heavy": { - "Panzer IV Ausf. E Tiger": 3 - }, - "Medium": { - "Stug III Ausf. G": 2, - "Marder 3 Ausf. M": 1, - "Panzer IV Ausf. H": 3, - "Panzer III Ausf. G": 3 - }, - "Recon": { - "Sd. Kfz. 232": 2 - } - }, - "Allies":{ - "Faction": "101st Airborne", - "Heavy": null, - "Medium": { - "M10 GMC": 1, - "M18 Hellcat": 2, - "M4A3 Sherman": 3, - "M4A3 Sherman Wade": 3 - }, - "Recon": { - "M5A1 Stuart": 5 - } - } - } - }, - "Colmar": { - "Offensive 01": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzerjäger Tiger Ausf. B Jagdtiger": 1, - "Nashorn": 1, - "Panzer V Ausf. A Panther": 3 - }, - "Medium": { - "Flakpanzer IV Ostwind": 1, - "Panzer III Ausf. G": 2, - "Jagdpanzer IV L48 Late War": 1, - "Jagdpanzer 38(t) Hetzer": 2, - "Marder 3 Ausf. M": 2 - }, - "Recon": { - "Panzer 38(t)": 2, - "Sd. Kfz. 232": 3, - "Sd. Kfz. 222": 2 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M26 Pershing": 4, - "M4A3E2 Sherman \"Jumbo\"": 2 - }, - "Medium": { - "M10 GMC": 2, - "M36 Jackson": 2, - "T34 Calliope": 1, - "M4A3 Sherman": 4 - }, - "Recon": { - "M8 Greyhound": 2, - "M5A1 Stuart": 2 - } - } - }, - "Offensive 02": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzer VI Ausf. E Tiger": 5 - }, - "Medium": { - "Panzer IV Ausf. H": 2, - "Jagdpanzer IV L70": 2, - "Jagdpanzer IV L48 Late War": 1, - "Jagdpanzer 38(t) Hetzer": 2, - "Flakpanzer IV Ostwind": 1, - "Stug III Ausf. G": 2 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 2, - "Sd. Kfz. 232": 2, - "Sd. Kfz. 222": 2, - "Sd. Kfz. 234/4 Stummel": 1 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3 (76) W HVSS Sherman": 2, - "M4A3E2 Sherman \"Jumbo\"": 2, - "M26 Pershing": 2 - }, - "Medium": { - "M10 GMC": 3, - "M18 Hellcat": 3, - "M4A3 Sherman": 4 - }, - "Recon": { - "M8 Greyhound": 3, - "M5A1 Stuart": 3, - "M24 Chaffee": 3 - } - } - }, - "Offensive 03": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzerjäger Tiger Ausf. B Jagdtiger": 1, - "Panzer V Ausf. A Panther": 3 - }, - "Medium": { - "Panzer IV Ausf. H": 3, - "Jagdpanzer IV L70": 2, - "Jagdpanzer IV L48 Late War": 1, - "Stug III Ausf. G": 3, - "Marder 3 Ausf. M": 2 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 2, - "Sd. Kfz. 232": 2, - "Sd. Kfz. 222": 1, - "Sd. Kfz. 234/4 Stummel": 2 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3 (76) W HVSS Sherman": 2, - "M4A3E2 Sherman \"Jumbo\"": 2, - "M26 Pershing": 2 - }, - "Medium": { - "M18 Hellcat": 2, - "M4A3 Sherman": 4, - "M36 Jackson": 3 - }, - "Recon": { - "M8 Greyhound": 3, - "M5A1 Stuart": 3, - "M24 Chaffee": 3 - } - } - }, - "Offensive 04": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzerjäger Tiger Ausf. B Jagdtiger": 2, - "Panzer VI Ausf. B \"KönigsTiger\"": 2 - }, - "Medium": { - "Panzer IV Ausf. H": 3, - "Jagdpanzer IV L70": 2, - "Jagdpanzer IV L48 Late War": 1, - "Stug III Ausf. G": 2, - "Marder 3 Ausf. M": 2 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 2, - "Sd. Kfz. 232": 2, - "Sd. Kfz. 234/4 Stummel": 1 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3 (76) W HVSS Sherman": 1, - "M4A3E2 Sherman \"Jumbo\"": 3, - "M26 Pershing": 2 - }, - "Medium": { - "T34 Calliope": 1, - "M10 GMC": 2, - "M36 Jackson": 2, - "M18 Hellcat": 2, - "M4A3 Sherman": 2 - }, - "Recon": { - "M8 Greyhound": 3, - "M24 Chaffee": 2 - } - } - }, - "Offensive 05": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzer VI Ausf. E Tiger": 5 - }, - "Medium": { - "Stug III Ausf. G": 2, - "Sturmhaubitze 42 \"StuH\"": 2, - "Jagdpanzer IV L48 Late War": 2, - "Panzer IV Ausf. G": 3, - "Flakpanzer IV Ostwind": 1 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 2, - "Sd. Kfz. 232": 2, - "Sd. Kfz. 222": 1, - "Sd. Kfz. 234/4 Stummel": 2 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3 (76) W HVSS Sherman": 1, - "M4A3E2 Sherman \"Jumbo\"": 3, - "M26 Pershing": 2 - }, - "Medium": { - "T34 Calliope": 1, - "M10 GMC": 2, - "M36 Jackson": 2, - "M4A3 Sherman": 4 - }, - "Recon": { - "M8 Greyhound": 2, - "M5A1 Stuart": 2 - } - } - }, - "Offensive 06": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzer VI Ausf. E Tiger": 3, - "Panzer VI Ausf. B \"KönigsTiger\"": 1, - "Nashorn": 1 - }, - "Medium": { - "Jagdpanzer IV L48 Late War": 1, - "Panzer III Ausf. G": 2, - "Flakpanzer IV Ostwind": 1, - "Marder 3 Ausf. M": 2, - "Jagdpanzer 38(t) Hetzer": 2 - }, - "Recon": { - "Sd. Kfz. 232": 3, - "Sd. Kfz. 222": 2, - "Panzer 38(t)": 2 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3 (76) W HVSS Sherman": 2, - "M4A3E2 Sherman \"Jumbo\"": 2, - "M26 Pershing": 2 - }, - "Medium": { - "M10 GMC": 3, - "M18 Hellcat": 3, - "M4A3 Sherman": 4 - }, - "Recon": { - "M8 Greyhound": 3, - "M5A1 Stuart": 3, - "M24 Chaffee": 3 - } - } - }, - "Offensive 07": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzer V Ausf. A Panther": 3, - "Nashorn": 1, - "Panzerjäger Tiger Ausf. B Jagdtiger": 1 - }, - "Medium": { - "Jagdpanzer IV L48 Late War": 2, - "Panzer IV Ausf. G": 3, - "Flakpanzer IV Ostwind": 1, - "Stug III Ausf. G": 2, - "Sturmhaubitze 42 \"StuH\"": 2 - }, - "Recon": { - "Sd. Kfz. 234 \"Puma\"": 1, - "Sd. Kfz. 232": 3, - "Panzer 38(t)": 2 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3 (76) W HVSS Sherman": 2, - "M26 Pershing": 3 - }, - "Medium": { - "M10 GMC": 3, - "M18 Hellcat": 3, - "M4A3 Sherman": 4 - }, - "Recon": { - "M8 Greyhound": 3, - "M5A1 Stuart": 3, - "M24 Chaffee": 3 - } - } - }, - "Offensive 08": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzer VI Ausf. B \"KönigsTiger\"": 2, - "Panzerjäger Tiger Ausf. B Jagdtiger": 2 - }, - "Medium": { - "Panzer IV Ausf. H": 2, - "Jagdpanzer IV L70": 2, - "Jagdpanzer IV L48 Late War": 1, - "Stug III Ausf. G": 2, - "Flakpanzer IV Ostwind": 1, - "Jagdpanzer 38(t) Hetzer": 2 - }, - "Recon": { - "Sd. Kfz. 222": 2, - "Sd. Kfz. 232": 3, - "Panzer 38(t)": 2 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3 (76) W HVSS Sherman": 1, - "M26 Pershing": 2, - "M4A3E2 Sherman \"Jumbo\"": 3 - }, - "Medium": { - "M10 GMC": 3, - "M18 Hellcat": 3, - "M4A3 Sherman": 4 - }, - "Recon": { - "M8 Greyhound": 2, - "M5A1 Stuart": 2 - } - } - }, - "Offensive 09": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzer VI Ausf. E Tiger": 5 - }, - "Medium": { - "Panzer IV Ausf. G": 3, - "Jagdpanzer IV L48 Late War": 2, - "Stug III Ausf. G": 2, - "Flakpanzer IV Ostwind": 1, - "Sturmhaubitze 42 \"StuH\"": 2 - }, - "Recon": { - "Panzer 38(t)": 2, - "Sd. Kfz. 232": 1, - "Sd. Kfz. 222": 2, - "Panzer II Ausf. C": 2 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3 (76) W HVSS Sherman": 3, - "M4A3E2 Sherman \"Jumbo\"": 3 - }, - "Medium": { - "M10 GMC": 2, - "M18 Hellcat": 2, - "M4A3 Sherman": 3, - "M36 Jackson": 2 - }, - "Recon": { - "M8 Greyhound": 3, - "M24 Chaffee": 2 - } - } - }, - "Offensive 10": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzer VI Ausf. E Tiger": 2, - "Nashorn": 1, - "Panzerjäger Tiger Ausf. B Jagdtiger": 1, - "Panzer V Ausf. A Panther": 2 - }, - "Medium": { - "Stug III Ausf. G": 2, - "Sturmhaubitze 42 \"StuH\"": 2, - "Jagdpanzer IV L48 Late War": 2, - "Panzer IV Ausf. G": 3, - "Flakpanzer IV Ostwind": 1 - }, - "Recon": { - "Panzer 38(t)": 2, - "Sd. Kfz. 232": 2, - "Sd. Kfz. 234 \"Puma\"": 1 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3 (76) W HVSS Sherman": 1, - "M4A3E2 Sherman \"Jumbo\"": 3, - "M26 Pershing": 2 - }, - "Medium": { - "M10 GMC": 3, - "M18 Hellcat": 3, - "M4A3 Sherman": 4 - }, - "Recon": { - "M8 Greyhound": 3, - "M5A1 Stuart": 2 - } - } - }, - "Offensive 11": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Panzer VI Ausf. E Tiger": 3, - "Nashorn": 1, - "Panzer VI Ausf. B \"KönigsTiger\"": 1 - }, - "Medium": { - "Panzer IV Ausf. H": 3, - "Stug III Ausf. G": 2, - "Jagdpanzer IV L48 Late War": 1, - "Jagdpanzer IV L70": 2, - "Marder 3 Ausf. M": 2 - }, - "Recon": { - "Panzer 38(t)": 2, - "Sd. Kfz. 232": 2, - "Sd. Kfz. 234 \"Puma\"": 1 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3 (76) W HVSS Sherman": 2, - "M4A3E2 Sherman \"Jumbo\"": 1, - "M26 Pershing": 3 - }, - "Medium": { - "M4A3 Sherman": 6, - "T34 Calliope": 3 - }, - "Recon": { - "M8 Greyhound": 2, - "M5A1 Stuart": 2, - "M24 Chaffee": 1 - } - } - }, - "Offensive 12": { - "Axis":{ - "Faction": "Wehrmacht", - "Heavy": { - "Nashorn": 1, - "Panzerjäger Tiger Ausf. B Jagdtiger": 1, - "Panzer V Ausf. A Panther": 3 - }, - "Medium": { - "Panzer IV Ausf. G": 4, - "Jagdpanzer IV L70": 2, - "Flakpanzer IV Ostwind": 1, - "Stug III Ausf. G": 2, - "Jagdpanzer 38(t) Hetzer": 2, - "Sturmhaubitze 42 \"StuH\"": 2 - }, - "Recon": { - "Sd. Kfz. 234/4 Stummel": 2, - "Sd. Kfz. 222": 1, - "Sd. Kfz. 232": 2, - "Sd. Kfz. 234 \"Puma\"": 2 - } - }, - "Allies":{ - "Faction": "1re Armée", - "Heavy": { - "M4A3E2 Sherman \"Jumbo\"": 2, - "M26 Pershing": 4 - }, - "Medium": { - "M10 GMC": 3, - "M18 Hellcat": 3, - "M4A3 Sherman": 4 - }, - "Recon": { - "M8 Greyhound": 2, - "M5A1 Stuart": 2, - "M24 Chaffee": 1 - } - } - } - } -} \ No newline at end of file From 22f7c100bac1898f9b9bcd9b893fe8bf65a943b1 Mon Sep 17 00:00:00 2001 From: Maximus7474 Date: Fri, 16 Aug 2024 23:55:32 +0200 Subject: [PATCH 7/8] feat(vehicleInfo): missing US Vehicles --- data/vehicleInfo.json | 267 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 267 insertions(+) diff --git a/data/vehicleInfo.json b/data/vehicleInfo.json index 6f5221a..dfa6d4c 100644 --- a/data/vehicleInfo.json +++ b/data/vehicleInfo.json @@ -818,6 +818,214 @@ "APC-T": "X" } } + }, + "M5A1 Stuart": { + "team": "Allies", + "type": "Light Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Hull Gunner", "Commander" + ], + "passengers": 4, + "caliber": "37mm", + "shells": { + "AP-T": "X", + "APC": "X" + } + } + }, + "M4A3 Sherman": { + "team": "Allies", + "type": "Medium Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Hull Gunner", "Commander" + ], + "passengers": 7, + "caliber": "75mm", + "shells": { + "AP-T": "X", + "APCBC-HE-T": "X" + } + } + }, + "T34 Calliope": { + "team": "Allies", + "type": "Medium Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Hull Gunner", "Commander" + ], + "passengers": 0, + "caliber": "75mm", + "shells": { + "AP-T": "X", + "APCBC-HE-T": "X" + } + } + }, + "M4A3E2 Sherman \"Jumbo\"": { + "team": "Allies", + "type": "HEavy Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Hull Gunner", "Commander" + ], + "passengers": 5, + "caliber": "75mm", + "shells": { + "AP-T": "X", + "APCBC-HE-T": "X" + } + } + }, + "M4A3 Sherman Wade": { + "team": "Allies", + "type": "Medium Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Hull Gunner", "Commander" + ], + "passengers": 5, + "caliber": "75mm", + "shells": { + "AP-T": "X", + "APCBC-HE-T": "X" + } + } + }, + "M4A3 (76) HVSS Sherman": { + "team": "Allies", + "type": "Heavy Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Hull Gunner", "Commander" + ], + "passengers": 5, + "caliber": "76mm", + "shells": { + "AP-T": "X", + "APCBC-HE-T": "X", + "HVAP-T": "X" + } + } + }, + "M10 GMC": { + "team": "Allies", + "type": "Medium Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Hull Gunner", "Commander" + ], + "passengers": 5, + "caliber": "76mm", + "shells": { + "AP-T": "X", + "APCBC-HE-T": "X", + "HVAP-T": "X" + } + } + }, + "M18 Hellcat": { + "team": "Allies", + "type": "Medium Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Commander" + ], + "passengers": 4, + "caliber": "76mm", + "shells": { + "AP-T": "X", + "APCBC-HE-T": "X", + "HVAP-T": "X" + } + } + }, + "M8 Greyhound": { + "team": "Allies", + "type": "Recon Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Commander" + ], + "passengers": 5, + "caliber": "37mm", + "shells": { + "AP-T": "X", + "APC-T": "X" + } + } + }, + "M24 Chaffee": { + "team": "Allies", + "type": "Light Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Hull Gunner", "Commander" + ], + "passengers": 5, + "caliber": "75mm", + "shells": { + "AP-T": "X", + "APCBC-HE-T": "X" + } + } + }, + "M26 Pershing": { + "team": "Allies", + "type": "Heavy Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Hull Gunner", "Commander" + ], + "passengers": 7, + "caliber": "90mm", + "shells": { + "APCBC": "X", + "HVAP": "X", + "APBC-T": "X" + } + } + }, + "M36 Jackson": { + "team": "Allies", + "type": "Medium Tank", + "factions": ["101st Airborne"], + "chapters": ["I", "III"], + "details": { + "crew": [ + "Driver", "Gunner", "Commander" + ], + "passengers": 4, + "caliber": "90mm", + "shells": { + "APCBC": "X", + "APCR-T": "X" + } + } } }, "vehicles": { @@ -1050,6 +1258,47 @@ "weaponry": { "75mm Anti Tank Canon": 1 } + }, + "Jeep Willys US M1919a4": { + "team": "Allies", + "class": "Specialized", + "factions": ["101st Airborne"], + "chapters": ["III"], + "seats": 4, + "weaponry": { + "Browning Machine Gun": 1 + } + }, + "M3 Halftrack": { + "team": "Allies", + "class": "Specialized", + "type": "Transport", + "factions": ["101st Airborne"], + "chapters": ["III"], + "seats": 11, + "weaponry": null + }, + "M3 GMC": { + "team": "Allies", + "class": "Specialized", + "type": "Tank Destroyer", + "factions": ["101st Airborne"], + "chapters": ["III"], + "seats": 4, + "weaponry": { + "75mm M1897A4": 1 + } + }, + "M20 Armoured Utility Car": { + "team": "Allies", + "class": "Specialized", + "type": "Armoured Car", + "factions": ["101st Airborne"], + "chapters": ["III"], + "seats": 6, + "weaponry": { + "M2 .50cal": 1 + } } }, "canons": { @@ -1106,6 +1355,24 @@ "weaponry": { "57mm Canon": 1 } + }, + "M1 Anti-Tank Gun": { + "team": "Allies", + "type": "Anti-Tank Gun", + "factions": ["101st Airborne"], + "chapters": ["III"], + "weaponry": { + "57mm Canon": 1 + } + }, + "M3 37mm AT Gun": { + "team": "Allies", + "type": "Anti-Tank Gun", + "factions": ["101st Airborne"], + "chapters": ["III"], + "weaponry": { + "37mm Canon": 1 + } } } } \ No newline at end of file From e6e2c5614760aca4351a269eac112239489e99c6 Mon Sep 17 00:00:00 2001 From: Maximus7474 Date: Sat, 17 Aug 2024 00:00:44 +0200 Subject: [PATCH 8/8] chore: update readme on subject of contributing to vehicleInfo.json --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6aba946..c606ab5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ ![](https://img.shields.io/github/v/release/Maximus7474/Squad44Bot?logo=github) -This Bot is a simple test to try integrations out including web queries and sorting data. +## Contributing +- The `vehicleInfo.json` is work in progress, data __will__ be inacurate/wrong, PRs are welcome to amend the data as well as Issues for improving data display/storage. Thanks to [FissionFeline](https://github.com/FissionFeline) for the template used to get the bot started. You can find it [here](https://github.com/FissionFeline/discord-js-template) to use it yourself and start or continue learning __discord.js__