Last active
April 26, 2019 20:22
-
-
Save b4ldr/02b3abd788ff1749449c622caaa54f98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use vars qw($VERSION %IRSSI); | |
use Irssi; | |
$VERSION = '0.01'; | |
%IRSSI = ( | |
authors => 'John Bond', | |
contact => 'irssi@johnbond.org', | |
name => 'wikimedia-ops script', | |
description => 'Script to clean ops channle' . | |
license => 'BSD', | |
); | |
sub sig_print_text { | |
my ($dest, $text, $stripped) = @_; | |
my $phab_bot = Irssi::settings_get_str('wiki_ops_phab_bot'); | |
my $ops_channel = Irssi::settings_get_str('wiki_ops_channel'); | |
my $dont_crap = Irssi::settings_get_str('wiki_ops_dont_crap'); | |
return unless $target == $channel; | |
# how do i get the nick? | |
return unless $nick == $phab_bot; | |
return if $msg =~ $dont_crap | |
$dest->{level} = MSGLEVEL_CLIENTCRAP; | |
Irssi::signal_continue(@_); | |
} | |
Irssi::signal_add_first('print text', 'sig_print_text'); | |
Irssi::settings_add_str('wiki_ops','wiki_ops_phab_bot','wikibugs'); | |
Irssi::settings_add_str('wiki_ops','wiki_ops_dont_crap','foobar'); | |
Irssi::settings_add_str('wiki_ops','wiki_ops_channel','#wikimedia-operations'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment