ForumSession¶
Methods¶
create_topic(category_id, title, body)
¶
Creates a forum topic. You must be logged in for this to not throw an error.
PARAMETERS
- category_id (
int | str
) - The ID of the forum category you want to post in. For example, the ID of the "Suggestions" category is31
. - title (
str
) - The title of the original post in the topic. - body (
str
) - The body of the original post in the topic.
Example:
session.forums.create_topic(1, "Add like button to comments", "Title.\nSupporters:\n\nNobody yet!")
post(topic_id, content)
¶
Posts a forum post on the specified topic.
PARAMETERS
- topic_id (
int | str
) - The ID of the topic you want to post on. - content (
str
) - The content of the post.
Example:
session.forums.post(506810, "This sucks")
edit_post(post_id, content)
¶
Edits the forum post with the specified ID.
PARAMETERS
- post_id (
int | str
) - The ID of the post you want to edit. - content (
str
) - The new content of the post.
report_post(post_id, reason)
¶
Reports the forum post with the specified ID.
PARAMETERS
- post_id (
int | str
) - The ID of the post you want to report. - reason (
str
) - The reason you want to report the post.
get_post_source(post_id)
¶
Gets the BBCode source of the forum post with the specified ID.
PARAMETERS
- post_id (
int | str
) - The ID of the post.
RETURNS - str
follow_topic(topic_id)
¶
Follows the forum topic with the specified ID.
PARAMETERS
- topic (
int | str
) - The ID of the topic you want to follow.
unfollow_topic(topic_id)
¶
Unfollows the forum topic with the specified ID.
PARAMETERS
- topic (
int | str
) - The ID of the topic you want to unfollow.
change_signature(signature)
¶
Changes your forum signature to a new signature.
PARAMETERS
- signature (
str
) - The signature you want to change your signature to.
get_latest_topic_posts(topic_id)
¶
Gets the latest posts on the specified forum topic. Returns an array of ForumPost objects.
PARAMETERS
- topic_id (
int | str
) - The ID of the topic you want to get the latest posts on.
RETURNS - list[ForumPost]
Example:
print(session.forums.get_latest_topic_posts(506810)[0].content)
# scratchclient sucks
get_latest_category_posts(category_id)
¶
Gets the latest posts on the specified forum category. Returns an array of ForumPost objects.
PARAMETERS
- topic_id (
int | str
) - The ID of the category you want to get the latest posts on. For example, the ID of the "Suggestions" forum category is1
.
RETURNS - list[ForumPost]
Example:
print(session.forums.get_latest_category_posts(31)[0].content)
# scratchclient sucks