#🧩-plugin-development

1 messages · Page 41 of 1

woeful plover
#

great no more stupid embeds for comments

cedar marsh
#

I'm probably gonna use crystal given that lib

dull magnet
#

ohh fire

woeful plover
#

okay I installed accessories api how do i add a button

woeful plover
#

or I could use interactions

green vessel
#

yesyes

frigid bay
#

finding a bug in a closed source video game that you didnt make and patching it yourself feels so powerful

potent fox
#

@dull magnet https://fxtwitter.com/dr_cintas/status/1734604588282794237 web developing will be dead soon alhamdulillah

The new Screenshot to Code from Vercel v0 is insane.

I just took a screenshot of a pricing table and it was converted into code using AI in seconds!

It even outputs the code and allows you to modify any specific parts.

▶ Play video
dull magnet
#

nop

primal lily
#

so I'm trying to give the catppuccin theme a translucent background

#

except none of the quickcss I'm using does anything

#

I even tried * { background: transparent } and it still doesn't work

potent fox
# dull magnet nop

I mean if you can feed primary secondary colors to LLM by just creating a design you can create the app ig

#

animations are still one thing tho

#

anyway do aoc

primal lily
#

ok so

#

setting color works for anything that hasn't had its color explicitly set it seems

#

which I'm guessing means theme happens after quickcss

stiff cargo
#

Seems like you need a selector with higher specificity

#

Or !important :D

primal lily
#

ah

#

ok interesting

#

it did something

#

but the window itself still isn't transparent

stiff cargo
#

Ah I haven’t read what you’re trying to do :3

primal lily
#

alright so

#

everything is indeed transparent

#

except the window

#

but the window should be

#

it has HUD vibrancy

#

and it's transparent for about a second during start

woeful plover
#

I need help what do I add here to make a modal

 addButton("comment", message => {
            return {
                label: "Comment",
                icon: InfoIcon,
                message,
                channel: ChannelStore.getChannel(message.channel_id),
                onClick: () => {
                    openModal(props => {
                        return ();
                    }
                    );
                }
            };
        }
        );
#

I tried all findable examples it only errors

dull magnet
#

look at other plugins that open modals

woeful plover
#

they all use a modal class

#

const key = openModal(modalProps => (
<LogModal
modalProps={modalProps}
close={() => closeModal(key)}
/>
));

#

for example

#

stilll brings me no where as idk how to define that

primal lily
#

ayy I did it

dull magnet
primal lily
#

now

dull magnet
#

just do the same they're doing

primal lily
#

is there a way to change background opacity while keeping the rest of the background color?

woeful plover
#

wait I got it

plush parcel
potent fox
#

I think its open to everyone now

#

and everyone gets free 500 credits

plush parcel
#

is it?

plush parcel
#

ok v0 sucks

#

without an image ref it makes every result look like vercel

#

webdev is saved 🙏

#

also not even ai can figure out how to align shit properly

woeful plover
#

my code so bad chatgpt needs to fix it

woeful plover
#

okay it was the extension

#

I made it a tsx and now it shows

#

I also hacked in discord messages

#

into the modal

#

im using the embed html of discord

potent fox
#

merge already

hoary sedge
#

is there an existing plugin to hide actions on hovered messages? like reply and create a thread. migrating from betterdiscord and it's the only replacement I've been unable to find
sorry if wrong channel to ask

dull magnet
#

u don't need a plugin for that

#

99.9% of the times u wanna hide something, you can do it with just css

hoary sedge
#

ah yeah true

#

any chance you know the names of the message hover buttons? and/or where to find that out myself

dull magnet
#

inspect elements

hoary sedge
#

jfc that definitely would work thanks completely forgot I could do that brainBasket

dull magnet
#

you'll have a hard time selecting them because they only show on hover, f8break is your friend though

hoary sedge
#

oh I got it sorted dw, brain just short circuited for a moment

broken mesa
#

is there a way to make custom labels like these?

floral plaza
#

the Tooltip component

broken mesa
#

ty

dull magnet
#

❯ make std_spec compiler_spec
Using /usr/bin/llvm-config [version= 17.0.6]
./bin/crystal build -D strict_multi_assign -D preview_overload_order -Dwithout_interpreter --exclude-warnings spec/std --exclude-warnings spec/compiler --exclude-warnings spec/primitives -o .build/std_spec spec/std_spec.cr
Using compiled compiler at .build/crystal
.build/std_spec --order=random
.build/std_spec: symbol lookup error: .build/std_spec: undefined symbol: __libc_start_main, version spec/std/float_printer/shortest_spec.cr:192
make: *** [Makefile💯 std_spec] Error 127

#

FEAR

austere mauve
#

Makefile💯

dull magnet
#

LOL

#

line 100 moment

woeful plover
#

beleve it or not its the second coding language I ever touched and the first one I did more then goof around in

dull magnet
#

no C

woeful plover
# dull magnet no C

yea I learned to dislike it an little bit after finding better coding languages that are easier

woeful plover
#

it is quite funny how I first started with pascal then directly moved to C/C++,then java and later python and javascript/typescript

#

unlike the C++ that I learned so long ago that I do not know how I did it I still remember the first day I touched python

#

as well as some early bot projects I learned JS for

#

@stark topaz would likely remember the SWR Moderation bot me and her sister worked on

#

it long is gone but it was fun

stark topaz
woeful plover
#

I tought you only know HTML skulldance

woeful plover
#

makes sense

astral peak
#

(that’s what 127 means)

astral peak
#

…or missing lib?

dull magnet
#

it literally says undefined symbol: __libc_start_main

#

which means it tried to run/compile/link (dunno) something that doesn't have an entry point (main method)

astral peak
#

wait then why tf does it return 127

#

thought that was from the shell lol

frigid bay
timid trellis
#

hey this isn't technically a vencord question but all the smart ppl are here so i'm gonna ask. i'm connecting to discord's voice gateway in a browser and im successfully doing everything until i get to opcode 4 (session description), where i'm trying to call setRemoteDescription on my RTCPeerConnection, but it throws with the following error:
Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to parse SessionDescription. m=audio 50001 ICE/SDP Expect line: v=

