13 lines
383 B
Python
13 lines
383 B
Python
import requests
|
|
import setting
|
|
import urllib3
|
|
|
|
# 发送消息
|
|
def send_message(chat_id, text):
|
|
url = f'https://api.telegram.org/bot{setting.telegram_bot_key}/sendMessage'
|
|
formData = {
|
|
"chat_id" : chat_id,
|
|
"text" : text
|
|
}
|
|
urllib3.disable_warnings(category=urllib3.exceptions.InsecureRequestWarning)
|
|
requests.post(url, data= formData, verify=False) |