An asyncio based client library for RC Together. The API docs are at: https://docs.rctogether.com
You can install using pip:
pip install rctogether
You'll need to generate an app key and secret according to the instructions in the API docs: https://docs.rctogether.com/#authentication
Provide these credentials as environment variables:
export RC_APP_ID=<your_app_id> export RC_APP_SECRET=<your_app_secret> export RC_APP_ENDPOINT=<domain>
If not provided the endpoint defaults to recurse.rctogether.com.
This example connects to the websocket and prints all messages received:
import asyncio
from rctogether import WebsocketSubscription
async def main():
async for message in WebsocketSubscription():
print(message)
asyncio.run(main())
You can use the REST API to list all your bots like this:
import asyncio
from rctogether import bots, RestApiSession
async def main():
async with RestApiSession() as session:
print(await bots.get(session))
asyncio.run(main())