From 55b8bd87c6f07d21de8b3037317b54c6a0374c86 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 3 Jan 2016 11:37:51 -0500 Subject: Add irc-to-me method --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 4eac154..51fe0c2 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ IRC::Client - Extendable Internet Relay Chat client - [`irc-all-events`](#irc-all-events) - [`irc-privmsg-me`](#irc-privmsg-me) - [`irc-notice-me`](#irc-notice-me) + - [`irc-to-me`](#irc-to-me) - [`irc-unhandled`](#irc-unhandled) - [Contents of the parsed IRC message](#contents-of-the-parsed-irc-message) - [`command`](#command) @@ -390,6 +391,7 @@ response. method irc-connected ($irc) { ... } # once per server connection method irc-all-events ($irc, $e) { ... } + method irc-to-me ($irc, $e) { ... } method irc-privmsg-me ($irc, $e) { ... } method irc-notice-me ($irc, $e) { ... } ... # all other handlers for standard IRC commands @@ -442,6 +444,23 @@ explicitly return [`IRC_NOT_HANDLED`](#irc_not_handled), your client will stop handling ALL other messages *** +### `irc-to-me` + +```perl6 + method irc-to-me ($irc, $e, $where, $who) { + $irc.privmsg: $where, "$who, you talkin' to me?"; + } +``` +Triggered when: the IRC `PRIVMSG` command is received, where the recipient +is the client (as opposed to some channel); the `NOTICE` command is +received, or the `PRIVMSG` command is received, where the recipient is the +channel and the message begins with client's nickname (i.e. the client +was addressed in channel. Along with `IRC::Client` object and the event +hash contained in `$e`, this method also receives two additional positional +arguments: `$where`, which is where to send the response (will be the channel +name or the name of the user who sent the message); and `$who`, which is the +nickname of the user who sent the message. + ### `irc-privmsg-me` ```perl6 -- cgit v1.1