Overview
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 libraries
import hikari
import lightbulb
# Create a GatewayBot instance
bot = hikari.GatewayBot("your_token_here")
client = lightbulb.client_from_app(bot)
# Ensure the client starts once the bot is run
bot.subscribe(hikari.StartingEvent, client.start)
# Register the command with the client
@client.register()
class Ping(
# Command type - builtins include SlashCommand, UserCommand, and MessageCommand
lightbulb.SlashCommand,
# Command declaration parameters
name="ping",
description="checks the bot is alive",
):
# Define the command's invocation method. This method must take the context as the first
# argument (excluding self) which contains information about the command invocation.
@lightbulb.invoke
async def invoke(self, 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()
Sponsors
I would like to give a special thanks to my sponsors for providing the funding to continue developing and improving this resource over the past 5+ years.
Large Bots
The following large bots are all using Lightbulb in production:
Invite Tracker |
nMarkov |
Do you own a large bot using Lightbulb? Mention @thomm.o on Discord or submit a pull request to add your bot to the list!
Show your Support
We love people's support in growing and improving. Be sure to leave a ⭐️ if you like the project, and I would gladly welcome any contributions if you're interested!
Links
- License: MIT
- Repository: GitHub
- Documentation: ReadTheDocs
IDE Plugin
Lightbulb now has a plugin for IntelliJ-based IDEs (IntelliJ, Pycharm, etc) to help improve the developer experience by providing autocompletion and type checking not yet supported by other tools. More features such as command boilerplate generation and further code inspections are planned.
You can install the plugin from the Jetbrains Marketplace within your IDE. View the plugin here.
Metadata
Release files for hikari-lightbulb 3.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hikari_lightbulb-3.2.6.tar.gz | 73.8 kB | Without provenance | Details for hikari_lightbulb-3.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hikari_lightbulb-3.2.6-py3-none-any.whl | Python 3 | none | any | Details for hikari_lightbulb-3.2.6-py3-none-any.whl |
Total release size: 178.4 kB
Release files / hikari_lightbulb-3.2.6.tar.gz
| Download URL | hikari_lightbulb-3.2.6.tar.gz |
|---|---|
| Size | 73.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
06beae2b39a9727da2199c7edd09c50455545e890f02d30d74c004ad692b0bf4
|
|
BLAKE2b-256 checksum How to use checksums |
e2fc3b8b05520321589492db730fb30aab9e75cf680bfde70c5625f1440038f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.5
|
Release files / hikari_lightbulb-3.2.6-py3-none-any.whl
| Download URL | hikari_lightbulb-3.2.6-py3-none-any.whl |
|---|---|
| Size | 104.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a9de5fc73fe7471830cf55a37d9b5dd8914ddb2ffcff08a7b17231d566393cd2
|
|
BLAKE2b-256 checksum How to use checksums |
63bdd61ea217b0d9e2382e7f6bf7aa61619982062e62c0b9bf3f9e64d536ee80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.5
|
Security for hikari-lightbulb 3.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.