naeruru / starboard

starboard / smugboard discord bot for moonmoon discord server
MIT License
42 stars 17 forks source link

Display name support #34

Closed Erisa closed 1 year ago

Erisa commented 1 year ago

Currently the starboard shows a users username, not their nickname or their username#1234 if present.

Given the changes towards a unique username & display name situation, it would probably make more sense to use the display name there, if present, going forward, rather than the username.

Most likely this requires some kind of library upgrade that I haven't looked into, putting this here to voice the thought.

naeruru commented 1 year ago

makes sense to me. unfortunately discord.js has not yet exposed that information, but when they do, it will simply be changing author.username to author.global_name (https://discord.com/developers/docs/change-log#identifying-migrated-users). the workaround is to fetch the user from the guild member list and get their nickname that way, but that requires more permissions and an additional fetch so I think I will wait for the former.

I will update to the latest discord.js for it which also switches their internals to use the ws package (14.10.0+).

naeruru commented 1 year ago

nickname (globalName) will now show by default. if nickname does not exist, it will fallback to username

(requires discord.js 14.12.0)