#๐Ÿ‘พ-core-development

1 messages ยท Page 107 of 1

austere talon
#

im too lazy to manually type them

spark cove
#

is this 17mb

#

it is

#

it looks like the heaps would be so much bigger than v8 profilers says

dapper tiger
#

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

dapper tiger
#

noop

#

just came to mind

#

vesktop not participating ven will fix

junior olive
#

my devcompanion isn't working horror

charred monolithBOT
junior olive
#

how do i patch a component uhh

#

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

charred monolithBOT
crude hearth
quaint sapphire
#

And just edit that match

#

Step 3: profit $$$

junior olive
#

guhh ok maybe

#

regex patching scares me fiure

charred monolithBOT
limber skiff
#

???????

#

my git is tripping

charred monolithBOT
limber skiff
#

oh

#

god damn

charred monolithBOT
limber skiff
#

small amount of skill issue

charred monolithBOT
charred monolithBOT
lime stone
#

๐Ÿ˜ญ there's bencord and manticord now

#

unsane

crude hearth
#

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 ๐Ÿฅด

charred monolithBOT
charred monolithBOT
charred monolithBOT
teal halo
#

imagine not being able to read

#

smh

charred monolithBOT
charred monolithBOT
livid pendant
#

Can you already use userplugins without recompiling?

spark pivot
#

No

charred monolithBOT
charred monolithBOT
limpid badger
# charred monolith

and ladies and gentle man, i think this is why some commits discussion are only limited to collaborators, perhaps to prevent nonsense

lime stone
#

gitposting

charred monolithBOT
night fossil
#

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
verbal pumice
#

just..turn it off from settings?

night fossil
#

is so wip it probably contains compile errors

#

wont vencord not build if thats the case

verbal pumice
#

getting vencord to not compile without a syntax error would be quite impressive tbh

#

basically all errors are at runtime

quaint sapphire
#

but yes it is possible, just edit the json file directly

charred monolithBOT
quaint sapphire
#

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" }

lime stone
#

sublime text ๐Ÿ‘€

#

you're so rich

quaint sapphire
#

I use it as my note editor

#

it is pretty lightweight if you don't have LSP plugins installed

lime stone
#

i kind of like it just wish it was foss ๐Ÿ˜ญ

#

or at least free

quaint sapphire
#

Kate is foss

verbal pumice
#

or just rename the plugin

charred monolithBOT
quaint sapphire
#

I don't have Kate bc I didn't know it was crossplatform
am stuck on windows for now

verbal pumice
#

to like disabled_MyPlugin

lime stone
#

gnome-text-editor is horrificly laggy

verbal pumice
#

in that case

lime stone
#

can't type properly with a lot of tabs open

quaint sapphire
lime stone
#

i think gedit was better actually

#

this is gnome-text-editor

#

i used to use gedit to write code lol

night fossil
tacit wyvern
#

greetings

lime stone
#

(horrific javascript iirc)

night fossil
#

i can just move it out of the plugins folder ig but meh

quaint sapphire
#

oh my god, I didn't know gedit had file-tree and syntax highlighting

lime stone
lime stone
verbal pumice
#

i still dont get it why you'd want it to not be included at all

#

when you could just turn it off

quaint sapphire
#

no longer checking file extensions?

#

sadge

lime stone
#

how many editors do you have

#

is this notepad++

quaint sapphire
#

vscode, sublime text 4, nano, all jetbrains IDEs

#

I count nano bc I use it frequently for small changes

lime stone
#

husk

quaint sapphire
#

are you even a programmer if you don't have syntax highliting on nano?

lime stone
#

it comes with that, doesn't it?

quaint sapphire
#

nope

lime stone
#

does on fedora

quaint sapphire
#

well, fedora must be shipping the config files then

lime stone
#

ah

#

how does it work

#

nano has plugins?

quaint sapphire
#

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?

austere talon
austere talon
quaint sapphire
austere talon
#

because it has compile errors

#

either move it out or move it into the normal plugins folder and git stash it

quaint sapphire
#

if it can't even compile, then how would that work?

#

๐Ÿƒ

charred monolithBOT
austere talon
quaint sapphire
#

oh yeah I am

jagged cloak
#

u can update trol

charred monolithBOT
nimble plaza
#

who up forking they vesktop ๐Ÿค‘๐Ÿค‘๐Ÿค‘

crude hearth
#

very good

#

I support RobimRMC

