Update send_message.sh
Browse files- send_message.sh +5 -5
send_message.sh
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
#!/bin/sh
|
2 |
-
|
3 |
# Define the message to be sent
|
4 |
MESSAGE="Hello, testing new domain"
|
5 |
|
6 |
# Define the URL for the Telegram Bot API
|
7 |
-
URL="https://api.basthofer.com/bot${BOT_TOKEN}/sendMessage
|
8 |
|
9 |
-
# Send the message using curl
|
10 |
-
RESPONSE=$(curl -i -X
|
11 |
|
12 |
# Print the response
|
13 |
echo "Response from server:"
|
14 |
echo "$RESPONSE"
|
15 |
-
echo "curl was sent"
|
|
|
1 |
#!/bin/sh
|
2 |
+
|
3 |
# Define the message to be sent
|
4 |
MESSAGE="Hello, testing new domain"
|
5 |
|
6 |
# Define the URL for the Telegram Bot API
|
7 |
+
URL="https://api.basthofer.com/bot${BOT_TOKEN}/sendMessage"
|
8 |
|
9 |
+
# Send the message using curl with POST and JSON
|
10 |
+
RESPONSE=$(curl -i -X POST $URL -H "Content-Type: application/json" -d "{\"chat_id\":\"${CHAT_ID}\",\"text\":\"${MESSAGE}\"}")
|
11 |
|
12 |
# Print the response
|
13 |
echo "Response from server:"
|
14 |
echo "$RESPONSE"
|
15 |
+
echo "curl was sent"
|