twitchdev / twitch-cli

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

Fixes #329 #330

Closed BarryCarlyon closed 3 months ago

BarryCarlyon commented 3 months ago

Complete the work in #322 as it broke things instead and fix #329

Testing verify trigger and retrigger (on the raid topic at least)

Notable faults/issues

Random ID usage on CP Reward add and TRN Event, this probably needs to be lifted to a field (seperate PR?)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Problem/Feature

Description of Changes:

Checklist

BarryCarlyon commented 3 months ago

This seems to have broken the retrigger_even_test though... Having a look :-D

BarryCarlyon commented 3 months ago

The fixed broken test was using the subscription ID as the store/retrieval Key which is what 322 tried to fix.

Xemdo commented 3 months ago

Tested --item-id on extension.bits_transaction.create and it seems to be working:

$ ./twitch-cli event trigger transaction --item-id=TEST

{
  "subscription": {
    "id": "6b5b7bda-1dff-fabe-a3e2-2b40c50eec11",
    "status": "enabled",
    "type": "extension.bits_transaction.create",
    "version": "1",
    "condition": {
      "extension_client_id": "gxuerabxs2v7p04d6gi4ob1zx40za2"
    },
    "transport": {
      "method": "webhook",
      "callback": "null"
    },
    "created_at": "2024-07-07T04:22:45.667109775Z",
    "cost": 1
  },
  "event": {
    "id": "e8881664-29b8-a228-8635-b7f1f354ed6b",
    "extension_client_id": "gxuerabxs2v7p04d6gi4ob1zx40za2",
    "broadcaster_user_id": "80885621",
    "broadcaster_user_login": "testBroadcaster",
    "broadcaster_user_name": "testBroadcaster",
    "user_name": "testUser",
    "user_login": "testUser",
    "user_id": "75350923",
    "product": {
      "name": "Test Trigger Item from CLI",
      "sku": "TEST",
      "bits": 100,
      "in_development": true
    }
  }
}

Same for channel.channel_points_custom_reward_redemption.add:

$ ./twitch-cli event trigger channel.channel_points_custom_reward_redemption.add --item-id=TESTTESTTEST

{
  "subscription": {
    "id": "5f19bc21-2bdb-2f81-bf6c-ab63052f0c78",
    "status": "enabled",
    "type": "channel.channel_points_custom_reward_redemption.add",
    "version": "1",
    "condition": {
      "broadcaster_user_id": "73985649"
    },
    "transport": {
      "method": "webhook",
      "callback": "null"
    },
    "created_at": "2024-07-07T04:24:49.78028451Z",
    "cost": 0
  },
  "event": {
    "id": "4148a820-405b-c633-a231-a9738bf60100",
    "broadcaster_user_id": "73985649",
    "broadcaster_user_login": "testBroadcaster",
    "broadcaster_user_name": "testBroadcaster",
    "user_id": "37829274",
    "user_login": "testFromUser",
    "user_name": "testFromUser",
    "user_input": "Test Input From CLI",
    "status": "unfulfilled",
    "reward": {
      "id": "TESTTESTTEST",
      "title": "Test Reward from CLI",
      "cost": 150,
      "prompt": "Redeem Your Test Reward from CLI"
    },
    "redeemed_at": "2024-07-07T04:24:49.78028451Z"
  }
}