Change list outputs to use embed instead
This commit is contained in:
parent
fa786d66fe
commit
b3f78a3f25
|
@ -21,16 +21,17 @@ module.exports = {
|
|||
if (!userDatabaseEntry) return interaction.followUp({ content: `Issue checking registration with "${user.username}".`, ephemeral: true });
|
||||
|
||||
const beatenGamesDatabaseEntries = await getBeatenGames(userDatabaseEntry.id);
|
||||
if (!beatenGamesDatabaseEntries || beatenGamesDatabaseEntries.length == 0) return interaction.followUp({ content: 'No games found.', ephemeral: true });
|
||||
|
||||
let desc = '';
|
||||
|
||||
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), ' \t', game.name, '\n');
|
||||
if (!beatenGamesDatabaseEntries || beatenGamesDatabaseEntries.length == 0) {
|
||||
desc = `${user.displayName} has not beaten any games yet.`;
|
||||
} else {
|
||||
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), ' \t', game.name, '\n');
|
||||
}
|
||||
}
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
|
|
|
@ -21,16 +21,17 @@ module.exports = {
|
|||
if (!userDatabaseEntry) return interaction.followUp({ content: `Issue checking registration with "${user.username}".`, ephemeral: true });
|
||||
|
||||
const databaseEntries = await getPlayingGames(userDatabaseEntry.id);
|
||||
if (!databaseEntries || databaseEntries.length == 0) return interaction.followUp({ content: 'No games found.', ephemeral: true });
|
||||
|
||||
let desc = '';
|
||||
|
||||
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('-\t', game.name, '\n');
|
||||
if (!databaseEntries || databaseEntries.length == 0) {
|
||||
desc = `${user.displayName} is currently playing no games.`;
|
||||
} else {
|
||||
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), ' \t', game.name, '\n');
|
||||
}
|
||||
}
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
|
|
|
@ -21,16 +21,17 @@ module.exports = {
|
|||
if (!userDatabaseEntry) return interaction.followUp({ content: `Issue checking registration with "${user.username}".`, ephemeral: true });
|
||||
|
||||
const databaseEntries = await getPlanningGames(userDatabaseEntry.id);
|
||||
if (!databaseEntries || databaseEntries.length == 0) return interaction.followUp({ content: 'No games found.', ephemeral: true });
|
||||
|
||||
let desc = '';
|
||||
|
||||
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('-\t', game.name, '\n');
|
||||
if (!databaseEntries || databaseEntries.length == 0) {
|
||||
desc = `${user.displayName} currently has no planned games.`;
|
||||
} else {
|
||||
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), ' \t', game.name, '\n');
|
||||
}
|
||||
}
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
|
|
Loading…
Reference in New Issue