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 the sender typed to the room’s text chat, which decides it: the sender’s right to send, the channel, the limits, the filter and who receives it, each at the recipient’s own level. Resolves with the message as the sender reads it, masked at the sender’s 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);