twitchdev / issues

Issue tracker for third party developers.
Apache License 2.0
72 stars 7 forks source link

Message fragments for channel.suspicious_user.message are sparsely populated #947

Open iProdigy opened 2 months ago

iProdigy commented 2 months ago

Brief description

For channel.suspicious_user.message, fragment.type == "text" never occurs, despite that being a documented possibility.

Thus, the fragments array does not behave like fragments for every other chat eventsub topic and the corresponding pubsub topic (low-trust-users), so it is not possible to reconstruct the full message with the fragments array (as is usually possible).

EventSub example:

{
  "message_id": "71a1fdf9-7a60-4ca8-a2cc-3866595c6efe",
  "text": "hello @djclancy from https://twitch.tv/ xd Kappa yo",
  "fragments": [
    {
      "type": "emote",
      "text": "Kappa",
      "Cheermote": {
        "prefix": "",
        "bits": 0,
        "tier": 0
      },
      "emote": {
        "id": "25",
        "emote_set_id": "0"
      }
    }
  ]
}

PubSub example:

{
  "text": "hello @djclancy from https://twitch.tv/ xd Kappa yo",
  "fragments": [
    {
      "text": "hello "
    },
    {
      "text": "@djclancy",
      "user_mention": {
        "userID": "268669435",
        "login": "djclancy",
        "display_name": "DJClancy"
      }
    },
    {
      "text": " from "
    },
    {
      "text": "https://twitch.tv/"
    },
    {
      "text": " xd "
    },
    {
      "text": "Kappa",
      "emoticon": {
        "emoticonID": "25",
        "emoticonSetID": "0"
      }
    },
    {
      "text": " yo"
    }
  ]
}

How to reproduce

  1. Subscribe to channel.suspicious_user.message
  2. Send a chat message that includes non-emote text

Expected behavior

The fragments array should include each text component, not just emotes/cheermotes (just like the pubsub equivalent, and other chat eventsub topics)

Additional context or questions

This bug fix can occur in v1 or v2. If a v2 topic is created, please fix the casing for the Cheermote field name (should be a lowercase C)... also it'd be nice if message_id was moved out of the message object for consistency with other chat eventsub topics

Xemdo commented 1 month ago

Ticketed internally as APIPLAT-4759