Integrazione Chat Discourse

:information_source: Chat Integration is for using an external chat system together with Discourse — you may be looking for Discourse Chat which adds Chat functionality directly to Discourse.

:discourse2: Summary Discourse Chat Integration allows you to integrate your chat system of choice with Discourse.
:open_book: Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately.

Features

discourse-chat-integration allows sending notifications about new Discourse posts to ‘group chats’ on a number of instant messaging platforms.

Notifications can be triggered by new topics, new replies, messages to a group, or mentions of a group. A notification in your instant messaging system will look something like this:

Configuration

  1. In your site settings, check chat_integration_enabled is :heavy_check_mark:
  2. Click on one of the providers below to see provider-specific setup instructions
  3. For more details, read ‘Configuring Rules’ below
Provider Notifications Slash Commands Post Transcripts Threaded Replies
Slack :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Telegram :white_check_mark: :white_check_mark:
Discord :white_check_mark:
Mattermost :white_check_mark: :white_check_mark:
Google Chat :white_check_mark:
Matrix (element.io) :white_check_mark:
Zulip :white_check_mark:
Rocket.Chat :white_check_mark:
Gitter :white_check_mark:
Flowdock :white_check_mark:
Stride Docs
Microsoft Teams :white_check_mark:
Basecamp Docs
IRC Cloud Docs
Flock Docs
Webex :white_check_mark:

Terminology

There are three key concepts in discourse-chat-integration: Providers, Channels and Rules

Configuring Rules

In your forum’s admin panel, under Plugins, you should see a Chat Integrations section. Within that there will be tabs for each of your enabled providers:

Rules have a number of options which can be configured:

  • Type:
    • Normal - send notifications based on standard posts on the forum
    • Group Message - send notifications based on private messages which a specified group is a part of
    • Group Mention - send notifications whenever specified group is @mentioned in a standard post on the forum (mentions in private messages are ignored)
  • Filter:
    • All posts with threaded replies - notify for new posts matching this rule, create per-topic threads on the chat provider (not available in all integrations)
    • All posts and replies - notify for new posts matching this rule
    • First post only - notify only for new topics matching this rule
    • Tag added to topic - notify when a tag is added to a topic (the create post for category and tag changes site setting must be enabled for this to work)
    • Mute - prevent notifications matching this rule
  • Category (if type is ‘Normal’)
    • Match posts based on their category. Leave as “(all categories)” to match all posts on the forum
  • Group (if type is ‘Group Message’ or ‘Group Mention’)
    • Specify the group you want to receive notifications for
  • Tags
    • Enter a list of tags to match posts with at least one of the listed tags. Leave blank to match all posts

Multiple rules

When multiple rules match a post, the top-most rule in the user interface is executed. Rules are first sorted according to the criteria:

  1. Group mentions
  2. Group messages
  3. Normal

and then sorted within that by

  1. Mute
  2. All posts and replies
  3. First post only

For example, with the following rules

Filter Category Tags
All posts and replies Mentions of: @team (all tags)
Mute Support (all tags)
First post only Support unsupported-install
All posts and replies (all categories) (all tags)
Notifications would be triggered for

but not for

Security/Permissions

The site setting “chat integration discourse username” allows you to secure your notifications against leaking private information.

By default the system account is used, which means that there is no restriction on notifications sent. To secure your notifications you should create a non-staff user with appropriate access privileges, and enter its username in the site setting.

Slash Commands

If your provider supports slash commands, you can manage rules from within your chat interface. Each provider varies slightly in syntax, but in general they follow a similar structure. (Note that at this time, only the Slack integration implements threads.)

The commands available are

Posting a transcript

If your provider supports transcript posting, you can post your instant messaging history to discourse. This is currently only supported for the Slack provider. Note: You will need to be using the “Access Token” method of connecting to Slack.

Send /discourse post to see the interface. The plugin will try and “guess” where your current conversation starts, by looking for a gap in the message history of more than 3 minutes.

Alternatively, you can specify a number of posts after the command, or a URL to the first message.

To load a transcript for a Slack thread, you can use /discourse post thread {url}, where {url} is the permalink of the first message in the thread. For example:

