This commit is contained in:
2024-04-01 20:58:16 +02:00
parent 444a208231
commit face9aef80
+9 -5
View File
@@ -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