A command handler for hikari with a focus on type-safety and correctness.
Project description
hikari-arc
A command handler for hikari with a focus on type-safety and correctness.
Installation
To install arc, run the following command:
pip install -U hikari-arc
To check if arc has successfully installed or not, run the following:
python3 -m arc
Please note that
hikari-arc
requires a Python version of at least 3.10.
Basic Usage
import hikari
import arc
bot = hikari.GatewayBot("TOKEN") # or hikari.RESTBot
client = arc.GatewayClient(bot) # or arc.RESTClient
@client.include
@arc.slash_command(name="hi", description="Say hi!")
async def ping(
ctx: arc.Context[arc.GatewayClient],
user: arc.Option[hikari.User, arc.UserParams(description="The user to say hi to.")]
) -> None:
await ctx.respond(f"Hey {user.mention}!")
bot.run()
For more examples see examples, or refer to the documentation.
Issues and support
For general usage help or questions, see the hikari discord, if you have found a bug or have a feature request, feel free to open an issue!
Contributing
See Contributing
Acknowledgements
arc
is in large part a combination of all the parts I like in other command handlers, with my own spin on it. The following projects have inspired me and aided me greatly in the design of this library:
hikari-lightbulb
- The library initially started as a reimagination of lightbulb, it inherits a similar project structure and terminology.Tanjun
- For the idea of usingtyping.Annotated
and dependency injection in a command handler.arc
also uses the same dependency injection library,Alluka
, under the hood.FastAPI
- Some design ideas and most of the documentation configuration derives fromFastAPI
.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hikari_arc-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2aaedf8ebcad6f9bc9efa64d50f437004d39fdaea12635b3ac1239b89cd1d22a |
|
MD5 | d881896d1659449bf01170af386bf263 |
|
BLAKE2b-256 | 2345e292f8519b6693c3a13292a6e3cb249f42f9d48f366dadfed34abb1177b8 |