Examples
# Getting the newest posts on Repl Talk and printing their titles
async for post in client.boards.all.get_posts():
print(post.title)API Reference
How to use the repltalk lib for Python. The functions are pretty self explanatory but I've added a short description for each of them.
The following functions are all coroutines unless specifically specified because asyncio is cool
Client
class repltalk.Client()
await login(username, password)Logs in to Repl.it with your username and password. Your bot must be verified in order to use this function.await get_post(post_id)Gets the post with that id. returns Postawait post_exists(post_id)Returns whether or not the post exists.await get_leaderboard(limit=30)Gets the top users from the Repl Talk leaderboard. returns list ofUsersawait get_all_comments()Gets all the recent comments from Repl Talk. *returns list ofCommentsawait get_user(username)Gets the user with that username. returns Userawait get_reports(resolved=False)Gets a list of reports. Only works for moderators or admins. See Report ListboardsSee Board.
Board
class client.boards
allThe All board on Repl Talk.shareThe Share board on Repl Talk.askThe Ask board on Repl Talk.announcementsThe Announcements board on Repl Talk.challengeThe Challenge board on Repl Talk.learnThe Learn board on Repl Talk.
async for post in get_posts(sort='top', search='')Gets the most recent posts from that board. Sort is the sorting order (top|hot|new) and search is the search query. returns AsyncPostList
RichBoard
A board that contains all the information from Board, and more.
You can get this by doing await client.boards.get(board_name) (NOT YET ADDED)
nameThe name of the board.title_ctaTitle call to actionbody_ctaBody call to actionbutton_ctaButton call to actionrepl_requiredWhether a Repl is required to be submitted.
Post
idThe post ID.titleThe post title.contentThe post content.boardThe board the post was made on.votesThe amount of upvotes the post has.authorThe post author. Will be a User object.timestampThe time the post was created at. (datetime.datetime object)urlThe post url in Repl Talk.replThe repl attached to the post.languageThe Language that the Repl attached to the post uses.show_hostedIndicates whether the post has a hosted repl linked to it.is_announcementWhether the post is marked as an announcement.pinnedWhether the post has been pinned to the top of the board.can_editIndicates if the user can edit the post. This will be False unless you created the post.can_commentIf the user can comment on the post.can_voteIndicates if the user can upvote the post.has_votedIndicates if the user has already voted on the post.is_lockedIndicates if the post is locked.can_answerWhether or not the user can answer the post.answeredIf the post has been answered (will always be False if it's not a question).comment_countThe amount of comments the post hasawait get_comments(order='new')Gets the comments on the post with the specified sort.await post_comment(content)Posts a comment on the post.await report(reason)Report the post
Comment
idThe comment ID.contentThe comment body.timestampThe time the comment was created at. (datetime.datetime object)can_editIndicates if the user can edit the comment.can_commentWhether or not the user can post a comment.urlThe comment's url.votesGets the amount of upvotes the comment has.can_voteIndicates if the user can vote on the comment.has_votedIndicates if the user has already upvoted the post.authorThe User for the author of the post.postThe post that the comment was made on.repliesA list of replies that the comment received.parentThe parent comment, if any.await reply(content)Replies to the comment with the content.await report(reason)Report the comment
User
idThe user ID. Pretty useless since you can't get the user from their id.nameThe user's username.avatarThe user's avatar url.urlThe user's profile link.cyclesThe amount of cycles/karma that user has.rolesThe roles the user has set on their profile.bioThe short description written by a user on their profile.organizationThe organization that the user is a part of. This can be None. See OrganizationsubscriptionThe subscription that the user has. This can be None. See Subscriptionfirst_nameWhat the user set as their first name in their profilelast_nameWhat the user set as their last name in their profilelanguagesThe Languages that the user uses most often.timestampThe time when the user account was created. (datetime.datetime object)await get_comments(limit=30, order='new')Get a list of up to 1100 of the users comments. See Commentawait get_posts(limit=30, order='new')Get a list of up to 100 of the user's posts. See Post
PostList/AsyncPostList
Acts like a normal list, except you can iterate over it
await next()Gets the next page of posts. Not present in AsyncPostList because it's done automatically.boardGets the board of the repls it's getting from
Repl
idThe Repl ID.embed_urlThe url for embedding the Repl on a web page.urlThe url of the Repl.titleThe title of the Repl.languageThe Language of the Repl.
Language
Represents a programming language on Repl.it.
idGets the ID of the language (ie python3).display_nameGets the display name of the language (ie Python).iconGets the url for the language icon.categoryGets the category that the language is listed as.is_newWhether the language was recently added to Repl.it.taglineA short description of the language.
Organization
The organization users are a part of
nameThe name of the organization
Subscription
A subscription that a user bought.
nameThe name of the subscriptionidThe id of the subscription
Report List
List of reports. see Report If linked post/comment is deleted is lazy report, See lazyReport
for report in get_reportsCycles through the reports, with lazy posts/comments.async for report in get_reportsCycles through the reports with full posts, if there is a post.
Report
A report on a comment or post
idThe report idtypeThe type of the report. ('post'or'comment')reasonWhy the report was madetimestampWhen the report was createdcreatorWho created the reportawait get_attached()Get the attached post/comment
Lazy Report
A less complete report
idThe report idreasonWhy the report was madecreatorWho created the report
Lazy Post
A less complete post
urlThe url to the postidThe post's idauthorThe post's authorcontentThe post's contenttitleThe post's titleawait get_full_post()Returns the full post
Lazy Comment
A less complete comment
urlThe url to the commentidThe comment's idauthorThe comment's authorcontentThe comment's contentawait get_full_comment()Returns the full comment