#archive-rpc-help
21942 messages · Page 10 of 22
doesnt seem to save
ah ok
its fine
ye
i have no clue
xD
hastebin tends to die
?hastebin
Please don't upload files or post unnecessarily long code blocks.
You can paste relevant code into https://hastebin.com/ instead, press CTRL + S or click the save icon and share the link.
Alternatives: https://hasteb.in/, http://www.hatebin.com/
I'm still somewhat of a noob at Discord Rich Presence... so bear with me plz; how would I incorporate a "join" button to my rich presence? I'd just like it to open a link in the default browser.
Also, what's the difference between RPCClient#connect() and RPCClient#login()
as far as i understand, rpcclient.connect connects to the rpc (well, that's what docs say) and rpcclient.login logs app in. it also calls .connect itself if needed
Hmm - so I seem to be confused. Setting up djs-rpc in nodejs on electron. I have imported Discord like this:
import * as discord from 'discord-rpc';
And then followed the rich presence example to get things running. When I start the app, I get the error:
{ code: 4000, message: 'No Client ID Specified' }
Clint id is being passed in and is set.
Also does there happen to be a d.ts file for djs-rpc floating around?
Found the issue...
rpc.login({ clientId }).catch(console.error);
Was what the demo had,
rpc.login({ clientId: clientId }).catch(console.error);
worked.
So I thought it time to delve into RPC but am I right in suggesting that you still need a whitelisted app to be able to use it? Running into invalid origin errors using the sample code in the docs.
What are you doing in the RPC?
To just display game state and message no whitelist required
To do joining and spectating yes. You need to invite people to the app manually for testing, and when done go through the submission process to get the app unlocked so anybody can use it.
@hallow badger Interestingly, those 2 lines ( { clientId } and { clientId: clientId }) are practically same.
@left fjord I figured out why 😂. I misspelled the variable. I wrote cleintId.
Yeah I'm just doing statuses
But invalid origin is a thing
Do me a favor and copy line for line the rich presence demo
And fill in your app details
Don't assist @smoky scroll, he won't listen to your help.
?
I know you can set a custom playing with RPC, but can you set streaming?
it says
Invalid origin
What should i do now?
definitely start with bit more context
there is asset limit per app, and I'm not sure if you can add assets using api
does anyone can help-me ?
when i clear the chat
the bot
doesn't say the message " Chat limpo por .. "
not rpc related, go to #archive-djs-v12-deprecated
fuc u
is it ok ?
@dire fox still not RPC related, please go to #archive-updating-to-v13 or #archive-djs-v12-deprecated
s o r r y
Hi, is anybody know how works the createLobby function?
i can't make this one works :/ still dunno why
please help m_m
C:\snapshot\Users\SinisterCyborg\Downloads\HammerRPC-master\node_modules\discord-rpc\src\transports\WebSocket.js:25
);
^
SyntaxError: Unexpected token )
at Object.exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:543:28)
at Module._compile (evalmachine.<anonymous>:0:0)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at Module.require (evalmachine.<anonymous>:0:0)
at require (internal/module.js:20:19)```
thats a syntax error
NSFW chanal
now
https://github.com/discordjs/rpc/tree/master/example is that a plugin? if yes then does it works?
why am i getting Object {code: 4000, message: "No Client ID Specified"}
i've tried as an int
a string
still nada
(yes i've tried it as a string)
login takes an object
on stable
not master
there's only one rpc version
wai
oh
it didn't use to

why isn't this working
rpc.setActivity({
...
timestamps: {
start: startMS,
end: endMS
},
})```
new Date(startMS): Fri Feb 15 2019 21:47:50 GMT+0000 (Greenwich Mean Time) {}
endMS: 1550269036485.952
new Date(endMS): Fri Feb 15 2019 22:17:16 GMT+0000 (Greenwich Mean Time) {}```
i've tried converting it to int (parseInt)
@fossil pilot ```JS
rpc.getGuilds().then(guilds => {
for (let index = 0; index < guilds.length; index++) {
const element = guilds[index];
console.log(element.name)
}
})
I put this on the ready listener
but it's saying Error: Not authenticated or invalid scope
same into the login callback
I dunno, I don't use rpc, wait for someone to answer
while authorizing i get back a code
but idk where i am supposed to use it
i mean it may be the auth2 code
Hey guys Im having a quick question:
I developed a tool for RPC with Discord.js ( https://go.astrogd.eu/rpc Redirects to Github)
But strangely if I use the tool and set my Activity with RPC, My Status vanishes after some time and I need to trigger the setActivity again.
Is this a bug, or do I need to constantly set the Activity every like 2 Minutes or so?
Hello, when trying to login i keep getting this error code: { code: 4000, message: 'Invalid Client ID' }, the client id was taken directly from the applications general site, and the code is: rpc.login({ clientId }).catch(console.error) // Log in and catch any errors`
I have tried with two different codes, one of which i know for sure worked earlier this year, and that app has not been touched/deleted.
So running into this error with node...
npm WARN discord-rpc@3.0.1 requires a peer of register-scheme
when I try to do npm install, it fails saying register-scheme is missing
but I can't seem to install register-scheme
What is more, register-scheme is not listed as a dep on npmjs.com
Error: Unresolved node modules: register-scheme
It does show it in the package.json. Discord rpc runs fine without installing this dep - is this something that should be removed?
"peerDependencies": {
"register-scheme": "github:devsnek/node-register-scheme"
},
Ok so I managed to get it fixed, you need to call
npm install -g --production windows-build-tools
npm install register-scheme@github:devsnek/node-register-scheme
npm install
and everything works as expected
What are the largeImageKey, smallImageKey, and smallImageText?
Nvm figured it out
root@dbotszhost-1:/home/hbot# 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! /root/.npm/_logs/2019-02-22T13_13_02_313Z-debug.log
why?
why i cant install this it makes no sense
Send the log
On my root it is working properly
you should have git installed
How do I go about adding "Ask to Join" to my rich presence?
Hello, is it possible to add rich presence to my bot ? I tried playing around with client.user.setPresence({}) but it did not seem to work properly (all it shows is the "Watching <string>" instead of the full rich presence tab that I was expecting. Would I have to create a different app, or is it possible ?
Bots cant have Rich Presence
Alright, thanks 😃
same as for supporting IE6
just why
especially when chrome likes to update itself in bg
@carmine mica The trailing comma here is still against pretty much all coding practices, and you should aspire to make this code to work with as many environments as possible. Fixing this mistake would cause no loss to you, so why not just merge the PR? The only reason I see for the trailing comma is for cleaner git diffs, but that is rarely the case and isn't done consistently throughout the project.
How to find asset id?
Or can i use asset by name?
@left fjord unlike IE6, Electron 2 is still commonly in use by many people. Also, Electron 2 was released on May 2nd, 2018. IE6 was released on August 27th, 2001. It is not the same at all.
The git diff to fix the problem is only +1 -1, so why is there a problem? It's not like the project is going out of its way for compatibility fixing this, it's just blatantly disallowing people using slightly older versions of Chrome from using it.
\\
Whole thing is just one , god...
does anyone know how to modify presence of user ? (playing at <>, since <>, etc...)
that's what this library is meant to do. check out the example in the channel description
why is the corresponding Discord user in the example app ?
It's not. Are you talking about the ID? Replace that with your application's client ID, it needs it to provide the name of the application and select images
But who is affected by the program ?
Whoever is running the program on their device. This code needs to be executed on the user's device. That's why its most common use is in electron apps. You will likely need to bundle node with your application, and that's just what electron does.
okay ...
What isbrpc ?
read the channel topic
how will i make invites
@lunar schooner message.channel.createInvite()
Excuse me, I have a question about discord-rich-presence:
https://www.npmjs.com/package/discord-rich-presence this one to be exact.
I'm pretty new to JS and I've kept searching for a way on how I might solve this. My problem is that I do not know, how I can reference the discord rpc to my JS (which is a chrome extension). What I want to do is: Get values from my chrome extension (done already!) and then display them in the RPC. I've downloaded the node module and have a folder with discord-rpc and a folder with "ws" for websocket I guess, but there are about 20JS files. How can I reference these to my chrome extension so that my main code can use the updatePresence() function?
anyone x-x?
do you have npm?
yes
I've got the package as well @boreal stream
It is also in my node modules
Now the question is how do I import this to my project? Since its a google extension, do I have to add every single .js file to the manifest.json maybe?
https://puu.sh/CVxUQ/1633a47073.png inside the Discord-rich-presence NPM
i..don't think you can use discord RPC in an extension
since it needs the client app
Yea it probably depends on node Looks like theres a browser version of discord-rpc no clue if rich-presence uses it
oof did I code this for nothing now aaaaaaaaaa
I thought I might run it in the extension
someone help me ?
Don't ask if you can ask a question, just ask it! If someone knows the answer, they'll do their best to help.
im a bit confused rn.
const RPC = require('discord-rpc');
const clientId = 'CLIENTIDHERE';
const clientSecret = 'CLIENTSECRETHERE';
const redirectUri = 'REDIRECTURIHERE';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
const client = new RPC.Client({ transport: 'ipc' });
client.on('ready', async () => {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
console.log(await client.getVoiceSettings());
});
// Log in to RPC with client id
client.login({ clientId, clientSecret, redirectUri, scopes })
.catch(console.error);
it doesnt auth properly and gives me the error invalid_client when it tries to exchange the code for an access token in the client#authorize
then its probably invalid
if i remove the clientSecret it works fine
it's possible to use discord.js rpc in browser addons?
not like someone was answered to that like 10 messages above
const find = require('find-process');
var fs = require('fs');
console.log('LOG: Connecting to Discord Servers...')
const client = require('discord-rich-presence')('123');
console.log('✓ LOG: Connected to Discord Servers.\n')
var old_time = new Date();
function update () {
find('name', 'EXE#1', true)
.then(function (list) {
if (!list.length) {
console.log('LOG: EXE#1 is not running!');
process.exit(0);
} else {
console.log('✓ LOG: EXE#1 is running.');
find('name', 'Discord', true)
.then(function (list) {
if (!list.length) {
console.log('LOG: Discord is not running!');
} else {
console.log('✓ LOG: Discord is running.');
}
})
}
})
var new_time = old_time;
client.updatePresence({
details: 'Loaded!',
state: `Loaded!`,
startTimestamp : new_time,
largeImageKey: 'big_logo',
instance: false,
});
}
setInterval(() => {
update();
},15000);
im trying to achive when EXE#1 is isn't running nodejs project will close, then if EXE#1 is running its will continue to check if EXE#2 file is running if not it will run loop till EXE#2 is found, only then show RPC client.updatePresence.
I got no error now
but it doesnt work
add **.catch(err => console.log(err); ** on the end of console.log(await client.getVoiceSettings());
how i can retry connect to discord with you lib this work but its not very beautiful :
rpc.login({ clientId: clientId }).catch((error) => {
var interval = setInterval(() => {
rpc = new DiscordRPC.Client({ transport: 'ipc' });
rpc.on('ready', () => {
console.log('Authed for user', rpc.user.username);
rpc.setActivity({
details: "In menu",
largeImageKey: "icon",
largeImageText: "Counter-Strike Global Offensive",
instance: false,
startTimestamp: new Date()
})
ready = true
clearInterval(interval)
});
rpc.login({ clientId: clientId }).catch(() => { })
rpc.connect()
}, 3000)
})```
Code is not supposed to be "beautiful"
and even less if you use javascript
I dont think is a good way to retry using DiscordRPC.Client
just make the thing a seperate function plus the ready event doesnt need to be repeated
just do rpc.login again
I am trying to get "Ask To Join" to work but everytime i invite the channel or smth it says the game has ended ```JS
const scopes = [ 'rpc', 'rpc.api' ];
RPC.register(clientId);
const client = new RPC.Client({ transport: 'ipc' });
client.on('ready', async () => {
client.setActivity({
state: 'Watching',
details: 'Something',
endTimestamp: new Date(),
largeImageKey: 'bestKey',
smallImageKey: 'play',
partyId: '7123498',
partySize: 1,
partyMax: 6,
joinSecret: 'MTIzNDV8MTIzNDV8MTMyNDU4',
matchSecret: 'MTIzNDV8MTIzNDV8MTMyNFF4'
});
client.subscribe('ACTIVITY_JOIN', function(stuff) {
console.log(stuff);
});
client.subscribe('ACTIVITY_JOIN_REQUEST', function(stuff) {
console.log(stuff);
});
var lobby = await client.createLobby(2, 6);
});
// Log in to RPC with client id
client.login({ clientId });``` (Ignore the test code)
well
end timestamp is literally exactly same millisecond as when running code
I know
Or is that the problem
?
🤔
pls say no
it literally ends millisecond after that code being run
its... logic...
Welp was testing out stuff so 
Doesn't solve the problem anyways
rpc.login({ clientId: clientId }).catch((error) => {
setInterval(() => {
rpc.login({ clientId: clientId }).catch(console.log)
}, 3000)
})```
this don't work 😐
error:```
Error: Could not connect
at Socket.onerror (H:\dev\csgodiscord rpc\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)```
when I open discord while this work
wait, so you first launch rpc then discord?
yes
tried differently?
i want to start my program and then if i open discord rpc connect to discord
but you know that it connects to existing, and running discord client, right?
huuun
that's why
whats the rpc thing?
i dont understand what it is
that's rpc
basically
ohhhhhh
ok
i thought i could sneak in and bring in some cool features for my bot but i dont think i want this
thank u @left fjord have a good day!!
nor you can
u2
oh
so it shows EVERYTHING im doing?
uhm
i dont think id like that lmao
wha
i mean, bots can't have rich presence
oh man
i wish
@left meteor help
@gleaming linden help
@smoky scroll :: I've sent you a DM with the command list.
can anyone give me code example with rpc?
i want to get started in it
cough channel description exists cough
ok :>
nvm
xd
Can you give your bot a RPC status with this?
no
Hi i am wondering if you can make a web app display a rich presence for someone. Is this possible?
how to get the application picture url in rich presence if you have the id?
Is there a list of available commands? Because i can not find commands like "CONNECT_TO_LOBBY" on the official docs
for presence can I set reset the timestamp when a variable is changed?
I've tried everything
haven't been successful
yeah, you can
pretty sure u just change the timestamp in the setactivity
I keep getting a could not connect error
im getting _closeMessage: 'Invalid Origin', message from trying to login
you use discord's web version?
Yup, i'm just bad.
You can ignore me.
totally didn't have status turned off
is it possible to sent a message through the rpc?
cuz i want to make an interface where people can see the messages of a specific channel and also sent messages to that channel
the reading messages already works
feel free to tag me when you reply to me ❤
Anyone know if it's possible to update rich presence from a web app?
sure
just run a node server and have the webapp make requests to it
or do some server side rendering and package it together
The node server would need to be localhost though, right?
doesn't have to be
but usually requests are made from the same machine
Hmm... Having trouble understanding how my server would communicate with a clients localhost
A request from the users browser to my server will not trigger communication w/ the users discord client
I was contemplating somehow using OAuth, but I couldn't really tell how to use the rpc oauth perms. Either I'm not searching right or documentation was unclear
Likely the former
oh yeah duh, i forgot, the way i usually see it work is the server is distributed which is what actually "runs" the "game"
i have seen people do that with browser extensions
so you would have to run the "game" and then the browser extension makes requests to the local server or something
I've seen a browser extension which works together with a ran application (extension tells the app what youtube video is being watch, for example, and the app updates rpc)
right
if you were looking for a more streamlined experience you could probably make an electron app for it tho
In this case it's a webapp, so the "game" runs in the browser. I don't think it's feasible to have each player run a local application
Ehh that's outside the scope of our goals for the foreseeable future. But yes, that would enable us to use rich presence pretty easily...
yeah only because you said webapp, which is basically what electron was made for lol
How do I clear the rich presence if I want to apply a new rich presence
const clientId = '565161122798370816';
DiscordRPC.register(clientId);
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
const startTimestamp = new Date();
if(rpc.application) {
rpc.destroy()
}
async function setActivity() {
rpc.setActivity({
details: `Idle`,
state: 'on Dot Browser',
startTimestamp,
largeImageKey: 'dot-large',
largeImageText: `Idle`,
instance: false,
});
}
rpc.on('ready', () => {
setActivity();
});
rpc.login({ clientId }).catch(console.error);```
this is my code
and all I want to do is
rpc.setActivity({
details: `Browsing ${hostname}`,
state: 'on Dot Browser',
startTimestamp,
largeImageKey: 'dot-large',
largeImageText: `Browsing ${hostname}`,
instance: false,
});```
change the text to that
pls someone
Hey @sharp dagger, I was about to start working on RPC too.
yeah
I wish someone would help you, lol
lol
Remember me?
No..?
@sharp dagger i'm pretty sure that just using rpc.setActivity() will replace the old text with the new text
idk if this is what you want but you can use a loop to check a condition then change the activity like so:
const clientId = '565161122798370816';
DiscordRPC.register(clientId);
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
const startTimestamp = new Date();
if(rpc.application) {
rpc.destroy()
}
async function setActivity() {
var details;
while(true) {
if(condition) {
details = "Idle";
} else {
details = "Browsing ${hostname}"
}
rpc.setActivity({
details: details,
state: 'on Dot Browser',
startTimestamp,
largeImageKey: 'dot-large',
largeImageText: details,
instance: false,
});
}
}
rpc.on('ready', () => {
setActivity();
});
rpc.login({ clientId }).catch(console.error);
?
i dont now
help
@smoky scroll


is it possible to know whether an app is whitelisted for RPC over websockets?
hey guys 👋🏻
me and a friend are currently trying to get rpc working in our game, but we can't quite get the events to trigger when pressing the "Ask to Join" button
and I got a few questions about lobbies. What do they do exactly?
oh wait, I think it was just his code being super dumb...

?softban 553332834194948121 shitposting/memeing in support channels
Successfully softbanned orrin#0626
What is RPC?
Read the Channel Topic ?
Remote Procedure Call (RPC) is a protocol that one program can use to request a service from a program located in another computer on a network without having to understand the network's details. A procedure call is also sometimes known as a function call or a subroutine call. RPC uses the client-server model.
Basically your node,js app can communicate with the Discord App
Not only nodejs app 
Well good luck using discord.js in a C# app
Well, I talk about the whole RPC rn, he asked what RPC is, not help for d.js RPC
But this is #archive-rpc-help
client.on('ready', () => {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
console.log(client)
client.subscribe('NOTIFICATION_CREATE', TestFunction)
});
(node:2560) UnhandledPromiseRejectionWarning: Error: Not authenticated or invalid scope
at RPCClient._onRpcMessage (G:\DreamingBot Drive\DiscordChroma-v2\node_modules\discord-rpc\src\Client.js:171:19)
at IPCTransport.emit (events.js:189:13)
at decode (G:\DreamingBot Drive\DiscordChroma-v2\node_modules\discord-rpc\src\transports\IPC.js:134:18)
at decode (G:\DreamingBot Drive\DiscordChroma-v2\node_modules\discord-rpc\src\transports\IPC.js:92:5)
at Socket.socket.on (G:\DreamingBot Drive\DiscordChroma-v2\node_modules\discord-rpc\src\transports\IPC.js:120:7)
at Socket.emit (events.js:189:13)
at emitReadable_ (_stream_readable.js:535:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:2560) 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:2560) [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.
how do i get authenticated or is it invaild scope?
tag me if you can help
Is there anyway to fetch a discord rpc image url ?
Using a bot?
@pastel sphinx correct
<User>.presence.game returns an Game
?docs Game
Then you just get the assets property
Also this question fits in #archive-djs-v12-deprecated or #archive-updating-to-v13 as it's not directly related to the d.js RPC
Does RPC rely on Node, or can I just run it in a browser? I'm creating a little bot that runs in Chrome so that I don't have to use my RPi for everything 
🤔
The RPC needs access to the Discord app to connect to it, i don't think a browser let's you access it
hey. Is the activity property of message supported?
Hello, Im using the example on github, which works perfectly fine. But when packaged into an electron app it is able to login but doesnt get to the ready event, any idea what could cause this
How do you setup a richpresence??!
consider looking at the documentation
there's an example right there
ive looked
it confuses me
why is there an error
const DiscordRPC = require("discord-rpc");
const clientId = '180984871685062656';
// only needed for discord allowing spectate, join, ask to join
DiscordRPC.register(clientId);
const rpc = new DiscordRPC.Client();
const startTimestamp = new Date();
rpc.setActivity({
details: "test",
state: 'in slither party',
startTimestamp,
largeImageKey: 'snek_large',
largeImageText: 'tea is delicious',
smallImageKey: 'snek_small',
smallImageText: 'i am my own pillows',
instance: false,
})
}
rpc.on('ready', () => {
setActivity();
// activity can only be set every 15 seconds
setInterval(() => {
setActivity();
}, 15e3);
});
rpc.login({ clientId }).catch(console.error);
this is the error http://prntscr.com/nekz5w
i get this error bit my client id is specified http://prntscr.com/nel9ni
how can i put a image in the presence of the bot?
bots don't have access to RPC
@smoky scroll use your own client ID
@sharp pawn I Have but stll it doesnt work!
Isn't the client ID the one of the app you create on discordapp.com? 
In discord API yes
I cannot figure out how to use Discord RPC's Ask to Join thing. The docs aren't very helpful.
I already tried a few things like
client.sendJoinInvite(client.user) and
id: '281134216115257344',
username: 'some user',
discriminator: '0849',
avatar: '615a4a48507386799ff66f1b773c71cd'
})```
but i get errors like:
Error: Invalid command: SEND_ACTIVITY_JOIN_REQUEST
Error: no join request for that user
how do i get this to work?
anyone?
how to use discord rpc please
for set a presence to my bot
Bots can't use rpc
😢
not even for a presence even if I change the ask to join
@inland wing
Bots can have presences but not rpc
how do we please ?
@inland wing
what
Connection is done through the Discord Application it just wont work
discord rpc seems to have very little support
Yeah because basically no one uses it
And the people who do use it are often halfway decent anyway
its more for people who make games and programs and want to link it to discord
@smoky scroll It seems to be with 3.0.1, i tried my code with "discord-rpc": "^3.0.0-beta.10", and it worked perfectly fine, but with "discord-rpc": "^3.0.1", it didn't
thx
It still doesnt work
Hm
What are your code
Did you run yarn add discord-rpc@3.0.0-beta.10 or npm i discord-rpc@3.0.0-beta.10?
Running via the VScode console wont work btw
hi... got question - is it possible to get user's mute/deafened states with RPC? I currently have working notifications when user gets new message but i don't know how to get those 2 states... I've tried with getVoiceSettings but i am only getting [Function: getVoiceSettings] in console...
The only way to check if user has changed his state is to subscribe to VOICE_SETTINGS_UPDATE event but that doesn't show actual mute/deafened status...
my code looks like this:
const RPC = require('discord-rpc');
const clientId = 'client ID here';
const scopes = ['identify', 'rpc', 'rpc.api', 'rpc.notifications.read'];
const client = new RPC.Client({ transport: 'ipc' });
client.on('ready', () => {
console.log('Authed for user', client.user.username);
client.subscribe('NOTIFICATION_CREATE', () => {
console.log('New notification received');
});
client.subscribe('VOICE_SETTINGS_UPDATE', () => {
console.log('Voice settings changed');
});
});
// Log in to RPC with client id
client.login({ clientId, scopes });```
@supple imp getting [Function: someName] means that you tried using function as a property. Like console.log(Math.random) instead of console.log(Math.random())
probably last question - how do I resolve Promise? I've tried everything and it's either not showing me the result at all or it logs Promise { <pending> }...
If i somehow manage to resolve it, it logs whatever I write in resolve and not the actual state 
nevermind - i've found the solution - now I just need to get one line from the output instead of every single setting FIXED
?promise
Guides to understand promises:
- MDN (Promise): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
- MDN (async/await): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
- Discord.js (async/await): https://discordjs.guide/additional-info/async-await.html
- Alligator.io (async/await): https://alligator.io/js/async-functions/
can I get user speaking status with discord-rpc? ex. if I join vc:
clientRPC.subscribe('VOICE_CHANNEL_SELECT', async () => {
console.log('Connected to voice channel');
});```
I want to get user speaking status like with https://discordapp.com/developers/docs/topics/rpc#speakingstartspeakingstop
Is there a way to set the rpc image from a url?
if there would, there would be no point in having limited assets amount
Does anyone know how to get a bot rich presence to change every 10 seconds? I’m using discord.js library
bots cant use rpc
Successfully softbanned sasha#5644
npm ERR! code ENOGIT
npm ERR! Error while executing:
npm ERR! undefined ls-remote -h -t ssh://git@github.com/discordjs/rpc.git
npm ERR!
npm ERR! undefined
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
Any idea why ?
i can install other modules
do you have git installed and is the executable in your PATH (environment variable)
basically what the last line says
yes i have
errors don't lie
how would i set up a RPC of my bot. i searched the Internet and it said nothing
you cant
Y?
idk if i got you correctly tho
so you want your bot to use this?
Wdym
bots cannot have 
but can they have a Custom games thing
it's literally text
yea that what i mean
nothing more
how does one set that up
?docs clientuser.setactivity in #app-commands
ok
so I am using rich presence in an electron app (electron v5.0.0, discord-rpc v3.0.1) and it all works fine on windows, however when I run the same code on ubuntu (19.04) I receive the following error: https://hastebin.com/erihuziley.cs The code running it is here: https://hastebin.com/tajuwiwobo.js Any help is much appreciated 😃
^^ The same issue happens when running the example from github.
Anyone know why this isnt working? http://1by.xyz/pictures/u38zsp.png error: http://1by.xyz/pictures/6rps9v.png
Please ping me if you're gonna reply, easier. thanks
oh its also pinned
no you you need a clientId property in your object
Elaborate?
options is this object, not a property of an object
yee
I was wondering if the clearActivity removes the presence from the user. I'm currently using a different rpc client and just wanted to see if that's the case before I switch and test
instead of just showing "Playing X"
yes
@leaden kelp
thx
For some reason I get "WebSocket is not a constructor" when using new Discord.Client({ transport: 'websocket' }); and "Transport is not a constructor" when using new Discord.Client({ transport: 'ipc' });
I'm using latest TypeScript and Electron v4.2.0, also Node v10
did you read the docs?
yeah, but not work >(
OKAAAAAY wtf
I think Webpack might be the problem
I just tested a simple js file that I started using node and it could set the RPC without any problems
And another lul. I basically copied the source into my project and it works. Using it as a dependency though does not. 
The only difference is, I rewrote it in TypeScript
is there djs rpc guide?
(please ping me on reply)
channel title
*topic
guide that explains
The RPC client emits an error when it can't initially communicate to the Discord client (via ipc) which is good, but relaunching Discord it doesn't emit any errors when it's failing to communicate to the Discord client.
Nevermind this is issue #42
is there any work being done on this?
So, I wrote a very fake rich presence for Fortnite, but when I start it, I get these errors:
C:\Users\Axorian\Desktop\RPC>node .
(node:1848) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'write' of null
{ code: 4000, message: 'No Client ID Specified' }```
The ID is the exact ID from the Developer Portal and the code I have is:
```js
const DiscordRPC = require("discord-rpc")
const clientId = "582791418418954265";
DiscordRPC.register(clientId);
const rpc = new DiscordRPC.Client({
transport: "ipc"
});
const start = new Date();
rpc.setActivity({
details: "Battle Royale - In Lobby",
state: "In A Squad",
startTimestamp: start,
partySize: 1,
partyMax: 4,
joinSecret: "thisisjustatestsecret",
largeImageKey: "fortnite",
smallImageKey: "tier",
smallImageText: "Tier 45"
});
rpc.login(clientId).catch(console.error);```
I am not sure what i'm doing wrong...
Okay, now I just get the No Client ID Specified error.
I think I fixed it by using; rpc.login({ clientId: clientId }); which I found from the GitHub issues.
you can also do rpc.login({clientId}) since { something: something } is equal to { something }
if you can't see the difference between this and your original code, login() takes object with client id inside.
@urban star
Ah, thanks. 😄
Bots can't use rpc
ive asked that so many times and never got a definitive answer
where can I get help about downloading "discord-rich-presence". npm i discord-rich-presence gives an error
have you tried looking on channel topic?
where can I ask that
have you tried looking on channel topic?
...and reading it?
just say the channel that I should ask help
read
the
topic
please
whatever
so discord rpc question in general: when a user authorizes an app to connect to their local discord client via rpc, do they set permissions on what it can do?
I'm looking through the docs discord has on this and am intrigued by the prospect of third party apps gaining authorisation to access your discord whereupon they can just read all your DMs
ah nevermind, found the scopes thingumy which controls access permissions
bh
n
n
Are Join Requests still working with this library? Or do i need to move to the SDK for it to work? (If so did anyone get the SDK to work with node.js?)
@plucky cargo they should work fine
Is there an example app using it? I tried it but was unable to do it ugh
probably too dumb lol
Welp gonna take a look at it later and report back
i mean, there is example linked in channel's topic
But its not using the join stuff as i remember
I am unable to client.connectToLobby() When i pass the partyId & Join Secret, Discord "crashes"
I'm looking at the docs and I don't see that client.connectToLobby exists
yeah thats the thing
djs docs doesn't have it even tho it exists
discordapp's docs doesn't have it either
well if djs doesn't have it, you can't use it 
using djs that is
Then why does it exist in the file in the first place
If i could i would use the SDK as its up to date but i need it in JS / a way to communicate with it
any way to subscribe to MESSAGE_CREATE without getting 4006?
have messages.read in scopes, passing client secret to login (i yhink so at least), using client.subscribe() in ready event, yet all i get after authorization is 4006 for subscribe
Is there a way to make someone join a discord using RPC?
I've seen it done but idk how
nope
iirc you can have links in your rpc?
i think
if so just put an invite in there
UnhandledPromiseRejectionWarning: Error: OAuth2 Error: invalid_request: Missing "redirect_uri" in request. someone help me
add a redirect url you goof
whats a redirect url
goodness
yeah ikr
its on your application page
found it
what do i put there
?oauth
Using the Discord API for authentication and data in your application: https://discordjs.guide/oauth2/
ℹ oauth2 is not a library functionality, you will have to implement this yourself based on discords documentation
so i will have a website running in the background whenever my rpc client is online?
How I can make the bot mention all from my server, but not @cyan skyr yone,mentioning all like
@fir st
@t wo
@th ree
Hello
const RPC = ("discord-rpc")
const clientId = 'ID'
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')
})
client.login({ clientId, scopes })
const client = new RPC.Client({ transport: 'websocket' })6:45 PM
^
TypeError: RPC.Client is not a constructor
what am I doing wrong?
you're assigning a string to RPC
and string#Client is not a thing
Sorry
probably meant to assign require('discord-rpc') to it
....
But
(node:8497) UnhandledPromiseRejectionWarning: #<ErrorEvent>6:49 PM
(node:8497) 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)6:49 PM
(node:8497) [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.
discord rpc program is completely broken today
it works client-side but won't show up on the web client or for anybody who isn't me
is discord rp being weird atm
not even EasyRP works
tried on 2 accounts with 2 separate applications
is nobody else having issues with rich presence because this is driving me insane
probs an api thing
you don't need a discord developer application license to use custom rich presence now right
no
apps made without a developer application license should work?
hmmm
yes it should unless discord changes something without that anyone noticed it
this is the only person i've found with my same issue
and it's almost 2 years old
and no real definitive solution that i haven't tried
- thats old
- spotify already has its own RP
- discord is sometimes very weird on showing status
eg: everyone see that you "playing visual studio code" but you see "listening to spotify"
that's not the official spotify implementation
it's from before that existed
it's a custom application just like mine
and i know discord can be weird about it but it's never just flat-out refused to show my rich presence
for days
yeah same maybe discord changes something for this you could ask in the official discord-api discord if they know something there but i think its just a Client issue/discord api doesnt send the update to other users
alright i'll try the discord api discord, thanks for the suggestion
i am new to this, but, will discord-rpc work with bots ?
no
i have a command to show me in how many guilds my bot are , and i want to make to show the names of the guilds
but i don`t know how
someone to help me?
i need it faster
?docs Collection#map
@feral oriole
@high summit nice, but next time, look if you are in appropiate channel, please 
Yeah I was helping someone @left fjord
Hey. How do i fix this?
(node:13478) UnhandledPromiseRejectionWarning: Error: Could not connect
const { Client } = require('discord-rpc');
const client = new Client({ transport: 'ipc' });
client.login(ID)
Ты ж запускал батник и клиент на одной машине, да?
@sterile ridge эмм.....
Забыл
What
@scarlet aspen ?
?docs
@manic plinth, what would you like to search?
Type cancel to cancel the command.
cancel
The command has been cancelled.
?help
?stats
Uptime 18h
it just rebooted
this is not #app-commands
o i didnt notice
Anyone know how to solve the net.createConnection is not a function issue
whats rpc for?
hello currently I would like to make a musical bot for favors I pass the codes to stop jumping and start the music thanks
@honest rapids Please don't channelhop and keep the questions in #archive-rpc-help rpc related
3|animesoul | at Socket.onerror (/home/gibigbig/animesoul/app/node_modules/discord-rich-presence/node_modules/discord-rpc/src/transports/ipc.js:32:16)
3|animesoul | at emitOne (events.js:116:13)
3|animesoul | at Socket.emit (events.js:211:7)
3|animesoul | at emitErrorNT (internal/streams/destroy.js:64:8)
3|animesoul | at _combinedTickCallback (internal/process/next_tick.js:138:11)
3|animesoul | at process._tickCallback (internal/process/next_tick.js:180:9)
3|animesoul | (node:29277) 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)
3|animesoul | (node:29277) [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.
rpc = require('discord-rich-presence')('530197265902731264');
rpc.updatePresence({
state: 'slithering',
details: '🐍',
startTimestamp: Date.now(),
endTimestamp: Date.now() + 1337,
largeImageKey: 'pres',
//smallImageKey: 'snek_small',
instance: true,
});
any idea why its not working?
hi guys, how to start to use RPC?
im getting this error
Does Discord RPC works directly on browser using this lib?
can i put 2 token in one const?
if yes how?
please do not cross post
you were already answered
hey! how do apps like spotify set the assets images in the rpc?
its always the current artist, no way that could fit in the max 150 uploadable assets, right?
@fair rapids: As far as I know, only Spotify has that proprietary functionality (as well as the progress bars for songs)
aw
Yea hence why Spotify appears even when you have game activity display disabled
This module is confusing me..
What I have to do, if I have an existing bot with Discord.js and want to have more options for RPC?
Bots can't use rpc
Oh wow - I was thinking that it's an extension of the existing presence status 
Is there a way with discordjs - discord-rpc to get what voice channel I'm in and a list of all the users in that channel? I found in the api that it's possible to get it, however is it possible with discord.js?
You could get all members in your current voice channel via bot, after that you just have to setup a rpc and push the informations you want to display inside of the field.
So, it would work.
But I don't know if thats against the ToS in any way
Any ideas on why this isn't working? https://i.imgur.com/rJwF6eZ.png
#<CloseEvent>
ive made the application, and thats the correct id
Is possible to display the users from a server on a RPC?
if you're trying to sort out integrations like
, you can search for Activity#applicationID. but, this question is unrelated to RPC so I could suggest #archive-djs-v12-deprecated or #archive-updating-to-v13
Is there a way to catch disconnect?
Is possible to display the users from a server on a RPC?
yea
Not just with DJS-RPC
Setup a Discord.js bot that gets what you need, then display it with djsrpc
@narrow pilot This question is not rpc related, pls head to #archive-other-js-questions
Can an RPC client be reused after getting destroyed? It keeps logging Cannot read property 'write' of null whenever I try to use it after rpc.destroy()
@ruby lance how if you dont mind me asking?
I was thinking to use the data of the rpc client, which is a bot
but dunno how xD
Discord.js-rpc != Discord.js
ik.
Good
You can't have RPC with bots.

Bots are not able to use a custom/rich presence. This is completely out of the hands of Discord.js and in those of Discord itself. Will it ever be supported? no Ask Discord.
thats pretty gay
ngl
hey! how do i set a "listening" status with discord-rpc?
google it
the example under https://github.com/discordjs/RPC/blob/master/example
does not show it and the docs under https://discord.js.org/#/docs/rpc/master/general/welcome
dont show it either
@smoky scroll
= the question still stands
google it more
sure u can find it somewhere
well that is incredibly unhelpful
why is this category called support center if im just told to google it? i havent found anything btw.
noone uses rpc :c
why does this channel exist
idk, but not many people use it
impossible, apparently. >:
iirc you can't
last time i tried it was forced to be 'playing'
isn't rpc not for bots ?
but the bot gets rpc when streaming twitch ?
no it does not
So I'm making my first RPC and I'm wondering how I would include the "Ask to join" button
@left fjord https://i.imgur.com/tfx8hQb.png
what is the point of this screen?>
it has got purple rpc thingy
no no
that is not rpc
i am stupid

happens :p
hey, how to i make my rpc client just keep trying to connect if it fails? it currently just throws a promise exception when it fails to connect (because discord is closed) and stops trying.
( @left fjord )
@fair rapids You can do .catch().then(Promise.resolve); to catch the exception. This should fix the Promise exception too. Afterwards, I'm not sure, I'm currently coding an RPC, and haven't thought of that yet. But, I think that should work. Once and if I do get to that I'll let you know if I find a solution.
Great, thanks! don't forget me please
Hello, I'm creating a chat room game in javascript (node.js as a backend and javascript webgl as a front end in the web browser ) i got the log in with discord working using passport, but i cannot get the rpc working from the browser
Yeah, that isn't possible
You could create the whole thing as an Electron.js app
But web servers aren't able to connect to a users rich presence
Ok, im jus curious about the line in the npm page
'In browser you can import/require it as discord-rich-presence/browser'
what is rpc to be used for?
@vapid raptor look in channel description
yeah, i see links
Yeah, did you see this https://discord.js.org/#/docs/rpc/master/general/welcome
i see an example
i was there
and dont know what it does by the example
It's the rich presence
You know how some games have like join / spectate features linked with Discord right?
no
i didnt knew that
As an example
i only know discord have the feature to see what you are playing
and be able to open the game
All this extra data comes from RPC
Yeah, it basically gives better information for applicaitons
It's in closed beta though afaik
soo the bot will be able to have his rich presence changed?
if i use djs rpc ?
No, that's not it. It's about providing additional details to "Playing a game"
Let's just take an example, the devs of a game could integrate their API with the Discord RPC. For example if someone is playing CSGO you could make a rich presence that the user is playing (x) map for (y) long time with (z) score
It's not so much for a bot as for an end-user
Something with an RPC component is running on their machine and interacting with the Discord client running on the same machine.
Correct me if I'm wrong here.
soo is like info that you send to discord from your pc and the discord display it?
Yes
However, you need a valid client ID for this and Discord is currently not giving them out to random people (closed beta)
Afaik, the client ID is only here to "enable" the Spectate and Join buttons
any application can have an RPC with infos about things like what map you play on, how many time you played etc, but only whitelisted apps for now will make your profile have the "Spectate" and "Join" button clickable instead of greyed out
Client ID is to be able to use proper app on discord's side
What is djs-rpc for?
read the pins
Can you display data from the bot to the RP?
"only basic status message afaik"
Bots can have a presence (as I like to call it). Which is just the title (under the name), like "!help" or "serving 238 servers". But no rich presence.
I have a problem..
It's not with the RichPresence but with the Bot's game activity
I have try to make the activity change every 30 seconds, the code is right (without error)
client.on('ready', () => {
let activityTypes = ['PLAYING','STREAMING','LISTENING','WATCHING']
let activityText = [`${client.guilds.size} serveurs`,`${client.channels.size} channels`,'Poloin The Boss' ,'Mange tes morts']
let randomType = activityTypes[Math.floor((Math.random()*activityTypes.length))]
let randomActivity = activityText[Math.floor((Math.random()*activityText.length))]
setInterval(async ()=>{
await client.user.setActivity(randomActivity, { type: randomType })
}, 30000)
})
But, he change just when the bot disconnect and reconnect..
Some one know why ?
Because your doing it inside your client.on('ready' ) event
Oh ! Yes I'm stupid, but I need to put it on what event ?
@proud sparrow
Well, The simplest way would be to create a command
I execute the command when the bot was ready and i say to the command to do my code ?
how would I install a npm package without all the peer deps
--no-optional doesn't work
wrong channel
👀
nvm.
can anyone just show the output of this page: https://github.com/discordjs/RPC/tree/master/example
I am not asking for much, just that I'm able to see that example lol. After downloading that github page and doing npm install to install electron.js. I'm encountering error message in some src folder saying "..." operator isn't understood by the compiler
this?
yeah I can't run example
@digital lichen
can you run that and show me the output?
wait
so you want me to install it and show you the output is it @noble valley
?
if possible, yes please. I ran into an error
let me try
give me one sec
previously, it dropped an error, but that was because I w2asn't in the directory :P
rip thanks for trying 😃
oh
Is there a way to edit rpc assets within the bot or similar?
Bots cant have rpc
that was not even close to the question
@smoky scroll no, i don't think there's an endpoint for managing assets, but i may be wrong
you can datamine the endpoint and make raw api requests 
Hi !
I noticed that a lot of methods are missing in the documentation website, the one who's in charge of it should update it !
e.g. : RPCClient#getRelationships doesn't appear on the website (https://discord.js.org/#/docs/rpc/master/class/RPCClient?scrollTo=getRelationships), although it's used here : (https://github.com/discordjs/RPC/blob/3444ac24d2f0d5f52f59207a8759d928207df0ad/test/rp.js#L45) and implemented here : (https://github.com/discordjs/RPC/blob/3444ac24d2f0d5f52f59207a8759d928207df0ad/src/client.js#L630)
There are lots of things missing, like parties etc are in the code but aren't mentioned anywhere
I'm getting { code: 4000, message: 'Invalid Client ID' } even though the client id I supply is the one on the developer portal, http://prntscr.com/ohq8pk why is that?
I think you should send a screenshot of your code, it'll be more useful
^
Sorry:
const DiscordRPC = require('discord-rpc');
const rpc = new DiscordRPC.Client({
transport: 'ipc'
});
rpc.on('ready', () => {
console.log(`Starting with clientId ${ClientId}`);
updateActivity();
setInterval(() => {
updateActivity();
}, 10e3);
});
rpc.login({ clientId: 'the id' }).catch(console.error);
It never does the ready event, just prints out that error
from the rpc.login({...
what is Presence.instance?
SOMEONE HELP MEEEEE rpc.getGuilds(); returns UnhandledPromiseRejectionWarning: Error: Not authenticated or invalid scope
scopes: const scopes = ['rpc', 'rpc.api', 'messages.read', 'email', 'guilds', 'rpc.notifications.read'];
I hope someone will be able to help me. I have a generic RPC login through 'discord-rpc' library and I am getting error on 'ipc':
const express = require('express');
const RPC = require("discord-rpc");
const scopes = ['rpc', 'rpc.api'];
const client = new RPC.Client({ transport: 'ipc' });
client.login({ clientId: process.env.CLIENT_ID, scopes })
.catch(e => {
console.error("=======================unable to login RPC");
console.error(e);
console.error("=======================unable to login RPC");
});
(edit: put scopes. same result)
in this channel, no one gets help
I don't think anyone knows how to use it, probably due to the lack of documentation - I'm struggling to even use the library at all...
@noble valley try adding scopes
I added scopes, but it didn't help. I feel like it may be because the project is hosted in the web, may be?
https://en.wikipedia.org/wiki/Inter-process_communication
Yeah, I only check for help here occasionally. I've semi-given up on help regarding RPC ¯_(ツ)_/¯
I'm not an expert but I can try to help
@noble valley
- Maybe you should do :
client.login ({clientId : process.env.CLIENT_ID, scopes : scopes})
@unborn stream - It seems you're not authentificated, can you send us a screenshot of code where you log in ?
const scopes = ['rpc', 'rpc.api', 'messages.read', 'email', 'guilds', 'rpc.notifications.read'];
rpc.on('ready', async () => {
console.log('- Activated -');
rpc.setActivity({
details: `Hello random stranger!`,
state: 'This is RPC.',
largeImageKey: 'croc_surprised',
largeImageText: 'This actually works',
smallImageKey: 'moo_moo',
smallImageText: 'Here is a pixel art cow.',
instance: false,
});
setTimeout(async function() {
var guilds = await rpc.getGuilds();
console.log(guilds);
}, 1000);
});
// Log in to RPC with client id
rpc.login({ clientId, scopes });
but the rpc works, just the guilds part fails, should i still do that?
Honestly, I think you should because the client#login method take and object as a parameter
Maybe It won't solve the .getGuilds() issue, but it'll avoid others 😉
still same error
Ok, well I'm gonna search on source code ...
Didn't find something revelant ...
You can pass your timeout as a parameter of getGuilds() ...
Um...
Maybe try to add your clientSecret to client#login method
how would i do that?
({clientId : * , clientSecret : *})
Your client secret can be found on the developer portal
ok ill try that
nope didnt work
I try my best to figure it out, but I'm not on of the devs so it's hard ^^
Do you have more details on the error message ?
(node:4940) UnhandledPromiseRejectionWarning: Error: Not authenticated or invalid scope
at RPCClient._onRpcMessage (C:\Users\user\folder\node_modules\discord-rpc\src\client.js:171:19)
at IPCTransport.emit (events.js:188:13)
at decode (C:\Users\user\folder\node_modules\discord-rpc\src\transports\ipc.js:134:18)
at decode (C:\Users\user\folder\node_modules\discord-rpc\src\transports\ipc.js:92:5)
at Socket.socket.on (C:\Users\user\folder\node_modules\discord-rpc\src\transports\ipc.js:120:7)
at Socket.emit (events.js:188:13)
at emitReadable_ (_stream_readable.js:539:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
(node:4940) 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:4940) [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.
@glossy fulcrum
?softban @smoky scroll ads
Successfully softbanned ! ByK44N#0123
Good night,
It would have some code or command in lowdb. What causes the bot to import the data saved to the channel in discord?
<@&265426791538229258>
<@&265426791538229258> LOL XD
OOF
just installed the rpc
@hexed python, the message you posted contained a bot token, you should reset it!
Go to https://discordapp.com/developers/applications and then click on the application that corresponds with your bot
Click "Bot" on the left side
Click the "Regenerate" button and then "Yes, do it!" on the popup.
wtf
@hexed python, the message you posted contained a bot token, you should reset it!
Go to https://discordapp.com/developers/applications and then click on the application that corresponds with your bot
Click "Bot" on the left side
Click the "Regenerate" button and then "Yes, do it!" on the popup.
omg
ez
so i just copied the example without the electron part
the setactivity works perfectly but selecttextchannel doesnt
Hey, do you mind if I ask?
idk if it needs an o2auth authorization for this
Do you need to enable your game activity in order for it to work?
cause I've tried this before, didn't work for me
idk 😂
well.. do you have game activity enabled right now?
look at my profile thats ok
I meant if you turned this on
of course it is
as its displayed
the presence is ok
i wanted to try another available method that could be easy to setup
selecttextchannel seemed perfect i just need to check if it has been changed on my discord client
and actually it doesnt work
Is it bad practice to expose my discord rich presence client id?
Your bot's ID?
Don't expose any Client Secrets if that's what you mean
Client ID as in 575108662457139201
Is okay I believe, since anyone with Dev Mode enabled can get your bot account's ID
Okay, thanks for the confirmation
Rewriting something and realised I had pushed it to github
The bot's id, that is
Yeah, just don't expose client secrets / tokens
Client ID is okay afaik
Yeah, the reason I'm rewriting it is so I don't have to expose my API keys 😃
Which is a huge pita
could just put them in a .json or .env then require them and not include that .json or .env file in the repo
That's how it is now
but I don't want to force users to create their own api key for ease of use
So I am making an API gateway so my electron app just hits that instead of the real api
Oh?
Could you elaborate a bit? I'm not too familiar with this whole djs-rpc thing Lol
So the djs-rpc thing is fine, but the information I'm updating it with needs to be pulled from the bungie api
So I am making a server that the app pings and that returns the data so I don't expose my bungie api key
Ah, okay
https://streamable.com/li6r8
Looks like this, then the discord rich presence looks like this:
So basically linking a console platform to discord's rpc?
Yeah basically
Because destiny doesn't have rpc, so I am making ti myself
afaik discord supports XBox as an rpc
hmmm, I'll have to look into that...
I started this like a year ago when destiny 2 came out, but I think I just want to get this working 100% before I start looking at more complex rpc options
because the bungie api can let me hit pc/xbox/ps4 without any hassle
that's cool
Thanks 😃
I'm currently writing a detailed documentation for my API, which is a pain in the ass cause I have extended versions and simplified versions
You can hmu when you finish your RPC, I'm really interested in the final product
Will do!
writing documentation is definitely not my strong suit haha
Documentation is a pain if it's long
Yeah
I've looked at some of the docs the devs I work with write, and jesus I could never do that
I can't say shit to be honest, D.js is long af
like 50 pages of just tech jargon
so i just copied the example without the electron part
the setactivity works perfectly but selecttextchannel doesnt
after a few investigation it requires scopes or o2auth auth
hey
who know make bot confetti
a what
Who helps me create a music bot?
?rule4
When asking for help, make sure to provide as much detail as possible. Simply saying, "it's broke yo", or "how 2 make music bot" certainly won't get either of us anywhere.
and that is not a channel for help with music bots
ok
in the console the first line is the data payload before encoding and the second is the error returned
note that it works if i dont specify the scopes and it doesnt with any of them
idk what to do the payload corresponds exactly to the docs
the most wtf is that on my discord client theres no scope error they display correctly
anyone
........
@hexed python show error then
#archive-djs-v12-voice-deprecated is a channel for users to request help with their music bot issues. @stone cargo
Or just ask questions about it in general
afaik
@boreal vector you dont know scrolling
You dont know how to read
Wrong scope
1 per 3 people here have issue with that
(i mean, invalid scope)
@left fjord you mean im not the only who this is happening to ?
if then have you any idea of how to fix it ?
theres nothing about that on google
no, had similiar issue a while back, nad just gave up
it's here in this channel
ah
actually im giving up too maybe discord should acknowledge this
The query which returns the error is AUTHORIZE to the localhost IPC (or rpc idk) server
So basically if I uninstall and install back Discord it could work 
finally fixed this just by inputing my own clientid @left fjord

just created my own app and provided its clientid
😂
you know something for that?
@left fjord idk
actually im getting this for my selectvoicechannel 😂

since i put rpc rpc.api and messages.read as in the example
maybe im gonna switch back to discord default
so that it would work idk
im gonna try some other methods
before
nothing works
🤦
still doesnt work
whoever has made discord rpc come 😭
lets try to add the client secret
¯_(ツ)_/¯
doesnt work anymore...
OMG
FOUND THE BUG
rllly
no fake
here it is undefined so it cannot authenticate afterwards
oof
so now we got the right url its unauthorized
fixed
yes
YES
EVERYTHINGS OK
@left fjord
😂
just fixed the lib
i can access the guilds

want me to tell the fixes ?
basically i changed only one thing
there were two problems from the example
- the redirect uri is required so in the example it should be provided and you should add 127.0.0.1 as default also
- the client secret is required too (else you get 401)
- (optional) the scope error that happened to uwuwu too idk what it was due to but it has been fixed by providing my own app client id
Theres an error also
force does no longer exist
Theres also a method missing
/**
* Get the voice channel the user is currently in. Returns null if the user is not connected to a voice channel.
* @returns {Promise}
*/
getSelectedVoiceChannel() {
return this.request(RPCCommands.GET_SELECTED_VOICE_CHANNEL)
}```just made it
@hexed python you should contribute on github !
It would be helpful !
Also, the website is out of date (generated in 2018) but the source code (see channel's decription) is better updated 😉
@sudden tusk well I just posted it here so that the lib maker will be able to acknowledge these issues and gaps, and let'em make fix it better
Yep true ^^
Quick question : how did you handle the unhandledPromiseRejectionError : not authenticated or invalid scopes ?
you know, that whole monologue from ala most likely fixes that
and everything below
I didn't notice their monologue was that long lmao
Ty 
Ala89, officially named most useful guy of the day 😂
😂 lel
Hello, everyone! Trying to build a small electron app with RP but there's a little problem. And I don't know what's wrong here, any idea?
https://i.imgur.com/cl5wLDR.png
https://i.imgur.com/qTfqmcY.png
https://i.imgur.com/OzY5PDu.png
Look at the example, https://discord.js.org/#/docs/rpc/master/general/welcome
iirc you should use login instead of connect
oh wait
^ client.connect doesn't take any arguments
goddamit
thanks everyone lol
feels stupid rn tbh
It happens to the best of us
does anyone know what to set as large image?
as protocol i mean
i saw this for spotify spotify:034c9a257d1d8088357b74aa1c52da2b52296877
@obsidian mirage its not a protocol
u need to pass the name of your image as defined in your app's params
as defined in your app's params
Hello
Hello, Can i get help please ?
code block please
Are you trying to run RP on some 3rd party service? @smoky scroll
Yes, Can you use google translate i don't understand English :x @smoky scroll
English > French
No, I can't
I mean, you can translate it to french lol (Speaking to ODIS)
To use RP you need to run the script with Discord client being opened on your PC
I activate the RP client bot but even with glitch or third console sa do not want to connect me. I have already tested everything, I even send an email to the team discord piur kind of situation, He said to me:
`
Hello Tim,
Sorry for the wait !
After turning to my team, it seems that the only solution is to go through a computer.
I know you do not have a computer, but it seems to be the only way. :(
Please excuse me for not being able to meet your expectations.
However, if you have other questions, I remain at your disposal!
Regards,
Benjamin
`
I ask a friend to make the same mistake as me
Not to sound bad, but I didn't understand anything
Is google translate
@smoky scroll
type it in french
that just means you NEED to have a desktop to run RPC.

@smoky scroll Même si je suis en galère aussi parce qu'ils parlent tous anglais (😭) je peux peut-être t'aider ?
Ouais, Tu peu aller en privé ? @deft mica
english only please
it's not gonna be
you have to run that on pc with discord, running rpc on glitch will not work
And he also has some undefined variables
Rpc works cuz discordapp makea a custom proxy server for it
Well brand new problem
const { code } = await this.request('AUTHORIZE', {
scopes,
client_id: this.clientId,
rpc_token: rpcToken,
redirect_uri: redirectUri,
});``` here the rpc server replies that redirect_uri is not defined whereas it is totally
totally unable to authenticate with scopes
I used to make it work
they dont even talk about the redirect uri param
the source of the problem is from discord...
ptb
i think
oh maybe i fixed it
ye fixed
oof
once again the lib is outdated
@hexed python
(Sorry for tag ^^)
How did you do to fix it ?
I don't really know 😂 I fixed it on my improved version of the rpc but not on the normal version
One thing is sure : redirect uri has nothing to do here
I was comparing what my discord client was receiving and what my rpc client was sending, comparing it to the Discord client's rpc code and it started working at this moment
You know every rpc emits or incoming pings are logged in the console of your discord client
Ok thanks ^^
Any ideas on why setActivity may not be working:
client.setActivity({
...activity,
startTimestamp,
endTimestamp,
}).catch(console.log(activity, startTimestamp, endTimestamp));
will log:
Updating now...
Green Day Coming Clean 13.626000404358 94.813003540039 playing
{
details: 'Coming Clean',
state: 'Green Day',
largeImageKey: 'tigitunes_jpg'
} 2019-08-08T22:45:28.071Z 2019-08-08T22:47:02.885Z
Just to clarify, it does login fine.
@noble sky there seem to be no error here
Just log the error
Catch callback first param
?
@noble sky
If I've understood,
activity is an object which equals to
{
details:'Coming Clean',
state:'Green Day',
largeImageKey:'tigitunes_jpg'
}```
Am I right ?
Then startTimestamp and endTimestamp have to be inside activity object
(According to doc example, which is old)
Ah okay, thank you @sudden tusk. I will see if I can fix that.
:OwO:
lol what’s the thing about only being able to set rpc every 15 sec
it's called rate limit
Oh
exists for a reason
lol

👉