skillfed

py-cord

A Python wrapper for the Discord API

py-cord v2.8.1 540.6K downloads/30d#6,101 on PyPI2,955
Permissive license MIT Active released

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-cord

uv

uv add py-cord

poetry

poetry add py-cord

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: InternetTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: UtilitiesTyping :: Typed

Tags

discord bot library pythondiscord api wrapper asyncpython discord slash commandsdiscord bot frameworkasync discord clientdiscord bot developmentpython discord library
discord-botasync-apiapi-wrapper

More Libraries packages