🌕 A dead simple command handler for Hikari
Project description
hikari-crescent
A simple command handler for Hikari.
Features
- Simple and intuitive API.
- Slash, user, and message commands.
- Error handling.
Links
Installation
Crescent is supported in python3.8+.
pip install hikari-crescent
Usage
Crescent uses signature parsing to generate your commands. Creating commands is as easy as adding typehints!
import crescent
bot = crescent.Bot("YOUR_TOKEN")
# Include the command in your bot - don't forget this
@bot.include
# Create a slash command
@crescent.command
async def say(ctx: crescent.Context, word: str):
await ctx.respond(word)
bot.run()
Information for arguments can be provided using the Annotated
type hint.
See this example for more information.
# python 3.9 +
from typing import Annotated as Atd
# python 3.8
from typing_extensions import Annotated as Atd
@bot.include
@crescent.command
async def say(ctx: crescent.Context, word: Atd[str, "The word to say"]):
await ctx.respond(word)
Commands can also be inside of a sublcassed crescent.Bot
object for an object-oriented workflow.
import crescent
class Bot(crescent.Bot):
# bot.include isn't needed in subclasses!
@crescent.command
async def say(self, ctx: crescent.Context, word: str):
await ctx.respond(word)
Support
Contact Lunarmagpie❤#0001
on Discord or create an issue. All questions are welcome!
Contributing
Create a issue for your feature. There aren't any guildlines right now so just don't be rude.
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
hikari-crescent-0.1.0b7.tar.gz
(24.8 kB
view hashes)
Built Distribution
Close
Hashes for hikari_crescent-0.1.0b7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89f173fa3de008ca15eda2152ea1f7eb9de666922bae64482dbe6308fecc7a83 |
|
MD5 | 15d71dfb912929086c5771198ab9f40b |
|
BLAKE2b-256 | 540afc0ef3b5fc41849ca4e6bd3e7c321f2bf0e8e2534fa9a2d58473d846f80d |