Update title overrides README and add Discord configuration issue template

This commit is contained in:
Samuel Elliott
2022-04-30 12:26:11 +01:00
parent 018c92cc62
commit 18dbf14365
3 changed files with 122 additions and 3 deletions

View File

@@ -0,0 +1,61 @@
name: Discord title configuration
description: Suggest changes to a title's appearance in Discord
# title:
labels:
- Discord title configuration
assignees:
- samuelthomas2774
body:
- type: input
id: title-name
attributes:
label: Title name
description: The full name of the title, exactly as it appears on a Nintendo Switch console or Nintendo eShop. If you are requesting a custom Discord application for this title, this will be used as it's name.
validations:
required: true
- type: input
id: publisher
attributes:
label: Publisher
description: The name of the title's publisher. This isn't used in Discord activities or any other features; this is just used to categorise titles.
validations:
required: true
- type: textarea
id: title-ids
attributes:
label: Title IDs
description: |
Include all related title IDs and their names, for example any demos or other versions (such as regional variants and online/prerelease demos), from all Nintendo eShop regions, even if they are not available for download.
If the title/s already has/have custom Discord configuration, you don't need to include all title IDs - just one to identify it. If the title hasn't been released yet and doesn't have a title ID, add a note in the other information section below, and the expected release date and links to Nintendo websites/Nintendo eShop NSUIDs.
Application title IDs are 16 hexadecimal digits, and should start with `0100` and end with `0000`, `2000`, `4000`, `6000`, `8000`, `a000`, `c000` or `e000`.
placeholder: |
0100d2f00d5c0000 Nintendo Switch Sports
01000ee017182000 Nintendo Switch Sports Online Play Test
...
validations:
required: true
- type: textarea
id: other-information
attributes:
label: Other information
description: |
Include any other relevant information, such as custom attributes that should be set for the title, or any changes that should be made to the existing configuration, or any other related titles that have/will be released.
validations:
required: true
- type: checkboxes
id: review-checklist
attributes:
label: Review checklist
options:
- label: No other open issues related to this title exist (if any issues do exist, add a comment/reaction to those instead of opening a new issue)
required: true
- label: I am requesting a custom Discord application for this title - this title is a very popular game and/or has high ratings, is currently available for purchase (or will be soon) in most Nintendo eShop regions, and it would be useful for a number of users to have it's own Discord application (I don't have any strict guidelines for which titles should have custom Discord applications - tick if you think the title should have it's own Discord application - I just want to keep the list short so I don't have to create 100s of Discord applications)
required: false

View File

@@ -2,3 +2,56 @@ Title overrides for Discord activities
---
This directory contains custom configuration for titles. The default configuration for all other titles is in [src/discord/titles.ts](../titles.ts). This is used by [src/discord/util.ts](../util.ts) (which also declares the type for title configuration objects) to convert znc presences to Discord activities.
`nxapi util validate-discord-titles` can be used to check title IDs are in the correct format.
Most titles shouldn't have their own Discord application - only the most popular games. Where a title does have it's own Discord application it should also be used for any related titles (e.g. demos, regional variants).
Finding title IDs
---
### 1. Presence
The title ID of the application you are using is included in the Nintendo eShop link in your Nintendo Switch presence. (This is what nxapi uses to find the title ID.)
You can retrieve this using nxapi by:
- Running `nxapi nso user --force-refresh`
- Running `nxapi nso friends --json | jq '.[] | select(.nsaId == "0123456789abcdef").presence'` (where `0123456789abcdef` is the NSA ID of the friend you want to get presence of)
- Clicking the Nintendo eShop button in a Discord activity - Discord will show the link and ask you to confirm opening it, however it will not let you copy the link
The Nintendo eShop link will look like this:
```
https://ec.nintendo.com/apps/0100f8f0000a2000/GB?lang=en-GB
```
In this link, the title ID is `0100f8f0000a2000`.
### 2. Nintendo Switch Parental Controls title download notifications
The title ID of any applications you download are recorded in daily summaries in the Nintendo Switch Parental Controls app. The title doesn't need to be used and the download can be cancelled immediately - it only needs to be queued. This is recorded when queuing downloads of application titles and does not include addon content or update data titles, so the application must be archived or deleted for this to be recorded again.
You can retrieve this using nxapi by running:
```sh
# 0123456789abcdef is the device ID
nxapi pctl daily-summaries 0123456789abcdef --json | jq '.items | .[] | .observations | .[] | select(.type == "DID_APP_DOWNLOAD_START")'
```
### 3. Nintendo Switch Parental Controls usage records
The title ID of any applications you use (for at least 5 minutes in any day) are recorded in daily summaries and monthly summaries in the Nintendo Switch Parental Controls app.
You can retrieve this using nxapi by running:
```sh
# 0123456789abcdef is the device ID
nxapi pctl daily-summaries 0123456789abcdef --json | jq '[ .items | .[] | .playedApps ] | flatten | unique_by(.applicationId)'
nxapi pctl monthly-summary 0123456789abcdef 2022-03 --json | jq '.playedApps | unique_by(.applicationId)'
```
### 4. titledb
Title IDs for most titles can be found at https://github.com/blawar/titledb (although some demo title IDs are unavailable).

View File

@@ -105,13 +105,18 @@ export function getTitleConfiguration(game: Game, id: string) {
});
}
type SystemModuleTitleId = `01000000000000${string}`;
type SystemDataTitleId = `01000000000008${string}`;
type SystemAppletTitleId = `0100000000001${string}`;
type ApplicationTitleId = `0100${string}${'0' | '2' | '4' | '6' | '8' | 'a' | 'c' | 'e'}000`;
export interface Title {
/**
* Lowercase hexadecimal title ID.
*
* Valid title IDs are 16 characters long, and should start with `0100` and end with `0000`, `2000`, `4000`, `6000`, `8000`, `a000`, `c000`, `e000` (this is because applications have 4^16 title IDs for the application itself, plus addon content and update data).
* Valid application title IDs are 16 characters long, and should start with `0100` and end with `0000`, `2000`, `4000`, `6000`, `8000`, `a000`, `c000`, `e000` (this is because applications have 16^4 title IDs for the application itself, plus addon content and update data).
*/
id: string;
id: ApplicationTitleId | '0000000000000000';
/**
* Discord client ID
*/
@@ -133,7 +138,7 @@ export interface Title {
largeImageKey?: string;
largeImageText?: string;
/**
* By default this will not be set.
* By default the user's icon and friend code will be used if the user is sharing their friend code; otherwise it will not be set.
*/
smallImageKey?: string;
smallImageText?: string;