Unify formatting of lists

This commit is contained in:
baz 2024-03-18 19:54:35 +00:00
parent 0c10dfb3c4
commit 80e0eb9c69
3 changed files with 7 additions and 5 deletions

View File

@ -26,13 +26,14 @@ module.exports = {
if (!beatenGamesDatabaseEntries || beatenGamesDatabaseEntries.length == 0) {
desc = `${user.displayName} has not beaten any games yet.`;
} else {
desc = desc.concat('__Total: ', beatenGamesDatabaseEntries.length, '/100__\n\n');
desc = desc.concat('__Total: ', beatenGamesDatabaseEntries.length, '/100__\n');
for (let i = 0; i < beatenGamesDatabaseEntries.length; i++) {
const gameid = await checkGameStorageId(beatenGamesDatabaseEntries[i].gameId);
const res = await getGameJson(`where id = ${ gameid.igdb_id }; fields *;`);
const game = res[0];
desc = desc.concat('**#', (i + 1), '** ', game.name, '\n');
const date = beatenGamesDatabaseEntries[i].updatedAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/');
desc = desc.concat('**#', (i + 1), ' (', date, ')**: ', game.name, '\n');
}
}

View File

@ -26,13 +26,14 @@ module.exports = {
if (!databaseEntries || databaseEntries.length == 0) {
desc = `${user.displayName} is currently playing no games.`;
} else {
desc = desc.concat('__Total: ', databaseEntries.length, '__\n\n');
desc = desc.concat('__Total: ', databaseEntries.length, '__\n');
for (let i = 0; i < databaseEntries.length; i++) {
const gameid = await checkGameStorageId(databaseEntries[i].gameId);
const res = await getGameJson(`where id = ${ gameid.igdb_id }; fields *;`);
const game = res[0];
desc = desc.concat('**#', (i + 1), '** ', game.name, '\n');
const date = databaseEntries[i].updatedAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/');
desc = desc.concat('**#', (i + 1), ' (', date, ')**: ', game.name, '\n');
}
}

View File

@ -26,7 +26,7 @@ module.exports = {
if (!databaseEntries || databaseEntries.length == 0) {
desc = `${user.displayName} currently has no planned games.`;
} else {
desc = desc.concat('__Total: ', databaseEntries.length, '__\n\n');
desc = desc.concat('__Total: ', databaseEntries.length, '__\n');
for (let i = 0; i < databaseEntries.length; i++) {
const gameid = await checkGameStorageId(databaseEntries[i].gameId);