A clean, efficient Discord API wrapper for bot development.
Project description
aiko_api
A clean, efficient, and modern Discord API wrapper for Python.
aiko_api is designed to be a lightweight and easy-to-use alternative for building Discord bots and selfbots. It features a flat command hierarchy, smart signatures, and a powerful plugin system with hot-reloading.
Features
- Flat Sub-command Hierarchy: Decorate commands with their parent commands for clean nesting.
- Smart Signatures:
selfis optional in Cogs; the library detects if it's needed. - Clean Cog Events: Automatically register
on_methods as event listeners. - Advanced Plugin System: Load Cogs and standalone commands from directories with built-in hot-reloading.
- Optimized HTTP: Built on top of
curl_cffifor high performance and better impersonation.
Installation
pip install aiko-api
Quick Start
import asyncio
from aiko_api import Bot
bot = Bot(command_prefix="!")
@bot.command()
async def ping(ctx):
await ctx.reply("Pong! 🏓")
@bot.event
async def on_ready(user):
print(f"Logged in as {user.username}")
if __name__ == "__main__":
asyncio.run(bot.start("YOUR_TOKEN"))
Advanced Usage: Plugins and Cogs
aiko_api features a powerful plugin system with built-in hot-reloading. It automatically detects and registers Cogs and standalone commands in a directory.
1. Create a Plugin (plugins/moderation.py)
from aiko_api import Cog, command
class Moderation(Cog):
# Root Command (No 'self' needed!)
@command()
async def config(ctx):
await ctx.send("Main config menu.")
# Sub-command: !config prefix
@config
async def prefix(ctx, new_prefix: str):
await ctx.send(f"Prefix updated to {new_prefix}")
# Deep Nesting: !config prefix reset
@prefix
async def reset(ctx):
await ctx.send("Prefix reset to default.")
2. Load and Hot-Reload
import asyncio
from aiko_api import Bot
async def main():
bot = Bot(command_prefix="!")
# Automatically load all Cogs and commands from a directory
bot.load_plugins("plugins")
# Start the hot-reloader in the background
asyncio.create_task(bot.watch_plugins("plugins"))
await bot.start("YOUR_TOKEN")
if __name__ == "__main__":
asyncio.run(main())
License
This project 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
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 aiko_api-0.1.4.tar.gz.
File metadata
- Download URL: aiko_api-0.1.4.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1895d9669c5a8b5d9049675d3d179e4b3f27ab0505dc0d4acf3daca341226441
|
|
| MD5 |
9ccf06df8fccd19513ffd6595b514e8f
|
|
| BLAKE2b-256 |
4157208f447fc810734437a635965ca8a4bde639a5ad008d9f28a0be421baf9e
|
File details
Details for the file aiko_api-0.1.4-py3-none-any.whl.
File metadata
- Download URL: aiko_api-0.1.4-py3-none-any.whl
- Upload date:
- Size: 26.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3d3bc3da58cc89154ac537c75316dedb280a3b3293d321f4ce611984575b7c5
|
|
| MD5 |
6756ab101d9074b16e2063921a70d2bb
|
|
| BLAKE2b-256 |
63ea94a9d95f62ea70d8856c008ac5e684c015022ca4a7712724a7db18cd9ef5
|