Originally Posted By: namitsoo

-General administrative commands (!ban user_xy -> bans user_xy, !timeout user_xy 30 ->timeout a user for 30seconds)




Twitch is a little odd with the way it goes about those. The commands would be simple, but it takes some digging to figure out what they actually want when it is done through an IRC client.


Code:

on *:TEXT:!ban *:#: { 
  if ($nick isop $chan) {
    msg $chan .ban $$2 
    msg $chan $$2 has been banned.
  }
}

on *:TEXT:!unban *:#: { 
  if ($nick isop $chan) {
    msg $chan .unban $$2 
    msg $chan $$2 has been unbanned.
  }
}

on *:TEXT:!timeout *:#: { 
  if ($nick isop $chan) {
    msg $chan .timeout $$2 $3 
    msg $chan $$2 has been timed out.
  }
}




This will look strange on the bot's end, since you're actually sending a message to the channel. However, nobody else will actually *see* the line where the bot says ".ban jerkface". that's just the way twitch works with that.

Last edited by Teksura; 13/06/14 04:55 AM.