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
Copy file name to clipboardExpand all lines: cmd/events.go
+18-3
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ func init() {
83
83
// flags for forwarding functionality/changing payloads
84
84
triggerCmd.Flags().StringVarP(&forwardAddress, "forward-address", "F", "", "Forward address for mock event.")
85
85
triggerCmd.Flags().StringVarP(&transport, "transport", "T", "eventsub", fmt.Sprintf("Preferred transport method for event. Defaults to /EventSub.\nSupported values: %s", events.ValidTransports()))
86
-
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.")
87
87
88
88
// per-topic flags
89
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.")
@@ -101,13 +101,13 @@ func init() {
101
101
// retrigger flags
102
102
retriggerCmd.Flags().StringVarP(&forwardAddress, "forward-address", "F", "", "Forward address for mock event.")
103
103
retriggerCmd.Flags().StringVarP(&eventID, "id", "i", "", "ID of the event to be refired.")
104
-
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.")
105
105
retriggerCmd.MarkFlagRequired("id")
106
106
107
107
// verify-subscription flags
108
108
verifyCmd.Flags().StringVarP(&forwardAddress, "forward-address", "F", "", "Forward address for mock event.")
109
109
verifyCmd.Flags().StringVarP(&transport, "transport", "T", "eventsub", fmt.Sprintf("Preferred transport method for event. Defaults to EventSub.\nSupported values: %s", events.ValidTransports()))
110
-
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
63
-
`--transport` | `-T` | The method used to send events. Default is `eventsub`. | `-T eventsub` | N
64
-
`--to-user` | `-t` | Denotes the receiver's TUID of the event, usually the broadcaster. | `-t 44635596` | N
65
-
`--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
66
-
`--gift-user` | `-g` | Used only for subcription-based events, denotes the gifting user ID | `-g 44635596` | N
67
-
`--secret` | `-s` | Webhook secret. If defined, signs all forwarded events with the SHA256 HMAC. | `-s testsecret` | N
68
-
`--count` | `-c` | Count of events to fire. This can be used to simulate an influx of events. | `-c 100` | N
69
-
`--anonymous` | `-a` | If the event is anonymous. Only applies to `gift` and `cheer` events. | `-a` | N
70
-
`--status` | `-S` | Status of the event object, currently applies to channel points redemptions. | `-S fulfilled` | N
71
-
`--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
72
-
`--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
73
-
`--cost` | `-C` | Amount of bits or channel points redeemed/used in the event. | `-C 250` | N
74
-
`--description` | `-d` | Title the stream should be updated/started with. | `-d Awesome new title!` | N
75
-
`--game-id` | `-G` | Game ID for Drop or other relevant events. | `-G 1234` | N
60
+
| Flag | Shorthand | Description | Example | Required? (Y/N) |
|`--forward-address`|`-F`| Web server address for where to send mock events. |`-F https://localhost:8080`| N |
63
+
|`--transport`|`-T`| The method used to send events. Default is `eventsub`. |`-T eventsub`| N |
64
+
|`--to-user`|`-t`| Denotes the receiver's TUID of the event, usually the broadcaster. |`-t 44635596`| N |
65
+
|`--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 |
66
+
|`--gift-user`|`-g`| Used only for subcription-based events, denotes the gifting user ID |`-g 44635596`| N |
67
+
|`--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 |
68
+
|`--count`|`-c`| Count of events to fire. This can be used to simulate an influx of events. |`-c 100`| N |
69
+
|`--anonymous`|`-a`| If the event is anonymous. Only applies to `gift` and `cheer` events. |`-a`| N |
70
+
|`--status`|`-S`| Status of the event object, currently applies to channel points redemptions. |`-S fulfilled`| N |
71
+
|`--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 |
72
+
|`--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 |
73
+
|`--cost`|`-C`| Amount of bits or channel points redeemed/used in the event. |`-C 250`| N |
74
+
|`--description`|`-d`| Title the stream should be updated/started with. |`-d Awesome new title!`| N |
75
+
|`--game-id`|`-G`| Game ID for Drop or other relevant events. |`-G 1234`| N |
76
76
77
77
78
-
79
-
**Examples**
80
-
81
78
```sh
82
79
twitch event trigger subscribe -F https://localhost:8080/ // triggers a randomly generated subscribe event and forwards to the localhost:8080 server
83
80
twitch event trigger cheer -f 1234 -t 4567 // generates JSON for a cheer event from user 1234 to user 4567
@@ -106,11 +103,11 @@ None
106
103
107
104
**Flags**
108
105
109
-
| Flag | Shorthand | Description | Example | Required? (Y/N) |
|`--forward-address`|`-F`| Web server address for where to send mock events. |`-F https://localhost:8080`| N |
109
+
|`--id`|`-i`| The ID of the event to refire. |`-i <id>`| Y |
110
+
|`--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 |
114
111
115
112
**Examples**
116
113
@@ -163,11 +160,13 @@ Allows you to test if your webserver responds to subscription requests properly.
163
160
164
161
**Flags**
165
162
166
-
| Flag | Shorthand | Description | Example | Required? (Y/N) |
|`--forward-address`|`-F`| Web server address for where to send mock subscription. |`-F https://localhost:8080`| Y |
166
+
|`--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 |
167
+
|`--transport`|`-T`| The method used to send events. Default is `eventsub`. |`-T eventsub`| N |
0 commit comments