LiveContributorRelationship¶
- class asyncpraw.models.reddit.live.LiveContributorRelationship(thread)¶
Provide methods to interact with live threads’ contributors.
- Parameters:
thread (asyncpraw.models.LiveThread)
- __call__()¶
Return a
RedditorListfor live threads’ contributors.Usage:
thread = await reddit.live("ukaeu1ik4sw5") async for contributor in thread.contributor(): print(contributor)
- Return type:
- __init__(thread)¶
Initialize a
LiveContributorRelationshipinstance.- Parameters:
thread (
LiveThread) – An instance ofLiveThread.- Return type:
None
Note
This class should not be initialized directly. Instead, obtain an instance via:
LiveThread.contributor().
- await accept_invite()¶
Accept an invite to contribute the live thread.
Usage:
thread = await reddit.live("ydwwxneu7vsa") await thread.contributor.accept_invite()
- Return type:
- await invite(redditor, *, permissions=None)¶
Invite a redditor to be a contributor of the live thread.
- Parameters:
redditor (
str|Redditor) – A redditor name orRedditorinstance.permissions (
list[str] |None) – When provided (notNone), permissions should be a list of strings specifying which subset of permissions to grant. An empty list[]indicates no permissions, and when not provided (None), indicates full permissions.
- Raises:
RedditAPIExceptionif the invitation already exists.- Return type:
Usage:
thread = await reddit.live("ukaeu1ik4sw5") redditor = await reddit.redditor("spez", fetch=False) # "manage" and "settings" permissions await thread.contributor.invite(redditor, permissions=["manage", "settings"])
See also
LiveContributorRelationship.remove_invite()to remove the invite for redditor.
- await leave()¶
Abdicate the live thread contributor position (use with care).
Usage:
thread = await reddit.live("ydwwxneu7vsa") await thread.contributor.leave()
- Return type:
- await remove(redditor)¶
Remove the redditor from the live thread contributors.
- Parameters:
redditor (
str|Redditor) – A redditor fullname (e.g.,"t2_1w72") orRedditorinstance.- Return type:
Usage:
thread = await reddit.live("ukaeu1ik4sw5") redditor = await reddit.redditor("spez", fetch=False) await thread.contributor.remove(redditor) await thread.contributor.remove("t2_1w72") # with fullname
- await remove_invite(redditor)¶
Remove the invite for redditor.
- Parameters:
redditor (
str|Redditor) – A redditor fullname (e.g.,"t2_1w72") orRedditorinstance.- Return type:
Usage:
thread = await reddit.live("ukaeu1ik4sw5") redditor = await reddit.redditor("spez", fetch=False) await thread.contributor.remove_invite(redditor) await thread.contributor.remove_invite("t2_1w72") # with fullname
See also
LiveContributorRelationship.invite()to invite a redditor to be a contributor of the live thread.
- await update(redditor, *, permissions=None)¶
Update the contributor permissions for
redditor.- Parameters:
redditor (
str|Redditor) – A redditor name orRedditorinstance.permissions (
list[str] |None) – When provided (notNone), permissions should be a list of strings specifying which subset of permissions to grant (other permissions are removed). An empty list[]indicates no permissions, and when not provided (None), indicates full permissions.
- Return type:
For example, to grant all permissions to the contributor, try:
thread = await reddit.live("ukaeu1ik4sw5") await thread.contributor.update("spez")
To grant
"access"and"edit"permissions (and to remove other permissions), try:await thread.contributor.update("spez", permissions=["access", "edit"])
To remove all permissions from the contributor, try:
await subreddit.moderator.update("spez", permissions=[])
- await update_invite(redditor, *, permissions=None)¶
Update the contributor invite permissions for
redditor.- Parameters:
redditor (
str|Redditor) – A redditor name orRedditorinstance.permissions (
list[str] |None) – When provided (notNone), permissions should be a list of strings specifying which subset of permissions to grant (other permissions are removed). An empty list[]indicates no permissions, and when not provided (None), indicates full permissions.
- Return type:
For example, to set all permissions to the invitation, try:
thread = await reddit.live("ukaeu1ik4sw5") await thread.contributor.update_invite("spez")
To set
"access"and"edit"permissions (and to remove other permissions) to the invitation, try:await thread.contributor.update_invite("spez", permissions=["access", "edit"])
To remove all permissions from the invitation, try:
await thread.contributor.update_invite("spez", permissions=[])