opencode-discord 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +2 -2
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -5,11 +5,11 @@ const CLIENT_ID = process.env.DISCORD_CLIENT_ID ?? "1486144419940929676"
|
|
|
5
5
|
|
|
6
6
|
type Activity = "idle" | "thinking" | "editing" | "running" | "reading"
|
|
7
7
|
|
|
8
|
-
export const DiscordStatus: Plugin = async ({ client: sdk, project }) => {
|
|
8
|
+
export const DiscordStatus: Plugin = async ({ client: sdk, project, directory }) => {
|
|
9
9
|
const rpc = new Client({ clientId: CLIENT_ID })
|
|
10
10
|
let connected = false
|
|
11
11
|
let sessionActive = false
|
|
12
|
-
let currentProject = project?.name ?? "Unknown Project"
|
|
12
|
+
let currentProject = project?.name ?? (directory ? directory.split(/[\\/]/).pop() ?? "Unknown Project" : "Unknown Project")
|
|
13
13
|
let startTimestamp = Date.now()
|
|
14
14
|
let lastEditedFile: string | undefined
|
|
15
15
|
let activity: Activity = "idle"
|