#๐พ-core-development
1 messages ยท Page 25 of 1
ven please review https://github.com/Vendicated/Vencord/pull/469 
why is it 4 on mac
they have like 2/3/4 and they do different screenshots
I see, that sounds cool! I think if you make the plugin more complex it's probably better as a third party plugin at that point, since it's very niche.
sadly third party plugins are not very usable for normal users rn but I plan to work on that at some point (as in you will just have to add a js file to a folder and it gets loaded automatically)
we can just merge it for now and just remove it and make it into a third party plugin eventually once that situation has improved
window, screen, selection
Sounds great!
should've done done from the beginning 
โ
byHug()
992a77e ShowHiddenChannels: Stage and voice channels su... - Nuckyz
I'm closing this for now because it's stale and we already discussed this not being very mergeable at least in its current state. Thank you though!
Hi! Are you still working on this?
placeholder={reviews?.some(r => r.senderdiscordid === UserStore.getCurrentUser().id) ? `Update review for @${username}` : `Review @${username}`}
Hi! I'm closing this for inactivity, feel free to reopen if you're still interested in getting this merged
It's a load of work to do this, simple message loggers just hook the delete function and just stop a message from being told to be deleted. Surgically inserting your own messages into chat is such a hassle and is prone to breaking a lot.
permamently logging is pretty useless anyway, in 99% of cases you don't care about the messages in the future, and if you do just take a screenshot like fyre said
super pog ven
Little improvement to allow this

Bad Patches
None
Bad Starts
None
Discord Errors
Bad Patches
None
Bad Starts
None
Discord Errors
in settings, after an error is thrown by isValid, nothing checks to remove the error once the input is valid again

is there any issue if i add a check or would that break something?

so you can do the following things
const x = findLazy(...)
Object.keys(x)
Object.entries(x)
// maybe others
it already works tho? @spark cove
wait how
A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible.
maybe its cus its extensible
yea thats why
@austere talon try it on a non-extensible object like findByPropsLazy("CREATE_INSTANT_INVITE")
Looked into it a bit more, and this actually solves a nicher case where the module is non-extensible. This is due to one of the getOwnPropertyDescriptor trap invariants
A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible.
not findbyprops
i dont really see the use case for this tbh
you used the wrong find lol
yes ik
how can u not see the use case lmao how else are u gonna enumerate those modules
more like why do u need to enumerate them
@limber skiff is doing it
but its kinda obvious
thats where u get the bitwise permissions
why do u just return?
ah cus if i didnt then someone could attach GET_KEY to a module
const Permissions = proxyLazy(() => Object.keys(find(m => typeof m.ADMINISTRATOR === "bigint")))
i dont see a problem with the pr, that isnt an obvious solution because most people dont understand where the problem comes from
the pr just fills a hole in making lazy values feel natural
i dont get how ur pr is supposed to fix the issue at hand, all it does is make getOwnPropertyDescriptor always return undefined unless u use those symbols
are u sure u didnt flip the if?
if (p === GET_KEY || p === CACHED_KEY) throw "NO";
is this what u meant? Otherwise it makes no sense to me
its a little whimsical let me try to show the case that its for in a screenshot
u could just remove those checks entirely
and ```diff
- Symbol.for()
- Symbol()
(or even don't, this is not really relevant imo, if someone wants to break it they can do that :P)
its just the first thing i thought of when i was writing the code
but fair
it was to prevent it from breaking is someone defined those symbol props on a module, but i make the keys unique symbols to make it not possible
does the pr make sense yet btw @austere talon
OH
i just got what u meant
it was flipped LMAO
hmmm do u remember u complained about lag when alt tabbing @spark cove
yea
ar eu gettin gthat with notifs css
maybe its .vc-notification h2
nah theres like 3 of them on screen
oh
it doesnt happen with all plugins off
let me build main
u will figure out which plugin it is
its message lagger
oh ok
that was an easy find
lmao
.messagelogger-red-text .messagelogger-deleted div
i just turned everything off and enabled anything that uses css
cause its always stupid css causing it
so true
so real amd true
actually no
it still lagg with out it?
window.onfocus = () => { console.time('window focus tick'); setImmediate(() => console.timeEnd('window focus tick')) }```
if u want to measure
maybe this
im also getting the lag without css yea
OHHH
i think its having to rewalk the dom to apply those cus
just the existence of this class = insane lag
yea
WHY???
balls
guh css so good
yeas=
something something it has to check entire body if it has class?
like its stupid and [class^=bleh] div checks every div in dom?
u dont do that tho
well i will just not do the class
idgi but u will fix
yop
uwu i love crypto miners </3
i just got what u mean btw but it already does that
yeah but idk
i must find out
u love
what is ?managed for
manual managed css
without it it is automatically attached for u
ooo
i will read webkit implementation to find out why body class so lagg
i still think it's cause of [class*=] selectors
anyway i will now restore my settings
i love settings backup
guh it doesnt work
what did discord do
๐ค
s.zz my hatred
WHAT IS THAT
500MB
OH
524288000/1024/1024 you love
fun fact there is constantly something repainting in the background of discord
what the hell is this
like for vc?
state of the art react client
nop a different one
lemme try remember how to open it
this
when isnt it
what zee hell
file uploading on windows to discord always has problems
yeah that happens to me all the time
i will try on vanilla
so i started getting in the habit of drag-and-dropping files instead of using the uploader
it always happened to me on vanilla too xd
mmm
it might be cause i had buggy discord
like i had two open somehow
it fixed after fully closing and restarting
ah i see
idk but the issue happens all the time for me :^)
nah its not taht

