#archive-rpc-help

21942 messages · Page 2 of 22

meager thorn

if they used elapsed

then yeah the user has the freedom to go over 24 hours

but we are talking about countdown here

the game sets the countdown

meanwhile the elapse is the users session

in a match etc

inland tinsel

I wish your game didnt have to be whitelisted or i would have made it work with csgo

dusky oasis

goodluck trying to attach RPC to CSGO exe 😃

meager thorn

idk how you would make it work with CSGO unless you make like a external launcher

and hook it up with CSGO using pointers

in c++

inland tinsel

Fetch my steam profile every minute lul

meager thorn

yeah but that would just get elapse time

nothing else

and if it goes on diong that

you can do that easily

steam literally has a API for getting profiles

and its live

¯_(ツ)_/¯

but it won't give you the information you would require really

like map name

scores

etc

dusky oasis

hmm thinks about making Facebook Criminal Case to Electron with RPC drakeLUL

tbh I bet that wouldn't even work

meager thorn

eyesRight

dusky oasis

wut

what did you steal now? 😄

meager thorn

me and some friends planning on making a IO game

and

like the main part im doing really

is making it all based on discord

so imma remove that enter your name here

and replace it with a oauth 2 discord login

so I can get the users profile pic and Name

use it as their user in game

and gonna hook it up with RPC

dusky oasis

Nice

meager thorn

to make the spectate and join feature allowed

where join would allow the user to join the same session

and spectate would

dusky oasis

I'm just waiting RPC to kinda open up outside f'ing game studios 😄

meager thorn

spectate

dusky oasis

to hook it up with Streaming stuff

like OBS etc 😃 would make it more interesting to see active stream ad on RP style

carmine mica

discords streamkit uses rpc

woven fiber

Am I right by saying that most people don't have an authorized game and won't be able to have invite or spectate?

steady sparrow

Invite and spectate features need to be reviewed by discord

woven fiber

Ofc

pastel sphinx

on my side the example rpc (by devsnek) is no longer working { Error: connect ENOENT \\?\pipe\discord-ipc-0 at Object.exports._errnoException (util.js:1050:11) at exports._exceptionWithHostPort (util.js:1073:20) at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1097:14) code: 'ENOENT', errno: 'ENOENT', syscall: 'connect', address: '\\\\?\\pipe\\discord-ipc-0' } any idea why ? (it worked 5 hours ago)

woven fiber

internet

pastel sphinx

FeelsTenseMan

smoky scroll

how can i set rich presence for my bot? xD

ancient anchor

u dont

smoky scroll

lolz

for what is that?

hoary sundial

the richpresence endpoint isn't enabled for bots

gg, that's it

you can't use it with bots

smoky scroll

oh...

and how can i use it for me?

then

hoary sundial

fp

user account != bot account

smoky scroll

ik

but how

🤦

hoary sundial

shit, misread your message

apply for rpc on discord, then read client docs Thonk

ancient anchor

you need to have gamebridge dont you?

yeah

woven fiber

No

I don't have it

And I'm booping sadness

meager thorn

you don't need gamebridge at all to use rich presence @ancient anchor

ancient anchor

o?

do you need to apply for anything

lusty musk

no

meager thorn

No

Although

if you are going to make it for a game

ancient anchor
hoary sundial

i assume they will enforce that rule later on

ancient anchor

been on that for atleast 5 mins now

meager thorn

there is no rules nor regulations

right now concerning RPC

that has been publicly released

lusty musk

fp

meager thorn

so therefore you are free to use it

ancient anchor

I would if electron installed

REEEEEEEEEEEEEEEE

meager thorn

oh and forgot to say

@ancient anchor RPC is free to use but some of the features you need to apply for really

although Rich Presence is free to use

ancient anchor

Ah

So just displaying random shit would be allowed for me to use

meager thorn

Mhm

ancient anchor

Oh

ok ill wait 30 mins for electron

meager thorn

For more information about RPC refer to

ancient anchor

ty

ancient anchor

Should I be able to see it on an alt

solid pasture

How does discord-rpc work without a user ID or login token?

tall wasp

its working with a client id

solid pasture

Isn't that the client ID of the rich presence application?

ancient anchor

you have to make an app, not a bot user

and use that ID

solid pasture

I'm asking how it alters data on my own account without having my account even being referenced.

ancient anchor

tbf I wonder aswell

solid pasture

Actually, it doesn't yet.

I can't get it to work.

ancient anchor

I cant either

solid pasture

😢

tall wasp

@carmine mica hey could you just confirm that your example is still working there might have been an update or something but your example isn't working

Thonk

solid pasture

I am really confused.

Does this thing have any documentation?

ancient anchor

nothing there tho tbf

tall wasp

yea because its not a d.js thing

its an extra thing

ancient anchor

ik

tall wasp

