fabianonline / matrix.sh Goto Github PK
View Code? Open in Web Editor NEWSend messages via matrix chat protocol right from your command line
Send messages via matrix chat protocol right from your command line
This tool is very good in CI/CD pipelines, but I am not confident providing the username and password for it to extract the token. It should be good to allow provident the token as an argument, usually provided from the secrets manager store.
$ ./matrix.sh --join-room
Enter the ID or address of the room you want me to join: #myroom:matrix.org
An error occurred. The matrix server responded with:
M_UNKNOWN: No known servers
This is only a "cosmetics" report.
I'm on
I can send text messages without problems, but when I'm sending a file like this:
/opt/matrix_cli/matrix.sh --identifier='system.internal' --room='!***********:domain.cc' --file="/my/diff.txt"
The raw data of the message show
"content": {
"body": "diff.txt\n",
"msgtype": "m.file",
"filename": "diff.txt\n",
"url": "mxc://domain.cc/********************"
and when trying to download the file, it will be saved as diff.txt_
. Content of the file is fine.
Let me add that I'm so happy about your script. It also did work right away.
$ ./matrix.sh --select-default-room
Getting Rooms...
Joined rooms:
jq: error (at <stdin>:1): null (null) has no keys
Rooms I'm invited to:
jq: error (at <stdin>:1): null (null) has no keys
Which room do you want to use?
Enter the room_id (the thing at the beginning of the line): #myroom:matrix.org
An error occurred. The matrix server responded with:
M_UNRECOGNIZED: Unrecognized request
Thanks for your work! Please provide a FOSS license for the script.
I'm trying to use Pantalaimon so that messages become encrypted.
Simple text works ok. Images don't. Since this does not happen if not using Pantalaimon, it can be that the issue is not with Matrix.sh but pantalaimon itself, but i cannot debug further.
Error in matrix.sh:
matrix.sh --image --file=5Mph94m.jpeg
Sending file...
{"m.upload.size":2147483648}
Uploading...
jq: error (at :1): Cannot index number with string "errcode"
parse error: Invalid numeric literal at line 1, column 13
Error in Pantalaimon log:
pantalaimon-pantalaimon-1 | [2023-01-04 21:25:14.699830] INFO: pantalaimon: Adding media info for aguiarvieira.pt/lvGHuLnVIzFqiBgfzLXhUtBK to the store
pantalaimon-pantalaimon-1 | Error handling request
pantalaimon-pantalaimon-1 | Traceback (most recent call last):
pantalaimon-pantalaimon-1 | File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
pantalaimon-pantalaimon-1 | resp = await request_handler(request)
pantalaimon-pantalaimon-1 | File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 504, in _handle
pantalaimon-pantalaimon-1 | resp = await handler(request)
pantalaimon-pantalaimon-1 | File "/usr/local/lib/python3.8/site-packages/pantalaimon/daemon.py", line 1053, in send_message
pantalaimon-pantalaimon-1 | return await _send(self.conf.ignore_verification)
pantalaimon-pantalaimon-1 | File "/usr/local/lib/python3.8/site-packages/pantalaimon/daemon.py", line 1005, in _send
pantalaimon-pantalaimon-1 | if content["info"].get("thumbnail_url", False):
pantalaimon-pantalaimon-1 | KeyError: 'info'
Trying to upload a picture provides a warning:
$ bash matrix.sh --room='' --file=image.png --image
stat: illegal option -- c
usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]
Hello.
While attempting to upload a video to a channel, the script does not return a error.
On the element website the message is already in error prompting to send a log.tar to synapse Github
On the element android app, the file name shows up, pressing on it returns "url is null".
Aparently, this is caused by a filename with spaces in it.
Can anyone confirm this behaviour ?
When sending output, for example like in readme ls -l | ./matrix.sh
the error No message to send given
is received.
The generated identifier during the login (used for initial_device_display_name) is built using private information that a user may not want to share with others (local user and host name).
This should be properly documented and possible to easily overload, e.g. there could be a --custom-identifier
option with its help mentioning how the default identifier is constructed out of the local user and host names.
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.