Skip to content

Commit

Permalink
Update changelog, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
hypergonial committed Sep 6, 2023
1 parent ab591e6 commit e6a1ca6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions docs/source/changelogs/v3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=============

Expand Down
2 changes: 1 addition & 1 deletion miru/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"get_view",
)

__version__ = "3.1.3"
__version__ = "3.2.0"

# MIT License
#
Expand Down
10 changes: 5 additions & 5 deletions miru/ext/nav/navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand All @@ -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):
Expand All @@ -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()
Expand Down

0 comments on commit e6a1ca6

Please sign in to comment.