Client#
- class autoreplit.client.CachedRequest(fut: Future, json: Dict[str, Any])#
Bases:
object
A cached request for better preformance.
- fut: Future#
- class autoreplit.client.ReplitClient(sid: str | None = None)#
Bases:
object
The replit client object. This class is the centerpiece or the library, almost all of the functions are of this class. This should be the only object you need to import.
- Parameters:
sid – The replit account’s secure ID, kind of like a token. Required for most actions but not all.
- async close() None #
Close the client, needs to be run after everything is done.
Warning
Never use with
autoreplit.ReplitClient.run()
- getCurrentUser() SimpleUser #
Get the current user. Returns a
SimpleUser
- getNotifications(count: int = 10, seen: bool = False) List[CommonNotif | UnidentifiedNotif] #
Get
count
amount of notifications for the current user.
- async rawQuery(queryname: str, query: str, vars: Dict[str, Any] = {}) QueryResult #
Use a raw gql query on the api. Returns a QueryResult object.
- Parameters:
queryname – The name of the query, for example
UserByUsername
query – The actual graphql query
vars – The variable params passed to the query
- run(mainfunc: coroutine) None #
Run Coroutine mainfunc so that a replit client works withing.
Uses a combination of
asyncio.run()
,autoreplit.ReplitClient.start()
andautoreplit.ReplitClient.close()