Skip to content

Commit 2e3be07

Browse files
author
Eviee Py
committed
Fix some scopes docs
1 parent 4fe5ab3 commit 2e3be07

File tree

1 file changed

+86
-89
lines changed

1 file changed

+86
-89
lines changed

twitchio/authentication/scopes.py

Lines changed: 86 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -84,171 +84,168 @@ class Scopes(metaclass=_ScopeMeta):
8484
8585
The Scopes class can be initialised and used a few different ways:
8686
87-
- Passing a `list[str]` of scopes to the constructor which can be in the same format as seen on Twitch.
88-
E.g. `["user:read:email", ...]`.
87+
- Passing a ``list[str]`` of scopes to the constructor which can be in the same format as seen on Twitch. E.g. ``["user:read:email", ...]``.
8988
90-
- Passing `Keyword-Arguments` to the constructor. E.g. `user_read_email=True`
89+
- Passing ``Keyword-Arguments`` to the constructor. E.g. ``user_read_email=True``
90+
91+
- Or Constructing the class without passing anything and giving each required scope a bool when needed.
92+
93+
- There is also a classmethod :meth:`.all` which selects all scopes for you.
9194
92-
- Constructing the class without passing anything and giving each required scope a bool when needed. E.g.
93-
```python
94-
scopes: twitchio.Scopes = twitchio.Scopes()
95-
scopes.user_read_email = True
96-
```
9795
98-
- There is also a classmethod [`.all`][twitchio.Scopes.all] which selects all scopes for you.
9996
10097
All scopes on this class are special descriptors.
10198
10299
Attributes
103100
----------
104101
analytics_read_extensions
105-
Equivalent to the `analytics:read:extensions` scope on Twitch.
102+
Equivalent to the ``analytics:read:extensions`` scope on Twitch.
106103
analytics_read_games
107-
Equivalent to the `analytics:read:games` scope on Twitch.
104+
Equivalent to the ``analytics:read:games`` scope on Twitch.
108105
bits_read
109-
Equivalent to the `bits:read` scope on Twitch.
106+
Equivalent to the ``bits:read`` scope on Twitch.
110107
channel_manage_ads
111-
Equivalent to the `channel:manage:ads` scope on Twitch.
108+
Equivalent to the ``channel:manage:ads`` scope on Twitch.
112109
channel_read_ads
113-
Equivalent to the `channel:read:ads` scope on Twitch.
110+
Equivalent to the ``channel:read:ads`` scope on Twitch.
114111
channel_manage_broadcast
115-
Equivalent to the `channel:manage:broadcast` scope on Twitch.
112+
Equivalent to the ``channel:manage:broadcast`` scope on Twitch.
116113
channel_read_charity
117-
Equivalent to the `channel:read:charity` scope on Twitch.
114+
Equivalent to the ``channel:read:charity`` scope on Twitch.
118115
channel_edit_commercial
119-
Equivalent to the `channel:edit:commercial` scope on Twitch.
116+
Equivalent to the ``channel:edit:commercial`` scope on Twitch.
120117
channel_read_editors
121-
Equivalent to the `channel:read:editors` scope on Twitch.
118+
Equivalent to the ``channel:read:editors`` scope on Twitch.
122119
channel_manage_extensions
123-
Equivalent to the `channel:manage:extensions` scope on Twitch.
120+
Equivalent to the ``channel:manage:extensions`` scope on Twitch.
124121
channel_read_goals
125-
Equivalent to the `channel:read:goals` scope on Twitch.
122+
Equivalent to the ``channel:read:goals`` scope on Twitch.
126123
channel_read_guest_star
127-
Equivalent to the `channel:read:guest:star` scope on Twitch.
124+
Equivalent to the ``channel:read:guest:star`` scope on Twitch.
128125
channel_manage_guest_star
129-
Equivalent to the `channel:manage:guest:star` scope on Twitch.
126+
Equivalent to the ``channel:manage:guest:star`` scope on Twitch.
130127
channel_read_hype_train
131-
Equivalent to the `channel:read:hype:train` scope on Twitch.
128+
Equivalent to the ``channel:read:hype:train`` scope on Twitch.
132129
channel_manage_moderators
133-
Equivalent to the `channel:manage:moderators` scope on Twitch.
130+
Equivalent to the ``channel:manage:moderators`` scope on Twitch.
134131
channel_read_polls
135-
Equivalent to the `channel:read:polls` scope on Twitch.
132+
Equivalent to the ``channel:read:polls`` scope on Twitch.
136133
channel_manage_polls
137-
Equivalent to the `channel:manage:polls` scope on Twitch.
134+
Equivalent to the ``channel:manage:polls`` scope on Twitch.
138135
channel_read_predictions
139-
Equivalent to the `channel:read:predictions` scope on Twitch.
136+
Equivalent to the ``channel:read:predictions`` scope on Twitch.
140137
channel_manage_predictions
141-
Equivalent to the `channel:manage:predictions` scope on Twitch.
138+
Equivalent to the ``channel:manage:predictions`` scope on Twitch.
142139
channel_manage_raids
143-
Equivalent to the `channel:manage:raids` scope on Twitch.
140+
Equivalent to the ``channel:manage:raids`` scope on Twitch.
144141
channel_read_redemptions
145-
Equivalent to the `channel:read:redemptions` scope on Twitch.
142+
Equivalent to the ``channel:read:redemptions`` scope on Twitch.
146143
channel_manage_redemptions
147-
Equivalent to the `channel:manage:redemptions` scope on Twitch.
144+
Equivalent to the ``channel:manage:redemptions`` scope on Twitch.
148145
channel_manage_schedule
149-
Equivalent to the `channel:manage:schedule` scope on Twitch.
146+
Equivalent to the ``channel:manage:schedule`` scope on Twitch.
150147
channel_read_stream_key
151-
Equivalent to the `channel:read:stream:key` scope on Twitch.
148+
Equivalent to the ``channel:read:stream:key`` scope on Twitch.
152149
channel_read_subscriptions
153-
Equivalent to the `channel:read:subscriptions` scope on Twitch.
150+
Equivalent to the ``channel:read:subscriptions`` scope on Twitch.
154151
channel_manage_videos
155-
Equivalent to the `channel:manage:videos` scope on Twitch.
152+
Equivalent to the ``channel:manage:videos`` scope on Twitch.
156153
channel_read_vips
157-
Equivalent to the `channel:read:vips` scope on Twitch.
154+
Equivalent to the ``channel:read:vips`` scope on Twitch.
158155
channel_manage_vips
159-
Equivalent to the `channel:manage:vips` scope on Twitch.
156+
Equivalent to the ``channel:manage:vips`` scope on Twitch.
160157
clips_edit
161-
Equivalent to the `clips:edit` scope on Twitch.
158+
Equivalent to the ``clips:edit`` scope on Twitch.
162159
moderation_read
163-
Equivalent to the `moderation:read` scope on Twitch.
160+
Equivalent to the ``moderation:read`` scope on Twitch.
164161
moderator_manage_announcements
165-
Equivalent to the `moderator:manage:announcements` scope on Twitch.
162+
Equivalent to the ``moderator:manage:announcements`` scope on Twitch.
166163
moderator_manage_automod
167-
Equivalent to the `moderator:manage:automod` scope on Twitch.
164+
Equivalent to the ``moderator:manage:automod`` scope on Twitch.
168165
moderator_read_automod_settings
169-
Equivalent to the `moderator:read:automod:settings` scope on Twitch.
166+
Equivalent to the ``moderator:read:automod:settings`` scope on Twitch.
170167
moderator_manage_automod_settings
171-
Equivalent to the `moderator:manage:automod:settings` scope on Twitch.
168+
Equivalent to the ``moderator:manage:automod:settings`` scope on Twitch.
172169
moderator_manage_banned_users
173-
Equivalent to the `moderator:manage:banned:users` scope on Twitch.
170+
Equivalent to the ``moderator:manage:banned:users`` scope on Twitch.
174171
moderator_read_blocked_terms
175-
Equivalent to the `moderator:read:blocked:terms` scope on Twitch.
172+
Equivalent to the ``moderator:read:blocked:terms`` scope on Twitch.
176173
moderator_manage_blocked_terms
177-
Equivalent to the `moderator:manage:blocked:terms` scope on Twitch.
174+
Equivalent to the ``moderator:manage:blocked:terms`` scope on Twitch.
178175
moderator_manage_chat_messages
179-
Equivalent to the `moderator:manage:chat:messages` scope on Twitch.
176+
Equivalent to the ``moderator:manage:chat:messages`` scope on Twitch.
180177
moderator_read_chat_settings
181-
Equivalent to the `moderator:read:chat:settings` scope on Twitch.
178+
Equivalent to the ``moderator:read:chat:settings`` scope on Twitch.
182179
moderator_manage_chat_settings
183-
Equivalent to the `moderator:manage:chat:settings` scope on Twitch.
180+
Equivalent to the ``moderator:manage:chat:settings`` scope on Twitch.
184181
moderator_read_chatters
185-
Equivalent to the `moderator:read:chatters` scope on Twitch.
182+
Equivalent to the ``moderator:read:chatters`` scope on Twitch.
186183
moderator_read_followers
187-
Equivalent to the `moderator:read:followers` scope on Twitch.
184+
Equivalent to the ``moderator:read:followers`` scope on Twitch.
188185
moderator_read_guest_star
189-
Equivalent to the `moderator:read:guest:star` scope on Twitch.
186+
Equivalent to the ``moderator:read:guest:star`` scope on Twitch.
190187
moderator_manage_guest_star
191-
Equivalent to the `moderator:manage:guest:star` scope on Twitch.
188+
Equivalent to the ``moderator:manage:guest:star`` scope on Twitch.
192189
moderator_read_shield_mode
193-
Equivalent to the `moderator:read:shield:mode` scope on Twitch.
190+
Equivalent to the ``moderator:read:shield:mode`` scope on Twitch.
194191
moderator_manage_shield_mode
195-
Equivalent to the `moderator:manage:shield:mode` scope on Twitch.
192+
Equivalent to the ``moderator:manage:shield:mode`` scope on Twitch.
196193
moderator_read_shoutouts
197-
Equivalent to the `moderator:read:shoutouts` scope on Twitch.
194+
Equivalent to the ``moderator:read:shoutouts`` scope on Twitch.
198195
moderator_manage_shoutouts
199-
Equivalent to the `moderator:manage:shoutouts` scope on Twitch.
196+
Equivalent to the ``moderator:manage:shoutouts`` scope on Twitch.
200197
moderator_read_unban_requests
201-
Equivalent to the `moderator:read:unban:requests` scope on Twitch.
198+
Equivalent to the ``moderator:read:unban:requests`` scope on Twitch.
202199
moderator_manage_unban_requests
203-
Equivalent to the `moderator:manage:unban:requests` scope on Twitch.
200+
Equivalent to the ``moderator:manage:unban:requests`` scope on Twitch.
204201
moderator_read_warnings
205-
Equivalent to the `moderator:read:warnings` scope on Twitch.
202+
Equivalent to the ``moderator:read:warnings`` scope on Twitch.
206203
moderator_manage_warnings
207-
Equivalent to the `moderator:manage:warnings` scope on Twitch.
204+
Equivalent to the ``moderator:manage:warnings`` scope on Twitch.
208205
user_edit
209-
Equivalent to the `user:edit` scope on Twitch.
206+
Equivalent to the ``user:edit`` scope on Twitch.
210207
user_edit_follows
211-
Equivalent to the `user:edit:follows` scope on Twitch.
208+
Equivalent to the ``user:edit:follows`` scope on Twitch.
212209
user_read_blocked_users
213-
Equivalent to the `user:read:blocked:users` scope on Twitch.
210+
Equivalent to the ``user:read:blocked:users`` scope on Twitch.
214211
user_manage_blocked_users
215-
Equivalent to the `user:manage:blocked:users` scope on Twitch.
212+
Equivalent to the ``user:manage:blocked:users`` scope on Twitch.
216213
user_read_broadcast
217-
Equivalent to the `user:read:broadcast` scope on Twitch.
214+
Equivalent to the ``user:read:broadcast`` scope on Twitch.
218215
user_manage_chat_color
219-
Equivalent to the `user:manage:chat:color` scope on Twitch.
216+
Equivalent to the ``user:manage:chat:color`` scope on Twitch.
220217
user_read_email
221-
Equivalent to the `user:read:email` scope on Twitch.
218+
Equivalent to the ``user:read:email`` scope on Twitch.
222219
user_read_follows
223-
Equivalent to the `user:read:follows` scope on Twitch.
220+
Equivalent to the ``user:read:follows`` scope on Twitch.
224221
user_read_moderated_channels
225-
Equivalent to the `user:read:moderated:channels` scope on Twitch.
222+
Equivalent to the ``user:read:moderated:channels`` scope on Twitch.
226223
user_read_subscriptions
227-
Equivalent to the `user:read:subscriptions` scope on Twitch.
224+
Equivalent to the ``user:read:subscriptions`` scope on Twitch.
228225
user_read_emotes
229-
Equivalent to the `user:read:emotes` scope on Twitch.
226+
Equivalent to the ``user:read:emotes`` scope on Twitch.
230227
user_manage_whispers
231-
Equivalent to the `user:manage:whispers` scope on Twitch.
228+
Equivalent to the ``user:manage:whispers`` scope on Twitch.
232229
user_read_whispers
233-
Equivalent to the `user:read:whispers` scope on Twitch.
230+
Equivalent to the ``user:read:whispers`` scope on Twitch.
234231
channel_bot
235-
Equivalent to the `channel:bot` scope on Twitch.
232+
Equivalent to the ``channel:bot`` scope on Twitch.
236233
channel_moderate
237-
Equivalent to the `channel:moderate` scope on Twitch.
234+
Equivalent to the ``channel:moderate`` scope on Twitch.
238235
chat_edit
239-
Equivalent to the `chat:edit` scope on Twitch.
236+
Equivalent to the ``chat:edit`` scope on Twitch.
240237
chat_read
241-
Equivalent to the `chat:read` scope on Twitch.
238+
Equivalent to the ``chat:read`` scope on Twitch.
242239
user_bot
243-
Equivalent to the `user:bot` scope on Twitch.
240+
Equivalent to the ``user:bot`` scope on Twitch.
244241
user_read_chat
245-
Equivalent to the `user:read:chat` scope on Twitch.
242+
Equivalent to the ``user:read:chat`` scope on Twitch.
246243
user_write_chat
247-
Equivalent to the `user:write:chat` scope on Twitch.
244+
Equivalent to the ``user:write:chat`` scope on Twitch.
248245
whispers_read
249-
Equivalent to the `whispers:read` scope on Twitch.
246+
Equivalent to the ``whispers:read`` scope on Twitch.
250247
whispers_edit
251-
Equivalent to the `whispers:edit` scope on Twitch.
248+
Equivalent to the ``whispers:edit`` scope on Twitch.
252249
"""
253250

254251
__slots__ = ("_selected",)
@@ -371,27 +368,27 @@ def __contains__(self, scope: _scope_property | str, /) -> bool:
371368
return scope in self._selected
372369

373370
def urlsafe(self, *, unquote: bool = False) -> str:
374-
"""Method which returns a URL-Safe formatted `str` of selected scopes.
371+
"""Method which returns a URL-Safe formatted ``str`` of selected scopes.
375372
376373
The string returned by this method is safe to use in browsers etc.
377374
378375
Parameters
379376
----------
380377
unqoute: bool
381-
If this is `True`, this will return scopes without URL quoting, E.g. as `user:read:email+channel:bot` compared to
382-
`user%3Aread%3Aemail+channel%3Abot`. Defaults to `False`.
378+
If this is ``True``, this will return scopes without URL quoting, E.g. as ``user:read:email+channel:bot``
379+
compared to ``user%3Aread%3Aemail+channel%3Abot``. Defaults to ``False``.
383380
"""
384381
return "+".join([scope.value if unquote else scope.quoted() for scope in self._selected])
385382

386383
@property
387384
def selected(self) -> list[str]:
388-
"""Property that returns a `list[str]` of selected scopes.
385+
"""Property that returns a ``list[str]`` of selected scopes.
389386
390-
This is not URL-Safe. See: [`.urlsafe`][twitchio.Scopes.urlsafe] for a method which returns a URL-Safe string.
387+
This is not URL-Safe. See: :meth:`.urlsafe` for a method which returns a URL-Safe string.
391388
"""
392389
return list(self)
393390

394391
@classmethod
395392
def all(cls) -> Scopes:
396-
"""Classmethod which creates this [`Scopes`][twitchio.Scopes] object with all scopes selected."""
393+
"""Classmethod which creates this :class:`.Scopes` object with all scopes selected."""
397394
return cls([scope for scope in cls.__dict__.values() if isinstance(scope, _scope_property)])

0 commit comments

Comments
 (0)