#🪅-progaming
1 messages · Page 12 of 1
yopppp
I don't think so, private visibility modifiers are there for a reason, they are there so you can expect stuff to work. If you set a private property/call a private method it could have very unexpected and breaking side effects and I BET you'd complain about "omg this _method I called changed stuff unexpectedly and now the whole thing imp building broke". If you need to call a private function I personally think that's the library developer fucking up, they should provide a way for you to use the thing you want to use safely
there are always reasons one might want to use private library function
it's up to the consumer
for example Aliucord used a shit ton of private android methods
or in a discord bot you might want to manually send gateway messages but the library makes the raw gateway send private
the issue with leaving it up the library dev is that they will always keep a minimal amount of things public
to keep the maintained api small
if someone needs to use a private thing then let them do it because they're going to do it either way
obviously at the cost of no support from the library developer
however you could always block ignoring visibility modifiers in production code
I don't think this is a language issue though and more so a library issue, the library just sucks and doesn't allow you to send raw gateway messages instead of the language sucking because it provides a way to change property and method visibility
or react
there are multiple pretty popular libraries making use of __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
whyDidYouRender.js: Line 44
wdyrStore.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current
the language sucks because it doesn't allow access to private members
any sane language allows you to access privates if you really know what you're doing
reflection 🤤
like js because there is no way to access #privates
meanwhile java, c#, etc allow accessing everything via reflection
in the case of java it's used heavily by android apps, including very popular apps such as the Facebook app
But then you can indeed fork the library and change the visibility, knowing it voids all support from the developer. Developers are also users, and we all know a ton of users are idiots
Ive seen people complain about "why does calling _thisMethod break stuff" before, it leads to unexpected codeflow
unexpected codeflow is a whole 'nother issue especially because private methods can be not very well named or documented and then have a _sendGatewayMessage method do stuff like change things on the bot object
but i guess im just coming from a place (rust) that is heavily restricted, everything private by default to remove unexpected codeflow
Forking the library, changing what you want knowingly voiding all original developer support and keeping idiots away is a much better solution imo
idiots will be idiots either way
worsening experience for smart users because of idiots makes little sense to me
the idiot will fork and then ask for support with the fork
we see it in #🏥-vencord-support-🏥
my gateway implementation has no public way to send raw event
yeah pretty much
forced reflection
I agree that languages should allow access to privates either way, but should you be entitled to support from library maintainers if they decided to remove said privates which you were using? No
nah ofc not
private api inherently makes no stability guarantee
unless you're Facebook
rusher loves very useful classes and functions being internal in compose
the language can make it clear you're violating access modifiers
via suppressing an error or some special syntax
kotlin does this with the internal modifier
although you can get the underlying websocket and send a text frame
the solution to this problem is to obviously rewrite every single library you use yourself because what are you doing relying on other people smh
this is so unbelievably true
i cannot even count the amount of times i have had to use internal things
and without the ability to bypass it I would've just been stuck
because it's simply infeasible to fork and build compose libraries
what even is __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
compose shit is so nested its insane
huge mix of gradle, bazel, makefiles, and some other build system
just use python, it has no private methods 
i think the problem is that you are using java that should definitely be close to a death sentence
just trying to find what text style some component uses usually involves ctrl clicking through several layers
secret react internals you are not to use lest you be fired
I wonder if they will ever be able to rename it 
the day they rename it Aliucord will break
aliu breaks every update already
aliu is dead
as of right now it doesn't work on a15
for me atleast
NOP
although a fix is known
must fix..
I'm on RN right now
tbf why are u on android 15
its just aliuhook being behind
oh
im not on a15
fix
I already need reduced motion so enabled it and app runs nice
i just check core dev occasionally
ill let the nerdier nerds take care of it
zt
you see in my personal opinion (which is indeed personal and an opinion) i think react sucks because there is demand for using it and there is apparently no way to safely get the things this provides, but i also just think react sucks in general and we should kill it in favour of svelte and vue
the thing is that as a library developer you don't really know everything people need / want
there'll always be some private thing that people will find useful
veeue.js
we already have many frameworks for each library
that's why i think using the new #privates in js libraries is awful
we need more
we've already had the _private contract for so much time and it's perfect
well if libraries with 11k stars use it how do react devs not know or why did nobody file a feature request then 😭
wrong
well it's hooking into internal react rendering logic
it has existed for a decade
we need yet another way to manage state
it makes sense that react doesn't want to expose this for public use
there are too few ways to handle state
observables?
rxjs
if you make it part of the public api you need to maintain it, and make a stability guarantee, document it, provide support, etc
rxjs is ehhh
it's better kept private (but should still be usable by advanced users who know what they're doing)
OBSERVABLES ARE AWFUL
KILL OBSERVABLES
I have trauma from working with minified observables in Aliucord
i understood them
is it? I mostly see it getting used for wdyrStore.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current, if like everyone wants to use it i see no reason for there not to be like an i guess useReactCurrentOwner() or whatever react does (i have no idea what this even does or thats how react would use it)
its just worse flows
observables kinda suck tbh
insane that people ported them to js
when promises exist..
we need every single component inside its own js shadowrealm.
terrible
why is ur repo so much java
did you never bother rewriting stuff in kotlin
my repo is like half half
wing biggest java fan
i have a pr that does that but i barely touch
wow
that's more kotlin than I remembered
https://github.com/zt64/aliucord-plugins
mine is all kotlin
wait
fix themer plugin @deep mulch
ignore the java that's cause of protobuf
so much java...
i just haven't bothered to rewrite bc its largely stable
evil zootie be like
protobuffing
@ionic lake hiii
protobuf
yeah same I only rewrote stuff that I was actively working on
I will rewrite everything in kotlin
i wish protobuf kotlin worked like apollo
yes
yes
I've noticed some differences in wings behavior which leads me to believe this is not the real wing @royal nymph
im probably gonna end up making minimal library for dealing with discords settings protos
you need to quarantine and remove mod before it tries a takeover
i become more and more sane and zeet freaks out
a bit full
was steht auf der Tasse...
smh
Anti Stress Tasse
wing racist
wing loves racing
@royal nymph did you know
what kinda name is grunka
wir brauchen offizielle Vencord Tassen
grunka
caveman
grungkah

