Z
Z
z10ax2020-09-03 23:18:17
Python
z10ax, 2020-09-03 23:18:17

How can a bot find out from whom a telegram message was forwarded?

Hello!
There is a task to get the telegram username through the forwarded message or through the username (@username) for the bot. I write in Python. I use telebot.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
moonbow, 2020-09-04
@z10ax

Hello! The user is pulled out of the
forwarded message , like (I xs syntax)? Then you can pull the name from the user , something like is used there => I don’t know the exact syntax, here is the telegram API: https://core.telegram.org/bots/api (control-effects by first_name and forward_from ) Here are the docks for telebot:forward_from.Messagefirst_name.Userfirst_name.forward_from.Message

  • https://pypi.org/project/pyTelegramBotAPI/
  • https://github.com/eternnoir/pyTelegramBotAPI

Here are good articles:
https://habr.com/ru/post/442800/ and https://habr.com/ru/post/448310/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question