looking at the sdp which the voice gateway provides, it doesnt start with v=. am i using the wrong method? i'm unfamiliar with webrtc so go easy on me lol

viral roost
timid trellis
woeful plover
thorn bramble
#

anyone good with java here that can tell me why should i use a Condition object over an AtomicBoolean? they seem to be the same thing, the former having more context aware methods

dull magnet
#

ive never heard of condition before

#

but always just used AtomicBoolean

#

seems subjective? just use whichever you prefer

dull magnet
timid trellis
#

for now, just receiving

dull magnet
#

ah

timid trellis
#

after some more reading, apparently discord uses some fucked up form of webrtc which isnt actually p2p? im so confused now

#

how did they implement it in the web app then

dull magnet
#

it uses webrtc

#

their desktop app uses some other stuff

#

@clear parcel will probably be able to help u

timid trellis
#

i just dont get how you actually connect via webrtc

#

both chromium and firefox are refusing to parse the sdp provided by the voice socket

timid trellis
#

i think

potent fox
#

yes

timid trellis
#

cool lol

#

this webrtc thing is still stumping me, are there any example implementations of it?

#

for discord, i mean

timid trellis
#

i dont blame you

#

this shit is a nightmare

#

mozilla couldn't be bothered to write proper docs for it and half of the api remains unimplemented in firefox

glass oracle
timid trellis
#

a lot of people are asking for it, there's no option for holding off

#

udp looks more complicated anyway

#

unless it isnt? i wouldnt know

glass oracle
#

i wanted to doc voice and gw but i have studies to take care of

glass oracle
#

you just have to handle rtp and rtcp packets
a bit of decrypting and opus

glass oracle
#

there's also a chrome thingy for debugging webrtc

#

chrome://webrtc-internals

timid trellis
#

oh im not sending select protocol, i forgot to lol, sorry

glass oracle
#

yeah you do select protocol after ip discovery and you have a connection

timid trellis
#

@glass oracle any idea why its refusing to decrypt? everything looks ok (all data is the right length, nonce is there, sequence is there, timestamp is there, etc)

#

im using libsodium.crypto_secretbox_open_easy, and the encrypted audio im trying to decrypt already excludes the nonce

#

oh does it only support xsalsa20_poly1305?

#

I FIGURED IT OUT

#

THE NONCE NEEDS TO BE PADDED WITH 24 NULL BYTES IF ITS UNDER 24 BYTES LONG

glass oracle
#

yes the nonce is 4 bytes and there are null bytes to conform with the required size as per the encryption algorithm

#

although different encryption algorithms have different payload structures (excluding the rtp/rtcp headers, that's universal)

there are some unknown encryption formats like aead_aes256_gcm and xchacha variants

#

aead_aes256_gcm is what the client uses (if you're able to figure out the payload format then I'll be very happy if you contribute that knowledge to userdoccers :))

timid trellis
#

maybe if i ever get some more experience, i'd love to contribute to userdoccers sometime

#

opus is the same as ogg right? im so so so close, ive managed to decrypt the audio data but i dont know how to play it back to verify that its working

timid trellis
#

ok ok so

#

im receiving the voice data

#

im decrypting it

#

i think

#

it doesnt error and gives all the proper data

#

but the opus it outputs seems to be invalid, unless im missing something

timid trellis
#

ok ok

#

so

#

ive found this module

#

to decode opus

cedar marsh
#

Ffmpeg

timid trellis
#

but unfortunately it seems to think the data is corrupted

signal wren
timid trellis
#

even though it isn't, and i know it isn't because the decrypted audio is 0xF8, 0xFF, 0xFE when its silent

signal wren
#

Thank you very much

timid trellis
#

im gonna just like

#

re explain my issue

#

since like

#

its gone from the chat now

#

ok so basically:

  • i am connecting to discord's udp voice servers
  • this is all successful
  • all data received is decoded properly (the timestamp is a timestamp, the ssrc is correct, the sequence number increments properly, the version and flags + payload type are fine)
  • the audio is successfully decrypted using xsalsa20_poly1305, the nonce being everything before the audio data as a buffer, padded with zeros after the data if its less than 24 long
  • using discord.js's OpusEncoder to decode the decrypted audio complains that its corrupt

so why is it complaining about that?

#

also, for some reason, it successfully decodes silence (which is always 0xF8, 0xFF, 0xFE as it should be per userdoccers)

glass oracle
timid trellis
timid trellis
#

sorry wasn’t fully awake when i said that so i couldn’t actually respond properly

#

is this not what i’m supposed to be doing? how can i play the audio data

tropic galleon
#

Voice is a pain tbh, i have an old thing that barely worked iirc

#

Let me find it

#

Oh its for receiving, misread, mb

glass oracle
#

there's also discord.js-self-v14 (13? 12? i forgor) which you can take a look at for voice

timid trellis
#

which i don’t think it’d handle

glass oracle
#

haven't really tried audio playback myself

timid trellis
#

damn

#

any idea how u might get it to play? any more details about the format other than that it’s 48khz stereo opus?

#

even just writing it to a file would be enough for me to know what to do but obviously writing the raw audio packets decrypted shows as invalid

timid trellis
#

@glass oracle figured out the decoding issues, i had to remove the first 12 bytes

#

trial and error goes hard

glass oracle
#

lol

timid trellis
#

i’ll put my findings on userdoccers when i’m home since examples can help a lot of people

glass oracle
#

👍

ripe void
#

how possible are folders inside favorite gifs tab?

#

or a random gif selector

#

the random gif selector shouldn't be too hard, Discord stores your gifs right?

timid trellis
#

@glass oracle alright final findings

#

after some more tinkering

#

the header size is 8, not 12

#

so subarray 8 and the decrypted buffer length

glass oracle
#

kinda differs for different formats

timid trellis
#

you have to strip the header before letting it decode

glass oracle
#

yeah

#

rtp header is not a part of opus data

woeful plover
#