zeet honest about how far back he is evolution wise
my name is so universal
taxi machine
tasky machine
no matter the accent, everyone says it correctly
tax season machine
oh noes
your name Derek
no my name is skrillex
wing real name Wilhelm
ill give people my name for $50
I know it starts with W or J
usd
i wish
maybe

i was wondering why my php code was so slow turns out i was traversing about 600 gb of files just to get the first 100... whoops
php and you wonder why its slow?
Who even uses php in 2024
Php is quite literally faster than js now
Or are you thinking of Python
Php has been faster than node since 8.0 iirc
really?
thought it was slower than python even
php 8.0+ is very viable
no lol
I just know php cuz of work anyway I don’t use it at home
hm i dont see any real benchmarks but most of the sources say js is faster except apparently php has good io?
Also php has types so it’s technically better than js (ts excluded)
I’ll try to find some actual benchmarks
idk man just use rust
That is what I’m already doing at home
tbh i just find php super ugly
I hate any language that uses $ prefix for variables
bash excluded
bash is ugly as shit
Ich liebe bash
It is ugly you are right
ich bash dir glei den schädel ein 🥺
EVERY single file has to start with <?php
oha
Unless you are doing html in your php?? But then you are already past mental insanity
Nö ich beschütze vee 👎👎👎👎
Shiggy blast
Falsches gif aber das wirst du sein nachdem ich fertig mit dir bin
deutsch
Okay yeah you are right whoops maybe I was thinking about a different language then but php isn’t slow just extremely ugly and weird
poor php
…that's what PHP is for
No it’s not
It was in like 2006
It’s not 2006 anymore
<span><?= 1+1 ?></span>
It’s now for website backends
If you want to render out html using php you use TWIG
huh everything i read says it slower than python
iirc
oh i think i got that mixed up lol
i was suprised that python is slower than python
python is indeed slower than python, if you compare cpy to pypy
*php
😭
i just woke up
also lewi broke automod and made it timeout 10 mins for space
that was distracting
python is slower than php that is
\x20
xd
wtf is that 45deg back bending
anyone else here using the new theme refresh? just want opinions and thoughts on it
i have "tried it" and my thoughts are
doesn't work with built-in theming
a lot of it just seems broken
i tried it again yesterday and found the devs adopted the industry standard bullshit called add more fucking padding to everything
only redeeming quality is it looks Modern-ish and the horizontal channels & roles / events / etc bar looks good
i wrote my user app in java
Someone needs to make a multi message delete plugin frfr
that seems like not a good idea
shift clicking hold buttons with messagelogger is so good though
i can generify that into a messageselect plugin
gmas
Do Discord cdn links expire? Can I just use Discord message links for my plugin or should I store them somewhere else?
cdn links expire after 24h
Do they? I have links to image messages in my tags from the tags plugin which were made a while ago, and they still work
yeah
no?
if you send a link inside discord it will be refreshed by the api
but the link won't work outside of discord
oh gotcha, thx. Then I'll keep using Discord links
so if you try to use the link as an image inside your plugin it won't work
only if you send it as a message
yeah
Make a bot that reposts it in a private channel every 24h
at that point you might as well put it on imgur
there's an api route that lets u refresh urls
50 at a time iirc
But that's less funny
24h? wasnt it 2 weeks?
oh did they increase it
i remember when they were first rolling this out it was 24h
thats cool
the link should tell you when it expires
no i was remembering something wrong i guess
How do I find actual react component names? React developer tools show me minified names like "d" and "e"
i dont think you can
If they're not in Forms or has an otherwise visible name, just make one up
you do not
ok, if I for example want to place a button inside some element how do I reference that element?
I've been following the docs half tutorial and this tutorial and I got the gist of it but this is the only thing that confuses me
Hellow I had ChatGPT make me a plugin for personal use, can someone check if this plugin would even work?
cuz I personally can´t code
could I DM the code to u and u check? 😅
no
it won't work
ai is awful at writing functioning code
The thing is Ik this plugin won´t be allowed on regular vencord so I wanna have it for my personal use but ChatGPT can´t tell me how I can activate it for some reason.... there is no plugins folder in my Vencord folder and creating one myself didn´t help either
i think we all would be able to say with 99% certainty that the code gpt wrote would not be right unless you somehow trained it in a diffrent way
RIP
hello shana
Hellow
thanks for the free laugh 😂
I would recommend you learn how to code before making a plugin, if you dont even understand what the generated code even does due to your lack of knowledge and experience then youre not fit for making plugins for vencord or anything remotely similar
so please take the chance to learn instead of using ai tools
oi smart ppl
aka not this guy
do a yof you happen to know if theres a tool similar to tp_smapi but for acer asipre laptops
the closest thing i found was acer-wmi-battery, but that doesnt seem to allow you to set thresholds to start/stop charging
do we like Java
9
19
3
No
based
Could someone please help me?
I keep getting the error:
The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle
for node? You can use "platform: 'node'" to do that, which will remove this error.
How can I fix this?
Have you considered doing what it says?
U need a native.ts file (which i dont know how it works or how to do it) for node modules
trying to figure that out; will tell you when I've done so
?? and how do i do that?? maybe explain instead of being rude? its not like its just pnpm build --platform node its not as easy as that its not clear how to do it
keep cooking
Thats where the fs code is so no its not that
Thanks i hope you get it fixed
im not an idiot
keep cooking
let me try enabling that plugin rq
im not on linux either anyway
good luck
https://xyproblem.info why do you need fs
I need it to check for a file (which the user gives its path in the plugin settings) and read it (im not that good of a dev but i dont think theres a different way of doing it)
No not that theres a native.ts file in the plugin voiceMessages for example
it seems to be able to use readFile from fs/promises
Yeah I know the import fs code is IN the native.ts unless thats not what you meant
if you manage to create a valid native.ts file you can import fs and whatnot and export all the functions you need im pretty sure
seems to be more like
(native/index.ts === native.ts except it can have other modules)
what can be invalid about a native.ts file? im literally just importing a module (sorry if that sounds rude i just dont understand)
sadge
you cant just create a native.ts file and be done with it
inside voiceMessages/DesktopRecorder.tsx
wait i might be an idiot brb
tbh i dont understand this too well either im just taking what i understand
nvm i dont think it matters i thought the PluginNative thing was basically like saying its should use node (which it is but i thought it was needed for native.ts as well i think this is needed just for sort of other nodejs files so i dont think i need this)
Yep something is weird with my build because I checked if it just happens because of my code/user error but it does it even if i copy other code
does anyone know how to fix The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error. error?
i had this issue and i forgot if i even fixed it
it was a different module though
it happens for any node modules not just for fs
nah it happens to me too when i tried to use fs a while ago
im gonna just
try and use wsl to build instead of windows
and hope for the best
il tell you if i manage to get a working thing too
yep nvm using wsl to build doesnt work either
I mean it always uses a line somewhat along the lines of this
however it has to return something and the bit im looking at does it like this:
im working on creating something along those lines too
im pretty sure its just for making the file also use node (which shouldnt be needed for native) basically its just to say its a continuation of native at least thats what im guessing cuz actual native.ts file doesnt have this
what in the xy-problem are you guys talking about
using fs
why
whats color theme?
thats what im tryna find
found why
that's a security hazard you can't do that
ask for help with your actual end goal, not your solution
index.ts/tsx runs inside of electron which is a containered environment (because of course you dont want websites to access your filesystem), native.ts runs on node so you can actually do desktop application stuff, take it as a "front- and backend"
if you need to access the filesystem you make a function in native.ts that does specifically what you want and then call it inside of index.ts
uuuh its called Dark Vision (found it as an extension)
is that why we dont have docs for native?
im confused, isnt that what I did? All of this code is running in native.ts its the imports not working?
Thats what im trying to do, look, im not trying to publish this plugin, i just need to import a JSON file (which the user provides), thats all.
for what
im sure your goal can be done MUCH better
there are web apis for askign for a file
im sure of that aswell believe me
which opens a file open dialog and is safe
(<input type="file">)
im trying to import chats from old accounts (using jsons extracted from discorchatexporter) i know its probably an idiotic idea
can i put that in the plugin settings page? im sorry for acting a lil dumb im not exactly a good dev
You can make custom settings components, yes
yeah, plugin settings allow for components as types
youd just have to make a react component
Right. thanks for your help!
wait okay so how would i save something in a folder as I wanna have something that saves an image to a folder somewhere
once again provide more info
you definitely cant save to arbitrary folders
what's the plugin goal
I think the entire world would be a much better place if people just "hey im having x problem, y is the goal, z is what i currently get. I have tried a, b, c. Here are some screenshots/logs:"
simply a quicker method of saving images, I would just have another messagectx patch with a button that saves the image(s) to a folder
lazy ass
for more context I dont know any regex so i cant just patch the save button
dam mb
well you'll have to make an ipc method and hardcode it to some safe folder like ~/Pictures
does the folder have to be inside vencord or can it be any folder
it can be any folder
flatpak restrict vencord to accessing only certain dirs, so if you want to disribute it/send pr then you should look at what is whitelisted in flatpak and use one of them
also you should path.resolve(path.join(dir, filename)) and check if it is in right dir to make sure something malicious doesn't set filename to sth like ../.. to write files to other place than intended
could you test if this branch works with url encoding in your proxy? https://github.com/Vendicated/Vencord/tree/immediate-finds
unless it also encrypts the http
¯_(ツ)_/¯
I think it will work, since it's passing in http(s)://localhost:3000/service/<encoded url> when error.stack is called, but I'll be able to give it a proper test later
that's nice
stupid question, but where does textReplace store the rules ?
i would guess it's not in the settings.json since i can't see it there, so in the storage of discord somewhere ?
DataStore I would presume
index.tsx: Lines 252-253
stringRules = await DataStore.get(STRING_RULES_KEY) ?? makeEmptyRuleArray();
regexRules = await DataStore.get(REGEX_RULES_KEY) ?? makeEmptyRuleArray();
mmmmh
i'm gonna try to change that to the settings.json or to another file to be able to easily share it or edit it outside of copy pasting my regexes inside of discord
I'm fairly certain you might be able to export the indexeddb through devtools
will i be able to reimport it after that tho ?
tbh i'm very new to JS, electron, react and all that stuff so i'm just dicovering
maybe try and see
mmmmhhh
interesting
ig i'm gonna yoink that and make a save and load button for the plugin
is there an easy way to like automaticall breakpoint once smth read data from a particular store ? (without knowing what is trying to access it obv, otherwise would be way easier)
any tips on where do I start on making a plugin
- https://docs.vencord.dev
- look at other plugins
i made something cursed
made the bundler import css as an instantiated stylesheet and shadowroot to remove the c from css
to do what
To be able to understand which function is the one reading and then writing to it to probably patch that function or at least have a starting point where i can explore the function tree to find out stuff i could patch
those are the interesting one i want to dive into
- GravityStore
- MyGuildApplicationsStore
- SystemAnalyticsStore
- understand why the "token" one has its value start with "dQw4w9WgXcQ" which i instantly noticed is the rickroll
- InstallationManagerStore
- hideGuildRaidDetectionNotice
and probably a few others
also stupid thing, idk if it's possible, but it would be nice to have vencord companion being split into 2 extensions, one being the snippet, and one being the tester, cause since the tester can't be install on GH codespaces, i can't use the snippets
@trail night did u get notarization working on macOS?
i think i did yeah, but a release hasnt been published yet properly
should be fixed next rel
wanna TLDR me on what the different env keys are? looking to copy it
sorry for ping, if u dont feel like explaining thats fine too
CSC_LINK: ${{ secrets.APPLE_SIGNING_CERT }}
API_KEY: ${{ secrets.APPLE_API_KEY }}
APPLE_API_KEY: apple.p8
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
```those
cuz i cant find where to source them
i assume signing cert is pretty much obsolete
or is simply using APPLE_API_KEY: apple.p8 alone enough?
@trail night I assume thats a no?
no
👍
the API_KEY is the key file
the KEY_ID is the ID of the actual certificate
the ISSUER is the team ID
you need all of these to submit to the API
vencord paid for a apple developer profile?
shite
kinda dont feel like using my company profile for this ngl
oh well
fuck notarize
no auto update for macOS then
thank you for wasting time on me
(Auto-response invoked by @jade stone)
Alrt hanks
uhm what is this
i can read it???
make the text neon lime green
what
color: lime;```
Oh so they're porting https://store.steampowered.com/app/1349230/5D_Chess_With_Multiverse_Time_Travel/ to css
What is it?5D Chess With Multiverse Time Travel the first ever chess variant with spatial, temporal, and parallel dimensions. It's the first ever chess variant with multiverse time travel!Features Sharpen your tactics by solving a collection of multiverse chess puzzles. Practice against four different AI personalities, each with different streng...
$11.99
6612
It's for subtitles or something
you style future styles...?
which you will never see, because by the time they appear....?
they are current
not future
??????
You can also style past
and present
anyone could explain to me why some css work in vencord quickcss, but not in openasar theming ?
the &:: stuff is getting me errors with openasar
also i'm using openasar theming instead of quickcss from vencord cause at the caveat of needing a client reload to apply, it seems more performant
uploaded as a file to reduce chat space
nvm openasar doesn't like nested css it seems like
does it just error in the editor, or does it not apply at all?
they might need to update their monaco
also theres no way to make applying a theme "more performant"
all it does is add the css to the head of discord
it does error and does not apply at all
well idk, weirdly when i used quickcss it was laggy, but once i disabled it and moved the css to openasar thing, it fixed the lagginess experience
maybe it's just placebo tho idk
They are adding time travel to css
Only works with computers equipped with GPUs that have quantum acceleration like the 50 series of RTX GPUs
Works like :hover but instead targets what the user will interact with next
-# ||or maybe its something with subtitles, idk||
i'm guessing its so you can match subtitles like
[this subtitle is in the past] -- matches `:past`
[this is the current subtitle] -- matches `:current`
[next subtitle line not shown] -- matches `:future`
Yeah
stupid question, but for the css how much deep is it worth going ?
like if i only have one [class*=<stuff>] that work, i mean it's good and if discord move it around it has a low risk of breaking, but i would guess that for the CSS to be applied the thing has to search what i target so it's maybe slower and also it has a higher risk of having a side-effect i didn't noticed ?
but then if i go like full path to the element it will point at it directly and make it faster maybe, but it mean if discord change one thing, it break
so what would be the "best" way to make the CSS ? always go for the more minimalist approach, try to just go as hard as possible or some point in between the 2 ?
The best way to use generic selectors:
- Prefer ^= over *=, as searching the start of the string is faster than searching the whole string
- Prefix generic selectors with Element name, ex:
div[class^=channelTextArea], as searching for only one element type speeds search tons
also is there maybe a tool to see to what a specific html element a CSS rule is applied to ?
it would probably help me discover the thing i modify accidentally
selector {
background: red !important
}
Or document.querySelectorAll('selector')
yeah but then what if visually it's hidden between stuff
oh nice seems good
In general just make sure it feels specific enough
i try to make it specific enough to only match what i want, but lax enough so that if discord decide to mess around it has some chance of not breaking
Discord will always break your css
😢
also this stuff is goated, thanks def what i needed
#📜-js-snippets message
If you really want to make sure your CSS is fast
my CSS is do bad that running the bench completely freeze my discord 💀
ok there is this weird effect going on the more specialized my selector is, the worst it perform
it's like the opposite of what i think would happen
More for it to check I guess
I'm pretty sure querySelectorAll performance is quite different from styling performance though — qSA is "which elements match this selector" while styling is "which selectors does this element match"
mmmmmmm
based on what it show me in the quickcss i would expect it to match, but it seems like it doesn't when i use ^^ but it does when i do ^* why is that ?
Because the class attribute here doesn't start with bottomRowActionDisabled
In the first place having two attribute-starts-with on the same attribute is kind of silly
well the quickcss show me this
<element class="bottomRowAction… bottomRowActionDisabled…">
<div class="bottomRowAction_d936aa bottomRowActionDisabled_d936aa" ...>
seems to match that format
wait so they don't actually concat like what the quickcss hover thing show ?
bottomRowActionDisabled is not at the beginning of the string
mmmmmmh
the string is bottomRowAction_d936aa bottomRowActionDisabled_d936aa
and bottomRowActionDisabled is not at the start
so each thing reevaluate separately unlike what the quickcss tooltip show
What quickcss tooltip
i thought when you did [][] it combined in some sort or regex/match/etc
the one shown here
Hm
When you do two starts-with selectors, it checks whether the attribute starts with two strings
Which, unless one is a prefix of the other (as is the case here) will of course never match anything ever
css literally has time travel
@naive bane hai i was told to ping u
is there a way to replace a cursor state with an image just with css? i tried a bunch of stuff but it never fully replaces the pointer for all interactions


