8go / matrix-commander

simple but convenient CLI-based Matrix client app for sending and receiving
GNU General Public License v3.0
563 stars 59 forks source link

Messages with --listen #132

Closed ghost closed 1 year ago

ghost commented 1 year ago

Ist there a possibility to only show the message text? When using --listen ? Like an extra command?

We want to use matrix-commander for a theater play in connection with smsmatrix. But we need anonymity, so only the message text is needed.

8go commented 1 year ago

You can use standard commands like grep, sed or cut to exclude information that you don't want. You can also use --output json and then grep for the desired lines.

Example with cut:

You standard output is something like: Message received for room test [!test12123123:matrix.example.com] | sender jane [@jane:matrix.example.com] | 2022-12-16 02:18:10 | some comment

You want to hide "jane" to provide anonymity.

Use matrix-commander --listen ........ | cut -d "|" -f 4. This will produce output some comment.