Код: Выделить всё
bot = Bot(token=TOKEN)
dp = Dispatcher()
chat_ids = []
async def check_if_bot_is_admin(chat_id):
member = await bot.get_chat_member(chat_id, bot.id)
resp = member.status
return resp
@dp.message(F.photo)
async def handle_photo(message: types.Message):
for group_id in chat_ids:
is_admin = await check_if_bot_is_admin(group_id)
if message.chat.type == 'private' and is_admin:
await message.copy_to(chat_id=group_id)
async def main():
await dp.start_polling(bot)
Моя цель создания этого бота — убедиться, что после отправки любого изображения в качестве личного сообщения боту он отправляет изображение всем группам, администратором которых он является.
Подробнее здесь: https://stackoverflow.com/questions/790 ... ng-aiogram
Мобильная версия