-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Telegram documentation unclear regarding chat_id #538
Comments
How did you send the commands to the bot in the channel? I just tried what you explained and got it working.
I also figured out what your issue with "Telegram Error: Chat_id is empty" was. You left the chat_ids empty, but you need to remove it. If you are e.g., using docker compose, you have to comment out the whole line. But yes, this should be improved in chat IDs handling. An empty config should be handled the same as no config. I would suggest also checking for a blank string in https://github.com/Der-Henning/tgtg/blob/main/tgtg_scanner/models/config.py#L71 @Der-Henning |
It seems I don't really understand how to start or talk to the bot in a channel. I've added the bot as a administrator in the channel, and it can successfully send messages. Then I've tried a lot of different things to start/talk to it (@BotUsername, slash command etc), but none of it is working. Thank you for the advice of inviting @ShowJsonBot to the group. I have the chat_id and have set it in the docker config. However, I only can send slash commands directly to the bot (and that's what triggered the warning-message above) - but I can not talk to it in the channel. How do I start it in the channel? Sorry for basic question, but I have googled this and could not find any anwers on how to start a bot in a channel. |
https://chatimize.com/telegram-bot-group/#What_if_your_bot_only_responds_when_someone_mentions_it
Do you mean that the slash commands still don't work even after setting the correct chat ID for the group? As mentioned before the bot correctly responded to me after doing that and did not log any warnings for new slash commands. If you still have issues after doing the fix describes in the link above, please also provide screenshots from the logs and the Telegram group. |
I think I have found the solution. It seems bots doesn't work in TG channels, only TG groups. I've created a group now, and added the bot - and now I can send commands to it. |
Oh sorry, I always misread channel with group. I didn't assume that anyone would want to do that. But if you are the only one using the bot you should just be able to have a normal chat with it. Just comment out the |
How do you get chat id in the first place. Why is this so complicated. |
If you just want to write with the bot directly, you can just send it "/getid" (without the quotes) to get the chat ID. Or you can send the bot the numbers it displays in the terminal if you don't have the "TELEGRAM_CHAT_IDS" or the chat IDs set in general. For group chats just invite the @ShowJsonBot which also shows you the chat id. |
Thanks that worked |
From the FAQ: "On the next start, the scanner will help you obtain the chat_id"
I tried to leave the chat_id empty, but I got an error: "Telegram Error: Chat_id is empty". I then created a new Telegram channel and added the bot to it as admin, then I added the channel id as chat_id - and that seems to be working. I get notifications to the channel. However, when I try to send command to the bot in the channel - nothing happens. When I send commands directly to the bot I get a warning: "Unauthorized access to _list_favorites from chat id 57xxxxx42 and user id 57xxxxx42".
If possible, please add some more instructions on how to obtain the chat_id for the bot. I've googled it, but it seems bots doesn't have a chat id. I'm confused.
The text was updated successfully, but these errors were encountered: