Just elaborating on what @tournymastercursebot said:
To clear a chat room:
PRIVMSG #channel :/clear
To clear a user (replaces user with message deleted)
PRIVMSG #channel :/timeout user (much more is allowed here, but this is the textbook example)
These commands result in TMI sending a CLEARCHAT message for clients, which then are used to alter the on-screen text.
Should be documented here Let us know if it’s unclear!