Skip to content
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

[Mod] Fixed not handling of nicknames that are too long. #2311

Merged
merged 3 commits into from
Dec 16, 2018

Conversation

Kowlin
Copy link
Member

@Kowlin Kowlin commented Nov 24, 2018

Type

  • Bugfix

Description of the changes

Fixed Mod not handling nicknames that exceed 32 characters.

@Kowlin Kowlin added V3 labels Nov 24, 2018
@Kowlin Kowlin requested a review from palmtree5 as a code owner November 24, 2018 20:57
Copy link
Contributor

@mikeshardmind mikeshardmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still isn't completely sufficient for preventig a traceback with this. see https://discordapp.com/developers/docs/resources/user#usernames-and-nicknames, should wrap in a try/except additionally.

await user.edit(reason=get_audit_reason(ctx.author, None), nick=nickname)
try:
await user.edit(reason=get_audit_reason(ctx.author, None), nick=nickname)
except discord.Forbidden:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer doing a hierarchy and perm check before the API call here.

The other error still needs to be caught for cases where the nick limitation is a result of discord not sharing all invalid nick parameters.

@Tobotimus Tobotimus merged commit a5efdc6 into Cog-Creators:V3/release/3.0.0 Dec 16, 2018
@Kowlin Kowlin deleted the pr/fix/rename branch February 12, 2021 09:15
@Jackenmen Jackenmen added the Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. label Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants