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 });
|
if (!userDatabaseEntry) return interaction.followUp({ content: `Issue checking registration with "${user.username}".`, ephemeral: true });
|
||||||
|
|
||||||
const beatenGamesDatabaseEntries = await getBeatenGames(userDatabaseEntry.id);
|
const beatenGamesDatabaseEntries = await getBeatenGames(userDatabaseEntry.id);
|
||||||
if (!beatenGamesDatabaseEntries || beatenGamesDatabaseEntries.length == 0) return interaction.followUp({ content: 'No games found.', ephemeral: true });
|
|
||||||
|
|
||||||
let desc = '';
|
let desc = '';
|
||||||
|
|
||||||
for (let i = 0; i < beatenGamesDatabaseEntries.length; i++) {
|
if (!beatenGamesDatabaseEntries || beatenGamesDatabaseEntries.length == 0) {
|
||||||
const gameid = await checkGameStorageId(beatenGamesDatabaseEntries[i].gameId);
|
desc = `${user.displayName} has not beaten any games yet.`;
|
||||||
const res = await getGameJson(`where id = ${ gameid.igdb_id }; fields *;`);
|
} else {
|
||||||
const game = res[0];
|
for (let i = 0; i < beatenGamesDatabaseEntries.length; i++) {
|
||||||
|
const gameid = await checkGameStorageId(beatenGamesDatabaseEntries[i].gameId);
|
||||||
desc = desc.concat('#', (i + 1), ' \t', game.name, '\n');
|
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()
|
const embed = new EmbedBuilder()
|
||||||
|
|
|
@ -21,16 +21,17 @@ module.exports = {
|
||||||
if (!userDatabaseEntry) return interaction.followUp({ content: `Issue checking registration with "${user.username}".`, ephemeral: true });
|
if (!userDatabaseEntry) return interaction.followUp({ content: `Issue checking registration with "${user.username}".`, ephemeral: true });
|
||||||
|
|
||||||
const databaseEntries = await getPlayingGames(userDatabaseEntry.id);
|
const databaseEntries = await getPlayingGames(userDatabaseEntry.id);
|
||||||
if (!databaseEntries || databaseEntries.length == 0) return interaction.followUp({ content: 'No games found.', ephemeral: true });
|
|
||||||
|
|
||||||
let desc = '';
|
let desc = '';
|
||||||
|
|
||||||
for (let i = 0; i < databaseEntries.length; i++) {
|
if (!databaseEntries || databaseEntries.length == 0) {
|
||||||
const gameid = await checkGameStorageId(databaseEntries[i].gameId);
|
desc = `${user.displayName} is currently playing no games.`;
|
||||||
const res = await getGameJson(`where id = ${ gameid.igdb_id }; fields *;`);
|
} else {
|
||||||
const game = res[0];
|
for (let i = 0; i < databaseEntries.length; i++) {
|
||||||
|
const gameid = await checkGameStorageId(databaseEntries[i].gameId);
|
||||||
desc = desc.concat('-\t', game.name, '\n');
|
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()
|
const embed = new EmbedBuilder()
|
||||||
|
|
|
@ -21,16 +21,17 @@ module.exports = {
|
||||||
if (!userDatabaseEntry) return interaction.followUp({ content: `Issue checking registration with "${user.username}".`, ephemeral: true });
|
if (!userDatabaseEntry) return interaction.followUp({ content: `Issue checking registration with "${user.username}".`, ephemeral: true });
|
||||||
|
|
||||||
const databaseEntries = await getPlanningGames(userDatabaseEntry.id);
|
const databaseEntries = await getPlanningGames(userDatabaseEntry.id);
|
||||||
if (!databaseEntries || databaseEntries.length == 0) return interaction.followUp({ content: 'No games found.', ephemeral: true });
|
|
||||||
|
|
||||||
let desc = '';
|
let desc = '';
|
||||||
|
|
||||||
for (let i = 0; i < databaseEntries.length; i++) {
|
if (!databaseEntries || databaseEntries.length == 0) {
|
||||||
const gameid = await checkGameStorageId(databaseEntries[i].gameId);
|
desc = `${user.displayName} currently has no planned games.`;
|
||||||
const res = await getGameJson(`where id = ${ gameid.igdb_id }; fields *;`);
|
} else {
|
||||||
const game = res[0];
|
for (let i = 0; i < databaseEntries.length; i++) {
|
||||||
|
const gameid = await checkGameStorageId(databaseEntries[i].gameId);
|
||||||
desc = desc.concat('-\t', game.name, '\n');
|
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()
|
const embed = new EmbedBuilder()
|
||||||
|
|
Loading…
Reference in New Issue