#archive-rpc-help

21942 messages · Page 11 of 22

keen flax

didn’t know why thas all

smoky scroll

How do I add image to this RPC?

{name: `Hobbe hotel, the best <3`, type: 1, url:"link"},
crisp creek

?pastebin

craggy boughBOT
craggy boughBOT
smoky scroll

I'm trying to get discord rich presence setup and working but I'm running into the issue of it not being able to connect apparently. The documents page practically has nothing to really read unfortunately, same with the NPMJS page and its github :/

 var rpc = require("discord-rpc");
 var vaas_rpc = new rpc.Client({transport:"ipc"});
 var clientId = "BOT CLIENT ID HERE";
 
 vaas_rpc.on("ready",function(){
     vaas_rpc.setActivity({
         details: "Place Holder Details",
         state: "Currently Beta Mode",
         largeImageKey: 'Place Holder Image set in discord dev page',
         largeImageText: 'Place Holder Text',
         startTimestamp: new Date()
     }).catch((reason) => console.error(reason));
 });
 vaas_rpc.login(clientId).catch((reason) => console.error(reason));```
sudden tusk

@smoky scroll

  1. You may pass an object in login method
  2. Apparently adding your clientToken helps
    vaas_rpc.login({clientId, clientToken})
smoky scroll

Still unable to connect for me

sudden tusk

Humm 🤔

What is your error message ?

smoky scroll
sudden tusk

Oh I'm sorry but I can't help on this one
🤔

Yeah can't figure out

Maybe someone else has a solution ?

smoky scroll
minor umbra

This is not possible for bots

drowsy tapir

Is there any way to make it like the Discord GameSDK where it doesn't show rich presence but it shows you are playing a game (with the icon)

Like this

old fable

wat

left fjord

Icon this way is only there because discord has one

wild frigate

how can i wait the end of the function before sending the message ?

wild frigate

ouai mais moi je veux pas un temps donné je veux des que l'action est fini et je pense que c'est faisable via de l'async

ahh oui j'avoue

je testerai demain ^^

strong chasm

I am getting an error No Client ID Specified?

const DiscordRPC = require('discord-rpc');
const clientId = "the client id";
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
rpc.login(clientId).catch(console.error);

rpc.on('ready', () => {
  rpc.setActivity({
    details: "Playing Main Lobby",
    state: "test",
    startTimestamp: new Date(),
    largeImageKey: "ct_logo",
    largeImageText: "ChatTriggers",
    smallImageKey: "hypixel",
    smallImageText: "Main Lobby",
    instance: true,
  });
});```
smoky scroll

You need to edit "the client id" with your client id

In Line 2

@strong chasm

strong chasm

Lol I know... It won't work..

smoky scroll

And did you Change?

strong chasm

But never mind I got something else working.

Wdym did I change?

smoky scroll

Wdym?

minor willow

What is djs-rpc for?

smoky scroll

@minor willow Discord - RichPrefrence

left fjord

Presence, not preference

smoky scroll

The RPC works with bots?

smoky scroll

no

old fable

read the pins

solemn shell

does setting rich presence's activity require any auth when using websocket transport ?

fresh crag

@smoky scroll changing it every 3s might be considered API Abuse

also for your main Question: This does not seem to be a libary question but rather how to use basic node.js wich is not the scope of this guild

smoky scroll

yeah, I'll change it to a higher number

thx

fresh crag

@solemn shell you cannot use websocket unless xou are in the private rpc beta

left fjord

what

that is not true

obtuse seal

Why would I be getting RPC_CONNECTION_TIMEOUT? My app has access to the internet and is not blocked by my firewall.

left fjord

aren't those 2 separate things

obtuse seal

One is a wrapper. It says it in the documentation.

Actually it says it in the embed.

urban shale

yeah...

leaden tusk

is there any way to run rpc on glitch ?

with token of user

smoky scroll

No

craggy boughBOT
delicate flint

wait since when get commits & etc redirected to here?

mild coyote

there's been a webhook for the rpc repo for a long time

brave wraith

Is it possible to change your rpc while using a bot?

Example: You'll click on 🦈 and then your rpc is "fishing some sharks" then you'll click on 📖 an then you rpc is "Working for math" or sonething like that

mild coyote

rpc is for games, so you could develop a "game" that does that for you

hidden linden

UnhandledPromiseRejectionWarning: Error: OAuth2 Error: invalid_request: Missing "redirect_uri" in request.

import * as RPC from "discord-rpc";

const clientId = "619611548532342795";
const scopes = ["rpc", "rpc.api"];

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

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

