Skip to content

Releases: hypergonial/hikari-miru

v4.2.0

08 Oct 16:30
Compare
Choose a tag to compare
  • Upgrade alluka to 0.3.
  • Upgrade hikari to 2.0.
  • Add Python 3.13 support.
  • Message builders returned by Menu and NavigatorView now try to set View.message when issuing a response through them.
  • Fix self.attr referring to a DecoratedItem instead of the item when using a decorator.
  • Fix message builders not passing through flags when using their respective response methods.

v4.1.1

13 Mar 23:37
Compare
Choose a tag to compare
  • Set View.message if a hikari.Message is passed to Client.start_view()'s bind_to=.

v4.1.0

10 Mar 16:46
5d435ea
Compare
Choose a tag to compare
  • Add the ability to specify view items as classvars, similarly to modals
  • Add the ability to pass the title to the modal as a class argument
  • Fix miru.ext.menu.Menu.build_response_async() ignoring the ephemeral= kwarg.
  • Fix items created with decorators always having the same custom_ids, even when randomly generated.
  • Fix NavigatorView default buttons being added when items= is specified.
  • Remove accidental typing_extensions import in miru.ext.nav.

v4.0.0 - REST Bot support

18 Jan 15:58
87cfae8
Compare
Choose a tag to compare

This is a major breaking release, adding REST bot support, dependency injection, removing global state from the library, and generally cleaning up old mistakes and weirdness that accumulated over the past 2 years.

Alongside this release comes overhauled documentation, with improved navigation, layout & search and extended examples. If you are looking for the v3 docs, you can find them here.

Tip

If you already have an application that depends on v3 of miru, see the migration guide.

  • BREAKING: Raised the minimum supported Python version to 3.10 or greater.

  • BREAKING: Change all @miru decorators to take Context as their first argument and the item (button/select etc..) as their second.

  • BREAKING: Seperate link buttons out of miru.Button as miru.LinkButton.

  • BREAKING: Remove miru.install(). Use miru.Client instead.

  • BREAKING: Remove View.start() and Modal.start(). Use Client.start_view() and Client.start_modal() respectively instead.

  • BREAKING: Remove NavigatorView.send(). Use NavigatorView.build_response() instead and send the builder.

  • BREAKING: Remove Modal.send(). Use Modal.build_response() instead and send the builder.

  • BREAKING: Remove Menu.send(). Use Menu.build_response() instead and send the builder.

  • BREAKING: Remove miru.ModalInteractionCreateEvent and miru.ComponentInteractionCreateEvent. Use the unhandled interaction hooks instead.

  • BREAKING: Made ViewItem.callback only accept positional arguments. This is to allow renaming the context variable's name when overriding it in subclasses. This should not affect most people.

  • BREAKING: Move miru.Context to miru.abc.Context.

  • BREAKING: Move miru.SelectBase to miru.abc.SelectBase.

  • DEPRECATION: Passing buttons= to ext.nav.NavigatorView() constructor. Use the newly added items= instead. The buttons= argument will be removed in v4.2.0.

  • Add miru.Client. The client manages the state of all currently running views & modals & routes interactions to them.

  • Add RESTBot support. Simply pass a RESTBot to miru.Client when initializing it.

  • Add first-class support for dependency injection. This allows to better manage state across the library, along with adding better compatibility to arc and Tanjun via Client.from_arc() and Client.from_tanjun() classmethods respectively.

  • Add the ability to configure autodefer at the item level for views. If an item does not specify autodefer, the view's setting will be used.

  • Add the ability to configure if the autodefer should be ephemeral, along with it's response type through AutodeferOptions.

  • Stabilize Context.issued_response. This property returns a boolean that is True if the underlying interaction has already received an initial response.

  • Add response builders for entire responses from views or modals.

  • Add Context.respond_with_builder().

  • Add @Client.set_unhandled_component_interaction_hook and @Client.set_unhandled_modal_interaction_hook. These are called when an interaction is received that is not handled by any running modal or view.

  • Add miru.abc.InteractiveViewItem for all view items that have callbacks. This includes all current miru.abc.ViewItem except miru.LinkButton.

v3.4.0 - Menus

25 Dec 00:39
Compare
Choose a tag to compare
  • Add miru.ext.menu, which aims to make creating complex, nested menus easy. See the documentation & example on how to use it.
  • Overhaul View autodefer logic. ViewContext are now automatically deferred if a response is not issued within 2 seconds, even if the callback is still running.
  • Add ItemHandler.get_item_by() and ItemHandler.get_item_by_id().
  • Deprecate ModalContext.get_value_by_predicate in favour of ModalContext.get_value_by. It will be removed in the next minor release (3.5.0).
  • Large amounts of typing improvements across the library.
  • Add CONTRIBUTING.md and configuration for common editors for better contributor experience.

v3.3.1 - Hotfix

23 Nov 21:06
Compare
Choose a tag to compare

Fix View.last_context and Modal.last_context incorrectly casting variable types.

v3.3.0 - Python 3.12 Support

22 Nov 20:20
Compare
Choose a tag to compare
  • Add support for Python 3.12
  • Improve Context typing in callbacks for better typechecking experience when using custom contexts. (#47)
  • Minor changes to the type signature of ModalContext.get_value_by_id() and ModalContext.get_value_by_predicate()

v3.2.2

28 Sep 12:35
Compare
Choose a tag to compare
  • Fix miru.abc.Item.position setter max value being it's width instead of row width.

v3.2.1

13 Sep 20:19
Compare
Choose a tag to compare
  • Fix miru.ext.nav.NavigatorView defaulting to ephemeral by default.

v3.2.0

06 Sep 23:41
Compare
Choose a tag to compare
  • 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 also accept miru.ext.nav.Page instances.