🌐
discord.py
discordpy.readthedocs.io
Welcome to discord.py
Welcome to discord.py · Getting started · Getting help · Extensions · Manuals · Meta · discord.py is a modern, easy to use, feature-rich, and async ready API wrapper for Discord. Features: Modern Pythonic API using async/await syntax · Sane rate limit handling that prevents 429s ·
help_center
This is a list of Frequently Asked Questions regarding using discord.py and its extension modules.
API Reference
This module uses the Python logging module to log diagnostic and errors in an output independent way. If the logging module is not configured, these logs will not be output anywhere. See Setting Up Logging for more information on how to set up and use the logging module with discord.py.
Introduction
Scripts executed with py -3 will ignore any currently active virtual environment, as the -3 specifies a global scope. discord.py revolves around the concept of events. An event is something you listen to and then respond to.
Creating a Bot Account
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
🌐
GitHub
github.com › Rapptz › discord.py
GitHub - Rapptz/discord.py: An API wrapper for Discord written in Python. · GitHub
A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.
Starred by 16K users
Forked by 3.9K users
Languages   Python
Discussions

Danny, creator of discord.py, is halting development of the library. Discord.py has come to an end - will likely have a major effect on bots
Wow, just read through the gist...this is sad. Also, to think that all bot commands might someday become only slash commands...shudders More on reddit.com
🌐 r/Python
99
540
August 28, 2021
Newest 'discord.py' Questions - Stack Overflow
Stack Overflow | The World’s Largest Online Community for Developers More on stackoverflow.com
🌐 stackoverflow.com
Is discord bot development with python becoming deprecated?

No there are a lot of other libraries

And discord official is an API so you can always go back to the basic raw api calling

More on reddit.com
🌐 r/Discord_Bots
11
12
February 23, 2022
My first real project! A RollBot using discord.py

Any feedback would be greatly welcomed. I'll be updating it as I go, but I am so excited to go from 0 to this.

So I'll give some points to improve on:

  • Put IDs and bot tokens in a config file, and provide an example config with fake values. That way you can avoid breaking the code when uploading the public version. It is not obvious exactly where in the code your IDs should go (and which IDs to use) without reading the whole code and looking at discord.py's documentation.

  • No need to calculate diceroll for every voice state change. Just calculate it right before you use it, because for the majority of voice state changes your bot sees you won't be needing it.

  • No need to look up my_channel until you need it either.

  • You check if member == client.get_user(): twice in such a way that the second time you check it, it's guaranteed to be true. You should remove one of those two checks.

  • The code rolling the dice and sending it (on voice state change) should probably be its own function. The checks can stay in the voice state change function, but the actual dice rolling feels like a separate idea when compared to the idea of checking voice states, so it should probably be in a separate function.

Personally I host my bots on OVH (on their £3/month tier) but I heard that Google Cloud, Amazon AWS, and Microsoft Azure all do their own free tiers. If you don't know the linux/unix command line, learn it, because adding Windows onto a server greatly increases its cost due to licensing fees.

More on reddit.com
🌐 r/learnpython
1
1
August 12, 2019
🌐
PyPI
pypi.org › project › discord.py
discord.py · PyPI
A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.
      » pip install discord.py
    