from Gus

solid pasture

I just wanted to set a custom rich presence and show it off to my friends. 😢

ancient anchor

me too but it wont work

tall wasp

wow

complaining like that won't help you at all

lmao

ancient anchor

im kidding

solid pasture

Got anything that will help?

ancient anchor

patience

solid pasture

loser

ancient anchor

¯_(ツ)_/¯

solid pasture

I'll go work on something else for now, I guess. 👋

(Tag me if a solution presents itself (or just don't).)

smoky scroll

how does one rpc

thats why i ask

meager thorn

Look at the title names

@smoky scroll

ancient anchor

Sam don't supposed you know why it wont work for Yukine and I

meager thorn

Rich presence != RPC

and you need to add it

as a game

in settings

@ancient anchor

ancient anchor

Uh okay 2secs

solid pasture

Oh!

Wow!

ancient anchor

omg it actually does work

solid pasture

That's such an obvious and easy solution!

howhigh

Does that mean that you need to have the script running on your computer and you can't set a custom rich presence from an external server?

ancient anchor

How do I change where it says RPC?

meager thorn

that's the point of RPC

That would be the app name @ancient anchor

solid pasture

It would be nice if I could do it from an external server.

meager thorn

that's why you set your own app name

ancient anchor

Oh i c

meager thorn

@solid pasture this is made for SDK

for games

So it woulden't be really a thing at all

if you set it via a selfbot tho you can

but you are risking a ban

and I don't condone doing that at all

ancient anchor

Where do I set the app name? in the settings

solid pasture

No, I'm not. It's legal. It's allowed. It's not discouraged.

ancient anchor

Because that doesnt seem to work

meager thorn

Discord developers

Selfbot aren't allowed

its in the api TOS

solid pasture

Where on this planet did you get that information?

meager thorn

from the admins them selfs

and the docs?

It literally says that

solid pasture

Abusing self-bots aren't allowed! Self-bots are totally allowed.

meager thorn

They aren't

please don't spread false information

solid pasture

If they wanted them not to be allowed, they could just disable them.

meager thorn

They can't

..

solid pasture

No, they couldn't. Never mind. Ignore that.

meager thorn

That's how

solid pasture

xD

meager thorn

You do realize

for you to login using

Discord itself

is using the API right?

solid pasture

Please use one or two messages per sentence.

meager thorn

Well please don't spread false information

that could cause another fellow user to get banned

solid pasture

Anyway, I already read the entire TOS, and it says literally nothing about self-bots or custom rich presences, and we have a screenshot in #archive-offtopic of an email from a developer saying that custom rich presences are okay.

ancient anchor

@meager thorn Where can I set the app name? Is that what its set as in settings?

meager thorn

Go to My apps

ancient anchor

OOOOOOOO

My bad

meager thorn

@solid pasture as I stated

Rich presence != selfbot

you can set rich presence using a selfbot tho

but I don't condone it

I never stated that the usage of rich presence isnt allowed

solid pasture

I've only ever heard that using self-bots to read other people's messages is disallowed.

meager thorn

Selfbot in general

isn't allowed

no matter what it does

this is why RPC exists

Unlike the normal OAuth2 flow, bot accounts have full access to all API routes without using bearer tokens, and can connect to the Real Time Gateway. Automating normal user accounts (generally called "self-bots") outside of the OAuth2/bot API is forbidden, and can result in an account termination if found.

source

solid pasture

It says that automating user accounts outside of the bot API is forbidden.

Also...

solid pasture

Does the content of that screenshot say that you'll be banned for it?

meager thorn

Literally does

solid pasture

It seems it's not a very official stance, because different staff members have different opinions on the matter.

meager thorn

Every developer says that

you aren't even in Discord API

you don't see literally most of the time what they say

.-.

solid pasture

"Every developer says that"

meager thorn

Look at that date

Thinkeng

solid pasture

Why would that matter?

meager thorn

you do realize TOS change right

?

solid pasture

...but, today, I read it, and there's nothing there!

Either way, I'll just stop using my convenient self-bot for whatever strange and mysterious reason for the fact that there apparently are at least two moderators out there who would ban for it.

By the way, @meager thorn, what's up with this?

meager thorn

Because most things you do in selfbots

aren't using oauth2 nor bot api

ancient anchor

How do I set watching with RPC

meager thorn

that's a selfbot

dont recommend you doing that

ancient anchor

Can I atleast set somethign after playing

solid pasture

What are they using then?

ancient anchor

so its not just bare after it

meager thorn

?

idk what you mean

ancient anchor

How it literally just says

"Playing"

Nothing after it

meager thorn

for me it just says

ancient anchor

No mine

meager thorn

oh

thats because its rich presence

Lucario is using a selfbot

ancient anchor

Oh

How did he tie them together tho

meager thorn

You don't

selfbot != RPC

and if you want to risk a ban

go google it

ancient anchor

So he just launched a selfbot along side?

meager thorn

cuz I ain't personally telling you

ancient anchor

she*

meager thorn

no

she is using selfbot to set richpresence

ancient anchor

im so confused rn lol

Sure I'll go with it

meager thorn

Just stick with RPC

unless you want to risk getting a account termination

if so

then look at how selfbots work

¯_(ツ)_/¯

ancient anchor

tbf my account is of no value

Yeah I know how selfbots work, but I thought rich presence wasn't in d.js

meager thorn

its not

you have to do it yourself

ancient anchor

o

meager thorn

look at how discord wants the payload to be send

and

yeah

thats how

solid pasture

Wait. What is most used to run a self-bot?

meager thorn

the discord api itself

this client has a way of connecting

and such

solid pasture

Isn't that...the OAuth2/bot API?

meager thorn

not all

setPresence in

the thingy

clients

isnt the oauth2/bot api

solid pasture

What about complete sentences?

meager thorn

What about you deal with it

?

solid pasture

I cannot understand what you're saying.

meager thorn

If you are gonna complain then google yourself

Go look at the source of how setPresence works

@solid pasture another way of understanding this

Did you realize there is a setEmail and a setPassword method

why would a bot need them?

does oauth2/bot api mention them?

solid pasture

Uh...

Why is the Discord.js library endorsing discouraged practice?

meager thorn

¯_(ツ)_/¯

solid pasture

Thonk

meager thorn

It's not just discord.js

its literally all the libs

solid pasture

That's strange, if it really is not allowed.

Also, setPassword sounds like a horrible idea for a library feature, discouraged or not. 👀

meager thorn

he has it there so if you are building your own discord client

and its a feature really that he can add

solid pasture

👌

meager thorn

I can understand your part tho

they should of worded it in a better way

the way they said it was kinda not understandable

so

¯_(ツ)_/¯

wanton spoke

@solid pasture but you have to provide your previous password Thonk

solid pasture

You use an authentication token to log into a self-bot, not a password.

meager thorn

That's how

discord logins tho

when you login to discord

it returns back a token and thats how you login

wanton spoke

it just has your email & password linked to your token

meager thorn

^

carmine mica

@tall wasp example works fine

wanton spoke

i love how we're talking about rpc

carmine mica

hey guys

solid pasture

Putting your raw password into any script in general is just not a good idea.

carmine mica

selfbots aren't allowed in any context

stop talking about it here

this channel is for rpc

byeeeee

solid pasture

👍

meager thorn

such a useful gus

wanton spoke

gus what happened to google bot (respond in general, i only sent this here cause i didnt wanna ping you and i know this is the only channel you look at)

carmine mica

i get pinged in any channel

if you say my name

wanton spoke

oh im sorry

ancient anchor

didnt even answer the original question

oof

solid pasture

Yo! I got it working! \o/

That was definitely worth 7 hours of my time. bort

solid pasture

Why am I the only person who can see this?

woven fiber

Maybe discord app hasn't sent it out

So restart discord

And then the app

solid pasture

I've tried that several times now.

It actually was working earlier, so I'm really confused.

blazing eagle

See what?

solid pasture

...my rich presence.

blazing eagle

Your presence showed earlier for me, now it actually doesn't

solid pasture

Yeah, I know.

I don't know what I changed to break it.

Looking at the network log, it does actually seem to be sending the data to Discord.

OH!

WOW!

I figured it out!

It was so obvious! howhigh

I had partyMax set lower than partySize.

scarlet aspen

rpc.login(clientID) means i have to put in my user id?

Or token.

fiery crater

your app client id

grim quest

I have a little question: Is it allowed now for public User Accounts to set Rich Presences?

scarlet aspen

Yes.

Does anyone know how to fix that?

crisp yacht

update node maybe

scarlet aspen

I do right now

crisp yacht

@grim quest as long as the content of the RP isnt breaking ToS or Community Guidelines its ok

scarlet aspen

Maybe it's because Node Version 3

Lol

crisp yacht

you have node 6.11

but ok

scarlet aspen

Oh

npm --v says 3

nvm

I'm updating it rn

crisp yacht

thats npm

scarlet aspen

Oh ok

crisp yacht

ur screen also told you

scarlet aspen

Still getting an error, but it says that electron isn't installed correctly. I'm going to reinstall those packages.

ancient anchor

It takes a while if bad internet

Run it with --verbose to see download progress

scarlet aspen

Thanks.

Why?

ancient anchor

Make an application

Not with a user, just make an app and take the client id

crisp yacht

wait does it actually not work if you have a bot account on the app?

scarlet aspen

Doesn't work with an application.

It doesn't return an error, but the rich presence isn't there.

My Application has got a bot user

ancient anchor

Idk @crisp yacht but it doesn't show it when I have a user

I said don't have a user lol

scarlet aspen

Oh, i retry with an application that doesn't have a user.

ancient anchor

Gus

scarlet aspen

Unknown Error? Thonk

ancient anchor

(that pings him)

scarlet aspen

Why does it return a DeprecationWarning when trying to connect to a bot without a user?

Should i post an issue on Github?

craggy boughBOT
meager thorn

@scarlet aspen Read the github

scarlet aspen

?

meager thorn

Read the github issue you made

craggy boughBOT
scarlet aspen

Works now.

grim quest

Question:
I tried this:

const startTimestamp = new Date();

rpc.setActivity({
    details: `Test`,
    state: `Test`,
    startTimestamp,
    partyId: 'test',
    partySize: 1,
    partyMax: 1,
    instance: true,
  });

Why does it say

(node:412) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: child "activity" fails because [child "timestamps" fails because [child "start" fails because ["start" must be a number]]]

now?

wanton spoke

Date.now()

grim quest

Then it won't count

woven fiber

You need an end

Or for a timer

grim quest

Well, I got the thing from GitHub:

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',
    partyId: 'snek_party',
    partySize: 1,
    partyMax: 1,
    matchSecret: hash('match'),
    joinSecret: hash('join'),
    spectateSecret: hash('spectate'),
    instance: true,
  });
