Skip to content

Instantly share code, notes, and snippets.

@b4ldr
Last active April 26, 2019 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b4ldr/02b3abd788ff1749449c622caaa54f98 to your computer and use it in GitHub Desktop.
Save b4ldr/02b3abd788ff1749449c622caaa54f98 to your computer and use it in GitHub Desktop.
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