fix query

This commit is contained in:
Erik 2022-11-09 17:26:00 +02:00
parent 5274059ca4
commit 4c09c2f3d6
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -69,7 +69,7 @@ class UserDatabase extends AbstractUserDatabase {
let user = this.cache.find((u) => u.externalProfiles.discord?.id === profile.id);
if (user) return Promise.resolve(user);
const data = await this.collection.findOne({ 'discord.id': profile.id });
const data = await this.collection.findOne({ 'externalProfiles.discord.id': profile.id });
if (data) user = this._createUser(data);
else {
this.logger.info(`Creating new user from Discord profile: ${profile.username} (${profile.id})`);