Giter Site home page Giter Site logo

heimdall's Introduction

Heimdall

Heimdall is a bot which bridges a chat in Telegram with a channel in Discord.

There is no public Heimdall bot. You need to host it yourself. To host a bot, you need nodejs. The bot requires NodeJS 8 or higher

Step by step installation:

  1. Install latest Nodejs and NPM. sudo apt-get update

    apt-get install build-essential libssl-dev

    curl https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

    source ~/.profile

    nvm install 10

    npm install -g npm

  2. Clone this repo. git clone https://github.com/HodlerCompany/Heimdall

  3. Open a terminal and enter the repo with the cd command. Something like cd Downloads/Heimdall. Your exact command may differ.

  4. Run the command npm install

  5. Make a copy of the file example.settings.yaml and name it settings.yaml

  6. Aquire a bot token for Telegram (How to create a Telegram bot) and put it in the settings file

  • The Telegram bot must be able to access all messages. Talk to @BotFather to disable privacy mode for the bot
  • Do NOT use another bot you already have running. That will cause all sorts of weird problems. Make a new one
  1. Aquire a bot token for Discord (How to create a Discord bot) 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 "App bot user" further down the page
  • Do NOT use another bot you already have running. That will cause all sorts of weird problems. Make a new one.
  1. Add the Telegram bot to the Telegram chat
  • If the Telegram chat is a supergroup, the bot also needs to be admin of the group, or it won't get the messages. The creator of the supergroup is able to give it admin rights.
  1. Add the Discord bot to the Discord server (https://discordapp.com/oauth2/authorize?client_id=YOUR_CLIENT_ID_HERE&scope=bot&permissions=248832). This requires that you have admin rights on the server.

  2. Start Heimdall: npm start

  3. Ask the bots for the remaining details. In the Telegram chat and the Discord channel, write /chatinfo. Put the info you get in the settings file.

  • If you want to bridge a Telegram group or channel, remember that the ID is negative. Include the - when entering it into the settings file
  • It is important that the Discord IDs are wrapped with single quotes when entered into the settings file. '244791815503347712', not 244791815503347712
  1. Restart Heimdall. You stop it by pressing CTRL + C in the terminal it is running in

Done! You now have a nice bridge between a Telegram chat and a Discord channel


FAQ

What kind of machine do I need to run this?

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 Heimdall to work

When running npm install, it complains about missing dependencies?

The Discord library Heimdall is using has support for audio channels and voice chat. For this, it needs some additional libraries, like node-opus, libsodium and others. Heimdall does not do audio, so these warnings can safely be ignored

How do I create more bridges?

Heimdall supports a theoretically infinite number of bridges, limited only by your hardware. Even a simple Raspberry Pi is powerful enough to run multiple bridges, so don't worry about making more

To make more bridges, just copy the one you have, paste it right below and make necessary changes:

...
bridges:
  - name: Default bridge
    direction: both
    telegram:
      ...
    discord:
      ...
  - name: Another bridge
    direction: both
    telegram:
      ...
    discord:
      ...
...

The names of the bridges are practically only log identifiers. They can be whatever string you want them to be. Note, however, that the setting discord.skipOldMessages uses the names to know which messages was last sent from which channel, so they should be unique.

Note that the settings file is indentation sensitive. If you do for example

  - name: Bridge 1
      direction: both

it won't work. The "d" in "direction" must be directly below the "n" in "name". See example.settings.yaml for proper indentation

How do I make the bot run automatically when my computer/server starts?

Take a look in guides/autostart/ of this repo

How do I update Heimdall?

If you cloned the git repo, just do a git pull. Running npm install may or may not be necessary. It doesn't hurt to run it anyway


This repo has been forked from TediCross.

https://github.com/TediCross/TediCross

Cryptocoins of the following types are accepted for donation:

  • BTC: 1Gzr9ZyvTiFCPKfy2BshuZgUeFLebAfbFU
  • ETH: 0x9449D54C85C8FdB079e74379d93A9C9fe611981A

heimdall's People

Contributors

suppen avatar trgwii avatar molteber avatar nayiemwillems avatar perryyan avatar chilace avatar coxxs avatar robotgryphon avatar

Watchers

James Cloos avatar seatrips avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.