Crates.io | telecord |
lib.rs | telecord |
version | 0.1.3 |
source | src |
created_at | 2017-11-28 18:45:32.335033 |
updated_at | 2017-12-06 23:06:19.292547 |
description | A bot to join Telegram Chats to Discord Channels |
homepage | |
repository | https://github.com/asonix/telecord |
max_upload_size | |
id | 40879 |
size | 89,476 |
Telecord is a bot that translates Discord messages to Telegram Messages (and the other way around).
it works
Grab a download from the current release. If there is no release for your operating system or architecture, go to the Crates.io or From Source sections of this readme.
This project requires Rust Nightly to compile. If you don't have Rustup, this is where you install it.
The following command will download the latest stable version of Telecord from crates.io, compile it, and install the binary to ~/.cargo/bin/telecord
rustup run nightly cargo install telecord
This project requires Rust Nightly to compile. If you don't have Rustup, this is where you install it.
git clone https://github.com/asonix/telecord.git
rustup install nightly
rustup run nightly cargo build --release
This will create a binary in ./target/release
that you can run with ./target/release/telecord
, or you can copy it wherever you need.
Make sure you have the proper environment variables set. You can do this with export
or by modifying the .env
file. A sample .env
is provided in this crate as .env.sample
DISCORD_BOT_TOKEN
and TELEGRAM_BOT_TOKEN
are self-explanatory, but CHAT_MAPPINGS
is a comma separated list of colon-separated tuples. The environment variable 1234:abcd,5678:efgh
maps telegram chat 1234
to discord channel abcd
, and also maps telegram chat 5678
to discord channel efgh
.
Once you have your environment variable set, you can use ./path/to/your/telecord/binary
to run the bot. Please note that the bot must be added to and be able to read messages in the Discord Channels and Telegram Chats it is meant to connect.
TELEGRAM_BOT_TOKEN="your token" \
DISCORD_BOT_TOKEN="your token" \
CHAT_MAPPINGS="your mappings" \
RUST_LOG=telecord=info \
./path/to/your/telecord/binary
Make sure you have a user and group you wish to run the bot as. If you don't, you can run it as your own user, or create a new user and group.
[Unit]
Description=A bot to connect Telegram to Discord
After=network.target
[Service]
Type=simple
User=your-telecord-user
Group=your-telecord-group
Environment="TELEGRAM_BOT_TOKEN=YOUR_BOT_TOKEN"
Environment="DISCORD_BOT_TOKEN=YOUR_BOT_TOKEN"
Environment="CHAT_MAPPINGS=CHAT_ONE:CHANNEL_ONE,CHAT_TWO:CHANNEL_TWO"
Environment="RUST_LOG=telecord=info"
ExecStart=/path/to/your/telecord/binary
TimeoutSec=90
Restart=always
[Install]
WantedBy=default.target
In powershell, navigate to the folder that contains the .exe file and run the following commands
$env:RUST_LOG = "telecord=info"
$env:TELEGRAM_BOT_TOKEN = "YOUR_TELEGRAM_TOKEN"
$env:DISCORD_BOT_TOKEN = "YOUR_DISCORD_TOKEN"
$env:CHAT_MAPPINGS = "chat_one:channel_one,chat_two:channel_two"
.\telecord.exe
In bash, navigate to the folder that contains the .exe file and run the following comands
TELEGRAM_BOT_TOKEN="your token" \
DISCORD_BOT_TOKEN="your token" \
CHAT_MAPPINGS="your mappings" \
RUST_LOG=telecord=info \
./telecord.exe
Telecord is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Telecord is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. This file is part of Telecord
You should have received a copy of the GNU General Public License along with Telecord If not, see http://www.gnu.org/licenses/.