Client

class autoreplit.client.CachedRequest(fut: Future, json: Dict[str, Any])

Bases: object

A cached request for better preformance.

fut: Future
json: Dict[str, Any]
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 getReplById(id: str) Repl
async getReplByUrl(url: str) Repl
async getUserByName(name: str) User

Get a user by name. Returns an user object.

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: CoroutineType) None

Run Coroutine mainfunc so that a replit client works withing.

Uses a combination of asyncio.run(), autoreplit.ReplitClient.start() and autoreplit.ReplitClient.close()

async start() None

Start the client, needs to be used first, before any other functions.

Warning

Never use with autoreplit.ReplitClient.run()

updatePresence() None

Update your bot’s presence, will set you to Online

exception autoreplit.client.RequestError

Bases: Exception

Replit api request error.

autoreplit.client.requiresSid(f: Callable) Callable

Decorator to make a function require a sid to run.