twitchdev / twitch-cli

The official Twitch CLI to make developing on Twitch easier.
Apache License 2.0
612 stars 71 forks source link

Events on EventSub WebSocket should set created_at appropriately #264

Closed Xemdo closed 1 year ago

Xemdo commented 1 year ago

As described in #263, by default the created_at field is automatically set to 1 hour prior to the moment the event is created, and can be overridden with --timestamp.

The behavior should be changed to:

Example payload:

> twitch event trigger channel.charity_campaign.donate --timestamp=1999-12-31T23:59:59.0000Z
{
  "subscription": {
    "id": "9a1bde48-b26c-facf-d200-6269cf2c19a4",
    "status": "enabled",
    "type": "channel.charity_campaign.donate",
    "version": "1",
    "condition": {
      "broadcaster_user_id": "53988464"
    },
    "transport": {
      "method": "webhook",
      "callback": "null"
    },
    "created_at": "1999-12-31T23:59:59.0000Z",
    "cost": 0
  },
  "event": {
    "campaign_id": "960c7653-cb01-ee00-8fad-2ab12dd532c6",
    "id": "baf9bd8a-e5d9-08be-f7d5-190f949014e2",
    "broadcaster_user_id": "53988464",
    "broadcaster_user_name": "testBroadcaster",
    "broadcaster_user_login": "testBroadcaster",
    "user_id": "76564361",
    "user_name": "testFromUser",
    "user_login": "testFromUser",
    "charity_name": "Example Charity",
    "charity_logo": "https://abc.cloudfront.net/ppgf/1000/100.png",
    "amount": {
      "value": 10000,
      "decimal_places": 2,
      "currency": "USD"
    }
  }
}

Disclaimer