austere talon
#

wtf is VencordPlus

tame escarp
#

NOT HIM

tame escarp
#

unless it does in which case ????

quaint sapphire
#

ah yes

#

smth you can do with just css is a nitro feature husk

charred monolithBOT
charred monolithBOT
teal halo
#

textreplace:

#

or whatever it's called

charred monolithBOT
charred monolithBOT
spark cove
#

will toledo has spoken

#

will toledo is in the epic games org

frail skyBOT
#
Bad Patches

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(){

Bad Starts

None

Discord Errors
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 ```
#
Bad Patches

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(){

Bad Starts

None

Discord Errors
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 ```
charred monolithBOT
charred monolithBOT
woeful sable
#

rip xd

mortal fractal
#

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

night sparrow
charred monolithBOT
olive aurora
#

when the unstable version is unstable WHAT

charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
#

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...

charred monolithBOT
charred monolithBOT
topaz thistle
#

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

austere talon
#

should probably add some super basic js tests to make testing it easier

austere talon
#

not hate but there's 0 reason for us to adopt it and most people use windows

topaz thistle
#

Or would you just like tests that simply require the module and test if it expsoes the functions properly?

austere talon
#

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 owoWink

crude hearth
#

Ben

austere talon
#

anyway i can just do that when i test it

shy veldt
#

@austere talon hi
are you a vending machine?

austere talon
#

yeah

topaz thistle
#

Yeah that would probably be better I'm not too familiar with testing frameworks and which one you'd prefer

crude hearth
#

Can you even use bun on bencord

#

Since discord uses n*dejs

austere talon
topaz thistle
#

I mean we didn't have tests before UmaruSmug

shy veldt
crude hearth
#

Imagine tests

#

Just write and hope it works

austere talon
crude hearth
#

Oh

shy veldt
crude hearth
#

Esbuild is good enough tbh

#

golang blobcatcozy

#

Guh @austere talon I HATE CGO

austere talon
#

my initial node addon did PI_salute

crude hearth
#

Building installer takes 9 morbillion years

austere talon
#

tbh the main reason i wrote tests was cause my C++ code tends to segfault sometimes

crude hearth
#

How did u even wrote installer

topaz thistle
#

Alr the lecture right now is boring af anyways, I'll add tests

austere talon
#

it's compiling opengl libraries

#

the cli builds in a few seconds

topaz thistle
crude hearth
austere talon
topaz thistle
#

Ah

austere talon
#

the installer is to be rewritten anyway

#

cause it has poor support for older hardware

topaz thistle
austere talon
#

i picked an arbitrary framework in a language i like (go)

crude hearth
#

I Doubt discord can run on old hardware

austere talon
#

oh my god btw @turbid hatch hows the state of wails installer

crude hearth
#

Write in powershell

austere talon
#

im sorry i totally forgot to look at it until now and you never really brought it up

austere talon
topaz thistle
crude hearth
#

Curve will rewrite in electron

austere talon
#

id sooner make it electron than C++

real flower
#

go honestly seems pretty cool

topaz thistle
austere talon
#

have u ever tried go noah

#

do i call u noah or curve

topaz thistle
#

What ever you prefer ^^

crude hearth
#

Tbh any language with webview is good as base

topaz thistle
median rapids
#

curve

crude hearth
#

As long as build isnt 9gb

austere talon
#

why do you hate yourself

topaz thistle
#

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

austere talon
#

give go a try once, it's kinda similar to C but with a strong stdlib and memory safety

real flower
#

if I ever learn something lowish level I'll just learn zig

austere talon
#

and has very basic oop without the shitty aspects

real flower
#

or rust

topaz thistle
austere talon
#

okay butttt

lime stone
austere talon
#

maybe you'll find go fun 2DWink

real flower
#

okay but it's called go so therefore it goes fast

austere talon
lime stone
#

well yeah

austere talon
#

inheritance sucks in most cases so you should use it very sparingly imo

#

although now we get into very subjective territory

austere talon
#

some people swear on their oop

topaz thistle
#

And meta programming is just ๐Ÿคฉ

lime stone
#

it's easy to create a lot of code smells using inheritence

quaint sapphire
topaz thistle
topaz thistle
quaint sapphire
#

is it?
since you are using c++, might as well expose native functions

austere talon
quaint sapphire
austere talon
#

you eval code from the node process

#

in the renderer process

#

you'll always be evaling code with web frameworks

topaz thistle
# quaint sapphire

That's the most portable way - Also WebView2 doesn't support exposing fully native functions properly

austere talon
woeful sable
#

why did ReviewDB get removed from Plugins?

topaz thistle
quaint sapphire
#

this looks like the only advantage this has over tauri

#

but only one event for webview?

woeful sable
topaz thistle
austere talon
#

never

topaz thistle
quaint sapphire
woeful sable
woeful sable
austere talon
topaz thistle
austere talon
quaint sapphire
topaz thistle
topaz thistle
quaint sapphire
#

are bindings for Rust possible?

topaz thistle
austere talon
#

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

topaz thistle
quaint sapphire
austere talon
#

wow that's already better than other frameworks

topaz thistle
#

It does

#

And it does better than Qt

quaint sapphire
#

wow

#

these are legit the reasons I am not using tauri

austere talon
#

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

topaz thistle
#

Yes use inject

austere talon
#

damn good framework then renxFLOWER

topaz thistle
#

The saucer window object is injected that way so that the js code can properly access it

austere talon
#

saucer is a funny name

quaint sapphire
topaz thistle
austere talon
#

time to port vesktop to saucer (eta 2038)

shy veldt
#

(turn back time)

topaz thistle
#

Should work though

austere talon
#

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

topaz thistle
#

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

austere talon
#

JAVA LOOKING ASS CLASSNAMES

#

is that webview2 ๐Ÿ˜ญ

topaz thistle
#

yes

austere talon
#

microsoft moment

topaz thistle
#

webview2's api is so fucking ass

austere talon
#

the entire windows api is fucking ass man

topaz thistle
#

well said

austere talon
#

i tortured myself with windows api once

#

horrid

topaz thistle
#

yeah

quaint sapphire
#

@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

topaz thistle
#

always gets you that close to fucking haning yourself

austere talon
#

the only good aspect of windows api is that the microsoft documentation is very extensive

topaz thistle
topaz thistle
#

Looking at you pipewire api

austere talon
#

i don't use it anymore but it works (mostly)

woeful sable
#

upside down vee WHAT

topaz thistle
#

Looks pretty good from first glance

austere talon
#

also

The function names are slightly obfuscated as with full names (SetKeyHookConfig instead of SetKHookConfig), Windows Defender was flagging vlock as RAT (lol)

#

๐Ÿ˜ญ

topaz thistle
#

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 :/

quaint sapphire
#

for legal reasons

topaz thistle
#

for illegal reasons

topaz thistle
topaz thistle
austere talon
#

yep content

#

i think people who ask questions answered in the faq deserve death by firing squad (in minecraft)

topaz thistle
#

agreed

#

(in Minecraft)

quaint sapphire
#

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

austere talon
#

support is a lot of whitenames helping whitenames which is kinda cool

woeful sable
#

fill it with ai bots that spread misinformation

real flower
#

thats pretty epic

austere talon
lime stone
#

what kind of saucer is this

quaint sapphire
austere talon
topaz thistle
quaint sapphire
#

@nimble pendant say that I am cute

#

what a failure of a bot

lime stone
#

aren't saucers like plates but for cups

real flower
topaz thistle
real flower
#

(that was an awful joke i am sorry)

topaz thistle
#

hahahahha

austere talon
topaz thistle
#

@austere talon should I use npm pack for the tests? (Is that the correct way to test packages locally?)

austere talon
#

i have no idea what that command does im gonna be real

#

you can just require(".")

quaint sapphire
topaz thistle
#

Alr ๐Ÿ‘

austere talon
quaint sapphire
austere talon
#

huh how

real flower
#

i wondered why it was visible for like 2 seconds

#

and then said unknown

topaz thistle
quaint sapphire
austere talon
#

it's just different font

#

that alien is way funnier too

#

why his legs so long

real flower
#

he goopy

austere talon
#

๐Ÿ‘พ

real flower
#

hehehehehhehee

#

i have no idea what that text says and i have never seen this image before

austere talon
#

i loaded a 3mb twemoji ttf into canvas but idk it doesn't work for some reason

real flower
#

LMAO

austere talon
#

im too lazy to fix and these emojis are fine

quaint sapphire
topaz thistle
#

lmao

lime stone
austere talon
lime stone
topaz thistle
#

I'll be home at like 15:35 (+-15) and then add tests, so probably at 16:00

#

So better start cleaning the kitchen ๐Ÿ”ซ

austere talon
#

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

lime stone
#

i wonder how you are using canvas in node

topaz thistle
#

good ๐Ÿˆโ€โฌ›

austere talon
quaint sapphire
#

use skia instead

lime stone
#

ah, so i guess that doesn't support emoji

austere talon
#

it does

quaint sapphire
#

fuck

austere talon
#

just something wrong with the twemoji font loading dunno

topaz thistle
quaint sapphire
#

oooh, was not a reply to me

lime stone
#

?

#

doesn't make sense as a reply to either shiggy

quaint sapphire
#

ven dum dum

austere talon
#

there are emojis right here toad

lime stone
#

oh guh

austere talon
#

wrong reply but yes

lime stone
#

brain fart

austere talon
#

idk i find node-canvas very good, and comfy api since its just web canvas

lime stone
#

what emoji font is that even

topaz thistle
#

Is that image really generated each time? I thought it was just a quickly drawn PNG lol

lime stone
#

it looks like old noto

austere talon
#

idk what the emoji font is, noto or smth

austere talon
quaint sapphire
#

imagine if you had puppeteer to take screenshots of the channels

lime stone
#

ROL really outdated linux

austere talon
topaz thistle
#

German engineering ๐Ÿ‡ฉ๐Ÿ‡ช

nimble pendantBOT
austere talon
#

but it uses a basic template ofc and just draws the texts on top of that

lime stone
austere talon
nimble pendantBOT
lime stone
#

(such as no category, different channel types)

quaint sapphire
lime stone
#

horror

#

you could still implement that i think

lime stone
#

you don't need a browser and print

lime stone
#

this would confuse people

#

i'll go to #๐Ÿค–-bot-commands

austere talon
#

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

topaz thistle
#

That's literally the most stupid feature I've ever seen

#

"feature"*

#

Yeah ofc

austere talon
#

css can do that ๐Ÿ˜ญ

lime stone
topaz thistle
#

The "feature" should be client side anyways so you could probably just patch a check for hasNitro, right?

austere talon
#

wait electron 27 is stable

#

let's try it

charred monolithBOT
crude hearth
#

What do they even change in electron versions

#

Actually they can change their api

#

But still its chrome

charred monolithBOT
nimble plaza
#

fix their apis and update chromium

austere talon
#

omg it fixes the devtools bug

topaz thistle
#

@austere talon Added tests

#

They're super basic but I guess that should suffice for now

charred monolithBOT
topaz thistle
#

Yeah I guess that makes sense there's no pipewire-server running

austere talon
#

thats kinda bad tho

#

it shouldnt segfault

topaz thistle
#

That's true

austere talon
#

it should throw a js error

#

or maybe there could be a isSupported() func or smth along those lines

#

that returns a boolean

#

both work

topaz thistle
#

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 :)

