mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-17 23:32:10 +00:00
as
This commit is contained in:
@@ -1969,15 +1969,22 @@ class DoSearchView(discord.ui.View):
|
|||||||
def __init__(self,*args, **kwargs) -> None:
|
def __init__(self,*args, **kwargs) -> None:
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.row1 = "Test"
|
self.row1 = "Test"
|
||||||
@discord.ui.button(label="Sprawdz czy istnieje", style=discord.ButtonStyle.danger, row=0)
|
@discord.ui.button(label="Nastepna strona", style=discord.ButtonStyle.primary, row=0)
|
||||||
async def button1_callback(self, interaction, button):
|
async def next_callback(self, interaction, button):
|
||||||
#emoji = await ctx.guild.fetch_emoji(id)
|
#emoji = await ctx.guild.fetch_emoji(id)
|
||||||
#button.emoji=1102174413887111189
|
#button.emoji=1102174413887111189
|
||||||
logger.info("Pressed")
|
logger.info("Pressed")
|
||||||
await interaction.response.edit_message(content = "You clicked the button!") # Send a message when the button is clicked
|
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)
|
@discord.ui.button(label="Odśwież wyszukanie", style=discord.ButtonStyle.danger, row=0)
|
||||||
async def button2_callback(self, interaction, button):
|
async def reset_callback(self, interaction, button):
|
||||||
|
#emoji = await ctx.guild.fetch_emoji(id)
|
||||||
|
#button.emoji=1102174413887111189
|
||||||
|
logger.info("Pressed")
|
||||||
|
await interaction.response.edit_message(content = "You clicked the button!") # Send a message when the button is clicked
|
||||||
|
|
||||||
|
@discord.ui.button(label="Poprzednia Strona", style=discord.ButtonStyle.primary, row=0)
|
||||||
|
async def perv_callback(self, interaction, button):
|
||||||
#emoji = await ctx.guild.fetch_emoji(id)
|
#emoji = await ctx.guild.fetch_emoji(id)
|
||||||
#button.emoji=1102174413887111189
|
#button.emoji=1102174413887111189
|
||||||
logger.info("Pressed")
|
logger.info("Pressed")
|
||||||
@@ -2001,12 +2008,12 @@ async def wyszukaj_linki_do_dokumentow(ctx):
|
|||||||
#5 przyciski przy każdym wierszu pozwalają sprawdzić czy plik istnieje na scihubie - jeśli tak podaje link do sciagniecia
|
#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)
|
#6 ostatni wiersz to dalej, wróć, skasuj, zaciagnij kolejne wyniki (jeśli jest ich więcej niż 1000)
|
||||||
result_view = DoSearchView()
|
result_view = DoSearchView()
|
||||||
resulttab = ["r1", "r2", "r3", "r4", "r5"]
|
resulttab = ["r1", "r2", "r3", "r4", "r5", "r6"]
|
||||||
|
|
||||||
for i in range(0,5):
|
for i in range(1,7):
|
||||||
query = quote_plus(resulttab[i])
|
query = quote_plus(resulttab[i])
|
||||||
url = f'https://www.google.com/search?q={query}'
|
url = f'https://www.google.com/search?q={query}'
|
||||||
result_view.add_item(discord.ui.Button(label = resulttab[i], row = i,url=url))
|
result_view.add_item(discord.ui.Button(label = resulttab[i-1], 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
|
await ctx.send("This is a button!", view=result_view) # Send a message with our View class that contains the button
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user