kha7iq/pingme

Support for carriage return \n

matbgn opened this issue ยท 6 comments

Is your feature request related to a problem? Please describe.

I was not able to send a msg (for instance via teams) with carriage return in it (\n Linux). Is there a way to achieve it?

Describe the solution you'd like

Sending a msg in form of:
pingme teams -w TOKEN --msg "Hi, I got a**\n** carriage return. Nice!"

Describe alternatives you've considered

Over ways to pass it will be totally acceptable

Additional context

PingMe version 0.2.4
NAME="Linux Mint"
VERSION="20.2 (Uma)"
ID=linuxmint
ID_LIKE=ubuntu

A great thank you for you're implementation of nikoksr/notify!

Hello @matbgn ,
The whole messages is treated as a string, i am afraid it won't be possible to achieve this when sending message.
You can use the --title flag when sending a message it will add '\n' between the tittle and message.

pingme teams -w TOKEN --title "Hi, I got a"  --msg  "carriage return. Nice!"

Again just thank you!

What would be the adaptations necessary to make it work? Could you point me any direction, so I could maybe invest some time to make a PR?

One way would be to analyze the content of message before sending it , check for specified carriage return using regex maybe.
Then recreate the string again, its a messy solution and too many things to consider when implementing it not sure if its worth spending time on it.
You can have a look here how its being added for title and message.

You are welcome, and i hope you find it useful.

Oh nice it sounds that it's in my possibilities ๐Ÿ˜„

But still a question, you pointed me out on service/mattermost/mattermost.go but my issue is on Microsoft Teams ๐Ÿค” and I see two other services implemented with it (Twilio and Mastodon). What should I take care of?

Mattermost was just an example , and because it not using notify you can see how message is constructed.
But teams and quite a few other services use notify, so this implementation has to be on notify side.

I will take care of it on August due to work load but it's on my todo list ๐Ÿ˜‰