When to use it
- Tell the chat room when a new post goes up on your site's board.
- Show stream donation and subscription alerts in the chat room too.
- Send news, like an event starting, to the chat room whenever you want.
When your external server sends an event through the uchat API, this plugin shows it in the chat room. Turn on the plugin, get a key from the API menu on the admin page, and put it on your server.
How to send
Send POST https://api.uchat.io/v2/rooms/{API room ID}/events with an Authorization: Bearer {API key} header and a JSON body. The body's plugin is alertBox, and the first item in data is the alert kind.
curl -X POST https://api.uchat.io/v2/rooms/room_xxxxxxxxxxxxxxxx/events \
-H "Authorization: Bearer uchat_..." \
-H "Content-Type: application/json" \
-d '{"plugin":"alertBox","data":["donation","Emma","10000","Go for it!"]}'
| Kind | data item order |
Example |
|---|---|---|
| New post | post, author, title, link, board |
["post","Olivia","Today's notice","https://example.com/1","Notices"] |
| Donation | donation, nickname, amount, message |
["donation","Emma","10000","Go for it!"] |
| Subscription | subscribe, nickname, months, message |
["subscribe","Noah","3",""] |
| Custom | custom, title, content, link |
["custom","Event starts","Join now",""] |
- Add
"to":"nickname"to show it only on that person's screen. - Values are shown as plain text only. Links can be clicked only when they start with
https://. - Anything a chat room user sends under the same name is ignored. Only events from the server API are shown.
Look
Alerts appear in the message list as full-width colored blocks. Like YouTube Super Chats or CHZZK donations, they stay in the conversation, so you can scroll up to see past alerts. The first line is bold, and the second line (message or title) shows below it. They're drawn only on each person's screen and aren't saved in the chat log.
Settings
For each kind, set On, the First line and Second line text, the Background color and the Text color. In the text you can use placeholders like {nick}, {title}, {amount}, {months} and {message}. For donations you can also set the Amount unit and the Minimum amount.