// Log in to RPC with client id
client.login({ clientId, scopes });
``` TS just for knowing what to do
ebon yew

Hi

Error: Could not connect

problem ?

dark lynx

@hidden linden try remove the scopes variable

wraith estuary

Can I use this on myself? Or would that be a selfbot

civic sedge

rpc is meant for people, it's what allows you to do stuff like with the vsc extension or detailed game data

craggy boughBOT
smoky scroll

what is rpc?

Rich Presence

unborn stream

is it possible to read and/or write messages with rpc? if so, how?

old fable

no

left fjord

it is

adding messages.read to scopes gives pretty

however, rpc.api gives that

@old fable

old fable

o_o

left fjord

imagine clicking authorize without reading

smoky scroll

xD

smoky scroll

Is it possible to set the PLAYING A GAME from rpc to something like Listening... Watching...

Only bots and official presences (like spotify) can do that

Ah okay... Guess this will be. Thanks 😄

frail gale

what is rpc though

unborn stream

hopefully for the last time, its rich presence

smoky scroll

what is rpc though /s

foggy dagger

GWmythicalGrandCat is there any built in application for discord rich presence by discord.js

hidden linden

what do you mean?

foggy dagger

I am looking for executable program write by node js to change discord rich presence

If it not exist I my try to write once

hidden linden

i dont understand

?npm discord-rpc

turbid oliveBOT
foggy dagger

Not package one

The program

hidden linden

what program?

foggy dagger

Program to change rich presence

But In JS

hidden linden

u can just make it but there is probably

i used one

foggy dagger

yes

That reason why I looking for it

If it is maybe we can maintain it

It not it okies

We can start from scratch

hidden linden
lusty depot

@hidden linden

delicate pollen

is it possible to use an Input() type thing for rich presence?

hidden linden

@lusty depot?

smoky scroll

@smoky scroll false, if you set the type In the gateway

Via websocket

Uh what

You said you can’t set listening, or whatever, In the rich presence type when connected to the gateway you can change it

Cool but, I think not native with this libary 🤔

Yea I know, it’s a manual thing

wild frigate

Hey, i do'nt know why i got "empty item" when it's actually a real number

even if i replace tempviews[8] with "p" i have the same result

wild frigate

Well it worked with i+=1 instead of i++

true dove

Does djs-rpc come in a webpack?

distant bane

i dont think so

it wouldnt be possible, probably

mainly because it uses ipc to connect with discord through your pc's internals

at least thats how i think it works, right?

true dove

But normal presence is possible with webpack?

distant bane

yes

true dove

It works differently I take it?

distant bane

yeah

old fable

looks like a web pack config to me

delicate pollen

Is there a way to set the input of your RP when you login in? (Example: Input() )

You type in console and it sets a status

unborn stream

is it possible to change the application name (or the text that appears after Playing:) without doing it manually?

delicate pollen

Create a new "bot"

smoky scroll

@old fable whats that browser?

old fable

um. google chrome on ios?

smoky scroll

oh, I've always used Safari so

foggy dagger

how to get app image when we got app client ID

Also for application name

I want to get assets app image that uploaded to app client

unborn stream

what is accessToken supposed to be? this is in RPCClient.login(), client.js:134

foggy dagger

@unborn stream I think that should be your access token

unborn stream

no shit sherlock

whats my access token

ok i got an access token, is it possible to send a message to a channel?

craggy boughBOT
craggy boughBOT
craggy boughBOT
unborn stream

what can i put into the evt parameter of RPCClient.subscribe()?

unborn stream

thank you

foggy dagger

How to fix this

subtle comet

define RPC

unborn stream

is it possible to do something like RPCClient.application.setName()or otherwise change the application name?

old fable

No

RPCClient#application is a readonly

foggy dagger

@subtle comet how to define it

Cause const RPC = require('discord-rpc') not working

unborn stream

use node.js

foggy dagger

@unborn stream What do you mean

I am using node Js

Electron to build application

unborn stream

okay whats the error

foggy dagger

As the screen shoot

unborn stream

if you do const RPC = require('discord-rpc') then RPC is something else than undefined

foggy dagger

it not working so I remove

It error when using const RPC = require('discord-rpc')

unborn stream

it says electron not found...

foggy dagger

Electron run normal

If not using dícord-rpc

shrewd gyro

so far it looks like you're trying to call rpc from the ui process of electron not the node process

unborn stream

^enable node integration in main process or do rpc stuff in main process

foggy dagger

I am call in it in main process of electron

Of course I know discord.js should run from B.E

Not F.E BTW

smoky scroll

do you see any discord rich presence modules for javascript on npm?

unborn stream

?npm discord-rpc

turbid oliveBOT
craggy boughBOT
craggy boughBOT
unkempt skiff

What must i change?

left fjord

install git

unkempt skiff

how can i make that? @left fjord

left fjord

you use google

type literally how to install git

follow one of 7123965482937456 available guides

unborn stream

i did rpcclient.subscribe('MESSAGE_CREATE', { channel_id: <string>, }, callback) but the callback function didnt execute when i sent a message to that channeö, what did i do wrong or has devsnek done something wrong

carmine mica

did you request messages.read?

unborn stream

probably not

unkempt skiff

How can make, that the bot send a message at for example 3pm

unborn stream

i dont think you can send messages with rpc

ok i added messages.read to the scopes it still doesnt work

spiral path

@GitHub#0000

smoky scroll

@GitHub#0000

unborn stream

why are yall trying to tag a webhook

broken skiff

I have added the rpc to my electron app for rich presence.

but invites cause this error:

smoky scroll

tutorials for djs rpc?

old fable

read the topic

weary flameBOT
[stdin]:2
message.split("--")
^

ReferenceError: message is not defined
    at [stdin]:2:1
    at Script.runInThisContext (vm.js:126:20)
    at Object.runInThisContext (vm.js:316:38)
    at Object.<anonymous> ([stdin]-wrapper:9:26)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at evalScript (internal/process/execution.js:80:25)
    at internal/main/eval_stdin.js:29:5
    at Socket.<anonymous> (internal/process/execution.js:192:5)
    at Socket.emit (events.js:214:15)
    at endReadableNT (_stream_readable.js:1178:12)

silent quartz

Wrong channel

I'm sorry

past anvil

i have a strange issue, when i use the 'websocket' transport when i try and log in it gives me an undefined error

like it literally only says undefined:

arctic eagle

code? @past anvil

sullen spindle
left fjord

42 verbose stack Error: Refusing to install discord-rpc as a dependency of itself

lethal whale

TL;DR: looks like you tried to name your project discord-rpc, and you can't install a module of the same name in it.

left fjord

why

they didn't bother to even paste that line to google, why give answer like that

nimble crane

isnt the rpc deprecated in favor of discord gamesdk

The SDK that this documentation references, Discord-RPC, has been deprecated in favor of our new Discord GameSDK. Replacement functionality for the Rich Presence SDK can be found in the Activity Manager of that SDK. This documentation can be referenced for education but does not entirely reflect the new SDK.

left fjord

RPC SDK !== RPC

nimble crane

oh heck im baby

waxen gazelle

Theres a program that uses discord-rpc and a lot of people are getting unexpected token errors where it says ... (the code has that in multiple places), what causes that? It's in the discord-rpc module and it wasnt happening before

past anvil

@arctic eagle

const discordRPC = require("discord-rpc");
const clientId = "blah";
const clientSecret = "blah"
const scopes = ['rpc', 'rpc.api', 'messages.read'];

discordRPC.register(clientId);

const client = new discordRPC.Client({ transport: 'websocket' });

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

client.login({ clientId, clientSecret, scopes }).catch(console.error);

if i replace 'websocket' with 'ipc' it works fine

arctic eagle

Don't include your client secret. It is of no use in websocket connections. Also, including it disallows use of the messages.read scope. Sources: https://discordapp.com/developers/docs/topics/rpc#authorize and https://discordapp.com/developers/docs/topics/rpc#connecting

Only plausible use of client_secret in RPC:

"We also have an RPC token system to bypass the user authorization modal. This is usable by approved games as well as by users on a game's whitelist, and also disallows use of the messages.read scope. If you have been granted access, you can send a POST request to https://discordapp.com/api/oauth2/token/rpc with your application's client_id and client_secret..."```
Notice how the websocket url doesn't include a secret:

