-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented the 'channel:manage:broadcast' scope #335
Conversation
/** | ||
* Whether or not to use the new channel:manage:broadcast scope | ||
*/ | ||
useNewBroadcastScope?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would reverse the logic on this, i.e. name it useLegacyBroadcastEditScope
and make it default to true.
await this._client.callApi({ | ||
type: 'helix', | ||
url: 'channels', | ||
method: 'PATCH', | ||
scope: 'user:edit:broadcast', | ||
scope: scope, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to repeat here. You can use the object shorthand in all methods.
try { | ||
const result = await this._client.callApi<HelixResponse<HelixStreamMarkerData>>({ | ||
url: 'streams/markers', | ||
method: 'POST', | ||
type: 'helix', | ||
scope: 'user:edit:broadcast', | ||
scope: scope, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shorthand
await this._client.callApi({ | ||
type: 'helix', | ||
url: 'streams/tags', | ||
scope: 'user:edit:broadcast', | ||
scope: scope, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shorthand
Superseded by #343. |
Type: Improvement
Fixes: #323
As issue #323 states, Twitch updated their API documentation a year ago to state that the "user:edit:broadcast" scope was replaced with the "channel:manage:broadcast". This PR aims at providing the possibility of passing an argument to the
ApiClient
to use it.This adds a
useNewBroadcastScope
boolean to theApiConfig
object that is used in that constructor, which alters the behaviour of the 3 relevant methods (updateChannelInfo
,createStreamMarker
andreplaceStreamTags
).