1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-11-01 13:02:38 +00:00

Fix formatting

This commit is contained in:
Myned 2022-02-21 13:41:01 -06:00
parent 8d9d5df204
commit 2be14bc324
No known key found for this signature in database
GPG key ID: 33790F979F7A28B8
2 changed files with 16 additions and 9 deletions

View file

@ -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:

View file

@ -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()