opencode-discord 1.3.0 → 1.4.0

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.
Files changed (2) hide show
  1. package/index.ts +4 -4
  2. package/package.json +2 -2
package/index.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { Plugin } from "@opencode-ai/plugin"
2
- import RPC from "discord-rpc"
2
+ import { Client } from "@xhayper/discord-rpc"
3
3
 
4
4
  const CLIENT_ID = process.env.DISCORD_CLIENT_ID ?? "1369345745815339008"
5
5
 
6
6
  export const DiscordStatus: Plugin = async ({ project }) => {
7
- const client = new RPC.Client({ transport: "ipc" })
7
+ const client = new Client({ clientId: CLIENT_ID })
8
8
  let connected = false
9
9
  let sessionActive = false
10
10
  let currentProject = project?.name ?? ""
@@ -30,7 +30,7 @@ export const DiscordStatus: Plugin = async ({ project }) => {
30
30
  : "Idle"
31
31
 
32
32
  try {
33
- await client.setActivity({
33
+ await client.user?.setActivity({
34
34
  details,
35
35
  state,
36
36
  startTimestamp,
@@ -63,7 +63,7 @@ export const DiscordStatus: Plugin = async ({ project }) => {
63
63
 
64
64
  try {
65
65
  console.log(`[opencode-discord] logging in...`)
66
- await client.login({ clientId: CLIENT_ID })
66
+ await client.login()
67
67
  console.log(`[opencode-discord] login ok`)
68
68
  } catch (e) {
69
69
  connected = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-discord",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Discord Rich Presence plugin for OpenCode — shows your AI coding activity in Discord",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -25,6 +25,6 @@
25
25
  },
26
26
  "homepage": "https://github.com/TheUntraceable/opencode-discord-status#readme",
27
27
  "dependencies": {
28
- "discord-rpc": "^4.0.1"
28
+ "@xhayper/discord-rpc": "^1.3.1"
29
29
  }
30
30
  }