Use findOne
This commit is contained in:
parent
205dcf6ff1
commit
6ab1adfe5b
|
@ -46,10 +46,10 @@ export default new class EmoteModule extends BuiltinModule {
|
||||||
await this.loadLocalDb();
|
await this.loadLocalDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
const userData = await Database.find({ 'id': 'EmoteModule' });
|
const userData = await Database.findOne({ 'id': 'EmoteModule' });
|
||||||
if (userData && userData.length) {
|
if (userData) {
|
||||||
if (userData[0].hasOwnProperty('favourites')) this._favourites = userData[0].favourites;
|
if (userData.hasOwnProperty('favourites')) this._favourites = userData.favourites;
|
||||||
if (userData[0].hasOwnProperty('mostused')) this._mostUsed = userData[0].mostused;
|
if (userData.hasOwnProperty('mostused')) this._mostUsed = userData.mostused;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.patchMessageContent();
|
this.patchMessageContent();
|
||||||
|
|
Loading…
Reference in New Issue