Skip to content

Commit

Permalink
fix null is typing...
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaliks committed Jan 15, 2023
1 parent c0939d3 commit e4d495f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/addMemberList.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function addMemberList(guild) {
// Make the username text
let username = document.createElement('p');
username.classList.add('mLUsername');
let name = m.nickname || m.user.username;
let name = m.displayName;
// if (name.length > 15) {
// name = `${name.substring(0, 15)}...`
// }
Expand Down Expand Up @@ -195,7 +195,7 @@ function addMemberList(guild) {
// Make the username text
let username = document.createElement('p');
username.classList.add('mLUsername');
username.innerText = m.nickname || m.user.username;
username.innerText = m.displayName;
username.style.color = m.roles.color?.hexColor || '#8E9297';
userDiv.appendChild(username);
});
Expand Down
2 changes: 1 addition & 1 deletion js/buildMemberMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function buildMemberMenu(parent) {
// Username and nickname
let topName = document.createElement('span');
topName.classList.add('memberTopName');
topName.innerText = member.nickname || member.user.username;
topName.innerText = member.displayName;
user.appendChild(topName);

if (member.nickname) {
Expand Down
4 changes: 2 additions & 2 deletions js/parseMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function formatPings(msg, text, dms) {
let user = dms
? bot.users.cache.get(id)
: msg.guild.members.cache.get(id);
name = user ? user.nickname || (user.user || user).username : id;
name = user?.displayName || user?.username || id;
} else if (type == 'role' && !dms) {
let role = msg.guild.roles.cache.get(id);
name = role ? role.name : id;
Expand Down Expand Up @@ -164,7 +164,7 @@ function formatEmbedPings(msg, text, dms) {
let user = dms
? bot.users.cache.get(id.replace(/!/, ''))
: msg.guild.members.cache.get(id.replace(/!/, ''));
name = user ? user.nickname || (user.user || user).username : id;
name = user?.displayName || user?.username || id;

if (name == id && !dms) {
let role = msg.guild.roles.cache.get(id);
Expand Down
2 changes: 1 addition & 1 deletion js/typingStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function typingStatus(override = false, m = undefined) {
}

for (let user in users) {
let name = dms ? users[user].username : users[user].nickname;
let name = dms ? users[user].username : users[user].displayName;
if (user != length - 1) text += name + ', ';
else text += name;
}
Expand Down

0 comments on commit e4d495f

Please sign in to comment.