Skip to content

gefeixun01/wechat-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 

Repository files navigation

微信机器人

  • 详情请联系QQ:3122142139
  • 文档交流学习使用。

调用示例

{
class WeChatapi():
    def __init__(self):
        self.url = 'http://127.0.0.1:9001'

    def Wx_GotoLoginQrCode(self):
        api=f'{self.url}/Wx_GotoLoginQrCode'
        response = requests.get(api)
        response.encoding = 'gbk'
        qr=response.text
        print(qr)

    def StartWeChat(self):
        api = f'{self.url}/StartWeChat'
        response = requests.get(api)
        response.encoding = 'gbk'
        qr = response.text
        print(qr)

    def Wx_SendMsg(self):
        url = f'{self.url}/Wx_SendMsg'
        post_data = {"to_wxid":"wxid_563b189nwsu22","content":"测试"}
        response = requests.post(url, data=json.dumps(post_data,ensure_ascii=False).encode('GBK'))
        response.encoding='gbk'
        print(response.json())
        
if __name__ == '__main__':
    wechatapi = WeChatapi()
    wechatapi.StartWeChat()
}

Releases

No releases published

Packages

No packages published