matiaslina / matrix-client Goto Github PK
View Code? Open in Web Editor NEWMatrix client for Raku
License: Artistic License 2.0
Matrix client for Raku
License: Artistic License 2.0
This ticket is similar to #8
Basically there are no methods for working with aliases. For example, getting a local address of a room is not possible.
I'm not sure why it was added, IMO it shouldn't be there. I know very little about matrix, but I think that this loop can be written without sleeping (it is using long polling, right?). Perhaps it's a good idea to stick sleep 0.1
in there just in case, but generally it shouldn't be needed.
M_NOT_FOUND: Event not found.
in method handle-error at /home/alex/.rakudobrew/moar-master/install/share/perl6/site/sources/E7751191976204E9D21C92A2486C980334A2E4CB (Matrix::Client::Requester) line 20
in method get at /home/alex/.rakudobrew/moar-master/install/share/perl6/site/sources/E7751191976204E9D21C92A2486C980334A2E4CB (Matrix::Client::Requester) line 36
in method get-name at /home/alex/.rakudobrew/moar-master/install/share/perl6/site/sources/6A5C5D7AF9F46FE814F0C6B3BD7E3297E85ABE4B (Matrix::Client::Room) line 24
in method name at /home/alex/.rakudobrew/moar-master/install/share/perl6/site/sources/6A5C5D7AF9F46FE814F0C6B3BD7E3297E85ABE4B (Matrix::Client::Room) line 33
The code is basically:
say $client.joined-rooms».name;
Not sure why it happens, but I think it's because the room has no name.
Problems with the current register
method:
device-id
if setted.initial_device_display_name
parameter.https://matrix.org/docs/spec/client_server/r0.3.0.html#post-matrix-client-r0-register
I think one simple yet common use case is to fire up the script just to send a single message to a particular room. An example for just that should be added to examples/
directory.
Hello, I guess E2E encryption is not yet supported?
What would take to implement it? Is there anything blocking it?
The parse-names
is now named uniparse
, as of Rakudo version 2017.12-10-ge5c38ad
The original parse-names
will continue to work for some time. It will issue a deprecation warning when 6.d language will be released (around first half of 2018) and will be removed entirely in 6.e language.
More info: Raku/doc@bff42f80b1
Currently there's no documentation at all. I'd really appreciate if there were docs at least half as good as IRC::Client's docs.
I tried to install with
zef install Matrix::Client
Eventually I got this error:
[Matrix::Client] Could not find Matrix::Response
I'm new to Raku, so I'm unsure what's going on. 😅
Looking at the bot.p6 example:
https://github.com/matiaslina/perl6-matrix-client/blob/0a36a8735d99a5aafac7a522affccf403efa6e28/examples/bot.p6#L25-L27
So save-auth-data is called pretty much every time the script is exited.
However, looking at the source for save-auth-data:
https://github.com/matiaslina/perl6-matrix-client/blob/0a36a8735d99a5aafac7a522affccf403efa6e28/lib/Matrix/Client.pm6#L48-L56
As far as I understand access_token
, user_id
, and device_id
should stay the same every run. I'm not sure about txn_id
, is it used to make sure we don't receive events that were already received? If so, and if I'm writing a bot that actively responds to commands, wouldn't it be better to save the file every time transaction id is changed? Otherwise in case of an unhandled crash (e.g. a segfault) the bot will respond to the same event twice?
The problem was introduced in e03a435. Basically, method login has a return constraint (Bool
), but the sub has this as the last line:
$!device-id = $data<device_id>;
So it ends up returning a Str (which fails).
Rooms may have an address in a form of e.g. #freenode_#whateverable:matrix.org
. However, an address like this is not accepted in $client.join-room: …
, and I have to use internal room id like !AZDMTOPHOfnSNBeubl:matrix.org
. Why so? And is there any way to use the readable address?
Hi!
Here is a summary:
02:41:15 10/27/2020 [bash: zef install Matrix::Client] ===> Testing: Matrix::Client:ver<0.6.0>
02:41:30 10/27/2020 [bash: zef install Matrix::Client] [Matrix::Client] Too few positionals passed; expected 2 arguments but got 1
02:41:30 10/27/2020 [bash: zef install Matrix::Client] [Matrix::Client] in method new at /home/fcldpzsguvrtwyhmkqib/.zef/store/Matrix-Client-0.6.0.tar.gz/Matrix-Client-0.6.0/lib/Matrix/Response.pm6 (Matrix::Response) line 143
02:41:30 10/27/2020 [bash: zef install Matrix::Client] [Matrix::Client] in block <unit> at t/40-response.t line 33
02:41:34 10/27/2020 [bash: zef install Matrix::Client] ===> Testing [FAIL]: Matrix::Client:ver<0.6.0>
02:41:34 10/27/2020 [bash: zef install Matrix::Client] stderr: Aborting due to test failure: Matrix::Client:ver<0.6.0> (use --force-test to override)
02:41:34 10/27/2020 [bash: zef install Matrix::Client] task exit status: 1
02:41:34 10/27/2020 [bash: zef install Matrix::Client] task bash: zef install Matrix::Client FAILED
Full log available here - http://rakudist.raku.org/sparky/report/debian/776
HTH
Alexey
I don't know if that's a new feature or not, but in Riot there's a Deactivate my account
button that is supposed to ask the server to delete the account. Currently this is not available in Matrix::Client.
I'm trying to get the Room ID using get-room-id
, so I can start sending messages to the right room only.
my $room-id = $client.get-room-id("#the-life-of-sjon:matrix.org");
However, I keep getting the following error message:
M_UNKNOWN: Expected RoomAlias string to start with '#'
in method get at /home/tyil/projects/personal/perl6-Local-Sjon/../perl6-Matrix-Client/lib/Matrix/Client/Requester.pm6 (Matrix::Client::Requester) line 43
in method get-room-id at /home/tyil/projects/personal/perl6-Local-Sjon/../perl6-Matrix-Client/lib/Matrix/Client.pm6 (Matrix::Client) line 316
in sub MAIN at /home/tyil/projects/personal/perl6-Local-Sjon/lib/Local/Sjon.pm6 (Local::Sjon) line 27
in block <unit> at bin/sjon line 4
This is confusing, as the string I'm passing does start with a #
. Is there any way I can start looking to figure out where it's going wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.