# discord.py

> An API wrapper for Discord written in Python

- Type: agent or tool
- Field: Assistants & Chat
- Repository: https://github.com/Rapptz/discord.py
- GitHub stars: 16196
- Licence: MIT
- Language: Python
- Last push: 2026-09-07
- Page: https://imutechz.in/agents/discord.py

## What it is
discord.py is an async-ready API wrapper for Discord written in Python. It provides a modern, Pythonic interface using async and await, with built-in rate limit handling and optimisations for speed and memory. It is aimed at Python developers who want to build Discord bots or interact with the Discord API programmatically.

## Features
- Modern Pythonic API using async and await
- Proper rate limit handling
- Optimised in both speed and memory
- Optional voice support via an extra install
- Command bot support through discord.ext.commands
- Example code included in the examples directory

## Best for
- Building Discord bots in Python
- Handling Discord API rate limits
- Writing async message and command handlers
- Adding voice support to a Discord bot

## Pros
- Uses async and await for a modern Pythonic API
- Handles rate limits properly
- Optimised for speed and memory
- Offers optional voice support

## Cons
- Requires Python 3.8 or higher
- Voice support on Linux needs libffi-dev and python-dev installed first
- A virtual environment is recommended, especially on Linux

## Install
```
python3 -m pip install -U discord.py
```

## Usage
```
await message.channel.send('pong')
```

Tags: discord, python, api-wrapper, async, chatbot, bot-framework, voice
