Giter Club home page Giter Club logo

weworkapi_python's Issues

PKCS7Encoder补位问题

PKCS7Encoder类中,amount_to_pad == 0不会发生

代码如下:
amount_to_pad = self.block_size - (text_length % self.block_size)
if amount_to_pad == 0:
amount_to_pad = self.block_size

weworkapi 4 python3

你好,官方提供的python api代码是python2的,为了适应我们的需要,我基于这个源码修改成了python3的,可以么

【corpwechat-bot】企业微信的python封装接口,开箱即用,一行代码实现消息推送

你好,本人在官方API的基础上封装并开发了一个简单的企业微信消息推送的库:corpwechat-bot,通过该库能够更加方便的实现开箱即用的消息推送方式:
具体效果可以查看QuickStart,
目前,基本上已经完成了官方大部分的消息推送,每个消息推送都可以通过一行代码实现,希望能被官方收录:)

应用消息

  • 文本消息: 最普通的消息,文字内容,最长不超过2048个字节
  • 图片消息:发送一张图片,可选jpg,png,大小不超过2MB,目前仅支持通过图片路径发送
  • 语音消息:发送一条语音,大小不超过2MB,时长不超过60s,必须是.amr格式
  • 视频消息:发送一段视频,大小不超过10MB,必须是.mp4格式
  • 普通文件:其他类型的文件,大小不超过20MB(不小于5字节)
  • markdown消息:传输markdown类型消息
  • 图文消息:图片文字形式,带有跳转链接,适合做推广
  • mpnews图文消息:有专属页面的图文消息,支持html标签内容
  • 文本卡片消息:以卡片形式呈现的文本,包含跳转链接
  • 任务卡片消息:应用与用户交互的卡片,需要配置回调

群聊机器人消息

  • 文本消息:普通文字消息,最长不超过2048个字节
  • 图片消息:图片大小不超过2M
  • 图文消息:图片文字形式,带有跳转链接,适合打广告
  • 文件消息:发送单个文件到群聊,大小在5B~20MB之间

设置自动回复消息时,出bug

image
此处只对用户不传入time时候做了生成操作,并将其转为字符串。若用户传入的time是数字类型,则不会转为字符串,进而导致程序出错。

40001 error

执行的时候报:40001 invalid credential, hint: [1597733128_47_64fcadb1b2caaa453d570b16348fd1ae]...

使用 python requests 上传文件名包含中文问题

使用 requests 可以成功上传英文文件名的文件,但不能上传文件名包含中文的情况。
能否给出使用 requests 上传文件名包含中文的示例?

我目前的做法:
f = open(u'测试.txt', 'rb')
url = '''https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=%s&type=file''' % ac_token
files = {'file': ('测试.txt', f)}
r = requests.post(url, files=files)

返回的是
{u'errcode': 44001, u'errmsg': u'empty media data, hint: [ ], more info at https://open.work.weixin.qq.com/devtool/query?e=44001'}

看起来是 requests 将 Content-Disposition 部分写为了:
Content-Disposition: form-data; name="file"; filename*=utf-8''%E6%B5%8B%E8%AF%95.txt

使用 API 测试页面 可以成功上传中文文件名的文件,看到的 Request Payload 为:
Content-Disposition: form-data; name="media"; filename="测试.txt"

签名验证问题

if not signature == sMsgSignature:
我这个一直不相等,是为什么呢

WXBizMsgCrypt3

image

sortlist内同时包含str和int类型会报错的。
image
timestamp可以转成str类型就可以了。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.