{"id":15974589,"url":"https://github.com/devzwy/flybookbotmsgsender","last_synced_at":"2025-04-04T17:13:03.009Z","repository":{"id":65775051,"uuid":"599480733","full_name":"devzwy/FlyBookBotMsgSender","owner":"devzwy","description":"飞书机器人工具","archived":false,"fork":false,"pushed_at":"2023-02-10T05:39:50.000Z","size":1270,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-30T07:28:27.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devzwy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-09T08:21:14.000Z","updated_at":"2023-02-10T05:44:27.000Z","dependencies_parsed_at":"2023-02-23T23:16:08.816Z","dependency_job_id":null,"html_url":"https://github.com/devzwy/FlyBookBotMsgSender","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"2714fbf92b1894838fee086b0425a6f1a79254d1"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devzwy%2FFlyBookBotMsgSender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devzwy%2FFlyBookBotMsgSender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devzwy%2FFlyBookBotMsgSender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devzwy%2FFlyBookBotMsgSender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devzwy","download_url":"https://codeload.github.com/devzwy/FlyBookBotMsgSender/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217221,"owners_count":20903009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-07T21:42:57.437Z","updated_at":"2025-04-04T17:13:02.993Z","avatar_url":"https://github.com/devzwy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 飞书自定义机器人消息发送工具\n\n## 使用步骤\n\n1. 安装库 [最新版本](https://pypi.org/project/fly-book-bot-sender)\n\n```\npip install fly-book-bot-sender==0.1.8\n```\n\n2. [下载模板](https://download.fr71.com/open/template.zip) 放在项目根目录  \n![img.png](img.png)\n\n## 开始发送消息\n\n1. 导入包\n\n```\nimport fly_book_bot_sender as sender\nfrom fly_book_bot_sender import MSG_TYPE\n```\n\n2. 配置全局机器人hookApi地址\n\n```\n# 配置全局使用的机器人消息发送api\nsender.setHookUrl('机器人创建时生成的hookUrl')\n```\n\n## 发送消息\n\n### 文本消息  \n```\nsender.sendChatMsg(msgType=MSG_TYPE.TEXT, content='你好，这是一条文本消息！')\n```  \n![img_5.png](img_5.png)  \n\n### 富文本消息  \n![img_6.png](img_6.png)  \n\n```\nsender.sendChatMsg(msgType=MSG_TYPE.RICH_TEXT,\n                       title='通知提醒',\n                       content=[\n                           {\n                               'tag': 'text',\n                               'text': '欢迎使用 '\n                           },\n                           {\n                               'tag': 'a',\n                               'text': 'fly-book-bot-sender',\n                               'href': 'https://github.com/devzwy/FlyBookBotMsgSender'\n                           }, {\n                               'tag': 'text',\n                               'text': ' 别忘了搞个Star哦～ '\n                           },\n                       ]\n                       )\n```  \n\n### 群名片消息  \n![img_7.png](img_7.png)  \n\n```\nsender.sendChatMsg(msgType=MSG_TYPE.GROUP_CARD, content='oc_f5b1a7eb27ae2c7b6adc2a74faf339ff')\n```\n\n### 图片消息  \n![img_8.png](img_8.png)  \n\n```\n# 获得token\nt = sender.getToken(app_id=APP_ID, app_secret=APP_SECRET)\n# 获得图片id\nik = sender.uploadImage('test.png', t)\n# 发送图片消息\nsender.sendChatMsg(msgType=MSG_TYPE.IMAGE, content=ik)\n```\n\n### 卡片消息1\n```\nsender.sendChatMsg(msgType=MSG_TYPE.CARD, title='卡片消息', content='这是一条卡片消息！')\n```  \n![img_9.png](img_9.png)  \n\n### 卡片消息2\n```\nsender.sendChatMsg(msgType=sender.MSG_TYPE.CARD,\n                       title='卡片消息',\n                       content='\u003cat id=all\u003e全部成员\u003c/at\u003e\u003cat id=uid_zhangsan\u003e张三\u003c/at\u003e \\\\n这是一条带业务按钮的卡片消息！我支持md语法！\\\\n\u003ca href=\\'http://www.baidu.com\\'\u003e这也时一个跳转链接\u003c/a\u003e\\\\n这条消息特别重要！\\\\n![小黄](img_v2_42baabc5-df87-46bf-83d5-7b26a101372g)\\\\n这是一个链接[aaa](http://www.baidu.com)\\\\n ---\\\\n告辞',\n                       bottons=[\n                           {\n                               'bt_title': '点我联系作者:玫瑰:',\n                               'href': 'https://github.com/devzwy'\n                           },\n                           {\n                               'bt_title': '老子今天不想搬砖',\n                               'href': 'https://baijiahao.baidu.com/s?id=1699508807181110630\u0026wfr=spider\u0026for=pc'\n                           }\n                       ])\n```  \n![img_10.png](img_10.png)  \n## 附\nsendChatMsg 函数回传一个长度=2的数组  \n第1位是bool值，代表发送的状态  \n第2位为str值，发送失败时返回原因，成功时返回定值：success\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevzwy%2Fflybookbotmsgsender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevzwy%2Fflybookbotmsgsender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevzwy%2Fflybookbotmsgsender/lists"}