austere talon
#

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

topaz thistle
#

Oh well that makes sense

charred monolithBOT
limpid badger
#

Yooo

austere talon
#

just bump everything to latest including major, surely it will work

limpid badger
#

v27 is now available? That means stuff has been fixed

austere talon
#

which is it, github

charred monolithBOT
austere talon
#

invited you as collaborator

topaz thistle
#

thanks!

charred monolithBOT
charred monolithBOT
woeful sable
#

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

charred monolithBOT
austere talon
woeful sable
#

thank you!

austere talon
#

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))
charred monolithBOT
austere talon
#

@nimble plaza i think u said u had some issues with permissions?

charred monolithBOT
#

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.

woeful sable
austere talon
#

no

#

all your friends are cached

woeful sable
#

because I have around 300 and I don't want to be limited

#

ohh okay

#

badword

#

o

#

wdym?

austere talon
#

should we just publish to npm?

topaz thistle
austere talon
#

yea

topaz thistle
#

yeah

#

but I'm still fixing the tests

austere talon
#

yeah no rush

charred monolithBOT
teal halo
#

that one works (pops out at startup but not a big deal)

#

this as well

teal halo
# charred monolith

wouldn't recommend that, it may ask for both at the same time if it feels like it

austere talon
#

oh true

charred monolithBOT
austere talon
#

