Sign inSign up

mainmethod/intergram

By mainmethod

•Updated about 6 years ago

Integrate a Live Chat on your website with Telegram

Image
1

874

mainmethod/intergram repository overview

⁠Description

Docker Image for integrating self hosted Live Chat on your website with Telegram. Credits go to https://github.com/idoco/intergram⁠

⁠Preconditions

  1. You have your own infrastructure where you are able to deploy docker containers.
  2. You are able to set up DNS records
  3. You have a Telegram account

⁠Usage

  1. Use the @BotFather⁠ to create your new bot.
  2. Create your new bot by typing /newbot and run through the bot setup process. You will get an HTTP API Token. Save that for later.
  3. Use the HTTP API Token you got from the Bot setup process as environment variable TELEGRAM_TOKEN and run this docker command on your infrastructure docker run -d -p 80:3000 -e TELEGRAM_TOKEN="YOUR_TOKEN" mainmethod/intergram. Alternatively you can use docker-compose (see below) or any other container orchestration, which supports Docker.
  4. Open a shell and run the following command. Replace <YOUR_TOKEN> with the HTTP API Token you got from @BotFather⁠ and <YOUR_SERVER_URL> with the URL under which you will run this Docker Image. Run curl "https://api.telegram.org/bot<YOUR_TOKEN>/setWebhook?url=<YOUR_SERVER_URL>/hook"
  5. Open a Telegram chat with your newly created bot and type /start. You will get a chat id.
  6. Add the following code to the <body> of your website. Replace <CHAT_ID> with the chat id you got from your bot. Replace <YOUR_SERVER_URL> with the URL under which you will run this Docker Image.
<script> 
 window.intergramId = "<CHAT_ID>";
 window.intergramServer = "<YOUR_SERVER_URL>";
</script>
<script id="intergram" type="text/javascript" src="<YOUR_SERVER_URL>/js/widget.js"></script>
  1. Done!

⁠Docker Compose

If you want to use docker-compose instead of a simple docker run, you can use it this way. Replace <YOUR_TOKEN> with the HTTP API Token you got from @BotFather⁠:

version: "3.1"
services:
  intergram:
    image: mainmethod/intergram
    ports:
      - "80:3000"
    environment:
      - TELEGRAM_TOKEN=<YOUR_TOKEN>
    restart: unless-stopped

Tag summary

Content type

Image

Digest

Size

83.5 MB

Last updated

about 6 years ago

docker pull mainmethod/intergram