redditwarp.siteprocs.wiki.ASYNC
#
- class redditwarp.siteprocs.wiki.ASYNC.WikiProcedures(client: Client)[source]#
Bases:
object
- class Page(outer: WikiProcedures)[source]#
Bases:
object
- async read(sr: str, page: str) WikiPage [source]#
Get a wiki page.
- Parameters:
sr (str) –
page (str) –
- Return type:
- Raises:
redditwarp.exceptions.RedditError –
PAGE_NOT_FOUND
:The specified wiki page does not exist.
INVALID_REVISION
:The specified revision UUID does not exist.
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
- async edit(sr: str, page: str, body: str, *, message: str = '') None [source]#
Edit a wiki page.
If the specifed content matches the current content of the wiki page, the edit will not go through.
- Parameters:
sr (str) –
page (str) –
body (str) –
message (str) – A commit message.
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
WIKI_CREATE_ERROR
:The specified wiki page does not exist.
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
- async revert(sr: str, page: str, revision: str) None [source]#
Revert a wiki page to a previous revision.
This creates a new edit with content matching that of the specified revision.
The revision message will look something like ‘reverted back 53 minutes’.
- Parameters:
sr (str) –
page (str) –
revision (str) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
INVALID_REVISION
:The specified revision UUID does not exist.
- revisions(sr: str, page: str, amount: int | None = None) ImpartedPaginatorChainingAsyncIterator[WikiPageRevisionsAsyncPaginator, WikiPageRevision] [source]#
Get wiki page revision log entries.
- Parameters:
sr (str) –
page (str) –
amount (Optional[int]) –
- Return type:
WikiPageRevisionsAsyncPaginator
,WikiPageRevision
]
- Raises:
redditwarp.exceptions.RedditError –
WIKI_DISABLED
:The specified subreddit does not have wikis enabled.
PAGE_NOT_FOUND
:The specified wiki page does not exist.
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
- discussions(sr: str, page: str, amount: int | None = None) ImpartedPaginatorChainingAsyncIterator[SubmissionListingAsyncPaginator, Submission] [source]#
Get link submissions linking to a particular wiki page.
- Parameters:
sr (str) –
page (str) –
amount (Optional[int]) –
- Return type:
SubmissionListingAsyncPaginator
,WikiPageRevision
]
- Raises:
redditwarp.exceptions.RedditError –
WIKI_DISABLED
:The specified subreddit does not have wikis enabled.
PAGE_NOT_FOUND
:The specified wiki page does not exist.
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
- async get_settings(sr: str, page: str) WikiPageSettings [source]#
Retrieve the current permission settings for a wiki page.
- Parameters:
sr (str) –
page (str) –
- Return type:
~.models.wiki_ASYNC.WikiPageSettings
- Raises:
redditwarp.exceptions.RedditError –
MOD_REQUIRED
:You are not a moderator of the specified subreddit.
WIKI_DISABLED
:The specified subreddit does not have wikis enabled.
PAGE_NOT_FOUND
:The specified wiki page does not exist.
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
- async set_settings(sr: str, page: str, *, permlevel: int, indexed: bool) WikiPageSettings [source]#
Update the permissions and visibility of a particular wiki page.
- Parameters:
sr (str) –
page (str) –
permlevel (int) –
Permission level indicating who can edit this wiki page.
”who can edit this page?”
0
: “use subreddit wiki permissions”1
: “only approved wiki contributors for this page may edit”2
: “only mods may edit and view”indexed (bool) – Whether this wiki page is to be indexed on the wiki page list.
- Return type:
~.models.wiki_ASYNC.WikiPageSettings
- Raises:
redditwarp.exceptions.RedditError –
WIKI_DISABLED
:The specified subreddit does not have wikis enabled.
PAGE_NOT_FOUND
:The specified wiki page does not exist.
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
redditwarp.http.exceptions.StatusCodeException –
302
:You do not have permission.
- async add_editor(sr: str, page: str, username: str) None [source]#
Add a user as an editor for a wiki page.
If the user is already added, it is treated as a success.
- Parameters:
sr (str) –
page (str) –
username (str) –
- Return type:
None
- Raises:
redditwarp.exceptions.RedditError –
WIKI_DISABLED
:The specified subreddit does not have wikis enabled.
UNKNOWN_USER
:The specified user does not exist.
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
- async remove_editor(sr: str, page: str, username: str) None [source]#
Remove a user as an editor for a wiki page.
Behaves similarly to
add_editor()
.
- property page: None#
- revisions(sr: str, amount: int | None = None) ImpartedPaginatorChainingAsyncIterator[WikiPageRevisionsAsyncPaginator, WikiPageRevision] [source]#
Get a revision log for all wiki pages.
- Parameters:
sr (str) –
amount (Optional[int]) –
- Return type:
WikiPageRevisionsAsyncPaginator
,WikiPageRevision
]
- Raises:
redditwarp.exceptions.RedditError –
WIKI_DISABLED
:The specified subreddit does not have wikis enabled.
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
- async list_pages(sr: str) Sequence[str] [source]#
Get a list of wiki pages in a subreddit.
- Parameters:
sr (str) –
- Return type:
Sequence
[str
]
- Raises:
redditwarp.exceptions.RedditError –
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.
Toggle the public visibility of a wiki page revision.
- Parameters:
sr (str) –
page (str) –
revision (str) –
- Return type:
Sequence
[str
]
- Raises:
redditwarp.exceptions.RedditError –
PAGE_NOT_FOUND
:The specified wiki page does not exist.
INVALID_REVISION
:The specified revision UUID does not exist.
private
:You do not have access to the specified subreddit; it is private.
banned
:You do not have access to the specified subreddit; it is banned.