how to read/receive telegram channel messages in my telegram bot?
Asked Answered
D

1

6

i'm trying to create a bot which can read/receive all messages in a specific channel and send them to me . my problem here is that i can't find a way to access those messages in my bot

important thing is:

  1. i'm not admin or creator of that channel
  2. i don't want to ask the creator to add my bot as administrator

i've searched in google but i wasn't able to find a solution and i'm also sure that it is possible to do it, because there are already some junction bots with exact same performance . any references or suggestions are appreciated .

Donte answered 9/8, 2021 at 9:9 Comment(2)
All bots, regardless of settings, will receive all messages from channels where they are a member. See hereRenaud
See this answer for how to read channel past messages using a user account.Anthropology
D
4

As already pointed out in the Telegram group of python-telegram-bot, bots can't receive messages from channels where they are not an admin. If you want something like this, you'll have to use a user bot, e.g. a program that controls your private Telegram account (in contrast to controlling a bot account). See here for some info on user bots.

Note that also the provider that you linked seems to be using userbots behind the scenes. More precisely, the docs on the so called "DirectConnection" state that you need to enter a phone number (associated to a telegram account) and then "Follow the instructions" which probably just means to enter the verification code that Telegram sends you. Phone number + verification code is exactly what is needed to control your private Telegram account.


Disclaimer: I'm currently the maintainer of python-telegram-bot.

Dhar answered 9/8, 2021 at 10:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.