Skip to content

Commit

Permalink
chore: update discord ipc
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMoonThatRises committed Jan 28, 2025
1 parent d2d239c commit a253dd3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions PlayTools/DiscordActivity/DiscordIPC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ class DiscordIPC {
if PlaySettings.shared.discordActivity.enable {
let ipc: SwordRPC
let custom = PlaySettings.shared.discordActivity

if custom.applicationID.isEmpty {
ipc = SwordRPC(appId: "996108521680678993")
} else {
ipc = SwordRPC(appId: custom.applicationID)
}
Task.init(priority: .background) {

Task(priority: .background) {
let activity = await createActivity(from: custom)
ipc.connect()
ipc.setPresence(activity)
Expand Down Expand Up @@ -68,9 +70,10 @@ class DiscordIPC {

activity.timestamps.start = Date()

activity.buttons[0].label = "Download PlayCover"
activity.buttons[0].url = "https://github.com/PlayCover/PlayCover/releases"
activity.buttons.removeLast()
activity.buttons = [
RichPresence.Button(label: "Download PlayCover",
url: "https://github.com/PlayCover/PlayCover/releases")
]

return activity
}
Expand Down

0 comments on commit a253dd3

Please sign in to comment.