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!

Links

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.

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-3.2.6.tar.gz (73.8 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-3.2.6-py3-none-any.whl (104.6 kB view details)

Uploaded Python 3

File details

Details for the file hikari_lightbulb-3.2.6.tar.gz.

File metadata

  • Download URL: hikari_lightbulb-3.2.6.tar.gz
  • Upload date:
  • Size: 73.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for hikari_lightbulb-3.2.6.tar.gz
Algorithm Hash digest
SHA256 06beae2b39a9727da2199c7edd09c50455545e890f02d30d74c004ad692b0bf4
MD5 d27d47c0a3fbca29524ae3f071e65f82
BLAKE2b-256 e2fc3b8b05520321589492db730fb30aab9e75cf680bfde70c5625f1440038f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hikari_lightbulb-3.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a9de5fc73fe7471830cf55a37d9b5dd8914ddb2ffcff08a7b17231d566393cd2
MD5 ed3511819a1e1ac7a842642b50d29e80
BLAKE2b-256 63bdd61ea217b0d9e2382e7f6bf7aa61619982062e62c0b9bf3f9e64d536ee80

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.2.6 This release

2 files

3.2.5

2 files

3.2.4

2 files

3.2.3

2 files

3.2.2

2 files

3.2.1

2 files

3.2.0

2 files

3.1.3

2 files

3.1.2

2 files

3.1.1

2 files

3.1.0

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.3.5.post1

2 files

2.3.5.post0

2 files

2.3.5

2 files

2.3.4

2 files

2.3.3

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.5

2 files

2.2.4

2 files

2.2.3

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

2.1.3

2 files

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.4

2 files

2.0.3

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

2.0.0a5

2 files

2.0.0a4

2 files

2.0.0a3

2 files

2.0.0a1

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.0.61

2 files

0.0.60

2 files

0.0.59

2 files

0.0.58

2 files

0.0.57

2 files

0.0.56

2 files

0.0.55

2 files

0.0.54

2 files

0.0.53

2 files

0.0.52

2 files

0.0.51

2 files

0.0.50

2 files

0.0.49

2 files

0.0.48

2 files

0.0.47

2 files

0.0.46

2 files

0.0.45

2 files

0.0.44

2 files

0.0.43

2 files

0.0.42

2 files

0.0.41

2 files

0.0.40

2 files

0.0.39

2 files

0.0.38

2 files

0.0.37

2 files

0.0.36

2 files

0.0.35

2 files

0.0.34

2 files

0.0.33

2 files

0.0.32

2 files

0.0.31

2 files

0.0.30

2 files

0.0.29

2 files

0.0.28

2 files

0.0.27

2 files

0.0.26

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.22

2 files

0.0.21

2 files

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

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