twitchdev/twitch-cli

[Bug] Count argument does not work for gifted subs

Closed this issue · 2 comments

What is the problem?

According to the argument list (-h), you should be able to use either -c | --count int to specify how many gifts the event should contain. However, this argument doesn't seem to be respected, and instead it always contains 5 gifts.
image

Operating System

Windows 11

Architecture Version (x86, x64, arm, etc)

x64

Steps to reproduce

  1. Start websocket server using CLI
  2. Trigger a channel.subscription.gift event with no arguments, it'll contain 5 gifted subs.
  3. Trigger another channel.subscription.gift event, this time with the argument --count 1, and it will still contain 5 gifted subs.

Relevant log output

PS C:\Users\User> twitch event trigger channel.subscription.gift --count 1 --transport=websocket

✔ Forwarded for use in mock EventSub WebSocket server
{"subscription":{"id":"f7fd3122-3c7e-f262-f8bd-012c1175daa6","status":"enabled","type":"channel.subscription.gift","version":"1","condition":{"broadcaster_user_id":"85103678"},"transport":{"method":"websocket","session_id":"WebSocket-Server-Will-Set"},"created_at":"2023-06-24T11:41:56.125244Z","cost":0},"event":{"broadcaster_user_id":"85103678","broadcaster_user_login":"testBroadcaster","broadcaster_user_name":"testBroadcaster","cumulative_total":78,"is_anonymous":false,"tier":"1000","total":5,"user_id":"64266685","user_login":"testFromUser","user_name":"testFromUser"}}
Xemdo commented

--count will run the event multiple times. For subs, you can use --cost instead.

The help documentation didn't note this, so I'm gonna change up the documentation to be as follows:

  -C, --cost int                     Amount of subscriptions, bits, or channel points redeemed/used in the event.
  -c, --count int                    Number of times to run an event. This can be used to simulate rapid events, such as multiple sub gifts, or large number of cheers. (default 1)

--count will run the event multiple times. For subs, you can use --cost instead.

The help documentation didn't note this, so I'm gonna change up the documentation to be as follows:

  -C, --cost int                     Amount of subscriptions, bits, or channel points redeemed/used in the event.
  -c, --count int                    Number of times to run an event. This can be used to simulate rapid events, such as multiple sub gifts, or large number of cheers. (default 1)

Ah, that worked perfectly, thank you! I did notice --tier doesn't work for gifts either, but I'll raise a separate ticket for that. :)