@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

high oracle
#

I don't know what you mean by that, my implementation already covers both permissions being requested at once, no?

austere talon
#

all other cases of permissions stall forever without callback

high oracle
#

it's not if and else

teal halo
#

don't edit that

austere talon
#

but you still need the default callback call if no case is handled

high oracle
#

I don't have if elese

#

yes I'm adding default callback

austere talon
high oracle
#

I just don't understand what you meant by it not covering both cases, when it clearly does

#

aight

#

wait actually

austere talon
#

i just left that feedback up because otherwise the else makes no sense

high oracle
#

what if user grants one permission but not the other?

austere talon
#

yes you call callback twice actually

high oracle
#

great

austere talon
#

thats wrong

high oracle
#

yeah I see

#

I can just chain the promises I guess?

austere talon
#

i would do like

let granted = true;
if (audio) {
  granted = await askForMediaAccess("mic")
}
if (video) {
  granted &&= await askForMediaAccess("cam")
}

callback(granted)
high oracle
#

yep that's amazeballs

#

although the handler isn't async

austere talon
#

just make it

high oracle
#

hm sure

austere talon
#

you can most likely just use an async func

#

thats why it uses a callback

high oracle
#

is this a bug?

#

makes no sense

austere talon
#

initialise it

#

let granted = true

