dgongut/docker-controller-bot

Chat not found

Closed this issue · 2 comments

Recently spun this up, getting the following error whenever it tries to send a notification:

*container_name*. Error: [A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: chat not found]

I've created the bot in telegram, created a new user for the bot (let's say it's called 'mycontainer_bot') and created a channel for it to post to with admin rights.

Below is my compose which connects to a default bridge network:

services:
    docker-controller-bot:
        environment:
            - TELEGRAM_TOKEN=6994952784:AAFPYCpHoDTuh69D1Pb1IpVXQCp5eeAMGoU #not my actual token
            - TELEGRAM_ADMIN=mycontainer_bot
            - CONTAINER_NAME=docker-controller-bot
            - TZ=$TZ
            #- TELEGRAM_GROUP=
            #- TELEGRAM_THREAD=1
            #- TELEGRAM_NOTIFICATION_CHANNEL=
            #- CHECK_UPDATES=1
            #- CHECK_UPDATE_EVERY_HOURS=4
            #- BUTTON_COLUMNS=2
            - LANGUAGE=EN
            #- EXTENDED_MESSAGES=0
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock # NO CAMBIAR
            - ./schedule:/app/schedule # CAMBIAR LA PARTE IZQUIERDA
        image: dgongut/docker-controller-bot:latest
        container_name: docker-controller-bot
        restart: unless-stopped
        tty: true

Is there anything I've done wrong/haven't done?

Thanks!

Hey!

There are several things to note here.

Firstly, TELEGRAM_ADMIN variable is not the bot's user (xxxx_bot), it is your CHAT_ID (the administrator user number for example 62625184). You can obtain that for example sending /id to @MissRose_bot.

Secondly, it is not possible to control the bot from a channel, only in a private conversation with the bot (talking in your example with (@mycontainer_bot) or in a group. To control it in a group you can fill also TELEGRAM_GROUP variable with the group's number chatID. Again there are some options to obtain it. Even if it is a supergroup with its threads inside, you can indicate in which of the threads the bot will write using TELEGRAM_THREAD variable.

The functionality that exists for the channels with TELEGRAM_NOTIFICATION_CHANNEL is not for control it, it's just for notifications. It is very rare that this functionality is used, it was requested by some people.

If you have any further questions, just ask me 👌🏻 I obviously leave this open until you solve it.

Regards

Thanks for the quick reply!

Got it, the admin isn't the bot, it's actually me as a telegram user. Makes sense. Understood about channels, tbh I'm not particularly well versed with Telegram so when I saw it was possible to make the bot an admin there I thought maybe that's what I was missing.

Either way this is now resolved, thanks for your help!