How to Build the Simplest Feishu Robot

insert image description here

After the robot joins the group, use the following function to make the robot send text messages to the group.

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)

In this way, the robot can send texts to the group

Guess you like

Origin blog.csdn.net/duoyasong5907/article/details/129915049