Need help with bot

I would like to make a !clear [user] command that timeouts the [user] then untimes them to clear all the chat they have sent! Thanks in advance! WolfLord~

I’d suggest just timing them out for one second (commonly called a purge). You need to sent .timeout user 1 to the server as a privmsg. Not entirely sure what you’re using for a bot, but here is an example in mIRC.
on *:TEXT:!clear *:#: { msg $chan .timeout $1 1 }

That code wont work since $1 = !clear. Change $1 to $2.

This taken into consideration he uses mIRC.

To OP: Might be usefull to include what program you’ll want code for… (._.’) FailFish