[Python] Trouble importing filters using Pyrogram

Discussão em 'Python' iniciado por Stack, Março 1, 2025.

  1. Stack

    Stack Membro Participativo

    I am facing this error and I do not know how to solve it and I think I have written my code correctly

    File "C:\Users\Revenger\index.py", line 1, in <module>
    from pyrogram import Client, Filters
    ImportError: cannot import name 'Filters' from 'pyrogram' (C:\Users\Revenger\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pyrogram\__init__.py)


    This is my Code

    from pyrogram import Client, filters
    from pyrogram.methods.chats.get_chat_members import Filters

    app = Client("Client", bot_token="Token")

    @app.on_message(Filters.private & Filters.command('start'))
    def startmsg(client, message):
    message.reply("Hi Wassimo Bot is Here")


    app.run() #"long-polling"

    Continue reading...

Compartilhe esta Página