"For WebSocket connections, the connection is always ws://127.0.0.1:PORT/?v=VERSION&client_id=CLIENT_ID&encoding=ENCODING"```

I think this may fix your problem @past anvil.

I'm not sure how much of that applies to what the discord.js-rpc lib actually does, though.

past anvil

ah ok

thanks! i'll give it a go and get back to you

i used 'message.read' because on the npm page it had some sample code with it in the scopes:
https://www.npmjs.com/package/discord-rpc

const clientId = '187406016902594560';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
 
const client = new RPC.Client({ transport: 'websocket' });
 
client.on('ready', () => {
  console.log('Logged in as', client.application.name);
  console.log('Authed for user', client.user.username);
 
  client.selectVoiceChannel('81384788862181376');
});
 
// Log in to RPC with client id
client.login({ clientId, scopes });

@arctic eagle

still happening

arctic eagle

What did you change?

I'd say it's a websocket error, but I don't really know. Have you tried restarting Discord?

past anvil

this is the code now:

const discordRPC = require("discord-rpc");
const clientId = "blah";
const scopes = ['rpc', 'rpc.api'];

discordRPC.register(clientId);

const client = new discordRPC.Client({ transport: 'websocket' });

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

client.login({ clientId, scopes }).catch(console.error);

removed the client secret and the message.read scope

young basin

is the clientId "blah" or is it there just so we dont gotta se your clientId

past anvil

its so you dont see my clientId

i use my actual Id when i run the code

carmine mica

client id isn't a secret

craggy boughBOT
ripe scroll

Where do i report bugs in the libary?

library*

weary zinc

Open up an issue on the github repo

past anvil

@carmine mica i tried using the example on the docs and they dont seem to work

carmine mica

@past anvil it's unemployed?

past anvil

unemployed?

left fjord

doesn't work so it's unemployed

in other words: ok, great story, but have you considered actually giving anything more on that fact, or we are supposed to perform magic to know the errors

past anvil

ok

i do still get the 'undefined' error which i cant fix

carmine mica

what is the undefined error

past anvil

i dont know

it only says 'undefined'

@carmine mica

carmine mica

fascinating

past anvil

yeah i have 0 idea what is happening

it works fine with ipc

carmine mica

websocket requires whitelisting

you have to use ipc

past anvil

Ohhhhh

i read that in the docs somewhere but i assumed it applied to something else

that makes sense thanks!

i'll stick to ipc for now lol

crystal zodiac
>npm i discord-rich-presence
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/discordjs/rpc.git
npm ERR! enoent 
npm ERR! enoent 
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\stepm\AppData\Roaming\npm-cache\_logs\2019-10-14T10_55_28_695Z-debug.log

debug.log: https://paste.ubuntu.com/p/Gxk8HQNWHp/
help 🙂

lethal whale

@crystal zodiac Install git, make sure adding it to PATH is enabled, reboot for a good measure.

crystal zodiac

thanks @lethal whale

glacial yew

anyone know how to fix Error: Could not connect at Socket.onerror (/rbd/pnpm-volume/2cfb3d7b-323c-413a-b975-30aca12c9aea/node_modules/.registry.npmjs.org/discord-rpc/3.1.0/node_modules/discord-rpc/src/transports/ipc.js:32:16) at Object.onceWrapper (events.js:277:13) at Socket.emit (events.js:189:13) at emitErrorNT (internal/streams/destroy.js:82:8) at emitErrorAndCloseNT (internal/streams/destroy.js:50:3) at process._tickCallback (internal/process/next_tick.js:63:19)

glacial yew

nvm

Im having a issue with the rpc im getting

const client = new rpc.Client({ transport: 'websocket' }); ^ ReferenceError: rpc is not defined

prisma sparrow

You didn’t define it

glacial yew

oh

so basically like requiring discord.js bur rpc

if im right const RPC = require("discord-rpc")

@prisma sparrow

lethal whale

Names are case-sensitive

RPC and rpc are different

cedar girder
left fjord

it is in the topic

cedar girder

Ok

So

I am creating a rich prescense GUI

When I tried the discord-rich-prescence it worked fine when I entered every value manually

like the example on the repository

But now I use electron for creating the GUI and I get the rpc client id from an input box

and the i get this error

Here is my full code

cedar girder

Oof, No one that can help...

Now i get this

THis is da code

k no one is gonna help

now only this

covert skiff

sorry for offtopic Trizly what theme are you using on VSCode?

cedar girder

One Dark Pro

The theme from Atom

glacial yew

anyone know how to fix (node:11624) UnhandledPromiseRejectionWarning: undefined (node:11624) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:11624) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

code:

const clientId = 'id';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
const RPC = require("discord-rpc")

const client = new RPC.Client({ transport: 'websocket' });

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

// Log in to RPC with client id
client.login({ clientId, scopes });```
past anvil

yeah

you need a .catch() on client.login

but it still wont fix the issue, if you try it you will get only a message that says 'undefined'

websocket is whitelisted so you have to use the ipc transport

@glacial yew

glacial yew

@past anvil im just using easyrp rn

past anvil

ah right

glacial yew

i gave up lol

past anvil

the discord-rich-presence package works pretty well

and the discord-rpc package does actually work, but only with ipc

glacial yew

oh lol

so i would change scopes to ipc?

past anvil

transport

glacial yew

oh

let me try that rn

past anvil

but of you're only using it for a presence then i would recommend just using discord-rich-presence

glacial yew

yea only for a custom prescence

past anvil
glacial yew

i learned how to do it in c++ and c#

past anvil

this is for js

glacial yew

ik

small mortar
var rpc = require("discord-rpc");
var bot = new rpc.Client({transport:"ipc"});
var config = {
    clientId:"242276511028084738",
    clientSecret:"not for you to see"
}
bot.on("ready",function(){
    bot.setActivity({
        details: "test",
        state: "test",
        largeImageKey: 'test',
        largeImageText: 'test',
        startTimestamp: new Date(),
        smallImageKey: 'test',
        smallImageText: 'test'
    }).catch((reason)=>console.error(reason));
})

bot.login().catch((reason)=>console.error(reason))

Im new to RPC and im wondering what im doing wrong, can anyone help me out?

past anvil

@small mortar you have to login with the clientId

you also don't need to login with your clientSecret for what you're doing

also for the .catch() you can just use .catch(console.error)

fathom lion

Is this the channel to ask for help with discord-rich-presence npm?

past anvil

yeah

fathom lion

I can't get joinRequest to work

It doesn't even get called

past anvil

does it break before then?

fathom lion

wdym break?

past anvil

it doesnt get called

like does the code stop working before then?

fathom lion

no, everything stays working

past anvil

are you getting an error message?

fathom lion

Not that I can see

past anvil

can i see the code?

fathom lion

Which parts would you like to see?

past anvil

all of it

how many lines is it?

fathom lion

all of it is 300+ lines

but i can gist it

past anvil

sure

fathom lion

line 202

past anvil

does line 209 work? @fathom lion

fathom lion

doesn't joinRequest need to work first for that to work tho?

past anvil

i dont see any documentation on joinRequest

fathom lion

It's discord's documentation, isn't it?

you press "Ask to Join" in discord and the game then needs to accept the request or deny it

past anvil

on discord's documentation or discord.js's documentation?

fathom lion

discord's?

past anvil

oh

fathom lion

