PurpleRelay relays messages from Pidgin/Finch to Discord.
296
PurpleRelay relays and routes messages from Pidgin/Finch to Discord utilizing D-BUS for IPC(inter-process communication).
PurpleRelay is configured through a routes.json file to filter incoming messages received through Pidgin using regular expressions that are then relayed to specified Discord channels.
Any instant messaging / chat account that Pidgin supports or through plugins should theoretically be capable of being relayed to Discord.
Relaying is simple to set up and there is even a Docker image available utilizing Finch for a headless GUI-less setup.
All possible configuration for the bot is done in the routes.json file. There is a provided routes-example.json in this repo for a simple setup.
0 to disable and infinitely retry reconnecting to Pidgin/Finch.false will disable updating the status indicator and activity so the bot will always appear as online(green).0 disables spam control and duplicate messages can be relayed.{
"config": {
"token": "",
"max_dbus_reconnect": 5,
"bot_status": true
},
"routes": [
{
"name": "RelayName",
"src": "IRC",
"filter_input_account": ".*",
"filter_input_sender": ".*",
"filter_input_conversation": ".*",
"filter_input_message": ".*",
"filter_input_flags": ".*",
"targets": [
{
"name": "InternalRouteName",
"channel_id": 123,
"title": "Relay",
"embed": true,
"embed_color": 4659341,
"timestamp": true,
"mention": "@here",
"strip_mention": true,
"spam_control_seconds": 0
}
]
}
],
"logger": {
"log_purple_messages": true,
"log_routed_messages": true,
"days_delete_after": 5
}
}
The Docker variant of PurpleRelay uses Finch to provide a GUI-less connection to chat services for relaying to Discord.
Dockerfile linksWhere to get help:
Where to file issues:
This image uses a single Docker volume to persist the Finch config, logs, and routes.json. See volumes for information about Docker volumes.
See this guide for using Finch.
docker volume create relayvol
docker volume inspect relayvol | grep "Mountpoint"
routes.json file into the root of the volume's mountpoint.docker run -it -v relayvol:/app --name myrelay nathanls/purplerelay
finch.
You will need to exec into the container to initially sign into the chat accounts with Finch from another terminal session.
If a volume is mounted at /app on the container the Finch config will persist across restarts.
You can also manually edit files within the Pidgin/Finch config directory which would be located at /app/.purple on the container and volume.
docker exec -it myrelay screen -r finch
Persist data through mounting named volumes to the /app directory within the container.
Example stack.yml for PurpleRelay:
version: '3.7'
services:
purple:
image: nathanls/purplerelay:stable
deploy:
restart_policy:
condition: any
volumes:
- relayvol:/app
networks:
- purple-network
volumes:
relayvol:
networks:
purple-network:
driver: overlay
requirements.txtThis section outlines the process for manually installing dependencies and running the application on Fedora if you choose not to utilize the Docker image of PurpleRelay.
Note: Package names and commands may differ between Linux distros.
Install Python3
dnf install -y python38
Install the PyGObject dependencies. See PyGObject install guide
dnf install -y gcc gobject-introspection-devel cairo-devel pkg-config python3-devel gtk3
Clone and make a virtualenv
mkdir ~/relay
cd ~/relay
git clone https://github.com/Nathan-LS/PurpleRelay.git
cd PurpleRelay
python3 -m venv venv
source venv/bin/activate
Install requirements
pip3 install -r requirements.txt
Rename routes-example.json to routes.json and add in your channel message routing. See Relay Configuration for information on configuration definitions.
mv routes-example.json routes.json
nano routes.json
Make a Discord application/bot and copy the token to config->token in the routes.json file.
See the relay-configuration on this document for config reference.
Ensure Pidgin or Finch is running and start the bot.
./venv/bin/python3 ./PurpleRelay
Content type
Image
Digest
Size
428.7 MB
Last updated
almost 6 years ago
docker pull nathanls/purplerelay:development