From face9aef8076934d53b355c324ad4dfba50926d3 Mon Sep 17 00:00:00 2001 From: Migatu Date: Mon, 1 Apr 2024 20:58:16 +0200 Subject: [PATCH] qq --- bot.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index 94f7bd8..1fe16b0 100644 --- a/bot.py +++ b/bot.py @@ -18,6 +18,7 @@ import re import shutil import sys import uuid +from urllib.parse import quote_plus from datetime import datetime from logging import handlers from pathlib import Path, PurePath @@ -1973,8 +1974,6 @@ class DoSearchView(discord.ui.View): #emoji = await ctx.guild.fetch_emoji(id) #button.emoji=1102174413887111189 logger.info("Pressed") - logger.info(button) - logger.info(interaction) await interaction.response.edit_message(content = "You clicked the button!") # Send a message when the button is clicked @discord.ui.button(label="Sprawdz czy istnieje", style=discord.ButtonStyle.danger, row=1) @@ -1982,8 +1981,6 @@ class DoSearchView(discord.ui.View): #emoji = await ctx.guild.fetch_emoji(id) #button.emoji=1102174413887111189 logger.info("Pressed") - logger.info(button) - logger.info(interaction) await interaction.response.edit_message(content = "You clicked the button!") # Send a message when the button is clicked @@ -2003,7 +2000,14 @@ async def wyszukaj_linki_do_dokumentow(ctx): #4 zwroc 5 wyników 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) - await ctx.send("This is a button!", view=DoSearchView()) # Send a message with our View class that contains the button + result_view = DoSearchView() + resulttab = ["r1", "r2", "r3", "r4", "r5"] + + for i in range(0,4): + query = quote_plus(resulttab[i]) + url = f'https://www.google.com/search?q={query}' + result_view.add_item(discord.ui.Button(label = resulttab[i], row = i),url=url) + await ctx.send("This is a button!", view=result_view) # Send a message with our View class that contains the button # *================================== Run