#archive-rpc-help
21942 messages · Page 15 of 22
console.log('Logged in as', client.application.name); on this line
yea
just delete that
Authed for user Mac
worked
now i need to make the details etc
yeeyee
sure thats fine
ty
its mostly from the example from the lib anyways so
did u define DiscordRPC as like const DiscordRPC = require("discord-rpc")
yes
yeah cause i get an err if i run that code
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
DiscordRPC is not defined
in your code that would be RPC.Client btw
cuz i defined DiscordRPC as the lib, but you defined RPC as the lib
no what im doing is im trying to just run ur code as plain
i removed the one i used for temp
let me see what you have currently
const DiscordRPC = require("discord-rpc");
const clientId = '794917013306081331';
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
async function setActivity() {
if (!rpc) {
return;
}
rpc.setActivity({
details: 'test',
state: 'test',
largeImageKey: 'large_image',
largeImageText: 'lol',
});
}
rpc.on('ready', () => {
setActivity();
client.log('success', 'RPC', 'CONNECTED!')
setInterval(() => {
setActivity();
}, 15e3);
});
rpc.login({ clientId }).catch(e => { Client.log('error', 'RPC_ERR', e) });
(node:11000) UnhandledPromiseRejectionWarning: ReferenceError: Client is not defined on the last line there
console.log for you
client.log is my bots logging system
im so dumb 
yeah i realised it rn.. its so late and im almost falling asleep haha
hmm it said success RPC CONNECTED!
but i dont see the game
cuz vsc extension is in the way
disable it
i dont even have it added, if i turn off the setting which says
Display current running game as status
would still show?
No thats not what i mean
in visual studio code
ohhhh
1s
you have an extension
yeeye
done
ou
looking noice
lmfao
but the image didnt work LOL
ur using my client id
thats why
wait really
yes
change client ids
to urs
lmfao
OH YEAH LOL
I THOUGHT I CHANGED IT ROFL
LMFAO
there we go
shush xd
wait so i would need to keep vsc open all the time for it to be running?
i mean you could run it in pm2
cant u run vsc in background
i mean im really messing with this and honestly its cool xd
just keep vsc open then
yeah
i appreciate you alot man haha
u helped me so much xD
i went thru this shit when i tried to make mine tbh
setInterval(() => {
setActivity();
}, 15e3);
});
this would refresh it every 15s?
yes, you dont need that technically, but ye
can we dm cuz i wanna say smth but its not related to this
ye
const RPC = require("discord-rpc");
const clientId = '800150138562543646';
const client = new RPC.Client({ transport: 'websocket' });
const scopes = ['rpc', 'rpc.api', 'messages.read'];
client.on('ready', () => {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
})
/*rpc.setActivity({
details: 'kekw',
state: 'testing',
largeImageKey: '2',
largeImageText: 'yep, this is a test'
});*/
client.login({ clientId, scopes})
Error: (node:6616) UnhandledPromiseRejectionWarning: Error: connection closed
Ok I changed a few things and
Error:
error RPC_ERR Error: connection closed
at WebSocketTransport.<anonymous> (C:\Users\user\Desktop\DTest\RPC\node_modules\discord-rpc\src\client.js:118:16)
at Object.onceWrapper (events.js:422:26)
at WebSocketTransport.emit (events.js:315:20)
at WebSocketTransport.onClose (C:\Users\user\Desktop\DTest\RPC\node_modules\discord-rpc\src\transports\websocket.js:67:12)
at WebSocket.onError (C:\Users\user\Desktop\DTest\RPC\node_modules\ws\lib\event-target.js:140:16)
at WebSocket.emit (events.js:315:20)
at ClientRequest.<anonymous> (C:\Users\user\Desktop\DTest\RPC\node_modules\ws\lib\websocket.js:579:15)
at ClientRequest.emit (events.js:315:20)
at Socket.socketErrorListener (_http_client.js:469:9)
at Socket.emit (events.js:315:20)
Code:
const RPC = require("discord-rpc");
const clientId = '800150138562543646';
const client = new RPC.Client({ transport: 'websocket' });
const scopes = ['rpc', 'rpc.api', 'messages.read'];
client.on('ready', () => {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
})
client.login({ clientId, scopes }).catch(e => { console.log('error', 'RPC_ERR', e) })
change websocket to ipc
where tf are people getting code that uses websocket?
in the npm package example
im using browser
you cant
its whitelisted
oof
but ig that example hasnt been updated
thanks
rip
var rpc = require("discord-rpc")
const client = new rpc.Client({ transport: 'ipc' })
client.on('ready', () => {
client.request('SET_ACTIVITY', {
pid: process.pid,
activity : {
details : "NeonCraft Minecraft Server",
assets : {
large_image : "nc",
large_text : "NeonCraft" // THIS WILL SHOW AS "Playing <Status>" from the outisde
},
buttons : [{label : "Join Now!" , url : ".gg/Zg9nTQ9y6h"},{label : "Info",url : ".gg/Zg9nTQ9y6h"}]
}
})
})
client.login({ clientId: '799980464357507102' }).catch(console.error);
help
error RPC_ERR Error: Could not connect
at Socket.onerror (C:\Users\ChopChoP\Downloads\Custom Discord RPC\node_modules\discord-rpc\src\transports\ipc.js:32:16)
at Object.onceWrapper (events.js:422:26)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)``` Error
Djs RPC is for users or bots ?
yk how some games set a status on your discord? this is for games that want to do that
Oh
So I want to have custom RPC
for that ?
well discord-rpc is the library that sets that custom status like "Playing <insert game here>"
yeah
But if I want a custom status
Like
Playing dbd
etc
how do I do ?
look at the docs
hold up i think i can find some
Okay
...oh wait they don't have any lol
oof
they should really work on that tbh but you can pretty much sus out most of the functionality from that one example
I wish there was any docs
But like I want mystatus playing something how do I do it wih djs rpc
oh wait there is another example here: https://github.com/discordjs/RPC/tree/master/example
Yeah I saw
this seems to be the code block in question:
rpc.setActivity({
details: `booped ${boops} times`,
state: 'in slither party',
startTimestamp,
largeImageKey: 'snek_large',
largeImageText: 'tea is delicious',
smallImageKey: 'snek_small',
smallImageText: 'i am my own pillows',
instance: false,
});
i mean you can guess how to do it from there
although i did wish they had docs
oh wait nvm i found the docs @tender musk: https://discord.js.org/#/docs/rpc/master/class/RPCClient
status cant be custom, it will always say Playing ${application name}, all you can change is the sub text
details is shown first, state is shown second
Hey, has anyone ever used SET_USER_VOICE_SETTINGS to set user pan Object for spacial audio ? I've been trying to do that and the server seems to get my Pan object correctly according to it's response, but the audio doesn't change.
Any hints pls ?
Is ~80 MB of RAM usage for one RPC runtime normal?
ehh depends
prolly shouldnt tho, cuz my bot is doing rpc and being a bot, and its using abt 40
is rpc bannable

just dont do dumb shit and youll be fine
the example doesn't work and only gives me the following error
> discord-rpc@3.1.4 example /home/Pajsen/RPC
> electron example/main.js
Error: Could not connect
at Socket.onerror (/Pajsen/RPC/src/transports/ipc.js:32:16)
at Object.onceWrapper (events.js:291:20)
at Socket.emit (events.js:203:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
[12703:0118/083940.119640:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
any idea why?
my network is working as it should
just remove all the stuff about electron from the example
thats an electron issue with gpu stuff, so just removing the electron part that you prolly wont use anyways will fix it
but my RPC doesn't update
even when I try the desktop app
@sacred ore
Like i said, the error youre getting ISNT an issue with the lib
its an issue with electron
which is what the example uses to make the little window that pops up
how do I fix it?
I removed the electron part but I got the
Error: Could not connect
at Socket.onerror (/home/Pajsen/RPC/src/transports/ipc.js:32:16)
at Object.onceWrapper (events.js:286:20)
at Socket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
did you input your clients token
and also, is this running on your pc or on a vps
I changed the client ID and its running on my PC
@sacred ore
show the code
'use strict';
/* eslint-disable no-console */
const DiscordRPC = require('../');
// Set this to your Client ID.
const clientId = 'MYREALID';
// Only needed if you want to use spectate, join, or ask to join
DiscordRPC.register(clientId);
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
const startTimestamp = new Date();
async function setActivity() {
if (!rpc) {
return;
}
// You'll need to have snek_large and snek_small assets uploaded to
// https://discord.com/developers/applications/<application_id>/rich-presence/assets
rpc.setActivity({
details: `booped 1 times`,
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);
it's the example code without electron
so, is clientId your clients id, or its token
cuz its needs the id
It's client id I use
show it ( its not private btw )
747353451314544701
thats it
did u get this from github? or from npm?
wait nvm
do you actually have the pictures that are listed in your rich presence
snek_large and snek_small
yes
@sacred ore
yepp
@sacred ore
@surreal hare you can't use RPC from wsl
Wondering how to use the NoRequireDiscord? Or if that's outdated, how do I allow the application to run even if Discord isn't open?
Thanks!
@olive orbit norequirediscord in the official sdk starts a discord client inside your program
I don't have the capacity to do that
I see
So there isn't a way of just ignoring if Discord isn't open?
not sure what you mean
As in, at the moment, if I try to run my program, it'll say Error: Could not connect - I want it to connect if the Discord application is open, but if it's not open, ignore it and run the program anyway
add an error event handler?
that's not specific to rpc
that's just how eventemitter works in nodejs
I've tried catch but regardless of that it isn't working
client.on('error', () => {})
rpc.on('error', () => { main() }) - still getting that same error
🤷
I'm not gonna give you a tutorial on how to handle errors in node
@carmine mica WSL?
Windows Subsystem for Linux
were you trying to use that , or are you actually on linux
it seems like its WSL cuz gpu issues like that seem to occur when it cant find a display
like in WSL
(node:36764) UnhandledPromiseRejectionWarning: Error: connection closed
at WebSocketTransport.<anonymous> (C:\Users\zaras\Documents\GitHub\SnailFM-Application\node_modules\discord-rpc\src\client.js:118:16)
at Object.onceWrapper (events.js:282:20)
at WebSocketTransport.emit (events.js:194:13)
at WebSocketTransport.onClose (C:\Users\zaras\Documents\GitHub\SnailFM-Application\node_modules\discord-rpc\src\transports\websocket.js:67:12)
at WebSocket.onClose (C:\Users\zaras\Documents\GitHub\SnailFM-Application\node_modules\ws\lib\event-target.js:136:16)
at WebSocket.emit (events.js:194:13)
at WebSocket.emitClose (C:\Users\zaras\Documents\GitHub\SnailFM-Application\node_modules\ws\lib\websocket.js:198:10)
at Socket.socketOnClose (C:\Users\zaras\Documents\GitHub\SnailFM-Application\node_modules\ws\lib\websocket.js:886:15)
at Socket.emit (events.js:194:13)
at TCP.<anonymous> (net.js:593:12)
(node:36764) 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:36764) [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.
aa?
const clientId = '287406016902594560';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
const client = new RPC.Client({ transport: 'websocket' });
client.on('ready', () => {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
client.selectVoiceChannel('81384788862181376');
});
// Log in to RPC with client id
client.login({ clientId, scopes });
electron app
this code is in main.js
It seems I am missing something?
I just used the example 😂
const RPC = require("discord-rpc");
``` these things are at top too
You don't need to require it twice
Although that won't fix anything
Alright; removed the double require.
So; whats the problem?
I haven't used rpc so idk
-=-
Anyone..?
I’m using Linux, debian
Why is the connection closed? Everything is defined correctly, this is stupid.
(node:36812) UnhandledPromiseRejectionWarning: Error: connection closed
at WebSocketTransport.<anonymous> (C:\Users\zaras\Documents\GitHub\SnailFM-Application\node_modules\discord-rpc\src\client.js:118:16)
at Object.onceWrapper (events.js:282:20)
at WebSocketTransport.emit (events.js:194:13)
at WebSocketTransport.onClose (C:\Users\zaras\Documents\GitHub\SnailFM-Application\node_modules\discord-rpc\src\transports\websocket.js:67:12)
at WebSocket.onClose (C:\Users\zaras\Documents\GitHub\SnailFM-Application\node_modules\ws\lib\event-target.js:136:16)
at WebSocket.emit (events.js:194:13)
at WebSocket.emitClose (C:\Users\zaras\Documents\GitHub\SnailFM-Application\node_modules\ws\lib\websocket.js:198:10)
at Socket.socketOnClose (C:\Users\zaras\Documents\GitHub\SnailFM-Application\node_modules\ws\lib\websocket.js:886:15)
at Socket.emit (events.js:194:13)
at TCP.<anonymous> (net.js:593:12)
(node:36812) 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:36812) [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.
const clientId = '574097225337012225';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
const client = new RPC.Client({ transport: 'websocket' });
client.on('ready', () => {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
client.selectVoiceChannel('81384788862181376');
});
// Log in to RPC with client id
client.login({ clientId, scopes });
lol; everything is perfect and I still get errors
@grand star im pretty sure its ur wifi connection
wtf?
😂
I dont think so
its a local connection
not over the air
Coded it myself; it works now
What is discord-rpc?
smh
what is discord rpc?
oh my god
i swear
look a tthe docs
when you play a game
a status pops up
thats discord-rpc
also use google
that can help
(99.9% of the time)
ok ok calm down
Just say Rich Presence @grand star
wht do you think rp stands for
😂
except that it doesnt
rpc means "remote procedural calls", rich presence is only a part of what rpc can do
ohhh @karmic jolt
Thank you for explaining
Shit. Your right.
lmao
Sorry for false information 🙏
Should of faced check that.
I thought it was something about remote procedure calls.
i have an issue
(node:6748) UnhandledPromiseRejectionWarning: Error: RPC_CONNECTION_TIMEOUT
I'm trying to get RPC working from a Chrome Extension. Everything else is working, I have the packing set up (with rollup) etc. but discord-rpc doesn't work
I'm getting this error:
DOMException: Failed to construct 'WebSocket': The subprotocol '[object Object]' is invalid
at this line (it's in the browser.js file):
const n = this.ws = new o(`ws://${this.hostAndPort}/?v=1&client_id=${this.client.clientId}`,{
origin: this.client.options.origin
});
Why the error occurs is pretty obvious I guess. o is window.WebSocket (i think... the file is minified) and window.WebSocket doesn't take an object with options but a list of subprotocols. If I just remove the origin header, the ws connection gets closed instantly (just as the discord rpc docs say)
my whole code here:
const rpc = require("discord-rpc/browser");
chrome.browserAction.onClicked.addListener(function (tab) {
const clientId = "...";
const client = new rpc.Client({ transport: "websocket" });
const scopes = ["rpc", "rpc.api", "messages.read"];
client.on("ready", () => {
console.log(client.user.username);
});
client.login({ clientId, scopes }).catch(console.error);
});
Anyone an idea how to fix this? I tried using the not browser version (it uses ws instead of window.WebSocket so it should be possible to set the Origin header but I get some problems because of the electron dependency)
@carmine mica i'll just ping you because i think this is a library problem and not something i fucked up. not sure though ...
.
it does not work in a "normal browser" (not in the chrome extension context) either, just tried, same error
Websocket is whitelisted and cannot be used regularly, discord-rpc will only ever work on the desktop application
@sacred ore I might have misunderstood something. I thought using websockets was just a different way of communicating with the discord application? Is that wrong?
So, I can only use discord rpc with the "ipc" transport?
Yes you can only use discord rpc with the ipc transport, websocket will never work for people who aren't whitelisted to use it
And ipc will only work if you're running the application on the same computer that discord is running on
Okay, thanks for clarifying that.
The application is running on the same computer but I guess I can't use IPC from a chrome extension. Thanks anyway :)
I mean it can probably be done, but if the chrome extension is coded to use websocket then probably not
I'm pretty sure it's not possible unfortunately. You can't write to sockets/pipes from a chrome extension.
Ripppp
Sorry bout ur luck
this doesn't exist
and you can't add an EventListener on the RPC object
Anyone know how I can catch the error or simply allow use of the application with or without a connection?
yes, you can, the rpc client extends event emitter.
how do you think you do, rpc.on('ready')?
and literally, handling errors is as simple as adding a catch
@sacred ore so
how this can produce this :
UnhandledPromiseRejectionWarning: Error: Could not connect
at Socket.onerror
it's not a catch problem
is it running on the same pc as discord is
or on a server
pc
i dev on my pc and discord is open or not on my pc
i handled the error correctly, i can go in my main() without any problem but it display an socket error and idk why
it should not try to connect if discord is close
so does it work when discord is open?
yes
and i want to start my script even if discord is not opened but without this socket error
if u catch the error the code should just be able to continue
you shouldnt have to call main from inside the catch
How did you manage to add buttons to your rpc? @sacred ore
i tried and i failed to do so
buttons: [ { label: " ", url: " " } ]```
are you on master
whats master
the master branch of discord-rpc
uhh how do i know that
npm i discordjs/RPC
i use discord-rpc
tried that but it gave me an err
what error
failed to install or smth
send the actual error
dont know what that even means honestly
@sacred ore ^
do u not have git installed on ur computer?
ah no i dont
you can just install it from here and put it in node_modules
like download that file?
yea download the repo and put it in node_modules
so would it just be
const DiscordRPC = require("discord-rpc"); still?
yes
everythings the same, and you can use buttons
oh so this is better?
its more updated
ahh
the only bad thing about install master branches is you dont fully know that its stable
but for the most part , master has been stable for me so
oh
ty
How do I enable Buttons (ask to join) ?
And where can I find the complete list of options that can be in the options object of setActivity() ?
heres a full list
use secrets for ask to join
And what's the instance option ?
dunno exactly , check discord dev documentation
i need help
Error: RPC_CONNECTION_TIMEOUT
when i starting index.js
all the time, or just sometimes
sometimes
that just means you tried to connect to many times
im refreshed discord, it now works
thx mate
im clicking buttons but its not redirecting me
they only work for other people, you will not be able to click them
they work for me for example
oh
yes
alr, well they work
👍 thanks
my rich presence isnt showing up
const BaseEvent = require('../utils/structures/BaseEvent');
module.exports = class ReadyEvent extends BaseEvent {
constructor() {
super('ready');
}
async run(client) {
client = require('discord-rich-presence')('784581764105633803');
client.updatePresence({
state: 'slithering',
details: '🐍',
startTimestamp: Date.now(),
endTimestamp: Date.now() + 1337,
largeImageKey: 'tooltip_large',
smallImageKey: 'tooltip',
instance: true,
});
}
}
Error: connection closed
at IPCTransport.<anonymous> (C:\Deskstop\AUB BOTS\Hideaki-Beta\node_modules\discord-rpc\src\client.js:118:16)
at Object.onceWrapper (events.js:422:26)
at IPCTransport.emit (events.js:315:20)
at C:\Deskstop\AUB BOTS\Hideaki-Beta\node_modules\discord-rpc\src\transports\ipc.js:137:18
at decode (C:\Deskstop\AUB BOTS\Hideaki-Beta\node_modules\discord-rpc\src\transports\ipc.js:92:5)
at Socket.<anonymous> (C:\Deskstop\AUB BOTS\Hideaki-Beta\node_modules\discord-rpc\src\transports\ipc.js:120:7)
at Socket.emit (events.js:315:20)
at emitReadable_ (_stream_readable.js:569:12)
at processTicksAndRejections (internal/process/task_queues.js:79:21)```
You need to use ipc instead of websockets
thanks bro
wait i am using ipc ig
Yeah, you are (didn't read the full error)... lmao try using websockets instead of ipc then?
Wait, can you show your <RPCClient>.login()?
rpc.login(config.Client_Id).catch(console.error);?
i am new to rpc
Yeah, okay you need to do:
.login({ clientId: <ClientID> });
thanks
rpc
.setActivity({
details: config.Rich_Presence.details,
state: config.Rich_Presence.state,
largeImageKey: config.Rich_Presence.file_bannername,
largeImageText: config.Rich_Presence.bannername,
smallImageKey: config.Rich_Presence.file_username,
smallImageText: config.Rich_Presence.username,
instance: false,
partySize: 0,
partyMax: config.Rich_Presence.maxpartysize,
startTimestamp: d1,
endTimestamp: d2,
})``` nothing visible on the bots profile
why?
is it possible to set the image as a url?
no
how can i do my Rich Presence Visualizer for my bot in the statues
u cant
bots can't use RPC
bots can only use setActivity
PLAYING = Playing **Game**
WATCHING = Watching **A Movie**
LISTENING = Listening **To Music**
STREAMING = Streaming **Game**
COMPETING = Competing in **A Game**
The above are the activity types that can be used
oh
I used the rpc master version and the buttons shows up but when i click it, nothing happens.
I even use someone elses code and it didnt work so is it smth with the npm?
@ me if u reply
you can't click your own buttons
Oh?
what does the instance thing do in the rpc?
yo why aint the status showing on my bot
here's the code
client.user.setActivity("Message", {type: "PLAYING"});
help me iam new to rpc do i put my id or bot id and it will auth it auto for me
?
and do i need to require it ?
const DiscordRPC = require('discord-rpc')
const rpc = new DiscordRPC.Client({ transport: 'ipc' })
rpc.on('ready', () => {
console.log('ready')
console.log(rpc.user.username)
rpc.setActivity({
details: 'abc',
state: 'def',
startTimestamp: new Date(),
instance: false
}).then(console.log)
})
rpc.login({ clientId: '657637495797841952' })```
is there any reason you can see why this isn't working? i get no errors, it ready's it console.logs the username, and the promise for setActivity returns an activity object, but it doesnt set my presence
It works fine for me and I don't see any errors in the code
my status just never gets set
Can you try running your RPC again?
just did rn
nothing
hm-
wh
it works for u
thats so weird
I'm not sure how to help you with this one-
hi how to use buttons
Buttons? Its very simple
Iam new
to rpc
What dose the RPC code your using look like?
const DiscordRPC = require('discord-rpc')
const rpc = new DiscordRPC.Client({ transport: 'ipc' })
const clientId = '788864503428546600';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
rpc.on('ready', () => {
console.log('ready')
console.log(rpc.user.username)
rpc.setActivity({
state: `Used In ${client.guilds.cache.size} Servers`,
buttons:"Invite",
instance: false
}).then(console.log)
})
rpc.login({ clientId: '789183229710172170' });```
@smoky scroll
Are you using this for your user account, or are you trying to use this for a bot account?
my account
it can't be used on bot account
Yeah ik im just wondering how your RPC is getting the amt of servers your bot is in-
how isnt this working aaa a
But the buttons should look something like this
buttons: [{
label: rpc.buttons.primary.buttonLabelText,
url: rpc.buttons.primary.buttonRedirectUrl
},
{
label: rpc.buttons.secondary.buttonLabelText,
url: rpc.buttons.secondary.buttonRedirectUrl
}
]
iam discord js and discord-rpc
thanks
I have no clue- its weird-
np
does the buttons seems ? @smoky scroll
it doesn't seem to me
You have to put the label & URL
It would look like this without the config
buttons: [{
label: "Invite",
url: "https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=0"
},
{
label: rpc.buttons.secondary.buttonLabelText,
url: rpc.buttons.secondary.buttonRedirectUrl
}
]
i did
Erm-
What dose the code look like now?
ok figured it out
cuz i had an actual game running
oop- lol
is there a way to change that? so if a game is running it still works
Not that I know of
you would have to start the RPC first
got it
that is the only way that I have found works
what is rate limit? i want to know what count i can change status in 1 minute?
it updates every 15 seconds, but discord handles that for you
um
so i can
change every 5 seconds
but discord change it after 15
yes?
yea
ok
but when
i have posted to api
2 presences
he have any cache?
or discord will update with last posted presence my rpc
¯_(ツ)_/¯ probably the latest
oh no
but anyway thanks for help 🙂
Error: connection closed
ok? repaired
lol
May we use RPC with a bot? (Eg @sudden gate) That code confused me: https://github.com/TapsHTS/discord-rpc
So idk
no, bots cannot have rich presence
That was i think, but that code confused me
what the code does is run the bot, and uses data from the bot to display on rpc
which would be displayed on your account, assuming you run that at your pc
Ah!
Ok
What does instance do?
(for future use) integer representing a boolean for if the player is in an instance (an in-progress match)
So nothing? Or maybe it does something these days and the rpc docs are out of date
hi why does the buttons doesn't seems to me
here is my code ```javascript
const DiscordRPC = require('discord-rpc')
const rpc = new DiscordRPC.Client({ transport: 'ipc' })
const scopes = ['rpc', 'rpc.api', 'messages.read'];
rpc.on('ready', () => {
console.log('ready')
console.log(rpc.user.username)
rpc.setActivity({
state: Used In ${client.guilds.cache.size} Servers,
buttons: [{
label: "Invite",
url: "https://discord.com/oauth2/authorize?client_id=INSERT_CLIENT_ID_HERE&scope=bot&permissions=0"
},
{
label: "support",
url: "google.com"
}
],
instance: false
}).then(console.log)
})
rpc.login({ clientId: '788864503428546600' });```
hi
is there is anyone ?
are u on discord-rpc master?
Did anyone ever put their rpc on a server with a custom client?
what does this even mean
Yea
maybe he is saying server, as in hosting, with a custom discord client. which to me sounds a lot like a bot.
how to add a url to the rpc?
rpc cool
What's the discord-rpc master ?
I used npm i discord-rpc
rpc communicates with your discord client on the same machine
I head its possible to run it on a vps with a custom client to accept and display the rpc
does this work on MacOS?
and require it as discordjs/rpc?
@smoky scroll
No
ok
but does i need to delete the first ?
Well technically yes , but good luck
it still showing nothing @smoky scroll its showing rpc but without buttons
Are you on discord-rpc master
i don't know i do as he told me
it gives me errorwhile installing
Okay , so go here https://github.com/discordjs/rpc, download it , and put it in your node modules
where
It's basically the same thing that be told you to do , except it will always work
node_modules
Put it in that folder
inside discord-rpc folder ?
it's working thanks
how do i set largeimage?
largeImageKey
How to fix this, Error: Could not connect
code:
``const client = require('discord-rich-presence')('');
client.updatePresence({
state: 'e',
details: 'e',
startTimestamp: Date.now(),
endTimestamp: Date.now() + 1337,
largeImageKey: '',
smallImageKey: '',
instance: true,
});``
how to solve the error 😦
at Socket.onerror (/app/node_modules/discord-rpc/src/transports/ipc.js:32:16)
at Object.onceWrapper (events.js:286:20)
at Socket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)```
```var rpc = require("discord-rpc")
const client = new rpc.Client({ transport: 'ipc' })
client.on('ready', () => {
client.request('SET_ACTIVITY', {
pid: process.pid,
activity : {
details : "Hello test !!",
assets : {
large_image : "disk_neon",
large_text : "PUBG" // THIS WILL SHOW AS "Playing <Status>" from the outisde
},
buttons : [{label : "mayb" , url : "https://google.com"},{label : "mayb2",url : "https://youtube.com"}]
}
})
})
client.login({ clientId : "803859542961029170" }).catch(console.error);```
umm i was running that time on glitch editor now i tried on my pc :/
i typed the start command node index.js no errors showing still my ID not having ric presence ;-;
hey, wanted to confirm, we can't change the blurple color in rpc right
@shell stirrup umm u have any idea that why my rpc isn't showing up 
🤔 errors?
no errors
runs perfectly on my cmd but i can't see the status
oh worked ! 
ehh idk why that time
it didn't worked
can rpc be run on vps???
no, because it will try to connect with your discord client and you won't have a discord client on vps (maybe)
not sure about what I said above but I think it won't work on vps
how to use this in rpc
.sendJoinRequest(user)
Request to join the game the user is playing```
only if u were to somehow run discord on the vps
:/ ig thn i can't
asking about this as well
url as in buttons ?
yes
?buttons
If you want to add buttons to your RPC , make sure you are on the master branch of discordjs/rpc. this can be installed using npm i discordjs/rpc.
Then inside your setActivity call, you can use buttons: [ { label: " ", url: " " }, { label: " ", url: " "} ], you can have a maximum of 2 buttons
You wil not be able to press these buttons on your own account, so dont freak out when something doesnt pop up when you click it
thank you
Nope, You can't change the blurple color.
I have a question. There is a way to use Discord-rpc without a client ? Like use a user token or something like that to put my JavaScript script on a vps ?
No
wow that's radical 😆 lmao
and there is a way to add a rich presence to a user with discordjs ?
only to yourself
look at mine
yes but you have discord-rpc on your pc ?
or on a vps ?
on my pc, cuz u have to
ok so for exemple
i want to run on a vps a discordjs script with my token on it so
"the script" is connected to my account
can i add a rich presence from that ?
No, rpc only works if discord is open on the same machine, so it wont work on a vps
ok and if i run discordjs connected to an account and i run rpc ?
it only works if DISCORD ( the application discord ), is open on the same machine as the rpc code
when it connects to Discord it connects to the client instance not the account
i think websockets may be different but that's how it works with ipc
p sure it's discord app that you connect to anyway
yeah discord app/client
it's also possible to connect to multiple instances of the client on the same pc with ipc, just not sure if it's possible with discord-rpc
don't stop the app? (deleted)
it works only if u have discord PC opened
What is the difference between ipc and websocket
theres many things, but just know ur not allowed to use websocket
*need to be whitelisted
and only in the context of discord's rich presence.
e?
Why it say connection closed?
const RPC = require('discord-rpc')
const clientId = "726287877897584673";
const scopes = ["rpc", "rpc.api", "messages.read"];
const client = new RPC.Client({ transport: "websocket" });
client.on("ready", () => {
console.log("Logged in as", client.application.name);
console.log("Authed for user", client.user.username);
client.selectVoiceChannel("81384788862181376");
});
// Log in to RPC with client id
client.login({ clientId, scopes });
cause you're using websocket instead of ipc
Someone's saying that i'm self-botting.
Is RPC considered selfbotting?
no
Ok so, there is a way to run Discord client on an vps without a screen ? Like Discord client in console mode idk ?
i mean yea, but youll have to figure out how to do it yourself
So there is no "Discord client" working without a screen
But Can i add a desktop to my Ubuntu server, use rdp launch Discord login, run my rpc and log off ?
I think it's possible to fork this a make an "console-mode" https://github.com/Flam3rboy/discord-bot-client
this is best way to get your account banned
also note that it's not "be logged in on the same pc". this itself has absolutely nothing to do with rpc whatsoever
the fact why you need to do that, is because the app runs a "server" to which rpc app connects and uses it to display rich presence (which doesn't really give a crap about which account is currently logged in)
so even if you won't get banned for using custom client, the custom client doesn't even have anything rpc related.
Would it be possible to create an rpc with a spectate button for an online game
Sure, if it's your game / you can edit the source code
Why is my RPC not showing up on my profile?
How do I use this?
Like how does one run it?
like any other js code
uh
dont know how too
lmao
then brush up on js basics
and how to use node.js
bruh
no, no bruh
we aren't here to teach you complete basics
ok?
Can i fetch number of members from a guild in discord-rpc?
rpc doesn't really have much to do with guilds 🤔
there is a command to get all guilds user is in, but from what i can tell you can't get much anyway, since guild objects you get are partial. both members and member_count are sent only on GUILD_CREATE, so are completely inaccessible rpc-wise, and approximate_member_count has this as description:
approximate number of members in this guild, returned from the
GET /guilds/<id>endpoint whenwith_countsistrue
which makes me believe you cannot do that from rpc at all
!rps
can someone clarify to me the use case for an RPC connection
Can i "update" the activity ?
pepe
just check my presence , use case
well, one of them at least
Oooof ok
how do i add button in the rpc?
@sacred ore can you help please?
?buttons
If you want to add buttons to your RPC , make sure you are on the master branch of discordjs/rpc. this can be installed using npm i discordjs/rpc.
Then inside your setActivity call, you can use buttons: [ { label: " ", url: " " }, { label: " ", url: " "} ], you can have a maximum of 2 buttons
You wil not be able to press these buttons on your own account, so dont freak out when something doesnt pop up when you click it
i did
not working
that is truly sad
have you thought about saying so?
and describing the issue?
buttons: [{ label: '', url: '' }],
i added that but it not working
tag says [{ label: '', url: '' }], not [{ label: '', '' }]
yes i meant that
what about the timer?
use startTimestamp
it's not working
?dnw
Against popular belief "does not work" is not sufficient information to provide to receive help.
What's the expected (wanted) behaviour, what's the actual (unwanted) behaviour? Do you get any errors? What's your relevant code that might be causing the issue?
const startTimestamp = new Date();
maybe some more code?
why are you doing that instead of using actual methods?
I have discord-rpc question
what does this error mean? ```const timeout = setTimeout(() => reject(new Error('RPC_CONNECTION_TIMEOUT')), 10e3);
^
Error: RPC_CONNECTION_TIMEOUT
at Timeout._onTimeout (C:\Users\Blaž\Documents\Discord\rpc\node_modules\discord-rpc\src\client.js:107:47)```
idk anything about rpc but it simply looks like you'r rejecting? an error after 10e3 milliseconds
what could that mean and how can I fix it?
its rpc throwing an error because the connection timed out
Depends what you want to do
o yah Discord\rpc\node_modules\discord-rpc\src\client.js:107:47)
so. i have great connection
could be anything without having more code
bruh
Wait so are both of em different?
npm i discord-rpc
and
npm i discordjs/rpc
i don't really understand master brank ehh
master branch means the master branch from github, installing npm i discord-rpc downloads it from npm, which isnt the latest version, while npm i discordjs/rpc downloads it from github, which is the latest version
the npm version doesnt have buttons as of yet
so you download it from github
would someone mind briefly explaining what rpc does / what you'd use it for?
this is rich presence
uses discord's rpc
Is it for the bot itself or members?
bots cannot have rich presence
so it can set a rich presence for members of a server?
only for you
if you run the rpc app at the same pc you have discord app running
ohhh ok
thx
Well yes
U can tehnically run rpc on a phone
?buttons
If you want to add buttons to your RPC , make sure you are on the master branch of discordjs/rpc. this can be installed using npm i discordjs/rpc.
Then inside your setActivity call, you can use buttons: [ { label: " ", url: " " }, { label: " ", url: " "} ], you can have a maximum of 2 buttons
You wil not be able to press these buttons on your own account, so dont freak out when something doesnt pop up when you click it
no u cant
it doesnt work with the mobile app
Well :yikes: then
I am trying to add the line Used in X servers and getting an error 😦
My code start
const client = new rpc.Client({ transport: 'ipc' })
client.on('ready', () => {
client.request('SET_ACTIVITY', {
pid: process.pid,
activity : {
state: `Used In ${client.guilds.cache.size} Servers`,```
Error :-
```TypeError: Cannot read property 'cache' of undefined
at RPCClient.<anonymous> (D:\Custom_Discord_RPC\Custom Discord RPC\index.js:7:33)
at RPCClient.emit (events.js:315:20)
at RPCClient.login (D:\Custom_Discord_RPC\Custom Discord RPC\node_modules\discord-rpc\src\client.js:146:12)
at processTicksAndRejections (internal/process/task_queues.js:93:5)```
client is an RPC client, completely separate from your actual client for the bot, you cannot use that method on an RPC client, but if you somehow got the actual client, then you could
thn howw do ppl use that Used in X servers (u too uses)
i literally just told you how
but if you somehow got the actual client, then you could
how can i get?

help pls 
is the rpc client in the same file as your bot ? are they event on the same machine
no my bot runs on vps and rpc client on my machine and both are on different code
im sure you could use oauth to do it , but thats a little too much hastle
ig i can do one thing like make just an ready event of bot and insert rpc in it
in my pc
will it work?
any idea
or the ?tryitout command 
what i used to do is run an express sever and have the bot call the server every number of minutes to update the stats
we cant really help with that here, but if you can figure that out, then u should be set
need to think cuz i couldn't got ur this msg 
hmm
client.application is null, is this intended?
Ooh oki, tho the npm version buttons do work for me i don't even know how but it doesn't show intellisense so I can hardly tell wots goin on in the code
yea intelisense doesnt really exist on it LMFAO
i had to figure out how to do buttons on my own to be able to make that tag
Oooooof xd
( even tho i learned later on that someone apparently posted the answer a week earlier in the chat and i didnt know oof )

No, just use Discord.js and login with your token
Then you can use data from your bot
that woks only if your bot is not sharded, mind you
?buttons
If you want to add buttons to your RPC , make sure you are on the master branch of discordjs/rpc. this can be installed using npm i discordjs/rpc.
Then inside your setActivity call, you can use buttons: [ { label: " ", url: " " }, { label: " ", url: " "} ], you can have a maximum of 2 buttons
You wil not be able to press these buttons on your own account, so dont freak out when something doesnt pop up when you click it
who want a discord rpc code
uhh me?
does anyone know how to set a custom status for your bot?
each time I do it with any method it spits errors
especially the TYPE bit
like TYPE: "LISTENING" or TYPE: "WATCHING"
bots cannot have custom status
?help
?config
?help config
Can someone tell how to clear activity?
?button
?buttons
If you want to add buttons to your RPC , make sure you are on the master branch of discordjs/rpc. this can be installed using npm i discordjs/rpc.
Then inside your setActivity call, you can use buttons: [ { label: " ", url: " " }, { label: " ", url: " "} ], you can have a maximum of 2 buttons
You wil not be able to press these buttons on your own account, so dont freak out when something doesnt pop up when you click it
?example
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.channel.send('pong');
}
});
client.login('token');
?rpc
Can someone give me a better example?
The GitHub Repo Example sucks ;-;
@smoky scroll what you need
I just need a good example for discord rpc
Or u can tell me how can I update the activity
Like the status of the bot
Of user
Hold on before we get into that I noticed the bot did something wrong
Yea I can wait
"const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(Logged in as ${client.user.tag}!);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.channel.send('pong');
}
});
client.login('config.token');
"
That's much more better
You use that in the index so if you share your index with anybody they won't get your token to mess with your bot
that's not rpc..
I know it's not but it's a better way of putting it
Yea we know
It's much more better so if you share your index with people they won't have access to your bot token which then they will steal your bot
Yea yea
A good example?
Hello?
what he was getting at is that this is not the chat for non-rpc related things
any of you guys know how to add button to discord rpc?
rpc.on("ready", () =>{
rpc.setActivity({
state : "Coding by IEB#4646 | IEBot",
details : "Coding",
largeImageKey : "iebot",
largeImageText : "IEBot",
buttons : [{label : "Youtube" , url : "https://www.youtube.com"},{label : "Website",url : "https://i"}]
})
console.log("Activated.")
});
buttons dont appear
other things do
please help :<
if you are feeling your self too late to help you are not dm me and tell how to fix if you know
or just @rain ermine
umm @sacred ore is it rude to ask you like this?
a lil bit, but i got u
?buttons
If you want to add buttons to your RPC , make sure you are on the master branch of discordjs/rpc. this can be installed using npm i discordjs/rpc.
Then inside your setActivity call, you can use buttons: [ { label: " ", url: " " }, { label: " ", url: " "} ], you can have a maximum of 2 buttons
You wil not be able to press these buttons on your own account, so dont freak out when something doesnt pop up when you click it
sorry :( and thanks
see the first line of that tag
i installed it like npm i discord-rpc
is it wrong?
i didnt understand :(
yea you have to use npm i discordjs/rpc
soo what should i change in the code
nothing, literally just install discord rpc like i showed
and it should work
it errored
when i tried
should i uninstall discord-rpc first?
it errors @sacred ore
whats the error
while installin
g
there is lots of errors
i dont know
@sacred ore are you there
that means you dont have git in ur path
you need to install git to install from master branch
would i be able to add time to my rpc
ERROR in ./index.js
Module build failed (from ./node_modules/discord-rpc/src/index.js):
LoaderRunnerError: Module 'path/to/discord-rpc' is not a loader (must have normal or pitch function)
Getting this error with webpack 😦
nvm ^^ it won't work anyways cause client would be running on node v8
Can you use rpc on browser?
Also- im pretty sure this is a mistake
No
ok
Hey does anyone know how to add buttons in rpc
?buttons
If you want to add buttons to your RPC , make sure you are on the master branch of discordjs/rpc. this can be installed using npm i discordjs/rpc.
Then inside your setActivity call, you can use buttons: [ { label: " ", url: " " }, { label: " ", url: " "} ], you can have a maximum of 2 buttons
You wil not be able to press these buttons on your own account, so dont freak out when something doesnt pop up when you click it
it doesnt work
Unfortunate
If you want to add buttons to your RPC , make sure you are on the master branch of discordjs/rpc.
How do you even know it's the issue
They don't say anything
hey can someone help me
I keep getting "Error: 401" when I try to start my rpc
hellooooo
"get help here"
my white wrinkly ass
Show your code
does it need clientSecret
I got it
I added the clientsecret
"get help here", but you forgot about the fact that it's completely voluntary help; that not everyone uses rpc, and that you have given absolutely no details whatsoever.
I've tried everything, but Client#application always seems to be null no matter what I do. Is this intended or am I doing something wrong?
when you only login with the client id , yea
oh, what else are the options I can log in with?
im pretty sure you can login with your bot token, lemme check rq
you cannot rip, the other parameter you can put is accessToken, im assuming it means an oauth one
accessToken is the only one that provides application
does that mean we can implement discord rpc from websites via oauth?
no , remember that rpc has to be used on the computer that your discord client is open on
hmm, what's the accessToken for then?
wait no im stupid
the code does the accessToken flow for you
it should provide you with the application
I tried, but there don't seem to be any docs for where to get an accessToken, and I've tried even making a different app on discord developers but I've never had client.application to not be null
yea accessToken you dont need to worry about actually i read the code wrong, but it should be working idky
its being null
everything that is set in the authorize is null
i tried stepping through the code, client.application stays null at the authenticate call from login (src/client.js:246-ish), but client.user gets a value and works properly, it's just client.application that stays null throughout the entire process
well
i got client.application to not be null
it was weird, idky why it doesnt work
do you login using a clientId?
yes
'cause my brain is too tired from school to think about this lmao
I give up
i'll just fix it when rpc docs are better
actually nvm i didnt get it oof
idk what the fuck is goin on
i blame the docs lol
nowhere in the docs does it say how/where to get an accessToken
well
like i said
accessToken is provided
i mislead you ealier
lmfao
accessToken is provided by the oauth flow it goes through when you provide either client id or client secret
well yeah, but it only goes through the authorize flow if you don't provide an accessToken on login
if i'm reading this code correctly you have the option of either calling login() with a clientId or an accessToken, but it doesn't say where to get an accessToken in the code (expected). The thing is, it doesn't say where to get an accessToken in the docs either, which is unexpected
yea but you dont NEED to provide accessToken, because the lib alr does it
accessToken is an exchange of an oauth code for a discord bearer token
so if you provided an access token, it would be from doing your own oauth exchange
yeah that would be nice
does accessToken allow bearer tokens?
it IS a bearer token
oh, didn't know that lol
heres the code for it
async authorize({ scopes, clientSecret, rpcToken, redirectUri } = {}) {
if (clientSecret && rpcToken === true) {
const body = await this.fetch('POST', '/oauth2/token/rpc', {
data: new URLSearchParams({
client_id: this.clientId,
client_secret: clientSecret,
}),
});
rpcToken = body.rpc_token;
}
const { code } = await this.request('AUTHORIZE', {
scopes,
client_id: this.clientId,
rpc_token: rpcToken,
});
const response = await this.fetch('POST', '/oauth2/token', {
data: new URLSearchParams({
client_id: this.clientId,
client_secret: clientSecret,
code,
grant_type: 'authorization_code',
redirect_uri: redirectUri,
}),
});
return response.access_token;
}```
yeah i saw that
thaat response.access_token is a bearer token
so theoretically you can set someone's RPC from a website via oauth?
No
because it uses IPC,
websocket is a whitelisted transport
awww
Hi i try to use buttons but buttons are not working
if i click nothing happens
const clientId = '804315545398411295';
const RPC = require('discord-rpc')
const client = new RPC.Client({ transport: 'ipc' });
client.on('ready', () => {
console.log('Authed for user', client.user.username);
client.setActivity({
details:'Festiva Gelişmekte Olan Müzik Botu',
state:'Butona TIkla Davet et',
largeImageKey:'large',
buttons:[
{
label:'Sunucuna Ekle',
url:'http://invite.festiva.me/'
}
]
})
});
// Log in to RPC with client id
client.login({clientId:clientId});
code
you cant click your own buttons
ok
?buttons
If you want to add buttons to your RPC , make sure you are on the master branch of discordjs/rpc. this can be installed using npm i discordjs/rpc.
Then inside your setActivity call, you can use buttons: [ { label: " ", url: " " }, { label: " ", url: " "} ], you can have a maximum of 2 buttons
You wil not be able to press these buttons on your own account, so dont freak out when something doesnt pop up when you click it
which is why i put this at the end^ 🤣
Hi who can help me with rpc fast?
protip: show code
was this fixed?
Idk check it
it doesn't break whole code
so it definitely isn't any priority
what exactly is the djs rpc im looking at the documentation and it doesnt really explain
this is rich presence
ooooooh
so it rich presence i see
thx
well, it uses rpc to set you a rich presence
ye
Can we use rpc to change the person's username
wdym @willow minnow
Pretty sure they mean what they said
bruh
no
Do you need Python to install the package discord-rpc? The console is going to tell me, that I have to install Python to use the RPC Client
no
?rpc
no apparently lol
Oh ty
Would your discord acc get banned if you used djs rpc to set stuff in your activity?
thats the point of rpc.
well, one of them
but no you wont get banned
kk ty
Isn't it technically a self bot?
thats what i thought
hmm
it's not
ok, what is the def of a self-bot?
well, doing bot stuff on a user account
and rpc does not belong into that category
"Automating normal user accounts outside of the OAuth2/bot API is forbidden"
You're automating the activity and status of a user account
I dont know if you realize, but rpc performs an ouath request
soo
it is within that scope
why would rpc exist if you weren't allowed to use it?
Well i mean using RPC is the same as you going on, lets say fortnite, and having that appear on your pressence thing
still logs onto a user account tho
it doesn't log onto your account, it uses the rpc server from the discord application
this is the point afaik, ToS also has a formulation along the lines of "users/bots may not interface with endpoints meant for bots/users"
discord app literally runs a server to which apps connect to, allowing apps to pass data to display on rich presence
no one is using a user token, no one is using gateway, no one is doing anything against tos.
Trying to install discord-rpc via npm and this happens any idea why?
The .git file it references 404s
github.com/djs?
what is that supposed to be
this package: https://www.npmjs.com/package/discord-rpc
It links to the github for discord.js
so i assumed i should ask here
which isn't on djs, mind you
but on discordjs
right
but i'm just trying to install it and it errors
hmm
maybe it's on my end then
no clue why is your git trying to do djs instead of discordjs
yeah me neither
is there a way to manually change the link or
install w/o using npm?
try doing npm i discordjs/rpc
Nevermind, figured it out, for some reason it was referencing github.com/djs in the package.json
Thanks for the help
what is discord-rpc, i should ask
?rpc
ok
it's rich presence kinda looks like this:
ah nice
I cannot install discord-rpc
it says I need to instakk python
ping me for answer
then install python?
?build-tools
Run npm i windows-build-tools --production --vs2015 --add-python-to-PATH --global as admin, and restart terminal.
Restarting machine can also be required.
@nocturne trail ^
rpc down for npm version: 0.0.0

please update in npm : https://github.com/djs/RPC to https://github.com/discordjs/RPC
C:\Users\Sambit Kayal\Documents\Custom Discord RPC\node_modules\discord-rpc\src\client.js:118
reject(new Error('connection closed'));
^
Error: connection closed
at IPCTransport.<anonymous> (C:\Users\Sambit Kayal\Documents\Custom Discord RPC\node_modules←[4mdiscord-rpc←[24m\src\client.js:118:16)
←[90m at Object.onceWrapper (node:events:483:26)←[39m
←[90m at IPCTransport.emit (node:events:376:20)←[39m
at C:\Users\Sambit Kayal\Documents\Custom Discord RPC\node_modules←[4mdiscord-rpc←[24m\src\transports\ipc.js:137:18
at decode (C:\Users\Sambit Kayal\Documents\Custom Discord RPC\node_modules←[4mdiscord-rpc←[24m\src\transports\ipc.js:92:5)
at Socket.<anonymous> (C:\Users\Sambit Kayal\Documents\Custom Discord RPC\nodemodules←[4mdiscord-rpc←[24m\src\transports\ipc.js:120:7)
←[90m at Socket.emit (node:events:376:20)←[39m
←[90m at emitReadable (node:internal/streams/readable:565:12)←[39m
←[90m at processTicksAndRejections (node:internal/process/task_queues:79:21)←[39m
I am getting this error
npm ERR! gyp ERR! stack Error: Cannot find module 'psl'
dead chat xD
?softban 728169193148514324 shitposting
Successfully softbanned GoldPine17#0069
why is the version just now changing lol
the last real commit was like 2 months ago
so you say that it should stay outdated until next commit happens?
No, but i get why its like that now lol
Hi, i want to add a small image but it don't work
Add how?
And doesn't work how?
I just did it
mk
Another question. I want to do a ask button. If i accept they can join my channel
With a party when they can with who i am
iirc party features only work for whitelisted devs
Ok
And for a timer
Like the time i'm connected
define startTime for an upcounting timer
define endTime for a countdown
?
I don't know how to put it
in the setActivity function, define startTimestamp with a Date.
Uh
Sorry i'm lost
I'm french
In your RPC application, you set the activity, correct?
It gives you this:
Where do you set that
Now see how you've set all other variables in that object?
Do it the same way, and set it's value to the time you wish.
In your case, a new date will do.
I put it in activity ?
Or in assets
Activity
why are you using client.request anyway, there's a setActivity() method
He's most likely copypasted it kek, given he doesn't understand what he has
Yup
It's that
Don't work
Set it to a Date.
Nop
Don't work
Do you know what a Date is?
Sorry lol
I put date
Lol
Like that ?
Nah
I recommend you learn Javascript before you venture onward with this, check #resources ^^
const scopes = ['rpc','rpc.api','messages.read'];
const client = new Discord.Client();
const rpc = new RPC.Client({ transport: 'ipc' })
rpc.on("ready", () => {
// rpc.setActivity({
// details: 'test',
// startTimestamp: new Date(),
// largeImageKey: 'icon',
// largeImageText: 'test'
// });
});
rpc.login({clientId, scopes})```
and what error did you say u got
specifically
this one: js Error: OAuth2 Authorization Error: Unknown Error at RPCClient._onRpcMessage (D:\Visual Studio Code\Dustins-Discord.js-Bot\node_modules\discord-rpc\src\client.js:185:19) at IPCTransport.emit (node:events:376:20) at D:\Visual Studio Code\Dustins-Discord.js-Bot\node_modules\discord-rpc\src\transports\ipc.js:138:18 at decode (D:\Visual Studio Code\Dustins-Discord.js-Bot\node_modules\discord-rpc\src\transports\ipc.js:92:5) at Socket.<anonymous> (D:\Visual Studio Code\Dustins-Discord.js-Bot\node_modules\discord-rpc\src\transports\ipc.js:120:7) at Socket.emit (node:events:376:20) at emitReadable_ (node:internal/streams/readable:572:12) at processTicksAndRejections (node:internal/process/task_queues:79:21) { code: 5000, data: { code: 5000, message: 'OAuth2 Authorization Error: Unknown Error' } }
Um
what tf
thats new
to me at least
apparently my code is commiting arsen
if even you dont know
closest i got is when i remove rpi.api
from scopes
what result did that yield
Error: 400
at D:\Visual Studio Code\Dustins-Discord.js-Bot\node_modules\discord-rpc\src\client.js:64:21
at processTicksAndRejections (node:internal/process/task_queues:93:5)
at async RPCClient.authorize (D:\Visual Studio Code\Dustins-Discord.js-Bot\node_modules\discord-rpc\src\client.js:225:22)
at async RPCClient.login (D:\Visual Studio Code\Dustins-Discord.js-Bot\node_modules\discord-rpc\src\client.js:150:21) {
body: { redirect_uri: [ 'Not a well formed URL.' ] }
}```
try completely removing scopes all together
k
i think this would give me a timeout
ok its not giving me a timeout thats good
now let me un comment the set activity
you dont have to pass scopes so
should work
u prolly just passed a bad scope
now its not setting activity 
ys it is
i see it
is that for me?
yes
it doesnt set it for ur bot lol
hmmm i wish it set it for the bot
the person whos discord is logged in
you cant
sadly
darn ok
i can work with this
thx for your help even if i cant see it
i just wish it would quit giving me this timeout error
how do i get the button to redirect to a url
read the bottom part of this tag
?buttons
frick
yuu is still down forgot
well
u cant press ur own buttons
ooooh
ur button is working
tho
yeye
sweet
guys I was wondering if I can display an icon for the current game activity instead of empty box with a question mark , I know you have to use rpc and discord js maybe ?
the thing is Im not finding a good documentation can some one help?
How do I make my bot have a custom presence? My code says SetPresence does not exist.
rpc is for users, not for bots
Yeah but like this
That's a status js <Client>.user.setActivity('text', { type: 'WATCHING' })
Oh right <client> do I put bot there since my bot only supports bot.test123.test123
what you mean by that?
Right so, When I am coding my bot instead of client.user.setActivity I have to put bot.user.setActivity.
Is there a way of making it change to client.