Skip to content
An API wrapper for Discord written in Python.
Branch: rewrite
Clone or download
Pull request Compare This branch is 159 commits ahead of Rapptz:rewrite.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


NOTE:This is a fork of that is kept automatically up-to-date with the upstream/rewrite branch of There are slight modifications which do not change any major core compatibility. Several gieseladev repositories and others pull from here. Targeted for Python >=3.6+ using rewrite with/without voice support.

Python Versions Maintained License

A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.

Key Features

  • Modern Pythonic API using async and await.
  • Proper rate limit handling.
  • 100% coverage of the supported Discord API.
  • Optimised in both speed and memory.


To install the development (rewrite) version, do the following:

# Linux/macOS
python3 -m pip install -U[voice]

# Windows
py -3 -m pip install -U[voice]

Optional Packages

  • PyNaCl (for voice support)

Please note that on Linux installing voice you must install the following packages via your favourite package manager (e.g. apt, yum, etc) before running the above commands:

  • libffi-dev (or libffi-devel on some systems)
  • python-dev (e.g. python3.6-dev for Python 3.6)

Quick Example

import discord

class MyClient(discord.Client):
    async def on_ready(self):
        print('Logged on as', self.user)

    async def on_message(self, message):
        # don't respond to ourselves
        if == self.user:

        if message.content == 'ping':

client = MyClient()'token')

Bot Example

import discord
from discord.ext import commands

bot = commands.Bot(command_prefix='>')

async def ping(ctx):
    await ctx.send('pong')'token')

You can find more examples in the examples directory.


You can’t perform that action at this time.