#๐พ-core-development
1 messages ยท Page 107 of 1
is this 17mb
it is
it looks like the heaps would be so much bigger than v8 profilers says
hm
i might try though i do not enjoy deobfuscated discord
this is the Dot
if accessibility.showrolecolordot
prepend roledot to username
though its been a while since i made typingtweaks
i forgot how i added the avatars
my devcompanion isn't working 
[ViewRaw] add option to make view raw button hidden
add 'addHiddenButton' and 'removeHiddenButton' to message popover api
how do i patch a component 
I'm considering patching 2 places for my plugin, either inside the decoration selection modal or the profile customization page
not really sure what to do after finding their modules

You write regex to find the minimal match you need
And just edit that match
Step 3: profit $$$
small amount of skill issue
Userplugins are absolutely terrible,useless and shit
yeah come and tell some end user to install node and git
then run bunch of commands while they cant open a command line
adding to that no update
resend message all the time ๐ฅด
Content
Discord Account
voidptr_t
What is it that you'd like to see?
It would be convenient to be able to translate messages via DeepL.
Request Agreement
- [X] I have read the requirements for opening an issue above
Can you already use userplugins without recompiling?
No
Don't show server emojis in autocomplete menu (optionally, show the current server's emojis but not others).
and ladies and gentle man, i think this is why some commits discussion are only limited to collaborators, perhaps to prevent nonsense
gitposting
how do i "disable" a plugin that is so wip it probably contains compile errors
โ [ERROR] No loader is configured for ".disabled" files: src/userplugins/forceAMOLED.ts.disabled
just..turn it off from settings?
is so wip it probably contains compile errors
wont vencord not build if thats the case
getting vencord to not compile without a syntax error would be quite impressive tbh
basically all errors are at runtime
if it contains compile errors, what would disabling it achieve?
but yes it is possible, just edit the json file directly
Maybe also add buttons to perform the action on everyone except yourself.
for me on windows it is located in C:\Users\%USERNAME%\AppData\Roaming\Vencord\settings
do note that it is json, you can't have { hi: "there" }, you must have { "hi": "there" }
I use it as my note editor
it is pretty lightweight if you don't have LSP plugins installed
Kate is foss
or just rename the plugin
I don't have Kate bc I didn't know it was crossplatform
am stuck on windows for now
to like disabled_MyPlugin
gnome-text-editor is horrificly laggy
in that case
can't type properly with a lot of tabs open
Gedit?
i think gedit was better actually
this is gnome-text-editor
i used to use gedit to write code lol
i just want to not delete it but have it ignored during build
greetings
(horrific javascript iirc)
i can just move it out of the plugins folder ig but meh
oh my god, I didn't know gedit had file-tree and syntax highlighting
did your old account 
yeah so good and lightweight too!
uhh, rename the file extension to smth like . https://cdn.discordapp.com/emojis/1024751291504791654.gif?size=48&name=shiggy&quality=lossless
i still dont get it why you'd want it to not be included at all
when you could just turn it off
vscode, sublime text 4, nano, all jetbrains IDEs
I count nano bc I use it frequently for small changes
husk
it comes with that, doesn't it?
nope
does on fedora
well, fedora must be shipping the config files then
lemme remember, its been a while ๐
you need them syntax files
and you include them
huh, actually nano may have shipped with syntax files
just not on windows?
there's currently no good way to do that. just temporarily move the files elsewhere
they've already explained why
I prefer commenting out the entry file
because it has compile errors
either move it out or move it into the normal plugins folder and git stash it
yeah but...enabling/disabling a plugin is a runtime thing
if it can't even compile, then how would that work?
๐
I want to see messages from people I blocked, without having to click the button to show it.
Could you add this as a feature?
(I block people to prevent them from sending me DMs and friend requests, not to prevent myself from seeing their messages.)
you're making no sense. they're asking for a way to exclude plugins from the build
oh yeah I am
who up forking they vesktop ๐ค๐ค๐ค
wtf is VencordPlus
themes:
Simple plugin that automatically replaces twitter.com and x.com URLs with ones that have been "fixed" so embeds continue to work.
you can do something similar with textreplace, no need for a whole plugin
you can do something similar with textreplace, no need for a whole plugin
Happy to close if considered undesirable.
yes there are already textreplace rules for this. thank you anyway!
MoreUserTags (had no effect):
ID: 609853
Match: /children:\[(?=\i,\(0,\i\.jsx\)\("span",{className:\i\(\)\.botText,children:(\i)}\)\])/
IgnoreActivities (had no effect):
ID: 238852
Match: /(?<=\(\)\.activityTitleText.+?children:(\i)\.name.*?}\),)/
IgnoreActivities (had no effect):
ID: 238852
Match: /(?<=\(\)\.activityCardDetails.+?children:(\i\.application)\.name.*?}\),)/
MoreUserTags (found no module):
ID: -
Match: .renderBot=function(){
None
font-weight: bold;
color: purple;
resetSocketOnError ReferenceError: Cannot access 'Dye' before initialization
at Module.default (WebpackModule132978:2:50)
at VencordWeb:13:748
at Kf (VencordWeb:6:10726)
at VencordWeb:6:10823
at [vencord.lazy.get] (VencordWeb:6:8193)
at ms.<computed> [as get] (VencordWeb:6:8667)
at Object.handleProtoChange (VencordWeb:49:50890)
at CONNECTION_OPEN (WebpackModule473419:2:5861)
at https://discord.com/assets/40a0d0452b53e2f3480b.js:12285:975
at https://discord.com/assets/40a0d0452b53e2f3480b.js:12275:847
%c[FetchBlockedDomain]
font-weight: bold;
color: purple;
Unable to process domain list delta: Client revision number is null
%c[FetchBlockedDomain]
font-weight: bold;
color: purple;
Downloading the full bad domains file ```
MoreUserTags (had no effect):
ID: 609853
Match: /children:\[(?=\i,\(0,\i\.jsx\)\("span",{className:\i\(\)\.botText,children:(\i)}\)\])/
IgnoreActivities (had no effect):
ID: 238852
Match: /(?<=\(\)\.activityTitleText.+?children:(\i)\.name.*?}\),)/
IgnoreActivities (had no effect):
ID: 238852
Match: /(?<=\(\)\.activityCardDetails.+?children:(\i\.application)\.name.*?}\),)/
MoreUserTags (found no module):
ID: -
Match: .renderBot=function(){
None
font-weight: bold;
color: purple;
resetSocketOnError ReferenceError: Cannot access 'Dye' before initialization
at Module.default (WebpackModule132978:2:50)
at VencordWeb:13:748
at Kf (VencordWeb:6:10726)
at VencordWeb:6:10823
at [vencord.lazy.get] (VencordWeb:6:8193)
at ms.<computed> [as get] (VencordWeb:6:8667)
at Object.handleProtoChange (VencordWeb:49:50890)
at CONNECTION_OPEN (WebpackModule473419:2:5861)
at https://canary.discord.com/assets/bc691a76e3904bd03355.js:12285:975
at https://canary.discord.com/assets/bc691a76e3904bd03355.js:12275:847
%c[FetchBlockedDomain]
font-weight: bold;
color: purple;
Unable to process domain list delta: Client revision number is null
%c[FetchBlockedDomain]
font-weight: bold;
color: purple;
Downloading the full bad domains file ```
whats the point of building for different systems? should it not be compatible with any as long as you build on something like ubuntu-lts?
since the previous version was just a prerelease, 1.0.0 should be fine
"version": "1.0.0",
wouldn't this just work?
module.exports = binding;
shouldn't this be
Napi::Error::New(env, "[venmic] 'link' requires one argument").ThrowAsJavaScriptException();
you're misusing headings here
# is the primary heading (h1), of which there should be exactly 1, which is the title
for each nested header you should increment the level by one, so usage should be ##
rip xd
should probably amend that firefox developer edition exists for those who dont want to deal with the potential instability of nightly
because ive had builds of nightly that would just instantly crash and thats what made me go back to vivaldi for a few years
yea, used nightly for 2 weeks then some websites like yt just crashes the browser
or the browser just wouldnt work
I didn't see this pr, but I implemented this again in #1784.
when the unstable version is unstable 
Thought so as well, the documentation for pkg-rebuilds did it like this as well so I just went with it, will update it later
Yep, good catch, copied the usage from the cmake-js example which seems to be wrong
Compiling for arch is to ensure that no compiler update suddenly breaks the build (i.e. there were some permissive changes some time ago that would cause breakage with certain build flags)
And compiling for fedora is to ensure that we have a build with a glibc version that isn't necessarily the latest.
I chose fedora as ubuntu doesn't use pipewire by default and from experience most ubuntu users won't explicitly install it either - fedora seems to be widely used and ships pipewire by defaul...
Also, the ubuntu-lts GCC Version is so ancient that it doesn't even support C++20 if I'm not mistaken
Are you sure the Arch build works on the Steam Deck, then? I can test it if you like.
Are you sure the Arch build works on the Steam Deck, then? I can test it if you like.
It should - if it doesn't the Fedora Build will work for sure but it would be great if you could test it ^^!
As the title is beneath the logo I've made all headings h2
whoops thanks
Yes would be useful
But should work
Ah, well would be best to test both
you can test the addon by running $ pnpm run install and then open the node repl $ node, then just require the .addon file without extension
should probably add some super basic js tests to make testing it easier
im surprised you didn't do that, how do you test it? just manually?
not hate but there's 0 reason for us to adopt it and most people use windows
Well we'd need a complete PipeWire Environment with a Node that is emitting sound to test things
Or would you just like tests that simply require the module and test if it expsoes the functions properly?
at the very minimum you could add test cases that just check that the functions work correctly and validate args correctly, would have caught the missing throw that way 
Ben
anyway i can just do that when i test it
@austere talon hi
are you a vending machine?
yeah
Yeah that would probably be better I'm not too familiar with testing frameworks and which one you'd prefer
oh, for something this small I'd just use normal js, maybe with the assert module
I mean we didn't have tests before 
are you the main character of https://anilist.co/anime/153360
After dying in a traffic accident, I find myself standing near an unfamiliar lake. My body won't move, I can't hear my voice, and when I try to shout in confusion, words that I never expected come out! "Get one free with a winner." I-it seems I've turned into a vending machine...! I can only do what actual vending machines can. It's impossible t...
no ofc not, but you can use it as build tool
Oh
nodejs
my initial node addon did 
Building installer takes 9 morbillion years
tbh the main reason i wrote tests was cause my C++ code tends to segfault sometimes
How did u even wrote installer
Alr the lecture right now is boring af anyways, I'll add tests
because you're compiling C++ gui libraries
it's compiling opengl libraries
the cli builds in a few seconds
What the fuck
Why doesnt it take those prevompiled
glfw
Ah
the installer is to be rewritten anyway
cause it has poor support for older hardware
Use https://GitHub.com/saucer/saucer :^)
๐ธ Next-gen desktop apps with web-frontend in C++. Contribute to saucer/saucer development by creating an account on GitHub.
i picked an arbitrary framework in a language i like (go)
I Doubt discord can run on old hardware
oh my god btw @turbid hatch hows the state of wails installer
Write in powershell
im sorry i totally forgot to look at it until now and you never really brought it up
nah, the installer is in go
is currently in go
Curve will rewrite in electron
id sooner make it electron than C++
go honestly seems pretty cool
Fuck electron wtf
What ever you prefer ^^
Tbh any language with webview is good as base
No I'm 100% a c++ slave
curve
As long as build isnt 9gb
It's a good thing
Everytime I touch a language that isn't c++ there's at least 10 things I miss that c++ has
give go a try once, it's kinda similar to C but with a strong stdlib and memory safety
if I ever learn something lowish level I'll just learn zig
and has very basic oop without the shitty aspects
or rust
C++ has that as well and is interoperable with C :)
okay butttt
i think it's generally a good idea not to use all C++ has to offer
maybe you'll find go fun 
okay but it's called go so therefore it goes fast
that applies to all OOP
well yeah
inheritance sucks in most cases so you should use it very sparingly imo
although now we get into very subjective territory
yeah ๐คฎ
some people swear on their oop
And meta programming is just ๐คฉ
it's easy to create a lot of code smells using inheritence
evaling js from c++ 
does it have concepts/sfinae and turning complete meta programming?
If you want a proper WebView that's a must have
is it?
since you are using c++, might as well expose native functions
i mean... electron works the same way
you eval code from the node process
in the renderer process
you'll always be evaling code with web frameworks
That's the most portable way - Also WebView2 doesn't support exposing fully native functions properly
this
why did ReviewDB get removed from Plugins?
Look at #๐ฅ-vencord-support-๐ฅ
this looks like the only advantage this has over tauri
but only one event for webview?
Me?
When will people finally learn to Ctrl+f ๐ซ
never
Yes
window.onload would be very useful to have in C++ or Rust
Nothing there.
Nothing there.
never look into #๐ฅ-vencord-support-๐ฅ you will want to die
Good suggestion, will add ^^
1h in #๐ฅ-vencord-support-๐ฅ makes you die 1 year earlier
oh, you are the dev?
if so, add as many events as you can ig
Well I'm not trying to compete with Tauri but simply offer a c++ alternative ^^
Will do after I've added module support so that you can access the native underlying WebView
are bindings for Rust possible?
Yes, I've had c bidings as well but due to current api changes I've removed them for now
does ur framework have
- blocking ipc
- blocking and INSTANT preload
- ability to modify requests/responses (mainly for patching csp)
those are the main things i found lacking in other frameworks than electron
Node bindings also existed
First two yes, last one yes but not currently exposed
tauri claims that WebviewRuntime2 does not support network intercepting
wow that's already better than other frameworks
how about 2? what i mean is being able to run js AS SOON as the page is initially ready, similarly to a script tag at the very top of the dom
Yes use inject
damn good framework then 
The saucer window object is injected that way so that the js code can properly access it
saucer is a funny name
does it work properly across all frames?
some websites have iframes and that may be wonky
What can I say I love the X files
time to port vesktop to saucer (eta 2038)
Yes it injects to all frames
But have not battle tested that
Should work though
but also electron has crazy many apis for all sorts of shit, i feel like matching that in other frameworks is really hard
also amazing tools like electron builder
Yeah, I think making a full electron alternative will be out of scope but being lightweight and re-using the system webview is something that electron doesn't offer
Btw
Look at this shit
Who in their right mind
Has class names this fucking long
yes
microsoft moment
webview2's api is so fucking ass
the entire windows api is fucking ass man
well said
yeah
@topaz thistle plans to support servo? (https://github.com/servo/servo)
if so, it would be awesome if we could bundle servo, for platforms w/o a webview
always gets you that close to fucking haning yourself
does it have a c api?
the only good aspect of windows api is that the microsoft documentation is very extensive
if so that would be a pretty nice thing
true
Looking at you pipewire api
i made this thing with very little C++ and zero winapi knowledge
i don't use it anymore but it works (mostly)
upside down vee 
Looks pretty good from first glance
also
The function names are slightly obfuscated as with full names (SetKeyHookConfig instead of SetKHookConfig), Windows Defender was flagging vlock as RAT (lol)
๐ญ
Lol
Have this comment over the long as java looking names
Had it as will kill you but some people told me I should probably change that :/
for legal reasons
for illegal reasons
Nice, will add it to the roadmap
I know the struggle, soundux support is endless loop of same three questions
yep 
i think people who ask questions answered in the faq deserve death by firing squad (in minecraft)
at this point, the only reason I make support channels in my servers, is so that I can ignore them and direct people to them
(not in minecraft)
support is a lot of whitenames helping whitenames which is kinda cool
fill it with ai bots that spread misinformation
thats pretty epic
also often time people who have no idea trying to help people who have even less of an idea
what kind of saucer is this
VenAI when?

cool logo saucer
aren't saucers like plates but for cups
a chromatic one
or ufos
wait hold up are you saying that your name is literally (
(that was an awful joke i am sorry)
hahahahha
vns #1161643117737422898 you need to go here
๐ #1161643117737422898
@austere talon should I use npm pack for the tests? (Is that the correct way to test packages locally?)
homie made a channel to roast me
Alr ๐

emoji fail
huh how
OH THATS WHAT HAPPENED
i wondered why it was visible for like 2 seconds
and then said unknown
would be funny if there was a ๐ pointing sideways
he goopy
๐พ
hehehehehhehee

i have no idea what that text says and i have never seen this image before
i loaded a 3mb twemoji ttf into canvas but idk it doesn't work for some reason
LMAO
im too lazy to fix and these emojis are fine
the pink one looks like mike
lmao
the text engine may have a skill issue be quite basic

hmm
I'll be home at like 15:35 (+-15) and then add tests, so probably at 16:00
So better start cleaning the kitchen ๐ซ
btw if you're interested in also integrating it into vesktop, feel free to do so, just base it off the branch i made for it, the basic framework is all already there
otherwise ill do it
i wonder how you are using canvas in node
good ๐โโฌ
node-canvas
use skia instead
ah, so i guess that doesn't support emoji
Node canvas is a Cairo backed Canvas implementation for NodeJS. - GitHub - Automattic/node-canvas: Node canvas is a Cairo backed Canvas implementation for NodeJS.
it does
fuck
just something wrong with the twemoji font loading dunno
Might give it a go after it's merged ^^
says Cairo tho
oooh, was not a reply to me
?
doesn't make sense as a reply to either 
ven dum dum
vns
there are emojis right here toad
oh guh
wrong reply but yes
brain fart
idk i find node-canvas very good, and comfy api since its just web canvas
what emoji font is that even
Is that image really generated each time? I thought it was just a quickly drawn PNG lol
it looks like old noto
idk what the emoji font is, noto or smth
it's RHEL so that would be plausible
yes it's generated
imagine if you had puppeteer to take screenshots of the channels
ROL really outdated linux
vns #1015073917938966568 fully | generated
German engineering ๐ฉ๐ช
๐ #1015073917938966568
but it uses a basic template ofc and just draws the texts on top of that

would make more sense just to implement more cases and fix emoji rendering
vns #1028117287716261939 voice chats don't | look right
๐ #1028117287716261939
(such as no category, different channel types)
what if I want the bot to respond in PDFs?
you don't need a browser and print

this would confuse people
i'll go to #๐ค-bot-commands
yeah ofc
it's probably one single patch
look at the other functions among the ones it patches and you might just find it right away
css can do that ๐ญ
it can do nitro themes too
The "feature" should be client side anyways so you could probably just patch a check for hasNitro, right?
Hi! looks like electron 27 has reached stable now. could you try the stable version?
What do they even change in electron versions
Actually they can change their api
But still its chrome
fix their apis and update chromium
a lot
omg it fixes the devtools bug
@austere talon Added tests
They're super basic but I guess that should suffice for now
In this PR, I resized platform indicators to 17px (14px for mobile indicator) to be more size consistent with other icons.
Default size:
(100%)
(200%)
Resized:
(100%)
 func or smth along those lines
that returns a boolean
both work
yep, I'll debug that and find out if it crashes in rohrkabel or the addon
maybe libpipewire segfaults because there's no systemd / any init system
this is going to be fun to debug :)
works on X11
okay now time to test on waylander
works
wait how do i test if its running with my flags
it still has window decorations even without the enable flag
Oh well that makes sense
Yooo
i love pnpm upgrade --latest
just bump everything to latest including major, surely it will work
v27 is now available? That means stuff has been fixed
test it
which is it, github
invited you as collaborator
thanks!
even with these changes, it still requests twice for me. once initially when requesting the screen, then when you click ok and the stream is about to start. but that seems to be entirely out of our control
how would I get the contents of a settings store? I want to get my whole friends list and I think RelationshipNotifier stores it so I want to get its content
Vencord.Webpack.Common.RelationshipStore.getFriendIDs()
// copy to clip
copy(Vencord.Webpack.Common.RelationshipStore.getFriendIDs().join("\n"))
thank you!
you could also export their entire user data if u prefer that
copy(JSON.stringify(Vencord.Webpack.Common.RelationshipStore.getFriendIDs().map(Vencord.Webpack.Common.UserStore.getUser), null, 4))
these issues should now all be fixed (including the electron 26 whitescreen)
Instead of the virtmic binary you could try to use kakxem/node-pipewire, that may be a bit cleaner than bundling a prebuilt binary.
Curve is helping us turn it into a native addon instead. thanks though!
can any mac users test this? https://github.com/Vencord/Vesktop/pull/121
@nimble plaza i think u said u had some issues with permissions?
However, it might still be possible to tell if the installation is not portable by checking if the path of the executable contains "AppData/Local" or "/usr/bin". I don't know if this solution would cause problems, so feedback is appreciated.
sorry for the late reply. No, that sadly wouldn't work, because the nsis (windows) installer lets u customise the location, and different linux distros may install to different locations.
does this make an API request for every user on the list?
because I have around 300 and I don't want to be limited
ohh okay
badword
o
wdym?
should we just publish to npm?
the virtmic?
yea
yeah no rush
gimme 2 mins
that one works (pops out at startup but not a big deal)
this as well
wouldn't recommend that, it may ask for both at the same time if it feels like it
oh true
actually, as pointed out by lumap, it might be both at once. in any case, the default case should call callback(true)
Uh, my current implementation supports both at once. It's not if-else, it's if and if. Default case being callback(true) makes no sense to me, could you elaborate?
Default case being callback(true) makes no sense to me, could you elaborate?
because there are other permissions that may be requested that we do not want to disallow.
As for the if blocks, your suggestion of using else if instead of if makes the permission requests mutually exclusive. My initial implementation makes sure that both can be requested at the same time.
@high oracle
anyway for the default case
if you do not call the callback, all permission requests will be pending forever
this breaks clipboard, notifications, etc
I don't know what you mean by that, my implementation already covers both permissions being requested at once, no?
all other cases of permissions stall forever without callback
don't edit that
thats saying to scratch the if else because it might be both at once
but you still need the default callback call if no case is handled
the suggestion. you should scratch the suggestion
I just don't understand what you meant by it not covering both cases, when it clearly does
aight
wait actually
i just left that feedback up because otherwise the else makes no sense
yes you call callback twice actually
great
thats wrong
i would do like
let granted = true;
if (audio) {
granted = await askForMediaAccess("mic")
}
if (video) {
granted &&= await askForMediaAccess("cam")
}
callback(granted)
just make it
hm sure
shouldn't default be false
no?
default is undefined
this isnt go :p
js has no types silly
how would it know that you're storing a boolean
uh okay
we want the default to be true anyway
why? isn't it better to assume that permission wasn't granted rather than to assume it was?
because the latter could cause problems
no
the permission handler handles all other perms too
clipboard, notifications, etc
you don't want to deny those perms
yes but this is in the context of media permissions
those go under the callback(true) remember?
im saying make that code the entire handler
ah okay
you mean it like this right
yeah
I think I can get rid of permission === media
you might get type errors
since the only way mediaTypes include audio and video is if permission === media
nop
yeah there we go thats bettert
Should I use DataStore like reviewDB did to store auth data for multiple accounts?
yeah that's the best way
ok
but why would the plugin need auth
it's decor
iframe 
nop
vee u still have the monster fart decor and every single pfp you have gets a whiff
@austere talon what's the constraints of datastore?
I don't need to store a object, can i just store a string?
wait
i see how it works now i think
thnaks
@austere talon Running PipeWire in docker seems to be fucked https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1720
I'll adjust the tests accordingly
@austere talon PR should now be ready

Can you check the exception message with assert?
dunno
well this is new
i was able to refresh discord (with vencord) and get back in fine
oh lol its only stable
canary and ptb are fine
Does datastore have a hook i can use 
a what
no
dang
alr @austere talon PR is now actually done
@austere talon did reviewdb's init auth on flux connection open actually work? I'm trying to do that and it's not working
oh brh
you need to also use start method
can somebody help me
vns
I'd like to use zustand in my plugin, I've tried obtaining the relevant methods with regex patching but it somehow totally fucked up vencord so ideally i'd like to just depend on the library, but how am i meant to do that as the library depends on react
oh I think I can help with that
have you uploaded your progress so far to a branch or smth?
you can write your own implementation of zustand in like 20 lines of code instead of using a whole library
personally I prefer pinia, but that is a vue store
I did it in like 20 of my codebases when I did enjoy using them, now I realized they are crap and stopped. lol
yes but not any of the store stuff yet
I wanna see if I can use zustand first before doing that
I need it to manage state across different bits of the app
reactive state?
like, are two stuff rendered at the same time and you want them to share state?
yeah one sec i'll share what I need it for right now in a moment but I need it for this later
Right now I'd like to use it to solve this
having to switch pages
eh, you can get away with just saving to the plugin object
or does zustand offer persistence across reboots or smth?
zustand does offer persistence but that's not a issue
I just think if I'm gonna need zustand for more advanced state down the line I might as well solve this with the same tool
This is what I've got rn: https://github.com/FieryFlames/Vencord/tree/decor-take-zustand (It's broken from the attempt at getting zustand)
I'd use the data store instead of trying to get zustand to work
I'm using the data store rn for auth, but it doesn't have a easy way to subscribe to changes (and rerender the component)
and datastore isn't the right tool to use for the other thing i need zustand for
you could use the settings api and make the settings hidden
but that aint good for complex data afaik
unless you serialise it
yeah ideally i just need zustand .-.
bc i've already got the zustand store all worked out from the vendetta plugin
does anybody know where the plugins are stored locally? cant seem to find a folder
In the source code https://github.com/Vendicated/Vencord/tree/main/src/plugins
so how would I go about creating my own plugin? I dont see any src on my pc
You clone the Vencord repository, add your plugin to the source, and then compile vencord yourself
That makes sense, thanks
@junior olive to fix the errors you are getting (before the plugin even loads), do this
zustand aint available at compile time, yet you were using it as if it was
cant be in the top-level
actually bad advice
dont use () within makelazy
lmao
oversight
Yeah I had a feeling I was doing smt wrong
Is it possible to just use the Zustand library as a dependency?
that would be the same
in both scenarios you are getting zustand when discord is loading
cant have code that uses it before it is loaded
I have a fix, one sec, working on it
why not useState?
Yes, but I wouldn't have to deal with finding the various Zustand features I want
because from what I see this is what zustand replicates
I want Zustand for more advanced state management
See this
wait- that's vendetta
I'm working on the same plugin for both vencord and vendetta
why not just set a state as an object?
why would u add a library like zustand
thats pointless
like strencher said u can just make ur own hooks or use vencord hooks
Zustand seems to take 99% of the work out of it
it is already bundled with discord
so not that bad of an idea
bc I have a slightly advanced state object for managing the users decorations
a custom react hook is all you need tbh
won't be longer than 30 lines of code
A Zustand store seemed like the way to do what I wanted to do.. so I did it
const listeners = new Set<Function>();
function updateDecors() {
Decors = dunno();
listeners.forEach(l => l());
}
function useDecors() {
const update = useForceUpdater();
useEffect(() => {
listeners.add(update);
return () => listeners.delete(update);
}, []);
return Decors;
}
you don't need a library
please looook at the store I used in vendetta, I wanted a fluxstore style object I could use to manage decorations easily https://github.com/Fierdetta/decor/blob/main/src/ui/stores/UserDecorationsStore.ts
I'll resolve this for now, let me know if there's anything we should still discuss / test ^^
@junior olive https://github.com/FieryFlames/Vencord/pull/1
Thanks but I would really like to use zustand mainly for the store i've already made with zustand in vendetta.. One of the things I do w/ the zustand store in vendetta that I will probably need to do in vencord too is calling it outside a react component and i don't think i can really do that with this
arjix this api makes me want to puke i have to be honest
and why mimick mutexes in js??????????
the promises dont have to execute in order or after another
cause I assume thats what zustand did
I replicated zustand
also promise hackery like that makes race conditions easily
you replicated zustands engine with none of the niceness of zustand
mutex in js 
you can just use Vencord's queue for this
it's a super simple promise queue
lmao reminds me of my old shitty mutex implementation that would race condition if you awaited twice