I did my best on the modal it is kinda bad looking SKULL_SKELETON

runic talon
#

like I get what it does

#

but how do you... make use of it

woeful plover
#

its for commenting on messages

runic talon
#

yeah that much I know

woeful plover
#

its handy for channels you cant talk in or to add notes to a message

#

later I wanted to make it sync

#

the icon can be used for other stuff

#

so I just updated Icons.tsx

runic talon
#

so it's basically user notes but for messages

#

though not sure why you'd need more than one note

#

also MessageNotes would be a way less confusing name if that's what it's for

#

I don't get why you'd want a comment-like UI for it either

#

it somewhat implies that the comments are public

modest wind
#

Hi! i was wondering how the muteNewGuild plugin worked, especially how does it mutes channel exactly? i want to make the same plugin but instead of muting guilds it enables the "Show Alll Channels" discord feature when an user joins a guild.

#

i'm a beginner btw lol

modest wind
#

i know... but i don't understand how it modifies notification settings

#

what is updateGuildNotificationSettings and is there something like it to not modify notification settings but the show all chnnels setting specifically

dull magnet
#

yes

#

updateGuildNotificationSettings is a function from discord

#

reverse engineer the show all channels toggle to find out how to do it

#

react devtools will help

woeful plover
#

is there a variable to see the discord install location

#

I wanted to make a saving system for comments

#

or I could use datastore

modest wind
glass oracle
#

rini

#

minor amount of optimizations

green vessel
#

omg rust

austere mauve
#

codegen backend cranelift

#

fear

#

oh that's neat actually

#

checks docs
unstable

#

LET ME HAVE FAST COMPILES

woeful plover
#

Updated my PR for my plugin

#

I made the comments save and the UI look not like it been designed by a idoitbruhdogo

frigid bay
woeful plover
#

it is functional

#

even after reloading

dull magnet
#

i tried looking at more issues to contribute but they're mostly confusing GanyuDizzy

minor jolt
#

based

#

does discord do somethjing weird with the mic mediastream under the hood ?

#

i override getMediaDevices to return a webrtc stream and i can hear it fine in the audio test

#

but others can't hear me in vc

#

sometimes if i play around with it a lot, turning audio stream on and off they can hear me

#

but then it breaks again

#

voiceActivityInput in the mediaengine becomes null sometimes

minor jolt
#

so it's not messing with those at least as far as i can tell

#

oh nvm it sets the track to disabled wtf Thunking

amber basin
#

look at how rnnoise did it before it was removed

timid trellis
#

does anyone know how exactly discord records your voice to be sent?

#

im using a udp connection instead of webrt

#

c

dull magnet
#

like how it records the audio from ur mic?

timid trellis
#

yeah

#

aside from just

#

using the web audio api

#

i understand that part

#

but atp ive committed to using udp

#

and ive got it all working but not with speaking

dull magnet
#

well probably some audio recording library

timid trellis
#

im assuming theres some rtc api which does it for them

dull magnet
timid trellis
#

would be perfect if i wasnt writing in js

dull magnet
#

or find a different library in C / friends

timid trellis
#

is it too late to admit that i dont know rust

minor jolt
#

lmao so ok i was able to narrow it down

#

basically, besides audio test muting the track sometimes idk whats up with that

#

for some reason in vc, other's can't hear me

#

unless someone else speaks in vc first

#

like if someone else triggers the green ring, then my "mic" works

#

and it has this problem on both ptt and voice activation

rocky jackal
#

also is it just me or does crystal's syntax look like python?

#

nvm python is nowhere near that level of actually functional code

#

(anything is better than python imo)

minor jolt
#

it's ruby

#

not python

dull magnet
#

oh

#

crystal/ruby are good oop

#

oop but you can write purely functional code

#

just like js

#

it's cozy

#

and they're very callback / inline func based

minor jolt
#

nvm cant figure out whats wrong lol

#

btw @dull magnet i threw out all the weird hacky steam proxy code i was doing so custom vencord build isn't needed anymore

#

and webpack should never break again

rocky jackal
timid trellis
#

hello so im having a NEW issue with voice

#

so i've got the mic data sending

#

apparently its recording at 48khz, 2 channels and a bitwidth of 16

#

but it only plays in the right ear on the official client and is also low pitched

#

if i change it to 48khz / 2 the pitch is corrected but its still in one hear and stutters even worse

cedar marsh
#

what the fuck twitter

green vessel
#

JSON

dull magnet
#

okay so

const id = await getVirtmic();

if (id) {
    const audio = await navigator.mediaDevices.getUserMedia({
        audio: {
            deviceId: {
                exact: id
            },
            autoGainControl: false,
            echoCancellation: false,
            noiseSuppression: false,
            channelCount: 2
        }
    });
    audio.getAudioTracks().forEach(t => stream.addTrack(t));
}
#

i did this in the console and confirmed that audio is indeed stereo @trim cedar

#

but it doesnt actually work

trim cedar
#

Probably a discord limitation then?

dull magnet
#

nahhh

#

why would it be

trim cedar
#

Or what do you mean

dull magnet
#

but smth is going wrong

trim cedar
#

Yeah not sure if it's something I'm doing

#

But I just forward the channels as is

#

So I don't think that venmic is the problem here but I'll have to test if there some pipewire quirk at play

#

Will do in a sec

dull magnet
#

like i said it works

#

i tested in console

#

its stereo

#

issue in the js somewhere

trim cedar
#

Wait you tested it in the stream?

#

And the stream was stereo then

#

Sorry my brain is dead today lmao I think I misunderstood your message the first time xD

dull magnet
#

i tested it in the console

#

playing the track in the console

#

it was stereo

trim cedar
#

ah ok got it

#

where's the vesktop code that reroutes the screenshare?

dull magnet
#
navigator.mediaDevices.getDisplayMedia = async function (opts) {
        const stream = await original.call(this, opts);
        const id = await getVirtmic();

        if (id) {
            const constraints = {
                deviceId: {
                    exact: id
                },
                autoGainControl: false,
                echoCancellation: false,
                noiseSuppression: false,
                channelCount: 2
            };

            const audio = await navigator.mediaDevices.getUserMedia({
                audio: constraints
            });
            audio.getAudioTracks().forEach(t => {
                stream.addTrack(t);
                t.applyConstraints(constraints);
            });
        }
        return stream;
    };
