You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constwebsubDeprecationNotice="Halt! It appears you are trying to use WebSub, which has been deprecated. For more information, see: https://discuss.dev.twitch.tv/t/deprecation-of-websub-based-webhooks/32152"
16
+
15
17
var (
16
18
isAnonymousbool
17
19
forwardAddressstring
@@ -33,7 +35,7 @@ var (
33
35
34
36
vareventCmd=&cobra.Command{
35
37
Use: "event",
36
-
Short: "Used to interface with Event services, such as Eventsub and Websub.",
// flags for forwarding functionality/changing payloads
79
84
triggerCmd.Flags().StringVarP(&forwardAddress, "forward-address", "F", "", "Forward address for mock event.")
80
85
triggerCmd.Flags().StringVarP(&transport, "transport", "T", "eventsub", fmt.Sprintf("Preferred transport method for event. Defaults to /EventSub.\nSupported values: %s", events.ValidTransports()))
81
-
triggerCmd.Flags().StringVarP(&secret, "secret", "s", "", "Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC.")
86
+
triggerCmd.Flags().StringVarP(&secret, "secret", "s", "", "Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC and must be 10-100 characters in length.")
82
87
83
88
// per-topic flags
84
89
triggerCmd.Flags().StringVarP(&toUser, "to-user", "t", "", "User ID of the receiver of the event. For example, the user that receives a follow. In most contexts, this is the broadcaster.")
@@ -96,13 +101,13 @@ func init() {
96
101
// retrigger flags
97
102
retriggerCmd.Flags().StringVarP(&forwardAddress, "forward-address", "F", "", "Forward address for mock event.")
98
103
retriggerCmd.Flags().StringVarP(&eventID, "id", "i", "", "ID of the event to be refired.")
99
-
retriggerCmd.Flags().StringVarP(&secret, "secret", "s", "", "Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC.")
104
+
retriggerCmd.Flags().StringVarP(&secret, "secret", "s", "", "Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC and must be 10-100 characters in length.")
100
105
retriggerCmd.MarkFlagRequired("id")
101
106
102
107
// verify-subscription flags
103
108
verifyCmd.Flags().StringVarP(&forwardAddress, "forward-address", "F", "", "Forward address for mock event.")
104
109
verifyCmd.Flags().StringVarP(&transport, "transport", "T", "eventsub", fmt.Sprintf("Preferred transport method for event. Defaults to EventSub.\nSupported values: %s", events.ValidTransports()))
105
-
verifyCmd.Flags().StringVarP(&secret, "secret", "s", "", "Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC.")
110
+
verifyCmd.Flags().StringVarP(&secret, "secret", "s", "", "Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC and must be 10-100 characters in length.")
`--forward-address` | `-F` | Web server address for where to send mock events. | `-F https://localhost:8080` | N
66
-
`--transport` | `-T` | The method used to send events. Default is `eventsub`, but can send using `websub`. | `-T websub` | N
67
-
`--to-user` | `-t` | Denotes the receiver's TUID of the event, usually the broadcaster. | `-t 44635596` | N
68
-
`--from-user` | `-f` | Denotes the sender's TUID of the event, for example the user that follows another user or the subscriber to a broadcaster. | `-f 44635596` | N
69
-
`--gift-user` | `-g` | Used only for subcription-based events, denotes the gifting user ID | `-g 44635596` | N
70
-
`--secret` | `-s` | Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC. | `-s testsecret` | N
71
-
`--count` | `-c` | Count of events to fire. This can be used to simulate an influx of events. | `-c 100` | N
72
-
`--anonymous` | `-a` | If the event is anonymous. Only applies to `gift` and `cheer` events. | `-a` | N
73
-
`--status` | `-S` | Status of the event object, currently applies to channel points redemptions. | `-S fulfilled` | N
74
-
`--item-id` | `-i` | Manually set the ID of the event payload item (for example the reward ID in redemption events or game in stream events). | `-i 032e4a6c-4aef-11eb-a9f5-1f703d1f0b92` | N
75
-
`--item-name` | `-n` | Manually set the name of the event payload item (for example the reward ID in redemption events or game name in stream events). | `-n "Science & Technology"` | N
76
-
`--cost` | `-C` | Amount of bits or channel points redeemed/used in the event. | `-C 250` | N
77
-
`--description` | `-d` | Title the stream should be updated/started with. | `-d Awesome new title!` | N
78
-
`--game-id` | `-G` | Game ID for Drop or other relevant events. | `-G 1234` | N
63
+
| Flag | Shorthand | Description | Example | Required? (Y/N) |
|`--forward-address`|`-F`| Web server address for where to send mock events. |`-F https://localhost:8080`| N |
66
+
|`--transport`|`-T`| The method used to send events. Default is `eventsub`. |`-T eventsub`| N |
67
+
|`--to-user`|`-t`| Denotes the receiver's TUID of the event, usually the broadcaster. |`-t 44635596`| N |
68
+
|`--from-user`|`-f`| Denotes the sender's TUID of the event, for example the user that follows another user or the subscriber to a broadcaster. |`-f 44635596`| N |
69
+
|`--gift-user`|`-g`| Used only for subcription-based events, denotes the gifting user ID |`-g 44635596`| N |
70
+
|`--secret`|`-s`| Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC and must be 10-100 characters in length.|`-s testsecret`| N |
71
+
|`--count`|`-c`| Count of events to fire. This can be used to simulate an influx of events. |`-c 100`| N |
72
+
|`--anonymous`|`-a`| If the event is anonymous. Only applies to `gift` and `cheer` events. |`-a`| N |
73
+
|`--status`|`-S`| Status of the event object, currently applies to channel points redemptions. |`-S fulfilled`| N |
74
+
|`--item-id`|`-i`| Manually set the ID of the event payload item (for example the reward ID in redemption events or game in stream events). |`-i 032e4a6c-4aef-11eb-a9f5-1f703d1f0b92`| N |
75
+
|`--item-name`|`-n`| Manually set the name of the event payload item (for example the reward ID in redemption events or game name in stream events). |`-n "Science & Technology"`| N |
76
+
|`--cost`|`-C`| Amount of bits or channel points redeemed/used in the event. |`-C 250`| N |
77
+
|`--description`|`-d`| Title the stream should be updated/started with. |`-d Awesome new title!`| N |
78
+
|`--game-id`|`-G`| Game ID for Drop or other relevant events. |`-G 1234`| N |
79
79
80
80
81
-
82
-
**Examples**
83
-
84
81
```sh
85
82
twitch event trigger subscribe -F https://localhost:8080/ // triggers a randomly generated subscribe event and forwards to the localhost:8080 server
86
83
twitch event trigger cheer -f 1234 -t 4567 // generates JSON for a cheer event from user 1234 to user 4567
@@ -109,11 +106,11 @@ None
109
106
110
107
**Flags**
111
108
112
-
| Flag | Shorthand | Description | Example | Required? (Y/N) |
|`--forward-address`|`-F`| Web server address for where to send mock events. |`-F https://localhost:8080`| N |
112
+
|`--id`|`-i`| The ID of the event to refire. |`-i <id>`| Y |
113
+
|`--secret`|`-s`| Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC and must be 10-100 characters in length. |`-s testsecret`| N |
117
114
118
115
**Examples**
119
116
@@ -169,11 +166,13 @@ Allows you to test if your webserver responds to subscription requests properly.
169
166
170
167
**Flags**
171
168
172
-
| Flag | Shorthand | Description | Example | Required? (Y/N) |
|`--forward-address`|`-F`| Web server address for where to send mock subscription. |`-F https://localhost:8080`| Y |
172
+
|`--secret`|`-s`| Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC and must be 10-100 characters in length. |`-s testsecret`| N |
173
+
|`--transport`|`-T`| The method used to send events. Default is `eventsub`. |`-T eventsub`| N |
0 commit comments