diff --git a/src/store.ts b/src/store.ts index 0218e296aab666f143a50a2dd14d57a741fac252..2cd2517931a140a928263cda9c6c2dc58b9c0a23 100644 --- a/src/store.ts +++ b/src/store.ts @@ -137,22 +137,22 @@ export class DiscordStore { public get_user_discord_ids(userId: string): Promise<string[]> { log.silly("SQL", "get_user_discord_ids => %s", userId); - return this.db.getAsync( + return this.db.allAsync( ` SELECT discord_id FROM user_id_discord_id - WHERE user_id = $userId + WHERE user_id = $userId; `, { $userId: userId, }, ).then( (rows) => { if (rows !== undefined) { - rows.map((row) => row.discord_id); + return rows.map((row) => row.discord_id); } else { return []; } }).catch( (err) => { - log.error("DiscordStore", "Error getting discord ids %s", err.Error); + log.error("DiscordStore", "Error getting discord ids: %s", err.Error); throw err; }); }