As a Roblox developer, it is currently too hard to work with TextChatService in many scenarios.
I recently used it to attempt to create a private chat system, but there are a few aspects of it that really left me wanting,
First, Poor documentation.
-
ChatInputBarConfiguration.TargetTextChannel is a property you can set, but is stated as read-only in the wiki. ChatInputBarConfiguration isn’t referenced at all on TextChatService, and I really think it should be, among other things. It was very difficult as a developer to figure out my options when using this system.
-
Another example would be that TextChannel.OnIncomingMessage fires BEFORE TextChatService.SendingMessage. This is not stated to be the case anywhere in the documentation, and would be assumed to work otherwise. This caused issues for me, which I will mention further down.
-
TextChannel.ShouldDeliverCallback is a function that has two inputs. TextChatMessage, and TextSource. It states in the documentation that you can find the sender via TextChatMessage.TextSource, but does not allude to what the inputed TextSource is. The inputed TextSource is the person receiving the message.
Better documentation, with code examples and recommended usage, would greatly reduce the amount of effort required to use this service.
Second, a lack of customization.
-
There’s no channel bar, so having custom chat channels requires a custom ui… which pretty much bypasses textchatservice in the first place. As a feature of the legacy chat, it is expected to have access to another viable option.
-
There’s no way to mod in our chat channels to the existing ui, either, as there is no way to remove, or otherwise modify the existing chat messages.
Adding more customization will allow users to create UI that works better with the existing roblox UI. This can lead to a dramatic difference in quality and consistency.
Third, unintuitive, and inconsistent features
- TextChannel.OnIncomingMessage fires BEFORE TextChatService.SendingMessage.
As an example, I used “/global chatstuff” to send the following chat into every text channel. I then wanted to remove the “/global” for the player that sent it, as well as the players who received the message.
So, I used .SendingMessage to check if it had “/global”, in order to send the message into several channels using SendAsync. I used OnIncomingMessage to remove the “/global”. .Sending message never saw the command, because the command was removed with OnIncomingMessage.
The solution ended up being to just use OnIncomingMessage to detect the command and filter out the global, by checking to make sure it was sent by the same player who received it, and using .ShouldDeliverCallback to remove the message from everyone else. Not exactly intuitive.
-
Messages can only be sent from the client, even if it is a server message. It’s unintuitive to have to send a remote event to a player for them to send their own message.
-
No TextChannel:UnsubscribeAsync(). Why is it that we use a function called :SubscribeAsync(), and yet in order to remove the player from the channel we have to find and delete the TextSource?
-
Richtext UIStroke does not fade properly when the chat ui fades. It will leave a black outline of the text sent. This feels more like a bug than anything.
-
The only way to remove a message on the client is to use OnIncomingMessage, and set the PrefixText and Text to " ". If it’s set to nothing, it won’t change anything. I was expecting that it would leave an empty space in chat, but it doesn’t which is nice… but also, not intuitive.
-
TextChatService.SendingMessage is stated as “Use this to allow placeholder messages to be shown to the user while waiting for server response to TextChannel:SendAsync()”, without an actual way to create, or prevent creating, your own placeholder message in chat.
The more intuitive a system is, the less time it takes to work with, and the greater my experience as a developer. In combination, these issues had made this system a lot more difficult to work with when compared to many other roblox services.
In total, it would really improve my experience if any of these examples were looked into and improved. Still a great system, appreciate all of the hard work, and I am looking forward to future updates!