Calling of non-existent attribute interaction.target in /editrole command #245

Closed
opened 2026-02-17 14:33:37 -05:00 by sirdog3355 · 1 comment
sirdog3355 commented 2026-02-17 14:33:37 -05:00 (Migrated from github.com)

During a code review executed by Claude Opus 4.6, it advised me that in cogs/edit_role.py I have a user argument for discord.Member in the command

async def editrole(self, interaction: discord.Interaction, user: discord.Member, options: app_commands.Choice[str], ping: bool = False):

But I use interaction.target when attempting to reference the information:

logger.log(UNAUTHORIZED, f"{interaction.target.name} ({interaction.target.id}) attempted to remove temporary role {options.name} from {target.name} ({target.id}) via /editrole.")

This results in a silent failure for the relevant loggers to execute.

Need to correct these instances.

During a code review executed by [Claude Opus 4.6](https://claude.ai/), it advised me that in `cogs/edit_role.py` I have a `user` argument for `discord.Member` in the command ```py async def editrole(self, interaction: discord.Interaction, user: discord.Member, options: app_commands.Choice[str], ping: bool = False): ``` But I use `interaction.target` when attempting to reference the information: ```py logger.log(UNAUTHORIZED, f"{interaction.target.name} ({interaction.target.id}) attempted to remove temporary role {options.name} from {target.name} ({target.id}) via /editrole.") ``` This results in a silent failure for the relevant loggers to execute. Need to correct these instances.
sirdog3355 commented 2026-02-27 23:28:11 -05:00 (Migrated from github.com)

Addressed by #257. No documentation updates necessary. Closing.

Addressed by #257. No documentation updates necessary. Closing.
Sign in to join this conversation.
No description provided.