diff --git a/discord/embed.js b/discord/embed.js index aff768c3..ca27a3bd 100644 --- a/discord/embed.js +++ b/discord/embed.js @@ -630,7 +630,13 @@ export const skinCollectionSingleEmbed = async (interaction, id, user, {loadout, const skinsUuid = []; const createField = async (weaponUuid, inline=true) => { const weapon = await getWeapon(weaponUuid); - const skin = await getSkinFromSkinUuid(loadout.Guns.find(gun => gun.ID === weaponUuid).SkinID); + const skinUuid = loadout.Guns.find(gun => gun.ID === weaponUuid)?.SkinID + if(!skinUuid) return { + name: 'No information available', + value: 'Login to the game for display', + inline: inline + } + const skin = await getSkinFromSkinUuid(skinUuid); skinsUuid.push(skin); totalValue += skin.price; @@ -665,6 +671,8 @@ export const skinCollectionSingleEmbed = async (interaction, id, user, {loadout, await createField(WeaponTypeUuid.Guardian), await createField(WeaponTypeUuid.Marshal), + await createField(WeaponTypeUuid.Outlaw), + await createField(WeaponTypeUuid.Stinger), await createField(WeaponTypeUuid.Ares), await createField(WeaponTypeUuid.Odin), @@ -720,8 +728,13 @@ export const skinCollectionPageEmbed = async (interaction, id, user, {loadout, f const createEmbed = async (weaponUuid) => { const weapon = await getWeapon(weaponUuid); - const skin = await getSkinFromSkinUuid(loadout.Guns.find(gun => gun.ID === weaponUuid).SkinID); - + const skinUuid = loadout.Guns.find(gun => gun.ID === weaponUuid)?.SkinID + if(!skinUuid) return { + title: 'No information available', + description: 'Login to the game for display', + color: VAL_COLOR_1, + } + const skin = await getSkinFromSkinUuid(skinUuid); totalValue += skin.price; const starEmoji = favorites.FavoritedContent[skin.skinUuid] ? " ⭐" : ""; @@ -736,7 +749,7 @@ export const skinCollectionPageEmbed = async (interaction, id, user, {loadout, f } const pages = [ - [WeaponTypeUuid.Vandal, WeaponTypeUuid.Phantom, WeaponTypeUuid.Operator, WeaponTypeUuid.Knife], + [WeaponTypeUuid.Vandal, WeaponTypeUuid.Phantom, WeaponTypeUuid.Operator, WeaponTypeUuid.Outlaw, WeaponTypeUuid.Knife], [WeaponTypeUuid.Classic, WeaponTypeUuid.Sheriff, WeaponTypeUuid.Spectre, WeaponTypeUuid.Marshal], [WeaponTypeUuid.Frenzy, WeaponTypeUuid.Ghost, WeaponTypeUuid.Bulldog, WeaponTypeUuid.Guardian], [WeaponTypeUuid.Shorty, WeaponTypeUuid.Bucky, WeaponTypeUuid.Judge], diff --git a/misc/util.js b/misc/util.js index 237159c6..dede55a4 100644 --- a/misc/util.js +++ b/misc/util.js @@ -391,6 +391,7 @@ export const WeaponType = { Vandal: "Vandal", Marshal: "Marshal", + Outlaw: "Outlaw", Operator: "Operator", Ares: "Ares", Odin: "Odin", @@ -413,6 +414,7 @@ export const WeaponTypeUuid = { [WeaponType.Operator]: "a03b24d3-4319-996d-0f8c-94bbfba1dfc7", [WeaponType.Guardian]: "4ade7faa-4cf1-8376-95ef-39884480959b", [WeaponType.Marshal]: "c4883e50-4494-202c-3ec3-6b8a9284f00b", + [WeaponType.Outlaw]: "5f0aaf7a-4289-3998-d5ff-eb9a5cf7ef5c", [WeaponType.Spectre]: "462080d1-4035-2937-7c09-27aa2a5c27a7", [WeaponType.Stinger]: "f7e1b454-4ad4-1063-ec0a-159e56b58941", [WeaponType.Knife]: "2f59173c-4bed-b6c3-2191-dea9b58be9c7",