#archive-rpc-help
21942 messages · Page 7 of 22
take the token
and use it in the extension with the faked origin (faked to your webserver's address)
And I don't see how I can set expected origin in Discord's app settings
Also a problem
It may not accept localhost origin by default I think
Hmm
might be worth a try, gonna give it a shot
Ping me if that works :)
And if that doesn't work, also :D

its not those origins
you don't have access to websocket origins
cuz you aren't whitelisted
@obsidian ridge So I can't even test my app without being whitelisted?
Sorry for wrong mention
@carmine mica
npm freezes on installing discord-rpc 
[..................] | loadDep:snekfetch: sill resolveWithNewModule discord-rpc@3.0.0-beta.8 checking installable status
and then it freezes
¯_(ツ)_/¯
just tried the same on my vps
didn't work
someone help me to how you do this and explain it to me please https://gyazo.com/3a358f155e2bfea6638899db49487ad4
try installing from the repo idk
idk how
whats the easiest way to do it
i heard theres one
<@&222087754366844928>
just your average jake paul fan
please refer to rules 2-5 kunur
@nimble crane what is 2-5?
#rules read em
is it possible to show a progress bar like in the picture with this library?
I am sending both the start and end timestamp
but it shows like this:
No, that's a discord thing
not possible with the API
Yeah it's possible
You hsyt have to give a start and end time
And it will do it?
Yeah one sec
🤔
rpc.setActivity({
details: `🎵 ${song.name}`,
state: `👤 ${song.artist}`,
startTimestamp: song.start,
endTimestamp: song.end,
largeImageKey,
smallImageKey,
largeImageText: `⛓ ${song.uri}`,
smallImageText: `💿 ${song.album}`,
instance: false,
});
can we not write alternatives to spotify rpc
Why write alternative though 
how to make this custom status
by using this
read the channel description/topic
wich link @smoky scroll
all of them
surely you can tell from the keywords next to each link the ones that might help
@high onyx this isnt a testing channel for commands
sorry
I cant get rpc working.... I did npm run example and i get
npm ERR! missing script: example
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jmh_guest/.npm/_logs/2018-02-14T03_53_32_324Z-debug.log
Does anyone know how this works? I don't see the image at my profile
<@&222087754366844928>
You've already uploaded 2 images, 1 small and 1 large.
Do I have to remove the large one?
Not necessarily, i use both.
It's not working for me
I don't see the image(s) on my profile
Did you make any node js code?
Yeah, I did
I don't remember exactly but the images should be added by the name you've uploaded them.
'picname',
Ah, I'll try that.
Thanks
What does 'rpc' mean?
Remote Procedure Call
fun thing; channel topic says that
How can i see code of an .exe file
Could you remind of what that has to do with this channel?
Read the topic, smh
i dont fuckin know what remote procedural calls mean
Read a bit more of the channel topic, maybe?
"BUT WHAT THE HECK IS THAT I HEAR YOU ASK"

