Python Slack Bolt:在带范围的 DM 中找不到通道

问题描述 投票:0回答:1

我在 DM 中使用斜杠命令并从 Slack 收到以下错误消息:

{'ok': False, 'error': 'channel_not_found'}

我的机器人目前具有以下范围,并正在使用

say
功能将消息发送到指定的 DM 通道。

以下是机器人的范围供参考:

app_mentions:read
channels:history
channels:join
channels:read
chat:write
chat:write.public
commands
groups:history
groups:read
im:history
im:read
im:write
incoming-webhook
mpim:history
mpim:read
mpim:write
mpim:write.invites
users.profile:read
users:read

我无法通过

ack
发送消息,因为它是通过模式发送的,有时需要发送到不同的频道(提示的一部分),这是我遇到的另一个问题(有谁知道我的机器人是否可以加入私人频道它本身还是什么?)

有问题的行如下:

message = await say(channel=data["channel_block"]["event-rsvp-channel"]["selected_conversation"], blocks=block_data["blocks"])
python slack slack-api slack-commands slack-bolt
1个回答
0
投票

抱歉,如果我参加聚会迟到了!希望你能明白这一点。

您的机器人无法加入私人频道,除非它已经是成员,这包括两个人之间的私信 - 您必须与人 A、人 B 和机器人创建群组消息。

我也会使用

chat_postMessage
而不是
say

© www.soinside.com 2019 - 2024. All rights reserved.