#🧩-plugin-development
1 messages · Page 31 of 1
simple as
basically ffmpeg cant do relative stream urls and i have no idea how to read hls files to turn entries into a singular readable stream
the problem is that doing key in obj has bad typings, you should try making a better version of Object.keys and use that like const key of objectKeys(request.query)
typescript is smart enough to infer the rest
could be like ts function objectKeys<T extends Record<any, any>>(obj: T) { return Object.keys(obj) as keyof T[]; }
that would be a good idea
it is rather annoying that Object.keys and Object.entries don't already have those kinds of typings - I did try variations using them but there was no benefit and for ... in looks a bit cleaner imo
yea it is annoying
i think for ... in will enumerate enumerable keys in the prototype too
so i try to use it less
them having those typing would be wrong
const obj = {
foo: "hi";
bar: "hi";
} as { foo: string };
Object.keys(obj) // Array<"foo"> ???
no
no
the as is just my preferred way of writing it
that object is perfectly assignable to { foo: string }
typescript's type system isnt like exact
{ foo: string } just means it has foo not that it only has foo
so an array with only foo elements would be an assumption
because that won't cause the issue?
interface User {
username: string;
}
function listUserDetails(user: User) {
Object.keys(user) // "username"[]
}
listUserDetails({
username: "epic",
realname: "gamer"
})```
this is perfectly valid ts with no casts
good example
there are tons of cases like this in real code where the actual js object passed contains way more props
think privates, passing a plain HTMLImageElement node to smth that only cares about a src, etc
where do you see a cast
there is no cast
ts is structurally typed
if it has a quack method it's a duck, it doesn't matter if it also has a woof method
yes that's why it returns string[] and not (keyof T)[]
absolutely not, no
it would be very unsafe to do so for type checking
^
pretty sure that's some compiler rule when you enable strict mode
if it helps at all, think of it like class inheritance
class Kemomimi {}
class Shiggy extends Kemomimi {
shig = true
}
function kemoKeys (instance: Kemomimi) {
return Object.keys(instance)
}
kemoKeys(new Kemomimi) // []
kemoKeys(new Shiggy) // ["shig"]
It's perfectly valid to pass an instance of Shiggy to kemoKeys, but it will change the output
that's a better example 
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
yes
that's exactly the point
but if you do Object.keys() on it password will still be there
it contains extra keys
ts playground is unusable on mobile
the editor is so scuffed
yes that is the point ;w;
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
I love how storing it in a variable works
but not inline
yes, and that's why it returns string[]
because it's correct
keyof T[] would be incorrect
yes thats part of assignability in type theory
and its baked into the type system because its structural
whar
someone complained about Object.keys returning string[] and I just said it makes sense to do that
that's all
structural type system moment
if it worked as the keyof type then this would throw an error at runtime (maybe a contrived example sure but it illustrates the point)
interface Datapoints {
height: number
distance: number
}
interface ExtendedDatapoints extends Datapoints {
mass: number
}
const handlers: { [K in keyof Datapoints]: (val: Datapoints[K]) => void } = {
height: v => console.log(`${v} meters tall`),
distance: v => console.log(`${v} meters away`)
}
function printData (datapoints: Datapoints) {
Object.keys(datapoints).forEach(key => handlers[key](datapoints[key]))
}
const data: ExtendedDatapoints = {
height: 45,
distance: 233,
mass: 43
}
printData(data)
(not bothering to do a ts playground for this because it doesn't compile for the exact reason we're already talking about)
my brain is small and it took me like a solid 15 minutes to figure out that keyof T[] is not the same as Array<keyof T> (which is the correct typing for this)
why does rust randomly change whether it shows the file or line number in this error
god if only there was an easier way of doing this
lol
You could combine all into one scroll function
would make it more concise
and use 2 enums for Axis and Direction
yeah ive done that already
why is it saturating
this was just me copying the ratatui scrollbar example thingy
so it doesnt scroll past the actual content
wrapping_add wraps
i was thinkin of clamp but ik
why does rust have so many add functions
why would you have 4294967295 items though
they do that for all compiler intrinsics
oh yeah and also it needs to saturate on subtraction so it doesnt underflow
is there like an api ref for third party plugins
Genuinely curious about the rpc plugin, how is it presetting the Game Name
wdym
The customRPC plug-in, it allows any Application Name to be set as long as you provide an Application ID, I’m trying to replicate it for my non-vc script but I’m baffled on how it’s done 😂
not possible probably
being in client gives you free access
if youre outside you need to work with their apis
similarly, listening and such normally wouldnt be possible
Ahh, that’s bummer 😂
where might i find these
can't seem them on the website unlees im blind
yay
How do I get the user id?
silly goober luna forgor to cache deps properly

now it's fast
also gh actions make my brain go mushy
Same but these config files make me go insane
Id like to make a plugin that would allow me to fav any media not only gifs. Are there any good tutorials/documentation that would allow me to even start from somewhere?
already made, its in review now

can I at least see how it works then cuz I wanted to learn something new
like a github repo or something

you can fav images if you put ?.gif after the link
but how do I even start, I dont have extensive knowledge about js let alone making plugins for discord mods, all Im asking for is a good place to start (documentation will do)
all vencord source code (including plugins) can be found in its github repository: https://github.com/Vendicated/Vencord
there is some information on getting started with plugin development in CONTRIBUTING.md and in docs/2_PLUGINS.md

ok
so from what I understand the plugin finds links with .gif extension and replaces it with other media extensions
or does it replace something else with those extensions?
can someone please please please make a watch os app so I can use discord without massive lag on my watch (Samsung galaxy watch 4)
I have a sideloaded aliucord atm but it's laggy af
it replaces discord's code to check if an image is a gif (all it does by default is check if the url ends with .gif) and changes it to look for any kind of multimedia extension
it's a pretty simple patch overall
ok
but how can I know that find: "/\.gif($|\?|#)/i" is linked to the part of the code that looks for extensions
that's a regular expression that does a search on discord's source code to find the portion that needs to be replaced
in discord's dev tools, you can use the search tool to search around discord's source code in a similar way
if you install vencord from source, you'll also have additional tools like the patch tester available in settings to be able to test patches like that
would also use react dev tools
but I dont understand how that regex part refers only to one specific part of code and some random .gif part
so it grabs only the first one
but how do I know that the first appearance of this is correct
(im using this website to see how exactly regex works)
its a bit confusing cuz its basically matching a regex in discord's own code
but yea
makes sense
but since theres no unknown/minified variables u can just use string instead
yeah
the find just to select the correct discord file
only one discord file has that exact string on it
so once it finds the correct, then it applies the match regex to select and replace the appropriate code in that file
its not that hard after all
I thought that find uses regex to find .gif in discord source code so I got confused when after searching for .gif I got multiple results
no lol
but since it just looks for string its all g
some discord file has that .gif regex in it
we just select the one that does to then apply the patches on it
yeah
find only exists to make it more efficient
its all g now, thanks for explanation
can someone help me with this? i want to round this controls but its getting gray background that i dont wanna have
ok i find it its ```css
.panels-3wFtMD {
-webkit-box-flex: 0;
-ms-flex: 0 0 auto;
flex: 0 0 auto;
/* background-color: var(--background-secondary-alt); */
z-index: 1;
}
owo
owo
venbot W
How do I find users by id?
you can use Vencord.Util.openUserProfile(id) in the console or send <@[id]> to get a clickable mention
invalid user jumpscare
the ValidUser plugin in question:
How do i get the banner url from users in code?
look at other plugins that do the same
Currently I have disabled the "Active Now" column with CSS which hides completely all my contacts' activities. However, it seems that 5 years ago it was possible to hide contacts' activities on a per-user basis: https://www.reddit.com/r/discordapp/comments/ak51tb/is_there_a_way_to_turn_off_game_history_of/. Is it a feature that I could bring back with programming? Not sure how to get started with that.
.nowPlayingColumn-1eCBCN .itemCard-3Etziu:has(.avatar-31d8He[src*="userid here"]) {
display: none;
}```
Woah, that's a fast response 😮 Testing it right away, tysm!!
Perfect, it did the trick!! Thank you so much for this code snippet, it's going to improve my Discord quality of life significantly 😄 Much appreciated!
salternator more like cssdestroyer
owo
i love having to monkey patch globals
/unban
is anyon here a rust pro who could help me pwease?
aware of this, but the scope kinda too large and keep it in dms
don't wanna post a huge code wall
just do it™️
why disable them?
and in what contexts disable
vulnerability how
oh yeah I just found this
Vesktop has recent enough chromium
no?
yeah ofc
just use vesktop :3
its meh
the titlebar implementation is lazy as fuck and looks ugly to me
I think?
I couldn't find any specific implementation details as to how the vuln is executed
from what i understand is a webp just needs to be loaded
which means you should be safe as long as you dont click on any images to open them in the full preview
how so?
but again, i could find very little details as to how the exploit works
preview would also use webp
because discord re-compresses the images for previews
and the exploit is in the huffman tree compression
we have discords native titlebar
it's opt in and that screenshot is ancient
discords titlebar sucks so i don't get why people like it but I ported it
oh it does defo
but not as much as windows's titlebar sucks
so you know, pick the less sucky
i prefer the windows native one
issues of the discord one are that snapping to maximise isn't consistent and it doesn't show while discord is loading
the windows one works better in terms of functionality
great, i can probs steal the code for it and just make a PWA version of discord ^^
like i did before GM died
you can't unless you load vencord
ohhh
ya get me, get me?
PWAs are pretty cool yeah
cuz it might not be possible to modify the CSP and headers in the way i need it for the extensions v2 chrome did
last time i did:
const manifest = {
name: 'Discord',
short_name: 'Discord',
start_url: 'https://discord.com/channels/@me', // URL when PWA launches
display: 'fullscreen',
display_override: ['window-controls-overlay'],
lang: 'en-US',
background_color: '#202225',
theme_color: '#202225',
scope: 'https://discord.com', // scope of all possible URL's
description: 'Imagine a place...',
orientation: 'landscape',
icons: [
{
src: ''
sizes: '256x256',
type: 'image/png'
}
]
}
const url = URL.createObjectURL(new Blob([JSON.stringify(manifest)], { type: 'application/json' }))
this.manifest = document.createElement('link')
this.manifest.rel = 'manifest'
this.manifest.href = url
document.head.prepend(this.manifest)
yeah i think that was the one
GM didnt want to do it iirc
removing csp is kinda bad for security but it is what it is
i mean vencord doesn't need to remove csp but then some features won't work and users cry

the main issue with PWA discord is the screenshare
cause limited to 720p 30fps?
or doesn't work at all
oh yeah
Vesktop also has patches for that
it took me hours to find out how to do it
https://github.com/Vencord/Vesktop/blob/main/src/renderer/components/ScreenSharePicker.tsx#L42-L71
and
https://github.com/Vencord/Vesktop/blob/main/src/renderer/components/ScreenSharePicker.tsx#L233-L248
there was that PR for the screenshare plugin
never got merged tho
this rly should be a web screenshare plugin, just like we have web rightclick
ah u still use electrons picker
so it would need to be re-written anyways
shame
I'd do it if i had the time haha
you just need to remove the screen picker and rely entirely on getUserMedia
I personally don't use it in the browser
most web plugins i only made cause they are also used in vesktop
since vesktop is just discord web with extra stuff
a lot of the web plugins are kinda cursed cause we just reactivate their desktop code (discord does not know how to codesplit) and then replace all references to desktlp only things like DiscordNative
I like to PWA discord because of well... the PWA benefits, shared http and media cache between websites, less processes etc
what benefits does it have
oh bro im writing a paper on this shit
so this convo is long
but TLDR a lot of shared internal processes
so in theory less memory usage
in practice we're talking about discord XD
and shared caches is simple, if you load something on discord, the same media is then cached for whatever headers specified it for, so if you re-open it in something else it doesnt need to re-download
its small, we're talking like a second of saved time most, but its nice UX
especially if your other media apps on your PC are also PWA's
because you're critically unhinged like me

i'm fairly sure i'm gonna add mkv support to firefox and safari before they add it
i like that u added that last part
do they not support mkv??
oh huh
so what did i do?
it supports opus tho
wrote a full EBML parser, extracted the metadata from mkv files, then transmuxxed it into an mp4 file and piped it into MSE
which means you can fully stream mkv files, with no upper filesize limits 🙂
well "I"
the mp4 encoding is done by a friend of mine
im doing the EBML and MSE shit
tho this is a bit inaccurate because chrome actually supports AC3 EAC3 and DTS, but only on specific devices and profiles like chromecast and limited android devices
web codecs?
chrome can't record opus
I want to be able to record opus audio
but it doesn't support it
😭
couldn't u use ffmpeg wasm or smth
it should be able to in webm's
that's what I'd try
it needs to be ogg opus
that has a limit of 2GB since its in memory
my limit is ~20TB
🙂
also ffmpeg couldnt stream it
i can
oh i see
with ffmpeg you'd need to first DL all of it, then re-encode the entire video
and then u can play
specifically for discord voice messages
with my solution its instant streaming
fuck that shit bro
i considered giving this a shot https://github.com/chris-rudmin/opus-recorder
but kinda meh
it should really just have native oggopus support
web codecs do support opus tho
yes I need media recorder
*you havent used webcodecs before and you dont know how to so you're falling back on mediarecoder
is what you mean
idk what it is
ffmpeg
but abstracted in js
with codecs and containers limited to what the browser supports
oh it's just very low level video and audio stuff
oh also experimental and not supported in furry browser
i mean
nor safari
it's still a pretty large part of the userbase you can't just say sorry guys not supported
yes but this code also runs in the extension
which supports all* browsers
anyway this looks not too bad https://developer.chrome.com/en/articles/webcodecs/
its pretty fucking bad ngl
XD
i personally hate web codecs
so i might give it a try and if it works I'll add it with a fallback to the old code for browsers that don't support it
thanks for pointing it out 
pwas go brrrrr
first time im learning about this feature
probably cause its experimental and not well supported so people don't talk about it often
oh man
wait till you learn that u can use service workers to create a nodejs-like http server in browser
x)
there are so many cool new browser apis that are basically "unusable" cause they don't have great support
FSA API REEEEE
oh yeah i talked about those here a while back too
for zipping
and unzipping
compression streams are cool yeah
we just bundle fflate into vencord
it's like 10kb
but so slow :/
are they tho
"compression streams"
read that again....
slowly....
anything web streams is slow
also you should talk to lewi who wrote that code
sending deflated might just be to save work on the server
cloud sync has some other issues anyway
sometimes when you enable a plugin and immediately restart it disables the plugin again
this i don't get, shouldn't compression basically nullify this
compression has intiial overhead
if ur data is small enough compression will make it bigger
x)
wel ofc
popover so true
but yeah our data is a few kb
so that's not an issue
why
how
the fuck
is setting sync
KB
????????????????
bro if that shit is over 1kb you're doing smth wrong
cause it contains settings for every single plugin including whether they are enabled or not
DO BENCODE
magic
honestly maybe im underestimating how much 1kb is
anyway it contains all possible settings for all ~140 plugins
even... disabled ones?
yeah
it initialises all settings deliberately
cant send skull sticker
it's so you can edit settings json easily if you're into that for some reason
and there's no reason not to
just open ur settings.json and you'll see
i use arch btw
i enjoy playing games and not spending 10 hours a day fixing network and config issues so i simply use windows 🙂
oh.
no cause compiling chromium
🥴
man
if you dont use CI for compiling chromium
then you're fucking unhinged
and that comes from some1 as unhinged as me
oh fair
how do you test your changes
make change
push to github
wait 10 hours
uh oh you forgot something
repeat
nah its probably way better with build cache but god idk how people work on shit that takes this long to compile
simply use mold for linking
so linking goes down to like 2 hours
and then recompiling is like 5 minutes
its not bad at all
needs ssd tho
meanwhile my subtitle rendering library for browsers takes 30 minutes to build
do you like embed the subtitles into the video data
then what
build image data, paint it on canvas
because it would take me 2 years to write a renderer thats spec compatible
ah, do you just use a library
thats like saying "oh just re-write vulkan in js"
i mean... drawing text on an image is easy enough
idk what sort of features subtitles have tho
GAGAG
what's so funny
he doesnt know
here
try not to crash ur phone tho
~20GB of subtitle image data rendered per second there btw
ah cause you have to be able to write to things in the video too
wow that is horrible
rotate Ur phone 😉
that's the max stress worst case scenario
negative fps 
anyway reimplement it in js :3
go commit die!
flashbacks to my roblox era
it supports SIMD enabled CPUs, non SIMD enabled CPUs, and engines which dont even have WASM
all in a single worker
also its defo not a "just use a library"
the painting logic is insane
all the wasm does is output uint8data
how do you run wasm without wasm support..
then actually displaying that in a very fast way without lagging the browser
is just insane
the wasm lib only exposes pointers in memory to bitmaps, from that single color bitmap i need to construct a single RGB image, then paint it on a canvas
and when you have say, 300 1080p bitmaps per frame
which comes out to like what...
622_080_000 bytes
a single bitmap
is a single color
so if a single scene has say 2 gradients
all of a sudden
thats gonna be 300 different colors
thats what happens in the video i linked
thats per frame
why does it do it that way
thats what generated by the WASM
goofy ahh
then *4 that to convert it to RGBA
you compile the wasm to JS, since assembly instructions are quite easy to port to JS, then create a fake WASM polyfill inside the worker, which always runs the same code, and eval it: https://raw.githubusercontent.com/ThaUnknown/jassub/main/dist/jassub-worker.wasm.js
so you do a
const read_ = (url, ab) => {
const xhr = new XMLHttpRequest()
xhr.open('GET', url, false)
xhr.responseType = ab ? 'arraybuffer' : 'text'
xhr.send(null)
return xhr.response
}
try {
const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00))
if (!(module instanceof WebAssembly.Module) || !(new WebAssembly.Instance(module) instanceof WebAssembly.Instance)) throw new Error('WASM not supported')
} catch (e) {
console.warn(e)
// load WASM2JS code if WASM is unsupported
// eslint-disable-next-line no-eval
eval(read_(data.legacyWasmUrl))
}
eh
like 40% slower than WASM?
which in itself is like 40% slower than native?
do you really care?
if your CPU/browser doesnt support wasm, even if running in wasm, you wouldnt get good perf anyways
so at most you'll be rendering only basic subtitles
and with this my browser coverage is 99.9%
4mb js 
the WASM itself is likely slower than normal JS, but noone is crazy enough to rewrite a 3d rendering library in another language while keeping it 1:1 compatible
yup, thats what 2MB of WASM compiled to JS look like
they locked me in a room
the entire lib is like what.... 10MB?
8?
cuz i have 2 WASM workers, one with SIMD and one without

and then the fake wasmjs worker
i dont recommend trying to compile wasm with SIMD
you'll fucking go insane
I never compiled wasm in my life lolol
what are these subtitles holy shit
these are not subtitles
these are like overlays
ASS
advanced sub station alpha
yup
they are for translating shit like signs, text etc
they arent captions
they are subtitles 🙂
vtt is simple captions
if you want to support non-vtt subtitles in browser, jassub is pretty much the best way nowdays
thats how my app renders all subtitles known to man
damn they turned subtitles into insane
i need a talk with whoever came up with this acronym
and give them a firm handshake 🤝
i mean this is pretty cool tbh
it looks like google translate camera
but it'd be easier and acceptable to me personally to just include such info in the normal subtitles
ig for bigger things like letters it's meh
well, thats kinda insulting to the people who spend 10 hours typesetting a single 10 second scene
good
yeah that
that had to be intentional
i bet you wont realise that the ||absolute demonic font: babylonia|| text is even a subtitle the first time u watch it
similar to me naming the asset variable "ass" in vencord installer

firefox user
on chrome its frame perfect
chrome
its not that off
best variable name
i just have a good eye
you just have a shit cpu XD
dropped frames: 0
thats video frames
not subtitle frames
the subtitle rendering is async
so it in itself doesnt have a concept of dropped frames
sicne it doesnt actually have a playback state
oh nice
probably cpu then yea
this subtitle format is cool
is this the format that youtube supports
it has more than vtt i think
they had something that a friend of mine used to make twitch chat as subtitles
ohh i think its realtext
a lot simpler than ass lol
Anybody have any idea how I would go about setting the "Playing" status ? The "RunningGame" store (or something along those lines) didn't have any helpful methods for manipulating that
And the events it fires when I open a game didn't do the trick either
look at other plugins doing it
this is the plugin youll want to be looking at https://github.com/Vendicated/Vencord/blob/6cfb67a52ea692eebf2f01d3498cffb21050c7a4/src/plugins/customRPC.tsx#L383
1 << 0
bro why did he do that
maybe to make it clear that its a bitfield?
copy pasting flags from docs
btw can u do watching status with external RPC?
not internal?
no
cuz i cant seem to get it to work D:
only internal
br0
watching is only for like discord streams and maybe more
Does this need an application to be created ?
you need to make a companion plugin to use all types
yes ofc
Just to be clear I don't care about rich presence just a simple "playing" status
The old type
what do u wanna do
we used to have a companion plugin for cider that would change the activity type to listening
but it was removed because it was too niche and also some concerns about cider
a good way to bring it back would be to make a generic plugin that lets you override presence type for arbitrary presences
something like you provide an app id and the type you want that app to be overwritten to
or remove sanitisation from the rpc in the client?
i honestly don't exactly know how it even works
i never read that code
you could do that too maybe
i looked at it recently for gameshigeon because i didnt realize there was a simple flux event for it lol
lmao
its not very sane i never want to see it again
I have a plugin for the steam deck that runs web discord+vencord in a separate tab on the steam deck and allows ya to open it quickly and offers some remote control from the quick access for muting/leaving vc + notification pop ups in game mode
And I wanna add this functionality to get what game you're playing and show it as playing status
thats neat
I'll probably put it on the testing store tonight
Yes I'm one of the original developers of decky lol
ohhh
i see
ur github pfp is cute
no way ur status is hating javascript
do u prefer python 😭
@dull magnet correction, the build is 21 minutes now, i forgot i removed license generation https://github.com/ThaUnknown/jassub/actions/runs/6237274674/job/16930507633
BASED
aagamer working with great people
JavaScript is a great language
console.log(typeof(document.all));
console.log(document.all);
whar
typeof document.all === "undefined" && document.all !== undefined
its an htmlcollection
help
well
it's more the case that you are calling it with an expression wrapped in parentheses?
wtf
WHY IS THE DOCUMENT FALSY
why 💀
Yes. A common point of friction between me and AA 
well
discord uses chromium 91.0 does it not
technically canary would be 98 bc electron 17 but yea
no??
discord has been on electron 22 for ages now
and me as well 💢
hmm sessions_replace seems to show me a playing status, but others can't see it
that's with "all" as sessionid
also opening discord on phone seems to remove it
Man this is impossible I tell ya, I fire all the events that go to the flux dispatcher
But none of them will set the damned status
death penalty
sessions replace is really cursed
the all session is supposed to represent your overall presence as shown to others
if it's even there 
Yea but for some reason it doesn't propagate to other devices if I just dispatch the event on the flux dispatcher. Like it doesn't fire through the websocket, so the other devices never receive it, so when they push their own state replace it just overwrites it, and removes the status
And it's not visible to anyone else
Not sure how discord does it under the hood
How it remote syncs the states
I guess maybe I could fire the websocket event directly ? Not sure if vencord has any provisions for this
I wonder how discord does it under the hood
When discord does it itself, I think the mobile devices on the session list also return the same activities
Not sure though
huh? you cant fire sessions replace
By fire you mean via dispatch
Yes I can fire it there, and it does cause an activity to show for me on my profile but noone else can see it
And if I open discord on phone it disappears on pc
dispatch is not what gets sent through ws
you can only receive sessions replace on ws
Hmmm, so it doesn't sync remote if it gets session replace on the flux dispatcher
So how do I make it fire in the WS ?
this does it for you
its a layer of abstraction over ws
https://discord.com/developers/docs/topics/gateway-events#update-presence this is what it ends up sending through ws
you do not want to use raw ws
I'll give it a try when I get home
Again I don't want rich presence, I don't want to create an application and I don't want it to say "Playing {application name}"
I just want a simple non-rich "Playing {thing}" status
then give it only the name
only discord can dispatch events lol
you're looking for the update presence op
userdoccers smh
most flux dispatches only have local effect
like the gateway gets sent some event and then dispatches it to update local stuff
only very few flux dispatches actually do a request
maybe
Big thanks
Btw can I use the createActivity and setRPC methods directly from Vencord.Plugins somehow or should I just reimplement
anyone know how to jump to a message? i tried changing the window href, but it just restarts discord
nevermind, i just found out what the object generated by createActivity looks like and just passed it directly to a dispatch
works great, another functionality done
a last thing i want to do now, is to add a button for posting the last steam screenshot
vencord settings > enable react dev tools
oh
i was confuned cos it was a google extension
what is the function name for setting a nnickname
ok then
im confuse
how do i set a breakpoint
if i edit this to include debugger and then save it discord crashes
wait im not sure if it crashes
i think it just takes like 200 years to load it
click the {} button in the bottom left to prettify
what the fuck
i did not know that was a button
or better yet go into devtools settings > experimental > always pretty print
is this devilbros doing?
h
DevilBro works for Discord?
yes
this is why they changed usernames
oh
once i have a function pinned down on the debugger and extracted via breakpoint how do i go about finding it via findByProps or findByCode ?
you just need to find a unique string in the function
check the exports of the module it's in
and write a filter for them
assuming the func is even exported
it's this one
and the one below it _createMessage
nvm i guess ill just do it how the VoiceMessage plugin does it
oh it even has a filter for CloudUpload
based
i should start consulting the existing plugins more lmao
@dull magnet hiiii how would I open discord settings page programmatically?
I mean in Vesktop
I'm adding some macOS menu bar support
couldn't find any
hm lemme see
how are u building
pnpm build --dev
oh is that vesktop
I'm in Vesktop, not Vencord
you need to install dependencies
I did
show the output of the install command
send code
.
I'm building with changes
blud
oh nvm
mainWindow is main process
it doesn't have access to renderer
you can only use webpack stuff in the renderer
well I need to bind a click listener in the menu bar that opens settings
the proper way would be to use electron IPC but that's very ugly
so I recommend just evaling script in the renderer
like this
you can just executeJavascript("Vencord.Webpack.Common.SettingsRouter.blah()")
javascript can gargle my nuts
oh
that looks better
this won't work
vendy loves
it fits with other macos app standards
(as well as cmd + , shortcut)
the shortcut already exists without that tho
why'd u say this then
im just confused :p
well I'm just saying that other macOS apps have the settings entry in the menu bar and I'm updating vesktop to follow that guideline
either way executeJavascript worked

@dull magnet you will review NOW
pub fn turn_left(&mut self) {
std::mem::swap(&mut self.0, &mut self.1);
self.1 *= -1;
}
least overengineered rust code
Anyone have any idea as to why the googleapis request for attachment upload might be returning 404 ?
Maybe a header issue ?
The same url when ran in aiohttp returns 404, but when I run the put request on curl (with no headers) it returns 200
wha it do
(me dum)

Heyo. I wanted to try to make a patch to the BlurNSFW plugin so that you have a Setting to only enbale the blurring when the Streamer Mode is enabled. I already tried to analyze the source code via the React Dev Tools what happens when enabling the "Streamer Mode" setting to understand which property to check for in the plugin but I honestly have no clue what happens and where I can find out if the streamer mode is currently engaged or not. Do you have some Ideas how to solve this problem?
really over the top method to rotate a coordinate vector anticlockwise 90 degrees
oh
*counterclockwise
*widdershins
StreamerMode = findStore("StreamerModeStore");
if (StreamerMode.enabled) {...}
```try this
I'll do. Thank you very much!
This is a bit off topic but I have been trying to make Vencord work with my JS injector or my unblocking site and well it’s not working if you want to view what I have so far here’s my script it’s based on the user script: https://cdn.z1g-project.repl.co/sodium/plugins/vencord.js
I can upload console logs on just not on my pc rn
I would've implemented this in ShowConnections if I realised it was this easy lol
although, I would have to check other options
funny macro™️
Should I use a Vec, or HashSet for generating an AST node for enums, I mean the enum Variants
I thought you were using C++ for everything
nop
I think I shouldn't even be using Box for this anyway
I'm doing research
Learning Rust With Entirely Too Many Linked Lists
it's the bad stack omgggg😲⚡
depends if you want it on the heap or stack
I mean
I made the most basic implementation of a Linked List
this looks like some Ruby addict wrote this
It isn't necessarily the worst in the world but it could get better
I love micro-optimizations
none
you make an enum
n if it has children u use a vec in the variant
RUST TALK
How am I supposed to store a rust enum in my AST and then work with that for the codegen?
HORROR
Small tip use the Option enum
perhaps

I will read through everything first

Yeah but I have to parse the fields and put them into a growable container
rn I use Vec
what the hell are you cooking
I just dunno which is better cuz the rust docs confuse me
A parser
custom toy lang
me so stupid
I couldn't even use a HashSet
this library is so cool https://mafs.dev/guides/display/polygons

