#archive-rpc-help
21942 messages · Page 9 of 22
i keep getting this error :
TypeError: rpc.SetActivity is not a function
most javascript libs are camelCased including this one
use setActivity
OO
it works thanks
Hey, I have a slight problem. Here is my error:
TypeError: Cannot read property 'fetchAssets' of null```
and here is my code:
```js
function init () {
rpc.login({ clientId }).catch(console.error)
rpc.on('ready', function ready() {
rpc.application.fetchAssets().then(function doIt (assets) {
assets.forEach(asset => {
console.log(asset.name + asset.type)
})
})
})
}```
Everything RPC related works fine, but I cannot fetch the application's assets.
Come on <@&265426791538229258> help me
Do ppl even still have these roles
Yeah like one person
Oh wait nvm
They used to
Not anymore
@arctic eagle
/**
* Authenticate
* @param {string} accessToken access token
* @returns {Promise}
* @private
*/
authenticate(accessToken) {
return this.request('AUTHENTICATE', { access_token: accessToken })
.then(({ application, user }) => {
this.accessToken = accessToken;
this.application = application;
this.user = user;
this.emit('ready');
return this;
});
}
what
That's the only point where it gets defined to smthng
oh
When i run the rpc example it gives this error:
> electron example/main.js
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! discord-rpc@3.0.0 example: `electron example/main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the discord-rpc@3.0.0 example script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/8.11.4/_logs/2018-09-06T10_25_48_898Z-debug.log```
@smoky scroll did u npm i
yes
This isn't RPC related.
Use the following link to generate an invite for your bot: https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID&scope=bot&permissions=0 CLIENT_ID
Change the permissions number to a permission bitfield you want, but it doesn't mean it'll come with those permissions, as people can disable them.
Please move to #archive-offtopic for other questions.
ok thanks, sorry I didn't really know where to ask it!
how make this epsled?
<@&265426791538229258> please write
Define the start timestamp instead of the end timestamp
Can the web version of the api support Rich Presence?
nvm
The Docs are a wonderful haven of info.
https://github.com/discordjs/RPC/blob/master/src/Client.js#L551
I assume the (user) is a discord ID?
eeyup, nvm
@smoky scroll why would you @ everyone u selfish cunt
sorry
Is RPC example still working? When I run npm run example the script appears to work, but I do not gain any rich presence in discord
It just gives the generic "Playing Electron for xyz"
what is discord-rpc?
?rpc
stands for rich presence client
?discord-rpc
?docs discord-rpc
@smoky scroll read channel topic
oh
rich presence
@lone totem i will have a look into it
even tho differening on my time i might only be able to view it on saturday
@fresh crag thanks
that was a useless ping, sorry
@lone totem Okay i will actually have a look into it rn
seems fine for me
Could it be something with osx? @fresh crag
Try restarting Discord
I did multiple times
My VScode rich presence was screwing with it somehow
@smoky scroll not discordjs rpc related
oof i forgot sorry
didnt see the channel
Thats why bot is sending d.js rpc github updates
aight
hi guys
How can i use Authorization URL in my website
?
not related to rpc, not related to djs in any way, so, #archive-other-js-questions
Hello. Got an unusual circumstance
I'm working with DiscordRPC within electron and I am getting a transport undefined error.
However the transport is clearly defined
const richPres = new DiscordRpc.Client({ transport: 'ipc' });
I'm having a weird issue with the example. I transferred the files to a different directory to test them with my code.
It all runs fine, except for the renderer.js file
So the html displays and it looks fine, but the snake isn't interactable
@lone totem how did u open the html
Same way the example has it. Defined npm start as electron main.js
The html shows though, just the snake doesnt count up/react on click
oooo
also same
@dapper island were u able to dodge issue #41? cuz i have the same problem
I created a workaround
how
Instead of loading it in a script within electron
I have the renderer call the JS in the webpage
oof
lmc
@dapper island fine i guess i'll wait for actual bug fix
Hi i try discord RPC but if i connected, i am a mistake :
Error: OAuth2 Error: invalid_request: Missing redirect URI.
how fixed this mistake ?
my code
const {Client} = require('discord-rpc');
const client = new Client({ transport: 'ipc' });
client.on('ready', async () => {
console.log(client.user);
});
client.login({
clientId: clientId,
scopes: ['rpc', 'rpc.api', 'messages.read'],
clientSecret,
}).catch(console.error);
Help me pls ?
How to set image ?
I have a code but don't work
Send the code
@smoky scroll you cant use the messages.read scope without a restrict url
@fresh crag i delete messages.read but always error
{ code: 5000,
message: 'OAuth2 Error: invalid_scope: unknown error' }
@smoky scroll just leave the scopes part away then
yes but after i want user spectate a game with discord rpc, style osu
what scopes are u using rn
I dont know so i test
With wich ones do u test
just with me, i create a game with nodeJs client and i try add extension discord rpc on discord for join and spectate a game
@smoky scroll What is in the Scopes variable rn
scopes: [....]
scopes: ['rpc', 'rpc.api'],
just delete messages.read
Error code
5000
5000OAuth2 Errorsent when a standard OAuth2 error occurred; check the data object for the OAuth 2 error information
U defined clientSecret right
clientSecret is define
Can u try without it
If it doesn't work add it back and make sure it's right
it's fine
else how used :
matchSecret spectateSecret joinSecret
bc on https://discordapp.com/developers/applications/:id/rich-presence
matchSecret dont exist
was directed here
not sure if this is really a lib question, but here goes anyways
this image (what i see) shows 5 hours elapsed, but it should only be like 30 seconds
{ top: 'Node E-4 D',
bot: 'none',
large: 'none',
small: 'none',
timestamp: '1537142492124' }
i do divide the timestamp by 1000 to make it in seconds. also i think that other people != me see this showing up correctly, but i myself dont. how to fix this problem?
on mobile and other peoples' clients it shows up fine
FUCK
?
@brittle panther you don't get presence updates for yourself
Is not updating presence for the user a limitation of rpc? Or something else?
I found my issue with the renderer.js
Something about
webFrame.setZoomLevelLimits(1, 1);```
was killing it
replacing it with this fixes it. No idea why the example doesn't break with the same code
webFrame.setVisualZoomLevelLimits(1, 1);
webFrame.setLayoutZoomLevelLimits(1, 1);
@carmine mica but it worked at first when i was coding it; only after using it for a few days did it become like this
@brittle panther seems like discord bug
oof
So umm how can i catch if the user closed Discord? (completely) or does that not work?
Or how can i "automatically" reconnect to the presence if you restart Discord?
if u get that error about unhandledpromiserejection i think that means they closed discord
Noob question : what scopes is used for ? I don't understand how they work
As i know it basically tells Discord "I want to access this and that from the user"
oh ok thanks
how create passport npm, oauth2
uhhh
can someone explain me what discord rpc is and a use case?
@brisk gull channel topic
Nah, I already looked at it, and I don't get it
@brisk gull Rich Presence is a way to show what you are playing in Discord, it also allows for cool features like spectating, joining their Party etc, you can see a lot of examples like League Of Legends, Fortnite and many more
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.
Any way to properly catch if Discord was closed? Or would i just run the .login function in an interval?
(to automatically reconnect)
hey, is there a way to turn off rpc without closing app?
You could clear the presence with .clearActivity() or you destroy the RPC with .destroy()
theres a clearActivity() ?
yep
ooh
@plucky cargo good question
it looks like I only handle closing during login
can you open an issue on the github
K
uh { code: 4000, message: 'No Client ID Specified' }
heres what i have https://hastebin.com/tomanucafi.js
look at pin
oh thanks
still getting the same error though
whatd you do
changed
rpc.login(clientID).catch(console.error) to rpc.login({ clientID }).catch(console.error)
clientID 
clientId
oh
thanks so much
👍
Expected output: Starts the rich presence
Output: err
Error( s): js { code: 4000, message: 'No Client ID Specified' }
Code (config.json): json { "richpres": { "clientId": "censored", "noConsolePrompt": "false" } }
Code: (rpc.js): ```js
const DiscordRPC = require("discord-rpc");
const config = require('../config')
const ClientId = config.richpres.clientId;
DiscordRPC.register(ClientId);
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
module.exports = rpc;```
Code (main.js): ```js
const rpc = require('./rpc')
const config = require('../config')
const ClientId = config.richpres.clientId
rpc.login({ ClientId }).catch(console.error);
//I wanted to keep this small, so i reduced it to the code that i think matters instead of having 200 lines of code```
This should, start the rich presence as everything is defined.
ClientId
could literally read a line before your post for the answer
Ive read it over multiple times
clientId
ClientId
lowercase c
😕
Thanks. If i may, when was it updated to that? As it was working fine just yesterday.
3.0.0
2 months ago
Hmm, i wonder why i didnt get the error before today.
i think i might be blind. i cant find setActivity in the docs
you're not blind
oh
Error: Could not connect
const ClientID = ('secret');
const rpc = new DiscordRPC.Client({ transport: 'ipc' });
const startTimestamp = new Date();
rpc.on('ready', () => {
console.log("Loading... RPC is ready");
setTimeout(() => {
console.log(`testing`)
rpc.setActivity({
state: `test`,
details: `test`,
startTimestamp,
largeImageKey: `ae_large`,
largeImageText: `опа`,
});
}, 2000);
}, 5000)```
What i need to do?
u dont have login
rpc.login({clientId: ClientID}).catch(console.error);
Same err
rename your var ClientID to clientId
then have { clientId } for your options
also why does your setactivity have a , 2000 as the end
Same err
Whatever i change
const clientId = "id"
const rpc = new DiscordRPC.Client({ transport: "ipc" })
const setActivity = () => {
if (!rpc)
return;
rpc.setActivity({
details: "test",
state: "test",
startTimestamp: new Date(),
largeImageKey: "ae_large",
largeImageText: "ona",
instance: false,
});
rpc.on("ready", () => {
console.log("Loading... RPC is ready")
setActivity()
setInterval(setActivity(), 5000)
})
}
rpc.login({ clientId }).catch(console.error)
^
ReferenceError: DicsordRPC is not defined```
Whats wrong?
man go away
@carmine mica
I just asking: what i doing wrong and what i need to change.
can you even read your own code
ffs
we're not here to teach you how "discord" is spelled
i played around with discord rpc a bit and stumbled upon the following error: ReferenceError: URLSearchParams is not defined. Source code is mostly copied from the example (https://discord.js.org/#/docs/rpc/master/general/welcome). URLSearchParams appears only to be available in a browser, while i want to run it in node.
(My source: https://gist.github.com/65679b1fa38bda42292eb0a4375e995a )
URLSearchParams is a global in node
iirc >= 10
oh that might be a mistake. ty ill try that
yeah im still on v8
node v8.9.1 not v8 the engine
thanks, that worked :)
(node:9212) UnhandledPromiseRejectionWarning: Error: OAuth2 Error: invalid_request: Missing redirect URI.
const clientId = "%%%"
const scopes = ['rpc', 'rpc.api', 'messages.read'];
const rpcclient = new RPC.Client({ transport: 'ipc' });
rpcclient.on('ready', () => {
console.log('Logged in as', rpcclient.application.name);
console.log('Authed for user', rpcclient.user.username);
rpcclient.selectVoiceChannel('%%%');
});
rpcclient.login({ clientId, scopes });```
@storm sable specify a redirect uri
how?
Your using scopes wich need a redirect uri
I suppose the ID here is the application ID?
Client ID
Is it possible to use the rpc library to construct a rich presence bit by bit?
const rpc = require('./rpc')
const readline = require('readline')
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
prompt: 'Would you like to set the state or details? '
})
rl.on('line', (line) =>{
if(line == 'details') {
rl.question('What would you like the details to be? ', answer =>{
rpc.setActivity({ details: answer });
console.log(`Updated your details to ${answer}`)
})
} else if(line == 'state') {
rl.question('What would you like the details to be? ', answer =>{
rpc.setActivity({ state: answer });
console.log(`Updated your state to ${answer}`)
})
}
})```
I get the errror ```js
(node:9032) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'write' of null
at IPCTransport.send (C:\censored\censored\censored\rpc2\node_modules\discord-rpc\src\transports\IPC.js:151:17)
at Promise (C:\censored\censored\censored\rpc2\node_modules\discord-rpc\src\Client.js:152:22)
at new Promise (<anonymous>)
at RPCClient.request (C:\censored\censored\censored\rpc2\node_modules\discord-rpc\src\Client.js:150:12)
at RPCClient.setActivity (C:\censored\censored\censored\rpc2\node_modules\discord-rpc\src\Client.js:509:17)
at rl.question.answer (C:\censored\censored\censored\rpc2\main.js:42:17)
at Interface._onLine (readline.js:285:5)
at Interface._line (readline.js:640:8)
at Interface._ttyWrite (readline.js:920:14)
at ReadStream.onkeypress (readline.js:165:10)
(node:9032) 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: 3)```
You could probably try a workaroundish method which would be all inputs set to null and updating them after an input by e.g. changing a variable and updating the presence
@cobalt wadi u need to use new RPCClient
Just requiring wont work
I have a fike for that
file*
How does it look
const DiscordRPC = require('discord-rpc')
const rpc = new DiscordRPC.Client({ transport: 'IPC' });
module.exports = rpc;```
Are you sure the client is ready @cobalt wadi
Yes
yesterday i forgot to have it log in.
is there a way to keep an RPC app running?
like without having an app or a site active from the client
to make my rpc app(i'm using the example) to like log in into my acc i put my id or an id of an app i make on discordapp.com/developers
How to get RPC?
☼
const DiscordRPC = require("discord-rpc");
const ClientID = 495983680859275264;
DiscordRPC.register(String(ClientID));
const RPC = new DiscordRPC.Client({transport: "ipc"});
RPC.on("ready", () => {
console.log("ready");
RPC.setActivity({
details: "Details",
state: "state",
largeImageKey: "aura",
largeImageText: "Large Image Text",
smallImageKey: "profile",
smallImageText: "Small Image Text",
instance: false
});
});
RPC.login(String(ClientID)).catch(console.error);``````bash
{ code: 4000, message: 'No Client ID Specified' }```
check pins in this channel
oh thx
you're also likely to have issues with your id since you're not declaring it as a string. js doesn't support integers as large as discord snowflakes.
How to get rpc?
@smoky scroll you gotta go to your local walmart
ask for doug
he'll take you into the back
go down the steps on the left
there you will find the rpc
I don't understanding you
lol
I haven't local walmart and what's it?
What the doug?
Reqd the channel description or use google
?rpc
stands for rich presence client
?rpc-help
const clientId = '187406016902594560';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
const client = new RPC.Client({ transport: 'websocket' });
client.on('ready', () => {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
client.selectVoiceChannel('81384788862181376');
});
// Log in to RPC with client id
client.login({ clientId, scopes });```
Error: ```(node:910) UnhandledPromiseRejectionWarning: #<ErrorEvent>
(node:910) 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:910) [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.```
If I remove the `const RPC = require("discord-rpc");` the error dissapeares but it will say RPC isn't definied...
@smoky scroll use ipc not websocket
did but now it says cant connect(i checked if the id is correct and it was and i did this with another code)
@smoky scroll is your discord client open?
yes
const clientId = "ID"
const rpc = new DiscordRPC.Client({ transport: "ipc" })
const setActivity = () => {
rpc.setActivity({
details: "aaaa",
state: "aaaa",
startTimestamp: new Date(),
largeImageKey: "fbig",
largeImageText: "Grinding defaults",
instance: false,
});
rpc.on("ready", () => {
console.log("Done")
setActivity()
setInterval(setActivity(), 5000)
})
}
rpc.login({ clientId }).catch(console.error)
```
@carmine mica ^ code
your set interval is wrong
as a side note
ok but why it can't connect?
¯_(ツ)_/¯
are you on ubuntu 16.04
nope
to be sure
you're running the rpc on the same computer that your client is on right
@smoky scroll it has to be on the same computer that your discord client is on
ok ty
?rpc-help
?help
?rpc
stands for rich presence client
?rpc help
?help commands
?help rpc
?help npm
npm discord.js
?npm discord.js
?npm install npm@2.15.0
@sterile halo, Yukikaze couldn't find the requested information. Maybe look for something that actually exists the next time!
:))
?npm openldapjs
@sterile halo #app-commands
?npm discord.js
?npm I discord.ns
@clear grotto, Yukikaze couldn't find the requested information. Maybe look for something that actually exists the next time!
?npm I discord.js
@clear grotto, Yukikaze couldn't find the requested information. Maybe look for something that actually exists the next time!
whats going on?
what discord rpc could help me in websites ?
???
node.js shows that discord-rpc module is not found even if I have it installed 😛
I can't tag the Dev role :(

