-
Notifications
You must be signed in to change notification settings - Fork 575
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
Document rule for attachment names for proper functioning in embeds #2959
base: current
Are you sure you want to change the base?
Document rule for attachment names for proper functioning in embeds #2959
Conversation
src/builder/create_embed.rs
Outdated
/// The URL must be ASCII alphanumeric characters ('a-z', 'A-Z', '0-9'). | ||
/// Underscores ('\_'), dashes ('-') and dots ('.') are allowed but they must not | ||
/// appear as the first character. Otherwise, the attachment will be sent separately from the | ||
/// Embed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a misfit with the line above saying it only supports HTTP(S), either adjust that line or adjust what you have written.
I feel like this would be better served by a PR to the discord developer docs, then simply linking there, as we cannot guarantee the rules keep up to date. |
Discord does mention the rules for naming here. Though you have to dig a little to see it. Should I just link this? As for the changes requested, I was awaiting verdict on #2776 before removing the misleading HTTP(S) comment. Will remove them now. |
Yeah, please do link to it, if there is Discord documentation on something we are moving to just link to that to prevent our docs rotting so much. |
23a9c20
to
0158270
Compare
Updated as requested |
0158270
to
956a478
Compare
Rebased to make sure the edits are in the right commits. |
If you want to make that automatic, put "closes/fixes #xxx" in the PR description. See the docs for that here. |
Thanks for the tip! |
Address #2635 by documenting Discord's rules for attachment URLS in the
attachment
andimage
methods ofCreateEmbed
.It is worth noting that these rules apply to all attachment URLs. I chose to document only in
CreateEmbed
as this is, as far as I know, the only case where unexpected behaviour occurs when the name contains invalid characters. In other cases, Discord handles it by stripping or replacing the invalid characters with underscores and no error is thrown.