Skip to content

Commit d8ef917

Browse files
committed
Fix navigator attachments
1 parent 8f36993 commit d8ef917

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

docs/source/changelogs/v2.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ These are all the changelogs for stable releases of hikari-miru (version 2.0.0 t
66

77
----
88

9+
Version 2.0.2
10+
=============
11+
12+
- Fix ``Context.edit_response()`` typehints.
13+
- Fix navigator attachments being kept between page changes.
14+
915
Version 2.0.1
1016
=============
1117

miru/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .traits import *
1010
from .view import *
1111

12-
__version__ = "2.0.1"
12+
__version__ = "2.0.2"
1313

1414
# MIT License
1515
#

miru/context/base.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,12 @@ async def edit_response(
379379
*,
380380
flags: t.Union[int, hikari.MessageFlag, hikari.UndefinedType] = hikari.UNDEFINED,
381381
tts: hikari.UndefinedOr[bool] = hikari.UNDEFINED,
382-
component: hikari.UndefinedOr[hikari.api.ComponentBuilder] = hikari.UNDEFINED,
383-
components: hikari.UndefinedOr[t.Sequence[hikari.api.ComponentBuilder]] = hikari.UNDEFINED,
384-
attachment: hikari.UndefinedOr[hikari.Resourceish] = hikari.UNDEFINED,
385-
attachments: hikari.UndefinedOr[t.Sequence[hikari.Resourceish]] = hikari.UNDEFINED,
386-
embed: hikari.UndefinedOr[hikari.Embed] = hikari.UNDEFINED,
387-
embeds: hikari.UndefinedOr[t.Sequence[hikari.Embed]] = hikari.UNDEFINED,
382+
component: hikari.UndefinedNoneOr[hikari.api.ComponentBuilder] = hikari.UNDEFINED,
383+
components: hikari.UndefinedNoneOr[t.Sequence[hikari.api.ComponentBuilder]] = hikari.UNDEFINED,
384+
attachment: hikari.UndefinedNoneOr[hikari.Resourceish] = hikari.UNDEFINED,
385+
attachments: hikari.UndefinedNoneOr[t.Sequence[hikari.Resourceish]] = hikari.UNDEFINED,
386+
embed: hikari.UndefinedNoneOr[hikari.Embed] = hikari.UNDEFINED,
387+
embeds: hikari.UndefinedNoneOr[t.Sequence[hikari.Embed]] = hikari.UNDEFINED,
388388
mentions_everyone: hikari.UndefinedOr[bool] = hikari.UNDEFINED,
389389
user_mentions: hikari.UndefinedOr[
390390
t.Union[hikari.SnowflakeishSequence[hikari.PartialUser], bool]
@@ -402,17 +402,17 @@ async def edit_response(
402402
The content of the message. Anything passed here will be cast to str.
403403
tts : undefined.UndefinedOr[bool], optional
404404
If the message should be tts or not.
405-
attachment : undefined.UndefinedOr[hikari.Resourceish], optional
405+
attachment : undefined.UndefinedNoneOr[hikari.Resourceish], optional
406406
An attachment to add to this message.
407-
attachments : undefined.UndefinedOr[t.Sequence[hikari.Resourceish]], optional
407+
attachments : undefined.UndefinedNoneOr[t.Sequence[hikari.Resourceish]], optional
408408
A sequence of attachments to add to this message.
409-
component : undefined.UndefinedOr[hikari.api.special_endpoints.ComponentBuilder], optional
409+
component : undefined.UndefinedNoneOr[hikari.api.special_endpoints.ComponentBuilder], optional
410410
A component to add to this message.
411-
components : undefined.UndefinedOr[t.Sequence[hikari.api.special_endpoints.ComponentBuilder]], optional
411+
components : undefined.UndefinedNoneOr[t.Sequence[hikari.api.special_endpoints.ComponentBuilder]], optional
412412
A sequence of components to add to this message.
413-
embed : undefined.UndefinedOr[hikari.Embed], optional
413+
embed : undefined.UndefinedNoneOr[hikari.Embed], optional
414414
An embed to add to this message.
415-
embeds : undefined.UndefinedOr[t.Sequence[hikari.Embed]], optional
415+
embeds : undefined.UndefinedNoneOr[t.Sequence[hikari.Embed]], optional
416416
A sequence of embeds to add to this message.
417417
mentions_everyone : undefined.UndefinedOr[bool], optional
418418
If True, mentioning @everyone will be allowed.

miru/ext/nav/navigator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ async def send_page(self, context: Context[t.Any], page_index: t.Optional[int] =
198198

199199
self._inter = context.interaction # Update latest inter
200200

201-
await context.edit_response(**payload)
201+
await context.edit_response(**payload, attachment=None)
202202

203203
async def start(
204204
self,

0 commit comments

Comments
 (0)