Motor

TextChatService

Mostrar obsoleto
no creable
servicio

A service handling in-experience text chat, including managing channels, decorating messages, filtering text, creating commands, and developing custom chats interfaces.

To learn more, see In-Experience Text Chat.

Resumen

Propiedades

Métodos

Eventos

Propiedades

ChatTranslationEnabled

no replicado
leer paralelo

ChatVersion

leer paralelo

Determines whether to fully enable TextChatService or revert to the legacy chat system. Setting this property to Enum.ChatVersion.LegacyChatService effectively disables TextChatService.

CreateDefaultCommands

leer paralelo

Determines whether TextChatService should create default TextChatCommands.

If true, the following TextChatCommands are created and put in a Folder named TextChatCommands inside TextChatService:

NamePrimary AliasSecondary AliasDescriptionUsage Example
RBXConsoleCommandconsoleOpens the Developer Console.\console
RBXEmoteCommandemoteePlays an avatar emote.\e dance
RBXHelpCommandhelp?Shows a list of chat commands.\help
RBXMuteCommandmutemMutes a user by their Name or DisplayName in all TextChannels.\m Username
RBXUnmuteCommandunmuteumUnmutes a user by their Name or DisplayName in all TextChannels.\um Username
RBXVersionCommandversionvShows the chat version.\version

Note that you can edit, create, and remove TextChatCommands even if CreateDefaultCommands() is true. Also note that mute and unmute commands apply to all TextChannels.

CreateDefaultTextChannels

leer paralelo

Determines whether TextChatService should create default TextChannels.

If true, Team-based TextChannels are automatically created (and removed when Teams are removed), along with the following TextChannels in a Folder named TextChannels inside TextChatService:

NameDescription
RBXGeneralFor all messages.
RBXSystemFor system messages.
RBXTeam[BrickColor]For team messages. Name of the TextChannel is the string RBXTeam followed by the name of Team.BrickColor. For example, RBXTeamCrimson for a team with "Crimson" BrickColor.

If false, Team-based TextChannels are not automatically created and destroyed.

Note that you can edit, create, and remove TextChannels even if CreateDefaultTextChannels() is true.

Métodos

DisplayBubble

void

Displays a chat bubble above the provided partOrCharacter and fires the BubbleDisplayed event with the parameters specified in this method. Can display bubbles for non-player characters (NPCs).

Parámetros

partOrCharacter: Instance

The part or character that the bubble to be displayed above.

message: string

The text to be displayed in the chat bubble.


Devuelve

void

CanUserChatAsync

proporciona

Parámetros

userId: number

Devuelve

CanUsersChatAsync

proporciona

Parámetros

userIdFrom: number
userIdTo: number

Devuelve

Eventos

BubbleDisplayed

Fires when TextChatService:DisplayBubble() is called.

Parámetros

partOrCharacter: Instance
textChatMessage: TextChatMessage

MessageReceived

Fires exclusively on the client in two circumstances: when the client receives a TextChannel:SendAsync() request from the server, or when TextChannel:DisplaySystemMessage() is invoked on the client.

Use the TextChatMessage parameter to get the TextSource and the text of the message (with TextChatMessage.Text).

The TextChatMessage parameter is the final result of any functions bound to TextChatService.OnIncomingMessage or TextChannel.OnIncomingMessage.

Parámetros

textChatMessage: TextChatMessage

The received TextChatMessage.


SendingMessage

Fires when TextChannel:SendAsync() is called by the sending client. Use this to allow placeholder messages to be shown to the user while waiting for server response to TextChannel:SendAsync().

Parámetros

textChatMessage: TextChatMessage

OnBubbleAdded

Parámetros

adornee: Instance

Devuelve

OnIncomingMessage

Parámetros


Devuelve