编码一个Slack块消息

2024-05-15 23:09:47 发布

您现在位置:Python中文网/ 问答频道 /正文

这样做有效:

    client.chat_postMessage(
           channel=channel,
            thread_ts = thread_ts, 
            blocks= 
            [
            {
            "type": "section",
            "text": {
                "type": "mrkdwn",
               "text": "Danny Torrence left the following review for your property:"
            }
            },
          [ ... and so on... more sections ...]

) 

但这不起作用:

client.chat_postMessage(
           channel=channel,
            thread_ts = thread_ts, 
            blocks=blockmsg
        )       

其中blockmsg是我之前在程序中定义的多行文字。Slack只是不发布“blockmsg”,它是静默的,即没有错误消息。你知道吗

这里有什么“明白”吗?你知道吗


Tags: textclienttypechatchannelsectionleftthread