Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discordSdk.ready() stuck in electron js #290

Open
whyzotee opened this issue Dec 8, 2024 · 0 comments
Open

discordSdk.ready() stuck in electron js #290

whyzotee opened this issue Dec 8, 2024 · 0 comments

Comments

@whyzotee
Copy link

whyzotee commented Dec 8, 2024

main.js

const { app, BrowserWindow } = require('electron')
const { DiscordSDK } = require('@discord/embedded-app-sdk')

const createWindow = () => {
    const mainWindow = new BrowserWindow({
        width: 800,
        height: 600,
    })

    mainWindow.loadFile('index.html')
    mainWindow.webContents.openDevTools()
}

const discordSetup = async () => {
    const discordSdk = new DiscordSDK('*******************'');
    console.log("discordSetup Start");
    await discordSdk.ready();
    console.log("discordSetup End!");
}

app.whenReady().then(() => {
    createWindow();
    discordSetup();
   
    app.on('activate', () => {
        if (BrowserWindow.getAllWindows().length === 0) createWindow()
    })
})

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') app.quit()
})

package.json

{
  "name": "Test",
  "version": "1.0.0",
  "description": "",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "whyzotee",
  "license": "MIT",
  "devDependencies": {
    "electron": "^33.2.1"
  },
  "dependencies": {
    "@discord/embedded-app-sdk": "^1.7.1"
  }
}

i don't know how to fix it please help, thank you.

@whyzotee whyzotee changed the title discordSdk.ready() stuck in electron discordSdk.ready() stuck in electron js Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant