Skip to content

Commit

Permalink
feat(DeepSeek): add activity (#9226)
Browse files Browse the repository at this point in the history
* fix(package-lock-version): upgraded cli version in package-lock.json

* feat(deepseek): create a new presence

* feat(deepseek): added a setting

* feat(deepseek): added a setting

* feat(deepseek): done with feature

* feat(deepseek): done with feature

* fix(deepseek): fixed lint

* fix(deepseek): added 512x512

* fix(deepseek): removed old lang

* fix(deepseek): removed comment

* Update websites/D/DeepSeek/presence.ts

change play and paused

Co-authored-by: Daniel Lau <[email protected]>
Signed-off-by: Tschöggi <[email protected]>

* fix(deepseek): removed promise all

* fix(deepseek): fixed logo

* fix(deepseek): possible null and format

* fix(deepseek): possible null

---------

Signed-off-by: Tschöggi <[email protected]>
Co-authored-by: Daniel Lau <[email protected]>
Co-authored-by: Florian Metz <[email protected]>
Co-authored-by: Bas van Zanten <[email protected]>
  • Loading branch information
4 people authored Feb 24, 2025
1 parent 387df2d commit 21b58eb
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 0 deletions.
22 changes: 22 additions & 0 deletions websites/D/DeepSeek/DeepSeek.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"deepSeek.startingPrompt": {
"description": "Displayed when the user is on the page to start a new prompt.",
"message": "Phrasing a new prompt..."
},
"deepSeek.talkingWithAi": {
"description": "Displayed when the user is engaging in a conversation with the AI and the Chat title is not shown",
"message": "Talking with AI about something"
},
"deepSeek.aiTalking": {
"description": "Displayed when the AI is generating a response.",
"message": "AI is responding..."
},
"deepSeek.readingResponse": {
"description": "Displayed when the user is reading the response of the AI.",
"message": "Reading the AI's response"
},
"deepSeek.askingQuestion": {
"description": "Displayed when the user is asking a question.",
"message": "Asking a question..."
}
}
36 changes: 36 additions & 0 deletions websites/D/DeepSeek/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://schemas.premid.app/metadata/1.13",
"apiVersion": 1,
"author": {
"id": "1167417152664522764",
"name": "Kaktuswerk"
},
"service": "DeepSeek",
"description": {
"en": "DeepSeek-V3 achieves a significant breakthrough in inference speed over previous models. It tops the leaderboard among open-source models and rivals the most advanced closed-source models globally."
},
"url": "chat.deepseek.com",
"version": "1.0.0",
"logo": "https://i.imgur.com/QfuHG4T.png",
"thumbnail": "https://i.imgur.com/xSgmreb.png",
"color": "#2885d1",
"category": "other",
"tags": [
"ai",
"chat",
"chatbot",
"conversations"
],
"settings": [
{
"id": "lang",
"multiLanguage": true
},
{
"id": "showTitle",
"title": "Show chat title",
"icon": "fa-solid fa-message-quote",
"value": true
}
]
}
58 changes: 58 additions & 0 deletions websites/D/DeepSeek/presence.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const presence = new Presence({
clientId: '1333939310441009182',
})
async function getStrings() {
return presence.getStrings({
play: 'general.playing',
pause: 'general.paused',
newPrompt: 'deepSeek.startingPrompt',
talkingWithAi: 'deepSeek.talkingWithAi',
aiTalking: 'deepSeek.aiTalking',
readingResponse: 'deepSeek.readingResponse',
askingQuestion: 'deepSeek.askingQuestion',
})
}
const browsingTimestamp = Math.floor(Date.now() / 1000)

enum Assets {
Logo = 'https://i.imgur.com/QfuHG4T.png',
}

presence.on('UpdateData', async () => {
const { pathname } = document.location
const showTitle = await presence.getSetting<boolean>('showTitle')

let presenceDetail: string, presenceState: string

const strings = await getStrings()

if (pathname === '/') {
presenceDetail = strings?.newPrompt ?? ''
}
else if (pathname.includes('/a/chat/s')) {
presenceDetail = (showTitle
? document.querySelector('div.d8ed659a')?.textContent
: strings?.talkingWithAi) ?? ''
}
else {
presenceDetail = strings?.talkingWithAi ?? ''
}

// Used for checking if the AI is currently responding

// Checking if the user is currently typing a question
if (document.querySelector('#chat-input')?.textContent !== '')
presenceState = strings?.askingQuestion ?? ''
else if (document.querySelector('div[class=\'f9bf7997 d7dc56a8\']'))
presenceState = strings?.aiTalking ?? ''
else if (document.querySelector('div.f9bf7997.d7dc56a8.c05b5566'))
presenceState = strings?.readingResponse ?? ''
else presenceState = ''

presence.setActivity({
largeImageKey: Assets.Logo,
startTimestamp: browsingTimestamp,
details: presenceDetail,
state: presenceState,
})
})

0 comments on commit 21b58eb

Please sign in to comment.