MCPcopy Create free account
hub / github.com/Tyaoo/picker / send

Method send

bot.py:83–98  ·  view source on GitHub ↗
(self, text_list: list)

Source from the content-addressed store, hash-verified

81 return text_list
82
83 def send(self, text_list: list):
84 limiter = Limiter(Rate(20, Duration.MINUTE)) # 频率限制,20条/分钟
85 for text in text_list:
86 with limiter.ratelimit('identity', delay=True):
87 print(f'{len(text)} {text[:50]}...{text[-50:]}')
88
89 data = {"msgtype": "markdown", "markdown": {"content": text}}
90 headers = {'Content-Type': 'application/json'}
91 url = f'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={self.key}'
92 r = requests.post(url=url, headers=headers, data=json.dumps(data), proxies=self.proxy)
93
94 if r.status_code == 200:
95 Color.print_success('[+] wecomBot 发送成功')
96 else:
97 Color.print_failed('[-] wecomBot 发送失败')
98 print(r.text)
99
100
101class dingtalkBot:

Callers

nothing calls this directly

Calls 2

print_successMethod · 0.80
print_failedMethod · 0.80

Tested by

no test coverage detected