Unify formatting of lists
This commit is contained in:
parent
0c10dfb3c4
commit
80e0eb9c69
|
@ -26,13 +26,14 @@ module.exports = {
|
||||||
if (!beatenGamesDatabaseEntries || beatenGamesDatabaseEntries.length == 0) {
|
if (!beatenGamesDatabaseEntries || beatenGamesDatabaseEntries.length == 0) {
|
||||||
desc = `${user.displayName} has not beaten any games yet.`;
|
desc = `${user.displayName} has not beaten any games yet.`;
|
||||||
} else {
|
} 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++) {
|
for (let i = 0; i < beatenGamesDatabaseEntries.length; i++) {
|
||||||
const gameid = await checkGameStorageId(beatenGamesDatabaseEntries[i].gameId);
|
const gameid = await checkGameStorageId(beatenGamesDatabaseEntries[i].gameId);
|
||||||
const res = await getGameJson(`where id = ${ gameid.igdb_id }; fields *;`);
|
const res = await getGameJson(`where id = ${ gameid.igdb_id }; fields *;`);
|
||||||
const game = res[0];
|
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,14 @@ module.exports = {
|
||||||
if (!databaseEntries || databaseEntries.length == 0) {
|
if (!databaseEntries || databaseEntries.length == 0) {
|
||||||
desc = `${user.displayName} is currently playing no games.`;
|
desc = `${user.displayName} is currently playing no games.`;
|
||||||
} else {
|
} else {
|
||||||
desc = desc.concat('__Total: ', databaseEntries.length, '__\n\n');
|
desc = desc.concat('__Total: ', databaseEntries.length, '__\n');
|
||||||
|
|
||||||
for (let i = 0; i < databaseEntries.length; i++) {
|
for (let i = 0; i < databaseEntries.length; i++) {
|
||||||
const gameid = await checkGameStorageId(databaseEntries[i].gameId);
|
const gameid = await checkGameStorageId(databaseEntries[i].gameId);
|
||||||
const res = await getGameJson(`where id = ${ gameid.igdb_id }; fields *;`);
|
const res = await getGameJson(`where id = ${ gameid.igdb_id }; fields *;`);
|
||||||
const game = res[0];
|
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ module.exports = {
|
||||||
if (!databaseEntries || databaseEntries.length == 0) {
|
if (!databaseEntries || databaseEntries.length == 0) {
|
||||||
desc = `${user.displayName} currently has no planned games.`;
|
desc = `${user.displayName} currently has no planned games.`;
|
||||||
} else {
|
} else {
|
||||||
desc = desc.concat('__Total: ', databaseEntries.length, '__\n\n');
|
desc = desc.concat('__Total: ', databaseEntries.length, '__\n');
|
||||||
|
|
||||||
for (let i = 0; i < databaseEntries.length; i++) {
|
for (let i = 0; i < databaseEntries.length; i++) {
|
||||||
const gameid = await checkGameStorageId(databaseEntries[i].gameId);
|
const gameid = await checkGameStorageId(databaseEntries[i].gameId);
|
||||||
|
|
Loading…
Reference in New Issue