/discourse post thread https://<slackname>.slack.com/archives/C6029G78F/p1522952993000017

Alternatively, you can use /discourse post with a thread-specific permalink like this:

/discourse post https://foo.slack.com/archives/G49KKS6AX/p1523062012000911?thread_ts=1523091738.000088&cid=G49KKS6AC

In both cases the “first/last message” UI is skipped - the entire thread is included in the transcript.

Adding new providers

Option 1: Submit a PR implementing your provider:

Option 2: Use your own plugin:
It is possible for third party plugins to register new “providers”. As an example, I’ve created a provider which sends webhooks to IFTTT. This could be used to automatically publish all posts in a category to facebook… or turn on your light when someone posts in Feature… or feed your fish whenever there’s a new Plugin.

CHANGELOG

TODO

Last edited by @tobiaseigen 2025-07-16T21:09:49Z

Check documentPerform check on document:
115 Mi Piace

Sarebbe interessante aggiungere il supporto per il plugin ActivityPub Plugin di Discourse in modo che la pubblicazione possa essere attivata in base a tag e altri filtri dall’integrazione della chat.

1 Mi Piace

Ciao, l’anno scorso Telegram ha annunciato forum/argomenti (mini chat all’interno di chat di gruppo). Ho provato a collegare ogni singola mini chat a una o all’altra categoria del mio sito. Ma a quanto ho capito, gli indirizzi degli argomenti non sono supportati dal plugin? Ad esempio, nel mio caso, ogni argomento ha un indirizzo come segue: @telegram_topic /1, @telegram_topic /2, @telegram_topic /3
Se inserisco un nome di chat standard nella riga, ad esempio @telegram_chat, funziona senza problemi.
Sarebbe molto comodo se il plugin avesse la possibilità di inserire indirizzi di chat simili (../1), così gli utenti non dovrebbero essere iscritti a molti canali indipendenti legati a determinate categorie del sito.

1 Mi Piace

Hai considerato di usare i tag per raggiungere questo obiettivo?

:thinking: Penso che l’uso dei tag non sia del tutto adatto al mio caso. Perché anche con l’aiuto dei tag, non vorrei che tutte le notifiche finissero in un unico canale, creando rumore informativo. Allo stesso tempo, invece di avere 20 canali per 20 categorie/tag, preferirei avere un’unica chat di gruppo in cui potrei organizzare diverse mini-chat a tema (per categoria/tag) dove ogni utente può visualizzare quella di cui ha bisogno e avere la possibilità di guardare in altre mini-chat. Sono così infastidito perché nella mia regione (Asia) la maggior parte delle persone usa le chat di WhatsApp e Telegram - i forum non sono popolari. Ma sto cercando un compromesso).\n\nP.S. Se mi ripeto spesso, non giudicarmi, sto solo cercando di esprimere i miei pensieri correttamente, dato che uso Google Translate.

1 Mi Piace

Dovresti essere in grado di filtrare quali tag si applicano a quali chat, almeno per quanto ti sto capendo.

Mi sembra che stiamo parlando di cose diverse :thinking: Non ho una domanda sul filtraggio delle chat per tag/categorie.
Per contesto. In precedenza, Telegram aveva canali e chat (ad eccezione dei bot). Questi canali/chat hanno un nome utente, approssimativamente @nome_chat o @nome_canale.
Dallo scorso anno, Telegram ha avuto l’opportunità di trasformare chat in forum contenenti mini chat tematiche come questa. Queste mini chat hanno i propri nomi utente, ad esempio @nome_chat /1, @nome_chat /2. La comodità di tali chat con mini chat è che l’utente non ha più bisogno di iscriversi a diverse chat separate tra loro, ma basta iscriversi a una chat (ad esempio, con il nome del mio sito) e avere accesso a molte mini chat (nel mio caso, ogni mini chat avrebbe come target una categoria specifica del sito) che interessano all’utente.
Ora voglio collegare queste mini chat a questo plugin, ma mi sembra che il plugin non supporti il nome utente della mini chat come nome_chat /1.

1 Mi Piace

