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 * 

Note: check Imports and Defined members to know what's being imported

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()
    )
)

Imports And Defined Members

  • This may vary a lot.
  1. Any = typing.Any

  2. Await = typing.Await

  3. Awaitable = typing.Awaitable

  4. Bot = discord.ext.commands.Bot

  5. Button = discord.ui.Button

  6. ButtonStyle = discord.ButtonSyle

  7. Callable = typing.Calleable

  8. Colour = discord.Colour

  9. Component = discord.Component

  10. Dict = typing.Dict

  11. Embed = discord.Embed

  12. EmbedField = discord.EmbedField

  13. EmbedList = dbdk.embed.EmbedList

  14. EmbedTemplate = dbdk.embed.EmbedTemplate

  15. Emoji = discord.Emoji

  16. ExceptionList = dbdk.utils.ExceptionList

  17. InputText = discord.ui.InputText

  18. InputTextStyle = discord.InputTextStyle (Shortcut)

  19. InputTextType = discord.InputTextStyle (Shortcut)

  20. List = typing.List

  21. Modal = dbdk.modal.Modal

  22. OptionType = ?

  23. Root = dbdk.root.Root

  24. RootItems = dbdk.root.RootItems

  25. SelectMenu = dbdk.components.SelectMenu

  26. SelectOption = dbdk.components.SelectOption

  27. States = dbdk.utils.States (Concept class)

  28. Tuple = typing.Tuple

  29. Union = typing.Union

  30. View = dbdk.view.View

  31. commands = discord.ext.commands

  32. components = dbdk.components (Module)

  33. create_root = dbdk.kit.create_root

  34. datetime = datetime (Module)

  35. default_on_select = dbdk.components.default_on_select

  36. default_on_submit = dbdk.modal.default_on_submit

  37. default_on_timeout = dbdk.view.default_on_timeout

  38. discord = discord (Module)

  39. embed = dbdk.embed (Module)

  40. extract = dbdk.utils.extract

  41. modal = dbdk.modal (Module)

  42. namedtuple = collections.namedtuple

  43. root = dbdk.root (Module)

  44. types = dbdk.types (Module)

  45. ui = discord.ui (Shortcut)

  46. utils = dbdk.utils (Module)

  47. view = dbdk.view (Module)

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.0.1.tar.gz (10.3 kB view hashes)

Uploaded Source

Built Distribution

dbdk-1.0.1-py3-none-any.whl (10.9 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