fix nickname null bug

This commit is contained in:
kdh8219 2023-04-29 18:55:35 +09:00
parent e344d040f6
commit 1ab0a8c21d
2 changed files with 6 additions and 3 deletions

View file

@ -37,7 +37,9 @@ export default {
for (const member of member_data) {
let nickname: string;
try {
nickname = (await interaction.guild.members.fetch(member[0])).nickname;
nickname =
(await interaction.guild.members.fetch(member[0])).nickname ||
(await interaction.client.users.fetch(member[0])).username;
} catch (e) {
nickname = ``;
}

View file

@ -73,9 +73,10 @@ export default {
content: "`에러`: 해당 멤버는 등록되지 않았어요!",
});
}
let text = "";
text += (await interaction.guild.members.fetch(discord_id)).nickname;
text +=
(await interaction.guild.members.fetch(discord_id)).nickname ||
interaction.user.username;
text += ": ";
for (const user of the_datas.docs) {
const minecraft_uuid = user.data()["minecraft_uuid"];