-
-
Notifications
You must be signed in to change notification settings - Fork 806
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
Can't use message.answer
within asyncio.gather
#1467
Labels
bug
Something is wrong with the framework
Comments
Workaroundtasks = [
asyncio.create_task(message.answer("Hi")),
asyncio.create_task(state.clear()),
]
await asyncio.gather(*tasks) |
I get the same error message when running: async with asyncio.TaskGroup() as tg:
tg.create_task(message.answer("Hi!")) Although the below works fine: await asyncio.create_task(message.answer("Hi!")) |
Doesn't work for me: await asyncio.create_task(message.answer("Hi!")) The error:
The above mentioned workaround with
UPD: async def send_message(text: str, message: Message):
await message.answer(text)
...
await asyncio.create_task(send_message("hi", message)) UPD 2: await asyncio.create_task(message.answer("Hi!").emit(message.bot)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist
Operating system
Latest Ubuntu
Python version
3.12.3
aiogram version
latest
Expected behavior
Current behavior
Steps to reproduce
Code example
Logs
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: