Category "discord.py"

Command for posting user's avatar

@bot.command(aliases=['av']) async def avatar(ctx, *, avamember : discord.Member = None): userAvatarUrl = avamember.avatar_url await ctx.send(userAvata

Discord Music Bot

I am creating a discord bot that plays music. It successfully joins a channel but then returns an error when searching for music. This is my code: @client.comma

How to get/save the attachment in a slash command?

What I'm trying to do here is get the url or raw file of a slash command attachment. Being the inexperienced person that I am, I've ran into some issues. On dis

Python mention random users from role

How can I mention multiple random users from a role member by using a command in a discord channel. @bot.command(pass_context=True) async def mention(ctx): #

_Context.send() got an unexpected keyword argument 'files'

Im using interactions.py and I cant figure out how to respond with an image await ctx.send(files="86.png")

Getting the url of a video of a new post using PRAW and send it to a discord server (praw, discord.py)

I'm trying to make a command in my discord.py bot that send the image or the video attacched to a post in reddit. But, when a post is with an Image, all works f

Updated - Create text_channel in specific category

So I am trying to create a text channel in a specific category. It worked but suddenly it's not. This is my Code: import discord from discord.ext import command

"on_raw_reaction_add" working but "on_raw_reaction_remove" not returning guild?

I coded on_eaw_reaction_add and it works just fine @commands.Cog.listener() async def on_raw_reaction_add(self, payload): msgID = 754487460142

Running Flask & a Discord bot in the same application

I am building a Discord bot in Python and would like to receive HTTP requests from Twitch.tv's API (See Webhooks Guide & Webhooks Reference) (To subscribe t

(Discord.py) My 8 Ball Command is having a small error here. It says that the thing that picks the responses to give is a error on startup?

@commands.command(name='8ball', description='Let the 8 Ball Predict!\n') async def _8ball(self, ctx, question): responses = ['As I see it, yes.

Discord Bot can only see itself and no other users in guild

I have recently been following this tutorial to get myself started with Discord's API. Unfortunately, when I got the part about printing all the users in the gu

How do I accept a string as an argument? (discord.py rewrite)

I am trying to make a discord.py command that accepts a string as a positional argument. How do I accept a string from a Discord message (and, by extension, boo

How do I accept a string as an argument? (discord.py rewrite)

I am trying to make a discord.py command that accepts a string as a positional argument. How do I accept a string from a Discord message (and, by extension, boo

Python discord bot - coroutine was never awaited

I'm working on a Discord bot and it works to some degree but it keeps crashing every couple minutes. It gives me an error like Task was detroyed but it's pendi

Commands don't run in discord.py 2.0 - no errors, but run in discord.py 1.7.3

I'm trying to understand how migrating from Discord.py version 1.7.3 to 2.0 works. In particular, this is test code I'm using: from discord.ext import commands

(Discord.py) Make my Bot only Respond to DM's

So I managed to get the basics of my Bot working which is good. However, when I try and send a message, for example execute /ping, the bot replies to it regardl

How to add Rate limit to dm_all command in discord.py?

I am using the code below to dm every member on the server and sometimes bot get rate limted at ultimately banned. I know this is against tos but out of curiosi

How to add Rate limit to dm_all command in discord.py?

I am using the code below to dm every member on the server and sometimes bot get rate limted at ultimately banned. I know this is against tos but out of curiosi

Is it possible to link the Discord server's name with its invite?

I have a list that stores dictionaries of the names of the servers my bot is in. The following is within a for loop, so server_name is different for each server

discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized

This is the huge error im getting: Traceback (most recent call last): File "C:\Users\User\AppData\Roaming\Python\Python310\site-packages\discord\http.py", lin