Separate Developer and Publishers in gameDetails
This commit is contained in:
parent
ec56eada19
commit
4ce09185d3
@ -69,16 +69,37 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (game.involved_companies) {
|
if (game.involved_companies) {
|
||||||
const companies = [];
|
const developers = [];
|
||||||
|
const publishers = [];
|
||||||
|
|
||||||
for (const company of game.involved_companies) {
|
for (const company of game.involved_companies) {
|
||||||
const info = await getCompanyInfo(company);
|
const info = await getCompanyInfo(company);
|
||||||
if (info.name) {
|
|
||||||
companies.push(info.name);
|
if (info.developed)
|
||||||
|
{
|
||||||
|
if (info.developed.find(item => item === game.id)) {
|
||||||
|
developers.push(info.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (info.published)
|
||||||
|
{
|
||||||
|
if (info.published.find(item => item === game.id)) {
|
||||||
|
publishers.push(info.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
embed.addFields({ name: 'Developers', value: `${companies.join(', ')}`, inline: true });
|
if (developers.length > 0)
|
||||||
|
{
|
||||||
|
embed.addFields({ name: 'Developers', value: `${developers.join(', ')}`, inline: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (publishers.length > 0)
|
||||||
|
{
|
||||||
|
embed.addFields({ name: 'Publishers', value: `${publishers.join(', ')}`, inline: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
embed.addFields({ name: 'Release Date', value: `${release_date}`, inline: true });
|
embed.addFields({ name: 'Release Date', value: `${release_date}`, inline: true });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user