#🧩-plugin-development
1 messages · Page 75 of 1
it's real
you will be happy to find out that we were considering Vencord Installer PWA for a while
there's a lot of native integration
well, i made it
so nothing to consider
i have an entire paper on PWAs
1 sec
i wrote it as one of my papers for uni
i'm impressed
took a second cuz i had to redact all the personal info
XD
wrote that mainly because i had to, and didnt want to make an actual project from scratch, so i just re-used some shit i had laying around
pdf, safer than docx
wrong
depends on what u use to read it
if you use adobe reader then yeah
if you use
A PWA
ITS SAFER
MYUAHAHAHAHA

Also is github down?
nah, just eating shit
How will they ever review PRs now
I think the api is fine tbf, I got that PR number from the intellij plugin
oh also @dull magnet i'm taking PWA's further with IWAs, they now have RAW TCP/UDP sockets, so i'm polyfilling node http, net and dgram using them, so you can run nodejs code in IWAs
IWAs are PWAs, just bundled and signed
which gives them access to more APIs, but also forces stricter CSP etc
the official examples all do not work, there are 2 community made IWAs that work, other than that there's nothing
there's no types, no tutorials, no guides
there is a spec, which isnt up to date
XD
wtf 😭
can it bypass cors tho
ok?
when will we get extension natives in vencord 
actually why am I asking
fuck you github
i was just about to go look at @grand haven's code
Is it back?
YES
oh it's nothing special like I was initially expecting
you have raw tcp/udp, cors only exists if you implement it
or is it on another branch
i thought this was an extension only thing for a long time
you're mistaken, this was a chromeapp only thing, aka chromeos, it just so happens manifest v2 extensions were ALSO chromeapps on top of being extensions
with v3 this was removed
oh
and a new TCP/UDP socket api was created, with a completly new API and structure
that explains why I couldn't find it when I was last looking for it
even tho it re-uses a lot of the old chromeapp code in its implementation
BUT the APIs are all different
so u cant just use old v2 chromeapp code
why 😭
because it was chromeapp specific
this is now a W3C standard for tcp and udp sockets
a W3C standard cant say "call chrome.socket.tcp"

you gotta implement http yourself too
that's so dumb
its not hard either
that's different
afaik there is basic mv3 dns lookup support in chrome dev only
that's an extension
I know
we're talking about websites
so if there's no DNS support in this then what are people expected to do
use a hardcoded public DNS resolver?
yeah i kept it simple because there are a lot of consideration and decisions i cant make as a 1st time contributor
like "what about firefox"
"how to do extension only plugins that dont run vesktop"
"should we have extension natives"
so i kept the code minimal, and simple
because considering vencords "merge almost no 3rd party plugins" policy, i have low expectation on this actually landing
what's your take on WebAuthn attestation
never used it
never had a need
its just "another auth method"
it doesnt bring anything new, or let u do cool new stuff
i mean the attestation functionality specifically
you do not know what webauthn attestation is
honestly true
website saying "have this securely, so i can verify its mine in the future and that its not been fucked with"?
at least thats how i understood it, i didnt care much so i didnt learn much about it, focused on other things
such as running nodejs natively on android
ok so
password manager DRM
that's webauthn attestation
at least, how I see it
How can i search a string through every single source file
Like ctrl+shift+f in dev tools?
No matching export in "src/webpack/common/index.ts" for import "Icons"
getting this on a personal plugin after the update. what changed?
Icons common removed
cause it got mangled / removed so it's useless now
just copy paste the svg
oof
how do I feed the svg to icon of MenuItem
just as a string?
'<svg...'
Type 'string' is not assignable to type 'ComponentType<any> | undefined'.
nope 😭
Have a look at the ones in src/components/Icons.tsx
In most cases, if you pass a giant string in jsx, you get a giant string in the dom
Menus are... special though
yeah thats missing the ID icon unless it's not called that there
I mean for how to use an svg as an Icon in general
I guess you could probably just do what you did here but outside a string
that didnt work. tried it first
Type 'Element' is not assignable to type 'ComponentType<any> | undefined'.
either way seems like you are rendering your icon before passing to the Menu
and instead you should just be passing the icon
wrapping it in {() => <svg></svg>} worked
yes because then you are not rendering it
which is what viewraw does except it doesnt do it inline
you are passing the functional component which renders it
function MyComponent() {...} is a ComponentType, which when called/rendered returns Element

