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