Skip to content
Back to top
View this page

# WidgetModeration

class praw.models.WidgetModeration(widget: praw.models.Widget, subreddit: praw.models.Subreddit | str, reddit: praw.Reddit)

  Class for moderating a particular widget.

  Example usage:

      widget = reddit.subreddit("test").widgets.sidebar[0]
      widget.mod.update(shortName="My new title")
      widget.mod.delete()

  __init__(widget: praw.models.Widget, subreddit: praw.models.Subreddit | str, reddit: praw.Reddit)

    Initialize a `WidgetModeration` instance.

  delete()

    Delete the widget.

    Example usage:

        widget.mod.delete()

  update(**kwargs) → praw.models.ButtonWidget | praw.models.Calendar | praw.models.CommunityList | praw.models.CustomWidget | praw.models.IDCard | praw.models.ImageWidget | praw.models.Menu | praw.models.ModeratorsWidget | praw.models.PostFlairWidget | praw.models.RulesWidget | praw.models.TextArea | praw.models.Widget

    Update the widget. Returns the updated widget.

    Parameters differ based on the type of widget. See Reddit documentation or the document of the particular type of widget.

    Returns:

      The updated `Widget`.

    For example, update a text widget like so:

        text_widget.mod.update(shortName="New text area", text="Hello!")

    Note

    Most parameters follow the `lowerCamelCase` convention. When in doubt, check the Reddit documentation linked above.