BetterChat V3 | Discontinued

Of course! You can use the bubble chat API I recently implemented with a client addon.

local bubbleChat = api.bubbleChat

local controller = bubbleChat.new(workspace.Part)

controller:createMessage("hey")
controller:setColors({
["BubbleBackgroundColor"] = Color3.fromRGB(255,0,0)
})

controller:setTypingIndicatorVisible(true)

If you need it to be accessible globally, you can always make an addon with something like

return function(api)
   shared.betterChatAPI = api
end

and in another script do:

local betterChatAPI;
repeat
    betterChatAPI = shared.betterChatAPI
    task.wait()
until(betterChatAPI ~= nil)

print(betterChatAPI)
1 Like

what version of the source module is more up to date, the one in the model, or the rbxm?

The GitHub will be the most up-to-date, the model is a version behind. I wasn’t aware that Roblox is allowing the source code now.

there is a src module inside of the model itself it requires

1 Like

Add the full_loader.rbxm file to studio, this will be the up-to-date source code

You can also make a plugin using the code linked on BetterChatV3/updater.lua at main ¡ Jumpathy/BetterChatV3 ¡ GitHub

To make an auto-updater that will update the chat to its latest version when you open studio.

Thanks, need to do a minor fork for a few features i want, but promising module

1 Like

What sort of features are you looking for?

@Jumpathy hey, I’ve been working with your module with a bit and I wanted to ask, is there any way to assign a chat tag to a player at runtime? Let’s say, for example, for roles that players can select ingame.

Also, if possible please add a ImageColor parameter to chat tags with images.

1 Like

The server API does support a method for the chat tags, directly on the speakers.

speaker:addTag("Tag text",Color3.fromRGB(255,0,0))
speaker:removeTag("Tag text")

Note that it will allow for duplicated tags, so do check if they already have the tag or else they could break it and add like 100 tags of the same text.

You can check the tags with the speaker.tags property, it will return something like this:

{
	{
		text = "Owner",
		color = Color3.fromRGB(255,255,0)
	}
}

Examples:

return function(api)
	local speakers = {}
	
	local onSpeaker = function(speaker)
		if speaker.isPlayer then
			speakers[speaker.player] = speaker
		end
	end
	
	api.speaker.speakerAdded:Connect(onSpeaker)
	for _,speaker in pairs(api.speaker:getSpeakers()) do
		task.spawn(onSpeaker,speaker)
	end
	
	-- later examples:
	
	local replicatedStorage = game:GetService("ReplicatedStorage")
	local validTags = {
		["Cool"] = Color3.fromRGB(255,0,0),
		["Loser"] = Color3.fromRGB(0,255,0)
	}
	
	replicatedStorage.addTag.OnServerEvent:Connect(function(player,name)
		if validTags[name] then
			speakers[player]:addTag(name,validTags[name])
		end
	end)
	
	replicatedStorage.removeTag.OnServerEvent:Connect(function(player,name)
		if validTags[name] then
			speakers[player]:removeTag(name)
		end
	end)
end

Note:

-- There's other ways to get a player's speaker such as:
api.speaker:getById(player.UserId)
api.speaker:getByName(player.Name)
1 Like

Okay, thank you! That was all I needed. Also it seems both the updater plugin and the new instructions are no longer working.

1 Like

The updater plugin isn’t working? It has been for me, what problems have you encountered?

src isn’t inside loader, causing it to break the entire betterchat plugin.

Trying to use the MainModule method is also kinda borked? cuz MainModule is outdated.

1 Like

Hey, I tried doing what you told me I could do earlier and it seems like it doesn’t work work, maybe I’m missing something but current code:

return function(api)
	local sss = game:GetService("ServerScriptService")
	sss.ChangeTag.Event:Connect(function(player, role_icon, role_color) 
		local speaker = api.speaker:getById(player.UserId)
		speaker:removeTag("RoleTag")
		speaker:addTag("RoleTag",{
			image = role_icon, -- string, rbxassetid
			Color = role_color -- color3, color3 always has color3.R, color3.G, color3.B
		})
	end)
end

error:

  19:34:08.118  ReplicatedStorage.betterchat_shared.formatting.richText:56: attempt to perform arithmetic (mul) on nil and number  -  Client - richText:56
  19:34:08.118  Stack Begin  -  Studio
  19:34:08.118  Script 'ReplicatedStorage.betterchat_shared.formatting.richText', Line 56 - function tostringRgb  -  Studio - richText:56
  19:34:08.118  Script 'ReplicatedStorage.betterchat_shared.formatting.richText', Line 44 - function colorize  -  Studio - richText:44
  19:34:08.118  Script 'Players.RabbyDevs.PlayerScripts.betterChatClient.modules.core.messages.util.functions', Line 99  -  Studio - functions:99
  19:34:08.119  Script 'Players.RabbyDevs.PlayerScripts.betterChatClient.modules.core.messages.default', Line 180  -  Studio - default:180
  19:34:08.119  Script 'Players.RabbyDevs.PlayerScripts.betterChatClient.load', Line 402  -  Studio - load:402
  19:34:08.119  Script 'Players.RabbyDevs.PlayerScripts.betterChatClient.load', Line 442  -  Studio - load:442
  19:34:08.119  Script 'Players.RabbyDevs.PlayerScripts.betterChatClient.load', Line 541  -  Studio - load:541
  19:34:08.119  Stack End 