woven fiber

Lemme check docs

Are you using your own app?

App ID

grim quest

I made an App and used the ID

It's just the startTimestamp. Nothing else.

woven fiber

Well then you can't do parties

You can't do parties and joining and stuff without and authed game

scarlet aspen

Is git required for rpc?

frail fiber

no

meager thorn

@grim quest maybe you should read

startTimestamp

frail fiber

that's perfectly valid, as long as it's defined

which it seems like it is

meager thorn

idk if he defined it

grim quest

Yeah

meager thorn

because it says time isnt a number

Go to hastebin paste your code

and let me see whats wrong

grim quest
meager thorn

and you have the latest version of the discord-rpc right?

@grim quest

k ig

woven fiber

The only problem is using your own game

As you don't have parties allowed

meager thorn

It would work fine

in the advanced rich presence when they mean by

allow join and allow spectate

is for public use

for everyone

thats why the whitelist exists

so lets say if I have specate and join mode on

and I publicly released it

others wont have that button

woven fiber

You need to be authed

meager thorn

only the owner and whitelisted people would

woven fiber

No

meager thorn

I have literally tried it

woven fiber

Lool

meager thorn

and not just me

even SNEK did

woven fiber

He has an authed app

meager thorn

welp still

I tried it myself

want me to put my rich presence on with the join and spectate mode on?

