Show images for unknown titles and add Nintendo eShop link in Discord

This commit is contained in:
Samuel Elliott 2022-03-13 20:03:06 +00:00
parent d750ed5a1f
commit 78e502bca2
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
2 changed files with 8 additions and 3 deletions

View File

@ -4,7 +4,6 @@ export const defaultTitle: Title = {
id: '0000000000000000',
client: '950883021165330493',
titleName: true,
largeImageKey: 'nintendoswitch',
};
const titles: Title[] = [

View File

@ -115,9 +115,15 @@ export function getDiscordPresence(game: Game, friendcode?: CurrentUser['links']
presence: {
details: text[0],
state: text[1],
largeImageKey: title.largeImageKey,
largeImageText: friendcode && title.largeImageKey ? 'SW-' + friendcode.id : undefined,
largeImageKey: title.largeImageKey ?? game.imageUri,
largeImageText: friendcode ? 'SW-' + friendcode.id : undefined,
smallImageKey: title.smallImageKey,
buttons: game.shopUri ? [
{
label: 'Nintendo eShop',
url: game.shopUri,
},
] : [],
},
showTimestamp: title.showTimestamp,
};