LiveThreadContribution

class asyncpraw.models.reddit.live.LiveThreadContribution(thread: asyncpraw.models.LiveThread)

Provides a set of contribution functions to a LiveThread.

__init__(thread: asyncpraw.models.LiveThread)

Initialize a LiveThreadContribution instance.

Parameters:

thread – An instance of LiveThread.

This instance can be retrieved through thread.contrib where thread is a LiveThread instance. E.g.,

thread = await reddit.live("ukaeu1ik4sw5")
await thread.contrib.add("### update")
await add(body: str)

Add an update to the live thread.

Parameters:

body – The Markdown formatted content for the update.

Usage:

thread = await reddit.live("ydwwxneu7vsa")
await thread.contrib.add("test `LiveThreadContribution.add()`")
await close()

Close the live thread permanently (cannot be undone).

Usage:

thread = await reddit.live("ukaeu1ik4sw5")
await thread.contrib.close()
await update(*, description: str | None = None, nsfw: bool | None = None, resources: str | None = None, title: str | None = None, **other_settings: str | None)

Update settings of the live thread.

Parameters:
  • description – The live thread’s description (default: None).

  • nsfw – Indicate whether this thread is not safe for work (default: None).

  • resources – Markdown formatted information that is useful for the live thread (default: None).

  • title – The title of the live thread (default: None).

Does nothing if no arguments are provided.

Each setting will maintain its current value if None is specified.

Additional keyword arguments can be provided to handle new settings as Reddit introduces them.

Usage:

thread = await reddit.live("xyu8kmjvfrww")

# update 'title' and 'nsfw'
updated_thread = await thread.contrib.update(title=new_title, nsfw=True)

If Reddit introduces new settings, you must specify None for the setting you want to maintain:

# update 'nsfw' and maintain new setting 'foo'
await thread.contrib.update(nsfw=True, foo=None)