说明
PyFeishuGroupBot 是一个基于飞书机器人API的Python库,用于发送消息到飞书群组。
安装
pip install PyFeishuGroupBot
使用
from PyFeishuGroupBot import *
bot = FeishuGroupBot("your_webhook_url")
bot.send_text("Hello, Feishu!")
消息类型
- 文本消息
- 卡片消息
- 富文本消息
- 图片消息
- 群名片消息
消息演示
from PyFeishuGroupBot import FeishuGroupBot
# 初始化机器人
bot = FeishuGroupBot("https://open.feishu.cn/open-apis/bot/v2/hook/******")
# 发送消息
bot.send_text("Hello, world!")
# 发送卡片消息
bot.send_card("标题", "消息")
# 发送图片
bot.send_image("img_ecffc3b9-8f14-400f-a014-05eca1a4310g")
# 发送富文本消息
bot.send_rich_text("Title", [{"tag": "text","text": "项目有更新: "}, {"tag": "a","text": "请查看","href": "http://www.example.com/"}, {"tag": "at", "user_id": "ou_18eac8********17ad4f02e8bbbb"}])
# 发送群名片
bot.send_group_share(["oc_f5b1a7eb27ae2****339ff"])
# Markdown转换富文本
from PyFeishuGroupBot import parse_markdown_to_feishu_post, FeishuGroupBot
result = parse_markdown_to_feishu_post("#你好\n测试")
bot = FeishuGroupBot("https://open.feishu.cn/open-apis/bot/v2/hook/******")
bot.send_rich_text("Title", result)
更新日志
2025年8月4日 更新 Github Actions
2025年8月12日 更新 Markdown转换富文本
Metadata
Release files for PyFeishuGroupBot 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyfeishugroupbot-0.0.7.tar.gz | 3.8 kB | With provenance | Details for pyfeishugroupbot-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyfeishugroupbot-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for pyfeishugroupbot-0.0.7-py3-none-any.whl |
Total release size: 8.2 kB
Release files / pyfeishugroupbot-0.0.7.tar.gz
| Download URL | pyfeishugroupbot-0.0.7.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1beaab87a708b4e18063996d22e658337cd7102c9d14725507d94b54a217b87
|
|
BLAKE2b-256 checksum How to use checksums |
e4860c26cee58455d30aac35ced4345fa516f7fb41c4be6aee44b182bb18b227
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2025.
Transparency logRelease files / pyfeishugroupbot-0.0.7-py3-none-any.whl
| Download URL | pyfeishugroupbot-0.0.7-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61958c230bf314b7a63263dfe0afd081d903539c2322b3321e7d009a0ea96818
|
|
BLAKE2b-256 checksum How to use checksums |
cdce8be3685a21a16a2382fc5cd6e23bb2ecdfa8153de1629cd6c1b735aabfa8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2025.
Transparency logSecurity for PyFeishuGroupBot 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for pyfeishugroupbot-0.0.7.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 12, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.