i was a bit stupid
YOU DONT EVEN NEED A QUEUE
JUST FIRE OFF ALL OF THEM AT ONCE IT DOESNT MATTER???
why would this need a mutex
lol
I appreciate trying to solve this via other means but I would really just like to use zustand :/
it might matter if u update state async
so that the state is only modified at chronological order
imagine
fire update 1
fire update 2
update 2 completes
update 1 completes
i mean idk what hes doing but thats what i assume it is
and?
most apps are designed where thats not an issue to begin with
so it is persistent across mount/unmount, just like zustand
cursed
this is true tho
Why can't I just use zustand :/
zustand is very nice
ive used it in a decky plugin
works around the lack of global contexts super well
I found it very convenient in the vendetta plugin for the main store it uses
you can use zustand, you just have to make every store have a factory method
factory method?
fucking hell, I hate the Ctrl+W keybind that discord has
I lost an entire code block due to it
huh, it no longer works?
ctrl W?

I'm gonna close that PR because it doesn't really do what I want to do
alr thanks
anyway if u can grab zustand from discord that's splendid but otherwise i'd rather not u add a dependency for smth that "pointless"
We can grab zustand from discord
i still dont really see the need for not just writing ur own basic solution
Like I had in vendetta
@austere talon look, if you can live on with this, then the fix is easy
thats all
Won't that create duplicate stores..?
oh the crash is cause u try to use it before discord is loaded?
i guess so
just make it a lazy
yep
const bearStore = proxyLazy(() => zustandCreate());
this should work
then just use it normally in ur components
ill try
alternatively
let store: StoreType;
definePlugin({
start() {
store = zustandCreate()
}
})
whichever u prefer
i think first is prettier but it will proxy ur store (makes no difference in code / at runtime)
the store is in another file and imported, so the former approach will be used me thinks
VEN I LOVE YOU WE'RE SO BACK
meanwhile me, who posted the makeLazy approach at the top of this convo
Yeah also wtf is the right way to handle obtaining stuff but only using it in other files?
^
yeah but makeLazy is ugly cause you gotta call it first
proxyLazy wraps makeLazy so u can use it like the real object
Having zustandCreate defined in the index but not used there seems odd
proxyLazy is kinda cursed but also really sexy
ven ur so goated
just move it to the file you use it in
how
getter/setter
wdym how
in that file
hm
ohhh are u grabbing it via a patch
yeah
yeah
theres no clean way to do that
you'd need to export a setter function and put it on ur plugin object
then call it from ur patch
hmmmmmmm
okay
setters have to be inside a object right? they can't be the variable
well
export setStore(s) {
store = s
}```
```js
definePlugin({
setStore,
patches: ... "$self.setStore($1)"
})
yeah i have to do that
won't i have to make giant ass patch for that
hm
well ik what i couuld do
@junior olive https://github.com/FieryFlames/Vencord/pull/2
oof did typo
Curve is helping us turn it into a native addon instead. thanks for the idea though!
Ah yeah that also sounds like a good idea.
I tested the code on KDE Wayland btw and it works great for me, besides the thing with the screen sharing portal popping up multiple times. That is a interesting bug, because it also happens in Chrome directly (when just trying to share your screen on a random website), but funnily enough not in qtwebengine (also based on chromium).
besides the thing with the screen sharing portal popping up multiple times
yeah, it's sadly still an issue even after all these fixes. The first time it requests is normal, and it calls our electron registered handler. then right before it starts streaming, it asks again, this time without triggering the electron handler
on a random website
so it happens on any website, not just discord?
this is the discord-virtmic person
i wonder if he'll discontinue it once that pr is merged and maybe also reaches discord desktop / armcord
is there a place for plugin ideas
not possible
spam discord api frfrfr
anything not supported officially by either desktop or mobile isnt possible
the point of the plugin would be to add support for it tho?
not possible
nvm prob bad suggestion coz to make it work it would need to spam discords api
you'd have to fetch all messages and do the filtering manually
yeah
wait you cant do that?
so it happens on any website, not just discord?
Yup, on https://webrtc.github.io/samples/src/content/getusermedia/getdisplaymedia too for example. In Chrome it shows the portal, then the Chrome dialog, then the portal again, then the stream starts. In Firefox it works as expected, with it first showing the Firefox dialog, then the portal, and then starting the stream.
you can fetch 100 messages at a time
if you fetch constantly for a few weeks you should get there
fair
the closest u can get is requesting ur data package. it will contain all your (own) messages so you can perform search on them
i wonder how big my data package is
what chromium version are you using? the site you linked works correctly for me on Version 117.0.5938.149 (Official Build, ungoogled-chromium) (64-bit)
Version 118.0.5993.70 (Official Build) Arch Linux (64-bit)
Interesting, maybe this is a recent bug.
oh does it not contain attachments?
as links
WHAT
rip google
what about a plugin to hide all other plugins
where with a keybind it can hide / show vencord client appearance
so if someone needed to take a screenshot of their client
they wouldnt get banned for having modded client
No, If I try the version you linked I get the same behaviour. My description of what is happening may have been a bit bad. At first the chrome dialog opens, when you try to select the "Window" tab, you get the first portal, and when you press "Share" you get the second portal.
or pop out a popup with css that basically matches discord client with just usernames, messages, pfps
no one would put the effort into writing css for reverting everything
the plugin would open a popup window
that looks like regular discord
with a keybind
i just installed chrome and it works fine for me on Version 118.0.5993.70 (Official Build) (64-bit) (fedora)
here's a recording, in case i'm misunderstanding
disable extension
oh wait true
enable later
Maybe the extension button could be used as a toggle to enable/disable vencord w/o disabling the extension
maybe it's an issue with pipewire itself or whichever DE/WM you use?
Here's mine:
gnome 44.5
pipewire
Compiled with libpipewire 0.3.81
Linked with libpipewire 0.3.81
had to double take that one
choo choo
coming out as a train fan ๐ฅ
why is there a fingerprint on my pc case
my bad 
Pipewire is same for me
pipewire
Compiled with libpipewire 0.3.81
Linked with libpipewire 0.3.81
I also tried the Chrome Flatpak, same behaviour. I suspect this is more of a KDE/Gnome difference.
I'll try to attach a screen recording, but that is suprisingly difficult to create on Wayland :D
but that is suprisingly difficult to create on Wayland :D
gnome recorder
CAMERA RECORD UR SCREEN
Is that using my PR or no?
time to install kde

can i just kde in tty3
or do i need to exit my gnome session
idek
No



