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
sendmethod 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file discea-0.1.1.tar.gz.
File metadata
- Download URL: discea-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0483269eeadaa5091261ff2a380f0a894ad36fd8c760660f06fe941470b646a6
|
|
| MD5 |
7c1d84a4b74fb791c55fcd1cea559041
|
|
| BLAKE2b-256 |
9eafea7c545b243e71b3be8944f5898a1d830e1cd0ad54b70dba3f1df853102b
|
File details
Details for the file discea-0.1.1-py3-none-any.whl.
File metadata
- Download URL: discea-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaa3721b9272c24a239ac9455bdcec2ba23ebb0f430b3f75c50613704f491e55
|
|
| MD5 |
a37f6c39ad8f457a17d001d5240034ab
|
|
| BLAKE2b-256 |
590012ca73412b548ee931b910f20388cb02d64635824b678bca39067401fb4e
|