high oracle
#

shouldn't default be false

austere talon
#

no?

#

default is undefined

#

this isnt go :p

#

js has no types silly

#

how would it know that you're storing a boolean

high oracle
#

uh okay

austere talon
#

we want the default to be true anyway

high oracle
#

why? isn't it better to assume that permission wasn't granted rather than to assume it was?

#

because the latter could cause problems

charred monolithBOT
austere talon
#

no

#

the permission handler handles all other perms too

#

clipboard, notifications, etc

#

you don't want to deny those perms

high oracle
#

yes but this is in the context of media permissions

#

those go under the callback(true) remember?

austere talon
#

im saying make that code the entire handler

high oracle
high oracle
#

you mean it like this right

austere talon
#

yeah

high oracle
#

I think I can get rid of permission === media

austere talon
#

you might get type errors

high oracle
#

since the only way mediaTypes include audio and video is if permission === media

high oracle
austere talon
#

yeah there we go thats bettert

high oracle
#

I'd get type errors or runtime errors if I went with mediaTypes!

#

yeah great pushing

junior olive
#

Should I use DataStore like reviewDB did to store auth data for multiple accounts?

austere talon
#

yeah that's the best way

junior olive
#

ok

austere talon
#

but why would the plugin need auth

junior olive
#

it's decor

austere talon
#

why not just send people to ur site

#

to change decor

junior olive
#

bc i wanna keep it in-app

#

seamless

austere talon
#

iframe renxDEAD

junior olive
#

nop

#

vee u still have the monster fart decor and every single pfp you have gets a whiff

austere talon
#

HAHAHA

#

amazing

junior olive
#

@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

austere talon
#

indexeddb

#

you can store anything cloneable

#

json, maps, sets, blobs, etc

junior olive
#

thnaks

austere talon
topaz thistle
#

@austere talon PR should now be ready

austere talon
topaz thistle
#

Can you check the exception message with assert?

austere talon
#

dunno

topaz thistle
#

yes

#

Let me add that

half notch
#

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

junior olive
#

Does datastore have a hook i can use hehesmile

austere talon
#

a what

junior olive
#

a react hook

#

it doesn't does it

austere talon
#

no

junior olive
#

dang

topaz thistle
#

alr @austere talon PR is now actually done

junior olive
#

@austere talon did reviewdb's init auth on flux connection open actually work? I'm trying to do that and it's not working

austere talon
#

it does work but not for the initial connection

#

only for switching accounts

junior olive
#

oh brh

austere talon
#

you need to also use start method

junior olive
#

yeah i juust sawthat

#

thanks

cursive ore
#

can somebody help me

verbal pumice
#

vns

nimble pendantBOT
charred monolithBOT
junior olive
#

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

quaint sapphire
#

oh I think I can help with that

#

have you uploaded your progress so far to a branch or smth?

nocturne haven
#

you can write your own implementation of zustand in like 20 lines of code instead of using a whole library

quaint sapphire
#

personally I prefer pinia, but that is a vue store

nocturne haven
#

I did it in like 20 of my codebases when I did enjoy using them, now I realized they are crap and stopped. lol

junior olive
junior olive
#

I wanna see if I can use zustand first before doing that

quaint sapphire
#

iirc doesn't vencord itself have a custom store?

#

nvm thats the data store

junior olive
#

Yea

#

I want zustand for the state shi

quaint sapphire
#

is useState not enough?

#

