[Python] I don't know how to get_chat_members_count with aiogram

Discussão em 'Python' iniciado por Stack, Novembro 30, 2024.

  1. Stack

    Stack Membro Participativo

    I am writing a bot and I can't find a clear answer to how to get number of members in the group and when a user writes /count in the bot, he would get the number of participants in the group.

    tell me pls what's wrong. Here is the code I made:

    from aiogram import Bot
    from aiogram import types
    from aiogram.dispatcher import Dispatcher
    from aiogram.utils import executor

    from config import token

    bot = Bot(token=token)
    dp = Dispatcher(bot)

    @dp.message_handler(commands=['count'])
    async def getCountMembers(message: types.Message):
    await bot.get_chat_members_count(-1001519650013)


    executor.start_polling(dp, skip_updates=True)

    Continue reading...

Compartilhe esta Página