Skip to main content

Discord Bot Dev Kit is a set of funtions and classes to simplify the creation of discord bots

Project description

NoVa - Discord Bot Dev Kit

Is a set of funtions and classes to simplify the creation of discord bots

Installing DBDK

pip install dbdk
  • You can install DBDK manually using PyPI

Importing DBDK

from dbdk import * 

Creating A Root

@bot.command(name="sample")
async def sample_command(ctx: commands.context.Context):

    root: Root = await create_root(ctx)
  • Roots are the start and managers of everything in DBDK. In most cases you will only need 1 root per command.

View Introduction

  • As shown in the example above, we assuming this is inside a command function definition.
root: Root = await create_root(ctx)

# by default `root` has a `view` property
root.view

# You can add items to the view using `add_items` method
await root.view.add_items(
    Button(on_click_callback, "This is the label"),

    SelectMenu(
        on_select_callback, options = [
            SelectOption
        ]
    )
)

Adding a Button to the view

# Create a on click callback function; this function is called when the button is clicked
async def on_click(clicked_button: Button, interaction: discord.Interaction):

    # respond the interacion
    await interaction.response.send_message("You Clicked the button!")

await root.view.add_items(
    Button(
        on_click,
        label = "Click Me!",
        emoji = '🙂'
    )
)

    # That's all, you'll see changes reflected in the root message

Embeds

await root.embeds.add_items(
    Embed(
        title = "My Embed",
        description = "My embed description :D",
        color = discord.Color.green()
    )
)

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

dbdk-1.2.tar.gz (11.7 kB view hashes)

Uploaded Source

Built Distribution

dbdk-1.2-py3-none-any.whl (14.5 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