#discord-rpc: client.application

14 messages · Page 1 of 1 (latest)

vagrant fable
#

Hey guys, is it normal that client.application is null?

I created another discord-rpc project to test stuff, here's the code:

import { Client } from "discord-rpc";

const client = new Client({
    transport: "ipc"
});

client.on("ready", () => {
    console.log("Logged in as", client.application?.name);
    console.log("Authed for user", client.user?.username);
});

client.login({
    clientId: "839894528953810944"
}).then(() => {
    console.log(client);
});
grizzled cliffBOT
junior solstice
#

Without any scopes you won't authenticate so won't have an application, yes

vagrant fable
#

Or is it the actual app in Discord Dev Portal but there's no data available since there's any scopes being used?

junior solstice
#

It is the one from dev portal. But there's no authorization against the API happening if you don't request any scopes. So you won't get the app from the API in response

vagrant fable
#

Also, in my ready event file I was using name: Events.Ready, it changed into ClientReady iirc so now I have to manually write name: "ready" right? A lot of people were reporting me issues that the RPC was not working for them and I think it was because of that change

vagrant fable
#

Can you just answer me the question above please?

junior solstice
#

So sounds like you're mixing discord-rpc and discord.js which - apart from being hosted under the same org - have no relation to each other

vagrant fable
#

So now for it to work I have to manually write "ready" instead or is there any enum I can use exclusively for RPC?

junior solstice
#

No. There isn't. discord-rpc is a very old package that had no work being done to it for 4 years. And the rewrite of it isn't done yet. So no