Skip to content

fedorerd/DiscordNotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DiscordNotify

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.

How to use?

Configure config. Bot uses "cfg.json" file as an entry point with all needed data.

  1. Create copy of "cfg_example.json" and rename it into "cfg.json".
  2. 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
  1. Save "cfg.json", run the bot with "python notifier.py"
  2. You may add several ds_channels and several accounts.

How to create bots, get tokens?

  1. 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:

image

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.

  1. 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.

image

Insert copied token into "ds_token" field in config.

  1. Discord channels IDs Go to Discord user settings. Open "advanced" and turn on "developer mode".

image

Then right-click the channel you want to resend messages from and click "copy ID".

image

Instert channel into config file.

  1. 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.

image

Copy ID and insert into config.

Credits

Original script

Original script author

About

Script to mirror Discord messages to Telegram

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages