diff options
author | Matias Linares <matiaslina@gmail.com> | 2020-03-24 19:37:11 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@gmail.com> | 2020-03-24 19:37:11 -0300 |
commit | e50b8fa9e02b19ece80ebeb576051e451d3a7812 (patch) | |
tree | 037db346e5deacfe21fe0bbae1b496331e3c117e /examples | |
parent | e39257df2688137d57d88d502f7198425d5dfcd5 (diff) | |
download | perl6-matrix-client-e50b8fa9e02b19ece80ebeb576051e451d3a7812.tar.gz |
Rename some things to from perl6 to raku
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/bot.raku (renamed from examples/bot.p6) | 0 | ||||
-rw-r--r-- | examples/doc-test.raku | 19 | ||||
-rw-r--r-- | examples/get-sync-json.raku | 12 | ||||
-rw-r--r-- | examples/rooms.raku (renamed from examples/rooms.p6) | 0 | ||||
-rw-r--r-- | examples/run.raku (renamed from examples/run.p6) | 2 | ||||
-rw-r--r-- | examples/send-message.raku (renamed from examples/send-message.p6) | 2 |
6 files changed, 33 insertions, 2 deletions
diff --git a/examples/bot.p6 b/examples/bot.raku index 8a9d206..8a9d206 100755 --- a/examples/bot.p6 +++ b/examples/bot.raku diff --git a/examples/doc-test.raku b/examples/doc-test.raku new file mode 100644 index 0000000..0072c94 --- /dev/null +++ b/examples/doc-test.raku @@ -0,0 +1,19 @@ +use v6; +use lib <lib>; +use Matrix::Client; +use Data::Dump::Tree; + +my Matrix::Client $client .= new: + :home-server<https://matrix.deprecated.org>, + :access-token(%*ENV<MATRIX_ACCESS_TOKEN>); + +say $client.presence(“@matias:matrix.deprecated.org”); +#`[ +for ^10 -> $i { + my $presence = $i %% 2 ?? "online" !! "offline"; + say $client.presence.presence; + say "Setting presence $presence"; + $client.set-presence($presence, :status-message<woops>); + sleep 3; +} +] diff --git a/examples/get-sync-json.raku b/examples/get-sync-json.raku new file mode 100644 index 0000000..2db9c5a --- /dev/null +++ b/examples/get-sync-json.raku @@ -0,0 +1,12 @@ +use v6; +use Matrix::Client; + +sub MAIN($file? = 'sync.json') { + my $c = Matrix::Client.new(home-server => 'https://matrix.deprecated.org'); + $c.login: 'deprecated_bot', 'deprecatedbot'; + + my $res = $c.sync; + $file.IO.spurt($res.content); + + $c.logout; +} diff --git a/examples/rooms.p6 b/examples/rooms.raku index 4f0a0c7..4f0a0c7 100644 --- a/examples/rooms.p6 +++ b/examples/rooms.raku diff --git a/examples/run.p6 b/examples/run.raku index f78df16..af1b188 100644 --- a/examples/run.p6 +++ b/examples/run.raku @@ -1,4 +1,4 @@ -#!/usr/bin/env perl6 +#!/usr/bin/env raku use v6; use lib <lib>; use Matrix::Client; diff --git a/examples/send-message.p6 b/examples/send-message.raku index 4824be5..2a8202a 100644 --- a/examples/send-message.p6 +++ b/examples/send-message.raku @@ -1,4 +1,4 @@ -#!/usr/bin/env perl6 +#!/usr/bin/env raku use v6; use lib 'lib'; use Matrix::Client; |