Make it work with group DM

This commit is contained in:
fishyFrogFace 2017-09-30 23:12:17 +02:00
parent ddaa2e6325
commit 78c4935614

View File

@ -219,9 +219,11 @@ class Bot {
}
static getDiscordNicknameOnServer(user, guild) {
const userDetails = guild.members.get(user.id);
if (userDetails) {
return userDetails.nickname || user.username;
if (guild) {
const userDetails = guild.members.get(user.id);
if (userDetails) {
return userDetails.nickname || user.username;
}
}
return user.username;
}