如何搭建最简单的飞书机器人

在这里插入图片描述

机器人入群后,使用如下函数可以让机器人向群内发送文字信息。

def send_feishu_message(content):
    url = 'https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxx'

    headers = {
    
    'Content-Type': 'application/json'}

    payload = {
    
    
        "msg_type": "text",
        "content": {
    
    
            "text": content
        }
    }

    response = requests.post(url, headers=headers, json=payload)
    print(response.text)

这样,机器人就可以往群里发文字了

猜你喜欢

转载自blog.csdn.net/duoyasong5907/article/details/129915049