If you mean replace all cursor: pointer with a custom image, then no, nothing automated
You'd have to find every rule that sets cursor: pointer and change it manually
damnit that would take forever
i tried with stuff like
a, button, input[type="button"], input[type="submit"], input[type="reset"], [role="button"], .custom-pointer {
cursor: url('./theme-resources/select.png'), pointer;
}
``` but that didnt work for like half of them, it seems some just change it back even if i set if to certain divs entirely they just change to the normal pointer
i'm trying to make it work for stylish and vencord respectively so that it can be applicable to molst websites for all interactable objects and divs etc
(stylish as in the chrome plugin)
hmm
ported my custom client to web
It's actually wayyyy slower compared to the native app
@native spruce native performance
rewrite it in assembly smh
All loaded on the fly
what platform is this for
all
yeah it works on most everything
not tested on iOS and MacOS since I don't have an iphone or macbook
its so fast
there is a MacOS build in github actions, and it does compile, so that's something
yeah that's generally the goal
makes the normal discord app look so slow
of course I have other targets in development, but speed is one of them
it's super nice on older devices as well
weird what happens when you don't use react with 4 billion frameworks
truee
although a lot of discord's iffyness is actually the codebase and not the framework
but I'm sure a lot of the performance could come from react native / js stuff depending on the platform
the analytics don't help
they just do some questionable stuff
here's a good one- ever notice that delay when clicking on guilds on the mobile app?
@frosty obsidian
I think they wait for a network request to show the view, so it feels like shit
my client will probably be a bit faster than yours on android due to not needing any sort of bridge or interop
does it just compile to java or something
It compiles natively
wing why did idea freeze
i haven't used dart
i tried dart and hated it
I think it compiles to native objects
so it's not java
the only transpilation that really occurs is when compiling to web when not using WASM
which goes to JS
oh neat
but it has been noted that yes, native apps are generally faster across the board, although not by a ton
huge
ah yeah
w/e?
whatever
ah
yeah I started using flutter for school stuff and it's just nice idk
super good packages, I like dart, it's fast, the tooling is great, cross-compilation to all platforms is a super cool bonus, etc
job market sucks, but I haven't really been looking since I'm just outta high school
compose is also cross platform but its just not quite there yet for all platforms
what platforms?
ios, android, desktop, web
oh wow
is there a good web demo?
the only site i know that uses it is zeets
but his isn't a great example bc its not interactive
zeets?
web is in alpha
the wasm api is true compose
ios is in beta
it renders to a canvas
yeah that's where flutter is kind of at
desktop and android are the only stable ones
I wanna do WASM but a few of the libraries I use don't really support it because of careless importing
although i think ios support is production ready
i just really wish desktop support didn't create incredibly bloated binarys
oof yeah that's kinda rough
not always
gloom desktop was 200mb
you can massively reduce the size by specifying the modules and running proguard
default includes every module
i specified the modules
did you enable proguard
fix
its still not great for other reasons
all of it xd
you can make well performing rn / electron apps
like how you can't customize the installer
I mean there's some jank / performance issues that I see across all electron apps, but discord just adds their own spice lmfao
same dev
name one jank or performance issue in vscode
conveyor makes much better packaging
i really just needed an installer that could do registry stuff
I will put you on a conveyor belt
state loss issues, window dragging issues jank, window freezing (less common), reload jank, component load jank, generally bad performance to name a few
do not
bad performance
what
are u running a potato from 2003
compared to native yeah
when indexing large project vscode struggles much more than something like zed
not that electron isn't capable, it's just issues I notice, that's all
zed is the only example that's faster
zed is native, that's why I'm comparing it
you asked what issues are caused by electron, those are the issues I notice
sorry if you disagree with what I notice lmfao
@frosty obsidian i think graalvm helps with compose desktop im gonna test
also idk what state loss issues whatever that's supposed to mean has to do with electron
happens in so many apps 😭
state management is hard
that's jank I see with electron apps more. Why? Unsure. but I do.
in any case, electron is important, I just definitely notice the jank, and it isn't only bad discord coding
insaneee
real
anyway that's besides the point, discord could perform well with electron if their code was better
me when I writefile for inter-process communication
vscode performance is excellent
guhhub desktop
linux fifos
malware
https://github.com/desktop/desktop review all code @royal nymph
I wonder how much of a role their flux system plays in the bad performance
Central store handling thousands of events...
scary
like ws events?
I've never heard of this, this is interesting
among other things
there's a doc about this by Facebook
most of their state is flux based
Google Facebook flux and you'll find it
I actually don't know a lot about discord's client internals despite dealing with the user api a lot
there's a central flux dispatcher which handles subscriptions and the events
wing works for discord
then there are flux stores which are stores for all data discord needs
oh yeah that's fine
each flux store has its own subscriptions
and the gateway and many other things dispatch flux events
so there's the primary dispatch, then each flux subscription individually listens to a seperate bit of the gateway dispatch?
so when a user updates, it dispatches USER_UPDATE which then notifies the UserStore which updates its data and notifies ui components that are subscribed to the UserStore
no
there's one single central dispatcher
all events go through that one central handler
discord has to manage a lot of state
okay yeah I got that
I imagine that that might be a big bottleneck
pretty sure Events are dispatched consecutively
I... don't think so?
That's what I do
I handle events in a single gateway parser and there's a lot, but not that many
that's normal yes
theres a lot more when you subscribe to guilds and junk
yeah I have that already
but you don't have one central handler that handles thousands of events and hundreds if not thousands of subscriptions
opcode 37 stuff
I do. I have a gateway dispatcher that handles all gateway events
but it also depends on how many servers you're in
there aren't thousands of gateway events
wing
Not unique no
and how many friends you have
I'm not following here.
When you say thousands of events, what are you referring to?
the entire app uses events for everything
yeah that's normal
gateway events are only a minor subset
I don't think you've checked how fucking long that line is
opening this made github mobile hang
yes they are
not having to care about analytics will help us greatly
high count of events does not equal high total volume
which ones?
we don't have to report every single thing the user does
the official client does
wing secretly works for discord
the settings api would be more of a bandwidth thing than a performance thing
but like, I doubt a settings call is gonna hurt your frame times lol
the problematic payloads are ready and ready supplemental
according to some people analytics causes big lag but vencord notrack doesn't seem to make any difference
oh yeah the ready event is a chonker
like idk I don't really see that much of a problem with discord's event stuff
you will write an optimised streaming parser in rust
nopp
I already do guild subscriptions and process nearly every user event type and it's not super expensive
the expensive bit is content rendering
kotlinx serialization is already very fast
it could be faster
ill move to zstd at some future date
you know how discord kotlin has this deranged manual json parser where the entire app broke when they changed the order of fields once
I wonder if that was cause of performance gains on potato phones
the zlib stuff is probably the biggest bottleneck and even then its not by much
discord is actually so bad on older phone
I might benchmark my app vs discord
but holy smokes
yeah
just their payload parser
even worse on bad phones
they use gson for the actual data
I downloaded the legacy client, and I'll say that it's way stranger than I remember
very fast
but strange
and gson doesn't care about order
even discord kt is innefficient in certain areas
my phone always gets warmer when i open discord
i have no idea how I'm gonna do caching yet
code
oh god I did something terrible for caching
lots of stuff needs to be cached in memory and on disk
I made a required readonly value for every network object's json recieved from the network
so you just cache from the original value, since there isn't any changes over it's lifecycle
stuff does change pretty frequently though
messages get deleted and edited, people change their profiles, presence is a thing
and a lot of data structures will only give you an id and not the actual object
discords api is designed around aggressive cacheing
I've thought about that
I actually do have mockups of an app I might develop with a few friends at uni
private suspend fun listen() {
wsSession.incoming
.receiveAsFlow()
.buffer(Channel.UNLIMITED)
.map { frame ->
frame.parseAsText(inflater)?.let { str ->
try {
json.decodeFromString<GatewayPayload<JsonElement>>(str)
.also(::logIncomingPayload)
} catch (e: Exception) {
Log.d("Gateway", "Failed to decode payload", e)
null
}
}
}
.filterNotNull()
.collect { payload ->
if (payload.sequence != null)
sequence = payload.sequence
when (payload.opCode) {
OpCode.Dispatch -> handleDispatch(payload)
OpCode.Reconnect -> handleReconnect()
OpCode.Heartbeat -> handleHeartbeat()
OpCode.Hello -> handleHello(payload)
OpCode.InvalidSession -> handleInvalidSession(payload)
OpCode.HeartbeatACK -> handleHeartbeatAck()
else -> {}
}
}
}
processing gateway so easy
@mild yoke do you log the trace(s)
just curious
elaborate?
the _trace property
don't think so
sent in the ready, hello, and resumed payloads
i can share my code if you'd like to
erm sure
maybe it could be translated to dart
I mean maybe
I made a fork of a bot library
/**
* Logs the `_trace` property sent in the Resumed, Ready events and the Hello payload
*
* @see buildTrace
*/
// TODO: Make extension function one proper Logger is created
internal fun logTrace(trace: String) {
val parsedTrace = Json.decodeFromString<List<JsonElement>>(trace)
Log.d("Gateway", buildString { buildTrace(parsedTrace) })
}
/**
* Assembles the `_trace` property sent in the Resumed, Ready events and the Hello payload
* into a readable format for logging
*
* Should produce something resembling the following output:
*
* gateway-prd-us-east1-d-dkmp: 266.217ms
* | id_created: 0.914ms
* | session_lookup_time: 0.273ms
* | session_lookup_finished: 0.023ms
* | discord-sessions-prd-1-132: 260.845ms
* | | start_session: 154.152ms
* | | starting_guild_connect: 0.078ms
* | | presence_started: 0.247ms
* | | guilds_started: 0.428ms
* | | guilds_connect: 102.282ms
* | | presence_connect: 0.002ms
* | | connect_finished: 102.629ms
* | | build_ready: 1.845ms
* | | clean_ready: 0.002ms
* | | optimize_ready: 1.419ms
* | | split_ready: 0.039ms
*
*/
private fun StringBuilder.buildTrace(trace: List<JsonElement>, level: Int = 0) {
trace
.chunked(2) { (name, data) ->
name.jsonPrimitive.content to Json.decodeFromJsonElement<TraceData>(data)
}
.forEach { (name, data) ->
val prefix = "| ".repeat(level)
appendLine("$prefix$name: ${data.micros / 1000f}ms")
if (data.calls != null) buildTrace(data.calls, level + 1)
}
}
guh the code has codeblock formatting
at the moment I'm going full speed on major features, and I'm leaving a lot of "best practices" behind until I need them- this appears to be one of those things
a mixed array
although this would be nice since I'd like to monitor the performance of my CORS proxy
i haven't found it actually useful yet but dolfies asked me to try logging it so i did
feels like more of a backend utility
compressed json is horrible
corrupted moment
yeah
thats why i said both have challenges
with room I'd have to write migrations quite often
annoying
and entities being mostly duplicates of the api models
and I'd probably have to write the domain models that'd actually end up used in the ui
https://github.com/EsotericSoftware/kryo is what kt uses
cant you just nuke
if youre updating the app might as well kill cache
erm why is my phone 40 degrees
i have an issue
quickcss doesn't like my 165MB of custom CSS
all i'm trying to do is play bad apple 😭
Yeah no shit use an external editor instead
it even crashed discord XD
it couldn't handle it
they said why
bad apple
it's bad apple
but in css
it's just like 300k lines
is there a way to hide the spans like that ? <span>\n</span> (\n i the actual linefeed character, not the characters \ and n)
ok so the gigachad firefox can do it, but the weak chromium can't
https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-only-whitespace
i tried this, but it doesn't work
span:blank
{
display: none !important; /* Prevent display */
}
MF
discord... please strip trailing newlines...
"Hi! • opinions are my own. • <3 • accent: #FF91AF\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n "
this was my plan for opencord
cache would be nuked every time schema changes
roomdb actually supports this ootb
i think i'm gonna write a plugin to overwrite the http responses in some cases so that it trim whitespaces, cause F it, if discord is too dumb to do it, i'll do it myself
@frosty obsidian
This "I'll do it myself" way of thinking is kind of how I am feeling as of lately
Wouldn't it be better to change wherever that's rendered? Messing with the communication layer sounds risky
Not possible
Discord separate thing in little span so the CSS cannot target it
+ it's easier to just edit the received json i think
I never said anything about css
It's what lead me to modding MC
And how generally i think about software now
Like i can't be bothered anymore, if the app fail to do smth, i look for a replacement
And if there's no replacement either i fork (soft or hard) or patch
And in the rare case when i can, either i cope or i drop it
what are you even trying to do
Well how else would it be changed ?
You mean changing the thing that parse the response and create the HTML ?
Maybe could be doable, but no idea, i'm not experienced in that
Fixing discord mess
This
Patching the relevant react component in some suitable way
So that the fact they send F up data doesn't break how it look
Because they send hundred of new lines, well it create hundred of span with new lines that affect how the app look
Here it's in the user profile
It create a long empty user profile
Which because i want to uncap to see the user bio, create a mess
(it's also an issue for vanilla discord if you open the extended user profile thing, but because i go there less i wasn't annoyed by it too much)
what are you trying to accomplish though, what are you doing this for
what is your result
because it very much sounds that what you are doing now is incredibly unnecessary
I want user profiles to not be F up
I want all the trailing whitespaces to be removed
If you wait a bit i'll send a screenshot of what i mean
first 2 screenshots are Vencord
second 2 are vanilla discord
notice how in the 1st case, Vencord has long bio, because i use CSS to show the full bio, but in the 3rd one vanilla avoid the issue by compacting the bio
however you can see the 2nd and 4th screenshots show the same issue of extremely long bio because discord is too F stupid to trim ending white-spaces
🤦♂️
i'm pretty sure if i want to replace the response i just have to dig a bit into the electron protocol API and register a handler or an intercept or smth like that and then it's just a case of checking whether it's an URL i want to handle or not and if it's good then do whatever i want to do on the response then give it back or smth
could probably do it with mitmproxy or smth if i didn't want to bother with electron and injecting into discord, but if i manage to do it inside of discord it's gonna be nicer
and sure maybe there's a cleaner way by changing smth else, but while i do have knowledge about how networking work and hacking stuff around it, i don't really know how the rest of discord work
i know a bit of html, js and css, but like only very basic stuff
there is no need for all that
ok sure, how do i do it in another way
^^
yes, but how
The ability to understand code from just reading it, without requiring documentation
🤣 at least i could half-ass betterdiscord plugins because they had extensive docs
- thanks for telling me to read the basic vencord docs, but i've alr done that
when i mean how, i mean could you explain the basics on how to do it
like even pointing me at an example in the vencord repo would be more useful
but i guess i'll search
there are more than a hundred plugins for you to look at
you dont need to be an ass about it but yeah i agree, an overview of the apis and backend stuff needed for development would be really helpful
they all do change what's rendered ?
a lot of them
ig i'm in for a reading session
cant you just change max-height to some number to prevent large bios
only for the small popout though, not for the big one
can anyone give me a snippet to add a button to the message box? i have an idea for a message scheduler
It's not an option, i don't want a scroll bar, but i don't want to have a cap either (i can alr have that working, i tried it yesterday and got a nice scrolling bar and stuff, but it was just meh)
I just want to be able to display useful clean data like discord should be doing
It's litterally one function call for them
A free storage service using Discord
One of my first full projects using typescript
If anyone has feedback on this it would be appreciated
that reaction doesnt seem like good feedback ngl
that's cause the concept is cursed asf
i know
cool though
im attempting to simulate the user pressing enter inside the chat box to send a message but its not working. any reasons as to why?
const handleSend = () => {
const textarea = document.querySelector("textarea");
if (textarea) {
const message = (textarea as HTMLTextAreaElement).value;
if (message.trim() !== "") {
(textarea as HTMLTextAreaElement).value = "";
const inputEvent = new InputEvent("input", { bubbles: true });
textarea.dispatchEvent(inputEvent);
const sendEvent = new KeyboardEvent("keydown", { key: "Enter", bubbles: true });
textarea.dispatchEvent(sendEvent);
}
}
};
don't do that
import { sendMessage } from "@util/discord"
don't do hacky Dom stuff
can you give an example? sorry im new to this😭
It kinda won't though with the new discord cdn update, right?
Like they are starting to delete files
??
Discord is starting to delete files on their CDN
that's not about deleting them
it's about needing the key to access them outside of discord
https://cdn.discordapp.com/attachments/1223973149222375536/1270948500879835148/2024-08-07_19.png?ex=66b58e87&is=66b43d07&hm=d5096522f107debd7b6e3aa4be5d97af962e8fe64243b1f7aa95f7fd2b18feb7&```
and that's not even new anymore?
and they can still be accessed on discord without the credential stuff
Is that inspired by this video?
https://youtu.be/c_arQ-6ElYI
How I'm storing hundreds of gigabytes of files on Discord, for free! I wrote a server in NodeJS and a frontend in React that lets me upload any file of any size to Discord, then download it later. Works great! And even hides tax evasion evidence from the IRS!
Don't do this yourself, I didn't actually read Discord TOS but if I had I'm pretty sur...
Oh thats cool
Seems to be less functional than mine though
Only the links, my code uses a discord bot that fetches new links when needed.
The bot uploads data about the file then the chunks so they are identifiable
Oh and no, I hadn't seen that video prior
It was inspired by a conversation I had with my friend
@royal nymph @royal nymph sleep
both of your solutions to the "discord channel as file storage" have pros and cons tbh
what are my cons
from what I can tell, you only do local metadata storage
how does it retrieve the files? on phone right now so can’t really look
for discord specifically
as I just assumed, I think the list of files is stored locally
nuh uh, more complicated
do you store file urls locally
it stores one inode locally, which points to an inode stored in one of the buckets and then it is a root directory, which stores pointers to other inodes for files and directories
pointer basically specifies which bucket and then has some identifier like message id for discord
i was wondering how tf it works
doubt
webhooks can create edit read and write so basically everything
no?
how does it work with expiring links
webhooks can read?
does the links expire
cant you renew links easily
it reads the message first, and then extracts the attachement url
yes
I didnt know this exists
oh huh
i was thinking history but yes that works
you just track history yourself it seems
shhh thats kinda what I mean guhhh
this way one file can be even split between discord and github
do you edit messages to point to other inodes
if i add new file for example, yes
you should emulate a real file system on discord
where you can have folders, file metadata & history, permissions and different users
do
this is entirely possible with a bot
and you should be able to mount it as a network drive on windows & linux
@meager turret new project for you
ye i thought about making it into fuse lole
discord fuse driver 
that would be insanely cursed
also possible with my system, just more data in inodes
download speeds 📉
wouldnt that also mean reindexing all the time though
because you cant find when something was changed

or
@frosty obsidian