Also it seems like the thing completely breaks upon sending more than 1 message.

Update on previous issue: I edited the speaker api script to allow me to have a image added from the api.

Even trying without a proper tag with an image, they don’t even seem to work!

  19:56:03.166  Stack Begin  -  Studio
  19:56:03.166  Script 'Players.RabbyDevs.PlayerScripts.betterChatClient.modules.core.messages.default', Line 278  -  Studio - default:278
  19:56:03.166  Script 'Players.RabbyDevs.PlayerScripts.betterChatClient.load', Line 402  -  Studio - load:402
  19:56:03.166  Script 'Players.RabbyDevs.PlayerScripts.betterChatClient.load', Line 442  -  Studio - load:442
  19:56:03.166  Script 'Players.RabbyDevs.PlayerScripts.betterChatClient.load', Line 541  -  Studio - load:541
  19:56:03.166  Stack End  -  Studio

image

This is because the API function directly only accepts tag text and tag colors, not images. To add tags with images you’ll need to add it to the speaker.tags table, like so:

return function(api)
	local sss = game:GetService("ServerScriptService")
	local internalName = "RoleTag"
	
	sss.ChangeTag.Event:Connect(function(player, role_icon) 
		local speaker = api.speaker:getById(player.UserId)
		for idx,tag in pairs(speaker.tags) do
			if(tag.name == internalName) then
				table.remove(speaker.tags,idx)
			end
		end
		table.insert(speaker.tags,{
			text = "",
			image = role_icon,
			color = Color3.fromRGB(0,0,0), --> does not support colors directly
			name = internalName --> Not normally a property, this is custom for this script
		})
	end)
end

If you want the other desired behavior, you’d need to rewrite the function, which I will not be personally adding to the system as my own because it will break other people who are using the API for that purpose.

And it does not take custom colors, so to do that you’d need to go to
src > client > modules > core > messages > default
and add at line 270 or so add:

image.ImageColor3 = tag.color or Color3.fromRGB(255,255,255)

This will make it accept a .color property for the tags. I will be oficially adding this in the next update as well as an image tags overhaul to use the same system as custom emojis for better appearances.

To add tags without images, it would be like so:

speaker:addTag("text",Color3.fromRGB(255,0,0))

This is intended behavior, you can disable it in the configuration in Messages.MessageGrouping.Enabled,
it’s meant to make messages sent by the same user back-to-back appear to merge together.

1 Like


Hey, I’ve encountered a small problem with betterchat v3 recently, that being bubbles sometimes simply never disappear.

Odd, I found the cause, but I don’t understand why it’s happening.

Remove this:

	local newMessage
	if cache[1] then --> using a message cache to be more memory-friendly :skull:
		local message = cache[1]
		table.remove(cache,1)
		reset(message)
		newMessage = message
	end
	
	local raw,user,icon,edit;
	if newMessage then
		raw = newMessage.Raw
		user = raw.User
		icon = newMessage:FindFirstChild("Icon")
		edit = newMessage:FindFirstChild("Edit")
	end

It’s located in client.modules.core.messages.templates.regular

Hi @Jumpathy,
Thank you for creating this module, it’s a big improvement over Roblox’s default chats.
I was trying out your chat in studio by cloning the repo and serving using rojo and I noticed that there was a few bugs.

Some of the empty folders were missing in the repo, like src\ServerScriptService\BetterChat V3\Addons, src\ServerScriptService\BetterChat V3\Config\Loader\src\shared\events, src\ServerScriptService\BetterChat V3\Config\Loader\src\shared\loading and src\ServerScriptService\BetterChat V3\Config\Loader\src\shared\addons which were causing WaitForChild errors and prevented the chat from loading.

Another bug that I found was with the quick chat and it not saving the formatted text correctly,
If you right click a message and save the message with formatting, it is saved with the HTML/RichText format instead of the markdown format.
**Bold Text** gets saved as <b>Bold Text</b>
Heres a video of the bug: Watch RobloxStudioBeta_sQoACmmLBy.mp4 | Streamable

1 Like

Thank you for telling me. I hadn’t considered it, as I recently rehauled the backend for messages filtering.

The flow for them is like so now:

Message -> (ex: **hi**)
Process with rich text (ex: **hi** --> <b>hi</b>)
Strip rich text and maintain information: (ex: <b>hi</b> --> hi)
Filter stripped text
-- When requested for a user:
Reapply tags to filtered text (ex: hi --> <b>hi</b>)
Distribute message accordingly to clients

Basically, I used to handle all of the rich text on the client, but now after moving it to the server, the client only has the XML formatted version and doesn’t know that it’s not a regular message. To fix it, I’ll probably have to just cache what the message originally was or something along those lines. Thank you for bringing this to my attention.


That being said, it should still work if you directly add it in the settings menu. All of this was to combat filter bypassing, a problem that I had seen in games using the chat. It was possible to bypass by making colored messages back-to-back with different letters and the chat would have no idea you’re actually swearing.

If it is not already a feature, please add the backslash ("\") functionality from sites like discord into the system. Putting a backslash before text formatting will disable the effects of the format.

For example:
Bold
\**Bold**
(obviously the backslash is hidden and only shows up as “**Bold**”)

1 Like