ACTIVITY_JOIN_REQUEST which rpc subscribes to which discord-rich-presence wraps as joinRequest

past anvil

i've never seen it before

fathom lion

has anyone ever tried it?

I'm tempted to just ping devsnek...

but at the same time, discord is trying to deprecate rpc

past anvil

tbh i've never seen that before

fathom lion

yeah, maybe somebody else can help me then

past anvil

it might be whitelisted

but i dont know

fathom lion

Rich presence is whitelisted, but you can still test it with up to 50 people before asking to get whitelisted

past anvil

ah ok

fathom lion

so if anyone else wants to take a crack at it, feel free to ping me here

I actually want to get it working without having to use some other browser renderer

craggy boughBOT
uncut sparrow

whats rpc

small detail pls

heady sail

also curious ;D

fathom lion

Component of local discord client responsible for communicating with other apps.

past anvil

^

i use it to make a silly game activity

small mortar

@past anvil returns "undefined"

past anvil

@small mortar what transport are you using?

uncut sparrow

Is it possible to change my game activity using this library?

lethal whale

Yes.

small mortar

ipc

past anvil

can i see the code?

hexed python

Someone here?

using ipc transport the disc client closes the connection just after the handshake with this error whereas the client ids are fine

  • the ipc process is no longer described in the disc docs
hexed python

fixed

its a bug within disc ptb

carmine mica

@tender cosmos here

fathom lion

Is there any plans to get gamesdk working in node?

The lobby information was changed and rpc can't do full rich presence anymore

left fjord

what do you mean by "full rich presence"

fathom lion

"Ask to Join" functionality, chat invites to your lobby. People forget it exists but that's what I wanted to do

left fjord

isn't that hidden behind beta for rpc?

fathom lion

It's not even a thing anymore as I know. As lobby information has changed in the new gamesdk

rpc is deprecated

left fjord

RPC is not

RPC SDK is

fathom lion

🤔

left fjord

those are 2 separate things

RPC is more like a protocol to do things in discord from outside of it

fathom lion

I get it is. Gamesdk had to communicate with discord somehow

left fjord

yeah, via rpc most likely

events for RPC

commands

fathom lion

I thought while your app wasn't whitelisted you could still test it yourself

You can scroll up, but i didn't get the rpc to send joinRequest events to my app

(I'm too drunk to think clearly right now tho so I'm not even sure what I want to do instead. But I still want to get full rich presence to work in node)

left fjord
fathom lion

Yeah, and one of these doesn't have support for lobbies. And form what I was told in the gamesdk server it's because lobby information was changed

If you can also change it for the old rpc idk

left fjord

i almost literally pasted code from rich presence visualizer into discord-rich-presence

fathom lion

And does the button really work? I also got it to display but clicking it didn't trigger anything

left fjord

not like i can't click it or something

fathom lion

Yeah, you need another pc and another account. (and I think you also need to invite that other account to your app's whitelist but I'm not sure about that)

left fjord

sadly, can't test rn, need to catch some sleep

fathom lion

Sure, if you are going to tho please tell me the results. If I could get a node only solution it would be great

carmine mica

@fathom lion all the activity events should be working

last i tested they were working

i don't know about lobbies though, i've never had a reason to use them so i don't test them

but they should work in theory

and rich presence is definitely working still

so many people use it

i'd get so many issues on the repo if it stopped working

fathom lion

Yeah, I had no problems with anything else rich presence related, but when I got another account to click my "Ask to Join" button nothing happened on my side.

cedar lynx

Any starting guide for djs-rpc

past anvil

depends what you wanna do

cedar lynx

I want to make rich presence for activity only

cedar lynx

@past anvil

past anvil

like mine?

cedar lynx

Ya

past anvil

i'd start here

and just start experimenting

cedar lynx

How I can set that RPC in my account ?

Any hint ?

past anvil

yeah you run it on your computer

it starts a local server that connects to any discord accounts that are logged in

i would change the ID to your own discord application

cedar lynx

Ok

Any way to use that with mobile ?

past anvil

start it on your computer and it should show on all your clients

cedar lynx

What is state and details ?

Last doubt

past anvil

on my one state is 'being lit' and details is 'They're all so cute!'

cedar lynx

Ok

Thank you

past anvil

np

carmine mica

@fathom lion ask to join also requires registering your game with discord locally

this usually happens automatically if its installed through the game store

if not, you have to use DiscordRPC.register()

fathom lion

So wait, there's no way to test it before applying for whitelist?

carmine mica

you can use DiscordPRC.register

but that requires running the game at least once

fathom lion

running the game at least once
meaning anyone could use it after running it once?

carmine mica

running the game once on each machine

ask to join requires that discord know how to launch the game

assuming your ask is granted

fathom lion

yeah, but what if the games are already running

carmine mica

🤷🏻

fathom lion

Ask to Join didn't work for me even when the games where already running

carmine mica

i haven't experimented too much with edge cases

my game is also installed through the discord store so

🤷🏻

fathom lion

discord doesn't have a store anymore tho

carmine mica

store channels

setting up the websocket server and such

fathom lion

discord-rich-presence npm doesn't call register on its own? and there really isn't any way to access the rpc from there

carmine mica

hmmm

you could pr a thing

register method

fathom lion

if you edit a local node module, does it get used when you run npm start ?

carmine mica

¯_(ツ)_/¯

fathom lion

i don't even need to, I can just require rpc and just call the register method, it's exported by rpc package

fathom lion

hmmmm... I'm running the same .exe on both PCs

carmine mica

¯_(ツ)_/¯

fathom lion

I think I got gamesdk working in node with edge.js

fathom lion

There's one thing that got me thinking. Does the party id need to be filled in to use Ask to Join and chat invites? Because the button appears when you have join secret filled in, but it might no work without party id

Because that is one thing for sure that I changed when I implemented gameSDK instead.

stoic moon

is there a way to set up rpc on my bot that uses discord.js?

left fjord

no

elfin hare

Is there a way to make RPC on an website?

unborn stream

*a website
no, but you can make one in the main process of an electron application

cloud grove

х

half zephyr

i want to update my rich presence by that code. But it doesn't work. Am i stupid or smth?

// content.js
var ws = new WebSocket("ws://localhost:6463/?v=1&client_id=605777168739598338");
function isOpen() { return ws.readyState === ws.OPEN }

function updatePresence(title, time, icon) {
    title = title.replace(/["]/g, "\\\"");
    var data = JSON.stringify(
        {
            cmd: "SET_ACTIVITY",
            args: {
                pid: 9999,
                activity: {
                    details: title
                }
            },
            nonce: Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1)
        }
    );

    if (!isOpen()) return;
    ws.send(data);
}
{
  "manifest_version": 2,
  "name": "Tomori Player",
  "version": "0.1.0",
  "browser_action": {
      "default_icon": "icon.png"
    },
    "permissions": [
        "ws://localhost:6463/*",
        "tabs",
        "webRequest",
        "webRequestBlocking"
    ],
  "content_scripts": [
      {
        "matches": [
          "https://www.youtube.com/watch*",
          "https://youtube.com/watch*"
        ],
        "js": ["content.js"]
      }
    ]
}

