redditwarp.siteprocs.live_thread.ASYNC
#
- class redditwarp.siteprocs.live_thread.ASYNC.LiveThreadProcedures(client: Client)[source]#
Bases:
object
- async get(idt: str) LiveThread | None [source]#
Get a live thread.
- Parameters:
idt (str) –
- Return type:
Optional
[LiveThread
]
- bulk_fetch(idts: Iterable[str]) CallChunkChainingAsyncIterator[LiveThread] [source]#
Bulk fetch live threads.
Entries are returned in the same order as specified.
If one of the IDs in a batch does not exist then a 500 HTTP error is returned.
- Parameters:
idts (Iterable[str]) –
- Return type:
- Raises:
redditwarp.http.exceptions.StatusCodeException –
500
:A specified ID does not exist.
- async create(title: str, description: str = '', resources: str = '', nsfw: bool = False) str [source]#
Create a live thread.
- Parameters:
title (str) – Title. A string no longer than 120 characters.
description (str) –
Description. Markdown text. This text is displayed under the title.
Default: empty string.
resources (str) –
The resources. Markdown text. This text is displayed on the sidebar.
Default: empty string.
nsfw (bool) –
Mark the live thread as NSFW.
Default false.
- Returns:
The ID of the newly created live thread.
- Return type:
str
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
NO_TEXT
:The specified title was empty.
RATELIMIT
:You must wait one minute before creating another live thread.
- async config(idt: str, title: str, description: str = '', resources: str = '', nsfw: bool = False) None [source]#
Configure the live thread.
Requires the
settings
live thread permission.All parameters must be specified otherwise they will be set to their effective defaults.
- (parameters):
Same as
create()
.
- Return type:
None
- Raises:
redditwarp.http.exceptions.StatusCodeException –
403
:There is no user context.
You do not have the
settings
live thread permission.You do not have permission.
404
:The specified live thread does not exist.
- async close(idt: str) None [source]#
Close a live thread.
This permanently closes the live thread, disallowing future updates.
- Parameters:
idt (str) –
- Return type:
None
- Raises:
redditwarp.http.exceptions.StatusCodeException –
403
:There is no user context.
You do not have the
close
permission.The live thread is already closed.
404
:The specified live thread does not exist.
- async get_update(idt: str, uuid: str) LiveUpdate [source]#
Get a specific live update in a live thread.
- Parameters:
idt (str) –
uuid (str) –
- Return type:
None
- Raises:
redditwarp.http.exceptions.StatusCodeException –
404
:The specified live thread ID or live update ID does not exist.
- pull(idt: str, amount: int | None = None) ImpartedPaginatorChainingAsyncIterator[LiveUpdateListingAsyncPaginator, LiveUpdate] [source]#
Pull live updates from a live thread.
- Parameters:
idt (str) –
uuid (str) –
- Raises:
redditwarp.http.exceptions.StatusCodeException –
404
:The specified live thread does not exist.
- async create_update(idt: str, body: str) None [source]#
Post a live update to the thread.
- Parameters:
idt (str) –
body (str) – Markdown text.
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
NO_TEXT
:The
body
parameter was empty.
- async strike_update(idt: str, uuid: str) None [source]#
Strike the content of a live update.
Requires that specified update must have been authored by the user or that you have the
edit
permission.Striken updates cannot be unstriken.
If an already striken item is striken it is treated as a success.
- Parameters:
idt (str) –
uuid (str) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
NO_THING_ID
:The live update specified by
uuid
was empty.The live update specified by
uuid
does not exist.
redditwarp.http.exceptions.StatusCodeException –
403
:You don’t have permission.
404
:The live thread specified by
idt
does not exist.
- async delete_update(idt: str, uuid: str) None [source]#
Delete a live update.
Requires that specified update must have been authored by the current user or that you have the
edit
permission.If an already deleted update is specified, the action will be treated as a success. But specifying a non-existing update ID will cause a
NO_THING_ID
API error.- Parameters:
idt (str) –
uuid (str) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
NO_THING_ID
:The live update specified by
uuid
was empty.The live update specified by
uuid
does not exist.
redditwarp.http.exceptions.StatusCodeException –
403
:You don’t have permission.
404
:The live thread specified by
idt
does not exist.
- async list_contributors(idt: str) ContributorList [source]#
Get a list of users that contribute to a thread.
Returns an object with a
.contributors
attribute containing a list of contributors, and a.invitations
attribute containing a list of users that have been invited to be contributors.The
.invitations
list will be empty if the current user does not have themanage
live thread permission.- Parameters:
idt (str) –
- Return type:
- Raises:
redditwarp.http.exceptions.StatusCodeException –
404
:The live thread specified by
idt
does not exist.
- async send_contributor_invite(idt: str, user: str, permissions: Iterable[str]) None [source]#
Invite a user to contribute to the live thread.
Requires the
manage
live thread permission.- Parameters:
idt (str) –
user (str) –
permissions (Iterable[str]) –
Values: empty string,
all
,close
,discussions
,edit
,manage
,settings
,update
.Default: empty string. On the interface it’ll say ‘no permissions’.
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
NO_USER
:The
user
parameter was empty.
USER_DOESNT_EXIST
:The specified user does not exist.
LIVEUPDATE_ALREADY_CONTRIBUTOR
:The specified user is already a contributor or has already been invited.
INVALID_PERMISSIONS
:An invalid permission was specified.
redditwarp.http.exceptions.StatusCodeException –
403
:There is no user context.
You do not have the
manage
permission.
404
:The specified live thread does not exist.
- async accept_contributor_invite(idt: str) None [source]#
Accept an invitation to contribute to a live thread.
- Parameters:
idt (str) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
LIVEUPDATE_NO_INVITE_FOUND
:You don’t have an invitation for the specified live thread.
redditwarp.http.exceptions.StatusCodeException –
404
:The specified live thread does not exist.
- async revoke_contributor_invite(idt: str, user_id: int | str) None [source]#
Revoke an outstanding contributor invite.
Requires the
manage
live thread permission.If attempting to remove the invite for a user that was not invited, the action is treated as a success.
- Parameters:
idt (str) –
user_id (Union[int, str]) –
- Return type:
None
- Raises:
redditwarp.http.exceptions.StatusCodeException –
404
:There is no user context.
You do not have the
manage
permission.You do not have permission.
- async leave_contributor(idt: str) None [source]#
Abdicate contributorship of the thread.
It is possible to leave a live thread and not have any contributors to it.
If leaving a live thread you were not a contributor to, the action is treated as a success.
- Parameters:
idt (str) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
redditwarp.http.exceptions.StatusCodeException –
404
:The specified live thread does not exist.
- async remove_contributor(idt: str, user_id: int) None [source]#
Revoke another user’s contributorship.
Requires the
manage
live thread permission.It is possible to remove your own contributorship, having the same effect as
leave_contributor()
.If attempting to remove the invite for a user that was not invited, the action is treated as a success.
- Parameters:
idt (str) –
user_id (int) –
- Return type:
None
- Raises:
redditwarp.http.exceptions.StatusCodeException –
403
: - There is no user context. - You are not a contributor to the live thread that has themanage
permission.404
:The specified live thread does not exist.
500
:The specified user was invalid.
- async set_contributor_permissions(idt: str, user: str, permissions: Iterable[str]) None [source]#
Change a contributor’s permissions.
Requires the
manage
live thread permission.- Parameters:
idt (str) –
user (str) –
permissions (Iterable[str]) – Same as
send_contributor_invite()
.
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
NO_USER
:The
user
parameter was empty.
USER_DOESNT_EXIST
:The specified user does not exist.
INVALID_PERMISSIONS
:An invalid permission was specified.
LIVEUPDATE_NOT_CONTRIBUTOR
:The specified user is not a contributor.
redditwarp.http.exceptions.StatusCodeException –
403
: - There is no user context. - You do not have themanage
live thread permission.404
:The specified live thread does not exist.
- async set_contributor_invite_permissions(idt: str, user: str, permissions: Iterable[str]) None [source]#
Change a contributor invite’s permissions.
- Parameters:
idt (str) –
user (str) –
permissions (Iterable[str]) – Same as
send_contributor_invite()
.
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
USER_REQUIRED
:There is no user context.
NO_USER
:The
user
parameter was empty.
USER_DOESNT_EXIST
:The specified user does not exist.
INVALID_PERMISSIONS
:An invalid permission was specified.
LIVEUPDATE_NO_INVITE_FOUND
:The specified user does not have an invite.
redditwarp.http.exceptions.StatusCodeException –
403
: - There is no user context. - You do not have themanage
live thread permission.404
:The specified live thread does not exist.