misc updates
This commit is contained in:
parent
95c52b7ad5
commit
c31a3d6e04
|
@ -20,11 +20,9 @@ module.exports = {
|
|||
const userDatabaseEntry = await getUserRegistration(user);
|
||||
if (!userDatabaseEntry) return interaction.followUp({ content: `Issue checking registration with "${user.username}".`, ephemeral: true });
|
||||
|
||||
let databaseEntries = await getPlayingGames(userDatabaseEntry.id);
|
||||
const databaseEntries = await getPlayingGames(userDatabaseEntry.id);
|
||||
if (!databaseEntries || databaseEntries.length == 0) return interaction.followUp({ content: 'No games found.', ephemeral: true });
|
||||
|
||||
databaseEntries = databaseEntries.reverse();
|
||||
|
||||
let desc = '';
|
||||
|
||||
for (let i = 0; i < databaseEntries.length; i++) {
|
||||
|
|
|
@ -91,7 +91,7 @@ async function createPlayingGameEntry(user, game) {
|
|||
entry.status = 'playing';
|
||||
|
||||
await entry.save();
|
||||
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ async function getRecentBeatenGameEntry(userId) {
|
|||
}
|
||||
|
||||
async function getRecentGameEntry(userId, status) {
|
||||
const beatenGameEntry = await LoggedGames.findOne({ where: { userId: userId, status: status }, order: [ [ 'updatedAt', 'ASC' ]] })
|
||||
const beatenGameEntry = await LoggedGames.findOne({ where: { userId: userId, status: status }, order: [ [ 'updatedAt', 'DESC' ]] })
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue