py-cord
A Python wrapper for the Discord API
What it is and what it does
py-cord is a Python library that wraps Discord's REST and WebSocket APIs, allowing you to write Discord bots using async/await syntax. It provides both modern slash commands and traditional prefix-based commands, with built-in rate limit handling and memory optimization. The library depends on aiohttp for HTTP requests and typing_extensions for type hints, and is designed to work with Python 3.10 through 3.14.
You use it by importing the module, instantiating a Bot object, decorating handler functions with command decorators, and calling bot.run() with your bot token. It handles the WebSocket connection, message routing, and command parsing automatically. Optional extras like voice support and performance speedups are available but require additional packages.
Use it for:
- Build a Discord bot with slash commands that responds to user interactions in real time.
- Create a moderation bot that monitors messages and enforces server rules using prefix commands.
- Develop a music bot that connects to voice channels and streams audio with optional voice support.
- Automate server tasks like role assignment, welcome messages, or scheduled announcements.
- Integrate external APIs or databases into Discord workflows via bot commands.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
py-cord is an async Python wrapper for the Discord API that lets you build Discord bots with modern async/await syntax, handling rate limits and providing both slash commands and traditional prefix-based commands.
Yes. py-cord is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive MIT license. It is suitable for anyone building Discord bots in Python who wants modern async syntax and a well-supported library.
Install
py-cord on PyPI
pip
pip install py-corduv
uv add py-cordpoetry
poetry add py-cordInstalling py-cord
Before you install
Low friction: pure Python wheel with only two runtime dependencies (aiohttp and typing_extensions). Active maintenance with a recent release 20 days old and steady commit activity. Supports Python 3.10–3.14.
License in practice
MIT license is permissive; you can use py-cord in commercial and private projects with minimal restrictions, provided you include the license notice.
Quickstart
pip install py-cord
import py_cord
bot = py_cord.Bot()
@bot.slash_command()
async def hello(ctx, name: str = None):
name = name or ctx.author.name
await ctx.respond(f"Hello {name}!")
bot.run("your_token_here")
Requires Python 3.10 or higher. Voice support requires optional system packages on Linux and additional Python packages.
Verify before relying
- Whether the package maintains API compatibility with Discord API changes over time.
- Performance characteristics under high-concurrency scenarios.
- Specific system package names required for voice support on different Linux distributions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — aiohttp, typing_extensions |
| Maintenance | actively maintained — 20 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 540,570/month — #6,101 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: py_cord-2.8.1-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
nextcordNextcord is an async-ready Python wrapper for…
permissive · top 15,000 on PyPI
discord.pydiscord.py is an async-ready Python wrapper for…
permissive · top 5,000 on PyPI
discordA Python API wrapper for Discord that provides…
unclear · top 15,000 on PyPI
discord.py-selfAn async Python wrapper for Discord's user…
permissive · top 15,000 on PyPI
qq-botpyA Python framework for building QQ chat bots…
permissive · top 15,000 on PyPI
hikariHikari is an async Discord bot framework for…
permissive · top 15,000 on PyPI
python-telegram-botProvides a pure Python asynchronous interface…
copyleft · top 1,000 on PyPI
pyTelegramBotAPIA Python library that wraps the Telegram Bot…
copyleft · top 5,000 on PyPI
aiodnsProvides asynchronous DNS resolution for…
permissive · top 5,000 on PyPI
allianceauth-discordbotA Discord bot framework for Alliance Auth that…
permissive · top 15,000 on PyPI