Twitch bot disconnect script

I know this is going to seem really dumb however I am trying to code my bot to only disconnect when an op uses the command. I would also like it to say 'Sorry but you do not have permission to do this if a normal user uses it.

Code so far:

on $*:TEXT:!disconnect:#:{
if ($nick isop $chan) {   msg $chan Goodbye everyone! I have been asked to disconnect! }; { /disconnect }
else { msg $chan Sorry but you cannot use this command! }
}
on ^*:text:!disconnect:#:{
  if ($nick isop $chan) { 
    msg $chan Goodbye everyone! I have been asked to disconnect! 
    disconnect
  }
  else { 
    if (!%no.spam) { 
      msg $chan Sorry but you cannot use this command! 
      set -u10 %no.spam derp
    }
  }
}

There you go. I’ve added a 10 seconds spam protection too.

1 Like