F
F
fgvnovoross2019-12-17 15:16:31
JavaScript
fgvnovoross, 2019-12-17 15:16:31

How to use Discord Join API and Spectate API in Node.js?

Javascript Node.js Help me understand using the library and API.
Is it possible to file features from screenshots (features that are originally from the Discord Api Game Sdk) into the game on Electron using the modules below. I could, but I don’t understand where to get the Secret of the team, the match, etc. In order for the Ask to join button to appear (or just Join in some cases), you need to specify partyMax, partySize, partyId, joinSecret in RichPresence. Where to get partyId and joinSecret??? To observe, specify spectateSecret. And where to get it???? I also read some articles and realized that the game needs to establish some kind of connection with the DS and then it would seem that it would be possible to get these values ​​...?
Help me figure it out please!
RichPresence code example in C++, C, Unreal, Unity:

static void UpdatePresence()
{
    char buffer[256];
    DiscordRichPresence discordPresence;
    memset(&discordPresence, 0, sizeof(discordPresence));
    discordPresence.state = "In a Group";
    sprintf(buffer, "Ranked | Mode: %d", GameEngine.GetMode());
    discordPresence.details = buffer;
    discordPresence.endTimestamp = time(0) + 5 * 60;
    discordPresence.largeImageKey = "canary-large";
    discordPresence.smallImageKey = "ptb-small";
    discordPresence.partyId = GameEngine.GetPartyId();
    discordPresence.partySize = 1;
    discordPresence.partyMax = 6;
    discordPresence.matchSecret = "4b2fdce12f639de8bfa7e3591b71a0d679d7c93f";
    discordPresence.spectateSecret = "e7eb30d2ee025ed05c71ea495f770b76454ee4e0";
    discordPresence.instance = 1;
    Discord_UpdatePresence(&discordPresence);
}

Electron
There is a Discord API
It has things like the GAME SDK
AND RichPresence
A module for using the Game SDK in Node.js and a module that simplifies the previous one .
5df8c6fd0c669306888061.jpeg5df8c7057a1e6038811589.png5df8c70ba88f5779345602.png5df8c712a3be2819051840.png5df8c717e42a5396594659.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question