meager thorn

As I stated

woven fiber

You can

meager thorn

this is for public use for everyone

this is why the whitelist exists

woven fiber

So what is that for

Oh

meager thorn

Want me to rephrase it again?

woven fiber

I still don't get it

meager thorn

k I got an idea wait

lets say I'm overwatch

right?

woven fiber

If you try to join a non-public game what happens

And you aren't whitelisted

meager thorn

nononon

woven fiber

Does it allow it?

meager thorn

thats not how it works ok so

IF the user

has the game first

the JOIN and SPECTATE button will be able to be used

and then after that

for me as a user too

to have that JOIN and SPECTATOR button

I need to be whitelisted

UNLESS

he went to authorized apps

and allowed the join and spectate button

woven fiber

Oh

meager thorn

lemme open my rich presence real quick with the join and spectate button

wrong version wait

woven fiber

For those to work you'd need a listener on the user's side to open the game and spectate

Am I right?

meager thorn

k

look at my game now

I have the join and spectate button right?

@woven fiber

woven fiber

Yh, disabled

I thought that was just cus of party size

meager thorn

disabled cuz u dont have the game

woven fiber

Soz

meager thorn

its alright fam

woven fiber

Yh

Does the game developer need to program something in on the other end to open the app tho and make it detected

meager thorn

yeah

woven fiber

Where's the docs for that?

meager thorn

Look at his example


  rpc.subscribe('ACTIVITY_JOIN', (req) => {
    console.log('should join', req);
  });

  rpc.subscribe('ACTIVITY_SPECTATE', (req) => {
    console.log('should spectate', req);
  });

  rpc.subscribe('ACTIVITY_JOIN_REQUEST', (req) => {
    console.log('join request', req);
  });

woven fiber

But that is on the other end

meager thorn

this is on everyones end

who ever has this game

needs to have these

he isnt forced to

woven fiber

So they need a background process?

meager thorn

thats IF they want to actually use it

no

you see take it as if it was steam

you know how in steam I can right click a friend

and join game?

woven fiber

Ys

meager thorn

take it as that but its built-in the game

discord is telling the game

