A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.
- Modern Pythonic API using
asyncandawait. - Proper rate limit handling to keep your bot running smoothly.
- Optimised in both speed and memory.
- Feature-rich support for the latest Discord API features.
.
├── discord/ # Core discord.py library source
├── SKILLS/ # Skill definition for AI assistants
│ └── custom-readme-generator/
├── images/ # Project visual resources
├── sounds/ # Audio resources for the bot
├── main.py # Main entry point for the bot
├── pyproject.toml # Project configuration and dependencies
├── requirements.txt # Python dependencies
└── README.md # This documentation
Python 3.8 or higher is required.
It is recommended to use a virtual environment.
# Basic installation
pip install -U discord.py
# With voice support
pip install -U "discord.py[voice]"git clone https://github.com/Rapptz/discord.py
cd discord.py
pip install -U .[voice]import discord
class MyClient(discord.Client):
async def on_ready(self):
print(f'Logged on as {self.user}')
async def on_message(self, message):
# don't respond to ourselves
if message.author == self.user:
return
if message.content == 'ping':
await message.channel.send('pong')
intents = discord.Intents.default()
intents.message_content = True
client = MyClient(intents=intents)
client.run('token')import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='>', intents=intents)
@bot.command()
async def ping(ctx):
await ctx.send('pong')
bot.run('token')Made with ❤️ for the Discord community