WidgetModeration¶
- class asyncpraw.models.WidgetModeration(widget, subreddit, reddit)¶
Class for moderating a particular widget.
Example usage:
subreddit = await reddit.subreddit("test") sidebar = [widget async for widget in subreddit.widgets.sidebar()] widget = sidebar[0] await widget.mod.update(shortName="My new title") await widget.mod.delete()
- Parameters:
widget (asyncpraw.models.Widget)
subreddit (asyncpraw.models.Subreddit | str)
reddit (asyncpraw.Reddit)
- __init__(widget, subreddit, reddit)¶
Initialize a
WidgetModerationinstance.
- await update(**kwargs)¶
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.
For example, update a text widget like so:
await text_widget.mod.update(shortName="New text area", text="Hello!")
Note
Most parameters follow the
lowerCamelCaseconvention. When in doubt, check the Reddit documentation linked above.