Skip to main content

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: self is 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_cffi for 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

aiko_api-0.1.3.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

aiko_api-0.1.3-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file aiko_api-0.1.3.tar.gz.

File metadata

  • Download URL: aiko_api-0.1.3.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

Hashes for aiko_api-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7296e5146e367a76efd932e8e84a0bd4c53366252da7b3e98d7fbd1537cc0fb3
MD5 f21080ce6126f524cef7ebbbb805c194
BLAKE2b-256 8f9d5b9e16a7fcfc1c788a8ba83a289532b7916e22da4ce330c0b8047b8869d2

See more details on using hashes here.

File details

Details for the file aiko_api-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: aiko_api-0.1.3-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

Hashes for aiko_api-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ccb34dd4360f5f69bff438fd05b2c0ebf6f6093a82b7ef94f854f1883780f5bd
MD5 4815753aaeae79d8425949e7d9a0279c
BLAKE2b-256 228c238afd29a1135c3eff38f0b4244b0f0c75a5b215bb683b003dd19df23361

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