moymo,Docs
Skip to content
More

SDKs ​

Planned

There is no official SDK yet. The API is plain HTTPS and (soon) a WebSocket, and every request is documented, so you can use it from any language today.

The plan ​

Moymo's SDKs will be generated and checked against the same machine-readable description of the API that this wiki's reference is written from, so they cannot drift from it:

  • the App API as an OpenAPI file;
  • the gateway events and opcodes as a schema;
  • the components (embeds, buttons, selects, modals) as a schema;
  • the scopes, permission bits and error codes as lists.

The first SDK will be moymo.js for JavaScript and TypeScript, shaped so that people who know the popular libraries for other chat platforms feel at home: a client that logs a bot in, typed events, helpers for building embeds and components, a command router, and a small OAuth2 helper that does PKCE for you. Other languages follow, starting with the ones people ask for.

What it will cover ​

AuthenticationBot tokens, OAuth2 with PKCE, refresh, revoke
RESTA typed method for every endpoint, with rate-limit handling and retries built in
GatewayConnect, identify, heartbeat, resume, intents; events as typed objects
InteractionsReceive over the gateway or an HTTPS endpoint (with the Ed25519 signature check done for you); answer, defer, follow up, open modals
HelpersPermission bit arithmetic, mention formatting, embed builders

Until then ​

Everything works with fetch:

Who is this bot?
js
const api = 'https://moymo.net/api/app/v1'
const headers = { Authorization: `Bot ${process.env.MOYMO_BOT_TOKEN}` }

const me = await (await fetch(`${api}/users/@me`, { headers })).json()
console.log(`Logged in as ${me.display_name} (@${me.username})`)
python
import os
import requests

api = "https://moymo.net/api/app/v1"
headers = {"Authorization": f"Bot {os.environ['MOYMO_BOT_TOKEN']}"}

me = requests.get(f"{api}/users/@me", headers=headers).json()
print(f"Logged in as {me['display_name']} (@{me['username']})")

If you write a library for Moymo, tell us: we would like to link to it, and to learn what the API made harder than it should be.

The wiki is for Moymo's members and developers. Something wrong or missing? Use "Suggest a change" on any page.