Im trying to intercept a message before it is sent with TextChatService. Now, im pretty sure its impossible, for whatever reason, even though we have a Message Recieve CALLBACK we dont have a Message Sent CALLBACK.
Its kinda awful, since that means ill have to implement my own InputBar for chat, but its whatever as long as TextChannel:SendAsync() works. If it works, I can use Metadata parameter to encode a Lua table to a string and allow for some REALLY custom chat options. But every time i use SendAsync, it simply says my message status is “Sending.”
Heres my code:
local TextChatService = game:GetService("TextChatService")
local Channel =TextChatService:WaitForChild("TextChannels"):WaitForChild("RBXGeneral")
local Http = game:GetService("HttpService")
local TestTable =
{
message="success",
swag=true
}
TextChatService.SendingMessage:connect(function(msg)
print("Sending message! :",msg)
end)
TextChatService.MessageReceived:Connect(function(msg)
print("msg recieved! :",msg)
end)
local Result = Channel:SendAsync("Hello!!!!!!")
print("Result status: ",Result.Status)
while wait(1) do
print("Result status: ",Result.Status)
end
At the very end, I have a infinite loop that always checks on the status of my sent message. This script is a local script within player starter scripts, and everything works fine with normal messages sent by the default Roblox input bar. But if you try to send a message with SendAsync(), nothing. How do i resolve a Sending message? What has to happen?