See here every colour and method the discord.Colour class has.
See here some of the API's you can use in your discord bot or anything. For any help or questions on how to use one, please contact the owner of the API and not me.
A much bigger list of APIs can be found here
[TOKEN] = API requires a token to access some if not all endpoints.
The descriptions are mostly copied from the API, sometimes personal or from the dev.
from __future__ import annotations | |
from typing import ( | |
Dict, | |
Generic, | |
List, | |
Optional, | |
TypeVar, | |
Any, | |
TYPE_CHECKING, | |
Sequence, |
See here an overcomplicated way to wait for input from a user using a modal. Every step is explained using comments.
This is meant to replace Client.wait_for("message")
for application commands.
- Easy way to construct a Modal with one text input field.
- Easily pass a check from the constructor
from typing import Any, TYPE_CHECKING, List | |
import asyncio | |
from discord import ui, Interaction | |
class GlobalView(ui.View): | |
def __init__( | |
self, |
The hyperlinks are either links to a gist or discord message in the discord.py server
- [2021-04-04]
- Danny starts development of discord.py 2.0
- [2021-08-28]
- Danny stops dpy development
- [2022-03-06]
- Danny starts dpy development again, after announcement of v10
- [2022-03-14]
- Danny reworks async stuff, breaking changes for all!
This gist shows how to make the bot wait for a message or reaction after doing a command. This should not be copypasted.
Check the discord.py docs for a detailed explanation of how it all works internally and which kwargs it takes.
See here two commands, one waiting for any message in a channel and the other waiting for a reaction with a specific emoji.
# for testing: | |
# import collections | |
# emoji = collections.namedtuple("emo", ["animated"])(False) | |
emoji = ... # some (Partial)Emoji object | |
guild = ... # some Guild object | |
emojis = guild.emojis | |
total = len(guild.emojis) | |
limit = guild.emoji_limit | |
animated = sum(1 for e in emojis if e.animated) |