mythal / boluo

A chat application designed specifically for playing RPGs.
https://site.boluo.chat
GNU Affero General Public License v3.0
106 stars 12 forks source link

Is there api documentation? #554

Open kagangtuya-star opened 3 weeks ago

kagangtuya-star commented 3 weeks ago

I see the Boluo's description has "open source and API." Is there any api documentation for this? I'd like to try to implement an external plugin to access a dice framework like Dicepp or Sealdice, to provide more functionality to extend. This should only use api's related to sending and receiving messages.

uonr commented 3 weeks ago

Currently there are only Typescript type definitions, which can be found here

https://github.com/mythal/boluo/blob/master/packages/api/src/get.ts

https://github.com/mythal/boluo/blob/master/packages/api/src/post.ts

In order to receive messages, you need to establish a WebSockets connection:

https://github.com/mythal/boluo/blob/master/apps/spa/hooks/useConnectionEffect.tsx#L11

I can provide some standalone example programs using the basic APIs