Specific TO Command

Hello !

I’m here to ask you how to create a very specific command (I’m struggling with tags, forgive my young experience in this business…)

I would like something like this:

The moderator/streamer would type: !commandname @user1
And this would time out user1 for a random amount of time (between x and x seconds) by displaying a message like : @user1 is punished for x seconds !

I have no idea if this is possible.

Thanks in advance for your answers!