redditwarp.siteprocs.subreddit_style_old.ASYNC#

class redditwarp.siteprocs.subreddit_style_old.ASYNC.SubredditStyleOldProcedures(client: Client)[source]#

Bases: object

async get_stylesheet(sr: str) StylesheetInfo[source]#

Get a subreddit’s stylesheet information.

This endpoint can be called without being a moderator of the target subreddit. You don’t even have to be logged in.

Parameters:

sr (str) –

Return type:

None

Raises:
async edit_stylesheet(sr: str, content: str, *, message: str = '') None[source]#

Update a subreddit’s stylesheet.

The stylesheet can also be updated by editing the config/stylesheet wiki page.

Parameters:
  • sr (str) –

  • content (str) –

  • message (str) – A commit message.

Return type:

None

Raises:
async add_stylesheet_image(sr: str, name: str, file: IO[bytes]) None[source]#

Upload an image for use in the subreddit stylesheet.

Parameters:
  • sr (str) –

  • name (str) – Must be a valid CSS identifier.

  • file (IO[bytes]) –

Return type:

None

Raises:
async remove_stylesheet_image(sr: str, name: str) None[source]#

Delete an image from the subreddit’s stylesheet custom image set.

The image will no longer count against the subreddit’s image limit, however the actual image data may still be accessible for an unspecified amount of time. If the image is currently referenced by the subreddit’s stylesheet, that stylesheet will no longer validate and won’t be submittable until the image reference is removed.

If the specified image name does not exist, it is treated as a success.

Parameters:
  • sr (str) –

  • name (str) –

Return type:

None

Raises:

redditwarp.http.exceptions.StatusCodeException

  • 500:

    The name parameter was empty.

async set_icon(sr: str, file: IO[bytes]) None[source]#

Set the subreddit icon.

Parameters:
  • sr (str) –

  • file (IO[bytes]) –

Return type:

None

Raises:
async unset_icon(sr: str) None[source]#

Remove the subreddit’s icon.

Parameters:

sr (str) –

Return type:

None

Raises:

redditwarp.http.exceptions.StatusCodeException

  • 403:

    You do not have permission.

async set_mobile_icon(sr: str, file: IO[bytes]) None[source]#

Set the mobile icon.

Parameters:
  • sr (str) –

  • file (IO[bytes]) –

Return type:

None

Raises:
async unset_mobile_icon(sr: str) None[source]#

Remove the mobile icon.

Parameters:

sr (str) –

Return type:

None

Raises:

redditwarp.http.exceptions.StatusCodeException

  • 403:

    You do not have permission.

async set_mobile_banner(sr: str, file: IO[bytes]) None[source]#

Set the mobile banner icon.

Parameters:
  • sr (str) –

  • file (IO[bytes]) –

Return type:

None

Raises:
async unset_mobile_banner(sr: str) None[source]#

Remove the mobile banner icon.

Parameters:

sr (str) –

Return type:

None

Raises:

redditwarp.http.exceptions.StatusCodeException

  • 403:

    You do not have permission.