Python的飞书群组机器人调用方法集合
Project description
说明
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转换富文本
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
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 pyfeishugroupbot-0.0.7.tar.gz.
File metadata
- Download URL: pyfeishugroupbot-0.0.7.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1beaab87a708b4e18063996d22e658337cd7102c9d14725507d94b54a217b87
|
|
| MD5 |
f47cff44d5e9e5692f60a750a8a6570b
|
|
| BLAKE2b-256 |
e4860c26cee58455d30aac35ced4345fa516f7fb41c4be6aee44b182bb18b227
|
Provenance
The following attestation bundles were made for pyfeishugroupbot-0.0.7.tar.gz:
Publisher:
python-publish.yml on Moxin1044/Py-FeishuGroupBot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfeishugroupbot-0.0.7.tar.gz -
Subject digest:
a1beaab87a708b4e18063996d22e658337cd7102c9d14725507d94b54a217b87 - Sigstore transparency entry: 384055451
- Sigstore integration time:
-
Permalink:
Moxin1044/Py-FeishuGroupBot@b69e51749e3d7814ba8bc2321d40256592832176 -
Branch / Tag:
refs/tags/v0.0.7 - Owner: https://github.com/Moxin1044
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b69e51749e3d7814ba8bc2321d40256592832176 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyfeishugroupbot-0.0.7-py3-none-any.whl.
File metadata
- Download URL: pyfeishugroupbot-0.0.7-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61958c230bf314b7a63263dfe0afd081d903539c2322b3321e7d009a0ea96818
|
|
| MD5 |
69678da29f12defdf520204e78a6e57d
|
|
| BLAKE2b-256 |
cdce8be3685a21a16a2382fc5cd6e23bb2ecdfa8153de1629cd6c1b735aabfa8
|
Provenance
The following attestation bundles were made for pyfeishugroupbot-0.0.7-py3-none-any.whl:
Publisher:
python-publish.yml on Moxin1044/Py-FeishuGroupBot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfeishugroupbot-0.0.7-py3-none-any.whl -
Subject digest:
61958c230bf314b7a63263dfe0afd081d903539c2322b3321e7d009a0ea96818 - Sigstore transparency entry: 384055462
- Sigstore integration time:
-
Permalink:
Moxin1044/Py-FeishuGroupBot@b69e51749e3d7814ba8bc2321d40256592832176 -
Branch / Tag:
refs/tags/v0.0.7 - Owner: https://github.com/Moxin1044
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b69e51749e3d7814ba8bc2321d40256592832176 -
Trigger Event:
release
-
Statement type: