diff --git a/docs/source/changelogs/v3.rst b/docs/source/changelogs/v3.rst index 0ba3027e..05d93a1c 100644 --- a/docs/source/changelogs/v3.rst +++ b/docs/source/changelogs/v3.rst @@ -4,6 +4,13 @@ Versions 3.0+ Changelog These are all the changelogs for stable releases of hikari-miru (version 3.0.0 to present). +Version 3.2.0 +============= + +- Add the ability to pass ``miru.Context`` to ``miru.ext.nav.NavigatorView.send()`` instead of an interaction or channel. +- Added ``miru.ext.nav.Page`` to represent a page with a complex payload. +- Updated ``miru.ext.nav.NavigatorView()`` and ``miru.ext.nav.NavigatorView.swap_pages()`` to accept ``miru.ext.nav.Page`` instances. + Version 3.1.3 ============= diff --git a/miru/__init__.py b/miru/__init__.py index 520bb41e..74594104 100644 --- a/miru/__init__.py +++ b/miru/__init__.py @@ -50,7 +50,7 @@ "get_view", ) -__version__ = "3.1.3" +__version__ = "3.2.0" # MIT License # diff --git a/miru/ext/nav/navigator.py b/miru/ext/nav/navigator.py index e6c555c5..c1406dd4 100644 --- a/miru/ext/nav/navigator.py +++ b/miru/ext/nav/navigator.py @@ -8,7 +8,7 @@ import hikari from miru.abc import Item -from miru.context import Context, ViewContext +from miru.context import Context from miru.view import View from .items import FirstButton, IndicatorButton, LastButton, NavButton, NavItem, NextButton, PrevButton @@ -267,7 +267,7 @@ async def start( async def send( self, - to: t.Union[hikari.SnowflakeishOr[hikari.TextableChannel], hikari.MessageResponseMixin[t.Any], ViewContext], + to: t.Union[hikari.SnowflakeishOr[hikari.TextableChannel], hikari.MessageResponseMixin[t.Any], Context[t.Any]], *, start_at: int = 0, ephemeral: bool = False, @@ -277,7 +277,7 @@ async def send( Parameters ---------- - to : Union[hikari.SnowflakeishOr[hikari.PartialChannel], hikari.MessageResponseMixin[Any], miru.ViewContext] + to : Union[hikari.SnowflakeishOr[hikari.PartialChannel], hikari.MessageResponseMixin[Any], miru.Context] The channel, interaction, or miru context to send the navigator to. start_at : int If provided, the page number to start the pagination at. @@ -288,7 +288,7 @@ async def send( If an interaction was provided, determines if the interaction was previously acknowledged or not. This is ignored if a channel or context was provided. """ - self._ephemeral = ephemeral if isinstance(to, (hikari.MessageResponseMixin, ViewContext)) else False + self._ephemeral = ephemeral if isinstance(to, (hikari.MessageResponseMixin, Context)) else False for item in self.children: if isinstance(item, NavItem): @@ -304,7 +304,7 @@ async def send( if isinstance(to, (int, hikari.TextableChannel)): channel = hikari.Snowflake(to) message = await self.app.rest.create_message(channel, **payload) - elif isinstance(to, ViewContext): + elif isinstance(to, Context): self._inter = to.interaction resp = await to.respond(**payload) message = await resp.retrieve_message()