summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2021-05-31 14:49:31 +0100
committerdakkar <dakkar@thenautilus.net>2021-05-31 14:49:31 +0100
commit45c117ab00d282f97df19cd7f58126d956f044ba (patch)
tree28e0d2787e44a167286f64773330781e351cc8f1
downloadraku-boha-45c117ab00d282f97df19cd7f58126d956f044ba.tar.gz
raku-boha-45c117ab00d282f97df19cd7f58126d956f044ba.tar.bz2
raku-boha-45c117ab00d282f97df19cd7f58126d956f044ba.zip
first stab
-rw-r--r--boha.raku21
-rw-r--r--boha.toml10
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'