From f7367cc30de8c5f75824d95fcc6883a9f17a9d2c Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sat, 28 May 2016 09:01:21 -0400 Subject: Write stuff --- DESIGN/01-main.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DESIGN/01-main.md b/DESIGN/01-main.md index 68db37d..3b82a19 100644 --- a/DESIGN/01-main.md +++ b/DESIGN/01-main.md @@ -354,6 +354,7 @@ event. User-defined events follow the same pattern, except they start with $msg.reply: 'Nice to meet you!'; } + # Listen to custom client-generated events: method irc-custom-my-event ($some, $random, :$args) { return IRC_NEXT unless $random > 5; $.irc.send: where => '#perl6', what => 'Custom event triggered!'; @@ -364,10 +365,9 @@ An event listener receives the event message in the form of an object. The object must provide all the relevant information about the source and content of the message. -The message object's attributes must be mutable, and where appropriate, -it must provide a means to send the message back to the originator -of the message. For example, here's a potential implementation of -`PRIVMSG` handler that receives the message object: +The message object, where appropriate, must provide a means to send a reply +back to the originator of the message. For example, here's a potential +implementation of `PRIVMSG` handler that receives the message object: ```perl6 method irc-privmsg ($msg) { -- cgit v1.1