Chat bot script HELP

Hi guys anyone are knowing why my script doesn’t work???

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

local function onPlayerChatted(player, message, channel)
	if message:lower() == "hi" then
		TextService:FilterStringAsync("Bot01 Hi " .. player.Name .. " !", player.UserId):andThen(function(filteredString)
			channel:SendFilteredMessage(filteredString)
		end)
	elseif message:lower() == "how are you" then
		TextService:FilterStringAsync("Bot01 Great what about you?", player.UserId):andThen(function(filteredString)
			channel:SendFilteredMessage(filteredString)
		end)
	end
end

Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message, channel)
		onPlayerChatted(player, message, channel)
	end)
end)