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

Unintuitive error in channel patches when the topic contains an emoji message format for an emoji hosted in a guild the editing entity is not in #6772

Open
almostSouji opened this issue Mar 30, 2024 · 2 comments
Labels

Comments

@almostSouji
Copy link

almostSouji commented Mar 30, 2024

Description

The API rejects PATCH /channels/:id requests if the topic contains emoji message formats <:name:id>/<a:name:id> of emojis hosted in guilds the changing entity (moderator/bot) is not in.

I see how it makes sense to restrict the emojis one can set initially, but the current behavior prevents any changes from being applied to the channel by staff/bots that do not share the guild the emoji is hosted in.

Error code 50035 CHANNEL_TOPIC_INVALID "Channel topic contains at least one word that is not allowed." is not particularly helpful to figure this out. (This is also the error message displayed to end-users in-client).

Steps to Reproduce

A)

  • Change the description of a channel to an emoji hosted in a server you are not in <:name:id> format
  • Get a rejection of the form above

B)

  • Have another person change the topic of a channel to an emoji hosted in a server you do not share with them
  • Try to edit any property of the channel (age restrict, slow mode, etc.)
  • Get the rejection of the form above

Expected Behavior

Either allow changes, if the emoji is not initially set, or at least provide a better end-user experience by displaying a useful error that explains the issue at hand. (This is also true for developer experience with the error returned from the API)

Current Behavior

Unfitting/Unhelpful error message

{
    "message": "Invalid Form Body",
    "code": 50035,
    "errors": {
        "topic": {
            "_errors": [
                {
                    "code": "CHANNEL_TOPIC_INVALID",
                    "message": "Channel topic contains at least one word that is not allowed."
                }
            ]
        }
    }
}

Screenshots/Videos

image

Client and System Information

canary 280235 (59a8878) Host 1.0.306 x64 (45844) Windows 11 64-bit (10.0.22631)
(likely not relevant, since this is about API behavior)

@almostSouji almostSouji changed the title Unintuitive error in channel patches when the description contains an emoji message format for an emoji hosted in a guild the editing entity is not in Unintuitive error in channel patches when the topic contains an emoji message format for an emoji hosted in a guild the editing entity is not in Mar 30, 2024
@hackermondev
Copy link
Contributor

This was introduced as part of a larger security issue they fixed. I was told they were going to revert this specifically but they never did.

@just-a-flower
Copy link

There is another issue where users without Nitro cannot use emojis in the channel topic, even if they are from the current server, which should not happen, since you will have access to an emoji that is in the current server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants