diff options
-rw-r--r-- | boha.raku | 21 | ||||
-rw-r--r-- | boha.toml | 10 |
2 files changed, 31 insertions, 0 deletions
diff --git a/boha.raku b/boha.raku new file mode 100644 index 0000000..725f00a --- /dev/null +++ b/boha.raku @@ -0,0 +1,21 @@ +#!/usr/bin/env rakudo +use v6.d; +use Config::TOML; +use IRC::Client; + +my $config = from-toml( + file => (%*ENV<BOHA_CONFIG_FILE> // $?FILE.IO.sibling('boha.toml').Str) +); + +.run with IRC::Client.new( + |($config<server>), + channels => $config<channels>.map(*.<name>), + :debug, + :plugins( + class :: does IRC::Client::Plugin { + # irc-addressed for in-channel messages + # irc-privmsg-me for direct messages + method irc-to-me($e) { "Boo!" } + }, + ), +); diff --git a/boha.toml b/boha.toml new file mode 100644 index 0000000..a15c0c6 --- /dev/null +++ b/boha.toml @@ -0,0 +1,10 @@ +[server] +host = 'irc.libera.chat' +port = 6697 +nick = 'raku-boha' +username = 'Boha' +userreal = 'Boha (in Raku)' +ssl = true + +[[channels]] +name = '#perl.it' |