If you’re a member of the staff you have several options including talking to the person, muting, and kicking them. If you don’t know how to use these commands ask another staff member for help.
If you aren’t staff, and there are no staff on to help monitor the chat, please discourage the person from spamming but be polite while you do it (for example, “Please don’t spam” is better than “stop!!! that’s breaking the rules!!!“).