it work
even on electron
why does discord have their own native method?
i also love how web spec has no proper js method to prompt for file upload
so u have to make input element and click it programatically
so dumb
?
the floating thing
j
oh
anyway do u approb notifications api @spark cove @umbral hedge
also pls tell me if theres a better way to do this https://github.com/Vendicated/Vencord/pull/467/commits/b30e79e99af6ac8d99a0ef98635d02d25ec1b5d1
cause using an extra state seems so hacky
basically i need to reevaluate this memo on "focus" event
to redo the document.hasFocus()
WindowStore.isFocused()
whaa
INSANE
that is real?
window-1
yea they use it for react helmet
uh so
i didnt even think about the fact taht theyd prob use a store for it
ye
yeah
discord uses it like this
const focused = useStateFromStores([WindowStore], () => WindowStore.isFocused());
do u have the getStoreByName
so epic
ye
discord uses connectStores a lot which is horrifying
20 hooks so many
love
opticord when
when discord stops minifying their builds 
I'd love to do it but... regex replacements are pretty rudimentary
i have a project im working on that uses AST to detect tslib/swchelpers/etc
rewriting functions is doable but if discord changes something that relies on it... that could go wrong
and then tersing
here me out
full of confidence when i see so maybe it's safe? in the comment
discord dev, you're a programmer writing a comment working on maybe the biggest startup ever, either the comment is uselessly funny or it is formal
they were just in a silly goofy mood
cringe
gO tO tHe PoInT
nop
discord didn't want to send the message in time, so, why is it rudimentary
?
the regex replacements, why they're rudimentary
because parsing out functions safely with just a single regexp is difficult
there are tons of things in discords code that are hard to parse out safely
we experimented with AST stuff but it took way too much time
no
bad idea lol
ยฏ_(ใ)_/ยฏ
humans have a hard time reading code
machines dont, and they're way smarter than us
if smarter means math
here me out
actually I realised that was probably only cause serialisation
o
here me out
yes seems so
parses 2mb in 10ms
it was literally just cause I used wasm
and serialisation sososososo slow
oh lmao
so acorn is fine
just swc bad
that makes sense though
vencord AST modding soon
a string
nice :3
we could maybe have plugins export an acorn tree parser fn
like something that could fit in acorn-walk
export default definePlugin({
transforms: {
Literal(node) {
// trolley
}
}
})
poor vap being forced to do this
AST is ez
the annoying thing is you have to add way too many if statements
I WILL
also u will read dms immediately
he's only saying that because i am insane ASTer
oh yeah wait i should use focus store
get real
idk but i fixed
WindowStore so good
ogey
copilot insane
function defaultAreStatesEqual<T>(state1: T, state2: T): boolean {
return state1 === state2;
}
type CompareStatesFn<State> = (prevState: State, newState: State) => boolean;
type Deps = Readonly<any[]> | undefined;
function useStateFromStores<State>(
stores: Array<Store<any>>,
getStateFromStores: () => State,
dependencies?: Deps,
areStatesEqual: CompareStatesFn<State> = defaultAreStatesEqual
): State
you love
dependencies so bad
actually didnt even give me anything useful
lol

