Go to file
Daniel Sonck 47f57aacb3
Note the migration towards gitlab.com
2022-04-04 15:58:00 +02:00
.github/workflows Fix testing workflow 2022-02-18 15:22:10 +01:00
img Add README with instructions and sample config 2019-08-19 22:18:58 +01:00
src Update Commands.ts 2021-11-06 20:14:05 +08:00
.gitignore add basic message sending 2019-06-30 17:45:05 +02:00
Dockerfile Force node:alpine to node v12 2021-08-01 00:32:55 -03:00
LICENSE add readme and license 2019-07-01 09:58:32 +02:00
README.md Note the migration towards gitlab.com 2022-04-04 15:58:00 +02:00
docker-run.sh drop privileges if no uid is specified 2020-02-19 18:43:58 +01:00
package-lock.json Update dependencies 2022-02-18 16:18:58 +01:00
package.json Update matrix-discord-parser version selection 2022-02-18 14:38:30 +01:00
sample.config.yaml document category var for room name 2021-04-02 20:55:00 +02:00
tsconfig.json add basic message sending 2019-06-30 17:45:05 +02:00
tslint.json add basic message sending 2019-06-30 17:45:05 +02:00

README.md

THIS PROJECT HAS BEEN MIGRATED OVER TO GITLAB: mx-puppet-bridge

Support room on Matrix donate

mx-puppet-discord

This is a discord puppeting bridge for matrix. It handles bridging private and group DMs, as well as Guilds (servers). It is based on mx-puppet-bridge.

Also see matrix-appservice-discord for an alternative guild-only bridge.

Setup

You need at least node 12 to be able to run this!

Clone the repo and install the dependencies:

git clone https://github.com/matrix-discord/mx-puppet-discord
cd mx-puppet-discord
npm install

Copy and edit the configuration file to your liking:

cp sample.config.yaml config.yaml
... edit config.yaml ...

Generate an appservice registration file. Optional parameters are shown in brackets with default values:

npm run start -- -r [-c config.yaml] [-f discord-registration.yaml]

Then add the path to the registration file to your synapse homeserver.yaml under app_service_config_files, and restart synapse.

Finally, run the bridge:

npm run start

Usage

Start a chat with @_discordpuppet_bot:yourserver.com. When it joins, type help in the chat to see instructions.

Linking a Discord bot account

This is the recommended method, and allows Discord users to PM you through a bot.

First visit your Discord Application Portal.

  1. Click on 'New Application'

  1. Customize your bot how you like

  1. Go to Create Application and scroll down to the next page. Find Create a Bot User and click on it.

  1. Click 'Yes, do it!

  1. Find the bot's token in the 'App Bot User' section.

  1. Click 'Click to Reveal'

Finally, send the appservice bot a message with the contents link bot your.token-here.

Linking your Discord account

Warning: Linking your user account's token is against Discord's Terms of Service.

First retrieve your Discord User Token. If this don't work, use this method: https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs#how-to-get-a-user-token

Then send the bot a message with the contents link user your.token-here.

Guild management

As most users are in many guilds none are bridged by default. You can, however, enable bridging a guild. For that use listguilds <puppetId>, e.g. listguilds 1. (Puppet ID can be found with list.)

Then, to bridge a guild, type bridgeguild <puppetId> <guildId> and to unbridge it type unbridgeguild <puppetId> <guildId>

Friends management

IMPORTANT! This is a USER-token ONLY feature, and as such against discords TOS. When developing this test-accounts got softlocked, USE AT YOUR OWN RISK!

You first need to enable friends management with enablefriendsmanagement <puppetId>.

You can view all friends and invitation status with listfriends <puppetId>.

You can accept a friends request / send a friends request with addfriend <puppetId> <user> where <user> is either the user ID (preferred) or the username#1234.

You can remove friends with removefriend <puppetId> <userId>.

Docker

Docker image can be found at https://hub.docker.com/r/sorunome/mx-puppet-discord

Alternatively build it yourself:

docker build -t mx-puppet-discord .

You may want some changes in your config.yaml:

bindAddress: 0.0.0.0
filename: '/data/database.db'
file: '/data/bridge.log'

Once the bridge has generated the discord-registration.yaml edit it to fix the address so that your matrix home server can connect to the bridge:

url: 'http://discord:8434'