i'm working on chrome extension

or how do i import and use discord-rpc in chrome extension?

craggy boughBOT
unborn stream

how is this rpc related?

plucky cargo

@half zephyr It won't work, Discord will disconnect almost immediately if you connect with a browser, trust me i tried. You will need to have an application running in the background

half zephyr

@plucky cargo oooooof, thank you

plucky cargo

What do you want to create a Rich Presence for btw?

half zephyr

parse current playing video from yt or song from soundcloud or etc and send it's title to rpc

plucky cargo

Welp, you can take a look at my project PreMiD, it does the exact thing with 260+ websites

half zephyr

wow, you're owner of premid?

plucky cargo

yep

half zephyr

I saw it but didnt use yet

plucky cargo

Give it a try then :P I can dm you the link

cloud girder

hey, is it possible to login to an account using discord.js and set the rich presence?

raw holly

no

craggy boughBOT
olive compass

i can't install discord-rich-presence module

help

ping me when you know issue

Error I get

subtle ore

do you have git

plucky cargo

Most likely not as its failing to spawn git

smoky scroll

how to work on rpc

plz teach

gleaming sleet

?rpc

turbid oliveBOT
smoky scroll

@gleaming sleet not that what to do after that

gleaming sleet

what are you wanting to do?

smoky scroll

after opening this site

what should i do next

gleaming sleet

what do you want to achieve?

smoky scroll

i want u to tell me the step to create rpc

gleaming sleet

why do you want to know RPC

smoky scroll

as i want to add my custom rpc in my profile

gleaming sleet

have you done any coding before?

smoky scroll

nope

gleaming sleet

i suggest you start with a basic javascript tutorial then

it's unlikely you'll find people here who'll write the code for you

smoky scroll

how to learn that !!

gleaming sleet

google javascript tutorial

smoky scroll

@gleaming sleet i have learn little bit not the discord.js

gleaming sleet

nice try 😉

smoky scroll

@gleaming sleet so how should i learn discord.js

sry for ping

gleaming sleet

plenty of docs here:

?guide

turbid oliveBOT
gleaming sleet

they're quite useful and will tell you how to set things up

smoky scroll

i have used this

and just got upto basic cmds

gleaming sleet

great show me your code!

smoky scroll

but not with the

gleaming sleet
smoky scroll

@gleaming sleet using this i am not able to where to set this command

gleaming sleet

what do you mean ?

smoky scroll

leave it

gleaming sleet

what you're trying to do will not require a command.. probably

smoky scroll

can u help me with

embed in my bot

gleaming sleet

check out ?embed

like I say, we wont write your code for you

actually, I should qualify, some might if they're being super generous or you offer to pay a reasonable amount

however if you have a specific problem we'd be happy to help

smoky scroll

@gleaming sleet

`y this error

on glitch

gleaming sleet

where have you defined RPC?

smoky scroll

how to define rpc

gleaming sleet

import it from the npm package

smoky scroll

@gleaming sleet after that same

prblm

gleaming sleet

show your code

smoky scroll

it is saying not defined

i installed discord rpc package

polar ibex

yeah, you have to import it

smoky scroll

can i talk to u

polar ibex

const ... = require(); for example (with an actual constant name and actual package)

smoky scroll

later i need to sleep right now

i havn't slept last night

gleaming sleet

i have a similar problem at times, on those days I don't think straight. Good luck

dusty sundial

does anyone know a good npm package for gamesdk?

gleaming sleet

?npm gamesdk

turbid oliveBOT

@gleaming sleet, Yukikaze couldn't find the requested information. Maybe look for something that actually exists the next time!

dusty sundial

isn't discord.js RPC deprecated?

unborn stream

the basic functionality works

i dont know about reading / sending messages, havent got it to work

smoky scroll

Someone for God's sake, who knows or has a folder with the basic commands to start the bot ready comes deprived for God's sake help

fathom plover

Tf stop Spaming @smoky scroll

smoky scroll

okay help bor plis I'm from Brazil

unborn stream

what does your nationality have to do with anything?

left fjord

@dusty sundial why would it be

dusty sundial

oh is that discord's rpc which got deprecated?

unborn stream

what are you talking about

carmine mica

@dusty sundial this lib isn't deprecated

discord had an sdk that is now deprecated

this lib implements some of the game sdk. it currently doesn't have some of the more advanced features like networking

astral nexus

What is dsj rpc?

gleaming sleet

?rpc

turbid oliveBOT
astral nexus

Rich presents ?

And would that do to help my bot?

left fjord

bots cannot use rpc

astral nexus

Soo whats the point then?

left fjord

this is rpc

astral nexus

For players?

left fjord

*users

you can use the lib to make your own rpc

astral nexus

Oh ye right

Huh sounds use full

gleaming sleet

To fetch butter

south wren

Can anybody give me an example of rpc presence code?

unborn stream
south wren

th

ivory gate

I got error in the above example

at the client side

require is not defined

mainWindow = new BrowserWindow({
        width: 340,
        height: 380,
        resizable: false,
        titleBarStyle: 'hidden',
        webPreferences: {
            nodeIntegration: true
        },
    });

nodeIntegration: true must be set ^

it isnt in that example

sullen star

maybe back then that option was not required to be set

ivory gate

now having problems with webFrame

It says that webFrame.setZoomLevelLimits is not a function

Even I tried in dev console, its not even defined

unborn stream

this is not rpc related

ivory gate

But it's an error in the example

smoky scroll

How get the 512 size of a pic

i am having issues with that

how to compress the size of an image

unborn stream

open it in an image editor?

smoky scroll

easy

photoshop

are easyiest

and the best

left fjord

that's not rpc related

smoky scroll

give batter quality

mild ridge

i want to update the largeImage live

I'm trying to recreate the spotify rich presence for youtube music

Where when you switch songs it updates the image to the thumbnail of the song cover image

Is it possible to do that?

Right now I just have to use a pre-uploaded key for the Youtube Music icon

left fjord

mind that spotify is not really regular rpc in that context.

for example

and while you can indeed replace spotify: with https://i.scdn.co/image/ and get full image link, it means that it doesn't use discord's assets, but external ones

mild ridge

so you can't really achieve this?

because as far as I'm aware you can't use external assets like spotify does

left fjord

if you can't pass url as image, not really, no

mild ridge

if you can't pass url as image

wdym by this

left fjord

litreally what i said

how do you set image from your assets

mild ridge

/filename.jpg or whatever

left fjord

you pass local file?

mild ridge

yeah

it saves the current song thumbnail as a file in my local directory

so i just point it to that

can you pass a url to the largeImage field?

left fjord

have you tried putting url instead?

mild ridge

Yes it didn't work

Just blank

left fjord

that's your answer i guess

mild ridge

F

smoky scroll

Hello! Is there any way to use new statuses for bot rpc?

unborn stream

i think i've heard that discord is working on it

smoky scroll

Nevermind, found that bots cannot use them right now anyway

smoky scroll

?cs

turbid oliveBOT

Can I set a custom status for my bot?

Can I read other users custom status?
There can be multiple activities now, a feature which the library does not yet include.
For now you can read the status via the GuildMembers presence if there is no other activity (think games, spotify):
[v12] #master: member.presence.activity
[v11] #stable: member.presence.game

The emoji used in the status is not yet readable.

snow moat

How can I add RPC to my bot? I copied the example code, but it doesn't work -- the RPC just doesn't show up. Here's my code:

'use strict';

const Discord = require('discord.js');

const DiscordRPC = require('discord-rpc');

const client = new Discord.Client();

client.login(token);

client.on('ready', () => {
  const clientId = client.user.id;
  DiscordRPC.register(clientId);

  const rpc = new DiscordRPC.Client({ transport: 'ipc' });
  const startTimestamp = new Date();

  rpc.login({ clientId, clientSecret: token })
    .then(() => console.log('logged in!'))
    .catch(console.error);

  async function setActivity() {
    if (!rpc) return;
    rpc.setActivity({
      details: 'booped 1 times',
      state: 'in slither party',
      startTimestamp,
      instance: false
    });
  }
  rpc.on('ready', () => {
    setActivity();

    setInterval(() => {
      setActivity();
    }, 15e3);
  });
});
smoky scroll

bots cant have rpc

reef yew
const DiscordRPC = require("discord-rpc");
const clientId = "i_removed_the_client_id_from_this_message";
DiscordRPC.register(clientId);
const rpc = new DiscordRPC.Client({
  transport: "ipc"
});
rpc.login({
  clientId
}).catch((e) => {
  console.error("Error logging in:", e);
});
Error logging in: Error: RPC_CONNECTION_TIMEOUT
    at Timeout._onTimeout (C:\Users\Name\Documents\GitHub\Project-Name\node_modules\discord-rpc\src\client.js:99:47)
    at listOnTimeout (internal/timers.js:535:17)
    at processTimers (internal/timers.js:479:7)

Running on Windows 10 64x. Discord Stable is open on the same machine. I'm using the same elevation as the Discord client. I've tried both admin and user elevations. Other things that use RPC such as PreMiD work perfectly fine. I've tried downgrading the module. I'm using discord-rpc@3.1.0.

thorn jackal

What are all the values I can pass to RPC.setActivity();?

rpc.setActivity({
    details: `booped ${boops} times`,
    state: 'in slither party',
    startTimestamp,
    largeImageKey: 'snek_large',
    largeImageText: 'tea is delicious',
    smallImageKey: 'snek_small',
    smallImageText: 'i am my own pillows',
    instance: false,
  });```

