Slack threads and chat integration plugin transcripts

For ‘Private Channels’ you need to add the groups:history scope. For “Direct Messages” you need to add the im:history scope. You will need to ‘reinstall’ the app for changes to scopes to take effect (Slack’s UI should have prompted you to do this).

Are you seeing anything at /logs when the errors occur?

2 个赞

I tried adding these scopes, and reinstalling:

groups:history
im:history
mpim:history

Still getting that 422, but don’t see anything obvious in the Discourse logs in the admin panel (this is a hosted instance, so I don’t have direct access to other logs).

1 个赞

I used the /discourse post command from a public channel to great effect… but threads are now more common in many channels than main channel conversations, so still hopeful that some day this will work in a thread…

Update: w00t! just tried it again and it worked!

/discourse post https://ourdomain.slack.com/archives/C0591LA4X/p1529529151000359?thread_ts=1529528304.000177&cid=C0592LA4X

as did:

/discourse post thread https://ourdomain.slack.com/archives/C0592LA4X/p1529528304000177

Another update: I was also able to post a thread from a private channel. :tada:

9 个赞

I got an error when using post transcript in a public channel:

{
	"message": "Job exception: undefined method `[]' for nil:NilClass\n",
	"progname": null,
	"severity": 3,
	"backtrace": "/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_message.rb:38:in `block in text'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_message.rb:30:in `gsub'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_message.rb:30:in `text'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_message.rb:62:in `processed_text_with_attachments'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_transcript.rb:155:in `block in build_slack_ui'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_transcript.rb:155:in `map'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_transcript.rb:155:in `build_slack_ui'\n/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/slack/slack_command_controller.rb:95:in `block in process_post_request'\n/var/www/discourse/lib/scheduler/defer.rb:70:in `block in do_work'\n/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection'\n/var/www/discourse/lib/scheduler/defer.rb:68:in `do_work'\n/var/www/discourse/lib/scheduler/defer.rb:59:in `block (2 levels) in start_thread'",
	"count": 9,
	"env": {
		"message": "Running deferred code 'Processing slack transcript request'"
	},
	"protected": false
}
1 个赞

Hello, did you managed to fix this? I have the same one.

To close the loop here - @mbugowski kindly contributed a pull request to fix the issue:

@tony612 if you update to the latest version it should now work.

5 个赞

斜杠命令现在可以在 Slack 线程中使用了!请看👇🏼

有没有可能支持在某个线程中通过斜杠命令发布转录内容?:crossed_fingers:t3:

6 个赞

我真的很希望这是真的,因为这会让我的生活轻松很多,但在 Slack API 文档中我并没有看到任何相关内容。我想知道他们是否给了 Giphy 特殊的 Alpha 测试访问权限?你有没有看到我所忽略的文档?

可能还有更多信息:今天在工作中,有人在某个线程中抱怨 Slack 不允许在子线程中使用 /giphy,并贴出了一张 Slack 提示该功能在子线程中不受支持的图片;而同一线程中的另一个人却成功使用了 /giphy。看来这里可能正在进行 A/B 测试。

1 个赞

好消息!我刚刚合并了一项插件更新,增加了对 Slack“快捷方式”(Shortcuts)API 的支持。现在,您可以在主题线程中按下 <kbd>...</kbd>,点击“发布到 Discourse",系统会为您提供一个按钮,直接跳转到 Discourse。再也不用折腾斜杠命令或主题永久链接了!

https://github.com/discourse/discourse-chat-integration/commit/610364ff6d9adbd642c9d201415bbd6da795a036

要启用此功能,您需要最新版本的 chat-integration 插件,并按照以下新步骤修改您的 Slack 应用配置:

一如既往,如果您有任何反馈,请随时告诉我们 :slight_smile:

cc @mcwumbly @galligan @mcdanlj

9 个赞

:star_struck::star_struck::star_struck:

太棒了!

我刚才尝试添加此功能,但不幸遇到了以下错误:

错误:无法从 Slack 获取频道历史记录

我在我们最新的 Slack 消息上进行了测试。

您是否已按照此主题中的所有设置说明进行操作?特别是,您是否已为机器人授予所有必要的权限范围?

我找到问题了!我们的聊天集成应用不在我尝试发布消息的频道中。将该应用邀请到频道后,我就能成功发布摘要了。谢谢。

  • 是否可以为所有 Slack 频道自动添加聊天集成应用?包括现有的频道以及未来创建的任何新频道?

  • 从用户体验的角度来看,将“继续在 Discourse 上操作”按钮的文本更改为“创建摘要”或快捷方式的名称(默认为“发布到 Discourse”,但可自定义)会更有意义,因为并非所有 Discourse 站点都自称是 Discourse。

2 个赞

很遗憾,我认为目前还无法实现,但我希望能证明我错了。我会研究一下是否可以改进这里的错误提示,以便提供如何将机器人添加到频道的操作指引。

:+1: 说得对。我们当然可以更新默认设置,移除“Discourse”这个词。但在此之前,您应该能够在管理面板中搜索“Continue on Discourse”(在 Discourse 上继续),并将其更改为您喜欢的任何内容:Customize text in Discourse

编辑:默认按钮文本现在为 在论坛上继续

4 个赞

我已按照 Slack 线程中描述的所有步骤进行操作。我添加了其中描述的所有范围(甚至添加了额外的范围),并将应用邀请到了相关频道。

问题是,在 1% 的情况下,它似乎有效,请看这里:

但在 99% 的公共频道中,我收到错误:“Error: unable to fetch users from Slack”(错误:无法从 Slack 获取用户)

在私信中:“Error: unable to fetch channel history from Slack”(错误:无法从 Slack 获取频道历史记录)

1 个赞