Улучшил форматирование
This commit is contained in:
parent
fc72734c40
commit
3772961447
@ -2,10 +2,10 @@
|
||||
|
||||
import sys, requests
|
||||
|
||||
bot_token = "123456789:ABCdefghIJKlmnOPQrstuVWXYz"
|
||||
chat_id = "123456789"
|
||||
bot_token = "6652676823:AAHQdhvn8qpEtRNCJeIgewOKH_LrJAl3Qrk"
|
||||
chat_id = "374070661"
|
||||
|
||||
message = "Пришла новая SMS:\nОтправитель: " + sys.argv[1] + "\nТекст: " + sys.argv[2]
|
||||
message = "Пришла SMS:\n\nОт: <b>" + sys.argv[1] + "</b>\nТекст: <code>" + sys.argv[2] + "</code>"
|
||||
|
||||
print(message)
|
||||
|
||||
@ -17,7 +17,7 @@ text_file.close()
|
||||
|
||||
# Send message
|
||||
|
||||
req = requests.get("https://api.telegram.org/bot" + bot_token + "/sendMessage?chat_id=" + chat_id + "&text=" + message)
|
||||
req = requests.get("https://api.telegram.org/bot" + bot_token + "/sendMessage?parse_mode=HTML&chat_id=" + chat_id + "&text=" + message)
|
||||
if (req.status_code != 200):
|
||||
print("Сообщение не отправлено! Статус код: " + str(req.status_code))
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user