Forward message from the specified Telegram channel to Discord Webhooks with all the media
- Python 3.6+
- Telegram APPID and HASH (can be created from here https://core.telegram.org/api/obtaining_api_id)
- Have a Telegram account with valid phone number
- Discord webhooks for the channels you to forward to
- Clone this repository
git clone https://github.com/abdellahaski/Telegram-To-Discord-Bot.git
. - Open your choice of console (or Anaconda console) and navigate to cloned folder
cd Telegram-To-Discord-Bot.git
. - Run Command:
pip3 install -r requirements.txt
. - Rename
example.env
andexample.config.json5
to.env
andconfig.json5
respectively - Fill out the .env and config.json5 files
- Run the bot by this command:
python3 main.py
- Add your Telegram
api_id
andapi_hash
to the.env
file | Read more here - Specify an existing temporary directory to the
DLLOC
variable (e.g.: C:/tmp or /tmp) - Specify the text to append to each of the forwarded messages in the
TEXT_TO_PREPEND
variable (it can be a ping (@everyone
,@here
, or@role
) and it can be a text or emojies like:point_right:
)
The ``config.json5` file contains a JSON array (list) of Telegram channel you want to forward messages from all along with specific configuration for each TG channel:
TGchannelID
: Telegram ID of the channel that you want to forward from (you can get it by forwarding any message from that channel to @jsondumpbot) don't forget to remove the first part (-100) from the IDsenderAvatarUrl
: The avatar URL that will be shown on Discord sender profile (if it's empty it will be pulled automatically from the Telegram channel profile picture)senderName
: The sender name that will be shown on Discord sender profile (if it's empty it will default to the Telegram channel name)DiscordWebhooks
: Contains a list of the Discord webhooks that you want messages to be forwarded to
You can have as many TG channels as you want forwarding message to as many as Discord webhooks you want