Every time you call TextChannel:SendAsync() with a command that’ll be intercepted by TextChatCommand.Triggered, SendAsync will proceed to infinitely yield. This appears to be happening in both studio and live servers.
What I expect to happen:
local TextChannel = a text channel
TextChannel:SendAsync("/w xtntt Hello World")
print("Command sent!") -- Output: Command sent!
What actually happens:
local TextChannel = a text channel
TextChannel:SendAsync("/w xtntt Hello World")
print("Command sent!") -- Never outputs, as the script is permanently caught on SendAsync.
I am aware that commands caught by .Triggered are sunk and do not replicate to other clients, however SendAsync should not be infinitely yielding due to this. On top of being annoying, this could also be a source for memory leaks.
This can be observed in studio:
Run the following code:
local channel: TextChannel = game:GetService("TextChatService"):WaitForChild("TextChannels"):WaitForChild("RBXGeneral")
local function sendMessage()
channel:SendAsync("/w hello")
end
local thread = coroutine.create(sendMessage)
coroutine.resume(thread)
task.wait(0.5)
print(coroutine.status(thread)) -- Will always print suspended rather than dead