如何使用 slack-api pins.add 方法
How to use slack-api pins.add method
我正在尝试使用 pins.add
方法,文档说他们现在不支持文件,file_comment,但是没有关于如何发送我想固定的文本的规范。
我试过使用如下所述的 slack 客户端,但它显示 not_pinnable,如果我不提及文本,它会显示 no_item_specified
.
sc.api_call("pins.add", channel=channel_id, ts=x, file='test', file_comment='helo')
要固定文本,您需要引用要固定的消息,该消息需要存在于频道中。您可以通过提供频道 ID 和消息的时间戳来引用消息。
当您自己 post 消息时(它在 API 的响应中)或从消息事件或通过使用 conversations.history
.
示例:
sc.api_call("pins.add", channel=channel_id, timestamp=message_timestamp)
我正在尝试使用 pins.add
方法,文档说他们现在不支持文件,file_comment,但是没有关于如何发送我想固定的文本的规范。
我试过使用如下所述的 slack 客户端,但它显示 not_pinnable,如果我不提及文本,它会显示 no_item_specified
.
sc.api_call("pins.add", channel=channel_id, ts=x, file='test', file_comment='helo')
要固定文本,您需要引用要固定的消息,该消息需要存在于频道中。您可以通过提供频道 ID 和消息的时间戳来引用消息。
当您自己 post 消息时(它在 API 的响应中)或从消息事件或通过使用 conversations.history
.
示例:
sc.api_call("pins.add", channel=channel_id, timestamp=message_timestamp)