parses messages from discord channels and sends updates to telegram channels
Db:
docker run -d --name=ds_to_tg -e POSTGRES_HOST_AUTH_METHOD=trust -e POSTGRES_USER=<user> -e POSTGRES_PASSWORD=<pass> -e POSTGRES_DB=ds_to_tg -p <port>:5432 postgres:12.5-alpine
Tables:
-
msgs
create table msgs(channel_id text,msg_id text,timestamp text);
-
channels
create table channels(channel_id text not null primary key,name text,tg_channel_id text);
Go run:
sudo apt update && sudo apt install screen
screen -S ds_to_tg
cd <script working directory> && go run main.go
Ctrl+a, D
You're good to go. To view logs use:screen -r ds_to_tg
, thenCtrl+a, D
to exit.
Tg:
- Add the bot to channel
- Type
/help
- Type
/add <channel_id> <name>
The bot will now send updates from that Discord channel to current tg group/channel