Hey, great resource!!
Just a minor issue though - characters like <
and >
display like this (html entity issue I assume)
Hey, great resource!!
Just a minor issue though - characters like <
and >
display like this (html entity issue I assume)
This is an issue with TextChatService, those characters are replaced to prevent users from using rich text, however, this behaviour cannot be disabled for custom chats
I could create a substitution system to fix this, I could… I don’t like it
hi! would this work with let’s say a script that changes the speaker’s name? great resource btw i think textchatservice screwed us all over, haha
Honestly, yeah.
It really has. It’s an unfinished buggy mess on the client-side with missing features, notorious issues and overall an awful UI/UX experience.
I still want to like it, and I hope it gets good enough to the point community replacements aren’t necessary. Though I feel like the engineers aren’t given enough time to work on it, and that’s the result we got.
I don’t dislike the engineers for trying, I just feel like they were rushed to get it out before they were happy with it.
It is possible, but not by chaning the speaker’s name
The Lua Chat System relies a lot of the name of the speaker, channel, or whatever, to get said speaker or channel, so changing the name of the speaker would break that, unless the name of the speaker is changed as it is created
How to achieve it, you’d have to use :RegisterFilterMessageFunction()
on either ChatService
or ChatChannel
, and modify the SpeakerDisplayName
of the MessageObj
:
local Chat = require(game.ReplicatedStorage.Chat)
local ChatService = Chat:GetChatService()
ChatService:RegisterFilterMessageFunction("SpeakerDisplayNameOverwrite", function(speakerName: string, messageObj: Chat.MessageObj, channel: string)
messageObj.SpeakerDisplayName = "CustomName"
end)
Alternatively, it would be possible to add a DisplayName field to the speaker, and make the message creator use that for the messageObj.SpeakerDisplayName
. I might do that in a future release
Client side, it is also possible to mess with the message creator modules. I also would like to make the ExtraData table or more, accessible within the utils module, for more customization
This is the function responsible for creating the label with the player’s name, inside of utils
Currently, the SpeakerName (formatName in the util function) is being set in the DefaultChatMessage and WhisperMessage message creator modules (ideally I would like this to be inside of utils)
So you could play with this
Update:
The LegacyChat actually already escapes those characters, when the FFlag something something (for right to left support I think) is enabled (which it is by default). I also noticed that, those escaped sequences actually display correctly with rich text enabled (which it is if the FFlag is set to true)
So why does it not work?
<font dir="ltr"> </font>&gt;
The & is getting substituted twice, once by the Lua Chat System, and then by TextChatService, so >
ends up being &gt;
When creating chat channels, you may have a problem that the normal TextChatService channel tabs overlap the chat port, in this case just disable TextChatService.ChannelTabsConfiguration.Enabled and the problem should disappear, it worked for me
P.S. i think author just forgot to mention this step in the installation section but it’s alright
Is there any way to make non-player speakers? i think i’m doing all right, but the message is just don’t showing, like i receive a notification about it (1 symbol near the channel tab)
but when i go to this channel there’s nothing new, i tried both on client and server
-- server script in serverscriptservice
local Chat = require(game.ReplicatedStorage.Chat)
local ChatService = Chat:GetChatService()
local ShowBroadcastMsgEvent = game.ReplicatedStorage.Events:WaitForChild("ShowBroadcastMsg")
local BroadcastChannel = ChatService:AddChannel("Broadcast", true)
BroadcastChannel.Leavable = false
BroadcastChannel.WelcomeMessage = "Welcome to Broadcast tune!"
BroadcastChannel.AutoJoin = true
BroadcastChannel.SpeakerJoined:Connect(function(speaker, ...: any)
print("speaker join to broadcast: "..speaker)
end)
local MeteorologicalCenterSpeaker = ChatService:AddSpeaker("Meteorological Center")
MeteorologicalCenterSpeaker:JoinChannel("Broadcast")
MeteorologicalCenterSpeaker:SetMainChannel("Broadcast")
game.Players.PlayerAdded:Connect(function(player: Player)
task.wait(5)
MeteorologicalCenterSpeaker:SayMessage("Storm", BroadcastChannel.Name)
ShowBroadcastMsgEvent:FireAllClients(MeteorologicalCenterSpeaker.Name)
print("message sent")
end)
--local script in starterplayerscripts
local Chat = require(game.ReplicatedStorage.Chat)
local ChatService = Chat:GetChatService()
local ShowBroadcastMsgEvent = game.ReplicatedStorage.Events:WaitForChild("ShowBroadcastMsg")
ShowBroadcastMsgEvent.OnClientEvent:Connect(function(speakername, ...: any)
local speaker = ChatService:GetSpeaker(speakername)
speaker:SayMessage("Storm", "Broadcast")
speaker:SendSystemMessage("test", "Broadcast")
end)
That is odd, when I tested it, I received the message, but ran into another issue, that is, the message was waiting to be filtered, which never happened since it isn’t a player… So the message was displaying as “____”
I would suggest looking for errors, but other than that I really have no idea as I cannot replicate your specific issue
About the other issue of the message being “____”, I will look into it this weekend. I’m pretty sure this is an issue with how I remade the filtering system, I did not consider chat bots, and I don’t actually know how they are handled by the LegacyChat
In the mean time, you can use this. The name of the ChatBot doesn’t appear, as it is, well, not being used, but it’s something…
game.Players.PlayerAdded:Connect(function(player: Player)
task.wait(5)
local speaker = ChatService:GetSpeaker(player.Name)
speaker:SendSystemMessage("Storm", BroadcastChannel.Name)
print("message sent")
end)
Also, sending the message to the client is not needed (or shouldn’t be), I assume you added that as you were trying everything to get it working…
Оh! I noticed that the message is now being sent successfully, it looks like it was some one-time roblox bug, but the filtering issue is still relevant
thankies for the help!! would u mind helping me and someone else through this process? it would be greatly appreciated if ur interested in payment for it too we can work that out
Did you try :RegisterFilterMessageFunction()
and the code snippet I sent? Send me a dm and I can help you further. Also don’t worry about a payement, but I might take some time for lengthy answers as summer break isn’t quite there yet
there was an attempt to get it done, LOL. where do you want me to shoot you a dm?
On the forum, you can click on my profile and there is a “Message” button
The initial file for this version had a bug,
– Fixed the system attempting to remove the speaker twice when leaving a channel
– Fixed some types having not being quite right
– Added a check to throw an error if using Chat:GetChatService() from the client
– Added a check for received messages that lack metadata (likely not sent through the lua chat system)
– Added checks for non-disabled parts of TextChatService that should be disabled (ie the chat window, default channels, etc)
– Added support for WinryVirtualKeyboard & Gamepad support
(This includes a modification to the ChatLocalization table, to make the base Textbox message show the proper keybind. Don’t reuse the old localization table
– Added ChatSettings.ChatHotKeyKeyboard
& ChatSettings.ChatHotKeyGamepad
, to customize the keybinds.
These can be changed at runtime, for example, to let players chose their prefered keybind. (Previous ChatSettings modules without those field still work)
– Added the FixDoubleRichTextSanitization FFlag, in the FFlags module, which fixes <, > and & appearing as > or whatever
– Fixed an oversight in the new filtering system leading to messages from bot speakers always displaying as “______”
@Shake_Official, you might like this one
Instantly put it into a place to try and yep, it works!
It’s nice to see another integration of the keyboard with an alternative Luau-exclusive API. I’ll look at including a proper WVK Luau API in the next release (One that, of course, takes into account the intricacies you’ve done to make your wrapper work).
I updated the files for version 3, there was a small issue where I did not write an if statement correctly, which caused any changes of the Settings module to trigger an update of the Textbox’s background text, and if that happened before the chat bar is created, it would lead to an error
That has been fixed, and updates to the Textbox’s background text don’t error anymore if the chat bar doesn’t exist yet
Hi, it really works fine now! Thanks for the update!
– Fixed messages from the team channel being stuck as the unfiltered placeholder
– Fixed the ChatBar breaking when existing custom states
– Added support for the legacy BubbleChat. To use it, set ChatSettings.BubbleChatEnabled = true, and TextChatService.BubbleChatConfiguration.Enabled = false
Smaller update because of the bugs I had to fix,
Somehow, the team channel not working has been a thing since the port I think, the other one was from improper testing. I might make beta versions for future release or something, so it can be tested in productionish. Testing using the local server in studio is a bit painful
This going to be pretty useful, i hope its done soon!