aboutsummaryrefslogtreecommitdiff
path: root/lib/IRC/Client/Plugin/PingPong.pm6
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IRC/Client/Plugin/PingPong.pm6')
-rw-r--r--lib/IRC/Client/Plugin/PingPong.pm610
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/IRC/Client/Plugin/PingPong.pm6 b/lib/IRC/Client/Plugin/PingPong.pm6
new file mode 100644
index 0000000..7ba977d
--- /dev/null
+++ b/lib/IRC/Client/Plugin/PingPong.pm6
@@ -0,0 +1,10 @@
+use v6;
+unit class IRC::Client::Plugin::PingPong:ver<1.001001>;
+
+multi method msg () { True }
+multi method msg ($irc, $msg) {
+ return unless $msg<command> eq 'PING';
+ my $res = "PONG {$irc.nick} $msg<params>[0]";
+ $irc.debug and say $res;
+ $irc.ssay($res);
+}