2020-08-12 05:07:16 +00:00
|
|
|
|
import json, time, sys
|
2022-06-08 09:03:43 +00:00
|
|
|
|
from httpx import get, post
|
2020-08-12 05:07:16 +00:00
|
|
|
|
|
|
|
|
|
token = str(sys.argv[1])
|
2022-06-08 09:03:43 +00:00
|
|
|
|
main = json.loads(get("https://api.github.com/repos/TeamPGM/PagerMaid_Plugins/commits/master").content)
|
2021-02-12 08:28:20 +00:00
|
|
|
|
text = "#更新日志 #" + main['commit']['author']['name'].replace('_', '') + \
|
2022-06-08 09:03:43 +00:00
|
|
|
|
' \n\n🔨 [' + main['sha'][0:7] + '](https://github.com/TeamPGM/PagerMaid_Plugins/commit/' + \
|
2021-02-12 08:28:20 +00:00
|
|
|
|
main['sha'] + '): ' + main['commit']['message']
|
|
|
|
|
push_content = {'chat_id': '-1001441461877', 'disable_web_page_preview': 'True', 'parse_mode': 'markdown',
|
|
|
|
|
'text': text}
|
2022-11-06 14:42:00 +00:00
|
|
|
|
push_content['message_thread_id'] = 1027828
|
2020-08-12 05:07:16 +00:00
|
|
|
|
url = 'https://api.telegram.org/bot' + token + '/sendMessage'
|
|
|
|
|
try:
|
|
|
|
|
main_req = post(url, data=push_content)
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
push_content['chat_id'] = '-1001319957857'
|
2022-11-06 14:42:00 +00:00
|
|
|
|
del push_content['message_thread_id']
|
2020-08-12 05:07:16 +00:00
|
|
|
|
time.sleep(1)
|
|
|
|
|
try:
|
2022-06-08 09:03:43 +00:00
|
|
|
|
main_req = post(url, data=push_content)
|
2020-08-12 05:07:16 +00:00
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
print(main['sha'] + " ok!")
|