Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions websites/R/Roblox/presence.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Assets } from 'premid'
// import { Assets } from 'premid'
import { Presence, PresenceData, Assets } from 'premid'; // TS hates when you dont define it all.

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Module '"premid"' has no exported member 'Presence'.

Check failure

Code scanning / PMD

Makes sure the TypeScript files are correct Error

Module '"premid"' has no exported member 'PresenceData'.

Check failure

Code scanning / ESLint

Enforce consistent usage of type imports Error

Imports "PresenceData" are only used as type.

Check failure

Code scanning / ESLint

Enforce sorted named imports. Error

Expected "Assets" to come before "PresenceData".

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

const presence = new Presence({
clientId: '612416330003382314',
Expand Down Expand Up @@ -37,7 +38,7 @@
'#horizontal-tabs li.rbx-tab.active',
)
const newUrl = new URL(href)
const searchResult = newUrl.searchParams?.get('Keyword') ?? newUrl.searchParams?.get('query')
const searchResult = (newUrl.searchParams.get('keyword') ?? newUrl.searchParams.get('query'))?.toLowerCase() ?? null;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
const item = document.querySelector<HTMLHeadingElement>(
'.item-name-container h2',
)?.textContent
Expand Down Expand Up @@ -92,10 +93,8 @@
presenceData.state = profileName?.textContent
}

presenceData.largeImageKey = document
.querySelector('.avatar-card-link.avatar-image-link')
?.querySelector('img')
?.getAttribute('src') ?? ActivityAssets.Logo
const profileImg = document.querySelector<HTMLImageElement>('.avatar-card-link.avatar-image-link img');

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presenceData.largeImageKey = profileImg?.src ?? ActivityAssets.Logo;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

presenceData.buttons = [
{
Expand Down Expand Up @@ -480,7 +479,10 @@
break
}
case pathname.includes('/u/'): {
//const user = document.querySelector('.username')?.textContent

Check failure

Code scanning / ESLint

Enforce consistent spacing after the `//` or `/*` in a comment Error

Expected exception block, space or tab after '//' in comment.
// for some reason, the devforum has different classes per user? weird?
const user = document.querySelector('.username')?.textContent
?? document.querySelector('.user-card-name')?.textContent;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presenceData.state = `Browsing ${user}'s Profile`
presenceData.largeImageKey = document.querySelector<HTMLImageElement>('.user-profile-avatar img')
?.src ?? ActivityAssets.DeveloperLogo
Expand Down Expand Up @@ -596,11 +598,11 @@
break
}
case pathname.includes('/translator-portal'): {
presenceData.details = 'Browsing trough the translator portal'
presenceData.details = 'Browsing through the translator portal'
break
}
case pathname.includes('credentials'): {
presenceData.details = 'Viewing the credentails manager'
presenceData.details = 'Viewing the credentials manager'
break
}
case pathname.includes('/docs'): {
Expand Down
Loading