what is idk
idk
lmao
ok look pr
ogey
now look dm
shame image urls dont work on windows ๐ญ
works in app tho
icon works tho
lmao wtf
alert moment
onClick does nothing for me from windows notifications, but that's the same even with native discord notifs so im not sure I'd call it an issue with the PR xd
ยฏ_(ใ)_/ยฏ
I blame discord
it's the only app with this problem
same with the file explorer thing you had earlier
I get that often
11 ofc
huh
setTimeout(() => Vencord.Api.Notifications.showNotification({
title: "h",
body: "hhhh",
icon: "https://cdn.discordapp.com/avatars/343383572805058560/a_080e59d3bf37c4bac3843912a680b494.webp?size=80",
onClose() {console.log("uwu")},
color: "red"
}), 1000)
onClick too
youre using onClose
that was just the last one i ran xd
does onClose work
in app yeah
not native?
not native
every other notif works fine
lol
real
the number seemed specific so it felt like there should've been some purpose
this ext is so cool
what ext is that
pretty awesome
i love
no its just random
lmao
so is 42 :P
I mean I could imagine 42 being some magic discord number
The Answer to the Ultimate Question of Life, the Universe, and Everything
i originally also used 42 for the z-index
but turns out discord uses z-index > 42
{__/}
( โข . โข)
/ >๐ฆ npm i
{__/}
( โข - โข)
/>๐ฆ oh noooo
๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ
๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆ๐ฆโฆ https://twitter.com/i/web/status/1623433167368593408
so i just made it the 32bit integer limit :p
SO MANY HOW
- how tf is that UR tweet lmao
twitter blue 2k limit or smth
in the link
uhhh
i think because I copied the link from a notification
"x liked your retweet"
personally I think there should be more packages
How look

