New Beta In-Experience Chat System for Channels, Filtering and More!

Hello there. I would like to address a few of my concerns that I have discovered in this beta. These could range from a lot of things, but I will just simply display my problems I have currently here:

Chat Commands

Now, I like the inclusion of instance based chat commands, but one problem is the limited amount of aliases possible with this command. As currently seen, there are only 2 aliases available. However, what if a value existed for chat commands which allowed for… a dictionary of chat commands to exist in 1 value? As an example:

local SizeCommand = path.to.SizeCommand
-- For more than one command, we set aliases in a dictionary.
SizeCommand.Aliases = {
"/scale",
"/size",
"/grow",
"/giant"
}

Alternatively, setting the dictionary of commands can be done via a property in explorer. This seems like a more effective method than having just 2 command aliases.

UI

The UI currently in the chat feels a bit too distracting from all the surroundings in game by blocking up quite a lot of screen space. For context, the color that is being used for the main Chat window is a color called “BackgroundUIContrast”. This color is essentially rgb 0,0,0 but with a transparency of 0.3. As the name suggests, it is for backgrounds on UI, but with :star2: contrast :star2:. Does Roblox’s chat fall into this case? NO.

Roblox’s chat UI should not fall within this category. Simply because the chat should not be contrasting from the actual gameplay itself. As well as that, the color is too dark which results in a large portion of the screen being covered up by this. Think of the old chat. The old chat was FAR less dark than this chat is. So how about you use a color… like BackgroundOnPress? While this correlates to the background of the UI being pressed, it would work far better for the chat than the current color does.
image

  • Easier color on the eyes
  • Less distracting and more transparent
  • Doesn’t hide a larger portion of the screen.

UX

Some of the UX in the new chat is… awful. For example, the text box is not fully scaled with the background. This results in this happening.
image

This should not be happening, and instead the textbox used for chatting should be full height of the box. So, without that full height, this happens.
image
Overall, I’d rather prefer full heighted text boxes than this. Oh my oh my.

I don’t really have a lot of problems with this new update. Hope some of this stuff gets fixed!

7 Likes

The set core does not work on the new Chat

local textchatservice = game:GetService("TextChatService")

textchatservice.OnIncomingMessage = function(message)
    if message["Status"] == Enum.TextChatMessageStatus.Success then
        game.StarterGui:SetCore("ChatMakeSystemMessage",{
            Text = "Your message has been sent",
            Font = Enum.Font.FredokaOne,
            TextSize = 25
        })
    end
end

image
Proof that it does not work in the new chat

3 Likes
1 Like

This looks great! All I’m missing is a server equivalent of OnIncomingMessage or SendingMessage.

I have a use case where I would like to filter messages for players on different teams, similar to the cross faction chat in WoW. Although it would require exposing who the message is being sent to. Reason this wouldn’t work on the client is that I can’t filter out bad words reliably.

Woah! How did you add those cool profile pictures?

3 Likes

Can we all agree that Roblox just comes out with the best studio betas?

6 Likes

This is amazing! I am very excited to see Roblox supporting more intuitive ways to use chat commands! It is also such a relief knowing that all the policy stuff will be taken care of for us. No more worrying if we forgot to filter a chat message! It’s always nice when we get more customizability to core Roblox systems without having to fork the entire thing.

I remember a few months ago I wanted to do some minor edits to the chat system but realized I would have to fork the entire chat system so just gave up. This update makes everything so much easier and makes me excited to see more updates in the future to the chat system!

You can use TextChannel:DisplaySystemMessage instead now:

message.TextChannel:DisplaySystemMessage("Message sent successfully!", "Custom.Test.Info")

local textchatservice = game:GetService("TextChatService")

textchatservice.OnIncomingMessage = function(message)
    if message.Status == Enum.TextChatMessageStatus.Success then
        if message.TextSource then
            message.TextChannel:DisplaySystemMessage("Message sent successfully!", "Custom.Test.Info")
        else
            -- Probably a system message
            if string.find(message.Metadata, "Info") then
                -- set TextChatMessageProperties and return with font choice

            end
        end
    end
end

Also had your previous code worked, you would have set up an infinite loop, so be careful. The code above avoids the infinity loop by checking for TextSource.

Normally I think best practice would be to avoid creating more messages within the callback and use the callback strictly for formatting messages by reading the message properties.

I like how OnIncomingMessage helps encapsulate all the formatting logic for fonts and text styles now instead of having it at each callsite in the game!

3 Likes

Thank you so much @metatablecatmaid

I hate working with API that doesn’t have documentation.

1 Like

For some reason, the following code causes studio to close:

local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")

TextChatService.OnIncomingMessage = function(message: TextChatMessage)
	local props = Instance.new("TextChatMessageProperties")

	local ChatTags = game:GetService("ReplicatedStorage"):WaitForChild("Functions"):WaitForChild("ChatTags"):InvokeServer() 
	
	if message.TextSource then
		local player = Players:GetPlayerByUserId(message.TextSource.UserId)
		local StringTagTable = {}
		local TagTable = ChatTags[player.UserId]
		for _, Tag in ipairs(TagTable) do
			table.insert(StringTagTable, "<font color='"..Tag.TagColor:ToHex().."'>["..Tag.TagText.."]</font>")
		end
		props.PrefixText = table.concat(StringTagTable, " ").." " .. message.PrefixText
	end

	return props	
end

Edit: Fixed it by waiting for the function before the event, however I find it strange that waitforchild would cause studio to crash.

1 Like

No, Pre-2012 chat was done in C++ not Lua, but there’s 3rd party ways to do this.

3 Likes

I like the idea for the CSV List

1 Like

A few bugs that I found:

  • The chat automatically opens upon joining, but will still show the notification in the icon when a message is sent unless you click it again.
  • When clicking ‘/’, the chat won’t open. You can only open it up if you click on the chat icon.

I forgot to mention this yesterday, but I just released a script to aid with adding prefixes and name colors to chat. NewChatController - Resources / Community Resources - DevForum | Roblox
image

I don’t think @ericplane posted theirs here, so I’ll include it as an additional resource:
TextChat+ v1.1 - A new way to manage TextChatService Tags - Resources / Community Resources - DevForum | Roblox
image

4 Likes

The chat covers up half of my monitor, is it possible that it could be resized?

3 Likes

This is life changing for admin commands!

1 Like

Can we make these commands but only admins of the experience can use them? (Admin Commands)

Yes, you just need to check the TextSource.UserId when it’s triggered.

Roblox has been cranking out these amazing updates recently, I’m really excited for the future.

The UI looks amazing and this seems much easier to work with!
Can’t wait for this to roll out into live servers!

1 Like

Was a custom chat system I was working on a long time ago, but I could never figure out how to get it to work or if it could work with lua chat system, so I never finished it

5 Likes