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

[Bug] Simulated websocket event channel.subscription.message: wrong emote indexes? #338

Open
Felk opened this issue Oct 15, 2024 · 0 comments

Comments

@Felk
Copy link

Felk commented Oct 15, 2024

What is the problem?

The emote indexes in the mocked message of type channel.subscription.message v1 seems to be wrong. It provides the message Hello from the Twitch CLI! twitchdevLeek with the emote indexes Begin: 26 and End: 39.
Those indexes give you twitchdevLee instead of twitchdevLeek

See the code: https://github.com/twitchdev/twitch-cli/blame/v1.1.24/internal/events/types/subscription_message/subscription_message.go#L66

Because the commit introducing this code is labelled "updating eventsub to match production" (3f42430), I'm wondering if this is just an error in the CLI, or whether there's actually an off-by-one on Twitch. I don't have any production subscription message on hand to compare.

Operating System

Windows 10

Architecture Version (x86, x64, arm, etc)

x64

Steps to reproduce

triggering

PS C:\Users\felk> twitch event trigger channel.subscription.message --transport=websocket
✔ Forwarded for use in mock EventSub WebSocket server

gives you (prettified):

{
  "subscription": {
    "id": "2bd37600-24c5-742a-4c18-5d93fe6c111f",
    "status": "enabled",
    "type": "channel.subscription.message",
    "version": "1",
    "condition": {
      "broadcaster_user_id": "94257613"
    },
    "transport": {
      "method": "websocket",
      "session_id": "WebSocket-Server-Will-Set"
    },
    "created_at": "2024-10-15T17:28:31.7523926Z",
    "cost": 0
  },
  "event": {
    "broadcaster_user_id": "94257613",
    "broadcaster_user_login": "testBroadcaster",
    "broadcaster_user_name": "testBroadcaster",
    "cumulative_months": 41,
    "duration_months": 1,
    "message": {
      "emotes": [
        {
          "begin": 26,
          "end": 39,
          "id": "304456816"
        }
      ],
      "text": "Hello from the Twitch CLI! twitchdevLeek"
    },
    "streak_months": 41,
    "tier": "1000",
    "user_id": "83967978",
    "user_login": "testFromUser",
    "user_name": "testFromUser"
  }
}

Relevant log output

No response

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

No branches or pull requests

1 participant