Skip to main content

A Python SDK for baidu infoflow robot.

Project description

infoflow-robot

PyPI - Version PyPI - Python Version


目录

安装

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


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.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

infoflow_robot-0.0.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file infoflow_robot-0.0.2.tar.gz.

File metadata

  • Download URL: infoflow_robot-0.0.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for infoflow_robot-0.0.2.tar.gz
Algorithm Hash digest
SHA256 91bf0761aecb558d4b6641ef9145f2b843464736e264bc9b26cc3557dee21b7c
MD5 886936e9ab140c5a3d3210c938ab0355
BLAKE2b-256 4f09da2087f15373942809506540c3ac20c9eafd0c0f1bf1143a9775aa8a1f7d

See more details on using hashes here.

File details

Details for the file infoflow_robot-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for infoflow_robot-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a0a000b191c1e21b7afa3aed2463faecc4ed5d9a548d5f4f70406833054dc2da
MD5 5fb0fe088ee0027c17508637efb31d3f
BLAKE2b-256 b06e72ae21ceafb473c84e0b4a597a3d8c30d640490972822fbce8e5cfbe3281

See more details on using hashes here.

Supported by

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