diff options
-rw-r--r-- | Changes | 9 | ||||
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | lib/IRC/Client.pm6 | 7 |
3 files changed, 22 insertions, 3 deletions
@@ -1,10 +1,13 @@ Revision History for 'IRC::Client' Perl 6 Distribution 2.002001 2016-01-03 - - Fix grammar parsing errors that ignored nicks/usernames with underscores + - Fixed grammar parsing errors that ignored nicks/usernames with underscores and digit 0 (#8) - - Add server password support (#3) - - Add `irc-to-me` method + - Added server password support (#3) + [New Events] + - Added `irc-to-me` event + [New Methods] + - Added `notice` event 2.001002 2015-12-30 - Minor doc updates and fixed missing prepreqs in META.info file @@ -31,6 +31,7 @@ IRC::Client - Extendable Internet Relay Chat client - [METHODS FOR PLUGINS](#methods-for-plugins) - [`.ssay`](#ssay) - [`.privmsg`](#privmsg) + - [`.notice`](#notice) - [INCLUDED PLUGINS](#included-plugins) - [IRC::Client::Plugin::Debugger](#ircclientplugindebugger) - [IRC::Client::Plugin::PingPong](#ircclientpluginpingpong) @@ -281,6 +282,14 @@ Sends a message to the server, automatically appending `\r\n`. Mnemonic: Sends a `PRIVMSG` message specified in the second argument to the user/channel specified as the first argument. +## `.notice` + +```perl6 + $irc.notice( 'Zoffix', 'Hallo!' ); +``` +Sends a `NOTICE` message specified in the second argument +to the user/channel specified as the first argument. + # INCLUDED PLUGINS Currently, this distribution comes with two IRC Client plugins: diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 6eb610f..cbdb335 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -69,6 +69,13 @@ method privmsg (Str $who, Str $what) { self; } +method notice (Str $who, Str $what) { + my $msg = "NOTICE $who :$what\n"; + $!debug and "{plug-name}$msg".put; + $!sock.print("$msg\n"); + self; +} + method handle-event ($e) { $e<pipe> = {}; |