Guide · Open source
How to use discord.py: Python Discord bot library guide
Updated · written with AI from the project's own documentation and checked against our catalogue data
discord.py is a Python library that wraps Discord's API, so programmers can write code that logs in as a bot and responds to events on Discord servers. This guide explains what the project is, what it requires, and how to get its source code. The project's README was empty in the material available for this review, so this page does not describe its features or usage in detail.
Quick start
- 1Install Python 3. Make sure Python 3 is installed on your computer. This is the only prerequisite listed in the source.
- 2Clone the repository. Run git clone https://github.com/Rapptz/discord.py in a terminal to copy the source code to your machine.
- 3Open the homepage. Visit http://discordpy.rtfd.org/en/latest for setup and usage documentation, since the README was empty.
- 4Check the licence. The project is licensed under MIT, so review the terms before using it in your own work.
What is discord.py?
discord.py is an API wrapper for Discord written in Python. A wrapper is a library that sits between your code and Discord's raw API, so you can call it from Python instead of building every request yourself.
It is a code library, not a ready-made bot. You need to write Python code that uses it to run a bot.
- Language: Python
- Purpose: API wrapper for Discord
- Licence: MIT
What do you need before you start?
The main prerequisite listed for discord.py is Python 3. If you are new to Python, install Python 3 first, then continue with the steps below.
The source material does not list other requirements, so check the project's homepage for anything further.
- Python 3
How do you get the discord.py source code?
The install method given for this project is a package manager, but the only install command confirmed in the source is cloning the repository with git. Run the command below in a terminal to copy the project to your computer.
Cloning gives you the source files. It does not, by itself, confirm how to install the library into your Python environment.
git clone https://github.com/Rapptz/discord.pyWhere can you find the official documentation?
The project lists a homepage at http://discordpy.rtfd.org/en/latest. Use it as the starting point for setup details, usage examples and API reference, since the README was unavailable for this review.
Because the README content is not confirmed here, do not rely on this page for commands beyond the git clone step.
- Homepage: http://discordpy.rtfd.org/en/latest
Who should use discord.py, and who should not?
discord.py suits Python developers who want to build a Discord bot, hobbyists making a small server bot for moderation or commands, and developers who prefer a Python wrapper over calling Discord's raw API.
It is not suited to people who want a bot without writing code, developers who work in other languages, or anyone who needs features the README did not confirm.
- Good fit: Python developers building a Discord bot
- Good fit: hobbyists making a small moderation or command bot
- Good fit: developers who want a wrapper instead of the raw API
- Not a fit: non-programmers wanting a no-code bot
- Not a fit: developers working in languages other than Python
What people use it for
- Building a Discord bot in Python that responds to events on a server
- Making a small moderation or command bot for a hobby server
- Writing bot code with a Python wrapper instead of calling Discord's raw API
Frequently asked questions
How do I install discord.py?
The source confirms only one command: git clone https://github.com/Rapptz/discord.py, which copies the repository. The install method is listed as a package manager, but the exact install command was not in the material available, so check the homepage at http://discordpy.rtfd.org/en/latest.
What do I need to run discord.py?
The listed prerequisite is Python 3. No other requirements are confirmed in the source.
Is discord.py free to use?
discord.py is licensed under the MIT licence. Read the licence file in the repository for the full terms.
Is discord.py a no-code bot builder?
No. discord.py is a code library, so you need to write Python to create a bot with it.
What are the alternatives to discord.py?
No comparable projects are listed in the source for this review, so no alternatives are named here. Developers in other languages should look for a library for their own language.
Why does the discord.py README not help me?
The README was empty in the material provided for this review. Use the project homepage at http://discordpy.rtfd.org/en/latest for documentation.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
discord.py is a good choice for Python developers and hobbyists who want to build a Discord bot with a Python wrapper, and it is MIT licensed. It is not a fit for people who want a bot without coding, or for developers using other languages. Because the README was unavailable for this review, confirm features and setup on the official homepage before you commit.
Install options & downloads