Oh @carmine mica you're the main guy!
Maybe I know what can cause it
Wait a second for a pic
@wicked radish i don't see anything wrong
Weird
Bigger and better pic ^
oh you did -g
remove the -g
But I want it globally
that's not how it works
you can't require global modules
I can lol
no you can't
It works for other modules
no it doesn't
Buh, I'll try it without the -g but I can bet it'll not help

XD I am a dumbo
It worked, thx sneky!
:+1:

@carmine mica Hey
Does the 'discord-rich-presence' library support image description?
yeah
How?
It's not mentioned in the documentation
@carmine mica
shrug
XD
It's not there
that's an example
not documentation
And where is the documentation if it isn't there? 😛
It isn't on GitHub either
@carmine mica
Sorry for tagging ya so much but I have the deadline for my project today lol
smallImageText
largeImageText
Thanks
You should include it publicly for other people too
const DiscordRPC = require("discord-rpc")
DiscordRPC.register("498930677484486656")
const rpc = new DiscordRPC.Client({transport: "ipc"})
let mainWindow;
rpc.on("ready", () => {
rpc.setActivity({
details: "Working with Electron",
state: "Some random app tests?",
startTimestamp,
largeImageKey: "javascript-electron-logo-s",
smallImageKey: "github",
largeImageText: "Ye learing it",
smallImageText: "Odar.xyz",
instance: false
})
})
rpc.login("498930677484486656").catch(console.error)
{ code: 4000, message: 'No Client ID Specified' }
check pins in this channel
what opetions are therre
literally what the pin says
secret?
client.login({ clientId: '1234567', clientSecret: 'abcdef123' })
sure, at least for clientId, sicne thats where the option moved to
kk
thx
thats not what it is, can you also keep irrelevant posts out of the channel
how do i add the "elapsed {time}" to rpc
@small mortar add a start timestamp
Hey I've never talked here but I immediately found what I was looking for because it's in the channel description
Wait maybe I did talk here awhile ago
but anyways
thanks for the useful discord 
alright
I wanna try this
I cant find the SDK
How to download and install discord.js on my PC
It is literally right on the discord.js page..
npm install discord.js
@brisk crag also this channel is for Discord Rich Presence
Hmm, I'm trying to get rich presence game invites to work, but the invite says the game isn't detected. I'm using Electron and the IPC transport. Any ideas how I can fix this?
are there no typings for discord-rpc?

