Communication work progress

FX

aa

Maybe wrong

Another step forward.

STOP!
This commit is contained in:
2024-04-10 16:27:45 +02:00
committed by migatu
parent 019e02a186
commit abb2f05798
2 changed files with 25 additions and 3 deletions
+24 -3
View File
@@ -682,11 +682,32 @@ async def check_music():
@tasks.loop(seconds=3)
# trunk-ignore(pylint/R0915)
async def check_data_q():
channel = client.get_channel(1062047367337095268)
try:
data = IN_COMM_Q.get(block=False)
if data.finished:
await channel.send(f"O. A tak będzie wyglądało coś ciekawego w przyszłości: {data}")
if data.stop:
searcher = data.author
ctx = data.ctx
query = data.content
entries = data.replies
message = '*Z podłogi wysuwa się winda na książki*'
message += f' Dzielny poszukiwaczu {searcher} w odpowiedzi na twoje zapytanie {query}'
message += 'nasza biblioteka służy Ci odpowiedzią. Przy dźwięku fanfar winda się otwiera a w środku '
if len(entries)<1:
message += "niestety nie ma nic"
elif len(entries)>1 and len(entries)<5:
message += " znajduje się coś:\n"
for item in entries:
message+=str(item["DOI"])
else:
message+= " znajduje się cholernie dużo:\n"
for item in entries:
message+=str(item["DOI"])
if len(message) > 1500:
await ctx.send(message)
message = ""
await ctx.send(message)
#await ctx.send(f"O. A tak będzie wyglądało coś ciekawego w przyszłości: {data}")
except Empty:
pass