Skip to main content

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

pyfeishugroupbot-0.0.7.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

pyfeishugroupbot-0.0.7-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

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

Hashes for pyfeishugroupbot-0.0.7.tar.gz
Algorithm Hash digest
SHA256 a1beaab87a708b4e18063996d22e658337cd7102c9d14725507d94b54a217b87
MD5 f47cff44d5e9e5692f60a750a8a6570b
BLAKE2b-256 e4860c26cee58455d30aac35ced4345fa516f7fb41c4be6aee44b182bb18b227

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfeishugroupbot-0.0.7.tar.gz:

Publisher: python-publish.yml on Moxin1044/Py-FeishuGroupBot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfeishugroupbot-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for pyfeishugroupbot-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 61958c230bf314b7a63263dfe0afd081d903539c2322b3321e7d009a0ea96818
MD5 69678da29f12defdf520204e78a6e57d
BLAKE2b-256 cdce8be3685a21a16a2382fc5cd6e23bb2ecdfa8153de1629cd6c1b735aabfa8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfeishugroupbot-0.0.7-py3-none-any.whl:

Publisher: python-publish.yml on Moxin1044/Py-FeishuGroupBot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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