Plugin System/API/Chat

From Kokua Wiki

Jump to: navigation, search
This page is a Work in Progress.
Anyone is welcome to contribute to it.

Contents

Introduction

This page describes chat-related requests and events that are part of the plugin system API.

SendChat Request

The SendChat request is sent from the plugin to the viewer to send chat over the network, as if the user had entered some chat into the chat bar. The plugin can optionally specify the channel number and/or range (whisper, say, or shout) to use.

["$request_id",
 "SendChat",
 "$message",
 $channel,
 $range
]

Error.ChatTooLong

If the message is longer than the maximum allowed chat message length, the viewer will respond with this error:

["$request_id",
 "Error.ChatTooLong",
 "$human_message",
 {
   "max_length" : $max
 }
]

Error.ChatInvalidChannel

If the channel number is invalid (i.e. it is negative or is greater than the maximum possible channel), the viewer will respond with this error:

["$request_id",
 "Error.ChatInvalidChannel",
 "$human_message",
 {
   "min_channel" : $min,
   "max_channel" : $max
 }
]

Error.ChatNotAllowed

If the user is not allowed to chat (e.g. they have been frozen by the land owner), the viewer will respond with this message:

["$request_id",
 "Error.ChatNotAllowed",
 "$human_message"
]

SendChat.Success

If the chat request succeeds, the viewer responds with this message:

["$request_id",
 "SendChat.Success"
]

IncomingChat Event

When the viewer receives new chat from the server, it generates an IncomingChat event. If the plugin has registered an event callback for that event type, it will receive a message from the viewer:

["$event_id",
 "IncomingChat",
 $props
]

OutgoingChat Event

TBW

Default Chat Callback

TBW

Personal tools
Namespaces
Variants
Actions
Navigation
Wiki
Toolbox