Skip to content

Commit

Permalink
fix: error on empty images array
Browse files Browse the repository at this point in the history
  • Loading branch information
imnaiyar committed Nov 13, 2024
1 parent e86feb8 commit da3d563
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bot/utils/dailyQuestEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const dailyQuestEmbed = (data: DailyQuestsSchema, index: number) => {
const { quests, rotating_candles } = data;
const total = quests.length;
const quest = quests[index];
let desc = `${quest.images[0].by ? ${quest.images[0].by}` : ""}\n${quest.images[0].source ? `Source: ${quest.images[0].source}` : ""}`;
let desc = `${quest.images[0]?.by ? ${quest.images[0].by}` : ""}\n${quest.images[0]?.source ? `Source: ${quest.images[0].source}` : ""}`;
const embed = new EmbedBuilder()
.setAuthor({
name: `Daily Quests (${index + 1}/${total})`,
Expand Down

0 comments on commit da3d563

Please sign in to comment.