16 lines
514 B
Bash
Executable File
16 lines
514 B
Bash
Executable File
#!/bin/bash
|
|
|
|
response=$(curl -s -X POST "https://api.telegram.org/bot$1/sendMessage" \
|
|
-d "chat_id=$2" \
|
|
-d "parse_mode=HTML" \
|
|
-d "link_preview_options={\"is_disabled\":true}" \
|
|
-d "text=$(echo -e $3)")
|
|
|
|
# if command -v jq >/dev/null 2>&1; then
|
|
message_id=$(echo "$response" | jq '.result.message_id')
|
|
# else
|
|
# message_id=$(echo "$response" | grep -o '"message_id":[0-9]*' | sed 's/"message_id"://')
|
|
# fi
|
|
|
|
echo "Sent message with ID: $message_id"
|
|
echo "OUTPUT_MESSAGE_ID=$message_id" >> $GITHUB_ENV |