#

this is what i got rn

#

no luck

trim cedar
#

Is stream.addTrack also called twice?

dull magnet
#

wdym

#

oh wait im dumb

#

t is ours

trim cedar
# dull magnet wdym

Just wanted to make sure that audio.getAudioTracks also yielded two tracks in case the tracks are split into FL/FR

dull magnet
#

oh

trim cedar
#

hmm

dull magnet
#

try it urself

trim cedar
#

Will do in a sec I'm too dumb to calculate the poly lines for an arrow placement rn lmao

dull magnet
#
const a = new Audio();
a.srcObject = await navigator.mediaDevices.getUserMedia({
    audio: {
        deviceId: {
            exact: (await navigator.mediaDevices.enumerateDevices()).find(d => d.label === "vencord-screen-share").deviceId
        },
        autoGainControl: false,
        echoCancellation: false,
        noiseSuppression: false,
        channelCount: 2
    }
});
a.play()
#

it works

#

so theres smth wrong with our patch

#

or smth in discords code

#

heres the patch

#

i added channelCount: 2 in constraints

#

inb4 its actually a discord limitation

trim cedar
#

Is it stereo on windows?

dull magnet
#

yes

#

but desktop app doesnt use webrtc

#

they use their own udp shit

trim cedar
#

True

dull magnet
#

actually

#

@amber basin i think u were messing around with stereo stuff on web

trim cedar
#

Wait

#

Does Vesktop even support Audio on Windows currently?

dull magnet
#

yes

#

via electron api

amber basin
#

nop

trim cedar
amber basin
#

i was doing soundboard on web

dull magnet
#

test

amber basin
#

with the same thing rnnoise did

trim cedar
#

Or maybe easier

#

Is anyone here using Vesktop on Windows right now?

frigid bay
#

no but i think i could get it real quick

trim cedar
#

that would be amazing

frigid bay
#

i dont know js/ts is that ok

trim cedar
#

yeah doesn't matter

frigid bay
#

okay 1sec

#

do i need a mic too

trim cedar
#

no

frigid bay
#

or is it screenshare related or

trim cedar
#

screenshare

frigid bay
#

screensahre is fine but i can't use mic

#

okay

#

okay sending this from vesktop

trim cedar
#

alr I'll join join = explod feel free to join and just screenshare this video: https://www.youtube.com/watch?v=6TWJaFD6R2s

You can check your Headphones (Kopfhörer) or your speakers (Lautsprecher). This ist thought of being useful for 2.0 or 2.1.
You can find other Sound Tests in my channel or my playlist.

My 2.1 Sound System: https://amzn.to/2Fohap1

My Bluetooth Speaker: https://amzn.to/2K7GkXB

My Headphones: https://amzn.to/2DqX3Ee

My Midi-Controller: https://...

▶ Play video
frigid bay
#

alright

#

1 sec

#

is it working fine

#

audio should be there

#

just streaming mpv

trim cedar
#

Yeah it's mono

#

You only hear it on one ear right

frigid bay
#

yeah

trim cedar
#

Alr thanks!

frigid bay
#

lol

dull magnet
#

i listened to it for like 30 minutes alr

trim cedar
#

Lmao xd

dull magnet
#

did u find that independently or from me

trim cedar
#

just searched stereo test on youtube

dull magnet
#

hahaha

#

we had the same idea

#

i did the same

trim cedar
#

xD

dull magnet
frigid bay
#

🍄

trim cedar
#

I'd happily take that mushroom

dull magnet
#

anyway uhh

#

idk how to proceed

#

its really hard to know if this is a limitation from discord's side or smth in their code or what

trim cedar
#

Yeah

dull magnet
#

do u know how to debug webrtc

trim cedar
#

No idea lmao

dull magnet
#

like how to check what packets its sending

dull magnet
trim cedar
#

I think one of the "easiest" approaches would be to just port the Windows module

dull magnet
#

huhh

trim cedar
#

Problem is that on linux all of the modules functions are stubbed

#

They literally do nothing so I can't even port it

dull magnet
#

do u mean like use their native thing

trim cedar
#

Yeah

dull magnet
#

discord_voice

#

thats painn

trim cedar
#

Well I mean

dull magnet
#

@tall kiln reimplement discord_voice blobcatcozy

trim cedar
#

I only need to hook the screenshare stuff I suppose

tall kiln
#

nop

dull magnet
#

on web it uses WebRTC

you have two connections, one for mic, one for screenshare / camera

#

on desktop it functions differently

trim cedar
#

We can have some frankenstein thing where we only make the screenshare go through the module

#

Depending on how fucked that is

dull magnet
#

@gritty sparrow @clear parcel does Discord's WebRTC channel for screenshare accept stereo audio

trim cedar
#

Bro I cannot get this fucking arrow right

#

What is wrong with me

dull magnet
frigid bay
#

if for some reason you want me to test a windows build then i'll be up for at least like 4 more hours

#

just @ me then

trim cedar
#

Could you maybe get me this folder from the normal (not vesktop) discord client?

I think it's in appdata somewhere on Windows

dull magnet
#

we'd have to reimplement the udp connection

#

so much effort and maybe risky

trim cedar
#

Not screenshare right?

dull magnet
#

it functions the same

trim cedar
#

Ah alr

frigid bay
#

do i just 7z this and send it in dms/here?

trim cedar
#

DM would be fine, and yeah any archive is fine

frigid bay
#

alright

trim cedar
#

Thanks!

dull magnet
#

chrome://webrtc-internals

#

how do u open this in electron

frigid bay
#

if i miss a message then you can @ me i don't mind, i almost didn't notice

trim cedar
dull magnet
#

horror

frigid bay
trim cedar
#

My downloads folder is just a massive PDF Dump holy fuck

#