are you saving a big object or smth?

junior olive
#

I need it to manage state across different bits of the app

quaint sapphire
#

reactive state?

junior olive
#

yeah that and some other stuff

#

I'll need it later down the line of this plugin

quaint sapphire
#

like, are two stuff rendered at the same time and you want them to share state?

junior olive
#

Right now I'd like to use it to solve this

#

having to switch pages

quaint sapphire
#

eh, you can get away with just saving to the plugin object

#

or does zustand offer persistence across reboots or smth?

junior olive
#

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

quaint sapphire
#

I'd use the data store instead of trying to get zustand to work

junior olive
#

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

quaint sapphire
#

you could use the settings api and make the settings hidden

#

but that aint good for complex data afaik

#

unless you serialise it

junior olive
#

yeah ideally i just need zustand .-.

#

bc i've already got the zustand store all worked out from the vendetta plugin

obsidian oyster
#

does anybody know where the plugins are stored locally? cant seem to find a folder

topaz thistle
obsidian oyster
#

so how would I go about creating my own plugin? I dont see any src on my pc

topaz thistle
#

You clone the Vencord repository, add your plugin to the source, and then compile vencord yourself

obsidian oyster
#

That makes sense, thanks

quaint sapphire
#

@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

junior olive
#

Is it possible to just use the Zustand library as a dependency?

quaint sapphire
#

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

torn knot
#

why not useState?

junior olive
torn knot
#

because from what I see this is what zustand replicates

junior olive
#

I want Zustand for more advanced state management

torn knot
#

wait- that's vendetta

junior olive
#

I'm working on the same plugin for both vencord and vendetta

torn knot
#

why not just set a state as an object?

austere talon
#

why would u add a library like zustand

#

thats pointless

#

like strencher said u can just make ur own hooks or use vencord hooks

junior olive
#

Zustand seems to take 99% of the work out of it

quaint sapphire
#

so not that bad of an idea

austere talon
#

why is there any work in it

#

there shouldnt be

#

what are u doing

junior olive
#

bc I have a slightly advanced state object for managing the users decorations

quaint sapphire
#

a custom react hook is all you need tbh
won't be longer than 30 lines of code

junior olive
#

A Zustand store seemed like the way to do what I wanted to do.. so I did it

austere talon
#
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

junior olive
charred monolithBOT
junior olive
placid wave
#

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

quaint sapphire
#

I replicated zustand

placid wave
#

also promise hackery like that makes race conditions easily

placid wave
austere talon
#

mutex in js VanillaWhat

#

you can just use Vencord's queue for this

#

it's a super simple promise queue

placid wave
#

lmao reminds me of my old shitty mutex implementation that would race condition if you awaited twice

#

i was a bit stupid

quaint sapphire
#

I haven't used vencord internals in a while

#

give me a break

placid wave
#

JUST FIRE OFF ALL OF THEM AT ONCE IT DOESNT MATTER???

#

why would this need a mutex

#

lol

junior olive
#

I appreciate trying to solve this via other means but I would really just like to use zustand :/

austere talon
#

it might matter if u update state async

quaint sapphire
placid wave
#

WHY ARE YOU UPDATING STATE AGAIN IN A STATE HANDLER

austere talon
#

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

placid wave
#

most apps are designed where thats not an issue to begin with

quaint sapphire
placid wave
#

cursed

junior olive
#

Why can't I just use zustand :/

placid wave
#

zustand is very nice

#

ive used it in a decky plugin

#

works around the lack of global contexts super well

junior olive
#

I found it very convenient in the vendetta plugin for the main store it uses

quaint sapphire
#

you can use zustand, you just have to make every store have a factory method

junior olive
#

factory method?

quaint sapphire
#

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?

radiant reef
#

ctrl W?

quaint sapphire
#

maybe discord just crashed

#

@placid wave

placid wave
junior olive
#

I'm gonna close that PR because it doesn't really do what I want to do

junior olive
#

alr thanks

austere talon
#

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"

junior olive
#

We can grab zustand from discord

austere talon
#

i still dont really see the need for not just writing ur own basic solution

junior olive
#

Like I had in vendetta

quaint sapphire
#

@austere talon look, if you can live on with this, then the fix is easy

#

thats all

junior olive
#

Won't that create duplicate stores..?

quaint sapphire
#

uhh

#

yes

#

use makelazy

#

lol

#

dum dum moment

austere talon
#

