Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ban/timeout reason and duration #13

Open
SReject opened this issue Jun 20, 2016 · 2 comments
Open

ban/timeout reason and duration #13

SReject opened this issue Jun 20, 2016 · 2 comments

Comments

@SReject
Copy link
Owner

SReject commented Jun 20, 2016

I need feedback on how this should be implemented, use cases, etc.

@Dissgruntled
Copy link

This is what I have been using. Just my personal preference on the look.

on $*:PARSELINE:in:/^@msg-id=timeout_success :\S+ NOTICE #\S+ :\S+ has been timed out for \d+ seconds\.$/i: {
  .parseline -it
  haltdef
}

on $*:PARSELINE:in:/^(?:@ban-duration=(\d+);)?@?ban-reason=(\S+)? :\S+ CLEARCHAT (#\S+) :(\S+)$/iF: {
  var %dur $regml(1), %reason $replace($regml(2), $chr(92) $+ s, $chr(32)), %chan $regml(3), %nick $twitchname($regml(4),%chan)
  if (%reason && %dur) { echo $color(info text) %chan $+([,$asctime($ctime,h:nn TT),]) %nick has been timed out for %dur seconds. Reason: %reason }
  elseif (%reason && !%dur) { echo $color(info text) %chan $+([,$asctime($ctime,h:nn TT),]) %nick has been permanently banned. Reason: %reason }
  elseif (%dur && !%reason) { echo $color(info text) %chan $+([,$asctime($ctime,h:nn TT),]) %nick has been timed out for %dur seconds. }
  elseif (!%reason && !%dur) { echo $color(info text) %chan $+([,$asctime($ctime,h:nn TT),]) %nick has been permanently banned. }
  .parseline -it
  haltdef
}

@SReject
Copy link
Owner Author

SReject commented Jun 22, 2016

For implementation I'd prefer I use something IRC-RFC related. That way scripts can make use of built in events to handle such

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants