#Wait for View to Stop and New Messages at the same time

1 messages · Page 1 of 1 (latest)

unkempt briar
#

This is a very theoretical question - I would like to wait for both a view to be stopped or a new message in the channel. I know how to do both separately (await view.wait() and await client.wait_for('message')), but I was wondering if I could do both at once.

The goal is to check for both a view to stop and a message to be sent, whichever comes first. Based on which one it identifies, the bot should respond differently. Is this possible? And if not, is there a hack to make this possible? Thank You so much!

unkempt briar
#

from what I understood of asyncio.gather, it seems to wait until all tasks are completed before "returning". like I mentioned, is it possible to use whichever one returns first, and ignore the second one?

frosty fractal
#

Although it's pending to be removed

#

I supposed threads could also be an option, but may be tad too complicated if there is something in the asyncio library that we are missing

unkempt briar
summer ice
summer ice
summer ice
#

But im not 100% sure how the docs mean that

frosty fractal
#

sure ig?

summer ice
#

yea everything else would be weird because there is no method that provides the same funktionality as wait

#

will see

frosty fractal
#

you can always downgrade tbh