Skip to main content

This is a msg-robot for qywechat.

Project description

QyWechat

GitHub issues GitHub forks GitHub stars GitHub license contributors PyPI PyPI - Python Version Downloads

This is a msg-robot for qywechat

Install

python -m pip install qywechat

Getting Started

send text msg

import qywechat
key = "b8cxxx"
bot = qywechat.Bot(key)
data = {
    	"msgtype": "text",
    	"text": {
        	"content": "hello world"
    	}
   }
# @ user, all user
# data = {
#    "msgtype": "text",
#    "text": {
#        "content": "LiuKeTest Msg",
#		"mentioned_list":["liuke","@all"],
#		"mentioned_mobile_list":["13800001111","@all"]
#    }
#}
bot.send_msg(data)

send markdown msg

data = {
    "msgtype": "markdown",
    "markdown": {
        "content": "实时新增用户反馈<font color=\"warning\">132例</font>,请相关同事注意。\n
         >类型:<font color=\"comment\">用户反馈</font>
         >普通用户反馈:<font color=\"comment\">117例</font>
         >VIP用户反馈:<font color=\"comment\">15例</font>"
    }
}

send image

bot.img_msg("path/test.jpg")

send file

media_id = bot.upload_file("path/liuke.zip")
data = {
    "msgtype": "file",
    "file": {
 		"media_id": media_id
    }
}
bot.send_msg(data)

send image & text msg

data = {
    "msgtype": "news",
    "news": {
       "articles" : [
           {
               "title" : "LiuKeTest",
               "description" : "qywechat",
               "url" : "https://xxx",
               "picurl" : "http://xxx.png"
           }
        ]
    }
}
bot.send_msg(data)

Features

  • Support all types message
  • Support send image
  • Support upload file

Contributing

Contributions are welcome.
If you've found a bug within this project, please open an issue to discuss what you would like to change.
If it's an issue with the API, please report any new issues at qywechat issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

qywechat-0.1.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file qywechat-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: qywechat-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.9

File hashes

Hashes for qywechat-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a017d660b8333e55ebf3f25ff9826b3ea77150ec224acc1ca30c7fca7ee50799
MD5 1fc860a4e6cc47ab3f3fb72f6becdae1
BLAKE2b-256 f21aa010b9c4580dc6c73764f6f8fde6abb987800246b1bc8ea4feb086a357a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page