From f6d0cf9607e83036618cf20c729f50f68e593429 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Thu, 7 Sep 2017 12:21:11 +0200 Subject: Correct spelling mistake in 'singnals' --- docs/01-basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/01-basics.md b/docs/01-basics.md index fb837de..23c9e81 100644 --- a/docs/01-basics.md +++ b/docs/01-basics.md @@ -66,7 +66,7 @@ message objects have a `.reply` method you can call to send a reply to the message's sender, however it's easier to just return a value from your method handler, which will automatically call `.reply` on the message object for you. -Returning a value from your event handler singnals to the Client Object that +Returning a value from your event handler signals to the Client Object that it handled the event and no other plugins or event handlers should be tried. Your plugin can do the `IRC::Client::Plugin` role (automatically exported when you `use IRC::Client`), which provides `$.NEXT` attribute. The value -- cgit v1.1 From 8d5d57ee32f97833fe682b0f3c8064ef16aa698a Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Thu, 7 Sep 2017 12:21:50 +0200 Subject: Apply generic fixes to make it nicer to read --- docs/01-basics.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/01-basics.md b/docs/01-basics.md index 23c9e81..281c745 100644 --- a/docs/01-basics.md +++ b/docs/01-basics.md @@ -28,21 +28,21 @@ more advanced features. You can find it at [*yet to be published*](#). ## Subscribing to Events -All of the functionality is implemented as "plugins," which are passed to +All of the functionality is implemented as "plugins", which are passed to the `:plugins` attribute. Plugins are just regular classes, altough they can do the `IRC::Client::Plugin` role to obtain extra functionality. -To subscribe to one of [the events](02-event-reference.md), simply -create a method with event's name in your class. The tutorial will use the +To subscribe to one of [the events](02-event-reference.md), simply create a +method with the event's name in your class. The tutorial will use the `irc-to-me` event, which is a convenience event fired when the bot is addressed in-channel or someone sends it a notice or a private message. ### Event Handler Input -The event handlers receive one positional argument, which is an object -that does `IRC::Client::Message` role. The actual object received depends -on the event that triggered the handler. For example, the `irc-to-me` can -receive these message objects: +The event handlers receive one positional argument, which is an object that +does the `IRC::Client::Message` role. The actual object received depends on the +event that triggered the handler. For example, the `irc-to-me` can receive +these message objects: ```perl6 IRC::Client::Message::Privmsg::Me @@ -63,7 +63,7 @@ constraint on it without having to explicitly call it: Channel messages, private messages, and notices can be replied to. Their message objects have a `.reply` method you can call to send a reply to the -message's sender, however it's easier to just return a value from your method +message's sender. However, it's easier to just return a value from your method handler, which will automatically call `.reply` on the message object for you. Returning a value from your event handler signals to the Client Object that @@ -133,7 +133,7 @@ class AlarmBot does IRC::Client::Plugin { :plugins(AlarmBot.new) ``` -Here, we subscribe to `irc-connected` event (using an anonymous parameter +Here, we subscribe to the `irc-connected` event (using an anonymous parameter for its message object, since we don't need it). It fires whenever we successfully connect to a server. In the event handler we setup a `react`/`whenever` loop, with a `Supply` generating an event every three -- cgit v1.1