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

Stickers documentation #2155

Merged
merged 9 commits into from
Nov 13, 2020
Merged

Stickers documentation #2155

merged 9 commits into from
Nov 13, 2020

Conversation

puddi
Copy link
Contributor

@puddi puddi commented Oct 15, 2020

adding a new field to the messages object for stickers, with new tables to explain the actual new type of stickers object (joint work w/ @jfurrow)

@puddi puddi requested a review from msciotti October 15, 2020 22:32
@apacheli
Copy link
Contributor

Any documentation for CDN?

We were discussing about the CDN URLs earlier in the Discord API server and discovered that https://discord.com/stickers and https://cdn.discordapp.com/stickers were both valid.

@RedDaedalus
Copy link
Contributor

Error code 50081 might be worth documenting as well. Not sure since bots can't use stickers.

@advaith1
Copy link
Contributor

looks like bots can also access /sticker-packs/directory/:layoutid:

  • client uses the layout id 758482250722574376
  • error 10033 Unknown Store Directory Layout
  • query params with_store_listings boolean and country_code

and when bots try to send stickers in a message by including sticker_ids, it returns error 50081 Cannot use this sticker; will bot be able to send stickers in the future?

Copy link
Contributor

@msciotti msciotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple nits then LGTM.

It's worth adding the JSON error code to this table: https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes

And also documenting the CDN URL for stickers here: https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints

@@ -202,6 +202,7 @@ Represents a message sent in a channel within Discord.
| application? | [message application](#DOCS_RESOURCES_CHANNEL/message-object-message-application-structure) object | sent with Rich Presence-related chat embeds |
| message_reference? | [message reference](#DOCS_RESOURCES_CHANNEL/message-object-message-reference-structure) object | reference data sent with crossposted messages |
| flags? | integer | [message flags](#DOCS_RESOURCES_CHANNEL/message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) |
| stickers? | array of [sticker](#DOCS_RESOURCES_CHANNEL/message-sticker-structure) objects | the stickers sent with the message |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be #DOCS_RESOURCE_CHANNEL/message-object-message-sticker-structure

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also might be worth saying in the description that bots can only receive stickers, and not send them

@msciotti
Copy link
Contributor

looks like bots can also access /sticker-packs/directory/:layoutid:

  • client uses the layout id 758482250722574376
  • error 10033 Unknown Store Directory Layout
  • query params with_store_listings boolean and country_code

and when bots try to send stickers in a message by including sticker_ids, it returns error 50081 Cannot use this sticker; will bot be able to send stickers in the future?

Bots don't need to access the directory layout so we can leave it undocumented. The team can decide if they wanna lock down the route or not. But the error code is worth documenting.

There's no ETA on bots sending stickers right now. It's a bit complex because of the necessity of entitlements to send stickers, and since bots can't "buy" things, they can't have an entitlement to send a sticker.

Feature request heard :) But probably not a thing in any near future unless it gets reprioritized.

@@ -202,6 +202,7 @@ Represents a message sent in a channel within Discord.
| application? | [message application](#DOCS_RESOURCES_CHANNEL/message-object-message-application-structure) object | sent with Rich Presence-related chat embeds |
| message_reference? | [message reference](#DOCS_RESOURCES_CHANNEL/message-object-message-reference-structure) object | reference data sent with crossposted messages |
| flags? | integer | [message flags](#DOCS_RESOURCES_CHANNEL/message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) |
| stickers? | array of [sticker](#DOCS_RESOURCE_CHANNEL/message-object-message-sticker-structure) objects | the stickers sent with the message (bots currently can only recieve messages with stickers, not send) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| stickers? | array of [sticker](#DOCS_RESOURCE_CHANNEL/message-object-message-sticker-structure) objects | the stickers sent with the message (bots currently can only recieve messages with stickers, not send) |
| stickers? | array of [sticker](#DOCS_RESOURCE_CHANNEL/message-object-message-sticker-structure) objects | the stickers sent with the message (bots currently can only receive messages with stickers, not send) |

https://youtu.be/YHqERNzRkCE

@puddi puddi requested a review from msciotti October 16, 2020 18:16
| preview_asset\* | ?string | sticker preview asset hash |
| format_type | integer | [type of sticker format](#DOCS_RESOURCES_CHANNEL/message-object-sticker-format-types) |

\* Sticker asset hashes currently cannot be resolved to an image.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem true though? at least for png/apng stickers; https://cdn.discordapp.com/stickers/748293547572330607/067a41f0df36a1d0925078ded077824c.png?size=512 is the image from the id and asset

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@puddi Let's instead just say that the URL for fetching them is private

@advaith1 It's possible, but we don't want to yet document it. There's lots of undocumented but technically available things within our API. In this case, where we host stuff could be subject to change (since we have two URLs that resolve there right now, lol) and we don't want everyone scraping stickers yet outside of our experiment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msciotti comment updated!

Copy link
Contributor

@msciotti msciotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add a small bit in Changelog.md saying these fields have been added. Otherwise LGTM

@puddi puddi merged commit b9ffd52 into master Nov 13, 2020
@puddi puddi deleted the stickers-docs branch November 13, 2020 23:18
BartArys added a commit to kordlib/kord that referenced this pull request Nov 28, 2020
l7ssha added a commit to nyxx-discord/nyxx that referenced this pull request Feb 11, 2021
l7ssha added a commit to nyxx-discord/nyxx that referenced this pull request Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants