aboutsummaryrefslogtreecommitdiff
path: root/lib/IRC/Client.pm6
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IRC/Client.pm6')
-rw-r--r--lib/IRC/Client.pm624
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6
index ae8f245..4635301 100644
--- a/lib/IRC/Client.pm6
+++ b/lib/IRC/Client.pm6
@@ -1,16 +1,16 @@
use v6;
role IRC::Client::Plugin { ... }
class IRC::Client:ver<1.001001> {
- has Bool $.debug = False;
- has Str $.host = 'localhost';
- has Int $.port where 0 <= $_ <= 65535 = 6667;
- has Str $.nick where 1 <= .chars <= 9 = 'Perl6IRC';
- has Str $.username = 'Perl6IRC';
- has Str $.userhost = 'localhost';
- has Str $.userreal = 'Perl6 IRC Client';
- has Str @.channels = ['#perl6bot'];
- has @.plugins = [];
- has IO::Socket::Async $.sock;
+ has Bool:D $.debug = False;
+ has Str:D $.host = 'localhost';
+ has Int:D $.port where 0 <= $_ <= 65535 = 6667;
+ has Str:D $.nick = 'Perl6IRC';
+ has Str:D $.username = 'Perl6IRC';
+ has Str:D $.userhost = 'localhost';
+ has Str:D $.userreal = 'Perl6 IRC Client';
+ has Str:D @.channels = ['#perl6bot'];
+ has IRC::Client::Plugin @.plugins = [];
+ has IO::Socket::Async $.sock;
method run {
await IO::Socket::Async.connect( $!host, $!port ).then({
@@ -23,8 +23,8 @@ class IRC::Client:ver<1.001001> {
for @!plugins.grep(*.interval);
react {
- whenever $!sock.chars-supply -> $str is copy {
- $str.say;
+ whenever $!sock.Supply -> $str is copy {
+ "[$str]".perl.say;
.msg(self, $str) for @!plugins.grep(so *.msg);
}
}