Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Reporting for addFields value having over 1024 characters could be improved #10466

Closed
jordiedh opened this issue Aug 31, 2024 · 1 comment

Comments

@jordiedh
Copy link

jordiedh commented Aug 31, 2024

Which package is this bug report for?

discord.js

Issue description

  1. Create an embed with a field value length of over 1024 (maximum length for a field value).
  2. Error message doesn't report accurately and leaves you guessing.

Description length reports an error specifically about being over 4096 characters, so I was thinking perhaps fields should do the same.

2024-08-31 17:48:39     at _ArrayValidator.handle (/app/node_modules/@sapphire/shapeshift/src/validators/ArrayValidator.ts:21:90)
2024-08-31 17:48:39     at _ArrayValidator.parse (/app/node_modules/@sapphire/shapeshift/src/validators/BaseValidator.ts:103:2)
2024-08-31 17:48:39     at EmbedBuilder.addFields (/app/node_modules/@discordjs/builders/src/messages/embed/Embed.ts:116:29)
2024-08-31 17:48:39     at <anonymous> (/src/commands/stats.js:82:19)
2024-08-31 17:48:39     at Array.map (<anonymous>)
2024-08-31 17:48:39     at Object.setEmbedFields (/src/commands/stats.js:81:25)
2024-08-31 17:48:39     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-08-31 17:48:39     at Object.execute (/src/commands/stats.js:65:9)
2024-08-31 17:48:39     at MessageManager.handleCommand (/src/handlers/messageManager.js:175:17)

Code sample

// Pretty self explanitory.

const v = ''; // string of 1025+ chars.
const embed = new Discord.EmbedBuilder();
embed.addFields({ name: 'Test', value: v, inline: true });
<Channel>.send({ embeds: [embed] });

Versions

Issue priority

Low (slightly annoying)

Which partials do you have configured?

User, Channel, GuildMember, Message, Reaction, GuildScheduledEvent, ThreadMember

Which gateway intents are you subscribing to?

Guilds, GuildMembers, GuildModeration, GuildEmojisAndStickers, GuildIntegrations, GuildInvites, GuildVoiceStates, GuildPresences, GuildMessages, GuildMessageReactions, DirectMessages, DirectMessageReactions, MessageContent, GuildScheduledEvents, AutoModerationConfiguration, AutoModerationExecution, GuildMessagePolls, DirectMessagePolls

I have tested this issue on a development release

No response

@didinele
Copy link
Member

didinele commented Oct 2, 2024

No longer relevant as of #10448 and subsequent follow-up changes (soon). If the error is still Not Great, this issue can be re-opened.

@didinele didinele closed this as completed Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants