An optional component handler for hikari, inspired by discord.py’s views

An optional component handler for hikari, inspired by discord.py’s views. Installation pip install git+https://github.com/HyperGH/hikari-miru.git Usage import hikari import hikari_miru as miru class MyView(miru.View): @miru.button(label=”Rock”, emoji=”đŸĒ¨”, style=hikari.ButtonStyle.PRIMARY) async def rock_button(self, button: miru.Button, interaction: hikari.ComponentInteraction): await interaction.create_initial_response(hikari.ResponseType.MESSAGE_CREATE, content=f”Paper!”) @miru.button(label=”Paper”, emoji=”📜”, style=hikari.ButtonStyle.PRIMARY) async def paper_button(self, button: miru.Button, interaction: hikari.ComponentInteraction): await interaction.create_initial_response(hikari.ResponseType.MESSAGE_CREATE, content=f”Scissors!”) @miru.button(label=”Scissors”, emoji=”✂ī¸”, style=hikari.ButtonStyle.PRIMARY) async def scissors_button(self, button: miru.Button, interaction: hikari.ComponentInteraction): await interaction.create_initial_response(hikari.ResponseType.MESSAGE_CREATE, content=f”Rock!”) @miru.button(emoji=”⏚ī¸”, style=hikari.ButtonStyle.DANGER, row=2) async def stop_button(self, button: miru.Button, interaction: hikari.ComponentInteraction): await interaction.create_initial_response(hikari.ResponseType.DEFERRED_MESSAGE_UPDATE) self.stop() # Stop listening for interactions […]

Read more