Skip to content

Commit da51216

Browse files
committed
Add additional detail to Chatter methods docs
1 parent b3646f0 commit da51216

File tree

1 file changed

+34
-19
lines changed

1 file changed

+34
-19
lines changed

twitchio/user.py

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def fetch_extension_analytics(
217217
Parameters
218218
-----------
219219
token_for: str | PartialUser
220-
A user access token that includes the `analytics:read:extensions` scope.
220+
A user access token that includes the ``analytics:read:extensions`` scope.
221221
extension_id: str
222222
The extension's client ID. If specified, the response contains a report for the specified extension.
223223
If not specified, the response includes a report for each extension that the authenticated user owns.
@@ -745,7 +745,7 @@ async def fetch_charity_campaign(self) -> CharityCampaign:
745745
Fetch the active charity campaign of a broadcaster.
746746
747747
.. note::
748-
Requires user access token that includes the `channel:read:charity` scope.
748+
Requires user access token that includes the ``channel:read:charity`` scope.
749749
750750
Returns
751751
-------
@@ -973,7 +973,7 @@ async def update_chat_settings(
973973
- To remove the ``slow_mode_wait_time``, ``follower_mode_duration``, or ``non_moderator_chat_delay_duration`` field's value, set the corresponding ``slow_mode``, ``follower_mode``, or ``non_moderator_chat_delay`` field to False (and don't include the slow_mode_wait_time, follower_mode_duration, or non_moderator_chat_delay_duration field).
974974
975975
.. note::
976-
Requires a user access token that includes the `moderator:manage:chat_settings` scope.
976+
Requires a user access token that includes the ``moderator:manage:chat_settings`` scope.
977977
978978
Parameters
979979
----------
@@ -1096,7 +1096,7 @@ async def send_announcement(
10961096
announcements longer than 500 characters are truncated.
10971097
color: Literal["blue", "green", "orange", "purple", "primary"] | None
10981098
An optional colour to use for the announcement. If set to ``"primary``" or `None`
1099-
the channels accent colour will be used instead. Defaults to ``None``.
1099+
the channels accent colour will be used instead. Defaults to `None`.
11001100
"""
11011101
return await self._http.post_chat_announcement(
11021102
broadcaster_id=self.id, moderator_id=moderator, token_for=token_for, message=message, color=color
@@ -1258,7 +1258,7 @@ async def create_clip(
12581258
If [`fetch_clips`][twitchio.user.PartialUser.fetch_clips] returns the clip, the clip was successfully created. If after 15 seconds [`fetch_clips`][twitchio.user.PartialUser.fetch_clips] hasn't returned the clip, assume it failed.
12591259
12601260
.. note::
1261-
Requires a user access token that includes the `clips:edit` scope.
1261+
Requires a user access token that includes the ``clips:edit`` scope.
12621262
12631263
Parameters
12641264
----------
@@ -1267,7 +1267,7 @@ async def create_clip(
12671267
If False (default), Twitch captures the clip at the moment the viewer requests it (this is the same clip experience as the Twitch UX).
12681268
If True, Twitch adds a delay before capturing the clip (this basically shifts the capture window to the right slightly).
12691269
token_for: str | PartialUser
1270-
User access token that includes the `clips:edit` scope.
1270+
User access token that includes the ``clips:edit`` scope.
12711271
12721272
Returns
12731273
-------
@@ -1849,7 +1849,7 @@ async def update_automod_settings(
18491849
AutomodSettings object containing the new settings for the broadcaster's channel.
18501850
You can fetch this using :meth:`~fetch_automod_settings`
18511851
token_for: str | PartialUser
1852-
User access token that includes the `moderator:manage:automod_settings` scope.
1852+
User access token that includes the ``moderator:manage:automod_settings`` scope.
18531853
18541854
Returns
18551855
-------
@@ -1933,12 +1933,12 @@ async def ban_user(
19331933
An optional ID of or the :class:`~twitchio.PartialUser` object of the moderator issuing this action.
19341934
You must have a token stored with the ``moderator:manage:banned_users`` scope for this moderator.
19351935
1936-
If ``None``, the ID of this :class:`~twitchio.PartialUser` will be used.
1936+
If `None`, the ID of this :class:`~twitchio.PartialUser` will be used.
19371937
user: str | PartialUser
19381938
The ID of, or the :class:`~twitchio.PartialUser` of the user to ban.
19391939
reason: str | None
19401940
An optional reason this chatter is being banned. If provided the length of the reason must not be more than
1941-
``500`` characters long. Defaults to ``None``.
1941+
``500`` characters long. Defaults to `None`.
19421942
19431943
Raises
19441944
------
@@ -1989,12 +1989,12 @@ async def timeout_user(
19891989
An optional ID of or the :class:`~twitchio.PartialUser` object of the moderator issuing this action.
19901990
You must have a token stored with the ``moderator:manage:banned_users`` scope for this moderator.
19911991
1992-
If ``None``, the ID of this :class:`~twitchio.PartialUser` will be used.
1992+
If `None`, the ID of this :class:`~twitchio.PartialUser` will be used.
19931993
user: str | PartialUser
19941994
The ID of, or the :class:`~twitchio.PartialUser` of the user to ban.
19951995
reason: str | None
19961996
An optional reason this chatter is being banned. If provided the length of the reason must not be more than
1997-
``500`` characters long. Defaults to ``None``.
1997+
``500`` characters long. Defaults to `None`.
19981998
duration: int
19991999
The duration of the timeout in seconds. The minimum duration is ``1`` second and the
20002000
maximum is ``1_209_600`` seconds (2 weeks).
@@ -2177,16 +2177,16 @@ def fetch_blocked_terms(
21772177
Fetches the broadcaster's list of non-private, blocked words or phrases.
21782178
These are the terms that the broadcaster or moderator added manually or that were denied by AutoMod.
21792179
2180-
??? note
2181-
Requires a user access token that includes the `moderator:read:blocked_terms` or `moderator:manage:blocked_terms` scope.
2180+
.. note::
2181+
Requires a user access token that includes the ``moderator:read:blocked_terms` or ``moderator:manage:blocked_terms`` scope.
21822182
21832183
Parameters
21842184
----------
21852185
moderator: str | int | PartialUser
21862186
The ID, or PartialUser, of the broadcaster or a user that has permission to moderate the broadcaster's chat room.
21872187
This ID must match the user ID in the user access token.
21882188
token_for: str | PartialUser
2189-
User access token that includes the `moderator:read:blocked_terms` or `moderator:manage:blocked_terms` scope.
2189+
User access token that includes the ``moderator:read:blocked_terms`` or ``moderator:manage:blocked_terms`` scope.
21902190
first: int
21912191
The maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 100 items per page. The default is 20.
21922192
max_results: int | None
@@ -2389,7 +2389,7 @@ def fetch_moderators(
23892389
A list of user IDs used to filter the results. To specify more than one ID, include this parameter for each moderator you want to get.
23902390
The returned list includes only the users from the list who are moderators in the broadcaster's channel. You may specify a maximum of 100 IDs.
23912391
token_for: str | PartialUser
2392-
User access token that includes the `moderation:read` scope.
2392+
User access token that includes the ``moderation:read`` scope.
23932393
If your app also adds and removes moderators, you can use the ``channel:manage:moderators`` scope instead.
23942394
The user ID in the access token must match the broadcaster's ID.
23952395
first: int
@@ -3745,7 +3745,7 @@ def colour(self) -> Colour | None:
37453745
37463746
There is an alias for this property named :attr:`.color`.
37473747
3748-
Could be ``None`` if the chatter has not set a colour.
3748+
Could be `None` if the chatter has not set a colour.
37493749
"""
37503750
return self._colour
37513751

@@ -3755,7 +3755,7 @@ def color(self) -> Colour | None:
37553755
37563756
There is an alias for this property named :attr:`.colour`.
37573757
3758-
Could be ``None`` if the chatter has not set a color.
3758+
Could be `None` if the chatter has not set a color.
37593759
"""
37603760
return self._colour
37613761

@@ -3769,6 +3769,9 @@ async def ban(self, moderator: str | PartialUser, reason: str | None = None) ->
37693769
37703770
Ban the chatter from the associated channel/broadcaster.
37713771
3772+
.. important::
3773+
This is different to the :meth:`~twitchio.user.PartialUser.ban_user` as it will ban this chatter directly in the associated channel in the object.
3774+
37723775
.. note::
37733776
37743777
You must have a user access token that includes the ``moderator:manage:banned_users`` scope to do this.
@@ -3780,7 +3783,7 @@ async def ban(self, moderator: str | PartialUser, reason: str | None = None) ->
37803783
token stored with the ``moderator:manage:banned_users`` scope for this moderator.
37813784
reason: str | None
37823785
An optional reason this chatter is being banned. If provided the length of the reason must not be more than
3783-
``500`` characters long. Defaults to ``None``.
3786+
``500`` characters long. Defaults to `None`.
37843787
37853788
Raises
37863789
------
@@ -3811,6 +3814,9 @@ async def timeout(
38113814
38123815
Timeout the chatter from the associated channel/broadcaster.
38133816
3817+
.. important::
3818+
This is different to the :meth:`~twitchio.user.PartialUser.timeout_user` as it will timeout this chatter directly in the associated channel in the object.
3819+
38143820
.. note::
38153821
38163822
You must have a user access token that includes the ``moderator:manage:banned_users`` scope to do this.
@@ -3830,7 +3836,7 @@ async def timeout(
38303836
The default is ``600`` which is ten minutes.
38313837
reason: str | None
38323838
An optional reason this chatter is being banned. If provided the length of the reason must not be more than
3833-
``500`` characters long. Defaults to ``None``.
3839+
``500`` characters long. Defaults to `None`.
38343840
"""
38353841
if reason and len(reason) > 500:
38363842
raise ValueError("The provided reason exceeds the allowed length of 500 characters.")
@@ -3846,6 +3852,9 @@ async def warn(self, moderator: str | PartialUser, reason: str) -> Warning:
38463852
Send this chatter a warning, preventing them from chat interaction until the warning is acknowledged.
38473853
New warnings can be issued to a chatter / user when they already have a warning in the channel (new warning will replace old warning).
38483854
3855+
.. important::
3856+
This is different to the :meth:`~twitchio.user.PartialUser.warn_user` as it will warn this chatter directly for the associated channel in the object.
3857+
38493858
.. note::
38503859
Requires a user access token that includes the ``moderator:manage:warnings`` scope.
38513860
moderator id must match the user id in the user access token.
@@ -3880,6 +3889,12 @@ async def block(
38803889
38813890
The user ID in the OAuth token identifies the broadcaster who is blocking the user.
38823891
3892+
.. important::
3893+
This is different to the :meth:`~twitchio.user.PartialUser.block_user` as it will block this chatter directly from the associated channel in the object.
3894+
3895+
.. note::
3896+
Requires a user access token that includes the ``user:manage:blocked_users`` scope.
3897+
38833898
Parameters
38843899
----------
38853900
source: Literal["chat", "whisper"] | None

0 commit comments

Comments
 (0)