Anything else,?

unborn stream

idk theres some start time and end time stuff, refer to discord's documentation for a more precise answer

or discord-rpc source code

or discord-rpc's incomplete docs

spring depot

how would I check if any of the values in an array are a substring of another string

unborn stream
craggy boughBOT
smoky scroll

?cs

turbid oliveBOT

Can I set a custom status for my bot?

Can I read other users custom status?
There can be multiple activities now, a feature which the library does not yet include.
For now you can read the status via the GuildMembers presence if there is no other activity (think games, spotify):
[v12] #master: member.presence.activity
[v11] #stable: member.presence.game

The emoji used in the status is not yet readable.

trim jasper

What's discord js rpc

unborn stream

discord rich presence

trim jasper

A ok

toxic shard

What causes this to happend?

(node:10560) UnhandledPromiseRejectionWarning: Error: RPC_CONNECTION_TIMEOUT

past anvil

can we see your code?

trim jasper

n o

past anvil

?

turbid oliveBOT

If you expect us to help you with your code, when we don't know whats wrong (e.g. you didnt share code), then share some code, or at least an error with us. If you refuse to share your code, then theres nothing we can really do, and dont expect us to be able to help

turbid oliveBOT

If you expect us to help you with your code, when we don't know whats wrong (e.g. you didnt share code), then share some code, or at least an error with us. If you refuse to share your code, then theres nothing we can really do, and dont expect us to be able to help

granite python

?

trim jasper

?

?

left fjord

stop please

trim jasper

I'm testing that command tho

left fjord

there is no command, only necro posting to old "question"

trim jasper

OK

karmic jolt

this channel isn't for canvas

narrow viper

Is there a channel for it?

karmic jolt
narrow viper

Thanks

outer bane

What is rpc?

nvm

im an idiot

simple schooner

(rich presence)

outer bane

Looks like noone need help w rpc :p

rocky nacelle

What is this exactly for? I'm still not sure after looking at example

unborn stream

create an application on discordapp.com and go into the rich presence section

slender forge

RPCClient only has the 'ready' event? I couldn't find anything in the docs

also what is a transport from RPCClientOptions?

left fjord
slender forge

thx

smoky scroll

Is that working?

@karmic jolt i can do canvas

spark jacinth

What is rpc

warm radish

read the channel topic?

spark jacinth

It says rich presence in only one of the link afaik. But what does that do? Setting rich presence?

warm radish

this is a rich presence

for users, not bots

spark jacinth

Yea ik, that's why I used whether it is used to set the rich presence

unborn stream

i thought you asked how to set rich presence

frosty forge

I'm trying to understand how this module works. As far as I'm aware, Discord.js is meant to build a Discord bot, but this module is meant to let users set their Rich Presence for games/applications that don't have it built in already? Does this use the local Discord client, or is it technically a self-botting function?

do you even have to have the local desktop client for Discord open for this to post your game status?

unborn stream

yes this module is used to set rich presence

uses local client, no self botting, discord allows usage of rich presence

yes you need to have discord open

@frosty forge

frosty forge

thanks. Is there perhaps a guide to getting started with it? Is it possible for this module to manage multiple games, or do I need a separate script for each game I want to manage?

unborn stream

you can check channel description for examples and help

separate script (and discord application) for each game

frosty forge

I don't mean at the same time, but rather, if I was playing one game and quit and start another game, do I need to terminate the script and start a new one for the new game?

unborn stream

yes

but in a production environment each game would have their own script embedded into the source code which would be automatically terminated upon closing the game

frosty forge

