diff options
author | Matias Linares <matiaslina@gmail.com> | 2020-03-24 19:37:44 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@gmail.com> | 2020-03-24 19:37:44 -0300 |
commit | e1abad7a57fd34ffb55c1d57d0b89ee91e55296b (patch) | |
tree | 12fe2d7b6d45543cb52f3b0382bc7de4bcc796fc /examples/send-message.p6 | |
parent | 2fb9929b3acd2caf6ca0f0cf1e16f0872f7ae667 (diff) | |
parent | e50b8fa9e02b19ece80ebeb576051e451d3a7812 (diff) | |
download | perl6-matrix-client-e1abad7a57fd34ffb55c1d57d0b89ee91e55296b.tar.gz |
Merge branch 'master' into documentation
Diffstat (limited to 'examples/send-message.p6')
-rw-r--r-- | examples/send-message.p6 | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/examples/send-message.p6 b/examples/send-message.p6 deleted file mode 100644 index 4824be5..0000000 --- a/examples/send-message.p6 +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env perl6 -use v6; -use lib 'lib'; -use Matrix::Client; - -sub MAIN(:$room-id?, :$room-alias?, *@args) { - unless $room-id.so || $room-alias.so { - fail 'Missing room-id or room-alias'; - } - my Matrix::Client $client .= new: - :home-server(%*ENV<MATRIX_HOMESERVER>), - :access-token($*ENV<MATRIX_ACCESS_TOKEN>); - - my $id; - if $room-id.so { - $id = $room-id; - } else { - say "Searching for $room-alias"; - $id = $client.get-room-id($room-alias); - } - - my $event = $client.send($id, @args.join(' ')); - say $event; -} |