1
0
mirror of https://f-hub.org/XMPP/xmpp-discord-bridge synced 2026-01-14 17:20:21 +01:00

xmpp-discord-bridge

Continuation of this repo.

This project is in very low maintenance mode currently. If you want to try it anyway, docker is most likely to work.

xmpp-discord-bridge's goal is to be a highly integrated bridge between XMPP and Discord.

Features

  • Uni-directional bridging of Discord reactions to XMPP: Currently without XEP-0424, but with a "compat" mode
  • Bi-directional bridging of media using Webhook embeds and OOB data
  • Uni-directional bridging of Discord presence to XMPP
  • Puppetering support on the side of XMPP
  • Automatic webhook creation
  • Uni-directional sync of the Discord channel's topic
  • XMPP Avatar spoofing on the Discord side
  • Support for proxying media sent via Discord (With this miniproxy (Mirror))

Screenshots

Screenshot of Gajim Screenshot of Discord

XEP Requirements

Some users have experienced issues unless their XMPP server supports certain XEPs. This is an incomplete list, only added to when incompatibility is found.

Install using pipx

Run below as an user, not as root. You can create a separate system user with sudo adduser --system (run sudo adduser --help for more information) and run a shell as that user with sudo -u systemuser -s, replacing systemuser with the user you created.

git clone https://codeberg.org/queer-spark/xmpp-discord-bridge.git
cd xmpp-discord-bridge
pipx install .

Create and edit ~/config.toml. Refer to example.toml for options.

Build Dockerfile

Navigate to the repository root and run the following command (Note that you can substitute podman with docker):

podman build -t xmpp-discord-bridge:latest -f contrib/Dockerfile .

Note: Docker can not communicate on 127.0.0.1, which XMPP services listen on for external components. You will need to configure your XMPP service to listen on all interfaces with 0.0.0.0. Here is the documentation needed for Prosody and Ejabberd.

XMPP

In order for the bridge to work, it needs to have an affiliation of owner before joining. Going off of the example.toml, it would have the JID of bot@discord.example.com. The virtual users that follow will be automatically added to the room with an affiliation of member.

Discord

(based upon https://github.com/42wim/matterbridge/wiki/Discord-bot-setup)

Create Bot

You need to setup a "Bot" on Discord. Go here and click "New Application".

Then give your bot a name. Click "Create". On the next screen, you can optionally set an Avatar Icon for your app and description.

Next, click on "Bot" on the left-hand menu. Then click "Add Bot", then "Yes Do It".

On the "Bot" screen, click "Reset Token" and "Yes. Do It!". Then click "Copy" to copy it. Then paste it to "discord_token" in your config.toml.

Optional: Here, you can also toggle if the bot is public, which will allow others to invite it to their servers.

Make sure to also toggle the "Server Members Intent" and "Message Content Intent" options further down under "Privileged Gateway Intents" to allow the bot to see the member list.

Invite Bot

Now it's time to invite your bot to your server. Don't worry about your bot being started for this next step. On the left-hand menu click "OAuth2" and copy the Client ID into this URL then navigate to it.

https://discordapp.com/oauth2/authorize?&client_id=YOUR_CLIENT_ID_HERE&scope=bot&permissions=536870912

The "permissions=536870912" at the end of the URL corresponds to the "Manage Webhooks" permission. It is required for the bridge to work correctly.

Discord will ask you which guild to invite it to. Select the guild then Authorize it.

Support & Contributing

Pull requests are welcome! There are plenty of issues that still need to be worked on. You are also welcome to open new issues.

License

See ./LICENSE

Description
An advanced XMPP to Discord channel bridge.
Readme GPL-3.0 301 KiB
Languages
Python 99.4%
Dockerfile 0.6%