twitch-cli icon indicating copy to clipboard operation
twitch-cli copied to clipboard

"Use my payload"

Open BarryCarlyon opened this issue 4 years ago • 0 comments

For eventsub it would be useful to do one or more of the following:

Provide a default "base payload" that contains some (but not all) keys.

So if I pass in:

{
        "broadcaster_user_id": "1337",
        "broadcaster_user_login": "cool_user",
        "broadcaster_user_name": "Cool_User",
}

A "test" of channel.update would overwrite the keys in

https://github.com/twitchdev/twitch-cli/blob/main/internal/events/types/stream_change/stream_change_event.go#L68

with the keys from the JSON above.

The JSON, could be a "default" JSON file/blob specified in the config. or at run time either via < pass in or --file argument --file could also logically be a configuration variable.

or

twitch event configure broadcaster_user_id x

Would define a broadcaster_user_id to use always until I unset

twitch event unconfigure broadcaster_user_id

-f would still override a preconfigure

Further to this a

twitch event signsend EVENTYPE < somefile.json

Would also suffice.

Use Case:

Say for example I am testing my endpoint for message types for a specific streamer, I don't want to have to type in/specify the broadcasterID every time (and the login/name being correct is a +)

Or I would chain a twitch-cli api users call into an eventsub call to populate the broadcaster (after suitable command line schnanaigans to provide the accurate user_login/name from an ID)

Notes:

This is a bit rambly and I need to refine this feature request a little.

BarryCarlyon avatar Oct 04 '21 14:10 BarryCarlyon