Skip to content

Instantly share code, notes, and snippets.

@uriel1998
Created March 6, 2026 15:56
Show Gist options
  • Select an option

  • Save uriel1998/f5c824c5a028b323786387968b6559f2 to your computer and use it in GitHub Desktop.

Select an option

Save uriel1998/f5c824c5a028b323786387968b6559f2 to your computer and use it in GitHub Desktop.
Matterbridge example with multiple gateways
# Copy to matterbridge.toml and fill in real values.
[discord]
[discord.mydiscord]
Token="DISCORD_BOT_TOKEN_HERE"
Server="DISCORD_SERVER_ID"
AutoWebhooks=true
RemoteNickFormat="[PROTOCOL] <{NICK}> "
PreserveThreading=true
[nctalk]
[nctalk.cloud]
Server="https://nextcloud.example.com"
Login="nextcloud_username"
Password="nextcloud_app_password"
RemoteNickFormat="[PROTOCOL] <{NICK}> "
# Optional matterbridge that might make attachments look a little better when
# coming from Discord.
ReplaceMessages = [
["(?s)^(.*?\\nhttps://cdn\\.discordapp\\.com/attachments/\\S+).*$", "$1"],
["(?m)^cdn\\.discordapp\\.com/attachments/\\S+\\s*$", ""],
["(?m)\\n{3,}", "\\n\\n"]
]
# Each enabled gateway should include at least one discord.* and one nctalk.* inout.
[[gateway]]
name="general"
enable=true
[[gateway.inout]]
account="nctalk.cloud"
channel="nextcloud_talk_room_token"
[[gateway.inout]]
account="discord.mydiscord"
channel="ID:123456789012345678"
[[gateway]]
name="another-room"
enable=true
[[gateway.inout]]
account="nctalk.cloud"
channel="another_talk_room_token"
[[gateway.inout]]
account="discord.mydiscord"
channel="ID:987654321098765432"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment