Skip to content

Commit

Permalink
Migrate to TextChatService:CanUsersChatAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
brennanarthurisaac authored Jan 22, 2025
1 parent 442f98f commit 714148f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cmdr/BuiltInCommands/Admin/announceServer.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
local TextChatService = game:GetService("TextChatService")
local TextService = game:GetService("TextService")
local Players = game:GetService("Players")
local Chat = game:GetService("Chat")

return function(context, text)
local filterResult = TextService:FilterStringAsync(text, context.Executor.UserId, Enum.TextFilterContext.PublicChat)

for _, player in ipairs(Players:GetPlayers()) do
if Chat:CanUsersChatAsync(context.Executor.UserId, player.UserId) then
if TextChatService:CanUsersChatAsync(context.Executor.UserId, player.UserId) then
context:SendEvent(player, "Message", filterResult:GetChatForUserAsync(player.UserId), context.Executor)
end
end
Expand Down

0 comments on commit 714148f

Please sign in to comment.