From a7e35351d333fc6792b0ec73859e063d12b263bf Mon Sep 17 00:00:00 2001 From: baz Date: Sat, 26 Jul 2025 02:58:39 +0100 Subject: [PATCH] Remove unnecessary substring --- commands/100-games/beatlist.js | 2 +- commands/100-games/changelog.js | 8 ++++---- commands/100-games/currentlyplaying.js | 2 +- commands/100-games/estimatedfinishdate.js | 2 +- commands/100-games/globalbeatlist.js | 2 +- commands/100-games/globalchangelog.js | 8 ++++---- commands/100-games/user.js | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/commands/100-games/beatlist.js b/commands/100-games/beatlist.js index 197d5bb..a2c75d9 100644 --- a/commands/100-games/beatlist.js +++ b/commands/100-games/beatlist.js @@ -29,7 +29,7 @@ module.exports = { for (let i = 0; i < beatenGamesDatabaseEntries.length; i++) { const game = await checkGameStorageId(beatenGamesDatabaseEntries[i].gameId); - const date = beatenGamesDatabaseEntries[i].statusLastChanged.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/'); + const date = beatenGamesDatabaseEntries[i].statusLastChanged.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }); desc = desc.concat('**#', (i + 1), ' (', date, ')**: ', game.name, '\n'); } } diff --git a/commands/100-games/changelog.js b/commands/100-games/changelog.js index 43abf72..b143d39 100644 --- a/commands/100-games/changelog.js +++ b/commands/100-games/changelog.js @@ -30,13 +30,13 @@ module.exports = { const game = await checkGameStorageId(changelogEntries[i].gameId); if (changelogEntries[i].newStatus == 'planning') { - newDesc = `:pencil: planned **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/')})*\n`; + newDesc = `:pencil: planned **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' })})*\n`; } else if (changelogEntries[i].newStatus == 'playing') { - newDesc = `:video_game: started playing **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/')})*\n`; + newDesc = `:video_game: started playing **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' })})*\n`; } else if (changelogEntries[i].newStatus == 'beat') { - newDesc = `:white_check_mark: beat **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/')})*\n`; + newDesc = `:white_check_mark: beat **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' })})*\n`; } else if (!changelogEntries[i].newStatus) { - newDesc = `:x: deleted **${game.name}** from **${changelogEntries[i].oldStatus}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/')})*\n`; + newDesc = `:x: deleted **${game.name}** from **${changelogEntries[i].oldStatus}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' })})*\n`; } if (newDesc.length + desc.length < 4096) { diff --git a/commands/100-games/currentlyplaying.js b/commands/100-games/currentlyplaying.js index 81b2252..6ccc53b 100644 --- a/commands/100-games/currentlyplaying.js +++ b/commands/100-games/currentlyplaying.js @@ -29,7 +29,7 @@ module.exports = { for (let i = 0; i < databaseEntries.length; i++) { const game = await checkGameStorageId(databaseEntries[i].gameId); - const date = databaseEntries[i].statusLastChanged.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/'); + const date = databaseEntries[i].statusLastChanged.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }); desc = desc.concat('**#', (i + 1), ' (', date, ')**: ', game.name, '\n'); } } diff --git a/commands/100-games/estimatedfinishdate.js b/commands/100-games/estimatedfinishdate.js index 15f4b68..5c9c76b 100644 --- a/commands/100-games/estimatedfinishdate.js +++ b/commands/100-games/estimatedfinishdate.js @@ -30,7 +30,7 @@ module.exports = { const days = (today - start) / (1000 * 60 * 60 * 24); const timepergame = days / beatenGamesDatabaseEntries.length; start.setDate(start.getDate() + (timepergame * 100)); - const formatteddate = start.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/'); + const formatteddate = start.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }); desc = `${user.displayName} is estimated to finish the 100 Games Challenge on **${formatteddate}**.`; } diff --git a/commands/100-games/globalbeatlist.js b/commands/100-games/globalbeatlist.js index cec67d0..622d050 100644 --- a/commands/100-games/globalbeatlist.js +++ b/commands/100-games/globalbeatlist.js @@ -21,7 +21,7 @@ module.exports = { for (let i = 0; i < beatenGamesDatabaseEntries.length; i++) { const game = await checkGameStorageId(beatenGamesDatabaseEntries[i].gameId); const userentry = await getUserFromId(beatenGamesDatabaseEntries[i].userId); - const date = beatenGamesDatabaseEntries[i].statusLastChanged.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/'); + const date = beatenGamesDatabaseEntries[i].statusLastChanged.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }); const newDesc = String.prototype.concat('**', date, '**: \t', game.name, ' \t*(', userentry.username, ')*\n'); if (newDesc.length + desc.length < 4096) { diff --git a/commands/100-games/globalchangelog.js b/commands/100-games/globalchangelog.js index bc73442..6d6a902 100644 --- a/commands/100-games/globalchangelog.js +++ b/commands/100-games/globalchangelog.js @@ -16,13 +16,13 @@ module.exports = { const user = await getUserFromId(changelogEntries[i].userId); if (changelogEntries[i].newStatus == 'planning') { - newDesc = `:pencil: *${user.username}* planned **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/')})*\n`; + newDesc = `:pencil: *${user.username}* planned **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' })})*\n`; } else if (changelogEntries[i].newStatus == 'playing') { - newDesc = `:video_game: *${user.username}* started playing **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/')})*\n`; + newDesc = `:video_game: *${user.username}* started playing **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' })})*\n`; } else if (changelogEntries[i].newStatus == 'beat') { - newDesc = `:white_check_mark: *${user.username}* beat **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/')})*\n`; + newDesc = `:white_check_mark: *${user.username}* beat **${game.name}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' })})*\n`; } else if (!changelogEntries[i].newStatus) { - newDesc = `:x: *${user.username}* deleted **${game.name}** from **${changelogEntries[i].oldStatus}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/')})*\n`; + newDesc = `:x: *${user.username}* deleted **${game.name}** from **${changelogEntries[i].oldStatus}** *(${changelogEntries[i].createdAt.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' })})*\n`; } if (newDesc.length + desc.length < 4096) { diff --git a/commands/100-games/user.js b/commands/100-games/user.js index 9e43d18..6fbc9b7 100644 --- a/commands/100-games/user.js +++ b/commands/100-games/user.js @@ -43,11 +43,11 @@ module.exports = { const days = (today - start) / (1000 * 60 * 60 * 24); const timepergame = days / beatenGamesDatabaseEntries.length; start.setDate(start.getDate() + (timepergame * 100)); - const date = start.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/'); + const date = start.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }); embed.addFields({ name: 'Estimated Finish Date', value: `${date}`, inline: true }); } - if (recentEntry) embed.addFields({ name: 'Last Updated', value: `${recentEntry.statusLastChanged.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' }).replace(/\//g, '/')}`, inline: true }); + if (recentEntry) embed.addFields({ name: 'Last Updated', value: `${recentEntry.statusLastChanged.toLocaleDateString('en-GB', { year: 'numeric', month: '2-digit', day: '2-digit' })}`, inline: true }); return interaction.editReply({ embeds: [embed] }); },