server启动之后,填入callback

This commit is contained in:
liuwei
2025-04-23 12:04:46 +08:00
parent f8faddd7c2
commit b919a3834e
3 changed files with 38 additions and 5 deletions

View File

@@ -39,6 +39,22 @@ def revoke_msg():
print(response.text)
def set_call_back():
url = "/tools/setCallback"
payload = json.dumps({
"token": "cb43f52db27e4a56bb6ec7da54373582",
"callbackUrl": "http://192.168.2.210:8999/gewechat/message/callback"
})
headers = {
'X-GEWE-TOKEN': 'cb43f52db27e4a56bb6ec7da54373582',
'Content-Type': 'application/json'
}
response = requests.request("POST",base_url+ url, headers=headers, data=payload)
print(response.text)
if __name__ == '__main__':
get_chatroom_members()
set_call_back()

View File

@@ -0,0 +1,17 @@
import requests
import json
url = "/tools/setCallback"
payload = json.dumps({
"token": "{{gewe-token}}",
"callbackUrl": "http://www.baidu.com"
})
headers = {
'X-GEWE-TOKEN': '{{gewe-token}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

View File

@@ -52,10 +52,10 @@ def main(chat_type: int):
#
# # 秀人网每天自动发pdf
# robot.onEveryTime("17:30", robot.xiu_ren_pdf_send)
time.sleep(5)
# 启动之后填入callback
gewe_client.client_set_callback()
# 返回启动的端口,以便调用者知道实际使用的端口
# time.sleep(5)
# # 启动之后填入callback
# gewe_client.client_set_callback()
# # 返回启动的端口,以便调用者知道实际使用的端口
# 启动Dashboard服务器
dashboard_server = None
try: