A Python SDK for baidu infoflow robot.
Project description
infoflow-robot
目录
安装
pip install infoflow-robot
使用
import infoflow_robot
import infoflow_robot.message as msg
webhook = "http://example.com/webhook"
toid = [123456]
# 发送单条信息
robot = infoflow_robot.Robot(webhook, toid)
robot.send(msg.Text("Hello, World!\n你好,世界"))
# 发送多条信息 (session 复用)
with infoflow_robot.Robot(webhook, toid) as robot:
robot.send(msg.Text("崭新的一年即将开始,愿新的一年里我们都能收获成长与喜悦!"))
robot.send([
msg.Text("本周五晚上有聚餐,记得来!"),
msg.At(atall=True),
])
# 发送图片
import base64
with open("loveyou.png", "rb") as f:
img = base64.b64encode(f.read())
robot.send(msg.Image(img))
License
infoflow-robot is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
infoflow_robot-0.0.1.tar.gz
(5.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file infoflow_robot-0.0.1.tar.gz.
File metadata
- Download URL: infoflow_robot-0.0.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df82d87c80f0daf95f35aed1f005047d967c6a70d03b530ab18601110c1d6e49
|
|
| MD5 |
07392ab93226f779bbd574ff843387ae
|
|
| BLAKE2b-256 |
f3a35e2b5b729396c33ea3a06f621393c9e4809445ad16833f211cffcf0f71d8
|
File details
Details for the file infoflow_robot-0.0.1-py3-none-any.whl.
File metadata
- Download URL: infoflow_robot-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3008ef9f1ee08508548b305610338bd9bfb1b0c8062d989fa3eb31a460072e74
|
|
| MD5 |
a54d712ba9cf0938b9a6fb82414f8a5a
|
|
| BLAKE2b-256 |
ecbcc33402c49b32f2b5a150ab9d739d6fee6211f6eb1c8cfefb4412d6784dd3
|