Skip to main content

🌕 A dead simple command handler for Hikari

Project description

hikari-crescent

code-style-black Mypy Docs pre-commit.ci status Pypi

A simple command handler for Hikari.

Features

  • Simple and intuitive API.
  • Slash, user, and message commands.
  • Error handling.

Links

📝 | Docs
📦 | Pypi

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


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.0b3.tar.gz (23.6 kB view hashes)

Uploaded Source

Built Distribution

hikari_crescent-0.1.0b3-py3-none-any.whl (31.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page