diff options
author | David Phillips <david@sighup.nz> | 2017-03-17 10:16:35 +1300 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-03-17 10:16:35 +1300 |
commit | 43a93894769711c44485aa40604d63587aedd77a (patch) | |
tree | 3dc7a5bbbd2decd7bfd42c171a820f114cc5eb1d | |
parent | be16e77827b779fdaab0e703f850d3561b3c0b8c (diff) | |
parent | 03802a8644320719134817c4a510b4bfccd5390f (diff) | |
download | idalius-43a93894769711c44485aa40604d63587aedd77a.tar.xz |
Merge remote-tracking branch 'alyptik/trumpet' into trumpet
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | bot.conf.example | 2 | ||||
-rwxr-xr-x | saxrobot | 11 | ||||
-rw-r--r-- | sb_config.pm | 2 |
4 files changed, 15 insertions, 2 deletions
@@ -1 +1 @@ -bot.conf +*.conf diff --git a/bot.conf.example b/bot.conf.example index 6fc84f7..77d1a8f 100644 --- a/bot.conf.example +++ b/bot.conf.example @@ -7,3 +7,5 @@ ignore = trumpetbot,abusiveuser password = pleffquiffle admins = snargle!~kleg@glarg.example.com must_id = 1 +re = tr+u, l+e+n+y +rep = 🎺, ( ͡° ͜ʖ ͡°) @@ -88,6 +88,17 @@ sub irc_public { if ($saxcount > 0) { $irc->yield(privmsg => $channel => "🎷 " x $saxcount); } + + my $idx = 0; + for (@{$config{re}}) { + my $repcount = () = $what =~ /@{$config{re}}[$idx]/gi; + if ($repcount > 0) { + if ($repcount > 0) { + $irc->yield(privmsg => $channel => @{$config{rep}}[$idx] x $repcount); + } + $idx++; + } + return; } diff --git a/sb_config.pm b/sb_config.pm index d107147..618b616 100644 --- a/sb_config.pm +++ b/sb_config.pm @@ -9,7 +9,7 @@ use Config::Tiny; sub parse_config { my @scalar_configs = ('nick', 'username', 'ircname', 'server', 'port', 'password', 'must_id'); - my @list_configs = ('channels', 'ignore', 'admins'); + my @list_configs = ('channels', 'ignore', 'admins', 're', 'rep' ); my $file = $_[0]; my %built_config; my $config = Config::Tiny->read($file); |