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) @tasks.loop(seconds=3)
# trunk-ignore(pylint/R0915) # trunk-ignore(pylint/R0915)
async def check_data_q(): async def check_data_q():
channel = client.get_channel(1062047367337095268)
try: try:
data = IN_COMM_Q.get(block=False) data = IN_COMM_Q.get(block=False)
if data.finished: if data.stop:
await channel.send(f"O. A tak będzie wyglądało coś ciekawego w przyszłości: {data}") 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: except Empty:
pass pass
+1
View File
@@ -25,6 +25,7 @@ def answer_external_command():
break break
if q_data.uuid in record: if q_data.uuid in record:
q_data.stop = True q_data.stop = True
q_data.entries = record
IN_COMM_Q.put(q_data) IN_COMM_Q.put(q_data)
return jsonify("SUCCESS") return jsonify("SUCCESS")