Compare commits

..

No commits in common. "cf7939a815f6768da1209974561c50220ae405fc" and "94d73cd542432a62f76b276f7637428d4268b4cf" have entirely different histories.

2 changed files with 6 additions and 8 deletions

View File

@ -8,8 +8,6 @@ module.exports = {
.setDescription('Show the list of games you have beaten.') .setDescription('Show the list of games you have beaten.')
.addUserOption(option => option.setName('user').setDescription('The user to check')), .addUserOption(option => option.setName('user').setDescription('The user to check')),
async execute(interaction) { async execute(interaction) {
await interaction.reply({ content: 'Searching for user...', ephemeral: true });
let user = interaction.user; let user = interaction.user;
const userOption = interaction.options.getUser('user'); const userOption = interaction.options.getUser('user');
@ -18,7 +16,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.reply({ content: `Issue checking registration with "${user.username}".`, ephemeral: true });
await interaction.reply({ content: `Searching for ${user.username}...`, ephemeral: true });
const beatenGamesDatabaseEntries = await getGames(userDatabaseEntry.id); const beatenGamesDatabaseEntries = await getGames(userDatabaseEntry.id);
if (!beatenGamesDatabaseEntries || beatenGamesDatabaseEntries.length == 0) return interaction.followUp({ content: 'No games found.', ephemeral: true }); if (!beatenGamesDatabaseEntries || beatenGamesDatabaseEntries.length == 0) return interaction.followUp({ content: 'No games found.', ephemeral: true });

View File

@ -8,8 +8,6 @@ module.exports = {
.setDescription('Delete a game that you have beaten from the 100 game challenge!') .setDescription('Delete a game that you have beaten from the 100 game challenge!')
.addNumberOption(option => option.setName('beatgamenumber').setDescription('Index of the game to delete in the list of beaten games.').setMinValue(1).setMaxValue(100)), .addNumberOption(option => option.setName('beatgamenumber').setDescription('Index of the game to delete in the list of beaten games.').setMinValue(1).setMaxValue(100)),
async execute(interaction) { async execute(interaction) {
await interaction.reply({ content: 'Searching for user...', ephemeral: true });
const beatGameNumber = interaction.options.getNumber('beatgamenumber'); const beatGameNumber = interaction.options.getNumber('beatgamenumber');
const userDatabaseEntry = await getUserRegistration(interaction.user); const userDatabaseEntry = await getUserRegistration(interaction.user);
@ -27,7 +25,7 @@ module.exports = {
const gameDatabaseEntry = await checkGameStorageId(result.gameId); const gameDatabaseEntry = await checkGameStorageId(result.gameId);
const body = `where id = ${ gameDatabaseEntry.igdb_id }; fields *;`; const body = `where id = ${ gameDatabaseEntry.igdb_id }; fields *;`;
const res = await getGameJson(body); const res = await getGameJson(body);
if (!res) return interaction.followUp({ content: 'No game found.', ephemeral: true }); if (!res) return interaction.reply({ content: 'No game found.', ephemeral: true });
const game = res[0]; const game = res[0];
const num = await getBeatenGameCount(userDatabaseEntry); const num = await getBeatenGameCount(userDatabaseEntry);
@ -42,9 +40,9 @@ module.exports = {
.setFooter({ text: 'The Ochulus • 100 Games Challenge', iconURL: interaction.client.user.avatarURL() }) .setFooter({ text: 'The Ochulus • 100 Games Challenge', iconURL: interaction.client.user.avatarURL() })
.setTimestamp(); .setTimestamp();
return interaction.followUp({ embeds: [embed] }); return interaction.reply({ embeds: [embed] });
} }
return interaction.followUp({ content: 'Unable to delete entry / No entry found.', ephemeral: true }); return interaction.reply({ content: 'Unable to delete entry / No entry found.', ephemeral: true });
}, },
}; };