/chatwoot

Primary LanguageGoApache License 2.0Apache-2.0

Chatwoot <-> Matrix Help Bot Integration

A bot which logs in as a help user in Matrix and mirrors all messages sent to it from Matrix into Chatwoot and allows Chatwoot agents to respond.

Matrix chat: #chatwoot-matrix:nevarro.space

Supported features

  • Chatwoot -> Matrix

    • Plain text
    • Message formatting
    • Attachments
      • Images
      • Files
    • Private messages are ignored
    • Redactions
    • Append message sender to message that gets mirrored into Matrix
  • Matrix -> Chatwoot

    • Text
    • Message formatting
    • Attachments
      • Images/GIFs
      • Files
    • Edits *
    • Reactions *
    • Redactions
    • Mark the canonical DM with a label
  • Multiple chats with help bot supported

  • Read receipt sent when message is sent from Chatwoot or when conversation is resolved in Chatwoot

  • Error notifications as private messages when bridging fails in either direction

* indicates that a textual representation is used because Chatwoot does not support the feature

Configuration

First, create an inbox in your Chatwoot instance, and set the webhook URL to the bridge (see Webhook Listener Settings below). Then, create a config.json file. The options are listed below. Required fields are marked with a *.

Matrix Authentication

  • Homeserver * --- the Matrix homeserver to connect to
  • Username * --- the Matrix username of the help bot
  • PasswordFile * --- a file containing the Matrix user password

Chatwoot Authentication

  • ChatwootBaseUrl * --- the base URL for the Chatwoot instance
  • ChatwootAccessTokenFile * --- a file containing the access token for Chatwoot
  • ChatwootAccountID * --- the Chatwoot account ID to use
  • ChatwootInboxID * --- the Chatwoot inbox ID to create conversations in

Database Settings

  • DBConnectionString * --- a PostgreSQL database connection string for the bot

Bot Settings

  • AllowMessagesFromUsersOnOtherHomeservers --- true or false indicating whether or not to create conversations for messages originating from users on other homeservers. Defaults to false.
  • CanonicalDMPrefix --- if not "", when creating a conversation, if the Matrix room name starts with this prefix, it will be labeled with the canonical-dm label. Defaults to "".
  • BridgeIfMembersLessThan --- if not -1, only bridge conversations where the member count in the room is less than this. Defaults to -1.
  • RenderMarkdown --- true or false indicating whether or not to convert the Chatwoot markdown to Matrix HTML.

Webhook Listener Settings

  • ListenPort * --- the port to listen for webhook events on