Skip to content

Commit

Permalink
Fix navigator attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
hypergonial committed Jan 10, 2023
1 parent 8f36993 commit d8ef917
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
6 changes: 6 additions & 0 deletions docs/source/changelogs/v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ These are all the changelogs for stable releases of hikari-miru (version 2.0.0 t

----

Version 2.0.2
=============

- Fix ``Context.edit_response()`` typehints.
- Fix navigator attachments being kept between page changes.

Version 2.0.1
=============

Expand Down
2 changes: 1 addition & 1 deletion miru/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .traits import *
from .view import *

__version__ = "2.0.1"
__version__ = "2.0.2"

# MIT License
#
Expand Down
24 changes: 12 additions & 12 deletions miru/context/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,12 @@ async def edit_response(
*,
flags: t.Union[int, hikari.MessageFlag, hikari.UndefinedType] = hikari.UNDEFINED,
tts: hikari.UndefinedOr[bool] = hikari.UNDEFINED,
component: hikari.UndefinedOr[hikari.api.ComponentBuilder] = hikari.UNDEFINED,
components: hikari.UndefinedOr[t.Sequence[hikari.api.ComponentBuilder]] = hikari.UNDEFINED,
attachment: hikari.UndefinedOr[hikari.Resourceish] = hikari.UNDEFINED,
attachments: hikari.UndefinedOr[t.Sequence[hikari.Resourceish]] = hikari.UNDEFINED,
embed: hikari.UndefinedOr[hikari.Embed] = hikari.UNDEFINED,
embeds: hikari.UndefinedOr[t.Sequence[hikari.Embed]] = hikari.UNDEFINED,
component: hikari.UndefinedNoneOr[hikari.api.ComponentBuilder] = hikari.UNDEFINED,
components: hikari.UndefinedNoneOr[t.Sequence[hikari.api.ComponentBuilder]] = hikari.UNDEFINED,
attachment: hikari.UndefinedNoneOr[hikari.Resourceish] = hikari.UNDEFINED,
attachments: hikari.UndefinedNoneOr[t.Sequence[hikari.Resourceish]] = hikari.UNDEFINED,
embed: hikari.UndefinedNoneOr[hikari.Embed] = hikari.UNDEFINED,
embeds: hikari.UndefinedNoneOr[t.Sequence[hikari.Embed]] = hikari.UNDEFINED,
mentions_everyone: hikari.UndefinedOr[bool] = hikari.UNDEFINED,
user_mentions: hikari.UndefinedOr[
t.Union[hikari.SnowflakeishSequence[hikari.PartialUser], bool]
Expand All @@ -402,17 +402,17 @@ async def edit_response(
The content of the message. Anything passed here will be cast to str.
tts : undefined.UndefinedOr[bool], optional
If the message should be tts or not.
attachment : undefined.UndefinedOr[hikari.Resourceish], optional
attachment : undefined.UndefinedNoneOr[hikari.Resourceish], optional
An attachment to add to this message.
attachments : undefined.UndefinedOr[t.Sequence[hikari.Resourceish]], optional
attachments : undefined.UndefinedNoneOr[t.Sequence[hikari.Resourceish]], optional
A sequence of attachments to add to this message.
component : undefined.UndefinedOr[hikari.api.special_endpoints.ComponentBuilder], optional
component : undefined.UndefinedNoneOr[hikari.api.special_endpoints.ComponentBuilder], optional
A component to add to this message.
components : undefined.UndefinedOr[t.Sequence[hikari.api.special_endpoints.ComponentBuilder]], optional
components : undefined.UndefinedNoneOr[t.Sequence[hikari.api.special_endpoints.ComponentBuilder]], optional
A sequence of components to add to this message.
embed : undefined.UndefinedOr[hikari.Embed], optional
embed : undefined.UndefinedNoneOr[hikari.Embed], optional
An embed to add to this message.
embeds : undefined.UndefinedOr[t.Sequence[hikari.Embed]], optional
embeds : undefined.UndefinedNoneOr[t.Sequence[hikari.Embed]], optional
A sequence of embeds to add to this message.
mentions_everyone : undefined.UndefinedOr[bool], optional
If True, mentioning @everyone will be allowed.
Expand Down
2 changes: 1 addition & 1 deletion miru/ext/nav/navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ async def send_page(self, context: Context[t.Any], page_index: t.Optional[int] =

self._inter = context.interaction # Update latest inter

await context.edit_response(**payload)
await context.edit_response(**payload, attachment=None)

async def start(
self,
Expand Down

0 comments on commit d8ef917

Please sign in to comment.