skillfed

discord.py

A Python wrapper for the Discord API

discord-py v2.7.1 6.8M downloads/30d#1,837 on PyPI16,135
Permissive 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) Active released

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

uv

uv add discord-py

poetry

poetry add discord-py

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: InternetTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: UtilitiesTyping :: Typed

Tags

discord bot library pythondiscord api wrapperpython discord clientasync discord librarydiscord.py bot frameworkdiscord server automationpython discord integration
discord-botasync-apiapi-wrapper

More Libraries packages