Skip to content

Commit

Permalink
Now compatible with miru v4
Browse files Browse the repository at this point in the history
  • Loading branch information
PieTw3lve committed Jul 21, 2024
1 parent 0bfe82f commit 1c254f1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/extensions/general/shop.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async def no(self, button: miru.Button, ctx: miru.ViewContext):

class ChecksView(nav.NavigatorView):
def __init__(self, inventory: Inventory, pages, buttons, timeout, autodefer: bool = True) -> None:
super().__init__(pages=pages, buttons=buttons, timeout=timeout, autodefer=autodefer)
super().__init__(pages=pages, items=buttons, timeout=timeout, autodefer=autodefer)
self.inventory = inventory

async def view_check(self, ctx: miru.ViewContext) -> bool:
Expand Down Expand Up @@ -147,8 +147,10 @@ async def customize(ctx: lightbulb.Context) -> None:
pages = inventory.get_pages(items, 10)
buttons = [NavShopSelectView(inventory, items, 10, row=1), nav.PrevButton(emoji='⬅️', row=2), NavPageInfo(len(pages), row=2), nav.NextButton(emoji='➡️', row=2)]
navigator = ChecksView(inventory, pages, buttons, timeout=None)

await navigator.send(ctx.interaction)
client = ctx.bot.d.get('client')
builder = await navigator.build_response_async(client=client, ephemeral=True)
await builder.create_initial_response(ctx.interaction)
client.start_view(navigator)

def load(bot):
bot.add_plugin(plugin)

0 comments on commit 1c254f1

Please sign in to comment.