Roblox Wiki
Advertisement
Roblox Wiki
Discontinued
This article is about a discontinued service.

The ChatService is a special service. It cannot be retrieved with :GetService(). While it is possible to retrieve ChatService through the default chat system, most uses can be replicated in alternative ways.

ChatService is received as a parameter from a function used for editing the chat.

ChatService is deprecated in favor of TextChatService light iconTextChatService dark iconTextChatService.[1]

new(): ChatService[]

Returns a newly created ChatService object containing a list of ChatChannels, ChatSpeakers, FilterMessageFunctions, ProcessCommandsFunctions, BindableEvents, the ChatVersion, and all the functions listed below.

Channels[]

AddChannel(ChannelName: string): ChatChannel[]

Creates a new ChatChannel object.

RemoveChannel(ChannelName: string): void[]

Removes the given ChatChannel object, disconnecting all ChatSpeakers.

GetChannel(ChannelName: string): ChatChannel[]

Finds the ChatChannel with the given ChannelName, or nil if it isn't found.

GetChannelList(): Table[]

Returns a Table of Channels within the ChatService.

GetAutoJoinChannelList(): Table[]

Returns a Table of Channels that can be automatically joined by players.

Speakers[]

AddSpeaker(speakerName: string): ChatSpeaker[]

Creates a ChatSpeaker with the given name.

RemoveSpeaker(speakerName: string): void[]

Removes the ChatSpeaker with the given name.

GetSpeaker(speakerName: string): ChatSpeaker[]

Finds and returns a ChatSpeaker with the given name.

GetSpeakerList(): Table[]

Returns a Table of all ChatSpeakers.

GetSpeakerByUserOrDisplayName(speakerName: string): ChatSpeaker[]

Finds and returns a possible ChatSpeaker with the given username or displayname.

InternalUnmuteSpeaker(speakerName: string): void[]

Internally (server-side only) unmutes a ChatSpeaker with the given name.

Commands[]

RegisterProcessCommandsFunction(funcId: int, func: function, priority: int): void[]

Internal method used to register a ProcessCommandsFunction based on priority level.

UnregisterProcessCommandsFunction(funcId: int): void[]

Internal method used to remove/deregister a ProcessCommandsFunction.

ProcessCommandsFunctionExists(funcId: int): bool[]

Returns if a giver ProcessCommandsFunction has been registered with the ChatService.

Messages[]

SendGlobalSystemMessage(message: string): void[]

Used by the default chat system to send system messages to all players.

RegisterFilterMessageFunction(funcId: int, func: function, priority: int): void[]

Internal method used to register a FilterMessageFunction based on priority level.

UnregisterFilterMessageFunction(funcId: int): void[]

Internal method used to remove/deregister a FilterMessageFunction.

FilterMessageFunctionExists(funcId: int): bool[]

Returns if a giver FilterMessageFunction has been registered with the ChatService.

Internal/Other[]

InternalNotifyFilterIssue(): void[]

Used by the ChatService to test for and notify the player of chat filter problems.

InternalApplyRobloxFilter(speakerName: string, message: string, toSpeakerName: string): string[]

Used to internally filter messages. This function will return true if IsStudio, the fromSpeaker is nil, the message is all spaces, or the message otherwise passes the typical FilterStringAsync check.

InternalApplyRobloxFilterNewAPI(speakerName: string, message: string, textFilterContext: TextFilterContext): bool,bool,string[]

Similar to InternalApplyRobloxFilter but with additional check in-place, and a tuple as the return type.

InternalDoMessageFilter(speakerName: string, messageObj: string, channel: ChatChannel): void[]

Attempts to apply all registered FilterMessageFunctions to the given messageObj.

InternalDoProcessCommands(speakerName: string, message: string, channel: ChatChannel): void[]

Attempts to apply all registered ProcessCommandFunctions to the given message.

InternalGetUniqueMessageId(): number[]

Increments and then returns the value of the internal MessageIdCounter variable.

InternalAddSpeakerWithPlayerObject(speakerName: string, playerObj: Player, fireSpeakerAdded: bool): void[]

Uses the giver Player to create a new ChatSpeaker. If fireSpeakerAdded is set to true it also fires a BindableEvent called SpeakerAdded.

InternalFireSpeakerAdded(speakerName: string): void[]

Likely a test function, as this does not actually create a new ChatSpeaker, it only fires a BindableEvent called SpeakerAdded.

References[]

External links[]

Advertisement