k.eaven 2466acf837 feat: Phase 1 - TUI Foundation with Textual
- Added Textual TUI framework with modern terminal UI
- Created main TUI app with navigation, message view, event log, state inspector
- Added comprehensive CSS styling for Discord-like appearance
- Implemented navigation pane, message area, event log, state tree, command bar
- Added keyboard shortcuts (Ctrl+Q quit, Ctrl+C command, Ctrl+N/P nav, etc.)
- Integrated TUI with existing REST/Gateway servers and state management
- Added CLI flag --tui/--no-tui to launch TUI mode
- Added Textual and textual-dev to optional dependencies

All 19 tests passing.
2026-11-01 03:09:40 +00:00

APIcord

Discord API Emulator for bot testing.

A standalone Python CLI program that emulates the Discord API (REST + WebSocket Gateway), enabling self-contained testing of Discord bots without requiring a real Discord connection.

Features

  • REST API Server - Implements Discord REST API endpoints needed for bot operations
  • WebSocket Gateway - Emulates Discord's Gateway for real-time events (READY, INTERACTION_CREATE, etc.)
  • State Management - In-memory state with guilds, channels, users, messages, and interactions
  • Test Scenarios - YAML-based test scenarios for automated bot testing
  • CLI Interface - Easy-to-use commands for starting, testing, and managing the emulator

Installation

pip install -e .
# Or for development
pip install -e ".[dev]"

Quick Start

# Start emulator with a test scenario
apicord start --scenario scenarios/basic_test.yaml

# Run automated test against a bot
apicord test --scenario scenarios/full_test.yaml --bot-path /path/to/bot

# Start with custom configuration
apicord start --port 8080 --guilds 2 --channels 5

Project Structure

apicord/
├── src/apicord/
│   ├── main.py              # CLI entry point
│   ├── config.py            # Configuration management
│   ├── rest/                # REST API server (aiohttp)
│   ├── gateways/            # WebSocket gateway (websockets)
│   ├── state/               # State management
│   ├── models/              # Pydantic models for Discord objects
│   └── cli/                 # CLI commands
├── tests/                   # Unit tests
├── scenarios/               # YAML test scenarios
└── pyproject.toml

License

GPL-3.0 - See LICENSE file for details.

S
Description
Discord API Emulator for bot testing
Readme GPL-3.0
236 KiB
0 Stars 1 Watchers 0 Forks
Languages
Python 100%