This howto describes how to setup the Mattermost provider included in discourse-chat-integration.
Install
If you haven’t already, install the discourse-chat-integration plugin
Notifications
Set up Mattermost
Your Mattermost server needs to be accessible from your Discourse server in order to connect them. It is recommended that you use HTTPS, but HTTP should also work.
In your Mattermost System Console , under Custom Integrations , check that these settings are enabled:
Enable Incoming Webhooks
Enable integrations to override usernames
Enable integrations to override profile picture icons
Enable Custom Slash Commands (if you want slash commands)
Login to your team, click your name in the top left, then click Integrations
Choose Incoming Webhooks , Add incoming Webhook
Enter a “Display Name”, “Description”, and choose a random channel from the list (it doesn’t matter which one, Discourse will override this)
Save
Copy the URL provided, you’ll need it later
Setup Discourse
Paste the URL you copied into the chat_integration_mattermost_webhook_url site setting
Enable chat_integration_mattermost_enabled
Setup some “Rules” for your channels, according to the discourse-chat-integration instructions. Channel identifiers look like #town-square or @davidtaylor.
Click Test on one of the channels to check everything’s working. You should receive a message like this:
Slash Commands
Slash commands allow you to manage your rules from inside Mattermost. To get it working:
If you didn’t already, enable Enable Custom Slash Commands in your Mattermost System Console
Login to your team, click your name in the top left, then click Integrations
Choose Slash Commands , Add slash command
Display Name : Discourse
Description : Manage Discourse notification rules
Command Trigger Word : discourse
Request URL : <your-discourse-url>/chat-integration/mattermost/command
Request Method : POST
Response Username : Discourse
Response Icon : (optionally specify an icon URL)
Autocomplete :
Autocomplete Hint : Manage this channel's integration with Discourse
Autocomplete Description : [watch|follow|mute|delete|status|help]
Save
Copy the “Token” provided, and paste it into your Discourse site settings under chat_integration_mattermost_incoming_webhook_token
Try sending /discourse help in your mattermost channel - you should get a message with a list of possible commands
「いいね!」 11
sam
(Sam Saffron)
2017 年 7 月 25 日午後 9:36
2
I recommend you also post this on the mattermost Discourse to get more feedbacks
We’re wondering if it’s possible/feasible to integrate Mattermost with Discourse, so that signing up on one would create an account for the other (or both use the same login either way). This would be fantastic, so that users only need to register...
Reading time: 1 mins 🕑
Likes: 5 ❤
and probably a dedicated topic.
(also I wish we warned communities about hideous looking oneboxes cause they are missing images)
「いいね!」 6
I think we already do in the dashboard if they use the default images for the logos.
「いいね!」 1
david
(David Taylor)
2017 年 7 月 26 日午後 1:47
4
Mattermost integration now supports slash commands (their implementation is built to be compatible with Slack’s)
I have also created a topic about it on the Mattermost forum, it can be found here:
👋 Hi everyone. I’m participating in the Google Summer of Code programme, working on Discourse (the software that you’re reading this in!). I’ve built a plugin for Discourse called discourse-chat-integration. It allows for “cross-posting” posts on...
Reading time: 1 mins 🕑
Likes: 7 ❤
「いいね!」 5
nommaz
2017 年 9 月 9 日午後 3:04
5
Hello! I am getting a broken image link to the right of the mattermost post. I tried to see the image url and it looks like an actual post instead of an image:
http://destek.hugin.com.tr/t/hugin-destek-topluluguna-hos-geldiniz/183/1
Is it intended to be the post author image I wonder?
Any tips on how to fix it?
david
(David Taylor)
2017 年 9 月 9 日午後 8:09
6
Hi @nommaz - sorry about that. It was indeed trying to load an image from the URL of the post, which clearly isn’t going to work
I’ve fixed it now, so if you update to the latest version of the plugin it should work as intended
committed 08:07PM - 09 Sep 17 UTC
「いいね!」 2
nommaz
2017 年 9 月 9 日午後 10:01
7
Hi David didnt work unfortunately
Are you sure it is not an issue with mattermost_provider.rb:68 ?
Thanks
Vedat
david
(David Taylor)
2017 年 9 月 9 日午後 10:10
8
Oops, I made the change in the slack provider instead of mattermost
Just added another commit to correct the error, so please can you give it another try
「いいね!」 1
What’s up if I get a 422 error when trying (test) to hook to Mattermost?
david
(David Taylor)
2018 年 12 月 5 日午後 3:04
11
Make sure you copied the webhook URL correctly, and that there are no spaces before/after the URL. Is your mattermost server accessible to the internet? Or just an internal network?
「いいね!」 3
csmu
(Keith John Hutchison - Ceiteach Seán Mac Úistin)
2019 年 3 月 15 日午前 3:01
12
What’s the best way to handle multiple teams / multiple mattermost servers?
Mattermost とチャット連携を有効にしています。「/discourse watch」コマンドで表示されるすべての「トップレベル」カテゴリを購読しましたが、「サブカテゴリ」への投稿がキャッチされません。
この投稿を見てください: https://openziti.discourse.group/t/this-is-a-test-topic-in-the-sdks-category/271
これは Slack には正しく転送されますが、Mattermost には転送されません。Slack は「すべてのカテゴリ」を購読できますが、Mattermost はできないようです。
考えられるすべての構文を試しましたが、うまくいきませんでした。何かヒントはありますか?
よろしくお願いします…
「いいね!」 1
@david - メンション失礼します。チャット連携でディスコースの投稿が見られないのですが。このスレッドをまだご覧になっていますか?
david
(David Taylor)
2022 年 2 月 26 日午後 10:44
15
現在、カテゴリを「ウォッチ」しても、サブカテゴリは自動的に含まれません。個々のサブカテゴリをすべて追加するか、「すべてのカテゴリ」オプションを使用する必要があります。
「いいね!」 1
やあ、返信ありがとう!!!「やり方」がわかったら最高なんだけど。プラグインが認識しているように見えるのは、一番上のカテゴリだけ?
「すべてのカテゴリ」オプションを見つけて試したけど、それも機能していないみたい?「すべて」を使えたら本当に嬉しいんだけど、それが理想だよ…私が「間違っている」の?下のスクリーンショットを見て。
@davidさん 、上記の件ですが、サブカテゴリを購読する方法がわからないのですが、また、使用できる「すべて」というオプションも見当たりません。これを解決できれば嬉しいです。
よろしくお願いします!
「いいね!」 1
david
(David Taylor)
2022 年 3 月 9 日午後 1:55
18
ご返信が遅くなり申し訳ありません、@Clint_Dovholuk !
スラッシュコマンドを使用すると、次のようにすべてのカテゴリを監視できると思います。
/discourse watch
ただし、通知ルールを設定する最も簡単な方法は、Discourse管理パネルを使用することです。そこでは、すべてのオプションがUIに明確に表示されているため、正確な「スラッシュコマンド」構文を理解しようとする必要はありません。詳細については、プラグインのドキュメントの「ルール設定 」セクションを確認してください。
「いいね!」 2
@david ありがとうございます。
以前にスラッシュコマンドのスクリーンショットを投稿しました。こちらに再投稿します…数投稿前に「サブカテゴリ」が表示されていないことがわかります…
以前にも管理ページを試しましたが、使用するとすぐにドロップダウンが閉じました…しかし、「下矢印」を押すと必要なものが解放されたようです。
「すべて」のオプションが__本当に__欲しいです。これは私が編集/修正できるプラグインですか???今はこんな感じです:confused:
david
(David Taylor)
2022 年 3 月 10 日午前 12:18
20
[quote=“Clint_Dovholuk, post:19, topic:66811”]
現状はこうなっています。
[/quote]すべてのトピックの通知を受け取るには、カテゴリ固有のルールをすべて削除し、単一の「すべてのカテゴリ」ルールを追加することをお勧めします。
[quote=“Clint_Dovholuk, post:19, topic:66811”]
以前、管理ページを試しましたが、使用するとすぐにドロップダウンが閉じました…
[/quote]ここで何が見えるか、もう少し詳しく教えていただけますか?スクリーンショットや動画があると素晴らしいです!
「ルール」を編集する際には、カテゴリのドロップダウンを使用して「(カテゴリなし)」を選択できるはずです。
保存すると、このようになります。
(ドロップダウンの「カテゴリなし」は、それが実際に何を意味するかの説明としては明らかに不十分です。修正します)
[quote=“Clint_Dovholuk, post:19, topic:66811”]
以前、スラッシュコマンドのスクリーンキャップを投稿しました。ここに再投稿します…数投稿前で「サブカテゴリ」がリストされていないことがわかります…
[/quote]サブカテゴリはスペースの都合上、ヘルプテキストから省略されていると思います。しかし、カテゴリの「スラッグ」(URLのサブカテゴリ名)を使用してカテゴリを購読することは可能です。たとえば、ここMetaの#howto:adminsの場合は /discourse watch admins となります。