How to convert ping command to string on MacOS Terminal

Depending on the shell you're using, you can do it like this:

telegram-send "$(ping -c1 192.168.1.1)"