From 99367354a2f5dfdb6652b2733f4b0c324419fea4 Mon Sep 17 00:00:00 2001 From: baz Date: Thu, 28 Mar 2024 20:56:56 +0000 Subject: [PATCH] Cut description down to maximum length --- commands/100-games/gameDetails.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/commands/100-games/gameDetails.js b/commands/100-games/gameDetails.js index e0cd413..6308f70 100644 --- a/commands/100-games/gameDetails.js +++ b/commands/100-games/gameDetails.js @@ -54,8 +54,14 @@ module.exports = { embed.setColor(0x6441a5); embed.setTitle(`${game.name}`); embed.setURL(`${game.url}`); - embed.setThumbnail(`${coverUrl}`); - embed.addFields({ name: 'Description', value: `${game.summary}` }); + + if (game.cover) { + embed.setThumbnail(`${coverUrl}`); + } + + if (game.summary) { + embed.addFields({ name: 'Description', value: `${game.summary.length > 1024 ? game.summary.substring(0, 1024) : game.summary}` }); + } if (game.involved_companies) { const companies = [];