User
A user is a member of Moymo: a person, or a bot.
User object
| Field | Type | Description |
|---|---|---|
id | UUID | The member's id |
username | string | Lowercase, 3 to 24 letters, digits and underscores. A person's profile address is <username>.moymo.net |
display_name | string | The name they chose |
avatar | ?string | A path on moymo.net (prefix it with https://moymo.net). Left out when the member has no picture |
email | ?string | Only for an access token with the email scope, and only when the address is verified. Never for a bot |
bot | boolean | true for a bot |
Get current user
GET
/users/@me For a bot token: the bot's own member. For an access token: the member; needs the identify scope, and email also adds their verified e-mail address.
RequestGET
/users/@me bash
curl https://moymo.net/api/app/v1/users/@me \
-H "Authorization: Bearer $ACCESS_TOKEN"js
const response = await fetch('https://moymo.net/api/app/v1/users/@me', {
headers: { Authorization: `Bearer ${accessToken}` }
})
const user = await response.json()Response200OKJSON
json
{
"id": "1f0c8d64-2a37-4f5b-9a0e-7c4d3b2e1a90",
"username": "david",
"display_name": "David",
"avatar": "/api/v1/users/uploads/avatars/6a5d2c.webp",
"email": "david@example.com",
"bot": false
}Errors: 403 without identify.
Get current user's servers
GET
/users/@me/servers For an access token: needs the servers scope, and lists the servers the member is in. For a bot token: the servers the bot is in.
Response200OKJSON
json
[
{
"id": "5f1d2b8e-7a64-4d07-8d3a-0b9f6c4e2a11",
"name": "Friday night",
"icon": "🎲",
"color": "#2bff6e",
"owner": true
}
]| Field | Description |
|---|---|
icon | A few characters (an emoji or a letter), possibly empty |
color | The server tile's colour |
owner | Whether this user owns the server |
Errors: 403 without servers.
Leave a server
DELETE
/servers/{server.id}/members/@me A bot leaves a server. The owner of a server cannot leave it (transfer it first).