Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

sendTextChatMessage

sendTextChatMessage(world, sendTextChatMessageOptions): Promise<TextChatSendResult>

Sends a message she typed to the room’s text chat, which decides it: her right to send, the channel, the limits, the filter and who receives it, each at her own level. Resolves with the message as she reads it, masked at her level, or why the room refused it, and never rejects; the message also lands in useTextChatSession. In a game played alone it resolves refused alone. As Roblox’s TextChannel:SendAsync.

Parameter Type
world World
sendTextChatMessageOptions SendTextChatMessageOptions

Promise<TextChatSendResult>

const sent = await sendTextChatMessage(world, { text: "gg" });
if (!sent.ok) showRefusal(sent.reason);