mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Viwe fix
This commit is contained in:
@@ -1965,9 +1965,10 @@ async def parametry_muzyki_mego_ludu(
|
||||
logger.info(exce)
|
||||
|
||||
class DoSearchView(discord.ui.View):
|
||||
def __init__(self,*args, **kwargs) -> None:
|
||||
def __init__(self, uuid, result_list, *args, **kwargs) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
self.row1 = "Test"
|
||||
self.uuid = uuid
|
||||
self.result_list = result_list
|
||||
@discord.ui.button(label="Nastepna strona", style=discord.ButtonStyle.primary, row=0)
|
||||
async def next_callback(self, interaction, button):
|
||||
#emoji = await ctx.guild.fetch_emoji(id)
|
||||
@@ -2008,11 +2009,13 @@ async def wyszukaj_linki_do_dokumentow(ctx):
|
||||
#4 zwroc 4 wyniki od librariana
|
||||
#5 przyciski przy każdym wierszu pozwalają sprawdzić czy plik istnieje na scihubie - jeśli tak podaje link do sciagniecia
|
||||
#6 ostatni wiersz to dalej, wróć, skasuj, zaciagnij kolejne wyniki (jeśli jest ich więcej niż 1000)
|
||||
result_view = DoSearchView()
|
||||
result_view = DoSearchView(uuid=str(query_uuid), result_list=query_response.json(["data"]))
|
||||
resulttab = []
|
||||
resultlink = []
|
||||
logger.info(query_response.json())
|
||||
for item in query_response.json()["data"]:
|
||||
hit, fetched, total, uuid_chk = query_response.json()["data"][0]
|
||||
answer = query_response.json()["data"][1]
|
||||
|
||||
for item in answer:
|
||||
resulttab.append(str(item["title"]))
|
||||
item_link = "https://sci-hub.se/" + str(item["DOI"])
|
||||
resultlink.append(item_link)
|
||||
@@ -2025,9 +2028,9 @@ async def wyszukaj_linki_do_dokumentow(ctx):
|
||||
logger.info(url)
|
||||
temp_label = str(resulttab[i])
|
||||
temp_label = temp_label.strip("[']")
|
||||
result_view.add_item(discord.ui.Button(label = str(temp_label[0:79], row = i+1,url=url)))
|
||||
result_view.add_item(discord.ui.Button(label = str(temp_label[0:79]), row = i+1,url=url))
|
||||
|
||||
labelka = "Wyniki wyszukiwania dla: " + str(query)[30:] # ile znaleziono artykułów w ogóle, ile zostało po refine
|
||||
labelka = "Wyniki wyszukiwania dla: " + str(query)[30:] + f'\nWszystkich {total} sprawdzonych: {fetched} znalezionych: {hit} '# ile znaleziono artykułów w ogóle, ile zostało po refine
|
||||
await ctx.send(labelka, view=result_view) # Send a message with our View class that contains the button
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user