Fucking Lecture Slides :(

frigid bay
#

do you like, need help reversing the node module maybe?

trim cedar
#

If you know IDA / Ghidra sure

#

But I think I can manage that as well

frigid bay
#

yeah i just don't know node or anything

dull magnet
#

how do u debug webrtc in devtools

frigid bay
#

i'm pretty bored i might as well see what i can find idk

trim cedar
#

UC File Analysing should've paid off enough to get this done lmao

frigid bay
#

lmao

#

ida 8.3 with hex rays decompilers leaked recently

trim cedar
#

Yeah saw that

frigid bay
#

which is pretty nice

trim cedar
#

Already grabbed it

#

But I'll need to harden my bottles flatpak for that before I use any of that lmao

dull magnet
trim cedar
#

Nice

frigid bay
#

well i could reverse the module but i don't really know what i'm looking for sooo

dull magnet
trim cedar
frigid bay
#

alrighty

dull magnet
#

idk how to read this

#

so it seems to send stereo

#

which would mean server side restriction?

trim cedar
#

Not sure if this helps at all

#

But judging from that so question

trim cedar
# dull magnet

the sdp thingy should include some info on stereo/mono as well

timid trellis
#

does anyone here know what might be causing stuttering when sending voice packets

#

like stuttering on the client side not from the sender

dull magnet
#

it do be sending stereo tho

trim cedar
#

hm yeah that looks good

dull magnet
#

so seems to be server side restriction maybe?

trim cedar
#

Probably

dull magnet
#

holy shit this is good music

#

i clicked some random video

dull magnet
dull magnet
#

wait

#

noah can u stream smth to me

trim cedar
#

sure

timid trellis
#

less stuttering, more cutting out for about half a second every half a second

dull magnet
#

maybe i can check ur stream in the debugger

#

and see if its sending me stereo (doubt)

trim cedar
#

holy fuck xD

#

Yeah sure

#

I'm in voice

timid trellis
#

i’m probably getting a lot of the parameters wrong for sending voice packets because there’s such little docs on them

trim cedar
#

Sec

#

Can't find firefox in the window selection lol

dull magnet
#

LOL

#

noob

#

just share entire screen

trim cedar
#

Got it

dull magnet
#

can u start and stop ur stream

green vessel
#

does anyone know how to change the text color of my username

dull magnet
#

@trim cedar

trim cedar
#

ye

dull magnet
#

a=rtpmap:102 H264/90000

#

thats a no ig?

#

wait thats video

#

im dumb

trim cedar
#

xD

dull magnet
#

a=rtpmap:111 opus/48000/2
a

#

this is audio

#

well idk if thats urs but whose else would it be

green vessel
#

hey sillyvee can u help me rq

trim cedar
#

That looks like stereo

#

What the fuck

#

Are discords servers merging this?

dull magnet
#

the thing is it doesnt look any different from mine

austere mauve
#

window selection for me only shows the windows on the current desktop

frigid bay
#

do u need official client screenshare to compare against?

austere mauve
#

so good

frigid bay
#

would that be of any use

trim cedar
dull magnet
#

well uhh

frigid bay
#

i can do that

dull magnet
#

idk im gonna stop debugging for now cuase im tired

#

but

#

u can continue

trim cedar
#

I have no idea how to get that up

dull magnet
#

go into src/main/mainWindow.ts and slap this under initArRPC:

const w = new BrowserWindow();
w.loadURL("chrome://webrtc-internals");
frigid bay
#

@ me if you're ready i'll screenshare whatever i'm watching on yt or the stereo test or whatever

dull magnet
#

its quite funky

frigid bay
#

using the official client with vencord installed

trim cedar
dull magnet
#

they dont contain much info

green vessel
#

hey can someone help with css

#

rq

dull magnet
#

setRemoteDescription is the one that has the stuff

#

but its like identical for yourself and others ?

#

idk how to use the dashboard tbh xd

trim cedar
#

xD

dull magnet
#

its so weird

#

there will be two

#

one is just audio (the first one) the other has both video and audio

#

u can easily tell which one is which by scrolling down and checking codec

trim cedar
#

This fucking arrow is finally positioned right

#

How did that take me so long

dull magnet
#

maybe we should check whether discord-screen-audio has stereo

trim cedar
#

I realldy doubt that

proud parrotBOT
dull magnet
#

does this mean it doesn't

trim cedar
#

Yep

dull magnet
#

apparently it works on firefox

trim cedar
#

Wait

#

This is a Chromium limitation???

dull magnet
#

oh wait nvm

dull magnet
#

in dsa

#

i skimmed too fast xd

trim cedar
dull magnet
trim cedar
#

Although it is pretty interesting to see that it works fine with Firefox

#

This is really interesting

#

Wanna do a BigBlueButton Conference to test stereo this week lmao

dull magnet
#

i think the person who opened the issue means other people's streams are mono

#

cause why else would fhey refer to a music bot

trim cedar
dull magnet
#

doubt

#

i don't think firefox has audio screenshare does it

trim cedar
#

Oh yeah I think that's it

#

So they're talking about incoming audio

dull magnet
#

yeah

#

i think everyone misunderstood

#

malte as well xd

#

anyway soo it's probably just a server side restriction when using webrtc

#

i pinged dolfies and friends, maybe one of them can help

frigid bay
trim cedar
#

Thanks! But I think this is something that'll be harder to get to the bottom of

frigid bay
#

i see

#

well if i can help test something then let me know! im not gonna be doing anything important i don't think

dull magnet
timid trellis
#

it’s shocking how bad the udp voice server docs are

#

what exactly is the timestamp and increment supposed to be? why does the increment start on a different value for each user? what format is the timestamp in??

dull magnet
#

like official docs?

cedar marsh
#

its formatted in dumb

timid trellis
#

though userdoccers doesn’t list any more detail about what exactly is supposed to be sent

#

i get the feeling the stuttering comes from the timestamp and increments being wrong somehow because the stuttering changes when i change the timestamp increase rate (which is a temp thing while i figure out wtf it is)

trail ginkgo
#

music bots and screenshares can have stereo audio tho

#

whaa

dull magnet
#

yes

trail ginkgo
#

oh i was misreading

glass oracle
glass oracle
#

this is stated in the spec somewhere

#

the ts doesn't need to be unix afaik

#

The timestamp reflects the sampling instant of the first octet in
the RTP data packet. The sampling instant MUST be derived from a
clock that increments monotonically and linearly in time to allow
synchronization and jitter calculations (see Section 6.4.1). The
resolution of the clock MUST be sufficient for the desired
synchronization accuracy and for measuring packet arrival jitter
(one tick per video frame is typically not sufficient).

#

An implementation is not required to run the Network Time Protocol in
order to use RTP. Other time sources, or none at zall, may be used
(see the description of the NTP timestamp field in Section 6.4.1).
However, running NTP may be useful for synchronizing streams
transmitted from separate hosts.

#

lmao ntp will wrap to 0 in 12 years

cedar marsh
glass oracle
timid trellis
glass oracle
#

yes the header is a well defined spec

turbid spruce
#

how does one add ⁣‍⁢‍⁡‌⁢‍⁡⁢‌⁡‌‍⁡⁣⁣‍⁤⁡‌‌⁣‍⁡⁢⁣‍⁢⁡‍⁡‌⁢⁣⁡‌‍⁡⁡‌‍⁡‌⁤⁤⁢⁡⁡⁡⁤‌‍‌⁡‌⁤⁡⁢‍⁡‍‌⁤‍⁢‍‌‍‌‌⁢‌⁡‌‍⁢‍⁡an indicator like the invisible chat plugin for a certain messsage by id?

#

like this

turbid spruce
#

didnt help

glass oracle
#

message accesssories

turbid spruce
#

nvm i got it

turbid spruce
#

this is what i got but is there any way to dynamically do it by message id?```tsx
INV_REGEX: new RegExp(/\bhello\b/),
indicator: ErrorBoundary.wrap(Indicator, { noop: true }),
patches: [
{
find: ".Messages.MESSAGE_EDITED,",
replacement: {
match: /let{className:\i,message:\i[^}]*}=(\i)/,
replace: "try {$1 && $self.INV_REGEX.test($1.message.content) ? $1.content.push($self.indicator()) : null } catch {};$&"
}
},
],

#

i also want to ask how to do something when you open a dm channel

dull magnet
#

i recommend using top level variables instead of storing everything on ur plugin instance

austere mauve
#

s

dull magnet
#

consider using message accessories instead of a patch if you're fine with having it below the message

turbid spruce
#

where would it be below the message?

dull magnet
#

where embeds are

#

and where the translate plugin puts translations

turbid spruce
#

i will take a look at that

dull magnet
#

as for how to render it for specific messages, look at the translate plugin

#

in short it uses react state and stores their setters in a global map

#

so you can obtain the setter for a specific message

glass oracle
#

someone better at rust needs to explain

austere mauve
#

v low margin

glass oracle
austere mauve
#

but also debug builds are usually 10x slower somehow for me

glass oracle
#

i just realized it's doing network i/o so thats pretty normal

#

i mean

austere mauve
#

yea probably

#

cranelift isnt good at optimising

glass oracle
#

i would try not using cranelift if my compile times didnt sky rocket to half an hour

austere mauve
#

sane

#

me when im working with bevy

#

thankfully the incremental build is a couple of seconds instead

glass oracle
#

cranelift gets me ~2 mins to compile from scratch
and 4~8 secs when incremental

#

ive been really cutting on dependencies and have been making tons of optimizations
BUT swc is such bloat

austere mauve
#

we need to riir swc

#

but in actual rust

glass oracle
#

yop

frigid bay
#

huh

#

had no clue there was even a gx partnership

#

if this works that's really dope

#

interesting

#

all of them are just already "claimed"

glass oracle
#

they added ratelimits now too (thanks @ntts)

frigid bay
#

nvm it works but i think its only if uve never had nitro before

glass oracle
#

yes
you have to not have Nitro for more than 12 months

frigid bay
#

i think i didnt have it in over a year

#

but it just says its claimed

#

while the same link works for a friend

#

another friend of mine who hasnt had nitro in the last 12 months says it says its claimed too

turbid spruce
#

how do i get the channel id when the messages has loaded? ```tsx
flux: {
LOAD_MESSAGES_SUCCESS: () => {

    },
},
dull magnet
#

it gives you the event as argument

#
LOAD_MESSAGES_SUCCESS(event) {
    console.log(event)
}
pure temple
#

(done with DiscordTokenGen v5398539 totally not script kiddie edition)

frigid bay
#

and they have nitro now

cedar marsh
#

ruby user readable error challenge
(The error should have ended after method_missing': undefined method action_mailer)

frigid bay
#

lol

trim cedar
#

Will show this to the next person that complains about C++ compiler errors being "unreadable" lmao

trail talon
trail talon
#

it might be that its only working if you've never had nitro before

frigid bay
trail talon
#

thank you

#

tbh im just doing it for fun, its probably gonna get patched in like 2-3 days

frigid bay
#

probably

frigid bay
#

didnt try the sha256 method but he says its probably the same result

#

but opera supposedly sends a uuid instead

turbid spruce
#

it appears to me that this only runs whenever the channel is first opened but i need it to run everytime i open a channel ```tsx
flux: {
LOAD_MESSAGES_SUCCESS: (event) => {
console.log("Loaded")
}
}

dull magnet
#

what for

#

what are you trying to achieve

thin elm
minor jolt
#

btw do plugins start after login or smth ?

dull magnet
#

you can customise when it's started

minor jolt
#

lmao i gaslit a lot of people because of this :')

#

how do i make it start on load instead of login

dull magnet
#

startAt property on ur plugin

minor jolt
#

and what values can it take ?

dull magnet
#

try it and see

karmic wedge
minor jolt
dull magnet
#

you're too used to python where you have no way of knowing

#

vencord is strongly typed...

karmic wedge
dull magnet
#

🤺

minor jolt
dull magnet
#

dude

#

stop

karmic wedge
dull magnet
#

look at it in your ide

#

wtf are u doing

karmic wedge
#

wait i dont even make vencord plugins why am i here

#

i do enmity shit 💀💀

minor jolt
#

im not making "vencord plugins" either im making an abomination lol

#

i guess DOMContentLoaded is what i want tho

#

thank god for that one plugin that used it

karmic wedge
#

its just a plugin to show a toast when you enter certain channels

#

and

#

it’s delicious

dull magnet
#

for the love of god get the python virus out of your brain

#

open vscode and in your plugin add startAt: and see what autocomplete or type information tells you

#

you're heavily overcomplicating this for yourself for no reason

minor jolt
#

i dont have any of that, my """plugin""" is literally a js file i inject via some obscure cdp method that calls on global Vencord

karmic wedge
#

i look like fucking whats his name uhhhhhhhhh yanderedev with the elif

#

its definitely able to be improved

dull magnet
#

that's horrible why would u ever write that code

karmic wedge
#

funny

#

it works tho

dull magnet
#

there's an event for channel switches and searching a webpack module takes a lot of time (multiple ms) so doing it in an interval will add insane lag

karmic wedge
#

really?

#

i use it actively installed

#

and i dont get lag

dull magnet
#

it will tell you that startAt takes a StartAt enum value and the enum contains everything you need..

dull magnet
karmic wedge
#

also i know i can do better i just dont feel like looking through the discord mobile jsbundle

#

im too lazy

dull magnet
#

the desktop code is nearly identical for non ui things like this

karmic wedge
#

okayy

minor jolt
#

bundling ?

#

nvm found it in the source

#

i guess webpackready was what i wanted

dull magnet
#

no

#

WebpackReady is the default

minor jolt
dull magnet
#

its name is a bit misleading, it's on login

minor jolt
#

so is there an actual webpackready regardless of login ?

dull magnet
#

no

dull magnet
# minor jolt bundling ?

you write code with many files, optionally using typescript or jsx and libraries, and the bundler takes care of bundling it into one or more js files that can be consumed by the browser

minor jolt
#

isn't that for building a plugin along with vencord though ?

dull magnet
#

so you can stop writing a 3000 lines js file unable to import libraries

dull magnet
minor jolt
#

can i somehow export only my plugin as an iife or smth

dull magnet
#

yes ofc

#

it will need a few modifications though

minor jolt
#

ill take a look

#

ty

minor jolt
#

the tza of 2 days ago would not have put in the work if he knew it was such an easy fix

#

people were complaining my thing was stuck on initializing (since the plugin never ran to send the loaded event)

#

and i naturally assume something webpack beyond my understanding broke again and i sat down and rewrote a lot of it to not use the weird proxy stuff that broke webpack

warm ether
#

Is it possible to add soundboard too vencord?

frigid bay
karmic wedge
#

its to prevent the toast from constantly sending

frigid bay
#

but like youre doing if (!signal) else if (signal)

#

kind of

#

idk im sleepy maybe im wrong

#

wouldnt this be the same```js
if (currentChannelId === desiredChannel) {
if (!signal) {
Toasts.open( ..... );
}
signal = true;
} else {
signal = false;
}

#

ig its not that different in the end but the fact u checked currentChannelId === desiredChannel in both if statements confused me a bit

#

the middle signal = true is useless at least because its already true if the condition for the if statement is true

#

idk minor nitpick i was just curious i hope this doesnt seem like im just shitting on your code or something

#

sry if it does

sacred crescent
#

Hi, How can I import effect snow to discord?

steady knot
#

there are a few ways to achieve that, easiest would probably be adding a snow gif in css to the background or with a pseudoelement on the foreground

#

if you want more dynamic/randomized snow you could maybe do it with a js snippet

#

I know there are many js snow snippets online, but not sure what it would require to make them work in discord, I know next to nothing of js

steady knot
#

I have no idea

glass oracle
#

go to dev portal and copy paste discord's code

sacred crescent
glass oracle
sacred crescent
turbid spruce
#

i just cant figure out the damn accessory things

#

ive been looking at the translate plugin and i feel like i kinda understand but not really

rocky jackal
#

so apparently, windows 10 and 11's virtual desktop feature has an api

#

gnome desktop on windows ain't dead yet!

modest wind
viral roost
#

what code editor are you using? vscode should do it automatically

modest wind
#

wait

#

it minified the copyright ;-;

viral roost
#

yeah it's supposed to do that

modest wind
#

oh oki so i can just commit?

viral roost
#

yes

modest wind
#

done ty :D

modest wind
#

tried pnpm test again and i get this:

        return new Error(`Invalid plugin ${fileName}, because ${reason}`);
               ^


Error: Invalid plugin src\plugins\showAllChannels\index.tsx, because authors array contains non-property access expressions
    at fail (c:\Users\username\Desktop\dev\Vencord\scripts\generatePluginList.ts:97:16)
    at <anonymous> (c:\Users\username\Desktop\dev\Vencord\scripts\generatePluginList.ts:136:67)
    at Array.map (<anonymous>)
    at parseFile (c:\Users\username\Desktop\dev\Vencord\scripts\generatePluginList.ts:135:51)
    at <anonymous> (c:\Users\username\Desktop\dev\Vencord\scripts\generatePluginList.ts:216:40)
    at async Promise.all (index 99)
    at <anonymous> (c:\Users\username\Desktop\dev\Vencord\scripts\generatePluginList.ts:212:5)

Node.js v20.10.0
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Test failed. See above for more details.```
dull magnet
#

make your plugin consistent with other plugins

turbid spruce
turbid spruce
#

Im getting this error when making a request, my friend says the CORS policy is set to global so anyone should be able to make a request```
Access to fetch at 'Insert endpoint here' from origin 'https://discord.com' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.

#

nvm he fixed it

turbid spruce
#

aight so i got an accessory working somewhat its supposed to only do it to a single message but it does it to every message even when i switch channels it just goes on every message

#
export function SeenAccessory() {
    return (
        <span className={cl("accessory")}>
            <SeenIcon width={16} height={16} />
            {" "}
            (Seen)
        </span>
    );
}
addAccessory(message_id, SeenAccessory)```
viral roost
#

yeah because that's what it's supposed to do

#

the id field isnt for the message id

#

take the props passed from addAccesory and add logic inside your component to only show it on the message ids it applies to

dull magnet
#

are u doing read receipts plugin

dull magnet
#

like i said look at other plugins using it

turbid spruce
potent fox
turbid spruce
jagged briar
#

do you want other people to be able to see this? or just for yourself

jagged briar
#

so someone looks at your message and you see the read indicator?

turbid spruce
#

i already got everything

jagged briar
#

yeah you'll need a backend for that

turbid spruce
#

yea i have backend already

jagged briar
#

ok good for you

turbid spruce
#

i just cant figure out this damn accessory thing

jagged briar
#

show some code

turbid spruce
#

this is what i think im supposed to do```tsx
export function SeenAccessory({ message }: { message: Message; }) {
// backend here?
// only return if message_id matches?
return (
<span className={cl("accessory")}>
<SeenIcon width={16} height={16} />
{" "}
(Seen)
</span>
);

jagged briar
#

where are you using the element

turbid spruce
#
addAccessory("message-id", props => <SeenAccessory message={props.message} />)
#

i get error here ^

jagged briar
#

what error

turbid spruce
#

i am the not understanding ^

jagged briar
turbid spruce
#

oh wait

#

sorry i cant read

turbid spruce
dull magnet
turbid spruce
dull magnet
#

"its return type void is not a valid jsx element"

#

don't return void

#

you need to return a react element, or null

turbid spruce
#

istg i am

dull magnet
#

you are returning void

#

send your code

turbid spruce
#

hoylk shit im an idiot

#

oh mah god

jagged briar
#

well that explains a lot

turbid spruce
#

yeah i think i got it

#

my bad

#

im acc blind

#

and stupid

#

alr i got it working thank you guys for being patient and dealing with my stupid ass 🙏

rustic stump
#

can someone help

jagged briar
#

what do you need

rustic stump
#

my friends codes not working

jagged briar
#

ok show the code

#

and define "not working"

rustic stump
#

you actauklly didnt even help

#

its jacobs

#

code

jagged briar
#

what

#

who is jacob

rustic stump
rustic stump
#

he gave me

jagged briar
#

oh i remember this

#

yeah no im not helping with this

#

jacob was banned

rustic stump
#

bro

jagged briar
#

if you keep begging us to help you with this pointless plugin then you'll get banned too

rustic stump
#

k

pliant pasture
green vessel
#

me making a very in depth python tutorial

#

im learning how to animate

#

but i made this animation in python as animation software costs money

green vessel
#

I tried with blender it was just too much for attempting 2d animatio

#

i just made these assets in figma

#

and tweended em

candid stump
green vessel
#

im trying natron but i got AMD APU so its giving me issues with OPENgl

candid stump
candid stump
#

alright then

#

you do you and gl hf

green vessel
glass oracle
#

i ended up making a different profile for cranelift so i can do optimized binaries in ci and fast compiles localy

austere mauve
#

@glass oracle you

glass oracle
#

me

austere mauve
#

pulled out

austere mauve
#

cuz we were talking in the middle of another convo

glass oracle
#

ah

austere mauve
#

./run ```rs
use std::rc;

println!("{}", std::mem::size_of::<rc::Rc<str>>());
println!("{}", std::mem::size_of::<Box<str>>());

worldly oxideBOT
#

Here is your rs(1.68.2) output @austere mauve

16
16
austere mauve
#

DISCORD

glass oracle
#

😔

austere mauve
#

wtf

#

how is rc a fat pointer

glass oracle
#

arc rc and box all give 16 for str

austere mauve
#

im gonna get real fatphobic

glass oracle
#

lmao

austere mauve
#

&str is also sixteen bytes cuz its not just a pointer, it also has the length stored

glass oracle
#

*const str is also 16

austere mauve
#

yop

#

fat pointers

glass oracle
#

thicc

austere mauve
#

simply use 32bit so its 8 bytes

glass oracle
#

lol

opal helm
#

hello, it's my first time creating a plugin, how do I create my own installer for my version of the code so I can test it?

#

there isn't really much documentation available 🙂

viral roost
opal helm
#

thanks, that's exactly what I needed!

#

btw my plugin is a rickroll blocker

glass oracle
#

how do you plan to block arbitrary urls

viral roost
#

just patch whatever function is called when clicking a url and replace the action if it's a rickroll

#

or just dont be a party popper

opal helm
#

i'm not actually blocking rickrolls, just detecting them and warning you lol

glass oracle
opal helm
dull magnet
#

you're acting like clicking a rickroll is the end of your life

opal helm
opal helm
tribal helm
#

Is there a way I can change my display name thru a JS snippet

green vessel
#

check the console with CTRL + SHIFT + I see if you find any errors

rocky jackal
#

but I would advise you not to

glass oracle
#

why not

rocky jackal
#

I mean, it should be safe to do

#

if you don't spam the api ofc

trail ginkgo
#

not fine to spam fine to use, theres probably a long ratelimit for that one anyways

median flare
turbid spruce
#

is there a way to change a setting value through like a command or smth? or is there some standardized place to store data?

frigid bay
turbid spruce
frigid bay
#

right i was gonna do that but forgot

#

vf theme

#

right

#

#🤖-bot-commands message

#

this disables quickcss and themes

turbid spruce
#

oh i ment like plugin settings like ```tsx
const settings = definePluginSettings({
placeholder: {
type: OptionType.STRING,
default: 'none',
description: ""
},
});

frigid bay
#

oh idk then

turbid spruce
#

ah alr thanks for trying anyways

dull magnet
#

settings.store.placeholder = "banana"

#

that's all u need to do

turbid spruce
sly whale
#

how do i make a js snippet

frigid bay
#

like the code block?

sly whale
#

no the uhh

#

the plugins