summaryrefslogtreecommitdiff
path: root/examples/doc-test.raku
blob: 0072c9482ab70c09dde248a2379948d1e09b44d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;
}
]