discord.py
A Python wrapper for the Discord API
What it is and what it does
discord.py is a modern, async-first Python library that wraps the Discord API, allowing developers to build bots and client applications that interact with Discord servers, channels, messages, and users. It uses Python's async/await syntax for non-blocking I/O and includes built-in rate-limit handling and memory optimization. The library supports both simple client-based interactions and more complex bot frameworks via its commands extension.
The package depends on aiohttp for HTTP requests and audioop-lts for optional voice support. It is actively maintained, supports Python 3.8 through 3.12, and has a large user base. Installation is straightforward via pip, with optional voice features available through an extra dependency (PyNaCl). The library is production-stable and suitable for building anything from simple command bots to complex Discord applications.
Use it for:
- Build a Discord bot that responds to commands and automates server moderation or management tasks.
- Create a bot that monitors channels, reacts to messages, or sends notifications based on server events.
- Develop a custom Discord client application that interacts with the API for data collection or analytics.
- Implement voice channel features such as audio playback or recording in a Discord bot.
- Integrate Discord notifications into an external application or workflow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
discord.py is an async-ready Python wrapper for the Discord API that lets you build bots and client applications to interact with Discord servers, channels, and users.
Yes. discord.py is a mature, actively maintained library with low install friction, permissive licensing, no known vulnerabilities, and strong community support. It is the standard choice for Python-based Discord bot development. Install it if you need to build Discord bots or integrate Discord API functionality into a Python application.
Install
discord-py on PyPI
pip
pip install discord-pyuv
uv add discord-pypoetry
poetry add discord-pyInstalling discord.py
Before you install
Low install friction with a pure-wheel distribution. Actively maintained with recent commits and a large community (16135 stars). Requires Python 3.8 or higher; voice support optionally depends on aiohttp and audioop-lts at runtime.
License in practice
MIT License permits free use, modification, and distribution with minimal restrictions—suitable for commercial and private projects alike.
Quickstart
pip install discord.py
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='>', intents=discord.Intents.default())
bot.run('your_token')
Requires Python 3.8 or higher. A Discord bot token is needed to authenticate; voice support requires optional system packages (libffi-dev, python-dev on Linux).
Verify before relying
- Whether the package's rate-limit handling and memory optimizations meet specific production workload requirements.
- Performance characteristics when handling large numbers of concurrent guild connections or message events.
Package facts
| License | The MIT License (MIT) Copyright (c) 2015-present Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — aiohttp, audioop-lts |
| Maintenance | actively maintained — 164 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,842,167/month — #1,837 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: discord_py-2.7.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
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
hikariHikari is an async Discord bot framework for…
permissive · top 15,000 on PyPI
pypresencePypresence is a Python client for Discord Rich…
permissive · top 15,000 on PyPI
qq-botpyA Python framework for building QQ chat bots…
permissive · top 15,000 on PyPI
py-cordpy-cord is an async Python wrapper for the…
permissive · top 15,000 on PyPI
nextcordNextcord is an async-ready Python wrapper for…
permissive · top 15,000 on PyPI
allianceauth-discordbotA Discord bot framework for Alliance Auth that…
permissive · top 15,000 on PyPI
prawPRAW provides a Python interface to Reddit's…
permissive · top 5,000 on PyPI
pyTelegramBotAPIA Python library that wraps the Telegram Bot…
copyleft · top 5,000 on PyPI