Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nadeshiko): add activity #9206

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

feat(nadeshiko): add activity #9206

wants to merge 12 commits into from

Conversation

noowz
Copy link

@noowz noowz commented Jan 27, 2025

Acknowledgements

Screenshots

Proof showing the creation/modification is working as expected

@noowz
Copy link
Author

noowz commented Jan 27, 2025

I don't know why it changed all the other Activities metadata files, is it normal?

@theusaf theusaf requested a review from Bas950 January 27, 2025 18:40
},
"url": "nadeshiko.io",
"version": "1.0.0",
"logo": "https://i.imgur.com/3QzrCo4.png",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logo must be 512x512

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logo must be 512x512

https://i.imgur.com/8gPbuTy.png

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be a square as well

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be a square as well

https://i.imgur.com/tDAXNRP.png

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one should be good. Please apply the URL to the code and commit it.

browsingTimestamp = Math.floor(Date.now() / 1000);

const enum Assets {
Logo = "https://i.imgur.com/3QzrCo4.png",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Logo = "https://i.imgur.com/3QzrCo4.png",
Logo = "https://i.imgur.com/tDAXNRP.png",

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a way to get the Logo URL from the metadata logo field?

Copy link
Member

@theusaf theusaf Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose you could import the metadata json, but it's probably fine/better to update the url in the code instead

Comment on lines 95 to 99
if (oldLang !== languageSetting) {
oldLang = languageSetting;

strings = await getStrings();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation of getStrings no longer needs the oldLang hack to work efficiently. Instead, just embed the presence.getStrings directly here

const strings = await presence.getStrings(...)

@noowz noowz requested review from Bas950 and theusaf January 29, 2025 22:47
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this change. (You might need to update your branch)

@theusaf theusaf enabled auto-merge (squash) February 3, 2025 21:41
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@noowz
Copy link
Author

noowz commented Feb 18, 2025

I have to update something for the /leaderboards page btw, I'll try to update it ASAP.

function homePage() {
presenceData.details = strings.viewHome;
presenceData.state = `${strings.search} for a player or guild...`;
presenceData.smallImageKey = Assets.Search;

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Property 'Search' does not exist on type 'typeof Assets'.
gameSelected && leaderboardSelected
? `${
strings.viewing
} ${gameSelected?.textContent.trim()} - ${leaderboardSelected?.textContent.trim()} leaderboard`

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

'gameSelected.textContent' is possibly 'null'.
gameSelected && leaderboardSelected
? `${
strings.viewing
} ${gameSelected?.textContent.trim()} - ${leaderboardSelected?.textContent.trim()} leaderboard`

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

'leaderboardSelected.textContent' is possibly 'null'.
} ${gameSelected?.textContent.trim()} - ${leaderboardSelected?.textContent.trim()} leaderboard`
: `${strings.search} for a leaderboard...`;
presenceData.smallImageKey =
gameSelected && leaderboardSelected ? Assets.Viewing : Assets.Search;

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Property 'Viewing' does not exist on type 'typeof Assets'.
} ${gameSelected?.textContent.trim()} - ${leaderboardSelected?.textContent.trim()} leaderboard`
: `${strings.search} for a leaderboard...`;
presenceData.smallImageKey =
gameSelected && leaderboardSelected ? Assets.Viewing : Assets.Search;

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Property 'Search' does not exist on type 'typeof Assets'.
else {
presenceData.details = `${strings.viewProfile} ${playerOrGuild}`;
presenceData.state = `${strings.viewing} guild stats`;
presenceData.smallImageKey = Assets.Viewing;

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Property 'Viewing' does not exist on type 'typeof Assets'.
return homePage();
else {
presenceData.details = `${strings.viewProfile} ${playerOrGuild}`;
presenceData.state = `${strings.viewing} ${achievementsGameNames[game]} achievements`;

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Type 'undefined' cannot be used as an index type.
else {
presenceData.details = `${strings.viewProfile} ${playerOrGuild}`;
presenceData.state = `${strings.viewing} ${achievementsGameNames[game]} achievements`;
presenceData.smallImageKey = Assets.Viewing;

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Property 'Viewing' does not exist on type 'typeof Assets'.
else {
presenceData.details = `${strings.viewProfile} ${playerOrGuild}`;
presenceData.state = `${strings.viewing} quests`;
presenceData.smallImageKey = Assets.Viewing;

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Property 'Viewing' does not exist on type 'typeof Assets'.
return presence.setActivity({
details: strings.browsing,
startTimestamp: browsingTimestamp,
smallImageKey: Assets.Viewing,

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Property 'Viewing' does not exist on type 'typeof Assets'.
"thumbnail": "https://i.imgur.com/9wL3Frb.png",
"color": "#872D4D",
"category": "games",
"tags": [

Check failure

Code scanning / PMD

Makes sure the `tags` don't contain the service name Error

Tags must not contain the service name
@PreMiD-Automations PreMiD-Automations force-pushed the main branch 2 times, most recently from 838facc to ee88c98 Compare February 24, 2025 18:04
@theusaf theusaf added the inactive PR/Issue has been inactive for a while and will be closed soon label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
activity creation inactive PR/Issue has been inactive for a while and will be closed soon
Development

Successfully merging this pull request may close these issues.

4 participants