What is toolboxActions?
It adds to this if you have the vencordtoolbox plugin enabled
aight well I cant figure out why the ID text wont show up in the svg so I guess ill just have a gray square as the icon :D
ooo Thanks
Is the viewbox set right? You might just be looking really closely at a corner or something
like this
yeah should be
<svg width="18" height="18" fill="none" aria-hidden="true" viewBox="0 0 24 24">
<path fill="currentColor" d="M15.3 14.48c-.46.45-1.08.67-1.86.67h-1.39V9.2h1.39c.78 0 1.4.22 1.86.67.46.45.68 1.22.68 2.31 0 1.1-.22 1.86-.68 2.31Z" />
<path fill="currentColor" d="M5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5Zm1 15h2.04V7.34H6V17Zm4-9.66V17h3.44c1.46 0 2.6-.42 3.38-1.25.8-.83 1.2-2.02 1.2-3.58s-.4-2.75-1.2-3.58c-.79-.83-1.92-1.25-3.38-1.25H10Z" />
</svg>
ive tried every combination of fill="currentColor" and fill="none" across all 3 as well including not including them at all 😭
just add it as JSX
ah the problem is the missing fill-rule
but the code yells at me if I dont remove that
Probably make it fillRule
whats the most efficient way of doing?
1...
for (const keybind in keybinds) {
const {
enabled,
key,
ctrl,
alt,
shift,
} = settings.store[keybind];
if (
enabled &&
alt === e.altKey &&
ctrl === e.ctrlKey &&
shift === e.shiftKey &&
key.toUpperCase() === e.key
) keybinds[keybind].action();
}
``` ...or 2?
```tsx
keybinds.find(keybind => {
const {
enabled,
key,
ctrl,
alt,
shift,
} = settings.store[keybind];
return (
enabled &&
alt === e.altKey &&
ctrl === e.ctrlKey &&
shift === e.shiftKey &&
key.toUpperCase() === e.key
);
})?.action()
You can also just const IdIcon = findComponentByCodeLazy("M15.3 14.48c-.46.45-1.08.67-1.86.67h-1.39V9");
You can probably shorten that string, I forgot to check
worked. bless you
Wouldn't 1 fire for duplicate keybinds whereas 2 wouldn't?
yes
Guess it depends on whether you want to allow dupes then
you can also
need to call that as a function, not JSX
that looks more confusing than just using a raw svg
that handles whether you have Developer Mode enabled and renders the whole button, not just the Icon
It's how discord creates "Copy ... ID"
ah so it would only show it with developer mode on?
that feels a bit redundant. if you have the extension you definitely want it on
Doess vencord give you access to the electron backend or is it just the render process?
only for what's needed, to avoid sandbox escape
one for getting updates, updating, getting settings
so when you need something else you need to edit the backend code for Vencord
which listens for the specific event of what you want and answers
i see
what are all the findByProps equivalents?
equivalents?
like every thing to get a reference to a part of the code
without the all versions
It's mainly 4:
byProps, byCode, byComponentCode, byStoreName
so all gives all the matches found?
yeah
how does bycode work?
It calls .toString() in the functions and checks if it includes the strings you pass
or if the regex you pass matches, but ideally you should only use strings as regex is slow
byProps is basically checking if the object has the properties you pass
so to modify a function i need to use .toString?
to modify a function you use patches 😭
byCode works like this
how long has wp been in console shortcuts 😭 ive always been using vencord.wbepack
How can i get a reference to a var that contains an object inside a function, or inside an array?
i dont think i can do it with patches
you can
you need to insert code to call a function within your plugin definition, with the reference to the var
and then store it somewhere
this seems like xy, what is your end goal?
this, i want to hijack this to 1. modify current keybinds and 2. add more
but i think that should work
what moduleid is that
this? 612226
yeah
prob just wrap Y with a call to your plugin
so each one of these is a instance = to it? so i would need to edit each one of those?
but don't patches apply before anything else, so if i change it at the start, every export will be changed
what does mapMangleModule do?
remember my byCode explanation?
the first argument is a byCode filter to the module where you want the exports from, which in this case I used part of its code that doesnt exist in any other place
then the second argument is a mapping of filters for the exports and a name you want to call that export when found
so between all the exports of that module which byCode matched, I called idkwhatisit the one export that includes the prop SERVER_NEXT
which is this one [V.EkH.SERVER_NEXT]: b.nq
EkH is an enum like this
enum EkH {
SERVER_NEXT = "SERVER_NEXT",
...the others
}
so the actual prop name is the string "SERVER_NEXT"
ok, i think i understand now, thanks
Gave it a look. While it seems similar, actually has nothing related to my goal. It simply changes which modal to show depending on a setting, but doesn't add any buttons into accout itself
At this point I do really need an advice on how to put a button into here
iamme made a plugin that adds an item here a few months ago but looking at the code it definitely would be broken by recent changes, it may be a worthwhile starting point though
What's the issue?
it returns the link as undefined
Oooo, thank you for a good reference, fefinitely gonna look into it
I'm slowly but surely getting better at patches
litterally the only hard part about developing a plugin
It's not even hard it's just annoying
I don't like devtools
don't you need to wait for the promise?
i don't know what promiseable means but yeah
im not sure
also i dont know how to add a second menu below that
beacuse i dislike react 
but try async awaiting the fetchData call
function buildMenuItem(type: "Sticker", fetchData: () => Promisable<Omit<Sticker, "t">>) {
return (
<Menu.MenuItem
id="bla"
key="bla"
label={"blah blah"}
action={async () => {
const res = await fetchData();
const data = { t: type, ...res } as Sticker;
const url = getUrl(data);
console.log("URL: " + url + "\n" + "Data: " + data);
Toasts.show({
message: "Placeholderr!",
type: Toasts.Type.SUCCESS,
id: Toasts.genId()
});
}
}
/>
));
}```
perhaps?
oh i forgot to await it yea
it's promiseable because it's lazy loaded i guess
AYYY THAT FIIXED IT!!
ayy
no problem :D
lmao
how would i add a second menu to it again?
i remembered uh
how to do it on mobile
call it twice I suppose?
buildMenuItem(...argsforitem1);
buildMenuItem(...argsforitem2);
and then add them both to the menu
then it does this
ohhh u meant like that
yup
i mean i could but i think itd be better if i just combined them botyh
I mean the function name is buildMenuItem
not BuildMenuItems
and I think you're also only taking in parameters for one menu item so you would have to change that up a little bit to make it for two menu items
wwaitwait
before i do that
i need to figure out how to change the placement
i want it to be below this tab
but uh
wait
nvm
easy fix
can i change which position of my context menu I put a menu item in?
probably depends on where they are initialized
You can use findGroupChildrenByChildId to make this easier
that name is soo horrible lmao
I shall make a new function with different name that also returns the index of the item
I made it when I didnt know much about react and stuff
so I just made up something that made sense
I still don't know much about react and I've got to build a massive project using it soon
so that's fun
I wanted to PR this a while back but I was very fresh on vencord, react and ts so I didn't bother
But I used my own version for a bit that returned the group, index and item
Also because I didn't realise that function already existed
How's roblox
i did
except
this is called devmode-copy-id yea
i have this but it doesnt do anything at all
doesn't work for those
they are called devmode-copy-id- + the actual id
devmode-copy-id-${id}
Didn't you make one that could do substrings?
oh yeahhh
Yeah just add true as a third param
it's the third param
My discord has been super laggy all day and I don't know if it's my fault or not
shiiit im not sure how imma get the messageID
is there a native way to get it
findGroupChildrenByChild("devmode-copy-id", children, true)
Does this make sense or do I need to find a better way to explain how this works?
Trying to get across how this formatting works and what the settings mean is the main pain with this plugin
I would help you if I had more knowledge with timestamps, but I dont
I have no idea what i'm looking at
lol
The first three inputs are the syntax for the three types of timestamp on messages and then the rest are how [calendar] is to be filled in when used in any of those three
I know how to use timetamps but that doesn't make much sense to me
Yeah it's kinda just meaningless at first glance
oh wait no that makes sense ish
i gave it a second glance
oh now it makes great sense
I understand it all at a third glance
looks good
Yeah so I'm just trying to figure out if there's a way I can reduce that to the first or second glance lol
If people can figure out textreplace I'm sure they can figure this out but y'know
the main reason first glance was "I have no idea what i'm looking at" was beacuse i didn't read the description
I thought it was a replacement for the current timestamp inserter
Maybe it should be renamed to CustomMessageTimestamps
Could help make it a bit clearer immediately
or TimestampFormatter
because it doesn't have to do with messages
you can put timestamps in your user profile
This doesn't affect those, it's only timestamps on messages
Ah okay
ohhh
does it affect the timestamp i'm talking about in messages?
or just the sent/edited timestamps
Just sent/edited
So you can set the format for cozy, tooltip and compact, in that order in the images
I dunno how lol, my account isn't even that old but I guess nobody before me wanted it 
Or were inactive when offered
is there a way to talk from native -> browser? i'm trying to do global shortcuts via electron's globalShortcut
ipc
i tried but i can't find it
like i can't import from electron and idk what global it's defined as
you can import from electron
in browser code?
ipc
Use the ipcMain and ipcRenderer modules to communicate between Electron processes
basically browser calls ipc -> ipc responds from native
so i have to poll native from browser?
you want native sending messages to browser?
yes
ideally it shouldnt be like that, and I'm also not sure if there is another way to do it, but you can executeJavascript
too many words
and then have some function accesible from the window which you can call using executeJavascript
but ideally it should be browser -> ipc -> answer
this tells u everything 😭
it probably does but it's a lot of text
and why read through text when i can ask someone to summarise for me 😁
oh lol it does
if u keep this mentality up you will quickly lose access here 
channel not for spoonfeeding https://tenor.com/view/no-gif-6533142189269812111
is this the correct section https://www.electronjs.org/docs/latest/tutorial/ipc#pattern-3-main-to-renderer ?
Use the ipcMain and ipcRenderer modules to communicate between Electron processes
it appears so
after reading the docs, i realise i need to use contextBridge.exposeInMainWorld. however, i've gathered this needs to be ran in the preload. is there any docs explaining how to insert a custom preload script for vencord specifically, in a plugin scope ofc?
^ looks like i can't. welp i guess i'm modifying vencord's preload script. good thing this plugin is just for me...
anyone got a link to the discord notification sfx from holidays?
this user plugin has it
https://discord.com/channels/1015060230222131221/1322597691066421368
How does one fix this? Based on the plugin I used as reference the function should be a thing (I used the translate plugin)
And unless im stupid, I cant find anything regarding how vencord does this
In index.ts
In native.ts
have you fully restarted your discord?
Yeah I have
I changed "VencordNative.pluginHelpers.Translate" to "VencordNative.pluginHelpers.OpenAI" So they dont conflict and got this as an error instead
Something says I am miss understand how this works
that needs to match your plugin name
Thank you
did u think it's just black magic that guesses what name you wanna use 😭
yea
is there anything somewhere on how patches work?
How can i append code after the match, not just replacing already existing one?
Can i add a function call to a function in my code in the replacement?
Sure, it's just code
Code can call functions
$self expands to a reference to the plugin object
so if i have a function doStuff(x) in my code, i do $self.doStuff($1) to run doStuff with the fitst capture group as a parameter?
Yes, that will insert a function call in the resulting code
It's just simple regex replace
If you write a function call in the replacement, then the replacement contains a function call
does the capture group have to be in the match, or the find part?
but whats the point of find if therer a match?
To know what module to replace in
so find gets you the module, then it replaces in the module?
Yes
thanks
does vencord exist on mac/linux?
Yes
is ctrl/alt key the same for them?
Its a bit complicated
I wrote a keybind mapper a while back
But you probably want to use discords own system
You can find it in one of my user-plugins
i was able to create a plugin that lets you run sounds from the soundboard via a keybind. however, it requires you to modify the preload script to make it functional globally. is there any vencord systems in place that make this process easier? i saw there was venbind but that seems to be very wip
use window.addEventListener("keydown", func), look how i did it here https://github.com/Vendicated/Vencord/pull/3185
that works even if you're not focused onto discord? that's the issue atm sadly
oh, no then
but why not just make an application yourself then, this should be pretty ez
what do you mean?
insteat of making it a vencord plugin, you make is a seperate application
i'm not too knowledgeable about how that would work. however, my requirements is that it plays the sound locally and for other people at the same time
anyway from what i could see, it looks like i have to deal with my current approach 😔
is this seriously not a stock feature?
i tried to do a ctrl shift f to see if any other plugins try to do similar things
and i couldn't find any examples
unless my searching skils are bad...
its not
oh i misread your question lol
How do i findAllByProps in the code, it works in console, but not in code
You usually want lazy finds in plugins
this wont work, as i filter it out after, heres what i have findAllByProps("dispatch", "dispatchKeyed").filter(s => Object.keys(s.emitter._events).includes("FOCUS_SEARCH"))
Ah, so you're not doing a ByProps filter in the first place
Have a look in consoleshortcuts for what findAllByProps actually is
If you want a custom filter, use a custom filter
well, i filter by props, then i check if they have a nested property
Which is not how you're supposed to do finds
how should i do it then?
With a custom filter
whats a custom filter?
findLazy(m => Math.random() < 0.1)
like that?
findLazy(m => ["dispatch", "dispatchKeyed"].every(p => m[p] !== void 0) && Object.keys(m.emitter._events).includes("FOCUS_SEARCH"))
seems like you are just finding the FluxDispatcher, which is already a common
Hello vendevs 
Can maybe someone tell me how to import api requests?
Sadly import { request } from "@utils/http"; // API request utility Dont work xd
well what are you trying to do
AI Rewrite plugin
SOmething which let you to manipulate your sent messages with chatgpt and for this i need to make api requests to openai api
AI slop
AI is cool and humans are to lazy to write large texts so why dont let chatgpt make it for u, nh? xd
THey dont like AI, okay 
i feel like that means dont use AI to write your plugins, no that they cant include ai
still tho
also Notepad ++ mention
requests don't need native, unless theres cors
dont be a retard with ai and you will be just fine
(most people are being idiots with it)
but dont use it for plugins or anything discord related unless you like iterating a lot and exceeding whatever you use's context window
https://chatgpt.com/share/679d520e-3174-8009-9ce8-432a7383f07f even it agrees with me lol
pretty much anything to do with the browser window, modifying headers (iirc), cors, and whatnot
there is no such thing as @utils/http. stop trying to use AI to generate Vencord plugins, it's impossible
well
feed it all the other plugins and discord's js and it will get decently far

if u have gpt 4o that is
that one explodes by itself every time discord changes something
nah, thats betterfolders
shc will prolly have to be removed soon
for some reason my brain processed that as hidden things
copilot "think deeper" uses gpt 4o now
but yeah, fair enough xd
if you feed it snippets of js bundles maybe
and i bet you could actually fit most of the repo in one initial message
not gonna try it i have other stuff to do today
most of this are probably irrelevant things like markdown files, but not quite
if you get it down to 128k tokens glhf
Could try only giving it plugins instead of the whole repo
nah, give it all of /webpack
is it possible to intercept a file using a presend listener
if anyone ever comes across this, it is possible, replace the upload with a new upload instanse after calling .upload()
idk if this is the best place to ask but
what'd be the best way to find a module
I saw there's this one localized hash in the module I wanna patch
8E4Gxc
But well
It might change from time to time
I know there are KEY -> HASH functions but I don't know if there's a HASH -> KEY one lol
Actually it might be one-way hash so yeah I guess the thing I'm trying to do is straight up impossible and I have to come up with a better way to find isolate that module
find: "#{intl::REPLYING_TO}"
Thank you
how did you find that out lol /genq
theres a mapping in pinned#👾-core-development of the keys
How can i force a modal height to be max size, even if the content doesnt do the full size?
ModalSize.LARGE sets modal to the max size.
pass size to ModalRoot
ik about that, but this only sets the width, the height is determined by the content in it.
tried that but it didnt work either
try outside the scroller
still doesnt work
@chrome elbow what does this do
[class*="NonPremium"]:has([class*="bannerPremium"]) [class*="avatarPositionNormal"],
[class*="PremiumWithoutBanner"]:has([class*="bannerPremium"]) [class*="avatarPositionPremiumNoBanner"] {
top: 76px;
}
i removed and nothing changed
and where does this apply
voice chat?
bannerPremium doesn't even exist anymore
Pretty sure they were old classes from profiles before discord released the simplified ones
i just deleted usrbg css file and it still works the same
yes
yes
usrbg css causes crazy lag
why does it need insane css just target the image element and override
I deleted its css
kapoof
@modern chasm you should ask here! but it might be difficult if you're not fluent at English
thx
im not good at English. but do my best.

i have a question for patches.
how do you find the relevant.
Is there no other way but to manually locate the relevant part?
Please let me know if you have any useful tools.
react dev tools
is it browser extension?
yes. but you can enable it in vencord settings if you want it in the desktop app
thx
is there a way to close the edit box without sending a bad request to discord?
What edit box
how do i make a plugin that fixes this fucking annoying bug where it mutes me when im the only person in a call
Working on Ruffle embeds for uploaded .SWF files! Still a way to go in terms of polish but wanted to show it off
sick
this is so fucking cool
discord should make this first party
u could have bots with literal game libraries lmao
basically is already
wiþ custom activities
þey just need to make it not rely on vc
@dull magnet use real th
it doesnt u silly
hop on plugin dev poker
make it not make you auþorise apps to do 3 million þings on ur account
Peak vendor dev setup
this is soooo bad
that too
html component with clickable actions would be soooo good
not full activities though
also actions shouldnt be able to be scripted
two monitors go brrrr
Ipad Multitasking
Yop
Guacamole with ssh to my raspberry pi
Firefox in docker container with vnc with web view
i usually double or tripple split the code view doe
Goes hard
ex:
so real
ultrawide unironically decent for coding
problem is
desk too small to fit 3 monitors
ikea doesnt sell a bigger desk than this
gotta buy a 2nd one
man i wish i knew how to properly use typescript
Are you speaking about ts specifically or js overall?
TS
like advanced TS typing
ya know, the fancy shit
https://youtube.com/playlist?list=PLIvujZeVDLMx040-j1W4WFs1BxuTGdI_b
His videos are pretty nice and short
If you have time
yeah but its not a good learning format
i mean shit like you'd see on type challenges
i know the basics
He has some videos on these
shit like
export type Remote<T> = RemoteObject<T> & (T extends (...args: infer TArguments) => infer TReturn ? (...args: {
[I in keyof TArguments]: UnproxyOrClone<TArguments[I]>;
}) => Promisify<ProxyOrClone<Unpromisify<TReturn>>> : unknown) & (T extends {
new (...args: infer TArguments): infer TInstance;
} ? {
new (...args: {
[I in keyof TArguments]: UnproxyOrClone<TArguments[I]>;
}): Promisify<Remote<TInstance>>;
} : unknown) & ProxyMethods;
like fuck, i dont even know where to start
or shit like optional arguments, on joined types, that arent optional in specific cases
idfk
its a completly different lang than JS when it comes to thinking about implementing shit when u got types like that
ig my mindset simply isnt there
type challenges on github is so good
If you know what you need, I can help you make a type
oh nah i dont want help
i'd rather learn how to do it, than have some1 do it for me
having people do it for u is useless for learning
having it already done by other people is useful tho
Do type challenges. Unironically so good
im simply rewriting all my codebase to typescript, but it still feels shit, like i feel like my fundamental understanding of typescript is wrong, i'm writing js, with types, but typescript feels like it should be a different language than JS, because you can architecture shit differently thanks to types
problem is, i dont know how to approach it
its hard to find good typescript codebases to learn from, because a lot of them are simply overengineered or overcomplex, and the ones that are actually so fucking complex they should use typescript, rarely do
sorry, i'm hyper obsessed with doing something utterly perfectly when i put actual effort into something, i either go with minimal effort and not give a fuck, or make sure its utterly perfect, no in-between
Again, my best advice is just to do some of the type challenges understand the basics, and then you will be shocked at the horror code you can write
Hi, is there more detailed documentation available than https://docs.vencord.dev/?
why does this work? https://github.com/Vendicated/Vencord/blob/main/src/plugins/fixYoutubeEmbeds.desktop/native.ts
The cutest Discord client mod. Contribute to Vendicated/Vencord development by creating an account on GitHub.
what's special about childList and subtree?
They are "special" because .observe() takes those arguments
Not exactly, but if you're looking for specifics then ask about those specifics
Its really hard to help if your intentions are unclear
Looking for basic information about vencord plugins. The frontpage of the docs site lists features like the plugin api and regexp code patches with no further details about those interfaces.
look at other plugins
its the best examples for what things do, and with an API that moves fast (because discord breakages) having docs up to date is hard, but its in progress
Is there one you would point to that is well documented and utilizes most of the features available
@stuck mango
No, each plugin does its own little things so unless you know what you want to do its hard for us to know what to tell you to look at
It's at least something
What are you trying to make
At least the basic explanation on how patches work I assume
I don't have a specific plugin in mind. Was trying to get an idea for what is available to plugins before picking a goal to tackle.
Also check the video in the pinned messages
Everything is available, you either use vencord api ( check other plugins ) or change ( patch ) discord code to make your thing
90% of the time you will need a patch
coming in to ask about docs when you aren't really sure what you want to do is a bad idea imo
You are in a project all about picking apart a closed source project and manipulating and patching it, having a clear goal in mind from the get go is basically essential.
You can do basically anything as long as the discord api permits it
That's how you might find where you have to make a patch
Well, there could be docs about vencord api at least
Like what different stores do, or decorations api
I understand that documentation is hard on changing interfaces and often gets left behind.
The frontpage of the docs made it sound like Vencord is providing a more stable interface than what would be availble to me simply modifying the Discord client myself.
I'm not sure what might be a good candidate for a Vencord plugin because I realize that what this project is doing is difficult and I do not have interest in trying implement and then maintain something overtop of the closed source moving codebase that is the Discord client. I appreciate very much the goal and effort behind Vencord. I wanted to evaluate what is reasonable to do in a Vencord plugin that would not require making something I would need to maintain as it's own Discord Client mod.
If you do simple things/reliable patches than most of the time it will withstand discord changes, but yes, it might break
tbf if you're not available to fix it if it breaks in future there's a fair chance someone will pick it up, nice benefit of it being a community project
Well, yeah, but I would feel bad giving my child to others
- if it's my bad patch or smth
Thanks, I am comfortable being able to find the code needed to be modified for specific React Components. The document you linked earlier is very helpful in illustrating the RegExp patch interface. The top of the document does say it is superceded by the new document site; is the information still mostly valid from that document?
Yeah it obviously shouldn't be the mindset going in, ideally
But it is the reality
Yeah, it's still the same. The one thing that 100% changed is discord's code example
Official docs haven't been made yet as you can see
And finding i18n strings is harder now
But basics are the same
You are not required to make finds by them
Thanks for the assistance!
But on the other hand, your bad patch isn't your concern anymore
It should be good enough to get merged
And then delete your discord account, so nobody can get to you

How can i copy a text to clipboard?
copyWithToast or Clipboard.copy if you don't want a toast
see how discord does it
react devtools is your friend
or think of vencord plugins that do, there are multiple
how cursed is this css? it makes the icon smaller when visual refresh is enabled to match the rest of the icons
html[class*="visual-refresh"] .vc-gary-icon {
width: 24px;
height: 24px;
}
Has any work gone into making ClientTheme work with visual refresh? I wouldn't mind looking into it at some point if not
not very
also I removed the :has() that makes my bigger plugin list only apply to the plugins tab and one tab in particular doesn't like the max width being unset lol
Oh sick
Yop
i think better to use this
So in terms of just making the plugin work directly it just needs to set those new css vars as well then
I mean, yes it kind of works, but also the color is too flat and you need those offsets
it looks fine just with this to me?
yes, it looks fine but for purely design standpoint the colors to flat and needs offsets, especially in the right part with the members list
there’s almost no discern from where the chat ends and the members list starts
Except for that white line
well that's the case without changing the vars too
I mean, yes it looks good and it works, but you gotta think client theme does more than just color your client... It also adds depths to the colors.
idrk what you mean
oh wait is that comma intentional
i do know what you mean if it's not
ok then yeah i see what you mean now
I might take a look at it later then
Thanks, I just went with notifications + Clipboard.copy
also, i am not really familiar with web stuff. Especially how cors and etc. work. I am trying to fetch some videos from cdn of discord but i get CORS error. what headers do i need to use so i can fetch those videos?
mediaItem.proxyUrl seems to work for videos tho it doesn't always exist. Lemme know if you guys know how discord makes requests of videos
Hiya! Question for this new Vencord dev 😅
I'm running into some issues with Webpack.findByProps which I have no clue on how to fix, or why it's even giving me this error, as I've changed to findByPropsLazy
I've rebuild Vencord (web) several times, yet for some reason it doesn't solve it.
import { findByPropsLazy } from "@webpack";
const ChannelStore = findByPropsLazy("getChannel", "getDMFromUserId");
const SelectedChannelStore = findByPropsLazy("getChannelId");
const ChannelTextAreaContainer = findByPropsLazy("ChannelTextAreaContainer");
What are the issues/error?
Don't know if any of it could be related to a different error;
which I suppose I'm getting due to
const settings = definePluginSettings({
enabled: {
type: OptionType.BOOLEAN,
description: "Enable or disable the plugin",
default: true,
},
autoExecute: {
type: OptionType.BOOLEAN,
description: "Enable or disable automatic transcripting for RegEx Channel name",
default: false,
},
channelPattern: {
type: OptionType.STRING,
description: "Regular expression to match channel names",
default: ".*", // Matches all channels by default
},
});
if (settings.use().enabled) {
Nevermind, somehow managed to fix it
this is very cursed
its alot better than my first attempt where i tried to find a way to detect visual refresh in the plugin code and update it there
yippee i have access
anyway
Ive got some decent progress on my oneko customization plugin so far, im wondering if there are more option types and if there is documentation somewhere regarding the definePluginSettings, im hoping instead of having the end user type out the name of each cat they can just use a dropdown menu or something
(yes I am aware that you can make drop down menus using some fancy code, however I want it to be done with the defInePluginSettings library for simplicity, brand new to all this and dont want to make it too complicated just yet)
settings.ts: Lines 53-63
service: {
type: OptionType.SELECT,
description: IS_WEB ? "Translation service (Not supported on Web!)" : "Translation service",
disabled: () => IS_WEB,
options: [
{ label: "Google Translate", value: "google", default: true },
{ label: "DeepL Free", value: "deepl" },
{ label: "DeepL Pro", value: "deepl-pro" }
] as const,
onChange: resetLanguageDefaults
},
in the future try to do your own research
so many other plugins have dropdowns
whenever you want to know how to do something, find an existing plugin that does and see how that does it
i tried using a plugin that has dropdowns but it did a complicated way on doing it, as stated in my message i wanted it to be done via the settings library
having some sort of documentation link should prevent me from asking more/any questions
there are none
the documentation is looking at other plugins
there are so many plugins
u should get to that one day
the problem with patching/modding an app like this is that its not really stable, and tbf we've been lucky that discord didnt change much about their code in so long
so putting actual effort into it is kinda a waste of time since its a gamble if it changes next week or not
and then you have outdated docs and yeah
it sux
no
Vencord Api will never be documented
it's useless
the only thing that needs documentation is concepts
like how to find modules
how to write patches
etc
what doesn't need docs is how to use vencord functions / apis
most public api has jsdoc and you have so many examples to look at, if you can't figure out how stuff works with that you won't be able to figure out how discord code works either so it's a waste of time to try to teach you
I know theres a lot of stuff available online :p but what isnt really is the concepts you just mentioned
which is what I was referring to
there's fairly little point rn
we already have so many pending PRs
we don't need more contributions at the moment
for the docs?
vencord
im really happy with how its turning out, got stuck on changing the kitty cuz i was using the wrong value for the link identifier but mangaged to get it working!
what do you guys think i should add?
video demo for yall
I want to thank those who helped me, I know I used the wrong channels a couple times but its turned out great so far, last part is to attempt creating a way for multiple kitties
what im thinking of is making a list of dictionaries, you can switch cats by going inbetween their "names" you assign them using a drop down , this will update the defaults and display the settings for either a new kitty or a kitty you have selected before, then when first starting it will run the fetch/eval thing for as many items there are in the list, using the lists index to get the correlating dictionary and using that dictionary for the values needed
just realized you can hear my music in the back ground 😭
it fits fine in that video imo
I've heard much more... extreme music in videos here
it was the end of the song i think so its fine lol
Yk what I think should be added an easier way to add custom skins… there’s a whole repo based around oneko stuff and on there, they have custom skins… As of rn you have to do via css but an “custom skin” option where you put in the link to an online png file would be cool…
im really new to all this, everything ive done so far has been by frankinsteing code and sheer luck, i would LOVE to do smth like that but i honestly just have no idea how lmao
frankenstiening
this is not too far off of what i was listening to 😭
oh my god they are all so cute
ik i love the valentine skin
also eevee
they look quite similar though, I had no idea this existed so huge thanks on showing this to me!
Yeah, most skins are based off the white one and just colored from there
And you can’t really stray too far away from that stencil it starts looking weird
there even used to be a 4k oneko skin and that one was really weird
yk now that i think abt it i could probably make a value at the end that is "CUSTOM IMAGE"
the code will check if there is anything in that text box, if there is it will override the dropdown pic, attempt to grab the image, if not it will grab a different image that is a table set full of little error symbols, showing you that it didnt quite work
i think im gonna work on that before i add support for multiple cats lol
I mean, that sounds like the most easiest way to do it other than just adding a bunch of skins is allow someone to upload a custom skin and then just making a publicly available repo where people can submit their skins and other people can use it
@dull magnet Vencord/Oneko repo when 
wdym
A github repo just for skins
ohh
I could always make my own? especially considering im planning on submitting this plugin
but I made a joke about adding the repo the Vencord org
ohh
considering there is already an oneko plugin does mine have any chance of being officially accepted? im not too sure how the process works lol
since it’s an enhancement of an already existing plugin, that would just probably replace that one that already exists
You have a higher chance of being accepted
although whoever is author on the old one I would keep them as an author on the new one
oh im planning on barely taking any credit, i have not the slightest clue what im doing and for some reason its still working 😭
Everyone start somewhere
I was in still kind and still kinda of am the exact same way
It’s a miracle I was able to fix WriteUpperCase
im suprised that any of my code is working at all, i dont even know javascript/typescript
i only know python, nothing else
gah dayum 😭
ctrl c and ctrl v are gonna be in the credits 😭
🗣️
i think since im gonna be adding a custom link thing i might as well integrate the billion skins this has
wait those are pngs and ive been using gifs, it might not work 😭
well we gonna see
covert them to gifs
download them, convert to gif, then reupload somewhere
prolly a diff git repo
yeah i have a testing repo incase i need to change small snippets
apparently no need, pngs work
as proven by maia running around on my screen
nice
took me a hot minute but whabam, all added (hopefully)
that might be to many options
maybe, lmk which ones are too similar so i can remove em 😭
time to test
well it works!
time to test all of em
they all work!
time to add custom
hypothetically done
IT WORKS
CUSTOM WORKS
There’s not really a way to gauge the most popular, so honestly what I would do is just go through the list and find the ones that you like the most or you think is the coolest or most unique and put those in by default and then just have the rest of them that can be used as a custom
Then have a link to a git repo (You can make your own) telling people a the custom skins
You can see something like Usrbg for how to that
probably, i dont think a bunch of options is too big of an issue tho
maybe cut it down to abt 15, the whole idea is customization and limiting the options doesnt quite line up with that lol
maybe ima change my mind later idk
time to do the part i was dreading
multiple cats at once
insane
i have an idea on how to do it but at the same time no idea lmao
never truer words spoken
gonna take a small break then get back to slaving away, just for vencord users to enjoy multiple cats on tehir screen
tehir
lol, custom non oneko image
now that im back to working i have 3 issues i gotta solve before starting
1: being able to store this list of dictionaires somewhere, like in the settings except you cant physically access it
2: a button to "save kitty", the idea is you have a drop down of created kitties along with a "new kitty", selecting new kitty and clicking the button will save all data entered into the list/dictionary above
3: clearing/updating the defaults on the settings page, when you select a premade kitty it will load all of its values (or in the case of new kitty it will load the default values)
a few other ones but i think those are less of a priority
idk how to do these but i will be looking through various plugins, if anybody knows how to fix a problem feel free to (please) answer and I will try my best to implement it without asking too many questions lol
show a screenshot of what the settings look like rn
yeah ofc
if you need me to do the this thing
i can
im gonna work on/add the name and cat picker after i figure out how to do all of these things
show a screenshot of what the model looks like
*module
the js file im using?
yeah
this is the exact one it pulls from: https://github.com/Tangerine0411/TestingStuff/blob/main/onek0.js
and this is the original (assuming i have changed something)https://github.com/kyrie25/spicetify-oneko/tree/main
all im doing is using this to change the values in the code itself
Thats not im talking about
show a full screenshot of this
ohhh
sure
basically some checks to make sure you dont set things to 0 and make sure that the kitty type doesnt screw up (it was giving errors for some reason)
yeah i jus cant find anything, i might just be dumb tho
Also im not sure if itll be accepted with you fetching from other peoples, because itll be prolly be a safety concern
What id do is take the assets and reupload them in a git repo your account that is making the pr owns
the tangerine thing is mine, im sure there is a way to lock it to a specific version somehow
tangerine04/11 is me
and while i doubt oneko cord would do that i probably will after i get this stuff all finished up
i think i found out how to get buttons so im abt to test that rq
You’d be surprised what can be done with a png, but also there is no telling if say the owner of OnekoCord just deletes the repo or whatever and boom the plugin is essentially broken
true, rn im just testing things (button has error) so there isnt much of a need currently, but before submitting im gonna do that
i noticed on the official one there was a bunch of numbers in the raw link, im assuming that links to a specific version, meaning it cant be changed (therfore keeping it safe)
i think i found a button
no, too specific
multiple kitty might not be possible (for my skill level) jus cuz of this button 😭
yeah that pins it to a specific commit
and commits are immutable
Gotcha, gonna have to do that before I submit anything
I have an idea but it's kinda dumb
yeah, also you might want to setup your dev environment properly because that formatting is a little insane
Whats wrong with my formatting 😭
A couple things here
- you can use nullish coalescing here instead of
if (condition == 0) condition = default_value - fetching a js file from a random github repo is uhhh bad :3
- you shouldn't have to do monkeypatching in the code if you have control over the contents already
- use template strings please I beg
also generally using var is bad practice, but that's bleh who cares
at least pin it to a hash
alr lemme look at this rq
1: idk what this means 😭
2) if you are talking about "tangerine0411" dw thats me, i have full and complete control over that repo lol
3) im assuming monkeypatching means the things im doing with the replace after fetching, im brand new to this and figured this is a pretty simple way on doing it
4) also dont know what that means
and for 2), im planning on moving the images to my repo soon, just not rn
also dont know what that is
im like extra brand new to all this, figured it would be a fun project and it was... up unitl the nefarious button
yeah i think i can use let instead right?
yeah, figured it would be a quick project, didnt realize what i was getting myself into 😭
nullish coalescing is simpler than it sounds just give it a quick google
gotcha
Nullish coalescing is the ?? operator in JS, it's a little confusing but it basically is a one liner version of
if (condition != null) condition = whatever_value_you_set
so for example you would instead write it as
let kitty_distance_replace = settings.store.kitty_distance ?? 48
so its this thing i used here
yea
i kept running into an error with the if and googled it, got that
In this case, if settings.store.kitty_distance is defined, everything is all good and it uses that value, but if it's not, it sets both settings.store.kitty_distance and kitty_distance_replace to the second value
Yeah exactly that
gotcha
Although in theory, you should really set up an init function in the actual oneko.js code instead, and just pass parameters
im trying to add a custom button to the server list. I can use the serverlist api to add it, but is there any easy way to replicate the pill hover animation, and the tooltip?
If you don't mind, I'm definitely willing to rewrite the code in a bit to fix some small issues (both oneko and the actual plugin)
referring to the pill on the left here
trying to replicate that
i want the button to be consistent with other elements in the server list
oh no i dont mind at all, this is more of a fun little project then something i want to keep all to myself
lemme upload what i have to my repo rq
just throw the link over when it's all ready :>
just my little testing grounds
ive been using onek0 instead of the other one
i dont remember why though...
is the MessagePopover api for tooltips? Or is that for something else
oh no I found tooltip stuff in common folder
its for the buttons that appear when you hover a message
makes sense
alr im back
my formatting might be horrible but at least (most) of my variable names are fire
bumping this, I have the hover and styling of it all looking good, I just need to replicate that pill
Is there any easy way to do that or do I just need to make it myself and try to get it looking the same
see how ReadAllNotifications puts their text there and do that
thats exactly what i did
all that plugin does is insert a button at the top, but that doesn't add the pill that other elements on the server bar have
(or any other styling, but thats easy to add)
what “pill”
this
See how discord does it
Its honestly probably just some CSS
:Hover or :Active id assume
it uses a js animation, i'll see if i can copy it
No way
Who would do such a thing
idk can't think of anyone
dont share for and watch any video sadan sends in #👾-core-development
not as bad as I was expecting
But i dont watch near my mother and have my phone scream the ||n-word|| when i watch i video sent in this server
I didn't hear that word in any of the videos I watched
It doesn’t matter anyways just music
me when headphones
I'm not sure, gonna have to think abt it for a sec
if i use the normal vencord updater, when does it decide to stop using my dev build of vencord?
it doesn’t usually lol
it wont
if u switch branch or be subject to one of nookies force pushes (which only happens on dev branches and not main usually) it might tell you to fix your "local changes" but other than that no
We love nookies force pushes
normal day at vencord dev branch
I am trying to make my own plugin, but I cant really see the difference between find and match in the patches of the plugin.
Find is for identifying the module, match is what to replace inside it
Now I wonder how did trey became contributor..
Apparently this commit https://github.com/Vendicated/Vencord/commit/55901ba35ecbdb6198227fbe4df1a2f14200b643

It was a while ago and i forgot
When I try to get to the onclick method for a button, I am getting onClick: () => null == O ? void 0 : O(n), instead of an actual function, even following #🧩-plugin-development message, I may be doing something wrong, but this was the way I did it last time.
use the break point to jump to the definition of O
Got it, thanks.
now that im done working (procrastinating my english hw)
how would i implement a button in the settings page of my plugin?
ive tried looking at some other plugins and while im pretty sure i know what to do after i just couldnt implement it in my plugin
idk if it matters but im doing it in ts not tsx
you need tsx 
i guess it was worth mentioning
alright well lemme be right back to see if my code works in tsx or not
indeed it does
so uhh, what now lol
i might have it working?
i guess not
"Property 'guh' does not exist on type 'JSX.IntrinsicElements'"
ignore my fabulous names
is it really the capitail letter thats the issue? istg
OH MY GOD IT WAS
OH MY GOD 😭
THERE ARE SO MANY
they are multiplying
jsx elements have to start with capital letters
otherwise they are raw normal html elements
yeah i recently learned that lol
on the bright side, lots of kitty
only issue is i cant delete them yet, but the button is progress
good ol reset got him outta here
one thing that i want to do is when you select an element in a drop down it will "update" all the values in the settings page to a variable, how would i do that?
ive seen some "update" things in plugins but im not 100% sure how they work
let me test smth rq
nope
hm
does the settings HAVE to be a constant?
lets see!
well it hasnt broken
how would i go about changing one of these values? default is the one im looking to change
i think i could just settings.store.kitty_speed.default = 3928493 but .default doesnt exist, how would i access it?
settings.def
some of the Zz's look a little weird, but very cool
I didn't make the kitties but if you point out which one it is I can try to fix it!
Oh and turns out default isn't quite the value I'm looking for, I want it to change what's currently being displayed, this way it "loads" the setting of all the kitties you made/saved previously
huh?
Uhh
Lemme screenshot to see if that helps
these are the settings of the plugin (lets pretend that at the top there is a dropdown and a text input for a name
@solemn scroll use cammelCase for the settings instead of snake_case
uh alr, gonna do that later ig
anyway
whoops clicked enter too fast
it might just be like the current frame or something
where are the textures?
at the start you will only have one item in the dropdown, New Kitty, then at the bottom there are two buttons, create kitty and delete kitty (maybe a save button too)
when selecting a cat you have made previously, it will cause all of the settings to change, to whatever you set earlier, meaning for example the screenshot above would be the settings for "jack" but when i change it to "john" it will change the values, for example kitty speed would be 44 and kitty distance would be 7
if this is a bad explanation then idk 😭
lemme find the github repo rq
ok yeah the actual textures look fine
it's just taking the ss in the middle of the anim made some of them a bit funny i think
ohh gotcha