don't do this to me
looks at any
how does the example work? 🤔
it doesn't work when I run npm run example
what is RPC ?
i dont know any thing about it
@smoky scroll run npm i before
@worldly iris read channel topic
ok
but what can it help me ?
It can set your presence
bot dashboard or something
OH
i get it now
Your best off looking here
https://discord.js.org/#/docs/rpc/master/class/RPCClient
@fresh crag lol....what why would you think I am stupid enough to not run that
At the methods
🤔
RichPresenceClient
that isnt what rpc stands for
lel btw it worked. Was problem with wsl
@worldly iris
RemoteProcedureCalls
anyways, thanks
@fresh crag oh thx
Role Play Chat
ewwie
wow
RichyPresenceCat meow
Can we please keep this shitposting outside of this channel, thanks.
how do I install RPC i've literally read the thingy and can't get it to download
like where tf do I find my assets/plugin folder
Hi there. There is a code that adds this to your pfp and you can change it anytime you want. It's working for my friend but not for me.
Any Idea why please? I need one.
@smoky scroll show whats not working
@fresh crag IT worked
Thanks!
its possible to run rich presence without discordapp installed?
like in phone
no rich presence is PC only
I am currently having problems when I Authorize my app:
ReferenceError: URLSearchParams is not defined
My code is:
const userID = '473680755944456192';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
const RPC = require('discord-rpc');
const Client = new RPC.Client({ transport: 'ipc' });
Client.login({ clientId: userID, scopes })
.catch(error => {
console.error(error);
});```
oh
seems to work on Node v10
forget everything I just said
Hey quick noob question, I'm not sure if this fits here though...
Would it be possible to read what game someone is playing or what they're doing and do something? For example something like:
give.role
} (just an example)```
Work on my pc but on my phone I have that 
update your node version
ok
I published an npm module for registering an application protocol for any electron apps https://github.com/samuelmaddock/electron-discord-register
lets you use rich presence join/spectate invites with the discord launcher
i'm using this with discord.js as a way to avoid any native module dependencies
neat
@heavy wolf App Phone?
Yes
Any1 knows why i get
Uncaught (in promise) TypeError: Cannot read property 'write' of null
at IPCTransport.send (D:!veznan\veznan.source\node_modules\discord-rpc\src\transports\IPC.js:151)
at Promise (D:!veznan\veznan.source\node_modules\discord-rpc\src\Client.js:152)
at new Promise (<anonymous>)
at RPCClient.request (D:!veznan\veznan.source\node_modules\discord-rpc\src\Client.js:150)
at RPCClient.setActivity (D:!veznan\veznan.source\node_modules\discord-rpc\src\Client.js:515)
at post (rpc.js:45)
at HTMLAnchorElement.onclick (richpresence.html:44)``` (on my electron app)
const { Client } = require('discord-rpc');
const rpc = new Client({ transport: 'ipc' });
async function post() {
const form = document.getElementById("frm1");
const res = document.getElementById('res');
if (!rpc) return res.innerHTML = `<h3 style="margin-bottom: -10px;">Response</h3><br /><pre style="color: red">Error: invalid RPC client</pre>`;
if (!form['appId'].value || form['appId'].value.length <= 15 || form['appId'].value.length > 20) {
return res.innerHTML = `<h3 style="margin-bottom: -10px;">Response</h3><br /><pre style="color: red">Error: invalid appId</pre>`;
}
let start = form['startTimestamp'].checked ? new Date() : undefined;
let structure = {
start,
state : form['state'].value && form['state'].value.length >= 1 ? form['state'].value.slice(0, 50) : undefined,
details : form['details'].value && form['details'].value.length >= 1 ? form['state'].value.slice(0, 50) : undefined,
instance : false,
largeImageKey : form['largeImageKey'].value && form['largeImageKey'].value.length >= 1 ? form['largeImageKey'].value.slice(0, 50) : undefined,
smallImageKey : form['smallImageKey'].value && form['smallImageKey'].value.length >= 1 ? form['smallImageKey'].value.slice(0, 50) : undefined,
largeImageText : form['largeImageText'].value && form['largeImageText'].value.length >= 1 ? form['largeImageText'].value.slice(0, 50) : undefined,
smallImageText : form['smallImageText'].value && form['largeImageText'].value.length >= 1 ? form['largeImageText'].value.slice(0, 50) : undefined
};
rpc.setActivity(structure);
return res.innerHTML = `<h3 style="margin-bottom: -10px;">Response</h3><br /><pre style="color: green">Your presence has been updated</pre>`;
}``` this is `rpc.js`
@craggy oyster you have to call login on the rpc client
aahh
forgot about that
i added rpc.login({ appId }).catch((err) => { return res.innerHTML = <h3 style="margin-bottom: -10px;">Response</h3><br /><pre style="color: red">${err}</pre>; }); and i still get the same thing though
under setActivity, should it be above?
oh
i think
ok i forgot ready event
now it odenst erorr
but my presence is also not updated
maybe its cuz i try to do it iwth a button
and i have nothin about rpc in my main file
@remote yoke would u know why
setActivity() also returns a promise
catch that and log the error
it's picky about what values you can set, so it might be a validation error
okay
it didnt return anything, i tried setActivity(structure).catch(console.error)
you're waiting until the ready event callback to invoke setActivity()?
here's my implementation if it helps https://github.com/samuelmaddock/metastream/blob/discord/app/browser/vendor/discord.ts
i am
Client.on('ready', () => {
Client.setActivity(structure).catch(console.error)
});```
but ill try to change some stuff
use rpc, not Client
okay so rename Client to rpc
you want to use the instance of Client which you created
const rpc = new Client({ transport: 'ipc' });
i already cahnged that part
to just const discordrpc = ...
https://hastebin.com/lemeqepata.js ok so now i have this, but iget no errors or anything, all that logs is the structure
i think its jsut the btn
hello
Hello snek
It's somenthing with my button i think
yes it is!
It works fine if i do it in my main file
you can't start calling stuff before you're logged in
So you cant put like a field with client id in it in a form?
hi ! Can we use the RichPresence to made a join request on form/discord? I've currently a bot, with it we moderate 2 discord servers and game realms (21). I would like create an automated process for recruiting new mods. I'm currently looking at RPC which can be really cool to open/close positions painless.
Then, i would like know if this kind of usage is possible and if it's against any discord rule.
if you can do it with the exposed api its probably fine
im having trouble installing this module can someone assist me please?
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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\conne\AppData\Roaming\npm-cache\_logs\2018-10-31T19_55_16_414Z-debug.log```
already done that
and added it to your environmental variables?
?
then you're on your own
not a problem with this library
?help
?util
?Util
?npm
@rose ether, what would you like to search for?
Type cancel to cancel the command.
cancel
The command has been cancelled.
Lel
rip
Ola este servidor fala portugues?
rpc br?
@unreal bloom nao
are there any typings for the library
@tawny nova no
fun
I'll work on some when I get home later today
edit: i forgot
How do I detect if the client is closed, so I know to reconnect?
I opened an issue once but for now I just catch if set activity fails for 10 times then I just run a login loop until connected
What is the difference between the IPC Transport and the WebSocket Transport?
How can I check if an RPC client is logged in or not?
Specifically, I'm building an electron system tray app with two options for presence for two different games, but when I click the an option after having clicked the other one, the presence does not change. I'm suspecting that I'd have to do <RPCClient>.destroy()if the client is logged in before doing <RPCClient>.login() for the other presence.
const contextMenu = Menu.buildFromTemplate([{
label: "None",
type: "radio",
click: () => RPC.destroy()
}, {
label: "Presence",
submenu: [{
label: "Ball Blast",
type: "radio",
click: () => {
register("509134492212920320");
RPC.destroy();
RPC.login({ clientId: "509134492212920320" }).catch(console.error);
}
}, {
label: "Captivator",
type: "radio",
click: () => {
register("510261009647140864");
RPC.destroy();
RPC.login({ clientId: "510261009647140864" }).catch(console.error);
}
}]
}, { role: "quit" }]);```
But, doing that returns this: bash (node:10831) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'write' of null
@quaint sapphire its 2 diffrent transport metods u can read abaut them online
@fresh crag I looked at the API docs and I didnt see anything about it. I looked for a while. Would you mind just telling me?
IPC - Inter-process communication
In computer science, inter-process communication or interprocess communication (IPC) refers specifically to the mechanisms an operating system provides to allow the processes to manage shared data. Typically, applications can use IPC, categorized as clients and servers, where the client requests data and the server responds to client requests.
So node.js talks to the Discord Client trough Windows
Websocket is over network so nodejs makes an webrequest to discord ( for whitelisted applications only )
@quaint sapphire
So is there any advantage to getting whitelisted to use a Websocket? @fresh crag
Yes
What are they
@quaint sapphire using a websocket is only needed if you're a website
the other thing that whitelisting does is give you access to additional rpc scopes
by default you can only do no-scope rich presence
Okay, thanks.
Sorry, I didn't understand what this was meant for.
What is rpc? What do people use it for?
check channel topic
I have
The docs don't make it clear what this is.
And there's nothing in the example github page that would tell you either.
Pretty sure this was in the channel topic at some point: https://discordapp.com/developers/docs/topics/rpc
Is there any reason this should be giving me a Invalid client id? Code: ```js
const Discord = require('discord-rpc')
const rpc = new Discord.Client({ transport: 'ipc' })
let ID = 'ID'
rpc.connect({ clientId: ID }).catch(console.error)```
ID has been replaced with the applications actual client id btw
try rpc.login({ clientId: ID })
oh..
Right
Too used to eris
how do you know if ```For now, RPC is in a private beta, which means that only apps that have signed up and been approved can access it.
im in it^
??
If you signed up and received an email, which you didn't most likely. Rich Presence is still allowed, but the features like joining lobbies and stuff are in a private beta @novel oar
@tawny nova https://www.npmjs.com/package/@types/discord-rpc have fun
@arctic eagle THANK
If you haven't signed up and been approved, you can't use it.
I'm not sure, I've never even tried, I'm just going off of what I've seen, maybe try google or something.
@white shard give me the code you use at rpc.login, including the id (IDs aren't sensitive)
@smoky scroll call setActivity after you login
e.g. in the ready event
if(id == '') {
document.getElementById("ifMissed").innerHTML = "You have missing fields."
} else if (state == ''){
document.getElementById("ifMissed").innerHTML = "You have missing fields."
} else if(details == '') {
document.getElementById("ifMissed").innerHTML = "You have missing fields."
} else if(large == '') {
document.getElementById("ifMissed").innerHTML = "You have missing fields."
} else if(small == '') {
document.getElementById("ifMissed").innerHTML = "You have missing fields."
// ===
if ([id, state, details, large, small].includes('')) document.getElementById("ifMissed").innerHTML = "You have missing fields."```
wouldnt it be rpc.setActivity?
@carmine mica do you know of any common reasons why some users would fail to login using IPC? some windows users are failing to connect to the discord rpc pipe
i don't think i'm doing anything special https://github.com/samuelmaddock/metastream/blob/master/app/browser/vendor/discord.ts#L58-L64
@remote yoke i bet there's an actual error
i log the caught error and it's just an empty object 😬
sounds unlikely
hmm, might be because i'm logging to the renderer from the main process
The error is 'Could not connect' from here https://github.com/discordjs/RPC/blob/master/src/transports/IPC.js#L32
¯_(ツ)_/¯
darn, thanks for your help anyway. going to search the web for a bit to see what i can find
is there any method to deploy rpc on heroku server so can make it always running? It runs on terminal but doesnt on heroku with same code
No, because you have to have Discord running on the same machine the RPC is connecting from. @urban ice
okayy
thanks
could someone give me a link to a guide on RPC
There is no officially recognized guide
@warm radish
How does a normal person use it then?
read the channel topic for documentation and examples
?
That is for bots
No it is not
we'll say it again: bots cannot use rich presence
I can use it for this account?
I used this for my rpc
wow what a shitty api
the whole reason the discord-rpc package exists is to make the discord rpc api easier to use while still providing all of the features. That isn't easy-rich-presence, that's limited-rich-presence.
if you're only using rich presence, you can use https://www.npmjs.com/package/discord-rich-presence
Do I have to submit a request for RPC access, or will it be automatically reviewed & I have to just wait?
likewise, will I never receive an access token(and thus not be fully authenticated) without RPC access, or is that just for authentication bypassing?
Quick question, How does rpc work exactly?
discord client opens a port
applications connects to that port and sends information on what to display
basically
actually, pretty much completely.
is there any instruction for getting RPC on bot?
bots and rpc are completely unrelated
also it's not possible for a bot to use rpc
yesss I think so but
how can these bots have their own rpc
that's not rich presence, that's just regular poor people presence
hmmm dont know whats difference
oh
thank you
ty it works
How i can download Discord RPC Client?
Check links in the title of this channel
what is an RPC Client...
can anyone tell me please?!
i didn't get it actually when i searched google 😅
._.
Bruh.
Basically it just emulates the part of discord that means you get stuff like 'In fornite game with 20 players with 5 mins left'
That rich presence tile
and
this will be a better explanation https://discord.js.org/#/docs/rpc
O thanks 😄
Hello developers
If the discord application client id is public to everyone
Does that make any issues ?
and which is better to let it private or not ?
@hot dust it doesn't make issues
anywhere you need actual privacy, there is the client secret
i
how does rpc work?
Discord is installed on a PC, it listens on a port. You send data to that port and discord responds by setting the user's playing status to what you sent, as long as it is in the correct format. If another program is already sending data to the port, your program is ignored until that program is finished.
@spare saffron
?softban 475640480294764575 ads
Successfully softbanned MOSTEER_ 17#1398
oof
holy fuck
i hit emoji limit

time to try on alt 
omfg i'm dumb
i saved gif as a png 
btw, for what is emoji.managed property?

is there something like an idiots guide for rpc?
@lone garden its complex but hasnt that many features
An guide isnt really worth it
rpc is not very complex
I managed to get rpc working locally, but not on the web. Is there a process for being able to use rpc on the web?
@scenic crag you need to be verified by discord
Most rpc features are in beta
private
Thanks got it working not nearly as configurable as I had hoped.
not configurable? it has full api coverage of rich presence for discord (i think), but ok
Who does one email/msg to get verified by discord?
@scenic crag first you will want to use the features of rpc that you normally have to be approved for since you are the owner of the app. you can also add other accounts (with a verified email) to your app's whitelist to use these features. once you know the features you want to use are working with your application, you can most likely contact discord support. their email is not that hard to find.
then again, there is still no guarantee that you will be approved.
chances are you'll only get approved if you are a game dev (but not always) that made a cool game
(Or quite popular)
?help
?npm
@twin flower, what would you like to search for?
Type cancel to cancel the command.
yes
at Socket.onerror (C:\Users\user\Desktop\asfg\node_modules\discord-rpc\src\transports\IPC.js:32:16)```
?docs owner id
Snowflake
?Snowflake
?serverinfo
?info
?whois
?whois @smoky scroll
?info @smoky scroll
Someone just posted a great RPC guide in the discordapp subreddit
?rpc
!rpc
😦
@Pete#7391 if u need info about rpc - check topic of channel

?help
?tag
When you beg me so much I just can't not help you~
Check ?help tag for more information.
Hmph, you probably wanted to use ?tag show or something!
?tag show
@twin flower, what tag would you like to see?
Type cancel to cancel the command.
cancel
The command has been cancelled.
?help tag
stop
why ?
?tag show Test
?help
?channel
Successfully kicked utku.js#3706
@mint dew ping from dead channel
I already have a ghost ping from #archive-starboard but ok 
what is the app ID?
this doesn't work...
application ID
Is it possible to force the client to just disconnect so i can have it reconnect to a different developer application?
call client.destroy() and create a new client
so like...
// Declare client, at top of file
let client = new Discord.Client({ transport: 'ipc' }) // Define client
// In the refreshclient function
client.destroy() // Destroy the client
client = new Discord.Client({ transport: 'ipc' }) // Make a new client
client.login({ clientId }).catch(console.error()) // Login, catch any errors
update() // My custom update function``` Or ```js
// Have the client declared already
// In the refreshclient function
client.destroy() // Destroy the client
client.login({ clientId }).catch(console.error()) // login with the client id, log any errors.
update() // My custom update function```?
I've never tested reusing clients
it should work in theory
you can always, like, try the code you're typing @cobalt wadi
So I have 2 instances of discord presences (using discord-rich-presence, but different app ID) running, but the newer one doesn't replace the previous one when activated.
Anyone else do this?
Discord's RPC documentation clearly states that something already connected via RPC holds priority until it disconnects. You would need a way to disconnect from RPC with the first app before you connect with the second one. A way to communicate between the apps would work.
@lost wind
Hm...
hello, MemberUpdate no longer works ? 😦
Huh? What do you mean?
@carmine mica you cannot re-use the client, we've found out the hard way... the connectPromise is never reset, thus the same is returned on other login attempts (say, after waiting a bit from it not connecting), which requires a full new Client or a manual connectPromise set to null before calling login again
@hard hatch sounds like a bug
open an issue
Will do
Although it should be an easy thing to pr?
yeah make a pr if you want
@carmine mica so... call .destroy on close in the connect promise? calling that would throw cause socket is already dead tho...
how can i let my bot leave a cancerous guild ?
what is RPC?
oof
okay
no, it's intentional.
No, that's how you spell the word "by"
@native osprey find the Guild and do Guild#leave
?docs Guild#leave
Already did it LMAO
Although channel topic
Also rpc != d.js
did you know you can use break outside of loops
@candid coyote eval a: { break a; }
@carmine mica
undefined
@carmine mica I think I got what you meant, you want to make the client require to be destroyed before it's reused. Issue is, it'll call this.transport.close, which will try to send a packet to a dead socket, thus erroring (cannot read property write of null or something)
i run client on vsc, what should i do next?
how can i apply rpc to visual studio code ?
Download an extension for it.
this one?
Nah i think it's by "noel"
Discord presence or something
:v oh
Yes
where is URLSearchParams 
Outdated vscode?
@surreal kestrel you need a later version of node
is this being worked on in disocrd.js? https://discordapp.com/developers/docs/resources/user#user-object-user-flags
@knotty trout Those user flags are not accessible to bot users: you need an oauth2 application.
oooh
ok thank you
Is it possible to set streaming with RPC? If so, please give example
You cannot afaik. Streaming is set by Discord when you're streaming to Twitch (and only works with twitch urls)
Well Twitch uses RPC to show that someone is streaming. They use it via their API. They have their own (verified) discord app just like anyone else does. If you did set streaming from your own app, you probably wouldn't be able to get it verified, but you could use it. Just without buttons and stuff to click to watch.
And no custom status/colour
@chilly elm
@arctic eagle So I would not be able to use the purple status icon?
https://i.imgur.com/AoafOme.png how big is the chance of me getting this verified so i can add a join button to my site?
I expect small but it would be awesome
They wouldn't verify you for that
They would verify you if you had a game that let people join other peoples' games, or interact with others in general. Telling someone to join your website (aka something that only you would use and wouldn't be useful to the public) will never get verified.
@coral viper what would the join button do
Just a clickable link, was worth trying
hello
is there any way to get the list of discord application assets?
@coral viper afaik now anyone can add the buttons as long as you do it properly (we implemented it in our vscode extension)
@hard hatch mind pming me your code? It doesnt seem to show up for me
Src/structures/activity I think
You need... A party, a join secret
yeah i have those strangely enough
oh it works but im getting "is not detected" or something and im not receiving the event
hope this isn't seen as "api abuse" though
welp
im having tons of problem with this part of my code
rpc.login({clientId: gameCache[new Number(placeId)].clientId || "client id in here" }).catch(console.error);
The problem is. if it runs the second time. rpc doesnt show
and i get this error
at setActivity (/Users/nahh/Downloads/rblxRP-master/index.js:98:64)
at Timeout.setInterval [as _onTimeout] (/Users/nahh/Downloads/rblxRP-master/index.js:125:4)
at ontimeout (timers.js:427:11)
at tryOnTimeout (timers.js:289:5)
at listOnTimeout (timers.js:252:5)
at Timer.processTimers (timers.js:212:10)
(node:12711) 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:12711) [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.```
@ornate drift new Number(...) returns a number object
are you looking for Number.parseInt()
no
also assuming gameCache[the numberified id] doesn't exist
you couldn't read clientId off it
It reads clientID when run into console
but not into rpc.login
@ornate drift the error is coming from gameCache[new Number(placeId)].clientId
which isn't part of my rpc codebase
so i can only offer guesses
¯_(ツ)_/¯
Okay thanks
wait actually
looking at that stack trace
@ornate drift index.js line 98
yep
thats the line
the rpc.login line
you're calling login inside an interval?
yes
don't?
any chances of changing rpc output when interval removed?
@ornate drift you can call setActivity multiple times
okay
you should only have one rpc instance running
and seriously stop using new Number
i can tell you now you'll never need to use new Number in your entire life long career as a js dev
okay thanks
I'm trying to build a custom status app, but i run into the following problem: The status doesn't update when I cal setActivity().
My renderer.js: __https://h.railrunner16.me/ehibajeyot.js__
My main.js: __https://h.railrunner16.me/feyurekoqe.js__
If i'm doing something stupid, i'm sorry. I'm new to Electron and RPC.
nvm solved it
Do we have the option to use anything but 'Playing' as an ActivityType now?
no
god damnit
@smoky scroll May I inquire about this status app?
ooooo
i like
Had a friend ask me yesterday if this was possible, I said certainly but I'm not making it. I've got other things to make
lmao
Could you DM me details?
yeah, i haven't built a binary tho yet
(even tho i've posted on the subreddit
https://url.railrunner16.me/l/hAHuLBf)
sweet
Do you have a repo?
Go to #archive-offtopic pls
maybe

no repo either yet, but soon, and we probs should move to #archive-offtopic, but rn i haz headake, so imma run the build and go slep
@smoky scroll I remember reading somewhere that having "exclusive" rpc on "public" accounts is against tos, just something to consider 
thats not what i'm doing
i asked this a few months ago and got the answer "RPC doesn't update on your own computer," which might be right, but i'd like another opinion. i currently have an rpc application using the time elapsed feature:
however, the time elapsed shows up on my computer wrong (says there, 4:48:20)
but if u check from another machine, others' accounts, etc
shows up right:
is there way to fix this ffor my own computer?
because if i play games like league or something, it definitely does show up properly on my own computer
That's a old bug that's just because discord can't parse timestamp s
Oof, any fixes?
?softban @smoky scroll weird shitposting spam in multiple channels
Successfully softbanned #4105
Why does RPCClient#user has a question mark before User? What does that mean?
<?something> basically means, that this property can return that something (in this case User), or be undefined.
As an example you can take GuildMember.nickname
Oh
can i use rpc on bots
no
var colors = require('colors');
console.log("Loading...".underline.green)
const RPC = require("discord-rpc");
const client = new RPC.Client({ transport: 'ipc' });
client.login({ clientId: '' }).catch(console.error)
client.once('ready', () => {
let presence = {
startTimestamp: new Date(1000)
};
client.setActivity(presence).catch(console.error)
console.log('loaded');
});
this wont work
clientId = he id of my discordapp developers application
@smoky scroll did you forget to hide your client secret in main.js?
I know this was a while ago
meh
ill reset it 
How do I handle this promise when Discord is not found to be running on the computer?
Do I need to put catch block everytime I call updatePresence?
No, you don't try {} catch {} promises
Add .catch to the end of the call every time you call updatePresence
like this?
im learning js, thanks xDD
actually i dont need the error log for now
.catch is only for promises.
?docs oauth
So I have a function that is updating RichPresence...using catch gives me an error "catch on undefined"
Here is what I am doing:
function updateDiscordRPC() {
rpcClient.updatePresence({
//Stuff
});
}
updateDiscordRPC().catch();
Just to clarify...I am using this library: https://www.npmjs.com/package/discord-rich-presence
I would recommend using .catch inside of the updateDiscordRPC function, on rpcClient.updatePresence
@arctic eagle When I do that, it gives me an error.
Hello guys 😄 I'm having a Transport is not a constructor issue (React CRA + Electron). Looks like the prob is the module being transpiled. Does anyone know how to prevent it? (without ejecting cra)
Anything other than that? A stacktrace maybe?
@arctic eagle
When using catch on rpcClient.updatePresence
index.js line 54 and 196 @lost wind
Have you checked the previous messages?
Those are the affected lines
try to catch the ```JS
rpcClient.updatePresence({
//Stuff
}).catch();
Yeah, doing that brings that error.
Without the catch, it works but gives me the unhandled promise error which I am trying to remove.
But what error?
Cannot read property 'catch' of undefined
then remove the catch's
Then how do I remove this warning every time Discord is not on?
Someone suggested to use catch, but that gives me the undefined error I mentioned previously
i am going to test if i also get this
Thanks
@lost wind you could put process.on(`unhandledRejection`, (reason, promise) => {}); somewhere, but that also affects all other unhandled rejections so idk if it's really too great
@calm dragon Yeah, I knew about that, but I wanted a fine-tuned solution. Oh well, I guess I will just stick to that.
Anyways, I have another question: Is it possible to check if another app is broadcasting rich presence?
@lost wind you need to actually return the promise
you don't return anything from updateDiscordRPC
Example?
function updateDiscordRPC() {
return rpcClient.updatePresence({
//Stuff
});
}
updateDiscordRPC().catch(() => {});
if you don't return anything from updateDiscordRPC it will obviously be undefined
Alright
and there's no such thing as undefined.catch()
i see
Any thoughts on my other question?
Since the new RPC revisions on Discord will only show the first connected app
can anyone help me
i download rich presence and it open in WINRAR
Not sure since when you are supposed to open .jar files as archives tho..
winrar supports jar files
try reinstalling winrar and u will see the supported file types
What
Ofc it supports, why not, but you know, in general, .jar aren't archives with same purpose as .zip or .rar
Generally, you are supposed to run .jar files.
But ok, never had this particular archive
@viral solstice this is uh JavaScript my dude gl
Is there a guide on RPC? I was reading the docs on the discord api docs and it looked like it only worked with SDK. How can i as a user set my own RPC
heya can anyone help why its not working
Not working how
error? paste it
You can't use discord rpc on glitch
As there's no discord client running
iv never done this so could someone help me set this up
const clientId = '187406016902594560';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
const client = new RPC.Client({ transport: 'websocket' });
client.on('ready', () => {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
client.selectVoiceChannel('81384788862181376');
});
// Log in to RPC with client id
client.login({ clientId, scopes });```
im looking at the example but i dont know what to fill in the variables with besides my client id
scopes and 'websocket'
how do u set up rich presence settings
like the large and small images, etc
I know you can set a custom playing with RPC, but can you set streaming?
Hey guys so, I need help I already installed discord.js and i am starting with discord.js, I made the default bot , when I run it, finds a error importing the module
const Discord = require('discord.js');
and its giving me all this errors
when i install it
it's only a warning
unless when you encountered a weird error in your bot
when i run
Linha = Line
and its a sintax error
It says that is a compile error from microsoft JScript
use nodejs
ohh shit...did u just used wscript?
I have been using discord.py, but the docs are kind of fucked and i prefer discord.js
@silver ivy Im new at java script xD
?resources
Useful links for learning JavaScript and Node:
CodeCademy online course: https://www.codecademy.com/learn/javascript
Eloquent Javascript, free book: http://eloquentjavascript.net/
MDN's JavaScript guide: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Introduction
You Don't Know JS (free book series): https://github.com/getify/You-Dont-Know-JS
Some Node: https://nodeschool.io/ https://www.codeschool.com/courses/real-time-web-with-node-js
Javascript reference/docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
time to read

yeah, Im using the CodeCademy tot
you need to read those
but, so how to use nodejs?
I already installed it obv
command prompt
open the folder of your script
enter cmd at the location bar
press enter
node <script>
that cmd thing I know xD
fuck me xD
u really need to learn node
just read
or other alternatives
?resources
Useful links for learning JavaScript and Node:
CodeCademy online course: https://www.codecademy.com/learn/javascript
Eloquent Javascript, free book: http://eloquentjavascript.net/
MDN's JavaScript guide: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Introduction
You Don't Know JS (free book series): https://github.com/getify/You-Dont-Know-JS
Some Node: https://nodeschool.io/ https://www.codeschool.com/courses/real-time-web-with-node-js
Javascript reference/docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
I started it with node and it gave me all those errors
at least you already know how to use node
?ask
yeah xD
Don't ask if you can ask a question, just ask it! If someone knows the answer, they'll do their best to help.
?ask node
Does anyone have a ticket system?
Not related to #archive-rpc-help or this server in general. Read Rule #5.
how to make the teeth, eg how to type in! prefix & and then the user who entered it
const RPC = require('discord-rich-presence')(client.user.id);
RPC.updatePresence({
largeImageText: client.user.username,
state: "▼ UPTIME ▼",
startTimestamp: Date.now()+1337, //<-- returns 00:00
largeImageKey: 'slothy',
smallImageKey: 'sloth',
instance: true,
})```
ReferenceError: window is not defined```
@novel oar define window
wtf
all i did was 👇
const RPC = require('discord-rich-presence/browser')('id');
RPC.updatePresence({
largeImageText: 'Fallenthetaco',
state: "Working On Music",
startTimestamp: Date.now()+1337,
largeImageKey: 'tacos',
smallImageKey: 'js',
instance: true,
})```
what line is the error on