How does what he said even relate to this server
Let alone channel
I have a end timestamp on Sunday, February 18th 2018, and the start timestamp on now.
My rpc is only showing 8:00:00
How can I fix that?
Are you sure they are the same types of time-stamps?
It should be epoch seconds
Date.now() is ms
@flat herald
Ah ok, tnx man!
@woven fiber, the end date is formatted like this:
new Date(2018, 01, 18, 17, 00, 00, 00);
And I have only specified a endTimestamp
Math.floor(new Date(2018, 01, 18, 17, 00, 00, 00)/1000)
Try that
@woven fiber, what you said gives this in ms: 1518969600
The ms of Date.now() gives 1518862082960
The time will not come right
Help!…
I'm back
Ooops
I mean this Math.floor(new Date(2018, 01, 18, 17, 00, 00, 00)/1000)
@flat herald Just become better it wil help
❤
Luv ya
hi, i have a problem with the RPC lib, when i try to run my code (who is very basic) the console send me this message :
Uncaught TypeError: Transport is not a constructor
at new RPCClient (discord-rpc.js:8877)
at index.js:5
the :5 line who's got the error is the client loader :
const client = new DiscordRPC.Client({ transport: "ipc" });
please 🙇, help me.
@brazen siren try it in all caps
@sly halo, well sadly it didn't work.
@brazen siren browser build i assume?
Anything I try to do with RPC times out for some reason
Even if its not from node
thats very specific
thanks
<.<
are you on beta.9
I am
cool
Are you running under sudo?
I know I had that issue.
RPC server is local to the user or whatever
@carmine mica yes, browser build. You guessed right.
Is there a problem with it? (The browser build)
Pretty sure browser build is whiteliste only
whitelisted from Discord itself?
if true, that's a bit sad, though thanks a lot man 😉
I appear to be wrong @brazen siren , websocket origins are white listed.
hi
@obsidian ridge if i make an app on discord and enable rpc for assets, do i have to enable the spectate option if i want spectate? because those need to be approved by discord https://k.gc.gy/Rkb3.png
dammit
<@&413754863726493697>
you have to throw yourself away that's what
hi
ello
those are always enabled for people on your whitelist
and you
Isn't that like not well enforced
checking them is only for people who aren't on your whitelist
or you
Oh ok nvm
well shit so to have spectate i do infact have to have that enabled right
for everyone
Does activity work with RPC?
if you mean things like "Listening to" or "Watching to" instead of "Playing", only with selfbotting
Any idea why my VS Code won't work with RPC
Should I just reinstall?
You should probably go to the actual server for the VS Code plugin. If you're using Crawl's plugin, then join discord.gg/4aFThGU
@hallow dust ^
Does anyone know if the underlying lib has a problem with Ubuntu? VSCode hasn't been working (ik it's crawls) but he suggested it could be the underlying lib
unix pipes don't care what flavour they run on
i would suggest checking who you run discord and vscode as
Right how would I check that?
(I'm new to Ubuntu)
google m8
?googleit
_
__ _ ___ ___ __ _| | ___ ___ ___ _ __ ___
/ _` |/ _ \ / _ \ / _` | |/ _ \ / __/ _ \| '_ ` _ \
| (_| | (_) | (_) | (_| | | __/| (_| (_) | | | | | |
\__, |\___/ \___/ \__, |_|\___(_)___\___/|_| |_| |_|
|___/ |___/ ```
?lol
ŒŒ
?what
return `wha${'ta'.repeat(10000)}`
@carmine mica I checked, they run as local user
Hey there, quick question: what type of timeconfig are there for Rich Presence
anyone having problem with npm install discord-rpc ?
i keep getting this npm ERR! cb() never called!
no
test if u have node
run a cmd on ur console
Yes i have it, i can run my node app @hot sluice
‘’Npm install discord-rpc@2.0.1’’ works but not when i take out the version
yea i got it
i had an error in my code i fixed it just never showed up on my terminal so i was confused
?googleit
Google it... https://www.google.com/
?help
@compact grail, Sent you a DM with information.
Would I be allowed to do a very basic RPC thing that hooks in with d.js to make something like this?
*RPC status switches to the specified ID*```
or would that be considered a selfbot?
and I would get banned
if you have to use a selfbot for it
its a selfbot
when i try to auth i get this error, i do get the auth message in discord. but in de console it returns this
does anyone have an idea what i could be doing wrong?
const DiscordRPC = require("discord-rpc");
const clientID = 'CLIENTID';
const client = new DiscordRPC.Client({ transport: "ipc" });
client.on('ready', (e) => {
console.log(`Logged in as` + client.user + `!`);
});
client.login(clientID, {scopes: ["identify"], clientSecret: "CLIENTSECRET"}).catch(console.error);
am i missing something?
client.login('the token');
:/ ?
@DELUUXE#1608
Hi, can someone pls help me understand, What data i need to pass for OAUTH2 Authorization?
https://discordapp.com/api/oauth2/authorize?response_type=code&client_id=157730590492196864&scope=identify%20guilds.join&state=15773059ghq9183habn&redirect_uri=https%3A%2F%2Fnicememe.website
How can i pass this authorization?
that hardly has anything to do with rpc or this library
Sorry could get it, this is for discord support right?
not oauth support
which is what ur question is
Hi @smoky scroll

hi
since discord got strict with selfbots, the RPC - rich presence is also not allowed right?
rpc !== selfbots
its allowed to use this as you wish
ok thanks
?googleit
Google it... https://www.google.com/
someone tell me how do i fix the error?, and the timestamp shows?
you just put, startTimestamp, never defining it
read
the error
so i have to put a number?
yes
oooh
oh no
?
you have it defined twice
in there
where?
the end
and the middle
wait can u send a screenshot of how it would look like
the second one ISNT defined
oh
literally
just
delete it
k
it tells you the line number
in the error
line 20
ah-ha
wait
when i put the timestamp
does it show like
5:00:00 left or 4:00 elapsed
left or elapsed?
you can literally run the code
i did lol
k lemme try again
do i put anything in the parantheses?
new Date() is the current date
and end date, is the date when u want it to end?
yes
it's called endTimestamp because that's the time it ends
startTimestamp: Date.now(),
endTimestamp: Date.now() + 1337,
i ran that
the second one should break
you're adding an integer to a Date
do i remove "+ 1337"
cause that was a sample i found
that doesn't make sense no
from one of the chats
maybe it does work
idk
but I don't think it would
it showed me the error again
oml
show me
the error this time
delete line 20
k
for like
the 20th time
delete it
then run it
FFS FINALLY
I said this
20 minutes ago
go check
im deaf
I said
XD
what chat?
delete line 20
this one
wait how do i make it say elapsed
ShowyMC (2) - Today at 4:14 PM
wait can u send a screenshot of how it would look like(edited)
! this again - Today at 4:14 PM
the second one ISNT defined
ShowyMC (2) - Today at 4:14 PM
oh
! this again - Today at 4:14 PM
literally
just
delete it
ShowyMC (2) - Today at 4:14 PM
k
! this again - Today at 4:14 PM
it tells you the line number
in the error
line 20
instead of left
yah just saw
no clue
oh
im gonna go do other things
k
gl
anyone here know if your able to make your rpc green like spotify
not possible afaik
^
Anyone knows what's the code to finish a rpc connection?
?
can i have RPC and streaming status both in the same time?
no
one will hide the other
ok rip
Hey guys, anyone knows what does the "instance" option?
@frail tiger
Oh
Thanks
oof
RPC is AWESOME
how can i get RPC for my bot?
like
i dont know how to set it up
there's an example app that works great and showcases the basics
Could you maybe link that example showcase?
channel topic
this might be a dumb question, but what is RPC even mean?
ik it stands for remote procedural calls
but
what do they do?
Rich Presence
And I don't remember what the C means
Rich Presence Client
It does something like that to your profile
that you can customize
check chnl topic
jesus christ (sorry if im offending anyone) this is really complicated. i might do it another time.
@fast linden#0540
No
Really easy
The only problem I have is with disconnecting of rpc
I don't know why
is it possible to set richpresence when some visits my html website?
yes
do you have a smal example or something to get me started? because i have no idea how to "requere" it
no cause its not really in the scope of this server
okay, thanks
im trying to download discord-rpc using npm install --save discord-rpc but its saying that git isnt installed, when it is. anyone have a clue as to how to fix this?
install git...
I DID
reinstall
I DID
Restart PC?
I DID
smash pc
no u
type git what does it say
For some reason everytime I try download RPC it gets so far and then stops
I found this repo on github with a simple client for RPC and I tried installing the dependencies but it never finished
Why does using discord-rpc on my bot set the presence on my account?
Because it connects to the currently signed in user
So, I can't set it on my bot? 😦
No
rip
There's a separate RPC API for bots I think
RPC, rich presence control?
It's legit in the channel topic
I've been told bots don't support RPC (yet)
they probably never will
i mean they dont need it
they cant play games
or listen to spotify
plus iirc the rpc server runs on the discord client
Guys
I wanna know...
What is rpc exactly?
Read
The
Channel
Topic
if i set RPC to myself, is it selfboting?
no if you use this repo
ok
rekt
Why am I getting this every time I try to start my RPC client? https://hastebin.com/evepovayom.rb
I just created a new application on the My Apps page, but now my RPC client is dying when I use the Client ID
I'm using the discord-rpc module,
Just logging in
{ code: 4000, message: 'Invalid Client ID' }
discord-rpc isnt related to this
this is for support for snek's rpc module
specifically
👀
Oh I was using this https://github.com/discordjs/RPC
oh ok, well then the message is very obvious, the client id is wrong

did u use ur user id
No
I used the Application's client Id
maybe ur inserting it incorrectly then
not much i can do but read the error message 4 u
I did this exact thing about 3 months ago just with a different application I had created and it was working
I haven't changed anything except for the ID
yea so u probably dun goofed when inserting it
rpc.login(clientId), clientId = ...
that's not code
just
what I'm doing
could always log what ur inserting right above the method and verifying its the exact same thing and that its a string
oh
it wasn't a string
I haven't touched this project in months
Anyway
👌🏻
Thank you
np
I can't install RPC for some reason
Just gets stuck on this
what the fuck is rpc ?
read topic
ah it's rich presence client
or remote procedural calls
http://prntscr.com/isni5c idk... you decide
Is it possible to make my RPC say something like Listening or Watching. Cause I'm using Soundcloud & Discord atm and it says Playing http://roy-purdy.is-my.world/4Urg4h5.png
No
Only the bots can do that I think
Hey folks -- having trouble finding what to do with discord-rpc for Windows/Unity setup. What the heck do I do with the /bin /include and /lib folders?
if you're making a unity game you shouldn't be using the JS lib
they're header files so im guessing you put them into your project folder
p sure its for c/c++ tho
is it possible to use the RPC library for setting rich presence without konwing the user ID?
Wdym
@drifting wing That's not the users id, thats your apps client ID from the devs page
also how the hecc do i use RPC
i'm not using the browser
ah
thats the client ID
okay
well thanks
hey guys anyone around that could help me out with rpc commands struggling with something
?ask
Don't ask if you can ask a question, just ask it! If someone knows the answer, they'll do their best to help.
.
exists a way to prevent rpc's auto close when someone closes discord?
rpc.setActivity({
details: name.replace("&", "&"),
state: video.replace("&", "&"),
largeImageKey: 'netflix',
smallImageKey,
instance: false,
});``` how do i make it say Watching?
u dont
youll need a whitelisted application to do anything like that afaik
oh 😦
how come discord bots can say it
cuz discord said they can
¯_(ツ)_/¯
oh shit waddup that magic
@blissful zinc afaik
rpc.setActivity({
details: name.replace("&", "&"),
state: video.replace("&", "&"),
largeImageKey: 'netflix',
smallImageKey,
instance: false,
});
why'd u repost
Why does RPC not work on Ubuntu 16.04? I'm trying to use crawl's vscode and he suggested it's the lib's fault

rpc works fine on ubuntu
i know for a fact cuz i used the netflix rpc
You need approved application in-order to use RPC
no you dont @smoky scroll
exists a way to prevent rpc's auto close when someone closes discord?
You don't because it's connected to discord
ah ok thanks
how do i make a basic RPC application ?
idk
Why is not he going on?
Someone please?
Lm
Fixed
Huuh I do not see any package.json
how do i get the numeric combo in this snippet const client = require('discord-rich-presence')('180984871685062656');
What is RPC?
look at the channel topic
@supple trail Remote Procedure Calls
hey guys anyone around that can help me out
?ask
Don't ask if you can ask a question, just ask it! If someone knows the answer, they'll do their best to help.
okay so i have this code if(command === "test"){ var add = "BHedVtixo153E4QCsF2NquhME6mDTSo8Ai"; var num = 1; client.sendToAddress(add,num); message.channel.send("send 1 coin test"); }
but i want to put var add and var num into one var is that possible
That's not RPC related
client.sendToAddress is an rpc command
What does RPC stand for?
i have no clue lol but im using bitcoin rpc
Sorry but this is the Discord RPC channel
Maybe you're question would best fit in #archive-other-js-questions
alright thank you
um
hello
I'm trying to create Discord RPC for Netflix as chrome addon
and to include in it Discord.js I used webpack
but when I load it into Chrome
it shows me TypeError: t is not a constructor
and it is from discord
wait
here
do you know how to repair this issue?
:/
is it my fault or discord's
cuz I really don't know
:/
there is a way to use rich presence in discord.js and not at rpc ?
i guess this question as been asked alot, sorry
@scenic forge here nobody will help you
I asked question and I’m still waiting
Is it possible for rpc to send messages as a user?
rich prescence is only with the prescence of the user, u can't send or read any messages at all
no thats definitely not true
rpc isnt only for rich presence
but can you send messages? 
not sure about sending messages specifically but you can act on behalf of the user in other ways at the very minimum with this library
I need help with rpc
So i launched everything
but how do i get it showing up on my profile
i am just confused
dont see anything wrong with it
So it's trusted.....and if anyone used it will not get ban or something else
My friend is worried about that !
Let me have a look
Looks fine
Oh good my friend will be happy using it...
Btw do you know something similar to this @solid light
No I don’t
Do you even use rpc
No I don’t
Why
Haven’t had the need to yet I might check it out later
Ok when you use it you will like it...
🙂
Did someone say Role Playing Chat?
@dim verge lol
@dim verge y u not in sarah's dc
oh its Fartful!
that discord sucks
i rejoined a few days ago
and it's just
randos i don't know
:l
Yuh no one really uses it anymore 2bh
Lol
Im just lurking here
Listening in
When it's none of my business
look on their add-on/package page if they have one I guess
just use your common sense and Google it first
Will Richpresence work for bots, or no cause they have no actual discord program open?
yeah it wont work for bots
thought so
rip
how to use rpc?
look at channel topic, theres an example you can copy paste
Bella endorsing copy + paste
can i have something like this for my own song player or is that a "Trusted" app only thing
(the thing that shows how much of the song is remaining)
yes that's possible, i forgot how though
@smoky scroll it used to be available to all
it's just for sspotify now
think it will come back when rpc is no longer in beta?
is there a tutorial how to make my bot have RPC?
not available for bots
Hmm.. at one point I know Rhythmbot had a slider that updated every five seconds
'cept now it no longer seems to update, except when you give it the np command
That's not RPC, that's an embed that's manually updated. Not relevant to this channel.
So, question- how does Atom do rich presence without ever asking me to login with Discord?
I installed the extension and it just worked™
because the extension can access your local copy of discord, hence why bots can't use it I think
Hello how to modify the "Play to" of my Rich Presence?
Help !?
hi
@placid parcel You can't change rich presence type to eg. "Listening" iirc
😦
<@&413754863726493697>
I'm trying to find any kind of documentation for what can be put inside this, unless that's all of them...? If I'm blind and it's easy to find, my apologies
Never mind, found it
Glad I could help!
that a userbot?
Never mind, found it
k maybe not
???
Userbot is when someone runs an app on normal account (without the BOT tag) and i don't think that's rpc question 
It's also against TOS
So don't
I was saying that Cheithroid may be a userbot responding to the phrase "Never mind, found it"
^
Stop making pointless comments @smoky scroll @Cheithroid#2928
Unhandled promise rejection (rejection id: 2): TypeError: (timestamp - EPOCH).toString(...).padStart is not a function
any1 help?
rpc.login("398111176145502209");
async function updatePresence() {
if (!rpc)
return;
let details
let projectName = await win.webContents.executeJavaScript("$(\"#project_name\")[0].value");
projectName = "" ? details = "Working on ${projectName}" : ""
rpc.setActivity({
details: details,
state: "Modeling in blockbench",
largeImageKey: "blockbench",
largeImageText: "Blockbench - free modeling tool",
instance: false,
})
}
rpc.once('ready', () => {
updatePresence();
// activity can only be set every 15 seconds
setInterval(() => {
updatePresence();
}, 15e3);
});
Am i blind or that's not the part of the code that causes error?
well when i comment out all the rpc code i get no errors
im like relatively sure that means u need to update node
could it cause electron is node v7??
well padStart got introduced later, and ive used rpc just fine with electron, so
i found a padStart() pollyfill from MDN and now it works perfectly]
Tnx
I packaged discord rpc with webpack (hopefully correctly)
How would I used it in the browser.js form?
@smoky scroll
how to fix it?
are you trying to run browser version on node?
@near lynx node
@cerulean temple the browser example is for browsers only
i try it it not working
@cerulean temple you have to run that example in electron
what is electron @carmine mica
that which the example is designed to run in
link to electron
google is unusable
@carmine mica how?
how?
@smoky scroll where?
Kicked Common its Java#9772
@cerulean temple npm run example
oh
@carmine mica ok
@carmine mica
no i meant
in the rpc repo
where the example code is
How I can set a image without adding it in assets ?
you can't
Would be cool if you could set URLS
Hey guys
I'm hoping one of you will be able to help me
I'm trying to figure out how to make a continuous time elapsed thing kind of how the VS Code discord rich presence thing works
if (infos) { // if !infos don't change presence then.
let {songName, author, progress} = infos;
if (author) {
if (previousSongName != songName) {
// start new time if songs have changed
progress = new Date().getTime() / 1000;
}
else {
// otherwise pull the previous song progress and subtract it from new time
progress = new Date().getTime() / 1000 - previousTime;
}
}
previousTime = progress;
previousSongName = songName;
rpc.setActivity({
details: songName,
state: author
? `by ${author}`
: author,
startTimestamp: progress,
largeImageKey:'soundcloud',
smallImageKey,
instance: false,
});
}```
this is the code that gets ran in my update rpc function
it seems to work for the first few updates but then the time elapsed starts showing values that are way off in the 10,000s
the progress variable is what updates the startTimestamp in the rpc.setactivity
any ideas?
send time in milliseconds
@carmine mica what do you mean?
the thing is it works for the first two rpc updates
then it jumps down 10 seconds
then it goes up to an hour
then it goes back down
feel like i've been trying to debug this for months
how is it even coming up with these random values
Uhh noob question here, is this possible in node?
is this node
it looks like it
also is the second part of the require, the bot user id?
Discord Bots can't have rich presence as far as I'm aware
dw i realised its possible in node
uhh can they not?
It's for users I think
Oh
So there's no bot rich presence
Don't think so
But there's watching, listening, streaming as the activity
yea
but
is it only for self-bots then?
No
seflbots and users
You can use it standalone
Yes
ok
nice
large oof

lol
-ban 355982515489734657 hi spam
Are you sure you want to issue this ban? (__y__es | __n__o)
y
Successfully banned pop#0953
Thanks Crawl
Owo
Finally a ping here and it's spam
Banned for spam
Looks like he really put himself...in a pickle.
Puts on sunglasses
YEAAAAAAAAAAAAAA
pong where
how do u get accessToken? i thought localstorage getter is blocked
@open bridge that example goes on your own website not pasted into the discord client
but you can't use it anyway
you have to use ipc
check out the rpc example here: https://github.com/discordjs/RPC/tree/master/example
RPC = Roleplaying Community
No
Keep your shit posts out of here thanks @smoky scroll
@upbeat skiff self deletes too
?
dont spam self deletes. especially not here.
Oh...
I was just trying to get something to work
Sorry
type: 'STREAMING',
details: ((playState&&playState===1)?"▶️ ":"⏸ ")+songName,
state: author,
largeImageKey:'soundcloud',
smallImageKey,
instance: false,
})```
needs a vaild twitch url
it stills show that I'm playing a game
I also did with LISTENING
same problem
client.user.setActivity('YouTube', { type: 'WATCHING' })
oh thanks
npm i discord-rpc
http://normies.reee.ee/eeeeeeeeeeee/9eFa6SH.png
Assuming I need to install GIT? I'm trying to get started with this whole rpc thing.
Answer to my q. Yes.
you need it
nvm
const DiscordRPC = require("discord-rpc");
const ClientId = '415099419592228864';
DiscordRPC.register(ClientId);
const rpc = new DiscordRPC.Client({
transport: 'ipc'
});
rpc.on('ready', () => {
console.log("ready");
rpc.setActivity({
details: `Developing Eskimo`,
state: 'Writing',
largeImageKey: 'logo',
// largeImageText: 'logo',
// smallImageKey: 'test',
// smallImageText: 'test',
instance: false,
});
});
rpc.login(ClientId).catch(console.error);
``` Don't work
Mention me if you want to respond me
k
now work
Sometimes the rp isn't displayed in the list
Is someone going to write RPC for brackets? Im really looking for it and its only one text editor without this feature and it supports extensions
Is it possible to use RichPresence through a browser? This is being done through coherent UI (Chrome 28) and no same-origin policy.
I'm devoloping an Electron app and I have two questions: 1. How to I use it in typescript ( i tried: import DiscordRPC from 'discord-rpc';) 2. Is there a methode that I have to call on close?
Is there any typescript definition file?
nope
not that i know of anyway
you should still be able to use it though
It complains that it wasn't fount
¯_(ツ)_/¯
I think I got it to work with the normal require for now
Is there a method that I have to call on close? or does it close automatically?
ah found it: .destroy()
How do I make it like I can send invites in the chat but don't have an ask to join button in my Profile?
You need to request that from your APP profile. It needs to be accepted by the Discord staff to have that feature though.
If this is what you mean;
http://normies.reee.ee/eeeeeeeeeeee/oGBh7eA.png
@sonic kayak you can do rpc in browser but I couldnt get webpack to export discord-rpc
strajabot> Getting the library working isn't the problem. Establishing a websocket connection is the issue
Well since discrodjs is known to be working in browser with webpack and its discord-rpc's dependecy that does the websocket connections it should work
At least I think so 🤔🤔 someone confirm if im right
discordjs uses a websocket to connect to the discord APIs
RPC is connecting to a local server. For rich presence, it seems that an IPC interface is needed.
https://github.com/discordjs/RPC/blob/master/src/transports/WebSocket.js websocket transport method for RPC
@sonic kayak
Yeah I know that the transport exists. It's just not possible to actually connect to the RPC over websocket without being whitelistsed.
you don't need whitelisting for an IPC connection
Can i get somewhere code of visual studio code/atom rich presence?
I want to make extension for other text editor
This is a RPC made by HyperCoder Dependent On ICrawls VSC Extension!
His Respository ---->
https://github.com/HyperCoder2975/vsc-discord-rpc
His Extension ---->
https://marketplace.visualstudio.com/items?itemName=HyperCoder29750.vsc-discord-rpc
Can Anyone tell me fir what is this RPC?
https://github.com/discordjs/RPC
As it is demanding a Voice Channel ID🤔
Please anyone help me! @carmine mica
I got redirected to ask here from TheIdiots Server
<@&222089067028807682>
sorry wrong server!
Is it possible to get the "playing line" for non-spotify rpc?
the progress bar?
I think not.
yeah the progress bar
i believe if you provide a start and end time, then itll happen.
nope
Hello. I have some problems getting rpc working
Anyone that would be willing to help me out ?
sure
Let me just grab the link
Starts on ln 70
I tried pinging some others websites and everything else worked.
rpc only runs on your local pc
the same pc your discord desktop client is on
Right now how would I fix that
run your code on your pc
instead of instance-1
Right. So that means I have to run it from my PC ?
yes
Why can't I do it from the VPS
thats what i said twice now
because thats not how it works
This is supposed to be for a bot, right ? Why should I be running it for a normal discord user. I just don't get it
its not for bots
its for users
...
rich presence doesn't work on bots
Why's there a section on discord developers page for it
because thats where the developer docs are
???
Rich presence assets
yes
applications aren't just bots
you're thinking about this all wrong
this is not rich presence channel btw
I was told to go here tho..
ntanis go away
I think he is confusing rpc
Refered from other newbie libs
with rich presence
ntanis
go
away
@smoky scroll so
here's how rpc works
an oauth application is registered
this application contains assets
usually for games
like blizzard would have an "Overwatch" application
Right.
then you can add images for the maps, characters etc
whatever your game has
then in your game you put code for rpc
which tells the local discord client "i'm playing this game on this map with this character etc"
so it grabs the assets you predefined
and shows them to all your friends
like this https://gc.gy/祿♅.png
How would I bring this to my discord "bot" or convert it to something that supports this
Yeah I get it
bots do not support rpc
Ah. I was already excited about getting dynamic profile pictures for it :v
you can just change the profile pic
For example the icon would change when it was assigning roles to someone or stuff like that
Wait.. can I ?
yeah but not that fast
Any idea when the next beta will be out?
Need the clearActivity() method to shutdown the rpc properly. Until it's available I'm using the implementation directly.
rpc.request('SET_ACTIVITY', {pid: process.pid})
The method I had previously used since December is no longer working.
I want to begin RPC where to start?
@carmine mica you alive?
I need some insight on the RPC transport type
a.k.a the WS method
@smoky scroll huh
from what I've gathered the WS should work for any app as long as you are in the whitelist until approval right?
mhm
and you have access to all RPC calls
er
you have to be in discord's whitelist
not your whitelist
last time I checked you just have to be in the app whitelist
but I can check
app whitelist is for invite features and such
also is there a way to get discord-rpc onto a CDN?
discord whitelists who can use websocket separately
due to security concerns
https://unpkg.com/discord-rpc should work
but you won't be able to
since I need to use it inside a chrome extension
sucks
and that one is coded with old ass deps
they don't want you to do that
hmm
can you run RPC from a browser?
yes if your app is whitelisted
btw @carmine mica do you know any timeframe for when the RPC leaves closed beta or if our app can join in?
since rn for the extension a WS relay is needed to bypass the whitelist