Published   Mar 03, 2026
Version   2.7.1
🌐
Python Discord
pythondiscord.com › pages › guides › python-guides › discordpy
Python Discord | Discord.py Learning Guide
A learning guide for the discord.py bot framework written by members of our community.
🌐
Discord.py
discordpy.readthedocs.io › en › latest › intro.html
Introduction - discord.py
This is the documentation for discord.py, a library for Python to aid in creating applications that utilise the Discord API.
🌐
Discord
discord.com › invite › python
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 421924 members
🌐
discord.py
discordpy.readthedocs.io › en › stable › quickstart.html
Quickstart - Discord.py - Read the Docs
# This example requires the 'message_content' intent. import discord intents = discord.Intents.default() intents.message_content = True client = discord.Client(intents=intents) @client.event async def on_ready(): print(f'We have logged in as {client.user}') @client.event async def on_message(message): if message.author == client.user: return if message.content.startswith('$hello'): await message.channel.send('Hello!') client.run('your token here') Let’s name this file example_bot.py.
🌐
Discord.py
discordpy.readthedocs.io › en › latest › api.html
API Reference
This module uses the Python logging module to log diagnostic and errors in an output independent way. If the logging module is not configured, these logs will not be output anywhere. See Setting Up Logging for more information on how to set up and use the logging module with discord.py.
Find elsewhere
🌐
Interactions-py
interactions-py.github.io › interactions.py
Interactions.py
A highly extensible, easy to use, and feature complete framework for Discord. interactions.py is the culmination of years of experience with Discord's APIs and bot development. This framework has been built from the ground up with community feedback and suggestions in mind.
🌐
Fallendeity
fallendeity.github.io › discord.py-masterclass
Discord.py Masterclass
Python 3.8 or higher installed on your computer. A Discord bot created on the Discord Developer Portal.
🌐
Open Collective
opencollective.com › discordpy
discord.py - Open Collective
discord.py is a popular Discord library for creating Discord bots and generally interacting with the Discord API.
🌐
Pycord
pycord.dev
HOME - Pycord
Pycord: The library for building Discord bots in Python
🌐
PyPI
pypi.org › project › discord.py-self
discord.py-self · PyPI
A modern, easy-to-use, feature-rich, and async-ready API wrapper for Discord’s user API written in Python.
      » pip install discord.py-self
    
Published   Jan 18, 2026
Version   2.1.0
🌐
Reddit
reddit.com › r/python › danny, creator of discord.py, is halting development of the library. discord.py has come to an end - will likely have a major effect on bots
r/Python on Reddit: Danny, creator of discord.py, is halting development of the library. Discord.py has come to an end - will likely have a major effect on bots
August 28, 2021 - It's pretty upsetting for us (you can see this in the comments) to hear about such a successful Python project just perishing like that. ... Yeah I honestly like Discord.js a lot more, it also gives you an incentive to learn another language. For example, it was the first time I worked with asynchronous code.
🌐
GitHub
github.com › Rapptz › discord.py › blob › master › examples › basic_bot.py
discord.py/examples/basic_bot.py at master · Rapptz/discord.py
An API wrapper for Discord written in Python. Contribute to Rapptz/discord.py development by creating an account on GitHub.
Author   Rapptz
🌐
Built In
builtin.com › software-engineering-perspectives › discord-bot-python
Build a Discord Bot With Python | Built In
Summary: A Discord bot in Python ... the discord.py library, developers can create bots that respond to events like messages or server joins, enabling custom commands and features within Discord....
🌐
Fallendeity
fallendeity.github.io › discord.py-masterclass › creating-a-bot
Creating a Discord Bot - Discord.py Masterclass
Python 3.8 or higher installed on your computer. A Discord bot created on the Discord Developer Portal.
🌐
GitHub
gist.github.com › 4Kaylum › a1e9f31c31b17386c36f017d3c59cdcc
A simple bot tutorial for Discord.py · GitHub
This snippet, though short, is ... you've not told it to yet), but it is a valid bot · The basis of Discord.py is to have functions that are triggered by events....
🌐
Stack Overflow
stackoverflow.com › questions › tagged › discord.py
Newest 'discord.py' Questions - Stack Overflow
I am building a Discord Bot using Python + SQLite3, and am creating a function /add_active that adds all users in the guild with a role 'active'. However, my application can't seem to access member ...
🌐
Medium
medium.com › @callmej.co › installing-python-and-discord-py-on-your-pc-3069c87940cb
Installing Python and discord.py on your PC | by callmeJ | Medium
April 23, 2023 - So we’re going to need two primary dependencies to get the bot up and running. The first is python itself, the language the program is written in and the second is discord.py which is a library of functions we can use to make the code work with the discord API.