oh the crash is cause u try to use it before discord is loaded?

junior olive
#

i guess so

austere talon
#

just make it a lazy

austere talon
#
const bearStore = proxyLazy(() => zustandCreate());
#

this should work

#

then just use it normally in ur components

junior olive
#

ill try

austere talon
#

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)

quaint sapphire
junior olive
#

VEN I LOVE YOU WE'RE SO BACK

quaint sapphire
#

meanwhile me, who posted the makeLazy approach at the top of this convo

junior olive
austere talon
#

yeah but makeLazy is ugly cause you gotta call it first

#

proxyLazy wraps makeLazy so u can use it like the real object

quaint sapphire
#

yeah

#

didn't know of proxyLazy

#

thats some nice magic

junior olive
austere talon
#

proxyLazy is kinda cursed but also really sexy

junior olive
#

ven ur so goated

austere talon
junior olive
junior olive
quaint sapphire
#

getter/setter

austere talon
#

wdym how

quaint sapphire
#

in that file

junior olive
#

hm

austere talon
#

ohhh are u grabbing it via a patch

junior olive
#

yeah

quaint sapphire
#

yeah

austere talon
#

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

junior olive
#

hmmmmmmm

#

okay

#

setters have to be inside a object right? they can't be the variable

austere talon
#

well

#
export setStore(s) {
  store = s
}```
  ```js
definePlugin({
  setStore,
  patches: ... "$self.setStore($1)"
})
junior olive
#

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
#

dw i have it

#

thanks tho

quaint sapphire
#

oof did typo

charred monolithBOT
#

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?

austere talon
#

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

obtuse rock
#

is there a place for plugin ideas

austere talon
#

currently no

#

whats your idea

obtuse rock
#

better search, adds additional search settings

#

eg searching for calls, etc

austere talon
#

not possible

obtuse rock
#

spam discord api frfrfr

austere talon
#

anything not supported officially by either desktop or mobile isnt possible

obtuse rock
#

the point of the plugin would be to add support for it tho?

austere talon
#

not possible

obtuse rock
#

nvm prob bad suggestion coz to make it work it would need to spam discords api

austere talon
#

you'd have to fetch all messages and do the filtering manually

obtuse rock
#

yeah

austere talon
#

which is not possible

#

good luck fetching millions of messages

obtuse rock
#

wait you cant do that?

charred monolithBOT
austere talon
#

you can fetch 100 messages at a time

#

if you fetch constantly for a few weeks you should get there

obtuse rock
#

fair

austere talon
#

the closest u can get is requesting ur data package. it will contain all your (own) messages so you can perform search on them

obtuse rock
#

i wonder how big my data package is

charred monolithBOT
austere talon
#

50-500mb

charred monolithBOT
obtuse rock
austere talon
#

as links

obtuse rock
#

ohhhh

#

that makes a lot more sense

austere talon
obtuse rock
#

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

charred monolithBOT
olive aurora
#

thats literally impossible

#

unless you restart the client

obtuse rock
#

or pop out a popup with css that basically matches discord client with just usernames, messages, pfps

olive aurora
#

no one would put the effort into writing css for reverting everything

obtuse rock
#

no i meant a new popup window, about:blank

#

then just copy discord css

olive aurora
#

thats not how it works

#

plugins arent css

obtuse rock
#

the plugin would open a popup window

#

that looks like regular discord

#

with a keybind

charred monolithBOT
olive aurora
#

ok heres your plugin

#

open it in browser

obtuse rock
olive aurora
#

disable extension

obtuse rock
#

oh wait true

olive aurora
#

enable later

quaint sapphire
charred monolithBOT
austere talon
#

i thought that said "trans" in ur bio

#

and was like woah congrats on coming out

lime stone
#

lmao

#

woah

junior olive
#

no I just like trains

austere talon
#

had to double take that one

junior olive
#

choo choo

lime stone
#

coming out as a train fan ๐Ÿ”ฅ

junior olive
#

Fr

#

it's tough

austere talon
#

why is there a fingerprint on my pc case

junior olive
austere talon
#

cleaned it

#

probably my little sister

#

i did have her on my lap at my desk

charred monolithBOT
austere talon
#

but that is suprisingly difficult to create on Wayland :D
gnome recorder sorrykirino

#

CAMERA RECORD UR SCREEN

quaint sapphire
austere talon
#

can i just kde in tty3

#

or do i need to exit my gnome session

#

idek

junior olive