mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Dodana procedura asynchronicznej generacji iteratora oraz komentarz w
jaki sposob inaczej przerobic fora na asynchroniczny. Przydatne ze wzgledu na to ze szukajka nadal blokuje heartbeat bota - co skutkuje warningnami i wyjatkami
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user