Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The bot does not call message handlers #58

Open
3 tasks done
R1senDev opened this issue Mar 25, 2024 · 0 comments
Open
3 tasks done

The bot does not call message handlers #58

R1senDev opened this issue Mar 25, 2024 · 0 comments

Comments

@R1senDev
Copy link

R1senDev commented Mar 25, 2024

Checklist

  • I am sure the error is coming from Pyrofork's code and not elsewhere
  • I have searched in the issue tracker for similar bug reports, including closed ones
  • I ran pip3 install -U git+https://github.com/Mayuri-Chan/pyrofork and reproduced the issue using the latest development version

Description

Nothing happens when sending a message to the bot in the example below.

Steps to reproduce

  1. Try to write an echo bot;
  2. ..enjoy.

Code example

from pyrogram.filters import text
from pyrogram.client  import Client
from tomllib          import load


with open('auth.toml', 'rb') as file: auth_data = load(file)


app = Client(
    name      = auth_data['api']['name'],
    api_id    = auth_data['api']['id'],
    api_hash  = auth_data['api']['hash'],
    bot_token = auth_data['api']['token']
)


@app.on_message()
async def on_text(_, msg):
    print(msg.text)
    await app.send_message(
        chat_id = msg.chat.id,
        text = 'Ping!'
    )


print('Starting..')
app.run()

Logs

Starting..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant