Skip to content
← Back to Community
I am getting error = "Syntaxerror: Missing intializer in const declaration"
Profile icon
gfj126

Just help me on this to fix it :(

Answered by JustCoding123 [earned 5 cycles]
View Answer
Voters
Profile icon
gfj126
Comments
hotnewtop
Profile icon
JustCoding123

Change all the -s to =. So your code will be:

const RPC = require("discord-rpc") const client = new RPC.Client({ transport: "ipc" }) const activity = { details: "Join me", assets: { large_image: "images_512x512", large__text: "join me", small_image: "images_512x512", small_text: "just join" }, buttons: [ { "label": "Join", "url": "https" } ], timestamps: {start: Date.now()}, instance: true }; client.on("ready", () => { client.request("SET_ACTIVITY", {pid: process.pid, activity: activity}) console.log("DONE"); }) client.login({ clientId: "896042502606450698" });

(I also fixed some small errors)

Profile icon
gfj126

@JustCoding123 look still not working perfectly

Profile icon
JustCoding123

@gfj126 I don't know how to use discord-rpc so I can't help sorry