yeah.... I don't have control of the source code of the game... It's mainly for things like commercial games that don't have a Rich Presence yet, but where an external program might be able to extract enough information to fabricate one and post it instead.

unborn stream

i see

frosty forge

it would be for personal use only, so I'm not worried about it being distributable.

unborn stream

in that case you would need to terminate the running script

frosty forge

would it be possible to do client.destroy() and then login with a new clientID?

unborn stream

yes

frosty forge

I'd like to see if I can make a passive Node.js script that runs at boot and list listens for the games I've decided to support and will automatically create the appropriate Rich Presence to match it.

unborn stream

sounds good

frosty forge

I wonder if it might be possible to call new RPC.Client() on different variables to establish parallel clients, instead of destroying and creating over and over?

const client2 = new RPC.Client({ transport: 'websocket' });```
unborn stream

totally possible

frosty forge

that might be useful since I have a multi-monitor setup and might actually end up having multiple games open at once.

unborn stream

discord can only display 1 rich presence at a time

frosty forge

yes, and I think it shows whichever is the most recently updated. I'm just anticipating what might happen if I try to open two games at once. I don't want the script to break because it doesn't know how to handle two games. If Discord can only show one at a time, that's fine, but I want to make sure my script doesn't go crazy if I decide to multitask...

unborn stream

ok

frosty forge

does this support other modes like "watching" or "listening to", or is it only "playing"? Might be fun to have it hook into Netflix or my music player or something.

unborn stream

only playing

frosty forge

is that a limitation of the module, or the API itself doesn't support it yet? I'm curious how apps like Spotify can display music.

unborn stream

api limitation

frosty forge

I guess Discord gave Spotify special treatment with a closed API or something.

unborn stream

yes

frosty forge

I'm guessing it's the same thing with the Game Launcher on Samsung devices. Currently the only way I'm aware of to show what you're playing on mobile.

unborn stream

im not familiar with that

frosty forge

if you look at my presence right now, you'll see it

unborn stream

i cant see it, i’ll now go to sleep

frosty forge

oh... well thanks for the help either way

unborn stream

youre welcome

frosty forge
winged notch

@frosty forge
client.user.setActivity('whatever it's doing', { type: "<type of activity here>" })

There are 4 types of activity.
LISTENING
PLAYING
STREAMING
WATCHING

unborn stream

@winged notch we were talking about rpc, this channel is for rpc, what the hell are you doing

winged notch

@unborn stream Sorry, my bad.

mortal heath

How to use rpc?

unborn stream

check channel desc for guides

median zenith

Does anyone know how to make a custom rich presence for TruckesMP/Euro truck sim 2?

delicate flint

I don't think that's what this channel is for

rocky nacelle

Does Android support Rich Presence through the browser?

unborn stream

not a lib question

rocky nacelle

You could at least answer the question while you're here instead of responding with "not a lib question"

unborn stream

i dont know the answer

smoky scroll
glad fox

hi, not sure if this is the good channel, but i was wondering why i can't see any webscoket connection with discord by using a man in the middle proxy like charles, fiddler or mitmproxy? I can see it when using the discord app but not with discordjs/discord.net and discordpy

radiant panther

A

chilly elm

Are the docs down or something, I can't access them

warm radish

for rpc specifically?

looks fine

chilly elm
TypeError: Failed to fetch``` when I click the first link in this channel's desc

djs library works fine though

I think something's wrong with the serviceworker on my client

Only hardrefreshing shows the page for me

smoky scroll

dirty da

karmic wagon

Hello! Does anyone use discord-rich-presence here? If so, is the API outdated, or am I doing it wrong? I'm running it at the ready-to-show event of my electron app, but it isnt working

I have my proper ID in, and im just using the example on it for testing:

        client.updatePresence({
            state: "slithering",
            details: "🐍",
            startTimestamp: Date.now(),
            endTimestamp: Date.now() + 1337,
            largeImageKey: "snek_large",
            smallImageKey: "snek_small",
            instance: true
        });
warm radish

isn't it always setActivity

?docs rpcclient.updatepresence rpc

turbid oliveBOT
warm radish

?docs rpcclient.setactivity rpc

turbid oliveBOT
warm radish

i'm pretty sure that's what you want?

oh wait, you're using a completely different package. this isn't the server for it lmao

?npm discord-rpc

turbid oliveBOT
karmic wagon

ya, ill change it to that package

warm radish

this is the package we provide support for

karmic wagon

ok

ill change it to that, 1 momento

warm radish

looks like a bug in the bot

karmic wagon

ok

thanks

what is the instance arg?

night marten

@karmic wagon

An instance of a class is a description of a specific object in memory. The class describes the properties and methods that will be available for the object, built according to the description embedded in the class. ... That is, they say: (in a virtual environment) create an instance of a class or, in other words, instantiate a class.

chilly elm

Is it possible to run RPC remotely without a real discord instance open?

left fjord

not really, mainly because your discord client runs RPC server your game or app connects to.

chilly elm

Is there any sort of stand alone RPC server?

left fjord

why would it be a thing

discord has rpc because it uses the data to display it on your profile

it's like running a ftp server that has no files, accounts and internet access

karmic wagon

How exactly does the RPC connect to discord?

left fjord

usually would be localhost:6463, either websocket if from browser-like "place", or via ipc

graceful river

I'm using ffmpeg to detect black frames and sequences

but i get random frames each run

unborn stream

is this rpc related?

left fjord

no, it's not. it's not even js

full bison

Right so i've got a DRPC script set up that would switch the RPC every hour. Buut instead of doing that it continues to run the DRPC from the hour that it was ran on. Is there any way to self restart the script once it turns the next hour?

Something like this in batch
:beginning: //code here goto beginning

left fjord

you could simply put code into a function and call the function periodically

full bison

I could give you a copy of the code if you'd like because i think that's what i currently have done

warped flint

send a pic @full bison

damn that was 2 days ago lol

full bison

ill do soon

warped flint

ey who wrote djs-rpc

can i send them a fixed version of their broken example lmao

i was looking into it for a smoll project im doing and decided to try out the example

it was broken so i fixed it

full bison

@warped flint

sorry about the delay

warped flint

so you want your rpc to set like that

?

every hour a different thing

full bison

yeah

i was thinking it would look cool

warped flint

first of all what does date.getHours() return?

and second

arguably more important

full bison

the current hour

no seconds included

don't really need them tbh

warped flint

here look

full bison

where

warped flint
const DiscordRPC = require('discord-rpc');
DiscordRPC.register(clientId);
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
rpc.setActivity({});
setActivity();


rpc.login({clientId}).catch(console.error);

try doing it like this

also isn't it always going to be the same hour? @full bison

full bison

well it does not update it with the correct hour no. But idk if it gives back the new hour

i could make a function that runs every minute and see what happens

warped flint

okay