hey guys so im getting an error
{ Error: connect ENOENT /run/user/0/discord-ipc-0
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'connect',
address: '/run/user/0/discord-ipc-0' }
anyone know
Can read the whole thing
@smoky scroll are you on ubuntu
yes i am
also im getting this error
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/root/discord-rpc-spotify/node_modules/discord-rpc/src/index.js:2:14)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)```
discord -rpc-spotify
@smoky scroll you know spotify has built in support for dicord presences
How can I set up RPC?
For my bot using discord.js
bots cant use rpc
I've seen video on YouTube that some guy set up rpc, there is also setting for rpc in bot page on discord devs
Unfortunately he wasn't doing it on discord js
like i said, its not for a bot
its for your client
you pass assets to an application though, which a bot happens to be
but the bot itself cannot make use of rpc
I'm newbie at this stuff so I don't know how to do that lol
as long as youre still not trying to get your bot to use it, then you can look at the channel description/topic here
So, you say that I can't set it up?
you cant for your bot
but you can for yourself, like on a user account:
how tho
Look at channel topic
no idea
Read it
comes with an example you can copy paste too
copy paste
to where
if u dont know how to run a node app i suggest you look at some google tutorials
which is weird 'cause it even tells you how to
😤 but node is some next level stuff. I could never learn that... 😤
e
hey there fellers, trying to develop a brackets discord rich presence extension but having a lot of trouble getting the library to load
ive followed all the error instructions, tried everything
legit nothing will work
only on the first line lol
as you can see i have discord-rpc installed thru npm in the folder
im just on the first step here tryna get the shit to LOAD so i can actually make my extension ;<)
hello there
trying to use the discord-rich-presence wrapper
example code works great
however, replacing the client ID on the first line with the client ID of my new app gives me an error
const client = require('discord-rich-presence')('180984871685062656');
client.updatePresence({
state: 'slithering',
details: '🐍',
startTimestamp: Date.now(),
endTimestamp: Date.now() + 1337,
largeImageKey: 'snek_large',
smallImageKey: 'snek_small',
instance: true,
});```example code
must have been the largeImageKey and smallImageKey things
because removing them worked
You need to have uploaded pictures to the app and then use the set keys
@smoky scroll what's the error? I can't see it properly
I got that part fixed. I gave up the plugin. The way Brackets manages Node stuff is unusable
Oh
use discord-rpc
Also instance is deprecated and even if it wasn't, you don't need the comma after the last value
Yeah so, every time I tried to run my program, it kept saying object.entries is not a function
could not fix it
and it was tied back to the discord-rpc
in some way
this isnt java support
Sorry :c
no worries
Does anyone know how to start a bot. My bot start command is now outdated.
Btw i used to use node .
node scriptname 
wrong channel OwO
^
@regal vine never tell people to change their code style while giving support
that's irresponsible and makes you look like a dick
is there a help channel?
@tranquil charm #archive-other-js-questions