Esiste un modo per creare una regola in cui posso taggare un nuovo messaggio e/o una risposta in modo che non venga pubblicato nel sistema di chat di destinazione (in questo caso Slack)?

Ehi Albert, se stiamo parlando di tag Discourse normali, puoi impostare un filtro ‘mute’ per impedire che argomenti con quel tag attivino notifiche in Slack.

Ma in termini di singoli post, non c’è modo di filtrarli.

1 Mi Piace

Penso di avere lo stesso desiderio tuo, Aizada:

Mi piacerebbe poter avere una chat di gruppo su Telegram, con i topic abilitati (che corrispondano in qualche modo alle categorie su Discourse), e poi, nelle impostazioni di integrazione Discourse/Chat, specificare a quale topic dovrebbe postare.

Ho provato a creare ora una chat di gruppo con topic (solo con il bot e me), ma quando digito /help all’interno di un topic, il bot risponde nella chat generale.

Hai dato un’occhiata a questo @david? Ho trovato questo thread su Stack Overflow, che mostra come ottenere il message_thread_id (che è l’ID del topic) e dice che l’API del bot ha ottenuto il supporto per questo nella versione 6.3.

Grazie comunque per il tuo lavoro! :heart_hands:t2:

1 Mi Piace

Ciao @ErlendMS :wave:. Al momento non abbiamo miglioramenti in programma per questo plugin, ma se qualcuno volesse aggiungere il supporto per il ‘threading’ (o topic) per l’integrazione Telegram, probabilmente sarebbe pr-welcome.

Abbiamo un certo supporto per il threading nell’integrazione Slack, quindi dovrebbe essere possibile riutilizzare parte di quella logica.

3 Mi Piace

È possibile usare questo plugin per ricevere notifiche su Slack ogni volta che un post viene contrassegnato per la revisione? Grazie.

Questo plugin espone funzioni API aggiuntive?

Dove richiedo una revisione di una PR? Ho inviato questa PR alla fine della scorsa settimana per aggiungere un nuovo provider e questa è ancora in attesa di un revisore. Ho cercato nelle varie guide per sviluppatori su Meta e non sono riuscito a trovarne una per le richieste di PR corrette.

Ecco la mia PR: FEATURE: Added Power Automate as a new provider by benoitdesnoyers · Pull Request #204 · discourse/discourse-chat-integration · GitHub

Grazie,

1 Mi Piace

Ciao ragazzi! Abbiamo appena unito questo pr per il plugin di integrazione della chat

Questa modifica mira a rimuovere l’opzione tags_changed dal filtraggio delle regole dall’integrazione della chat – stiamo apportando questa modifica perché stiamo rimuovendo l’impostazione Creazione di un piccolo post di azione quando la categoria o i tag di un argomento cambiano.

Ma la funzionalità rimarrà la stessa, se hai Discourse Automation installato. La prossima volta che eseguirai le migrazioni per questo plugin, aggiungerà uno script al plugin Discourse Automation che funzionerà in modo simile a quello che abbiamo attualmente.

Questo è un esempio di automazione che verrà creata:

Verrà inviato al mio canale in base alle categorie e ai tag che sto monitorando.

${ADDED_AND_REMOVED} è il testo predefinito; si comporterà allo stesso modo della regola.

Abbiamo anche aggiunto per questa opzione di script alcune opzioni che possono essere utilizzate nel messaggio:

  • ${TOPIC} per il nome dell’argomento
  • ${REMOVED_TAGS} per i tag rimossi
  • ${ADDED_TAGS} per i tag aggiunti
    sia rimossi che aggiunti si attiveranno solo se contengono un tag.
    Ad esempio: il messaggio added: ${ADDED_TAGS} si attiverà solo se ci sono tag aggiunti.
4 Mi Piace

Abbiamo riscontrato un problema con l’altro PR (gli utenti che utilizzavano altri provider non potevano utilizzare l’automazione quando le etichette degli argomenti cambiavano), quindi per risolvere il problema, abbiamo creato questo nuovo PR, in cui teniamo conto di ogni provider.