full bison

But i first gotta wait for a hour change

warped flint

so first of all connect to discord-rpc properly

paste my code into there

const DiscordRPC = require('discord-rpc');
DiscordRPC.register(clientId);
const rpc = new DiscordRPC.Client({ transport: 'ipc' });

this specifically

full bison

right and where it says clientId i should put exactly that?

warped flint

yes

the thing that you get on the front page of your discord app

full bison

Yeah

hmm

warped flint

whoop

wait

okay found the docs

so

just go like

full bison

it should be client. right?

warped flint

that doesn't matter


rpc.on('ready', () => {
  setActivity();
});

just add that to the bottom of the function

wait

@full bison are you reading the djs-rpc docs or the discord gameSDK docs?

full bison

I think the djs-rpc docs

warped flint

also your interval is 60 seconds

full bison

yeah ik that

It still does this btw even with the thing at the end of the function

warped flint

hold on im trying it for myself

@full bison what are you running this on?

past anvil

what is the code?

can i see it?

warped flint

ok we solved the issue

drowsy pendant

Code

const clientId ='656631192195694604'
//<theres my code of rpc>
rpc.login({clientId}).catch(console.error)

Error

{ code: 4000, message: 'Invalid Client ID' }

One hour ago its working but now its not working.
I Restarted my application its start give me error.
Anyone have solution ?

warped flint

check if the clientid is okay ig?

drowsy pendant

i fixed okey.

now i have question

how to make clickable text like a spotify

left fjord

99.9% that you can't.
Spotify 's rpc does not work in same ways you could do with regular rpc api

drowsy pendant

GWmythicalFeelsSadMan

warped flint
carmine mica

the fuck

warped flint

it's just a fixed version of your example for discordjs/RPC

i needed it a couple weeks ago and checked out the example it was br0ken so i unbr0ked it

carmine mica

nothing about that is "fixed"

warped flint

it works now

carmine mica

it already works

warped flint

it didn't

carmine mica

then you did something wrong

warped flint

the snakes couldn't update and the booping did nothing

try the one from discordjs/rpc out for yourself

it 100% don't work

carmine mica

I wrote it

I know it works

warped flint

try it

ik you wrote it

carmine mica

no

I have better things to do with my life

warped flint

twas broken and now it fixed cause i was bored

okay

@carmine mica there

there just wanted to tell u

sorry for disturbing you

unborn stream

"I have better things to do with my life than to test the code i wrote"

  • creator of djs rpc
carmine mica

@warped flint you installed the wrong version of electron

electron changed some defaults in later versions

craggy boughBOT
warped flint

k ill try it now

yeey gj @carmine mica it works now lol

nice

oh just a quick question, do you recommend npm or yarn

full bison

This might be random but anyone know why i'm getting this error when running my DRPC script on my rabperrypi?
pi@raspberrypi:~/Discord-Bots/DRPC $ node DRPC.js 21 Error: Could not connect at Socket.onerror (/home/pi/Discord-Bots/DRPC/node_modules/discord-rpc/src/transports/ipc.js:32:16) at Object.onceWrapper (events.js:315:30) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at emitErrorNT (internal/streams/destroy.js:64:8) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9) ^C

It runs fine on my pc

drowsy pendant

cuz

discord is not opened

open discord and start app

full bison

oh

drowsy pendant

if u try to make Discord Bot Presence with DJS-RPC

bot don't have rich presence

u can't

full bison

Right

So i'd have to run discord on my rasbperry pi. Does that have to be the app version?

drowsy pendant

uhm yes

full bison

frick

rocky nacelle

Using discord-rpc i always get
Error: OAuth2 Error: invalid_request: Missing "redirect_uri" in request. and get asked to authorize the app

const RPC = require("discord-rpc")
const clientId = '514513911712238095';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
 
const client = new RPC.Client({ transport: "ipc" });
 
client.on("connected", () => {
    console.log("Connected!")
})

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

client.login({ clientId, scopes });```

i changed websocket to ipc as when it is on websocket it just throws an "undefined" error

unborn stream

put client secret somewhere into client.login()

rocky nacelle

@unborn stream what should i define it as?

unborn stream

enter it as a parameter or as a value of a parameter into the client’s login method

warped flint

client.login({ clientId: [yourClientId] })

oh lol thought this was today or something

left fjord

that's also not exactly correct

smoky scroll

how can i use messages..read scope

how do i access it in the discord=rpc

rocky nacelle

Error: Not authenticated or invalid scope i keep getting this even before authorizing on the client

oh saw the search history

time to dip my fingers into the lib

sick it works

basically what i did is set my redirectUri to 127.0.0.1 and set a timeout so the client has time to authenticate and then perform the requested action

i might make a pr to emit the ready event after authentication succeeded

rocky nacelle

Message event is broken but discord sends it

fixie time

found the issue

craggy boughBOT
median sonnet

what is rpc?

uncut pawn

rich presence

in the example for rpc, i dont understand the ID. can anyone explain?

is this the ID of the user?

midnight granite

how would i even approach integrating rpc as a mod for a game

i have a lua engine to work with in this case

like what are the rpc fundamentals

how does the application interact with discord

is there an rpc server running on the discord client i have to connect to?

left fjord

yes

midnight granite

whats the point of the sdk then

lol

left fjord

to have reaady to use library that you plug directly to your app and instantly can use it?

just like discord.js makes you totally not care about making direct requests to discord's api

median sonnet

using rpc can i set rich presence?

midnight granite

thats all it does

median sonnet

Oh

unborn stream

what else did you expect rpc to be used for

median sonnet

i did not know what it was

unborn stream

you got told it was rich presence...

frosty rampart

what is rich presence

everyones sleeping :/

mossy wren

Rich Presence allows you to leverage the totally overhauled "Now Playing" section in a Discord user's profile to help people play your game together. Rich game data—including duration, score, current boss or map, and so much more—lives inside Discord. You can spectate a friend's game directly from their profile popout, or party up via beautiful chat embeds with real-time information about open party slots and the party's in-game status. No more exchanging usernames and friend codes, or wondering if there's room for you to join. Rich Presence is a living invitation to play together, or to watch your friends kick butt.

Taken from https://discordapp.com/developers/docs/rich-presence/how-to#so-what-is-it

nocturne void

I always thought it was remote procedure call

left fjord

overall - yes
in terms of discord - it is your definition used to display more data on your profile from apps that support it

whole "definition" above from 12d ago even though it's chunky doesn't explain much. simple screenshot of spotify or vscode presence would do as well

mossy wren

It doesn’t but I thought I’d use the official "definition"

zinc wadi

?docs rpc

turbid oliveBOT
past anvil

lol

rocky creek

How do i rich presence to a channel from an online game

for example

there's a player list and i want to display it on specific channel