Resends messages from Discord into telegram. Script resend attachments and tags username of the message author. Bot supports any amount of Discord tokens, Discord channels and Telegram bots. Check config.
Configure config. Bot uses "cfg.json" file as an entry point with all needed data.
- Create copy of "cfg_example.json" and rename it into "cfg.json".
- In cfg.json, fill the needed data:
- tg_botkey - auth token of telegram bot
- ds_token - auth token of discord account
- ds_channels - ids of discord channel u want to track messages in. Format: "channel_id": 0
- tg_chat - id of telegram chat, where the bot should send all fetched messages from discord channels
- Save "cfg.json", run the bot with "python notifier.py"
- You may add several ds_channels and several accounts.
- Telegram Bot To create a telegram bot, DM https://t.me/BotFather and follow the instructions. After creating the bot, you will see such message:
Copy bot auth token from the yellow box (under 'Use this token to access the HTTP API:'). Insert token into "tg_botkey" field in config.
- Discord auth token Login to your Discord account in browser. Press F12 to open inspect mode in your browser. In inspect mode, go to "Application". In "Application", select "Local Storage" and "https://discord.com". Find "token" key and copy its value.
Insert copied token into "ds_token" field in config.
- Discord channels IDs Go to Discord user settings. Open "advanced" and turn on "developer mode".
Then right-click the channel you want to resend messages from and click "copy ID".
Instert channel into config file.
- TG Chat ID Insert any random number into tg chat id field in cfg. Add the bot to the chat you want to send messages in (DM, group chat, channel (if channel grant bot with admin rights). After adding the bot, send any message to the telegram channel, so the bot will see it. Start the bot with "python notifier.py". You will see the ID of the last channel where the bot fetched a message in console.
Copy ID and insert into config.