mojira / mojira-discord-bot

🎮 A Discord bot for linking to and providing information about Mojira tickets
https://discord.gg/rpCyfKV
GNU General Public License v3.0
19 stars 9 forks source link

Display user names the same everywhere #281

Open violine1101 opened 1 year ago

violine1101 commented 1 year ago

Purpose

Display new user handles as @violine1101 and old ones as violine1101#8993 everywhere.

This also should fix the issue where messages could not be deleted if you had a new user handle.

Approach

Add a helper function in DiscordUtil to decide how to print the name. Also added two more helper function for consistent setting of embed footers and authors.

Future work

We'll probably need to rework this with the next discord.js update anyway, I presume (though I haven't checked their progress on the matter)

chandler05 commented 1 year ago

I can take a look at this later, but from what I can tell this would still leave #201 as an issue. Not sure if you'd want to figure out a solution for that here, or if you'd rather leave that alone right now.

violine1101 commented 1 year ago

I've specifically tested that case and it should work (though only with my second commit)

mdashlw commented 1 year ago

Missed this: https://github.com/mojira/mojira-discord-bot/blob/437f7b51ad8a76fbf5035385804f82d69eef6a27/src/util/RequestsUtil.ts#L75


discord.js support for pomelo was added in 14.12.0 (currently using 14.2.0). user.tag now returns username or username#tag whereas this getUserHandle returns @username