yo

some peep wants to join

wanna accept or deny?

if accept then it will let the player join the game

or depends on how the developer sets it up

woven fiber

So they need a background listener to open up the game?

meager thorn

to open up that game

woven fiber

Yes

meager thorn

discord konws the game exe

k so

woven fiber

Ah

meager thorn

lemme give u a example of this actually wait

woven fiber

And it calls it with some params after the acception

meager thorn

it says game not detected

right?

woven fiber

Yes

meager thorn

yeah because discord doesn't have the game in its game sections

woven fiber

So does it open up the exe and call it with some params such as spectate or play and the party id

meager thorn

yes

woven fiber

Noice

So it's in the added games bit, with the exe

meager thorn

its all inside the exe

woven fiber

I know

I mean to check if the game is detected it has to be in added games

With the name of the exe file

meager thorn

if its a non-verified game then yes

woven fiber

If verified?

meager thorn

it would automatically detect it

and if launched it would say

Playing blahblahblah

woven fiber

So you wouldn't need to open up the game

meager thorn
woven fiber

I wasn't talking about that

meager thorn

take this for example

woven fiber

Soz

meager thorn

destiny 2 is a verified game

woven fiber

Yes

meager thorn

if i launch it

it knows automatically

then im playing it

and I didn't even add it

discord added it itself

woven fiber

I'm not talking 'bout that

What I mean is that it just has a list of games you play and the exe, sorry for the confusion

I GTG

Thx so much

meager thorn

np

ye

Discord knows where to execute the game exactly

scarlet aspen
342 verbose stack Error: No git binary found in $PATH
343 verbose cwd C:\Users\Clashi\Desktop\Clashi SB\drpc
344 verbose Windows_NT 10.0.15063
345 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
346 verbose node v9.2.0
347 verbose npm  v5.5.1
348 error code ENOGIT
349 error No git binary found in $PATH
350 error Failed using git.
350 error Please check if you have git installed and in your PATH.
351 verbose exit [ 1, true ]

What is this?

vernal sinew

hm

meager thorn

350 error Please check if you have git installed and in your PATH.

download git?

nice selfbot

scarlet aspen

Thanks.

grim quest

Well, how to check the discord-rpc version again?

frail fiber

what command are you running, 420

scarlet aspen

npm install

vernal sinew

are custom rich presences bannable from discord?

scarlet aspen

no ^

grim quest

So, my discord-rpc version is discord-rpc@3.0.0-beta.2 @meager thorn

frail fiber

the package.json prolly contains some git dependency...

so yea, you do need git, sorry

meager thorn

ye thats the latest

grim quest

good.

meager thorn

@vernal sinew they aren't

as long as you dont use a selfbot to apply them

vernal sinew

i use just the rpc folder

without token etc

meager thorn

then its not bannable

vernal sinew

cool

meager thorn

@grim quest minda try replacing startTimestamp with

wait lemme check something before I tell u to do it

grim quest

ok

scarlet aspen

Is it possible to modify the elapsed time? Like new Date() - 600000

meager thorn

why not just Date.now()/1000

?

scarlet aspen

Doesn't work.

Look at my rp.

elapsed time stucks at 00:00

meager thorn

did you do the /1000 part

scarlet aspen

no

meager thorn

well thats why

Date().now returns time in miliseconds

discord wants seconds

scarlet aspen

Now it works, but it's not modified.

meager thorn

well I kinda explained why

scarlet aspen

Oh wait.

Yes.

I understand.

Ok ok.

grim quest

What did you done @scarlet aspen? Because mine isn't working

scarlet aspen

?

new Date()

meager thorn

Terax

scarlet aspen

Is working fine

meager thorn

put your code in hastebin

and send it to me

scarlet aspen

Oh it works.

Yes.

16 Hours ok

meager thorn

do me a fav tho

before you set it

parseInt

or Math.round( )

dont leave it like new Date().now() /1000

@scarlet aspen

craggy boughBOT
granite fractal

What is the channel where I can post questions about straight discord.js?

meager thorn
granite fractal

ok

craggy boughBOT
spark rain

I am getting this error from the sole existence of .destroy() in my code:

