Bot which bridges Telegram chats with Discord channels
Bot which bridges Telegram chats with Discord channels
TediCross is a bot which bridges a chat in Telegram with a channel in Discord.
There is no public TediCross bot. You need to host it yourself. To host a bot, you need nodejs. The bot requires NodeJS 18 or higher.
If you are cloning the repository and looking for the stable release, switch to the stable branch.
We now have a Telegram channel where we post news about the bot! Join us at https://t.me/TediCross
The bot is able to relay text messages and media files between Discord and Telegram. @-mentions, URLs, code (both inline and block-style) works well
For a list of known bugs, or to submit a bug or feature request, see this repo's "Issues" tab
Setting up the bot requires basic knowledge of the command line, which is bash or similar on Linux/Mac, and cmd.exe in Windows
cd command. Something like cd Downloads/TediCross-master. Your exact command may differnpm install --omit=devexample.settings.yaml and name it settings.yamlMessage Content Intent under Bot > Privileged Gateway Intents and put it in the settings file under discord.token. NOTE that the token is NOT the "Client Secret". The token is under the section "Bot" further down the pagenpm start/chatinfo. Put the info you get in the settings file.- when entering it into the settings file'244791815503347712', not 244791815503347712threadMap section under particular Bridge. Write /threadinfo in telegram and discord threads to get corresponding IDs.Done! You now have a nice bridge between a Telegram chat and a Discord channel
Please refer to Docker Guide for the details.
As mentioned in the step-by-step installation guide, there is a settings file. Here is a description of what the settings do.
telegram: Object authorizing and defining the Telegram bot's behaviortoken: The Telegram bot's token. It is needed for the bot to authenticate to the Telegram servers and be able to send and receive messages. If set to "env", TediCross will read the token from the environment variable TELEGRAM_BOT_TOKENuseFirstNameInsteadOfUsername: If set to true, the messages sent to Discord will be tagged with the sender's first name + last name. If set to false - sender's username will be preferred, but if username is not set - first name + last name. Note that Discord users can't @-mention Telegram users by their first name. Defaults to falsecolonAfterSenderName: Whether to put a colon after the name of the sender in messages from Discord to Telegram. If true, the name is displayed Name:. If false, it is displayed Name. Defaults to falseskipOldMessages: Whether to skip through all previous messages cached from the telegram-side and start processing new messages ONLY. Defaults to true. Note that there is no guarantee the old messages will arrive at Discord in ordersendEmojiWithStickers: Whether to send the corresponding emoji when relaying stickers to DiscordfilterCustomEmojis: Determines what to do with custom emojis from Discord message before it reaches telegram. Has three states:default - custom emojis will be transferred without any processing (ex: My Text);remove - custom emojis will be removed from the output (ex: My Text);replace - custom emojis will be replaced with a definable string. Defined in replaceCustomEmojisWith (ex: My Text).
Defaults to defaultreplaceCustomEmojisWith: Determines a string that will be used as a replacement for custom emojis. Anything that can be passed as a string is supported, including emojis. Defaults to ``replaceAtSign: Whether to replace @ sign to something else from Discord message before it reaches. When set to true will replace @ with a string you put into settings.replaceAtSignWith. If set to false - will do nothing. Defaults to falsereplaceAtSignWith: Determines the string that will be used as a replacement for @ sign. Anything that can be passed as a string is supported, including emojis. Defaults to #removeExcessiveSpacings: USE WITH CAUTION Whether to remove excessive (2 or more) whitespaces from Discord message. Can help to neat your message up if it wasn't particulary untidy in the source. When set to true will remove excessive whitespaces and replace them with a single whitespace instead. If set to false - will do nothing. Defaults to falsesuppressFileTooBigMessages: Suppress warning messages on errors with sending too big files (due to API limitations) from telegram to discord. Defaults to false.suppressThisIsPrivateBotMessage: If set to true - suppress warning messages (This is an instance of a TediCross bot...) in telegram chats outside configured bridges. Defaults to falsediscord: Object authorizing and defining the Discord bot's behaviortoken: The Discord bot's token. It is needed for the bot to authenticate to the Discord servers and be able to send and receive messages. If set to "env", TediCross will read the token from the environment variable DISCORD_BOT_TOKENskipOldMessages: Whether to skip through all previous messages sent since the bot was last turned off and start processing new messages ONLY. Defaults to true. Note that there is no guarantee the old messages will arrive at Telegram in order. NOTE: Telegram has a limit on how quickly a bot can send messages. If there is a big backlog, this will cause problemsuseNickname: Uses the sending user's nickname instead of username when relaying messages to TelegramreplyLength: How many characters of the original message to display on repliesmaxReplyLines: How many lines of the original message to display on repliessuppressThisIsPrivateBotMessage: If set to true - suppress warning messages (This is an instance of a TediCross bot...) in discord channels outside configured bridges. Defaults to falseenableCustomStatus: If set to true - enables the custom status. Defaults to falsecustomStatusMessage: The message to set as custom status. Defaults to "TediCross"debug: If set to true, activates debugging output from the bot. Defaults to falsemessageTimeoutAmount: Amount for your unit of time to expire messages in MessageMap. Defaults to 24messageTimeoutUnit: Format of time as a string (ie: 'hours', 'days', 'weeks', etc...). Defaults to 'hours'persistentMessageMap: Allow MessageMap to persist between reboots by saving it to a file. Defaults to falsebridges: An array containing all your chats and channels. For each object in this array, you should have the following properties:name: A internal name of the chat. Appears in the log
direction: Direction of the bridge. "both" for bidirectional, "d2t" for discord-to-telegram, "t2d" for telegram-to-discord
telegram.chatId: ID of the chat that is the Telegram end of this bridge. See step 11 on how to acquire it
telegram.relayJoinMessages: Whether to relay messages to Discord about people joining the Telegram chat
telegram.relayLeaveMessages: Whether to relay messages to Discord about people leaving the Telegram chat
telegram.sendUsernames: Whether to send the sender's name with the messages to Discord
telegram.crossDeleteOnDiscord: Whether to also delete the corresponding message on Discord when one is deleted on Telegram. NOTE: See FAQ about deleting messages.
discord.channelId: ID of the channel the Discord end of the bridge is in. See step 11 on how to acquire it
discord.relayJoinMessages: Whether to relay messages to Telegram about people joining the Discord chat
discord.relayLeaveMessages: Whether to relay messages to Telegram about people leaving the Discord chat
discord.sendUsernames: Whether to send the sender's name with the messages to Telegram
discord.crossDeleteOnTelegram: Whether to also delete the corresponding message on Telegram when one is deleted in Discord
discord.disableWebPreviewOnTelegram: Whether to disable links preview when relaying to Telegram
discord.useEmbeds: Whether to use embeds for current bridge. Can be always, never, auto. Defaults to false
threadMap: An array containing all threads mapping for each bridge
telegram: Telegram thread ID. See step 13 on how to acquire itdiscord: Discord thread ID. See step 13 on how to acquire itThe available settings will occasionally change. The bot takes care of this automatically
Anything capable of running NodeJS should be able to run TediCross. People have had success running it on ordinary laptops, raspberry pis, Amazon Web Services, Google Cloud Platform, and other machines. It runs on both Linux and Windows, and probably also macOS. It does NOT, however, run on Heroku
The machine must be on for TediCross to work
Not much at all. Almost all the commands are written in the installation guide exactly as they should be entered. The only thing you need to know in addition is the cd command, in order to navigate to wherever you unpacked TediCross
node: not found when I try to run itThis likely means you are using Ubuntu or another Debian based Linux distro. You get node version 4 when you do apt-get install nodejs, and it is called nodejs instead of node.
TediCross requires node 18 or higher to run. To get node 18 on a Debian based system (in
No open issues yet, or sync has not completed.