Skip to main content

Hikari-Lightbulb logo

PyPI

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
Invite Tracker
nMarkov
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!

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.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hikari-lightbulb 3.2.7
File Size Uploaded Provenance Actions
hikari_lightbulb-3.2.7.tar.gz 73.8 kB Without provenance Details for hikari_lightbulb-3.2.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hikari-lightbulb 3.2.7
File Interpreter ABI Platform Actions
hikari_lightbulb-3.2.7-py3-none-any.whl Python 3 none any Details for hikari_lightbulb-3.2.7-py3-none-any.whl

Total release size: 178.5 kB

Release files / hikari_lightbulb-3.2.7.tar.gz

Download URL hikari_lightbulb-3.2.7.tar.gz
Size 73.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e028075c360c56b1fc143b1c276aaa878f58959d3542c84870dc5404baaeeb67
BLAKE2b-256 checksum
How to use checksums
805892e9222802340df6945a8a56007f4ca6edf96c67a505261611e69434604e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Release files / hikari_lightbulb-3.2.7-py3-none-any.whl

Download URL hikari_lightbulb-3.2.7-py3-none-any.whl
Size 104.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce9167af5819c0689870d427266626d776286be94df463c9976b54e99cc459f4
BLAKE2b-256 checksum
How to use checksums
2d1f0f51a040f27df9829d86ab7578d35c745ad92664607ace1b777876749696
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Security for hikari-lightbulb 3.2.7

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.

Release history Release notifications | RSS feed

This release

3.2.7 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page