@xander1998 is correct, however I would write it this way instead :
AddEventHandler("chatMessage", function(s, n, m)
local message = string.lower(m) -- This prevents it from NOT recognizing /DISCORD as the command (just in case the user has caps lock on)
if message == "/discord" then
CancelEvent() -- Hide the message from user chat
TriggerClientEvent("chatMessage", s, "DISCORD", {204, 51, 255}, "DISCORD LINK")
end
if message == "/help" then
CancelEvent()
TriggerClientEvent("chatMessage", s, "HELP", {204, 51, 255}, "CHANGE ME")
end
end)
This will help users out, just in case they don’t type the EXACT caps needed for the command.
string.lower(m) converts the message to all lowercase when a message is received.