(node:5364) ExperimentalWarning: The http2 module is an experimental API.
(node:5364) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): false
(node:5364) [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.```
Any ideas?
carmine mica

hmm

i never tested destroy

¯_(ツ)_/¯

spark rain

So it may or may not work, like, at all?

carmine mica

¯_(ツ)_/¯

rejections with false aren't too common

i'll look into it

spark rain
  // based on the object from
  // https://github.com/discordapp/discord-rpc/blob/master/examples/send-presence
  console.log('Ready, setting rich presence');
  client.setActivity({
    state: 'Using Main Menu.',
    details: 'Available to join',
    startTimestamp: Math.round((new Date()).getTime() / 1000),
    endTimestamp: Math.round((new Date()).getTime() / 1000)+10,
    largeImageKey: 'menus',
    smallImageKey: 'icon',
    partyId: 'party1234',
    partySize: 1,
    partyMax: 6,
    matchSecret: 'xyzzy',
    joinSecret: 'join',
    spectateSecret: 'look',
    instance: false,
  });
 
  client.subscribe('ACTIVITY_JOIN', ({ secret }) => {
    console.log('Game Join Request', secret);
  });
 
  client.subscribe('ACTIVITY_SPECTATE', ({ secret }) => {
    console.log('Game Spectate Request', secret);
  });
  
  
  
});
 
// Log in to RPC with only client id; allows only rich presence.
// If you want to use other features you should see below for an example
// of authorization with scopes, which will still let you use rich presence
// if you are using the `ipc` transport.
client.login('');



client.destroy()```

I tried it in the ready loop as well, knowing me it's an issue my end.
carmine mica

uh

client.login and client.destroy are async

spark rain

Hmmm. I primarily based this around your example code which has it unasnyced. RIP me for being dumb.

So, I have to put them in async funtions like on ready or what?

carmine mica

uh

wut

no

spark rain

I've only used Async in python so I am kinda new to this.

carmine mica

i can't test anyway

the dev build of discord has a bug with rpc

and i don't feel like downloading stable

spark rain

You use canary or whatever or is there an exclusive dev version?

If anyone has any idea it would be appreciated :)

worthy ginkgo

How I can set the large image on richpresence?

I've tried with the link but nothing

spark rain

You have to upload an asset to your application

hard hatch

@carmine mica I have the Canary version which has the RPC server on, what do you need tested? :3

spark rain

I think he wants .destroy() tested

hard hatch

ah

spark rain

It should in theory cut the connection and remove Rich Presence

Any luck?

worthy ginkgo

How I can set image on rich presence? I’ve tried to upload it as assets on discord dev dashboard but nothing

pale sleet

oh

meager thorn

@worthy ginkgo upload the image in the application as large or small then use its name as the key

in RPC

@spark rain whats your problem exactly?

gritty spindle

alrighty then sam

I made the application, what now?

uploaded an image, etc.

meager thorn

add it as a game

gritty spindle

where?

meager thorn

Settings

gritty spindle

oh shit idon't have that

im on canary

meager thorn

Pretty sure you do if you have the client

oblique gorge

i need help

meager thorn

canary has that smh

I'm using canary

e.e

gritty spindle

ill refresh client

one sec

meager thorn

@oblique gorge whats the problem sir

oblique gorge

i was kidding

:>

i have no friends

meager thorn

im ur friend from now on

solution solved

oblique gorge

and lately i've been feeling like i don't belong

meager thorn

!

oblique gorge

ya know?

meager thorn

o

u need emotional support

qq

gritty spindle

I saved the application, uploaded a cover image + one asset (that is just random photos), and it doesnt show up in the Games

meager thorn

ADD IT

MANUALLY

gritty spindle

..oh

meager thorn

That's why I said add ._.

gritty spindle

it doesnt show here

lol

meager thorn

Did you build it as a electron app?

gritty spindle

..oh

the fuck

carmine mica

doesn't have to be electron

gritty spindle

alright

carmine mica

but the process must have a gui

meager thorn

yeah

I personally used pkg cuz

why not

¯_(ツ)_/¯

gritty spindle

can I just run a .js process

instead of like.. an electron app

im just unsure what goes into it lol

meager thorn

basically

you need that js

to be a executable file

¯_(ツ)_/¯

carmine mica

the fuck is that url

meager thorn

which one

carmine mica

oh

they got a new domain

thats new

meager thorn

they still own it

carmine mica

it redirects

meager thorn
carmine mica

"when it got really big"

meager thorn

like really really big

carmine mica

its been big for years

sam go away

meager thorn

pretty rude

how dare you

oblique gorge

gus has a huuuuuge penis

woah

meager thorn

that's pretty gay

take that to the gay channel

tall wasp

off-topic

carmine mica

i'd apprecate it if you didn't shitpost here

thx

gritty spindle

made an electron app called memes
??

im assuming theres some code I have to put in there

but uhh.. thats why im here

C:

oook ill just use gus' code

nvm

strange spade

Okay so I want to test RPC thing on another account. I have it on canary, and I'm using your example code and it works fine, but it runs on stable. I only want it to run on canary?

meager thorn

remove the game from ur stable

?

strange spade

It won't just re-add itself?

meager thorn

idk tbh

gritty spindle

idk fam this isnt working lul

i used gus' example

carmine mica

so basically

rpc connects to a unix socket

which is in something analogous to /tmp/discord-rpc-n

n increments

so the first client will be discord-rpc-0

second will be discord-rpc-1

