mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 13:02:38 +00:00
Fix formatting
This commit is contained in:
parent
8d9d5df204
commit
2be14bc324
2 changed files with 16 additions and 9 deletions
|
@ -37,9 +37,10 @@ async def reverse(context):
|
|||
|
||||
if len(urls) > 1:
|
||||
selector = components.Selector(
|
||||
pages=[f'**Select {urls.index(url) + 1} out of {len(urls)} potential images to search:**\n{url}' for url in urls],
|
||||
buttons=[components.Select(), components.Back(), components.Forward(), components.Confirm()],
|
||||
urls=urls)
|
||||
pages=[f'**Select potential images to search: `{urls.index(url) + 1}/{len(urls)}`**\n{url}' for url in urls],
|
||||
buttons=[components.Back(), components.Forward(), components.Select(), components.Confirm()],
|
||||
urls=urls
|
||||
)
|
||||
|
||||
await selector.send(context.interaction, ephemeral=True)
|
||||
await selector.wait()
|
||||
|
@ -100,7 +101,8 @@ async def _reverse(context, urls, *, selector=None):
|
|||
selector = components.Selector(
|
||||
pages=pages,
|
||||
buttons=[components.Back(), components.Forward()],
|
||||
timeout=900)
|
||||
timeout=900
|
||||
)
|
||||
|
||||
await selector.send_edit(context.interaction)
|
||||
else:
|
||||
|
|
|
@ -11,21 +11,24 @@ class Back(nav.PrevButton):
|
|||
super().__init__(
|
||||
style=hikari.ButtonStyle.SECONDARY,
|
||||
label='⟵',
|
||||
emoji=None)
|
||||
emoji=None
|
||||
)
|
||||
|
||||
class Forward(nav.NextButton):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
style=hikari.ButtonStyle.SECONDARY,
|
||||
label='⟶',
|
||||
emoji=None)
|
||||
emoji=None
|
||||
)
|
||||
|
||||
class Confirm(nav.StopButton):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
style=hikari.ButtonStyle.PRIMARY,
|
||||
label='➤',
|
||||
emoji=None)
|
||||
emoji=None
|
||||
)
|
||||
|
||||
async def callback(self, context):
|
||||
await context.edit_response(content='**Searching...**', components=None)
|
||||
|
@ -40,7 +43,8 @@ class Select(nav.NavButton):
|
|||
super().__init__(
|
||||
style=hikari.ButtonStyle.DANGER,
|
||||
label='✗',
|
||||
emoji=None)
|
||||
emoji=None
|
||||
)
|
||||
|
||||
async def callback(self, context):
|
||||
if self.view.urls[self.view.current_page] not in self.view.selected:
|
||||
|
@ -74,7 +78,8 @@ class Selector(nav.NavigatorView):
|
|||
super().__init__(
|
||||
pages=pages,
|
||||
buttons=buttons,
|
||||
timeout=timeout)
|
||||
timeout=timeout
|
||||
)
|
||||
self.urls = urls
|
||||
self.selected = []
|
||||
self.saved = set()
|
||||
|
|
Loading…
Reference in a new issue