Skip to main content

A simple Python module for creating Discord bots and sending webhooks

Project description

Discea

A modern, powerful, and developer-friendly Python module for creating Discord bots and sending webhooks. Built on top of discord.py, Discea aims to simplify the boilerplate while providing a premium development experience.

Why Discea?

Discord bot development often involves repetitive code for syncing commands, handling interactions, and building complex embeds. Discea streamlines this by providing:

  • 🚀 Zero-Config Syncing: Command tree syncing is handled automatically.
  • Fluent API: Design embeds and views using a chainable, readable syntax.
  • 🛡️ Unified Messaging: A single send method that works for both prefix and slash commands.
  • 🎨 Premium Defaults: Modern intents and settings enabled by default.

Installation

pip install discea

Quick Start

Creating a Bot

from discea import DisceaBot, DisceaEmbed, DisceaView
import discord

bot = DisceaBot(prefix="!")

@bot.slash_command(name="ping", description="Check if the bot is responsive")
async def ping(interaction: discord.Interaction):
    await bot.send(interaction, "Pong!")

@bot.command(name="hello")
async def hello(ctx):
    await bot.send(ctx, "Hello there!")

if __name__ == "__main__":
    bot.run("YOUR_TOKEN")

Advanced Examples

Complex Fluent Embeds

embed = (DisceaEmbed.simple("System Status", "All services are operational.")
         .add("API Latency", "12ms", inline=True)
         .add("Database", "Connected", inline=True)
         .image("https://example.com/status.png")
         .footer("Last updated 2 mins ago")
         .author("Discea Monitoring", icon_url="https://example.com/icon.png"))

await bot.send(interaction, embed=embed)

Interactive Views with Callbacks

async def button_callback(interaction: discord.Interaction):
    await interaction.response.send_message("Button was clicked!", ephemeral=True)

view = DisceaView()
view.add_button("Primary Action", style=discord.ButtonStyle.primary, callback=button_callback)
view.add_link("Documentation", "https://github.com/...")

await bot.send(interaction, "Interactive Message:", view=view)

API Reference

DisceaBot

Method Description
slash_command(name, description) Decorator to register a global slash command.
command(name) Decorator to register a traditional prefix command.
send(ctx, content, embed, view) Unified send method. ctx can be Interaction or Context.
run(token, sync=True) Starts the bot and handles command syncing.

DisceaEmbed

Method Description
add(name, value, inline) Adds a field. Returns self for chaining.
footer(text, icon_url) Sets footer. Returns self.
author(name, url, icon_url) Sets author. Returns self.
image(url) Sets image. Returns self.
thumbnail(url) Sets thumbnail. Returns self.

DisceaView

Method Description
add_button(label, style, callback, ...) Adds a button to the view.
add_link(label, url) Adds a URL button (link) to the view.

DisceaWebhook

Method Description
send(content, ...) Sends a POST request to the Discord webhook.
send_embed(title, description) Helper for quick embed delivery via webhook.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

Discea is licensed under the MIT License.

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

discea-0.1.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discea-0.1.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file discea-0.1.2.tar.gz.

File metadata

  • Download URL: discea-0.1.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for discea-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0e0d54c6d423ea2d97afff7a945f453082c1fc4040fbe645f80edc8d4ca6ae7a
MD5 db7ab110a313b796920e4742acbdc7e6
BLAKE2b-256 301b489f4fdefb282107dead0e2704bb46260bc03fd0bd6e6694fa2d751e5313

See more details on using hashes here.

File details

Details for the file discea-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: discea-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for discea-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 437868691a08b7439e316dbc184b497ea2fe44b649f174e8b0dc04c3cda44efd
MD5 d19b7f61e623de41b78546632f995f7b
BLAKE2b-256 fc9558ce275928e261d4c49e6ec06fcd5fb8e72611b6a68cbb00a8cee72b61a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page