Skip to main content

A simple to use command handler for Hikari

Project description

PyPI

Lightbulb

Lightbulb is designed to be an easy to use command handler library that integrates with the Discord API wrapper library for Python, Hikari.

This library aims to make it simple for you to make your own Discord bots and provide all the utilities and functions you need to help make this job easier.

Installation

Use the package manager pip to install Lightbulb.

pip install hikari-lightbulb

Usage

# Import the command handler
import lightbulb

# Instantiate a Bot instance
bot = lightbulb.BotApp(token="your_token_here", prefix="your_prefix_here")

# Register the command to the bot
@bot.command
# Use the command decorator to convert the function into a command
@lightbulb.command("ping", "checks the bot is alive")
# Define the command type(s) that this command implements
@lightbulb.implements(lightbulb.PrefixCommand)
# Define the command's callback. The callback should take a single argument which will be
# an instance of a subclass of lightbulb.context.Context when passed in
async def ping(ctx: lightbulb.Context) -> None:
    # Send a message to the channel the command was used in
    await ctx.respond("Pong!")

# Run the bot
# Note that this is blocking meaning no code after this line will run
# until the bot is shut off
bot.run()

Issues

If you find any bugs, issues, or unexpected behaviour while using the library, you should open an issue with details of the problem and how to reproduce if possible. Please also open an issue for any new features you would like to see added.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please try to update tests as appropriate and ensure that documentation is updated if you add any features accessible through the public API.

If you use this library and like it, feel free to sign up to GitHub and star the project, it is greatly appreciated and lets me know that I'm going in the right direction!

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

hikari-lightbulb-2.2.4.tar.gz (82.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hikari_lightbulb-2.2.4-py3-none-any.whl (112.5 kB view details)

Uploaded Python 3

File details

Details for the file hikari-lightbulb-2.2.4.tar.gz.

File metadata

  • Download URL: hikari-lightbulb-2.2.4.tar.gz
  • Upload date:
  • Size: 82.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for hikari-lightbulb-2.2.4.tar.gz
Algorithm Hash digest
SHA256 3e216c8332748c12d0f82df11d14a45b0cea476d1bfea7a2e917411aeba78ed0
MD5 e824639a98d9d4f0754008af1ad34507
BLAKE2b-256 de26f35f63936453d57f1c511e58fa00d0e8cffb2681425155233641f36a2434

See more details on using hashes here.

File details

Details for the file hikari_lightbulb-2.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for hikari_lightbulb-2.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4783c7087f0c32a842f6bffc695568c3436584cd872383d1a43555b7f766ddd7
MD5 70d2321ed782d9854122911b413fb2a3
BLAKE2b-256 0770f286fc2ef75322e0d2e8be38b6711172c39ba365438ea5472650ff8a236b

See more details on using hashes here.

Supported by

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