1
Renamer
kingston edited this page 2026-11-03 12:51:18 -06:00

Renamer

Administrator nickname tools. Three commands change one member, a list of members, or every member holding a role.

Requirements

The bot needs Manage Nicknames and a role positioned above the members it renames. Discord refuses nickname changes for the server owner and for members whose highest role is at or above the bot's highest role.

Commands

Command Arguments Permission
[p]renamer rename <member> [nickname] Administrator
[p]renamer bulkrename <members...> <nickname> Administrator
[p]renamer massrename <role> <nickname> Administrator

All three are guild only. The check is admin_or_permissions(administrator=True), which passes for members with the Administrator permission and for Red's admin roles.

rename

[p]renamer rename @Alice Alice
[p]renamer rename @Alice

The nickname argument is optional and keyword only. Leaving it out clears the nickname, and the confirmation says the nickname was cleared. The audit log reason is Renamed by <author>.

bulkrename

[p]renamer bulkrename @Alice @Bob @Carol Team

members uses Greedy, so the final word is taken as the nickname. At least one member is required. Every member is set to the same nickname in sequence. The reply reports how many succeeded and how many failed, without naming the failures.

massrename

[p]renamer massrename @Team Team

Iterates role.members, which comes from the local member cache, so very large guilds may include a partial list until the cache is complete. The reply includes the role mention and the same success and failure counts.

Error handling

rename reports specific failures: a permission error produces "I don't have permission to rename that member." and an HTTP error includes the exception text.

bulkrename and massrename count discord.Forbidden and discord.HTTPException as failures and continue through the list. They do not report which members failed or why.

How it works

Each command calls member.edit(nick=..., reason=...). Discord applies its own rate limits; the cog does not pace requests, so a mass rename of a large role proceeds as fast as the API accepts and may hit the global rate limit, which appears as an HTTP failure in the count.

No hostname or moderator role hierarchy precheck is performed. A command can partially succeed.

Limits

  • Nickname length is enforced by Discord, which rejects values over 32 characters. The cog passes the value through and reports the HTTP error.
  • bulkrename and massrename accept one nickname for everyone, so the result is a set of identical display names.
  • There is no undo. The audit log records each change with the reason string.

Stored data

Guild config under identifier 182736451 contains allowed_roles, an empty list by default. No command reads or writes it. It appears to be a leftover from an earlier permission model and has no effect on behavior.