diff options
author | Zoffix Znet <cpan@zoffix.com> | 2016-01-01 09:00:37 -0500 |
---|---|---|
committer | Zoffix Znet <cpan@zoffix.com> | 2016-01-01 09:00:37 -0500 |
commit | 98cee4deebfba64dd7143f97675788b175fb8fb4 (patch) | |
tree | 4b10bbf17f16a603d89732cca24bf60e3ea70b3d /lib/IRC/Client.pm6 | |
parent | ce9eb0ee6f2903c551f88f989ef17ef8f1dbdc1f (diff) |
Add server password support (Relates to #3)
Diffstat (limited to 'lib/IRC/Client.pm6')
-rw-r--r-- | lib/IRC/Client.pm6 | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 8c0b2c1..49d1cff 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -2,9 +2,10 @@ use v6; use IRC::Parser; # parse-irc use IRC::Client::Plugin::PingPong; use IRC::Client::Plugin; -class IRC::Client:ver<2.001001> { +class IRC::Client:ver<2.002001> { has Bool:D $.debug = False; has Str:D $.host = 'localhost'; + has Str:D $.password; has Int:D $.port where 0 <= $_ <= 65535 = 6667; has Str:D $.nick = 'Perl6IRC'; has Str:D $.username = 'Perl6IRC'; @@ -23,6 +24,7 @@ class IRC::Client:ver<2.001001> { await IO::Socket::Async.connect( $!host, $!port ).then({ $!sock = .result; + $.ssay("PASS $!password\n") if $!password.defined; $.ssay("NICK $!nick\n"); $.ssay("USER $!username $!username $!host :$!userreal\n"); $.ssay("JOIN {@!channels[]} x\n"); |