L’impostazione Creazione di un piccolo post d'azione quando la categoria o le etichette di un argomento cambiano non apparirà nell’integrazione della chat.

Se hai installato discourse automation, la prossima volta che eseguirai le migrazioni per questo plugin, verrà aggiunto uno script al plugin discourse automation che funzionerà in modo simile a quello che abbiamo attualmente.


Le tue automazioni appariranno più o meno così:

E i tuoi provider sono i provider abilitati.

Ad esempio, ho abilitato Discord, Slack, Telegram e Google Chat

Il tuo nome del canale è il nome che gli hai dato nelle impostazioni di integrazione della chat.

Ad esempio, il nome qui è Spidey

3 Mi Piace

Abbiamo un nuovo lotto di modifiche per Automation/chat-integration

In questo nuovo lotto, le modifiche degne di nota sono:

  • Abbiamo aggiunto Trigger with PMs (Attiva con messaggi privati), che consente di controllare se questa automazione debba essere attivata anche sui messaggi privati.
  • Risolto un problema per cui l’automazione del trigger Topic tags changed (Tag dell’argomento modificati) veniva attivata durante la creazione dell’argomento.
3 Mi Piace

Come accennato in precedenza – qui

L’impostazione del sito create post for category and tag changes può attualmente divulgare tag/categorie private; un modo che abbiamo trovato per mantenere quella funzionalità è stato spostarla nei sussurri:

Funziona in modo simile ai piccoli post, ma ora è necessario disporre di whisper allowed groups con un certo gruppo per farlo funzionare.

Ho unito una PR per il core con questa modifica e una per chat-integration, rimuovendo l’uso di tale impostazione; la funzionalità di automazione aggiunta dovrebbe essere 1:1 con la piccola azione se qualcuno ha problemi, faccelo sapere!

3 Mi Piace

Ho altri aggiornamenti per questo plugin :steam_locomotive:

Abbiamo aggiunto il campo trigger on per l’automazione Send Chat-Integration message.

Cosa fa?

Controlla quando i tag vengono:

  • Aggiunti e Rimossi (predefinito)
  • Aggiunti
  • Rimossi

Attualmente, questo controllo è inclusivo.
Un buon esempio è se lo imposto su Aggiunti; affinché questa automazione venga eseguita, sarà necessario che qualsiasi tag venga aggiunto a un argomento.

Quando viene impostato Tags added, la tabella di automazione appare così:

Aggiunto tag all’argomento Rimosso Tag dall’argomento L’automazione è stata eseguita?
:white_check_mark: :cross_mark: :white_check_mark:
:white_check_mark: :white_check_mark: :white_check_mark:
:cross_mark: :white_check_mark: :cross_mark:

Quando viene impostato Tags removed, la tabella di automazione appare così:

Rimosso tag dall’argomento Aggiunto Tag all’argomento L’automazione è stata eseguita?
:white_check_mark: :cross_mark: :white_check_mark:
:white_check_mark: :white_check_mark: :white_check_mark:
:cross_mark: :white_check_mark: :cross_mark:
2 Mi Piace


Oggetto: Impossibile accedere alla sezione Plugin per la configurazione dell’integrazione chat

Ciao,

Sono un amministratore del forum LXDAO e sto cercando di configurare il plugin Discourse Chat Integration per connettermi con Telegram. Secondo la documentazione ufficiale, dovrei essere in grado di configurarlo nella sezione Plugin del pannello di amministrazione.

Tuttavia, nella mia dashboard di amministrazione, ho accesso solo a quattro sezioni: Generale, Moderazione, Sicurezza e Report. La sezione Plugin menzionata nella documentazione non sembra essere disponibile.

Potreste aiutarmi a capire:

  1. Il plugin Chat Integration è già installato sul nostro forum?
  2. Ho bisogno di permessi aggiuntivi per accedere alla sezione Plugin?
  3. Se stiamo utilizzando una soluzione Discourse ospitata, ci sono limitazioni riguardo all’installazione/configurazione dei plugin?

Come amministratore, quali passaggi devo intraprendere per configurare correttamente l’integrazione Telegram per la nostra community?

Grazie per il vostro aiuto!