I'm at the mall
:^)
average mantika pr: 103 comments and still not merged
Because ven still not finished
@Vendicated FINISH
@austere talon finish
FINIOSH WHAT
TIMEZONEDB
Bad Patches
None
Bad Starts
None
Discord Errors
Bad Patches
None
Bad Starts
None
Discord Errors
@crude hearth@crude hearthFINISH NOW
merge this ven ๐
wtf are those classnames
so verbose
.perm-viewer-user-permissions-title-toggle-permissions-btn
ยฏ_(ใ)_/ยฏ
u will use shorter names
๐ญ
.permviewer-btn
aight
:P
@mantikafasi YOU WILL FINISH NOW
ya
@mantikafasi YOU WILL FINISH NOW
yop
we will get to 4 digit comments before its finished
๐ด
What a nice thing to see as soon as I wake up
@crude hearth
@solemn spoke
replaces hardcoded plugin names with $self for plugins that haven't already done that
have not tested every single plugin, but the ones i did test work as expected and the diff looks fine i think
why did u undo like half the plugins again @rigid venture
cuz ``
doesn't work
and some other places aren't strings
doesn't it only work w strings idek
it should work fine with functions and even ``
doesn't work for raw that's what i know for sure
it doesnt with replace functions
oh yeah it doesn't work with functions
idk why tbh, it could
@spark cove is there any reason u didn't wrap functions to replace the $self in the return
?
**patches.ts: **Line 31
if (typeof replace === "function") return replace;
this could wrap the function
I'm asking if there's any reason you didn't do it, like were there any issues or if just forgot / no reason
ohh
i probably forgot
u should do that
if (typeof replace === "function") return (...args) => replace(...args).replaceAll("$self", `Vencord.Plugins.plugins.${pluginName}`);```
ye basically
You can hide channels and servers with keybinds and same goes for server members its rly nice and usefull
Changes how the RPC for Audacious looks. For example changes it to the activity type to listening, then it also moves around the names of the albums and titles so it looks more like Spotifys.
Hi! I just merged Notifications. They don't currently have a way to not auto dismiss but you could add that if you wanted

i think that was just an accident tbh lmao
thats the person in #๐ฅ-vencord-support-๐ฅ
im neeewww
im so confuseed

pnpm buildWeb --standalone
whereee ๐ญ
im trying 
we rly should find a way to make user plugins easier to be installed for bd noobs
bd noobs try to install bd plugins
we plan to improve userplugins eventually anyways
how so?
wait, wdym by userplugins
u just plop js file in a folder and it loads it
simple
but some dumbass is gonna put bd plugins in there and complain it doesnt work
i meant bd noobs as the ones that used the installer and think that you have to download plugins instead of using the built in
even tho 3rd party plugins shouldn't be used, it is good to provide a good way to install them
the idea is to make a template github repo
which has a workflow to compile it
and you download that
already made a typedefs thing for use in third party plugins
but i didn't really know the best way to load arbitrary js plugins (+ the fact they need to patch code too) so was waiting for someone else to jump on it
i have an idea, couldn't you load locally? like, go to a folder and load it
like, vencord would create a folder at the home directory in where you could input 3rd party plugins
ik that's a no-go for browser, but like, the other option is to either recompile it or to fetch the plugin, that is horrible for a slow connection
I doubt we'd support it for browser
yeah
or at least stay with the compile method for browser
anyways, what do you think of doing a simmilar approach to traditional mods
Bad Patches
None
Bad Starts
None
Discord Errors
wait, forget all what i said
what if we fetched the plugins first then put it in some sort of cache
so we wont need to fetch every time we load
Bad Patches
None
Bad Starts
None
Discord Errors
esbuild wasm
doable and would work on web
making sure they don't get auto updated is important
considering they'll get cached somewhere, auto update is likely manageable
ofc
fetching plugins doesnt work
why so?
because they need to be run synchronously
idk, fetch it one time, save in cache, do a restart and then load from cache?
check if promise is resolved every 10 milliseconds
obvious solution
do immediately
be nice
supersedes #273
colors chat mentions and member list role titles, typing colors are handled by TypingTweaks so it's not included here to prevent duplicate functionality.
https://github.com/Vendicated/Vencord/pull/477
https://github.com/Vendicated/Vencord/pull/475
bring in the double
@austere talon 
leave her alone
or do you just spend all time on other stuf- of course
If I ever get back into it I will reopen
I'm improving message logger next
that includes adding cache persistโข๏ธ
do not
will
bad
will have option for it too
bad
guh so much hate for log cache
what in the world is this emoji
pleadey

imageUrl: trackData.image?.find(x => x.size === "large")?.["#text"]
interface ActivityButton {
you should probably urlencode this
wha
The code won't get this far unless the API returns something (which assumes the username is already valid).
This requires an additional import. I'll add that in a separate commit.
Feel free to merge the commits btw :P
Bad Patches
None
Bad Starts
None
Discord Errors
Bad Patches
None
Bad Starts
None
Discord Errors
i will soon i am busy procrastinating
match: /user:(\i),channelId:(\i).{0,300}?"@"\.concat\(.+?\)/,
this is extremely dangerous. This will match everything starting from the first instance of (function(a) up to roleIcon, which could be thousands of characters! Please rewrite this in a different way or alternatively change the .+? to .{0,100} or whatever is appropriate
const channel = ChannelStore.getChannel(channelId);
Just import it!!
this is how it was in the original patch too which is scary
@austere talon nope apparently this is intentional
we need to replace 1100 characters +/- some
i didnt actually see what this was patching originally but we're actually just rewriting the entire render function for the headers so i'll need to work out how to make it more specific
not very much
mainly touchups and linting compliance
and adding settings
i didnt realise how awful that patch was until i threw it into regex101
its very easy to write dangerous matchers
mm, ive tried making it as specific as possible by matching on something that's only in that func body within a certain no. of characters so it should be good
it only matches that one render func in the module now
thats a lot better 


Discord Account
afterSt0rm#0740
What is it that you'd like to see?
I recently upgraded my PC, and I'm doing the "install everything again" step, which is painful. Most of my applications are easily available using winget, so it would be nice to have the Vencord installer also available on winget. You can find additional information about how to create a winget package here: https://github.com/microsoft/winget-create
It also helps that once you update the package version, I can u...
prevents recursion by limiting depth to 16 messages and checking if any parent message is being linked inside it at any point
uhm this may or may not be causing the client to randomly hang up for a while (but not indefinitely) when switching channels. I'll take a look tomorrow but for now I sleep
funny bug
while this pr is open, might as well fix the guild name showing in both the embed and channel mention

This is almost possible, the CLI just needs to add a "channel" flag so you can select which Discord channel should be patched.
btw u can
function checkRecursion(id: string, rootId = id, depth = 0): boolean {
true I will
Hi! I just merged Notifications. They don't currently have a way to not auto dismiss but you could add that if you wanted
will add notifications to this soon, as for auto dismiss i'll figure something out for that
When you have duplicate emotes across servers, often Discord will select one from another server. This triggers FakeNitro, which is pretty neat, but doesn't use the neater emote embedding.
An option to always put the current server's emotes first when you type : or ctrl+E would solve this.
Thank you.
TypingUsers: Crashes on "Multiple users are typing" in non english languages (such as norsk)
EmoteCloner: Still uses broken patch for context menu stolen from ReverseImageSearch, just gotta copy paste the fix over (or improve it to not copy paste patches from reverse image search)
MessageLinkEmbeds: Crashes on link cycles
theres an open pr for MessageLinkEmbeds but it uses global state which is bad
yeye in a bit
I tried passing thru props but doesnt work
I'm not sure how else you could do
why not?
I assumed it was okay since there's global message cache there
as I understand it there's no way to preserve extra props after you get to using AutomodEmbed
okay i fixed it
ugly but u get the point
should i just not render anything?
ye i think thats better
please review / test @woeful sable
mmm
wtf is Reflect
ye ok we good
Proxys let u intercept specific actions. Reflect.foo is the counterpart to Proxy.foo (default implementation)
so inside proxy trap get() you can just call Reflect.get() with the arguments you got to do the default action
so that proxy returns embeddedBy for key "vencordEmbeddedBy", and the default value for anything else
the reason I use a proxy is so that I don't have to pollute the original message object
thank you anyway 
i initially tried cloning but that gets rid of the prototype aka all methods just gone
my first thought was polluting the message object cuz I didn't know u could do this
that's way better I think
pog
@austere talon realisation
diff --git a/src/plugins/customRPC.tsx b/src/plugins/customRPC.tsx
index 9a0901b..82c2c73 100644
--- a/src/plugins/customRPC.tsx
+++ b/src/plugins/customRPC.tsx
@@ -216,7 +216,8 @@ async function setRpc(disable?: Boolean) {
FluxDispatcher.dispatch({
type: "LOCAL_ACTIVITY_UPDATE",
- activity: !disable ? activity : {}
+ activity: !disable ? activity : null,
+ socketId: "CustomRPC",
});
}
diff --git a/src/plugins/lastfm.tsx b/src/plugins/lastfm.tsx
index 94cbeca..1866b0a 100644
--- a/src/plugins/lastfm.tsx
+++ b/src/plugins/lastfm.tsx
@@ -88,8 +88,13 @@ async function getApplicationAsset(key: string): Promise<string> {
return (await assetManager.getAsset(applicationId, [key, undefined]))[0];
}
-function setActivity(activity?: Activity) {
- FluxDispatcher.dispatch({ type: "LOCAL_ACTIVITY_UPDATE", activity: activity });
+function setActivity(activity: Activity | null) {
+ FluxDispatcher.dispatch({
+ type: "LOCAL_ACTIVITY_UPDATE",
+ activity,
+ socketId: "LastFM",
+ });
}
- discord checks for
null, not if the activity object is falsy - discord maps these by
socketId(so you can have multiple activities), the only reason it worked is cuz it was mapping both asundefined
(socketId is usually a string of a number)
yop
what happen
probably no one noticed but that basically makes them incompatible
i blame ven for making vencord in the first place
deleting vencord rn
the good ending.
also am I the only person bothered by a function returning something or undefined instead of something or null
yes
cant wait to switch to bd
undefined haters wya
it's not crashing for me
guhh I will PR a PR again
no i avoid this all the time too
when i can
oh it crashed with en gb
why can u build urlsearchparams from url but not build a url using urlsearchparams
js so bad
fetch(`https://meow.cat/?${params}`) so ugly
src/plugins/lastfm.tsx:166:17 - error TS2540: Cannot assign to 'searchParams' because it is a read-only property.
166 url.searchParams = new URLSearchParams({
SO BAD
fixed it easy
what the fuck

they literally went out their way to make it terrible
le works
avatarseverywhere?
but actually
why even patch the strings
can just replace the string access with hardcoded string
something is breaking and I'm trying to figure what is causing it
it happens specially if you switch language
no i fixeds already
its cause it only patches once
so if u load new strings it doesnt repatch
are you sure that's the issue
oh
actually it makes sense
because it doesn't have {a} and those thing discord is treating it as a string
hence why this doesn't fail
I thought not patching all could be the issue but I was testing other things first lol
aight
I'm gonna pr the other things I fixed
I fixed it
oh awesom
just this should work
sure then lol
works
nice
eh to improve it a bit
tbh i dont like both plugins having the same code
could refactor it to an api
i should have done that initially but lazy
how so?
wdym
an api to add items to that context menu?
yea
if u want to
oh
user ones etc
what do you want it to do?
is tsserver ok
I'm not quite understanding what you want to achieve lol
well
Auto import from 'console'
an api to dynamically add context menu entries without patches
ah
that's not hard to do but
what if the user wants to put an entry inside an specific group
my id was to patch that function then pass the children to the callbacks
on permissions viewer I do that for each thing
ig
chromium show actual arguments challenge
hmmm
maybe patch the return of the context menus
then we modify the children
and we can use the key properties to select where to apply an entry
these are the arguments to the function
@austere talon rate ```ts
if (!res.ok || json.error) {
const apiError = json.message
? ${json.error}: ${json.message}
: "no error message";
const errorString = ${res.status} ${res.statusText} (${apiError});
logger.error(Failed to query Last.fm API: ${errorString});
return null;
}
based on the navId you can check if it's the context menu u want
ya
then you can search the children for where u wanna add
and add ur own
it should be really simple
I mean for this
for example
yeah sure
wait all context menus go through this?
yes
oh dang
vencord dev is poppin'
yes
cool
patchContextMenu(data => {
if (data.navId !== "guild-context") return;
const devModeIdx = data.children.findIndex(item => item.props.children.key === "whatever that ones key is");
if (devModeIdx === -1) throw "bruhhhh";
data.children.splice(devModeIdx, 0, <Menu.MenuItem .../>);
})
the api could look something like this i think
4cade51 adds them to my settings
we also need the props
we will add a invisible children to all context menus that gives us all the props
that way we can transport it like it's part of the context menu lol
wait wdym
for example we will create our copy of e
and we will create jsx element passing that copy here
then once the context menu is here we will remove our element and grab the props from it
actually I'm being dumb lol
maybe we can just pass it here?
but then u have to patch every context menu implementation, no?
pain
we need a way to access all the props incoming
including the ones our plugins modify
actually are you sure
we might be able to get the dom target somehow without needing more patches
that should already be enough since you can get most relevant info from that
btw does canary have fixed devtools
what's wrong with it




