widgrensitasobi-defold
widgrensit/asobi-defold/asobi.api.dm
asobi direct messages over REST. A project reaches it as client.dm.
- GitHub: widgrensit/asobi-defold — pinned to
v1.18.1- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as api_dm from "asobi.api.dm"
- Pick a release from widgrensit/asobi-defold releases and add its Source code (zip) URL (or a packaged
Functions
send(client: Client, recipient_id: string, content: string, callback?: HttpCallback)
Sends a direct message to a player.
Parameters
client:Client— The client.recipient_id:string— The recipient's player id.content:string— The message text.callback?:HttpCallback— Receives the sent message, or the error.
history(client: Client, player_id: string, limit?: number, callback?: HttpCallback)
Fetches the direct messages exchanged with a player.
Parameters
client:Client— The client.player_id:string— The other player's id.limit?:number— The most messages to return. The server's default applies when left out.callback?:HttpCallback— Receives the messages, or the error.