-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
discord.py bug on await member.edit() function. #9839
Comments
Please put following code before bot.run or in command: import logging
logging.getLogger('discord.http').setLevel(logging.DEBUG) And send |
Hi, I cannot reproduce this error within the v2.3.2 release/tag of discord.py. I'm using the following code to test:- Codeblockimport logging
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix=">>!", intents=discord.Intents.all())
@bot.command()
async def nick(
ctx: commands.Context, member: discord.Member, nick: str | None = None
) -> None:
version = discord.version_info
await ctx.send(f"Version info: {version}")
await member.edit(nick=nick) # no return with these parameters
mem = ctx.guild.get_member(member.id) # fresh from cache
await ctx.send(f"Member new nick: {mem.nick}")
bot.run(
"...",
log_level=logging.DEBUG,
) There were no errors output in my console, nor present from what I could see. I got the following debug logging output:- Logs editing another member
I also tried on an upwards member in the hierarchy which errored as expected: Logs for upward hierarchy
So I'm at a loss for reproducing this error. Could you give more context to this, did you try and change the bot's nickname, someone else in the guild's nickname, and their hierarchical ordering compared to the bot itself within the guild? |
I don't get this error on my test bot |
I can see in your debug logging that your HTTP requests are going to |
I found that this error is causing for using https://github.com/twilight-rs/http-proxy and when i don't use it it works fine. |
Yeah. |
Historically we've had issues when users use the Twilight proxy, and it is outside of our scope for assistance. You'll need to raise this with the proxy developers and let them resolve the issue you're experiencing, as discord.py works as intended. |
Okay, thank you. |
For future visitors, the reason why this most likely failed is because the proxy URL did not have an explicit version set. The library assumes v10 of the Discord API, while the default unqualified version is v6. Therefore it manifests into these errors. |
Summary
Error on changing/reseting nickname.
Reproduction Steps
My nick command used to work fine but I don't know why I am getting this error today.
Minimal Reproducible Code
Expected Results
I expected it to changed the nickname or remove the nickname without any error.
Actual Results
I get the following error:
However the nickname changes without any issue, but I am not able to send the confirmation message as it stops the command execution.
Intents
message, guilds, members
System Information
Name: discord.py
Version: 2.3.2
Summary: A Python wrapper for the Discord API
Home-page: https://github.com/Rapptz/discord.py
Author: Rapptz
Author-email:
License: MIT
Location: /usr/lib/python3/dist-packages
Requires:
Required-by:
Python 3.11.6
Checklist
Additional Context
No response
The text was updated successfully, but these errors were encountered: