#archive-rpc-help

21942 messages · Page 7 of 22

hoary citrus

unless you do that via a regular webserver

take the token

and use it in the extension with the faked origin (faked to your webserver's address)

main imp

And I don't see how I can set expected origin in Discord's app settings

Also a problem

hoary citrus

pretty sure it's this

main imp

It may not accept localhost origin by default I think

Hmm

hoary citrus

might be worth a try, gonna give it a shot

main imp

Ping me if that works :)

And if that doesn't work, also :D

hoary citrus

SeemsGood

carmine mica

its not those origins

you don't have access to websocket origins

cuz you aren't whitelisted

main imp

@obsidian ridge So I can't even test my app without being whitelisted?

Sorry for wrong mention

@carmine mica

frank wren

npm freezes on installing discord-rpc thonk

[..................] | loadDep:snekfetch: sill resolveWithNewModule discord-rpc@3.0.0-beta.8 checking installable status

and then it freezes

carmine mica

¯_(ツ)_/¯

frank wren

just tried the same on my vps

didn't work

smoky scroll
wanton spoke

try installing from the repo idk

smoky scroll

idk how

whats the easiest way to do it

i heard theres one

<@&222087754366844928>

wanton spoke

just your average jake paul fan

nimble crane

please refer to rules 2-5 kunur

smoky scroll

@nimble crane what is 2-5?

nimble crane
serene lark

is it possible to show a progress bar like in the picture with this library?

I am sending both the start and end timestamp

but it shows like this:

mild ruin

No, that's a discord thing

not possible with the API

rough thicket

Yeah it's possible

You hsyt have to give a start and end time

mild ruin

And it will do it?

rough thicket

Yeah one sec

mild ruin

🤔

rough thicket
  rpc.setActivity({
    details: `🎵  ${song.name}`,
    state: `👤  ${song.artist}`,
    startTimestamp: song.start,
    endTimestamp: song.end,
    largeImageKey,
    smallImageKey,
    largeImageText: `⛓  ${song.uri}`,
    smallImageText: `💿  ${song.album}`,
    instance: false,
  });
smoky scroll

can we not write alternatives to spotify rpc

rough thicket

Why write alternative though thonk

smoky scroll

how to make this custom status

by using this

read the channel description/topic

wich link @smoky scroll

all of them

surely you can tell from the keywords next to each link the ones that might help

smoky scroll

@high onyx this isnt a testing channel for commands

high onyx

sorry

keen ledge

I cant get rpc working.... I did npm run example and i get

npm ERR! missing script: example

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jmh_guest/.npm/_logs/2018-02-14T03_53_32_324Z-debug.log

tardy cloud
cerulean seal

Does anyone know how this works? I don't see the image at my profile

cerulean seal

<@&222087754366844928>

cold scroll

You've already uploaded 2 images, 1 small and 1 large.

cerulean seal

Do I have to remove the large one?

cold scroll

Not necessarily, i use both.

cerulean seal

It's not working for me

I don't see the image(s) on my profile

cold scroll

Did you make any node js code?

cerulean seal

Yeah, I did

cold scroll

I don't remember exactly but the images should be added by the name you've uploaded them.

'picname',

cerulean seal

Ah, I'll try that.

Thanks

smoky scroll

What does 'rpc' mean?

Remote Procedure Call

smoky scroll

fun thing; channel topic says that

smoky scroll

How can i see code of an .exe file

mild ruin

Could you remind of what that has to do with this channel?

smoky scroll

Read the topic, smh

i dont fuckin know what remote procedural calls mean

mild ruin

Read a bit more of the channel topic, maybe?

"BUT WHAT THE HECK IS THAT I HEAR YOU ASK"

GWjustinThonkEyes

ancient anchor

How does what he said even relate to this server

Let alone channel

flat herald

I have a end timestamp on Sunday, February 18th 2018, and the start timestamp on now.

My rpc is only showing 8:00:00

How can I fix that?

woven fiber

Are you sure they are the same types of time-stamps?

It should be epoch seconds

Date.now() is ms

@flat herald

flat herald

Ah ok, tnx man!

flat herald

@woven fiber, the end date is formatted like this:
new Date(2018, 01, 18, 17, 00, 00, 00);

And I have only specified a endTimestamp

woven fiber

Math.floor(new Date(2018, 01, 18, 17, 00, 00, 00)/1000)

Try that

flat herald

@woven fiber, what you said gives this in ms: 1518969600

The ms of Date.now() gives 1518862082960

flat herald

The time will not come right

Help!…

woven fiber

I'm back

Ooops

I mean this Math.floor(new Date(2018, 01, 18, 17, 00, 00, 00)/1000)

smoky scroll

@flat herald Just become better it wil help

Luv ya

craggy boughBOT
brazen siren

hi, i have a problem with the RPC lib, when i try to run my code (who is very basic) the console send me this message :

Uncaught TypeError: Transport is not a constructor
    at new RPCClient (discord-rpc.js:8877)
    at index.js:5

the :5 line who's got the error is the client loader :

const client = new DiscordRPC.Client({ transport: "ipc" });

please 🙇, help me.

sly halo

@brazen siren try it in all caps

brazen siren

@sly halo, well sadly it didn't work.

carmine mica

@brazen siren browser build i assume?

tough moat

Anything I try to do with RPC times out for some reason

Even if its not from node

carmine mica

thats very specific

thanks

<.<

are you on beta.9

tough moat

I am

carmine mica

cool

rough thicket

Are you running under sudo?

I know I had that issue.

RPC server is local to the user or whatever

brazen siren

@carmine mica yes, browser build. You guessed right.
Is there a problem with it? (The browser build)

rough thicket

Pretty sure browser build is whiteliste only

brazen siren

whitelisted from Discord itself?

if true, that's a bit sad, though thanks a lot man 😉

rough thicket

I appear to be wrong @brazen siren , websocket origins are white listed.

meager raven

hi

smoky scroll

@obsidian ridge if i make an app on discord and enable rpc for assets, do i have to enable the spectate option if i want spectate? because those need to be approved by discord https://k.gc.gy/Rkb3.png

dammit

<@&413754863726493697>

obsidian ridge

you have to throw yourself away that's what

carmine mica

hi

smoky scroll

ello

carmine mica

those are always enabled for people on your whitelist

and you

steady sparrow

Isn't that like not well enforced

carmine mica

checking them is only for people who aren't on your whitelist

or you

steady sparrow

Oh ok nvm

smoky scroll

well shit so to have spectate i do infact have to have that enabled right

for everyone

hallow dust

Does activity work with RPC?

noble pond

if you mean things like "Listening to" or "Watching to" instead of "Playing", only with selfbotting

hallow dust

Any idea why my VS Code won't work with RPC

Should I just reinstall?

dusk lintel

You should probably go to the actual server for the VS Code plugin. If you're using Crawl's plugin, then join discord.gg/4aFThGU

topaz cave

@hallow dust ^

formal skiff

Does anyone know if the underlying lib has a problem with Ubuntu? VSCode hasn't been working (ik it's crawls) but he suggested it could be the underlying lib

carmine mica

unix pipes don't care what flavour they run on

i would suggest checking who you run discord and vscode as

formal skiff

Right how would I check that?

