diff --git a/bot.py b/bot.py index 063ba69..b98398f 100644 --- a/bot.py +++ b/bot.py @@ -579,7 +579,22 @@ async def get_file(ctx, source, link): ) logger.error("Wrong link provided youtube: {}".format(link)) return "", None + +# define an asynchronous generator +async def async_iterator_generator(range): + # normal loop + for i in range: + # yield the result + yield i +''' Alternatywna wersja przerobienia fora na asynchroniczny +# traverse the iterable of awaitables +for item in coros: + # await and get the result from the awaitable + result = await item + # report the results + print(result) +''' async def wyszukaj(ctx, how_many=0): # TODO: Potem dorobić wyszukiwania po kawałkach słów i sieć neuronową z możliwością wyrażenia opinii o dopasowaniu.