From f0c6711fee80f5cb5e5b05c2e971800e2a269f69 Mon Sep 17 00:00:00 2001 From: Migatu Date: Tue, 2 Apr 2024 13:59:50 +0200 Subject: [PATCH] aaa --- bot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 3f0303b..b80b7f0 100644 --- a/bot.py +++ b/bot.py @@ -2014,10 +2014,10 @@ async def wyszukaj_linki_do_dokumentow(ctx): resultlink = [] for item in query_response.json(): logger.info(item) - resulttab.append(item["title"]) + resulttab.append(str(item["title"])) item_link = "https://sci-hub.se/" + str(item["DOI"]) resultlink.append(item_link) - for i in range(1,5): + for i in range(1, min(5,len(resulttab))): query = quote_plus(resulttab[i-1]) result_view.add_item(discord.ui.Button(label = resulttab[i-1], row = i,url=resultlink[i])) await ctx.send("This is a button!", view=result_view) # Send a message with our View class that contains the button @@ -2026,3 +2026,7 @@ async def wyszukaj_linki_do_dokumentow(ctx): # *================================== Run logger.info("Starting discord bot") client.run(TOKEN) + + +#widok - generuje się 5 stron po 4 linki +# odśwież - zamienić na "dalej" - zaciąga kolejne 20 rezultatów \ No newline at end of file