(I'm new to Ubuntu)

crisp yacht

google m8

smoky scroll

?googleit

pure onyxBOT
                          _                           
   __ _  ___   ___   __ _| | ___   ___ ___  _ __ ___  
  / _` |/ _ \ / _ \ / _` | |/ _ \ / __/ _ \| '_ ` _ \ 
 | (_| | (_) | (_) | (_| | |  __/| (_| (_) | | | | | |
  \__, |\___/ \___/ \__, |_|\___(_)___\___/|_| |_| |_|
  |___/             |___/                          ```
atomic locust

?lol

pure onyxBOT

ŒŒ

atomic locust

?what

pure onyxBOT
return `wha${'ta'.repeat(10000)}`
formal skiff

@carmine mica I checked, they run as local user

storm venture

Hey there, quick question: what type of timeconfig are there for Rich Presence

craggy boughBOT
smoky scroll

anyone having problem with npm install discord-rpc ?

i keep getting this npm ERR! cb() never called!

hot sluice

no

test if u have node

run a cmd on ur console

smoky scroll

Yes i have it, i can run my node app @hot sluice

‘’Npm install discord-rpc@2.0.1’’ works but not when i take out the version

hot sluice

yea i got it

i had an error in my code i fixed it just never showed up on my terminal so i was confused

buoyant ice

?googleit

pure onyxBOT
compact grail

?help

pure onyxBOT

@compact grail, Sent you a DM with information.

hallow dust

Would I be allowed to do a very basic RPC thing that hooks in with d.js to make something like this?

*RPC status switches to the specified ID*```

or would that be considered a selfbot?

and I would get banned

carmine mica

if you have to use a selfbot for it

its a selfbot

hidden geode

when i try to auth i get this error, i do get the auth message in discord. but in de console it returns this

does anyone have an idea what i could be doing wrong?

const DiscordRPC = require("discord-rpc");
const clientID = 'CLIENTID';
const client = new DiscordRPC.Client({ transport: "ipc" });

client.on('ready', (e) => {
    console.log(`Logged in as` + client.user + `!`);
});

client.login(clientID, {scopes: ["identify"], clientSecret: "CLIENTSECRET"}).catch(console.error);

am i missing something?

cosmic stag

client.login('the token');

:/ ?

@DELUUXE#1608

ivory lava

Hi, can someone pls help me understand, What data i need to pass for OAUTH2 Authorization?
https://discordapp.com/api/oauth2/authorize?response_type=code&client_id=157730590492196864&scope=identify%20guilds.join&state=15773059ghq9183habn&redirect_uri=https%3A%2F%2Fnicememe.website

ivory lava

How can i pass this authorization?

smoky scroll

that hardly has anything to do with rpc or this library

ivory lava

Sorry could get it, this is for discord support right?

smoky scroll

not oauth support

which is what ur question is

crisp saddle

Hi @smoky scrollYouDidIt YouDidIt

smoky scroll

@crisp saddle this

green summit

hi

since discord got strict with selfbots, the RPC - rich presence is also not allowed right?

smoky scroll

rpc !== selfbots

its allowed to use this as you wish

green summit

ok thanks

smoky scroll

?googleit

pure onyxBOT
smoky scroll

someone tell me how do i fix the error?, and the timestamp shows?

random aurora

you just put, startTimestamp, never defining it

read

the error

smoky scroll

so i have to put a number?

random aurora

yes

smoky scroll

oooh

random aurora

oh no

smoky scroll

?

random aurora

you have it defined twice

in there

smoky scroll

where?

random aurora

the end

and the middle

smoky scroll

wait can u send a screenshot of how it would look like

random aurora

the second one ISNT defined

smoky scroll

oh

random aurora

literally

just

delete it

smoky scroll

k

random aurora

it tells you the line number

in the error

line 20

smoky scroll

ah-ha

wait

when i put the timestamp

does it show like

5:00:00 left or 4:00 elapsed

left or elapsed?

random aurora

you can literally run the code

smoky scroll

i did lol

k lemme try again

do i put anything in the parantheses?

random aurora

new Date() is the current date

smoky scroll

and end date, is the date when u want it to end?

random aurora

yes

it's called endTimestamp because that's the time it ends

smoky scroll

startTimestamp: Date.now(),
endTimestamp: Date.now() + 1337,

i ran that

random aurora

the second one should break

you're adding an integer to a Date

smoky scroll

do i remove "+ 1337"

cause that was a sample i found

random aurora

that doesn't make sense no

smoky scroll

from one of the chats

random aurora

maybe it does work

idk

but I don't think it would

smoky scroll

it showed me the error again

oml

random aurora

show me

the error this time

smoky scroll
random aurora

delete line 20

smoky scroll

k

random aurora

for like

the 20th time

delete it

then run it

smoky scroll

FFS FINALLY

random aurora

I said this

20 minutes ago

go check

smoky scroll

im deaf

random aurora

I said

smoky scroll

XD

what chat?

random aurora

delete line 20

this one

smoky scroll

wait how do i make it say elapsed

random aurora

ShowyMC (2) - Today at 4:14 PM
wait can u send a screenshot of how it would look like(edited)
! this again - Today at 4:14 PM
the second one ISNT defined
ShowyMC (2) - Today at 4:14 PM
oh
! this again - Today at 4:14 PM
literally
just
delete it
ShowyMC (2) - Today at 4:14 PM
k
! this again - Today at 4:14 PM
it tells you the line number
in the error
line 20

smoky scroll

instead of left

yah just saw

random aurora

no clue

smoky scroll

oh

random aurora

im gonna go do other things

smoky scroll

k

gl

minor ferry

anyone here know if your able to make your rpc green like spotify

mild ruin

not possible afaik

tall wasp

^

frail tiger

Anyone knows what's the code to finish a rpc connection?

frail tiger

?

latent tusk

can i have RPC and streaming status both in the same time?

smoky scroll

no

one will hide the other

latent tusk

ok rip

frail tiger

Hey guys, anyone knows what does the "instance" option?

steady sparrow

@frail tiger

frail tiger

Oh

Thanks

dusty totem

oof

outer lotus

RPC is AWESOME

latent tusk

how can i get RPC for my bot?

like

i dont know how to set it up

outer lotus

there's an example app that works great and showcases the basics

crisp kite

Could you maybe link that example showcase?

smoky scroll

channel topic

smoky scroll

this might be a dumb question, but what is RPC even mean?

ik it stands for remote procedural calls

but

what do they do?

frail tiger

Rich Presence

And I don't remember what the C means

normal basin

Rich Presence Client

minor ferry

It does something like that to your profile

that you can customize

check chnl topic

smoky scroll

jesus christ (sorry if im offending anyone) this is really complicated. i might do it another time.

@fast linden#0540

frail tiger

No

Really easy

The only problem I have is with disconnecting of rpc

I don't know why

hidden geode

is it possible to set richpresence when some visits my html website?

smoky scroll

yes

hidden geode

do you have a smal example or something to get me started? because i have no idea how to "requere" it

smoky scroll

no cause its not really in the scope of this server

hidden geode

okay, thanks

smoky scroll

im trying to download discord-rpc using npm install --save discord-rpc but its saying that git isnt installed, when it is. anyone have a clue as to how to fix this?

mortal wigeon

install git...

smoky scroll

I DID

mortal wigeon

reinstall

smoky scroll

I DID

dusk lintel

Restart PC?

smoky scroll

I DID

mortal wigeon

smash pc

smoky scroll

no u

marble basin

type git what does it say

formal skiff

For some reason everytime I try download RPC it gets so far and then stops

I found this repo on github with a simple client for RPC and I tried installing the dependencies but it never finished

marble basin

Why does using discord-rpc on my bot set the presence on my account?

dusk lintel

Because it connects to the currently signed in user

marble basin

So, I can't set it on my bot? 😦

dusk lintel

No

marble basin

rip

frail tiger

There's a separate RPC API for bots I think

smoky scroll

RPC, rich presence control?

dusk lintel

It's legit in the channel topic

smoky scroll

I've been told bots don't support RPC (yet)

crisp yacht

they probably never will

i mean they dont need it

they cant play games

or listen to spotify

plus iirc the rpc server runs on the discord client

minor fjord

Guys

I wanna know...

What is rpc exactly?

steady sparrow

Read
The
Channel
Topic

latent tusk

if i set RPC to myself, is it selfboting?

smoky scroll

no if you use this repo

latent tusk

ok

craggy boughBOT
oblique gorge

rekt

hallow dust
smoky scroll

I just created a new application on the My Apps page, but now my RPC client is dying when I use the Client ID

I'm using the discord-rpc module,

Just logging in

{ code: 4000, message: 'Invalid Client ID' }

discord-rpc isnt related to this

this is for support for snek's rpc module

specifically

👀

oh ok, well then the message is very obvious, the client id is wrong

thonk

did u use ur user id

No

I used the Application's client Id

maybe ur inserting it incorrectly then

not much i can do but read the error message 4 u

I did this exact thing about 3 months ago just with a different application I had created and it was working

I haven't changed anything except for the ID

yea so u probably dun goofed when inserting it

rpc.login(clientId), clientId = ...

that's not code

just

what I'm doing

could always log what ur inserting right above the method and verifying its the exact same thing and that its a string

oh

it wasn't a string

I haven't touched this project in months

Anyway

👌🏻

Thank you

np

formal skiff

I can't install RPC for some reason

Just gets stuck on this

split igloo

what the fuck is rpc ?

smoky scroll

read topic

split igloo

ah it's rich presence client

or remote procedural calls

storm thorn
smoky scroll
frail tiger

No

Only the bots can do that I think

molten wyvern

Hey folks -- having trouble finding what to do with discord-rpc for Windows/Unity setup. What the heck do I do with the /bin /include and /lib folders?

smoky scroll

if you're making a unity game you shouldn't be using the JS lib

pliant thistle

they're header files so im guessing you put them into your project folder

p sure its for c/c++ tho

craggy boughBOT
drifting wing

is it possible to use the RPC library for setting rich presence without konwing the user ID?

wanton spoke

Wdym

ebon sage

@drifting wing That's not the users id, thats your apps client ID from the devs page

also how the hecc do i use RPC

i'm not using the browser

drifting wing

ah

thats the client ID

okay

well thanks

craggy boughBOT
crystal vapor

hey guys anyone around that could help me out with rpc commands struggling with something

nimble crane

?ask

pure onyxBOT

Don't ask if you can ask a question, just ask it! If someone knows the answer, they'll do their best to help.

tired shore

.

torpid elbow

exists a way to prevent rpc's auto close when someone closes discord?

blissful zinc
rpc.setActivity({
            details: name.replace("&amp;", "&"),
            state: video.replace("&amp;", "&"),
            largeImageKey: 'netflix',
            smallImageKey,
            instance: false,
        });``` how do i make it say Watching?
smoky scroll

u dont

youll need a whitelisted application to do anything like that afaik

blissful zinc

oh 😦

how come discord bots can say it

smoky scroll

cuz discord said they can

¯_(ツ)_/¯

blissful zinc

oh shit waddup that magic

smoky scroll

@blissful zinc afaik

upbeat estuary
rpc.setActivity({
            details: name.replace("&amp;", "&"),
            state: video.replace("&amp;", "&"),
            largeImageKey: 'netflix',
            smallImageKey,
            instance: false,
        });
smoky scroll

why'd u repost

formal skiff

Why does RPC not work on Ubuntu 16.04? I'm trying to use crawl's vscode and he suggested it's the lib's fault

craggy boughBOT
formal skiff

mmLol

smoky scroll

rpc works fine on ubuntu

i know for a fact cuz i used the netflix rpc

smoky scroll

You need approved application in-order to use RPC

no you dont @smoky scroll

torpid elbow

exists a way to prevent rpc's auto close when someone closes discord?

smoky scroll

You don't because it's connected to discord

torpid elbow

ah ok thanks

craggy boughBOT
craggy boughBOT
half ice

how do i make a basic RPC application ?

smoky scroll

idk

smoky scroll

Why is not he going on?

Someone please?

Lm

Fixed

Huuh I do not see any package.json

craggy boughBOT
smoky scroll

how do i get the numeric combo in this snippet const client = require('discord-rich-presence')('180984871685062656');

supple trail

What is RPC?

mild ruin

look at the channel topic

spice saffron

@supple trail Remote Procedure Calls

craggy boughBOT
craggy boughBOT
crystal vapor

hey guys anyone around that can help me out

dusk lintel

?ask

pure onyxBOT

Don't ask if you can ask a question, just ask it! If someone knows the answer, they'll do their best to help.

crystal vapor

okay so i have this code if(command === "test"){ var add = "BHedVtixo153E4QCsF2NquhME6mDTSo8Ai"; var num = 1; client.sendToAddress(add,num); message.channel.send("send 1 coin test"); }

but i want to put var add and var num into one var is that possible

dusk lintel

That's not RPC related

crystal vapor

client.sendToAddress is an rpc command

dusk lintel

What does RPC stand for?

crystal vapor

i have no clue lol but im using bitcoin rpc

dusk lintel

Sorry but this is the Discord RPC channel

crystal vapor

alright thank you

craggy boughBOT
willow blade

um

hello

I'm trying to create Discord RPC for Netflix as chrome addon

and to include in it Discord.js I used webpack

but when I load it into Chrome

it shows me TypeError: t is not a constructor

and it is from discord

wait

here

do you know how to repair this issue?

willow blade

:/

willow blade

is it my fault or discord's

cuz I really don't know

:/

scenic forge

there is a way to use rich presence in discord.js and not at rpc ?

i guess this question as been asked alot, sorry

willow blade

@scenic forge here nobody will help you

I asked question and I’m still waiting

north shuttle

Is it possible for rpc to send messages as a user?

smoky scroll

rich prescence is only with the prescence of the user, u can't send or read any messages at all

no thats definitely not true

rpc isnt only for rich presence

but can you send messages? thinking

smoky scroll

not sure about sending messages specifically but you can act on behalf of the user in other ways at the very minimum with this library

craggy boughBOT
smoky scroll

I need help with rpc

So i launched everything

but how do i get it showing up on my profile

i am just confused

craggy boughBOT
craggy boughBOT
craggy boughBOT
gritty wagon

Is this trusted..

smoky scroll

dont see anything wrong with it

gritty wagon

So it's trusted.....and if anyone used it will not get ban or something else

My friend is worried about that !

solid light

Let me have a look

Looks fine

gritty wagon

Oh good my friend will be happy using it...

Btw do you know something similar to this @solid light

solid light

No I don’t

gritty wagon

Do you even use rpc

solid light

No I don’t

gritty wagon

Why

solid light

Haven’t had the need to yet I might check it out later

gritty wagon

Ok when you use it you will like it...

🙂

dim verge

Did someone say Role Playing Chat?

limber bluff

@dim verge lol

oblique gorge

@dim verge y u not in sarah's dc

dim verge

oh its Fartful!

that discord sucks

oblique gorge

i rejoined a few days ago

and it's just

randos i don't know

:l

dim verge

Yuh no one really uses it anymore 2bh

limber bluff

Lol

Im just lurking here

Listening in

When it's none of my business

mild ruin

look on their add-on/package page if they have one I guess

just use your common sense and Google it first

warm parcel

Will Richpresence work for bots, or no cause they have no actual discord program open?

smoky scroll

yeah it wont work for bots

warm parcel

thought so

rip

craggy boughBOT
craggy boughBOT
cerulean temple

how to use rpc?

smoky scroll

look at channel topic, theres an example you can copy paste

steady sparrow

Bella endorsing copy + paste

craggy boughBOT
smoky scroll

can i have something like this for my own song player or is that a "Trusted" app only thing

(the thing that shows how much of the song is remaining)

mild ruin

yes that's possible, i forgot how though

carmine mica

@smoky scroll it used to be available to all

it's just for sspotify now

smoky scroll

think it will come back when rpc is no longer in beta?

latent tusk

is there a tutorial how to make my bot have RPC?

pastel sphinx

not available for bots

bold badger

Hmm.. at one point I know Rhythmbot had a slider that updated every five seconds

'cept now it no longer seems to update, except when you give it the np command

steady briar

That's not RPC, that's an embed that's manually updated. Not relevant to this channel.

ripe minnow

So, question- how does Atom do rich presence without ever asking me to login with Discord?

I installed the extension and it just worked™

mild ruin

because the extension can access your local copy of discord, hence why bots can't use it I think

placid parcel

Hello how to modify the "Play to" of my Rich Presence?

placid parcel

Help !?

carmine mica

hi

near lynx

@placid parcel You can't change rich presence type to eg. "Listening" iirc

placid parcel

😦

slow ginkgo

<@&413754863726493697>

boreal atlas

I'm trying to find any kind of documentation for what can be put inside this, unless that's all of them...? If I'm blind and it's easy to find, my apologies

Never mind, found it

keen marlin

Glad I could help!

mild ruin

that a userbot?

Never mind, found it

k maybe not

keen marlin

???

near lynx

Userbot is when someone runs an app on normal account (without the BOT tag) and i don't think that's rpc question Thonk

keen marlin

It's also against TOS

So don't

mild ruin

I was saying that Cheithroid may be a userbot responding to the phrase "Never mind, found it"

keen marlin

^

smoky scroll

Stop making pointless comments @smoky scroll @Cheithroid#2928

craggy boughBOT
zenith edge

Unhandled promise rejection (rejection id: 2): TypeError: (timestamp - EPOCH).toString(...).padStart is not a function

any1 help?


rpc.login("398111176145502209");
async function updatePresence() {
  if (!rpc)
  return;
  let details
  
  let projectName = await win.webContents.executeJavaScript("$(\"#project_name\")[0].value");
  projectName = "" ? details = "Working on ${projectName}" : ""
  rpc.setActivity({
    details: details,
    state: "Modeling in blockbench",
    largeImageKey: "blockbench",
    largeImageText: "Blockbench - free modeling tool",
    instance: false,
  })
}

rpc.once('ready', () => {
  updatePresence();

  // activity can only be set every 15 seconds
  setInterval(() => {
    updatePresence();
  }, 15e3);
});

near lynx

Am i blind or that's not the part of the code that causes error?

zenith edge

well when i comment out all the rpc code i get no errors

smoky scroll

im like relatively sure that means u need to update node

zenith edge

could it cause electron is node v7??

smoky scroll

well padStart got introduced later, and ive used rpc just fine with electron, so

zenith edge

i found a padStart() pollyfill from MDN and now it works perfectly]

Tnx

glass tundra

I packaged discord rpc with webpack (hopefully correctly)

How would I used it in the browser.js form?

oblique gorge

@smoky scroll

cerulean temple

how to fix it?

near lynx

are you trying to run browser version on node?

cerulean temple

@near lynx node

carmine mica

@cerulean temple the browser example is for browsers only

cerulean temple

i try it it not working

carmine mica

@cerulean temple you have to run that example in electron

cerulean temple

what is electron @carmine mica

carmine mica

that which the example is designed to run in

cerulean temple

link to electron

carmine mica

google is unusable

cerulean temple

@carmine mica how?

how?

@smoky scroll where?

misty cipherBOT

Kicked Common its Java#9772

carmine mica

@cerulean temple npm run example

oh

cerulean temple

@carmine mica ok

@carmine mica

carmine mica

no i meant

in the rpc repo

where the example code is

smoky scroll

How I can set a image without adding it in assets ?

plain tide

you can't

smoky scroll

Would be cool if you could set URLS

smoky scroll

Hey guys

I'm hoping one of you will be able to help me

I'm trying to figure out how to make a continuous time elapsed thing kind of how the VS Code discord rich presence thing works

if (infos) { // if !infos don't change presence then.
        let {songName, author, progress} = infos;
        
        if (author) {
            if (previousSongName != songName) { 
                // start new time if songs have changed
                progress = new Date().getTime() / 1000;
            }
            else { 
                // otherwise pull the previous song progress and subtract it from new time
                progress = new Date().getTime() / 1000 - previousTime;
                
            }
        }
        
        previousTime = progress;
        previousSongName = songName;
        
        rpc.setActivity({
            details: songName,
            state: author
            ? `by ${author}` 
            : author,
            startTimestamp: progress,
            largeImageKey:'soundcloud',
            smallImageKey,
            instance: false,
        });

    }```

this is the code that gets ran in my update rpc function

it seems to work for the first few updates but then the time elapsed starts showing values that are way off in the 10,000s

the progress variable is what updates the startTimestamp in the rpc.setactivity

any ideas?

carmine mica

send time in milliseconds

smoky scroll

@carmine mica what do you mean?

smoky scroll

the thing is it works for the first two rpc updates

then it jumps down 10 seconds

then it goes up to an hour

then it goes back down

feel like i've been trying to debug this for months

smoky scroll

how is it even coming up with these random values

craggy boughBOT
smoky scroll

Uhh noob question here, is this possible in node?

is this node

it looks like it

also is the second part of the require, the bot user id?

hexed cave

Discord Bots can't have rich presence as far as I'm aware

smoky scroll

dw i realised its possible in node

uhh can they not?

hexed cave

It's for users I think

smoky scroll

Oh

So there's no bot rich presence

hexed cave

Don't think so

But there's watching, listening, streaming as the activity

hexed cave

No

smoky scroll

seflbots and users

hexed cave

You can use it standalone

Yes

smoky scroll

ok

smoky scroll

nice

thick sedge

large oof

smoky scroll

noposts

maiden jacinth

lol

raw holly

-ban 355982515489734657 hi spam

misty cipherBOT

Are you sure you want to issue this ban? (__y__es | __n__o)

raw holly

y

misty cipherBOT

Successfully banned pop#0953

thick sedge

Thanks Crawl

iron parrot

Owo

Finally a ping here and it's spam

Banned for spam

fringe imp

Looks like he really put himself...in a pickle.

Puts on sunglasses

YEAAAAAAAAAAAAAA

green spire

pong where

open bridge

how do u get accessToken? i thought localstorage getter is blocked

carmine mica

@open bridge that example goes on your own website not pasted into the discord client

but you can't use it anyway

you have to use ipc

smoky scroll

RPC = Roleplaying Community

inland wing

No

smoky scroll

Keep your shit posts out of here thanks @smoky scroll

smoky scroll

@upbeat skiff self deletes too

upbeat skiff

?

smoky scroll

dont spam self deletes. especially not here.

upbeat skiff

Oh...

I was just trying to get something to work

Sorry

smoky scroll

its ok

smoky scroll
            type: 'STREAMING',
            details:  ((playState&&playState===1)?"▶️ ":"⏸ ")+songName,
            state: author,
            largeImageKey:'soundcloud',
            smallImageKey,
            instance: false,
        })```
mortal wigeon

needs a vaild twitch url

smoky scroll

it stills show that I'm playing a game

I also did with LISTENING

same problem

mortal wigeon

client.user.setActivity('YouTube', { type: 'WATCHING' })

smoky scroll

oh thanks

regal vine
regal vine

Answer to my q. Yes.

smoky scroll

you need it

smoky scroll

nvm

smoky scroll
const DiscordRPC = require("discord-rpc");

const ClientId = '415099419592228864';

DiscordRPC.register(ClientId);

const rpc = new DiscordRPC.Client({
    transport: 'ipc'
});

rpc.on('ready', () => {
    console.log("ready");
    rpc.setActivity({
        details: `Developing Eskimo`,
        state: 'Writing',
        largeImageKey: 'logo',
        // largeImageText: 'logo',
        // smallImageKey: 'test',
        // smallImageText: 'test',
        instance: false,
    });
});

rpc.login(ClientId).catch(console.error);
``` Don't work

Mention me if you want to respond me

k

now work

Sometimes the rp isn't displayed in the list

pallid oracle

Is someone going to write RPC for brackets? Im really looking for it and its only one text editor without this feature and it supports extensions

sonic kayak

Is it possible to use RichPresence through a browser? This is being done through coherent UI (Chrome 28) and no same-origin policy.

fading fog

I'm devoloping an Electron app and I have two questions: 1. How to I use it in typescript ( i tried: import DiscordRPC from 'discord-rpc';) 2. Is there a methode that I have to call on close?

Is there any typescript definition file?

carmine mica

nope

not that i know of anyway

you should still be able to use it though

fading fog

It complains that it wasn't fount

carmine mica

¯_(ツ)_/¯

fading fog

I think I got it to work with the normal require for now

Is there a method that I have to call on close? or does it close automatically?

ah found it: .destroy()

fading fog

How do I make it like I can send invites in the chat but don't have an ask to join button in my Profile?

regal vine

You need to request that from your APP profile. It needs to be accepted by the Discord staff to have that feature though.

zenith edge

@sonic kayak you can do rpc in browser but I couldnt get webpack to export discord-rpc

sonic kayak

strajabot> Getting the library working isn't the problem. Establishing a websocket connection is the issue

zenith edge

Well since discrodjs is known to be working in browser with webpack and its discord-rpc's dependecy that does the websocket connections it should work

At least I think so 🤔🤔 someone confirm if im right

sonic kayak

discordjs uses a websocket to connect to the discord APIs

RPC is connecting to a local server. For rich presence, it seems that an IPC interface is needed.

zenith edge

@sonic kayak

sonic kayak

Yeah I know that the transport exists. It's just not possible to actually connect to the RPC over websocket without being whitelistsed.

you don't need whitelisting for an IPC connection

pallid oracle

Can i get somewhere code of visual studio code/atom rich presence?

I want to make extension for other text editor

weak holly
weak holly

Can Anyone tell me fir what is this RPC?
https://github.com/discordjs/RPC
As it is demanding a Voice Channel ID🤔
Please anyone help me! @carmine mica
I got redirected to ask here from TheIdiots Server

regal vine

<@&222089067028807682>

smoky scroll

sorry wrong server!

meager escarp

Is it possible to get the "playing line" for non-spotify rpc?

hexed cave

the progress bar?

regal vine

I think not.

meager escarp

yeah the progress bar

smoky scroll

i believe if you provide a start and end time, then itll happen.

carmine mica

nope

smoky scroll

Hello. I have some problems getting rpc working

Anyone that would be willing to help me out ?

carmine mica

sure

smoky scroll

Let me just grab the link

Starts on ln 70

I tried pinging some others websites and everything else worked.

carmine mica

rpc only runs on your local pc

the same pc your discord desktop client is on

smoky scroll

Right now how would I fix that

carmine mica

run your code on your pc

instead of instance-1

smoky scroll

Right. So that means I have to run it from my PC ?

carmine mica

yes

smoky scroll

Why can't I do it from the VPS

carmine mica

thats what i said twice now

because thats not how it works

smoky scroll

This is supposed to be for a bot, right ? Why should I be running it for a normal discord user. I just don't get it

carmine mica

its not for bots

its for users

smoky scroll

...

carmine mica

rich presence doesn't work on bots

smoky scroll

Why's there a section on discord developers page for it

carmine mica

because thats where the developer docs are

???

smoky scroll

Rich presence assets

carmine mica

yes

applications aren't just bots

you're thinking about this all wrong

smoky scroll

this is not rich presence channel btw

I was told to go here tho..

carmine mica

ntanis go away

smoky scroll

I think he is confusing rpc

Refered from other newbie libs

with rich presence

carmine mica

ntanis

go

away

@smoky scroll so

here's how rpc works

an oauth application is registered

this application contains assets

usually for games

like blizzard would have an "Overwatch" application

smoky scroll

Right.

carmine mica

then you can add images for the maps, characters etc

whatever your game has

then in your game you put code for rpc

which tells the local discord client "i'm playing this game on this map with this character etc"

so it grabs the assets you predefined

and shows them to all your friends

smoky scroll

How would I bring this to my discord "bot" or convert it to something that supports this

Yeah I get it

carmine mica

bots do not support rpc

smoky scroll

Ah. I was already excited about getting dynamic profile pictures for it :v

carmine mica

you can just change the profile pic

smoky scroll

For example the icon would change when it was assigning roles to someone or stuff like that

Wait.. can I ?

carmine mica

yeah but not that fast

fresh mortar

Any idea when the next beta will be out?

Need the clearActivity() method to shutdown the rpc properly. Until it's available I'm using the implementation directly.

rpc.request('SET_ACTIVITY', {pid: process.pid})

The method I had previously used since December is no longer working.

subtle knoll

I want to begin RPC where to start?

smoky scroll

@carmine mica you alive?

I need some insight on the RPC transport type

a.k.a the WS method

carmine mica

@smoky scroll huh

smoky scroll

from what I've gathered the WS should work for any app as long as you are in the whitelist until approval right?

carmine mica

mhm

smoky scroll

and you have access to all RPC calls

carmine mica

er

you have to be in discord's whitelist

not your whitelist

smoky scroll

last time I checked you just have to be in the app whitelist

but I can check

carmine mica

app whitelist is for invite features and such

smoky scroll

also is there a way to get discord-rpc onto a CDN?

carmine mica

discord whitelists who can use websocket separately

due to security concerns

https://unpkg.com/discord-rpc should work

but you won't be able to

smoky scroll

since I need to use it inside a chrome extension

carmine mica

sucks

smoky scroll

and that one is coded with old ass deps

carmine mica

they don't want you to do that

smoky scroll

hmm

smoky scroll

can you run RPC from a browser?

yes if your app is whitelisted

btw @carmine mica do you know any timeframe for when the RPC leaves closed beta or if our app can join in?

since rn for the extension a WS relay is needed to bypass the whitelist

craggy boughBOT
craggy boughBOT
craggy boughBOT
weak holly

NotLikeCat

craggy boughBOT
smoky scroll

hey guys so im getting an error

{ Error: connect ENOENT /run/user/0/discord-ipc-0
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'connect',
  address: '/run/user/0/discord-ipc-0' }
smoky scroll

anyone know

atomic socket

Can read the whole thing

carmine mica

@smoky scroll are you on ubuntu

smoky scroll

yes i am

smoky scroll

also im getting this error

    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/root/discord-rpc-spotify/node_modules/discord-rpc/src/index.js:2:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)```
smoky scroll

discord -rpc-spotify

@smoky scroll you know spotify has built in support for dicord presences

next cairn

How can I set up RPC?

For my bot using discord.js

smoky scroll

bots cant use rpc

next cairn

I've seen video on YouTube that some guy set up rpc, there is also setting for rpc in bot page on discord devs

Unfortunately he wasn't doing it on discord js

smoky scroll

like i said, its not for a bot

its for your client

you pass assets to an application though, which a bot happens to be

but the bot itself cannot make use of rpc

next cairn

I'm newbie at this stuff so I don't know how to do that lol

smoky scroll

as long as youre still not trying to get your bot to use it, then you can look at the channel description/topic here

next cairn

So, you say that I can't set it up?

smoky scroll

you cant for your bot

but you can for yourself, like on a user account:

velvet oak

how tho

smoky scroll

Look at channel topic

velvet oak

no idea

smoky scroll

Read it

comes with an example you can copy paste too

velvet oak

copy paste

to where

smoky scroll

if u dont know how to run a node app i suggest you look at some google tutorials

which is weird 'cause it even tells you how to

smoky scroll

😤 but node is some next level stuff. I could never learn that... 😤

craggy boughBOT
craggy boughBOT
craggy boughBOT
craggy boughBOT
craggy boughBOT
craggy boughBOT
median quail

e

smoky scroll

hey there fellers, trying to develop a brackets discord rich presence extension but having a lot of trouble getting the library to load
ive followed all the error instructions, tried everything
legit nothing will work
only on the first line lol

as you can see i have discord-rpc installed thru npm in the folder
im just on the first step here tryna get the shit to LOAD so i can actually make my extension ;<)

soft birch

hello there

trying to use the discord-rich-presence wrapper

example code works great

however, replacing the client ID on the first line with the client ID of my new app gives me an error

const client = require('discord-rich-presence')('180984871685062656');
 
client.updatePresence({
  state: 'slithering',
  details: '🐍',
  startTimestamp: Date.now(),
  endTimestamp: Date.now() + 1337,
  largeImageKey: 'snek_large',
  smallImageKey: 'snek_small',
  instance: true,
});```example code

must have been the largeImageKey and smallImageKey things

because removing them worked

hexed cave

You need to have uploaded pictures to the app and then use the set keys

@smoky scroll what's the error? I can't see it properly

smoky scroll

I got that part fixed. I gave up the plugin. The way Brackets manages Node stuff is unusable

hexed cave

Oh

regal vine

use discord-rpc

Also instance is deprecated and even if it wasn't, you don't need the comma after the last value

smoky scroll

Yeah so, every time I tried to run my program, it kept saying object.entries is not a function

could not fix it

and it was tied back to the discord-rpc

in some way

smoky scroll

this isnt java support

raw gale

Sorry :c

smoky scroll

no worries

tranquil charm

Does anyone know how to start a bot. My bot start command is now outdated.

Btw i used to use node .

pastel sphinx

node scriptname blobthonkang

strange pagoda

wrong channel OwO

pastel sphinx

^

carmine mica

@regal vine never tell people to change their code style while giving support

that's irresponsible and makes you look like a dick

tranquil charm

is there a help channel?

clear flint
unique skiff

POGGERS

POGGERS

covert raven

is RPC basically rich presence

this is my only question for this channel lol

carmine mica

@covert raven read topic

covert raven

k

unique skiff

POGGERS

smoky scroll
const DiscordRPC = require("discord-rpc");
const ClientID = '456826241933377539';
const snekfetch = require("snekfetch");
const rpc = new DiscordRPC.Client({ transport: 'ipc'});
const startTimestamp = new Date();
rpc.on('ready', () => {





    const request = require("request")

    url = 'http://api.vime.world/user/2760573/session';

    request(url, function (error, response, body) {
        if (error || response.statusCode !== 200) {
            throw error || new Error("Invalid status code");
        }

        const obj = JSON.parse(body);
        // ...
        console.log(obj);


        rpc.setActivity({
            details: `${body.user}`, //i tried everything here, JUST EVERYTHING
            state: `${body.message}`,
            startTimestamp,

            largeImageKey: `cat`,
            largeImageText: `Привет!`,

            smallImageKey: `smile`,
            smallImageText: `Я люблю САЛО`
        });

    });

});

rpc.login(ClientID).catch(console.error);```

why does it says undefined?

inland wing

It’s very obvious what he means

smoky scroll

😛

Thats what I use.

.-.

Heh, I dont use RPC. I dont know why Im here.

carmine mica

@smoky scroll use obj.user and obj.message

not body.user and body.message

@raw holly can you delete the video above

it links to some java shit

can i maybe have manage message perms here

smoky scroll

@carmine mica thanks, but have you seen into the URL?

carmine mica

yes

smoky scroll

I want to parse the username

carmine mica

its a string

smoky scroll

so I have to use obj.username, right?

or obj.user.username

carmine mica

@candid coyote ```js
const body = {"user":{"id":2760573,"username":"iKpudka","level":37,"levelPercentage":0.51013,"rank":"YOUTUBE","playedSeconds":1307656,"guild":{"id":107,"name":"Revenge","tag":"Life","color":"&6","level":55,"levelPercentage":0.3143406779661017}},"online":{"value":false,"message":"Игрок оффлайн"}}

const obj = json.parse(body);

${obj.username} ${obj.online.message}

candid coyoteBOT

@carmine mica

ecmabot.js:3
const obj = json.parse(body);
            ^

ReferenceError: json is not defined
    at ecmabot.js:3:13
    at Script.runInThisContext (vm.js:91:20)
    at /var/ws/run.js:46:25
    at Object.<anonymous> (/var/ws/run.js:72:3)
    at Module._compile (internal/modules/cjs/loader.js:678:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at createDynamicModule (internal/modules/esm/translators.js:54:15)
carmine mica

lol

smoky scroll

ikr

carmine mica

@candid coyote ```js
const body = {"user":{"id":2760573,"username":"iKpudka","level":37,"levelPercentage":0.51013,"rank":"YOUTUBE","playedSeconds":1307656,"guild":{"id":107,"name":"Revenge","tag":"Life","color":"&6","level":55,"levelPercentage":0.3143406779661017}},"online":{"value":false,"message":"Игрок оффлайн"}}

const obj = JSON.parse(body);

${obj.username} ${obj.online.message}

candid coyoteBOT

@carmine mica

undefined:1
[object Object]
 ^

SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at ecmabot.js:3:18
    at Script.runInThisContext (vm.js:91:20)
    at /var/ws/run.js:46:25
    at Object.<anonymous> (/var/ws/run.js:72:3)
    at Module._compile (internal/modules/cjs/loader.js:678:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
carmine mica

@candid coyote ```js
const body = {"user":{"id":2760573,"username":"iKpudka","level":37,"levelPercentage":0.51013,"rank":"YOUTUBE","playedSeconds":1307656,"guild":{"id":107,"name":"Revenge","tag":"Life","color":"&6","level":55,"levelPercentage":0.3143406779661017}},"online":{"value":false,"message":"Игрок оффлайн"}}

const obj = JSON.parse(body);

${obj.username} ${obj.online.message}

candid coyoteBOT

@carmine mica

'undefined Игрок оффлайн'
carmine mica

oh

obj.user.username

whoops

smoky scroll

So, this should be working, right?

I'm currently online via smartphone, so I can't really test it

carmine mica
const DiscordRPC = require("discord-rpc");
const ClientID = '456826241933377539';
const snekfetch = require("snekfetch");
const rpc = new DiscordRPC.Client({ transport: 'ipc'});
const startTimestamp = new Date();
rpc.on('ready', () => {
    const url = 'http://api.vime.world/user/2760573/session';

    snekfetch.get(url).then((r) => r.body).then((obj) => {
        console.log(obj);

        rpc.setActivity({
            details: `${obj.user.username}`, //i tried everything here, JUST EVERYTHING
            state: `${obj.online.message}`,
            startTimestamp,

            largeImageKey: `cat`,
            largeImageText: `Привет!`,

            smallImageKey: `smile`,
            smallImageText: `Я люблю САЛО`
        });
    });
});

rpc.login(ClientID).catch(console.error);
smoky scroll

Thank you <3

smoky scroll

Do anyone have a tutorial how i can make a rich?

smoky scroll

How can i make my own rich presence?

hexed cave

Check channel topic @smoky scroll

gritty spindle

Is there an example of a browser extension using RPC?

I saw the one on the github, but it doesn't explain much.

or rather, is it even possible to make a browser extension that uses RPC?

carmine mica

@gritty spindle you'll need permission from discord to use websockets

gritty spindle

eeeee this guy is using an express client

would that work?

carmine mica

uh

i dunno

gritty spindle

or will I need permission for that also Thonk

carmine mica

@gritty spindle only the official spotify rpc can do listening

coarse yacht

Hey, is there some way to check for a rpc of a bot

smoky scroll

Bots can’t have rich presence

coarse yacht

well I mean like the playing message

smoky scroll

Just presence

coarse yacht

yes

like this

smoky scroll

I said just presence

Use set activity method

coarse yacht

I mean can you check for that

smoky scroll

user.presence