Skip to content

Commit

Permalink
🚑 Fix lyrics passing length limit
Browse files Browse the repository at this point in the history
  • Loading branch information
eritislami committed Feb 19, 2023
1 parent d8e6391 commit e2509bd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions commands/lyrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ export default {

let lyricsEmbed = new EmbedBuilder()
.setTitle(i18n.__mf("lyrics.embedTitle", { title: title }))
.setDescription(lyrics)
.setDescription(lyrics.length >= 4096 ? `${lyrics.substr(0, 4093)}...` : lyrics)
.setColor("#F8AA2A")
.setTimestamp();

if (lyricsEmbed.data.description!.length >= 2048)
lyricsEmbed.setDescription(`${lyricsEmbed.data.description!.substr(0, 2045)}...`);

return interaction.editReply({ content: "", embeds: [lyricsEmbed] }).catch(console.error);
}
};

0 comments on commit e2509bd

Please sign in to comment.