How to get sent message id by telegram bot | Как узнать ID отправленного сообщения телеграм бот

Аватар автора
Секреты Продуктивного Творчества
2:22 - получение ID [getting Id] ВНИМАНИЕ. В примере используется библиотека aiogram, но такой способ (найти айди сообщения в атрибуте класса, возвращаемого функцией отправки) есть, пожалуй, в каждой популярной библиотеке (pyTelegramBotAPI, к примеру) #bot bot.py: import logging import json from aiogram import Bot, Dispatcher, executor, types import time API_TOKEN = '' with open(&&as token_file: API_TOKEN = json.load(token_file)["token"] logging.basicConfig(level=logging.INFO) bot = Bot(token=API_TOKEN) dp = Dispatcher(bot) if message.text == "/start": message_obj = await bot.send_message(chat_id=message.from_user.id, text=&message') message_obj_sec = await bot.send_message(chat_id=message.from_user.id, text='counter') await animate(message, [message_obj, message_obj_sec]) async def animate(message, args): text_fst_state = """░░░░░▄▄▀▀▀▀▀▀▀▀▀▄▄░░░░░ ░░░░█░░░░░░░░░░░░░█░░░░ ░░░█░░░░░░░░░░▄▄▄░░█░░░ ░░░█░░▄▄▄░░▄░░███░░█░░░ ░░░▄█░▄░░░▀▀▀░░░▄░█▄░░░ ░░░█░░▀█▀█▀█▀█▀█▀░░█░░░ ░░░▄██▄▄▀▀▀▀▀▀▀▄▄██▄░░░ ░▄█░█▀▀█▀▀▀█▀▀▀█▀▀█░█▄░""" text_snd_state = """░░░░░▄▄▀▀▀▀▀▀▀▀▀▄▄░░░░░ ░░░░█░░░░░░░░░░░░░█░░░░ ░░░█░░▄▄▄░░░░░▄▄▄░░█░░░ ░░░█░░███░░▄░░███░░█░░░ ░░░▄█░▄░░░▀▀▀░░░▄░█▄░░░ ░░░█░░▀█▀█▀█▀█▀█▀░░█░░░ ░░░▄██▄▄▀▀▀▀▀▀▀▄▄██▄░░░ ░▄█░█▀▀█▀▀▀█▀▀▀█▀▀█░█▄░""" text_thrd_state = """░░░░░▄▄▀▀▀▀▀▀▀▀▀▄▄░░░░░ ░░░░█░░░░░░░░░░░░░█░░░░ ░░░█░░▄▄▄░░░░░░░░░░█░░░ ░░░█░░███░░▄░░▄▄▄░░█░░░ ░░░▄█░▄░░░▀▀▀░░░▄░█▄░░░ ░░░█░░▀█▀█▀█▀█▀█▀░░█░░░ ░░░▄██▄▄▀▀▀▀▀▀▀▄▄██▄░░░...

0/0


0/0

0/0

0/0