mirror of
https://github.com/abdellahaski/Telegram-To-Discord-Bot.git
synced 2025-12-07 11:09:54 +00:00
main
Telegram-To-Discord
Forward message from the specified Telegram channel to Discord Webhooks with all the media
Requirements
- 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
Installing and Setup
- 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.envandexample.config.json5to.envandconfig.json5respectively - Fill out the .env and config.json5 files
- Run the bot by this command:
python3 main.py
Filling .env file
- Add your Telegram
api_idandapi_hashto the.envfile | Read more here - Specify an existing temporary directory to the
DLLOCvariable (e.g.: C:/tmp or /tmp) - Specify the text to append to each of the forwarded messages in the
TEXT_TO_PREPENDvariable (it can be a ping (@everyone,@here, or@role) and it can be a text or emojies like:point_right:)
Filling config.json5 file
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
Languages
Python
94.5%
Shell
5.5%