is RPC basically rich presence
this is my only question for this channel lol
@covert raven read topic
k

const DiscordRPC = require("discord-rpc");
const ClientID = '456826241933377539';
const snekfetch = require("snekfetch");
const rpc = new DiscordRPC.Client({ transport: 'ipc'});
const startTimestamp = new Date();
rpc.on('ready', () => {
const request = require("request")
url = 'http://api.vime.world/user/2760573/session';
request(url, function (error, response, body) {
if (error || response.statusCode !== 200) {
throw error || new Error("Invalid status code");
}
const obj = JSON.parse(body);
// ...
console.log(obj);
rpc.setActivity({
details: `${body.user}`, //i tried everything here, JUST EVERYTHING
state: `${body.message}`,
startTimestamp,
largeImageKey: `cat`,
largeImageText: `Привет!`,
smallImageKey: `smile`,
smallImageText: `Я люблю САЛО`
});
});
});
rpc.login(ClientID).catch(console.error);```
why does it says undefined?
It’s very obvious what he means
😛
Thats what I use.
.-.
Heh, I dont use RPC. I dont know why Im here.
@smoky scroll use obj.user and obj.message
not body.user and body.message
@raw holly can you delete the video above
it links to some java shit
can i maybe have manage message perms here
@carmine mica thanks, but have you seen into the URL?
yes
I want to parse the username
its a string
so I have to use obj.username, right?
or obj.user.username
@candid coyote ```js
const body = {"user":{"id":2760573,"username":"iKpudka","level":37,"levelPercentage":0.51013,"rank":"YOUTUBE","playedSeconds":1307656,"guild":{"id":107,"name":"Revenge","tag":"Life","color":"&6","level":55,"levelPercentage":0.3143406779661017}},"online":{"value":false,"message":"Игрок оффлайн"}}
const obj = json.parse(body);
${obj.username} ${obj.online.message}
@carmine mica
ecmabot.js:3
const obj = json.parse(body);
^
ReferenceError: json is not defined
at ecmabot.js:3:13
at Script.runInThisContext (vm.js:91:20)
at /var/ws/run.js:46:25
at Object.<anonymous> (/var/ws/run.js:72:3)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at createDynamicModule (internal/modules/esm/translators.js:54:15)
lol
ikr
@candid coyote ```js
const body = {"user":{"id":2760573,"username":"iKpudka","level":37,"levelPercentage":0.51013,"rank":"YOUTUBE","playedSeconds":1307656,"guild":{"id":107,"name":"Revenge","tag":"Life","color":"&6","level":55,"levelPercentage":0.3143406779661017}},"online":{"value":false,"message":"Игрок оффлайн"}}
const obj = JSON.parse(body);
${obj.username} ${obj.online.message}
@carmine mica
undefined:1
[object Object]
^
SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at ecmabot.js:3:18
at Script.runInThisContext (vm.js:91:20)
at /var/ws/run.js:46:25
at Object.<anonymous> (/var/ws/run.js:72:3)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
@candid coyote ```js
const body = {"user":{"id":2760573,"username":"iKpudka","level":37,"levelPercentage":0.51013,"rank":"YOUTUBE","playedSeconds":1307656,"guild":{"id":107,"name":"Revenge","tag":"Life","color":"&6","level":55,"levelPercentage":0.3143406779661017}},"online":{"value":false,"message":"Игрок оффлайн"}}
const obj = JSON.parse(body);
${obj.username} ${obj.online.message}
@carmine mica
'undefined Игрок оффлайн'
oh
obj.user.username
whoops
So, this should be working, right?
I'm currently online via smartphone, so I can't really test it
const DiscordRPC = require("discord-rpc");
const ClientID = '456826241933377539';
const snekfetch = require("snekfetch");
const rpc = new DiscordRPC.Client({ transport: 'ipc'});
const startTimestamp = new Date();
rpc.on('ready', () => {
const url = 'http://api.vime.world/user/2760573/session';
snekfetch.get(url).then((r) => r.body).then((obj) => {
console.log(obj);
rpc.setActivity({
details: `${obj.user.username}`, //i tried everything here, JUST EVERYTHING
state: `${obj.online.message}`,
startTimestamp,
largeImageKey: `cat`,
largeImageText: `Привет!`,
smallImageKey: `smile`,
smallImageText: `Я люблю САЛО`
});
});
});
rpc.login(ClientID).catch(console.error);
Thank you <3
Do anyone have a tutorial how i can make a rich?
How can i make my own rich presence?
Check channel topic @smoky scroll
Is there an example of a browser extension using RPC?
I saw the one on the github, but it doesn't explain much.
or rather, is it even possible to make a browser extension that uses RPC?
@gritty spindle you'll need permission from discord to use websockets
eeeee this guy is using an express client
would that work?
uh
i dunno
am I able to specify "LISTENING" with this?
https://github.com/devsnek/discord-rich-presence
or will I need permission for that also 
@gritty spindle only the official spotify rpc can do listening
Hey, is there some way to check for a rpc of a bot
Bots can’t have rich presence
well I mean like the playing message
Just presence
yes
like this
I said just presence
Use set activity method
I mean can you check for that
user.presence
