Skip to content

Commit

Permalink
feat: wip cmd handling
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Aug 8, 2024
1 parent bc270df commit 4b87de1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugins/shelteRPC/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ async function handleMessage(e: MessageEvent<string>) {
const data = JSON.parse(e.data)
const assets = data.activity?.assets

if (data.cmd) return handleCmd(data)

if (assets?.large_image)
assets.large_image = await generateAssetId(
data.activity.application_id,
Expand Down Expand Up @@ -102,6 +104,13 @@ async function handleMessage(e: MessageEvent<string>) {
})
}

const handleCmd = async (payload: any) => {
switch(payload.cmd) {
case 'INVITE_BROWSER':
// TODO
}
}

const retry = async (fn: (curTry: number) => any, times: number = 5, wait: number = 500) => {
let result

Expand Down

0 comments on commit 4b87de1

Please sign in to comment.