whatisgithub

What is discord.py?

rapptz/discord.py — explained in plain English

Analysis updated 2026-06-24

16,058PythonAudience · developerComplexity · 2/5Setup · easy

In one sentence

Async Python wrapper for the Discord API. Write a bot in about ten lines, with support for commands, events, voice, and automatic rate limiting.

Mindmap

mindmap
  root((discord-py))
    Inputs
      Bot token
      Discord events
      Slash commands
    Outputs
      Bot replies
      Channel and member actions
      Voice playback
    Use Cases
      Build a moderation bot
      Run a music bot
      Send notification alerts
    Tech Stack
      Python
      asyncio
      Discord API
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a Discord moderation bot that bans, mutes, or filters messages

USE CASE 2

Run a music or audio bot that plays in a voice channel

USE CASE 3

Push GitHub or monitoring alerts into a Discord channel

What is it built with?

Pythonasyncio

How does it compare?

rapptz/discord.pymodelscope/funasrflet-dev/flet
Stars16,05816,05116,072
LanguagePythonPythonPython
Setup difficultyeasyhardeasy
Complexity2/54/53/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Needs a bot token from the Discord developer portal and Python 3.8+.

So what is it?

Discord.py is a Python library that lets you build bots and automated tools for Discord, the popular chat platform. An API wrapper (what this library is) handles all the low-level communication with Discord's servers so you can focus on what your bot actually does, rather than figuring out how to talk to Discord's systems. Using discord.py, a developer can write a few lines of Python to create a bot that listens for messages, responds to commands, manages server members, and more. The code examples in the README show how simple this is: a bot that replies "pong" when someone types "ping" takes about 10 lines of code. The library handles rate limiting (Discord's rules about how fast you can send requests) and is designed to work asynchronously, meaning it can respond to many events at once without slowing down. The library supports an optional voice feature (for bots that play audio in voice channels) through an additional package. It requires Python 3.8 or higher and is installed via pip, Python's standard package installer. Discord.py is aimed at Python developers who want to automate tasks on Discord servers, building moderation bots, game bots, music players, notification systems, and similar tools.

Copy-paste prompts

Prompt 1
Show me a discord.py ping pong bot with slash commands using the latest 2.x API
Prompt 2
Help me set up the voice extras for discord.py and play an mp3 in a voice channel
Prompt 3
Write a discord.py cog that auto-deletes messages containing banned words
Prompt 4
Explain how discord.py handles rate limits so my bot does not get banned by the API

Frequently asked questions

What is discord.py?

Async Python wrapper for the Discord API. Write a bot in about ten lines, with support for commands, events, voice, and automatic rate limiting.

What language is discord.py written in?

Mainly Python. The stack also includes Python, asyncio.

How hard is discord.py to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is discord.py for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.