my library only connects to the 0th one

because there's not much else to do

gritty spindle

am I required to have a small asset?

carmine mica

all fields are optional

strange spade

okay so i need to like have stable closed or something?

carmine mica

close the one you don't want to use

restart the one you do want to use

strange spade

oh restart thats why

carmine mica

in that order

that i said

strange spade

okay thanks ill try it

carmine mica

in your console you can see

strange spade

k

carmine mica

you should see like

[RPCServer] listenting on /tmp/asdhaksjfsfagasf/discord-rpc-0

gritty spindle

the most obnoxious part about doing rpc w/ electron (on osx) is that you have to package your app every single fucking time

carmine mica

no you don't

meager thorn

^

gritty spindle

how do you set the title then?

meager thorn

did you build it?

carmine mica

well

you don't need to set the title

to test

it will just show up as Electron

gritty spindle

discord doesnt detect the game though

yeah

carmine mica

so add it manually

???

gritty spindle

reeeee

ok

app.setAsDefaultProtocolClient(`discord-${ClientId}`, path.join(__dirname, 'launch.sh')); also is this needed? unsure what this does

carmine mica

discord checks if a protocol discord-client_id:// is registered

for spectate and join and ask to join

gritty spindle

so I don't need that unless im using that?

carmine mica

thats how it delects if you have the game installed

so ya

don't need that line unless you're using spectate/join/atj

gritty spindle

alright

strange spade

got it working, thanks 😉

craggy boughBOT
gritty spindle

Error: child "activity" fails because [child "timestamps" fails because [child "start" fails because ["start" must be a number]]]
if you cant tell, i have no idea what im doing

nor any idea of what this means

guspls

carmine mica

you have to send the timestamp as a number

what did you set it to

startTimestamp

gritty spindle

i used your code

carmine mica

which code

gritty spindle
carmine mica

thonk

ok guys

i fixed my client

@gritty spindle can't repro

gritty spindle

???? wtf

can i just put a random number in there

carmine mica

you don't need it

gritty spindle

o

works lul

