flybywiresim / discord-bot

This is the repository for the FlyByWire Simulations Discord bot
https://flybywiresim.com
GNU Affero General Public License v3.0
17 stars 36 forks source link

"Executed By" Not Reflecting Latest Change in Discord Usernames #465

Closed JasonO99 closed 1 year ago

JasonO99 commented 1 year ago

Bug type

Utility or complex functionality issue

Describe the bug

Since Discord have removed the need for a discriminator in their update to Discord usernames, the 'Executed By' text at the bottom of some commands still puts "#0" at the end despite the username not having any discriminator anymore.

Example Discord Message - https://discord.com/channels/738864299392630914/740722295009706034/1115821195917525032

8c83ba48f018906ff4147280ae96ba51

My username is now just jason_91 in Discord, since being updated.

Expected behavior

Username should show the discriminator if the username has one, otherwise it should not show "#0" if there isn't one.

Steps to reproduce

  1. Use Bot Command that displays "Executed By" text when used

References (optional)

Discord Blog Post on Username Changes - https://discord.com/blog/usernames

Additional info (optional)

No response

Discord Username (optional)

jason_91

benw202 commented 1 year ago

Hey Jason, thanks for this.

I think this will require a little bit of looking into (as I am sure we are going to start encountering more strangeness, for example we use user tags in our moderation logs - this will do the same).

Perhaps we're waiting on an update on Discords end where msg.user.tag displays correctly depending if a user has an old or new username. Eventually all users will be on the new system and discord.js would reflect that. I can't see them keeping username#0 for everyone when we are all on the new system.

pdellaert commented 1 year ago

As we just using the user tag as provided by the discord API, and it is the one that generates it, we can't really do much about it, at this point.

Think once they update discord.js for this new behavior, we might get a fix automatically.

benw202 commented 1 year ago

image

During migration the #0 is temporary - we don't rely on discriminators for anything so we don't need to do anything

JasonO99 commented 1 year ago

I see. I wasn't aware the #0 is what Discord API returns, I thought it might be something the bot code done to put a value there or similar.

Just a case of waiting for the conversion and Discord will remove #0 - in my example it's not the end of the world, it was more to highlight the issue in case it impacts something else in the bot code.

Putting it down as a Discord 'issue' then and needing to be patient for the discriminator names to be obsolete.