thanks (:

gritty spindle

just one more quick question: is the watching/listening thing considered against the ToS and cannot do it via rpc?

you'd have to do it via selfbot?

solid pasture

Self-bots are not allowed, but why can't you do it with discord-rpc?

Why do they exist as values if applications cannot trigger them?

tall wasp

because it will be implemented soontm

solid pasture

eyes_eyebrows

gritty spindle

how to make user accept inv?

carmine mica

they get an email

check out my rp tho

solid pasture

Oh! By the way, @smoky scroll, I was wrong about self-bots being allowed for rich presences yesterday. The email said that rich presences without an associated game was allowed, not that using self-bots to do it was allowed. The Discord devs have explicitly and strictly stated that self-bots are not allowed. You were right and should therefore probably not be setting your presence like that. Sorry! 😬

smoky scroll

Yeah I'm aware

Lazy to switch to rpc been busy

solid pasture

👍

soft thistle

what's rpc

solid pasture

See: channel description.

cerulean lodge

Do we have any docs for RPC and if so can someone shove me in the right direction plox

scarlet aspen
grand marsh
woven fiber

What should the matchSecret/joinSecret/spectateSecret be a hash of, does it need salting and is there a recommended hashing type

I don't get why it would need salting

It doesn't does it, you wouldn't send any sensitive data over would you?

carmine mica

@woven fiber the way you encrypt it is up to you

the discord devs strongly recommend that you do

woven fiber

Discord js doesn't have rpc docs do they

tall wasp

they do

woven fiber
woven fiber

Thx

tall wasp

^

woven fiber

What should the secret be a hash of

Oh

So if you have a match id system with some data in it like map, they want it hashed so it is always the same length? Or is it for security

Cus their example used base64 (which is two way hash)

spark rain

So, I have tried to gather what I can, is there any exclusive conditions to destroy? I want to run it as a console script as preferably I want it to run in the background.

because it hooks in even when the application isn't selected manually by discord

Like, now it is booted.

And it tried to destroy and nothing occured so now I have to refresh my entire discord to throw it out

hmmm. Might be BetterDiscord, considering thats whats throwing tons of errors in console

Nope

smoky scroll

@smoky scroll Hi i wanted to know how did you do the custom rich presence thing pls idk how to do it

tf

Didn't ask you to go here to ask me again

Look at topic

And figure

woven fiber

Lucario is what I said about the hashing right

It isn't security is it

Do they just want the same ammount of letters every time

smoky scroll

wtf

spark rain

hmm. I got the new library (Copy and pasted latest commits from Github) and now it ends when the process ends (Or thats canary) but destroy still kills it...

As in:

(node:9532) [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.```
ancient anchor

@smoky scroll code

i bet ur doing DiscordRPC = something

smoky scroll

wut i am not good at coding

ancient anchor

show your code

smoky scroll
ancient anchor

you need to require the module

smoky scroll

i have the module

ancient anchor

then require it

smoky scroll

read pls

npm install discord-rpc

ancient anchor

smh

smoky scroll
ancient anchor
smoky scroll
spark rain

const { Client } = require('discord-rpc'); Like this

I think

smoky scroll

ok i will try

but where do i put it

ancient anchor

before you use it

smoky scroll

i am noob

ancient anchor
spark rain

just put it before CONST RPC

smoky scroll

ok

spark rain

Where it is on mine

ancient anchor

and change new DiscordRPC.Client to new Client

smoky scroll

like this?

ancient anchor

Assuming you used lavenders code

frail fiber

you need to change some stuff to make it work

spark rain

my code is probably wrong somewhere tbh

frail fiber

Change { Client } to just DiscordRPC

ancient anchor

and details isnt spelt right

u put detals

and is that an electron app

Since otherwise you wont be able to add as a game

spark rain

With mine, it literally just works

smoky scroll

Could I buy a VPS from anyone?

ancient anchor

no

smoky scroll

Or VPN?

ancient anchor

no

spark rain

I didn't have to add it and it's not an electron app

@smoky scroll Have you even searched on chrome, they are free

ancient anchor

I changed mine a little :^)

smoky scroll
ancient anchor

smh

mild ruin

xd

ancient anchor

a said change it to

not add

smoky scroll

can you show me your code pls

ancient anchor

no

new Client

spark rain

My code just does this

ancient anchor

?learn js

?learnjs

ancient anchor

I recommend you take a look at some of those

spark rain

oh wait mine just dumped it on without me realising sneaky discord bugger

smoky scroll
ancient anchor
mild ruin

Just... go learn js

ancient anchor

im not gonna say again

smoky scroll

but idkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk

ancient anchor

How dont you get that

change new DiscordRPC.Client to new Client

spark rain

Just use the example code.

ancient anchor

I literally typed that with out ``

yeah

smoky scroll
spark rain

If you are struggling and really only want to make a few memes or make your profile pretty use the examples

ancient anchor

omg

spark rain

👏

ancient anchor

ok i see you changed your code to const DiscordRPC = require('discord-rpc')

so use

new DiscordRPC.Client

smoky scroll

that quitting when i start it

so

it s confirmed

i am noob

ancient anchor

what

smoky scroll

gonna ask a french friend

ancient anchor

smh okay

Why dont you just use the example lol

spark rain

@smoky scroll ```javascript
const { Client } = require('discord-rpc');

// Rich Presence only works with IPC, and so it won't work in browser
const client = new Client({ transport: 'ipc' });

client.on('ready', () => {
// based on the object from
// https://github.com/discordapp/discord-rpc/blob/master/examples/send-presence
console.log('Ready, setting rich presence');
client.setActivity({
state: 'West of House',
details: 'Frustration Level: 0',
startTimestamp: Date.now(),
endTimestamp: Date.now() + (10 * 60e3),
largeImageKey: 'canary-large',
smallImageKey: 'ptb-small',
partyId: 'party1234',
partySize: 1,
partyMax: 6,
matchSecret: 'xyzzy',
joinSecret: 'join',
spectateSecret: 'look',
instance: false,
});

client.subscribe('ACTIVITY_JOIN', ({ secret }) => {
console.log('Game Join Request', secret);
});

client.subscribe('ACTIVITY_SPECTATE', ({ secret }) => {
console.log('Game Spectate Request', secret);
});
});

// Log in to RPC with only client id; allows only rich presence.
// If you want to use other features you should see below for an example
// of authorization with scopes, which will still let you use rich presence
// if you are using the ipc transport.
client.login('18712471923871230');```

Just use that

ancient anchor

does that actually work?

spark rain

yup

smoky scroll

let s find out

spark rain

of course you need to tinker

like with the client ID etc

But yeah, it works

smoky scroll

yeah gonna see

spark rain

Does anyone know if verified apps prioritise themselves over Rich Presence?

smoky scroll

it s showing me that when i start it

spark rain

Uh that has nothing to do with the example..?

ancient anchor

dont launch with debug

run normally

lusty portal

Hey dudes - im looking to get the skivvy on whats allowed for embedding discord chat on webapp?

smoky scroll

nothing at all to do with rpc

lusty portal

Cool cool, thank you @smoky scroll

smoky scroll

:triggerred:

spark rain

Is RPC rate limited?

carmine mica

yus

you can only set activity once per 15 seconds

spark rain

So I can't change the status in realtime. So how would I prevent a status checking too fast?

carmine mica

how often do you need to set it

spark rain

Not often, I just need a quick idea on how to prevent my script reading it too fast and trying to update too fast, chances are I can work it out.

carmine mica

wut