#🧩-plugin-development

1 messages · Page 75 of 1

humble tulip
#

I never got into PWAs tbh, I didn't really see the benefit over just having a bookmark in your browser

#

For like 99% of sites

flint bronze
#

it's real

dull magnet
#

you will be happy to find out that we were considering Vencord Installer PWA for a while

grand haven
grand haven
#

so nothing to consider

#

i have an entire paper on PWAs

#

1 sec

#

i wrote it as one of my papers for uni

flint bronze
grand haven
#

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

flint bronze
#

wrong

grand haven
#

depends on what u use to read it

#

if you use adobe reader then yeah

#

if you use

#

A PWA

#

ITS SAFER

#

MYUAHAHAHAHA

flint bronze
grand haven
#

the PWA is just the browser's pdf reader wrapped in a nicer UI

#

XD

humble tulip
#

Also is github down?

grand haven
#

nah, just eating shit

flint bronze
humble tulip
#

How will they ever review PRs now

#

I think the api is fine tbf, I got that PR number from the intellij plugin

grand haven
#

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

flint bronze
#

What is an IWA

#

ohj

grand haven
#

which gives them access to more APIs, but also forces stricter CSP etc

flint bronze
grand haven
#

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

dull magnet
#

can it bypass cors tho

flint bronze
#

afaik

dull magnet
#

ok?

flint bronze
#

when will we get extension natives in vencord blobcatcozy

#

actually why am I asking

#

fuck you github

#

i was just about to go look at @grand haven's code

#

Is it back?

grand haven
flint bronze
grand haven
#

you have raw tcp/udp, cors only exists if you implement it

flint bronze
#

or is it on another branch

flint bronze
grand haven
#

its nothing special

#

i kept it simple, because people dont like merging raw prs

grand haven
#

with v3 this was removed

flint bronze
#

oh

grand haven
#

and a new TCP/UDP socket api was created, with a completly new API and structure

flint bronze
#

that explains why I couldn't find it when I was last looking for it

grand haven
#

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

flint bronze
#

why 😭

grand haven
#

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"

flint bronze
#

are DNS lookups supported

grand haven
#

no, gotta implement it yourself

#

its not hard

flint bronze
grand haven
#

you gotta implement http yourself too

flint bronze
#

that's so dumb

grand haven
#

its not hard either

flint bronze
grand haven
#

its almost identicall actually

#

and http2 is harder than dns query by a lot

flint bronze
grand haven
#

that's an extension

flint bronze
#

I know

grand haven
#

we're talking about websites

flint bronze
#

so if there's no DNS support in this then what are people expected to do

#

use a hardcoded public DNS resolver?

grand haven
#

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

flint bronze
#

what's your take on WebAuthn attestation

grand haven
#

never used it

#

never had a need

#

its just "another auth method"

#

it doesnt bring anything new, or let u do cool new stuff

flint bronze
#

i mean the attestation functionality specifically

grand haven
#

again, this was doable by other means before

#

its just more streamlined now

flint bronze
#

you do not know what webauthn attestation is

flint bronze
grand haven
#

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

flint bronze
#

ok so

password manager DRM

flint bronze
#

at least, how I see it

kindred perch
#

How can i search a string through every single source file

humble tulip
#

Like ctrl+shift+f in dev tools?

quick zephyr
#

No matching export in "src/webpack/common/index.ts" for import "Icons"

getting this on a personal plugin after the update. what changed?

dull magnet
#

Icons common removed

#

cause it got mangled / removed so it's useless now

#

just copy paste the svg

quick zephyr
#

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 😭

humble tulip
#

Have a look at the ones in src/components/Icons.tsx

vast karma
#

In most cases, if you pass a giant string in jsx, you get a giant string in the dom

#

Menus are... special though

quick zephyr
humble tulip
#

I mean for how to use an svg as an Icon in general

humble tulip
quick zephyr
#

that didnt work. tried it first

#

Type 'Element' is not assignable to type 'ComponentType<any> | undefined'.

vast karma
#

Check how any other code does menu items with icons

#

ViewRaw should have some I think

cedar olive
#

either way seems like you are rendering your icon before passing to the Menu

#

and instead you should just be passing the icon

quick zephyr
#

wrapping it in {() => <svg></svg>} worked

cedar olive
#

yes because then you are not rendering it

quick zephyr
cedar olive
#

you are passing the functional component which renders it

#

function MyComponent() {...} is a ComponentType, which when called/rendered returns Element

quick zephyr
quick zephyr
leaden fable
#

What is toolboxActions?

humble tulip
#

It adds to this if you have the vencordtoolbox plugin enabled

quick zephyr
#

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

leaden fable
#

ooo Thanks

humble tulip
# quick zephyr

Is the viewbox set right? You might just be looking really closely at a corner or something

#

like this

quick zephyr
#

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 😭

hushed loom
quick zephyr
#

ah the problem is the missing fill-rule

#

but the code yells at me if I dont remove that

humble tulip
#

Probably make it fillRule

kindred perch
#

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()
humble tulip
#

You can probably shorten that string, I forgot to check

quick zephyr
humble tulip
humble tulip
#

Guess it depends on whether you want to allow dupes then

cedar olive
#

need to call that as a function, not JSX

quick zephyr
#

that looks more confusing than just using a raw svg

cedar olive
#

that handles whether you have Developer Mode enabled and renders the whole button, not just the Icon

#

It's how discord creates "Copy ... ID"

quick zephyr
#

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

cedar olive
#

actually that has an extra prop you can use

#

showWithoutDeveloperMode

inner monolith
#

Doess vencord give you access to the electron backend or is it just the render process?

cedar olive
#

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

inner monolith
#

i see

kindred perch
#

what are all the findByProps equivalents?

cedar olive
#

equivalents?

kindred perch
cedar olive
#

without the all versions

#

It's mainly 4:

#

byProps, byCode, byComponentCode, byStoreName

kindred perch
#

so all gives all the matches found?

cedar olive
#

yeah

kindred perch
#

how does bycode work?

cedar olive
#

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

kindred perch
#

so to modify a function i need to use .toString?

hushed loom
#

to modify a function you use patches 😭

cedar olive
#

byCode works like this

hushed loom
#

how long has wp been in console shortcuts 😭 ive always been using vencord.wbepack

kindred perch
#

How can i get a reference to a var that contains an object inside a function, or inside an array?

cedar olive
#

patches

#

not webpack finds

kindred perch
cedar olive
#

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

hushed loom
#

this seems like xy, what is your end goal?

kindred perch
kindred perch
hushed loom
#

what moduleid is that

kindred perch
#

this? 612226

hushed loom
#

yeah

cedar olive
#

that object is exported

#

now, the object you need is one of these

hushed loom
kindred perch
#

but don't patches apply before anything else, so if i change it at the start, every export will be changed

cedar olive
#

this one, to be more exact

kindred perch
cedar olive
#

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"

kindred perch
#

ok, i think i understand now, thanks

worthy path
#

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

stiff dragon
#

still stuck on this

#

i cleaned up a lot of the code

humble tulip
humble tulip
stiff dragon
#

it returns the link as undefined

worthy path
inner monolith
#

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

stiff dragon
#

im not sure

#

also i dont know how to add a second menu below that

#

beacuse i dislike react SakuraYay

inner monolith
#
type Promisable<T> = T | Promise<T>;
#

didn't know that existed

inner monolith
#
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?

stiff dragon
#

oh i forgot to await it yea

inner monolith
#

it's promiseable because it's lazy loaded i guess

stiff dragon
#

AYYY THAT FIIXED IT!!

inner monolith
#

ayy

stiff dragon
#

thank you

inner monolith
#

no problem :D

inner monolith
#

lmao

stiff dragon
#

how would i add a second menu to it again?

#

i remembered uh

#

how to do it on mobile

inner monolith
#

🤨 what

#

mobile?

stiff dragon
#

i used to maintain a fork of a mobile mod

#

so i worked with react more back then

inner monolith
#

buildMenuItem(...argsforitem1);
buildMenuItem(...argsforitem2);

#

and then add them both to the menu

stiff dragon
#

then it does this

stiff dragon
inner monolith
#

yup

stiff dragon
#

i mean i could but i think itd be better if i just combined them botyh

inner monolith
#

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

stiff dragon
#

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

inner monolith
#

can i change which position of my context menu I put a menu item in?

stiff dragon
humble tulip
cedar olive
#

that name is soo horrible lmao

#

I shall make a new function with different name that also returns the index of the item

inner monolith
#

😭

#

findGroupChildrenByChildId

cedar olive
#

I made it when I didnt know much about react and stuff

#

so I just made up something that made sense

inner monolith
#

I still don't know much about react and I've got to build a massive project using it soon

#

so that's fun

humble tulip
cedar olive
#

should have been findTreeByChild

#

or something like that

humble tulip
#

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

inner monolith
#

How's roblox

stiff dragon
#

except

#

this is called devmode-copy-id yea

#

i have this but it doesnt do anything at all

cedar olive
#

doesn't work for those

#

they are called devmode-copy-id- + the actual id

#

devmode-copy-id-${id}

humble tulip
#

Didn't you make one that could do substrings?

cedar olive
#

oh yeahhh

humble tulip
#

Yeah just add true as a third param

cedar olive
#

it's the third param

humble tulip
#

My discord has been super laggy all day and I don't know if it's my fault or not

stiff dragon
#

is there a native way to get it

cedar olive
#

findGroupChildrenByChild("devmode-copy-id", children, true)

humble tulip
#

Trying to get across how this formatting works and what the settings mean is the main pain with this plugin

cedar olive
#

I would help you if I had more knowledge with timestamps, but I dont

inner monolith
#

lol

humble tulip
#

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

inner monolith
#

I know how to use timetamps but that doesn't make much sense to me

humble tulip
#

Yeah it's kinda just meaningless at first glance

inner monolith
#

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

humble tulip
#

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

inner monolith
#

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

humble tulip
#

Maybe it should be renamed to CustomMessageTimestamps

#

Could help make it a bit clearer immediately

inner monolith
#

or TimestampFormatter

#

because it doesn't have to do with messages

#

you can put timestamps in your user profile

humble tulip
#

This doesn't affect those, it's only timestamps on messages

inner monolith
#

Ah okay

humble tulip
inner monolith
#

ohhh

#

does it affect the timestamp i'm talking about in messages?

#

or just the sent/edited timestamps

humble tulip
#

Just sent/edited

#

So you can set the format for cozy, tooltip and compact, in that order in the images

inner monolith
#

damn I just realised you have suffocate as your tag

#

that's cool

humble tulip
#

I dunno how lol, my account isn't even that old but I guess nobody before me wanted it suffoPeepoShrug

#

Or were inactive when offered

rigid marlin
#

is there a way to talk from native -> browser? i'm trying to do global shortcuts via electron's globalShortcut

dull magnet
#

ipc

rigid marlin
#

i tried but i can't find it

#

like i can't import from electron and idk what global it's defined as

dull magnet
#

you can import from electron

rigid marlin
#

in browser code?

dull magnet
#

no

#

in native

rigid marlin
#

how does browser recieve the message from native

#

that's the part i'm stuck on

dull magnet
#

ipc

rigid marlin
#

do you have example code pls

#

idk how to use ipc on the browser

dull magnet
cedar olive
#

basically browser calls ipc -> ipc responds from native

rigid marlin
#

so i have to poll native from browser?

cedar olive
#

you want native sending messages to browser?

rigid marlin
#

yes

cedar olive
#

ideally it shouldnt be like that, and I'm also not sure if there is another way to do it, but you can executeJavascript

dull magnet
rigid marlin
#

too many words

cedar olive
#

and then have some function accesible from the window which you can call using executeJavascript

#

but ideally it should be browser -> ipc -> answer

rigid marlin
#

hmm okay

#

thanks i'll have a look

dull magnet
rigid marlin
#

it probably does but it's a lot of text

#

and why read through text when i can ask someone to summarise for me 😁

cedar olive
rigid marlin
#

its ok

#

i read guys

dull magnet
rigid marlin
#

it appears so

rigid marlin
#

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

rough scroll
#

anyone got a link to the discord notification sfx from holidays?

restive hare
#

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

cedar olive
#

have you fully restarted your discord?

restive hare
#

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

cedar olive
#

that needs to match your plugin name

restive hare
#

Ohhhhh

#

That makes sense

#

Yeah that was it

restive hare
dull magnet
#

did u think it's just black magic that guesses what name you wanna use 😭

kindred perch
#

is there anything somewhere on how patches work?

kindred perch
#

How can i append code after the match, not just replacing already existing one?

kindred perch
#

Can i add a function call to a function in my code in the replacement?

vast karma
#

Sure, it's just code

#

Code can call functions

#

$self expands to a reference to the plugin object

kindred perch
#

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?

vast karma
#

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

kindred perch
#

does the capture group have to be in the match, or the find part?

vast karma
#

Uh

#

It's just a regex replace

kindred perch
#

but whats the point of find if therer a match?

vast karma
#

To know what module to replace in

kindred perch
#

so find gets you the module, then it replaces in the module?

vast karma
#

Yes

kindred perch
#

thanks

kindred perch
#

does vencord exist on mac/linux?

hushed loom
kindred perch
#

is ctrl/alt key the same for them?

hushed loom
#

I wrote a keybind mapper a while back

#

But you probably want to use discords own system

hushed loom
rigid marlin
#

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

kindred perch
rigid marlin
kindred perch
#

but why not just make an application yourself then, this should be pretty ez

kindred perch
rigid marlin
#

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 😔

flint bronze
rigid marlin
#

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

flint bronze
#

its not

rigid marlin
#

oh i misread your question lol

flint bronze
kindred perch
#

How do i findAllByProps in the code, it works in console, but not in code

vast karma
#

You usually want lazy finds in plugins

kindred perch
vast karma
#

Ah, so you're not doing a ByProps filter in the first place

humble tulip
#

Have a look in consoleshortcuts for what findAllByProps actually is

vast karma
#

If you want a custom filter, use a custom filter

kindred perch
vast karma
#

Which is not how you're supposed to do finds

kindred perch
#

how should i do it then?

vast karma
#

With a custom filter

kindred perch
#

whats a custom filter?

vast karma
#

findLazy(m => Math.random() < 0.1)

kindred perch
cedar olive
#

seems like you are just finding the FluxDispatcher, which is already a common

topaz venture
#

Hello vendevs guild_eyes_hmm
Can maybe someone tell me how to import api requests?

Sadly import { request } from "@utils/http"; // API request utility Dont work xd

oak sundial
#

well what are you trying to do

topaz venture
#

AI Rewrite plugin Pepe_Think SOmething which let you to manipulate your sent messages with chatgpt and for this i need to make api requests to openai api

oak sundial
#

AI slop

topaz venture
#

AI is cool and humans are to lazy to write large texts so why dont let chatgpt make it for u, nh? xd

topaz venture
#

THey dont like AI, okay Pepe_Think

hushed loom
swift delta
#

also Notepad ++ mention

oak sundial
#

doesn't this need a native.ts?

#

i can't remember what does and doesn't

kindred perch
#

requests don't need native, unless theres cors

amber mantle
#

dont be a retard with ai and you will be just fine

#

(most people are being idiots with it)

amber mantle
dull magnet
clear parcel
#

well

#

feed it all the other plugins and discord's js and it will get decently far

#

if u have gpt 4o that is

gloomy terrace
#

feed it fakenitro

#

and it will explod

hushed loom
#

fake nitro is sane compared to shc

gloomy terrace
hushed loom
gloomy terrace
#

wait, shc is

#

oh, hidden channels

clear parcel
gloomy terrace
#

for some reason my brain processed that as hidden things

clear parcel
#

copilot "think deeper" uses gpt 4o now

gloomy terrace
clear parcel
#

huh they added a captcha to it

#

ig that would be very abusable lol

amber mantle
#

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

kindred perch
hushed loom
hushed loom
#

is it possible to intercept a file using a presend listener

hushed loom
worthy rose
#

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

bronze dove
#

find: "#{intl::REPLYING_TO}"

worthy rose
#

how did you find that out lol /genq

bronze dove
worthy rose
#

Oh

#

That's awesome, thank you!

kindred perch
#

How can i force a modal height to be max size, even if the content doesnt do the full size?

iron epoch
#

pass size to ModalRoot

kindred perch
cedar olive
#

height: 100% with css

#

simply set your empty content to width and height 100%

kindred perch
cedar olive
#

try outside the scroller

kindred perch
#

still doesnt work

dull magnet
#

@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?

dull magnet
gloomy terrace
dull magnet
#

i just deleted usrbg css file and it still works the same

gloomy terrace
#

I remember seeing those classes in a theme I was using at the time

#

Found it venniecozycat

chrome elbow
dull magnet
#

usrbg css causes crazy lag

fallen sandal
#

why does it need insane css just target the image element and override

dull magnet
#

I deleted its css

fallen sandal
#

kapoof

dull magnet
#

@modern chasm you should ask here! but it might be difficult if you're not fluent at English

modern chasm
dull magnet
modern chasm
#

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.

modern chasm
dull magnet
rocky falcon
#

is there a way to close the edit box without sending a bad request to discord?

vast karma
#

What edit box

stiff dragon
#

how do i make a plugin that fixes this fucking annoying bug where it mutes me when im the only person in a call

sinful hound
humble tulip
#

sick

clear parcel
#

discord should make this first party

#

u could have bots with literal game libraries lmao

dull magnet
#

wiþ custom activities

#

þey just need to make it not rely on vc

hushed loom
#

@dull magnet use real th

clear parcel
clever nexusBOT
clear parcel
#

hop on plugin dev poker

dull magnet
#

make it not make you auþorise apps to do 3 million þings on ur account

tight canyon
#

Peak vendor dev setup

flint bronze
flint bronze
#

html component with clickable actions would be soooo good

#

not full activities though

#

also actions shouldnt be able to be scripted

iron epoch
grand haven
#

to 3 monitors

tight canyon
tight canyon
#

Yop

tight canyon
grand haven
#

i usually double or tripple split the code view doe

tight canyon
grand haven
iron epoch
grand haven
#

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

tight canyon
grand haven
#

like advanced TS typing

#

ya know, the fancy shit

tight canyon
#

If you have time

grand haven
#

yeah but its not a good learning format

#

i mean shit like you'd see on type challenges

#

i know the basics

tight canyon
grand haven
#

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

hushed loom
hushed loom
grand haven
#

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

hushed loom
grand haven
#

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

hushed loom
stuck mango
unkempt hemlock
#

what's special about childList and subtree?

vast karma
#

They are "special" because .observe() takes those arguments

oak sundial
stuck mango
oak sundial
#

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

stuck mango
#

Is there one you would point to that is well documented and utilizes most of the features available

tight canyon
#

@stuck mango

oak sundial
#

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

tight canyon
#

It's at least something

oak sundial
#

What are you trying to make

tight canyon
stuck mango
#

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.

tight canyon
tight canyon
#

90% of the time you will need a patch

oak sundial
#

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

tight canyon
#

That's how you might find where you have to make a patch

tight canyon
stuck mango
#

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.

tight canyon
#

If you do simple things/reliable patches than most of the time it will withstand discord changes, but yes, it might break

humble tulip
#

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

tight canyon
#

Well, yeah, but I would feel bad giving my child to others

#
  • if it's my bad patch or smth
stuck mango
# tight canyon That's how you might find where you have to make a patch

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?

humble tulip
#

But it is the reality

tight canyon
#

And finding i18n strings is harder now

#

But basics are the same

tight canyon
stuck mango
#

Thanks for the assistance!

vast karma
tight canyon
#

It should be good enough to get merged

#

And then delete your discord account, so nobody can get to you

stiff dragon
#

did one of the requested suggestions nuke one of the functions required

dark spruce
#

How can i copy a text to clipboard?

dull magnet
#

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

rocky lynx
#

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;
}
humble tulip
#

Has any work gone into making ClientTheme work with visual refresh? I wouldn't mind looking into it at some point if not

humble tulip
#

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

tropic ice
humble tulip
#

Oh sick

tropic ice
humble tulip
#

So in terms of just making the plugin work directly it just needs to set those new css vars as well then

swift delta
tropic ice
swift delta
#

there’s almost no discern from where the chat ends and the members list starts

#

Except for that white line

tropic ice
#

well that's the case without changing the vars too

swift delta
#

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.

tropic ice
#

idrk what you mean

swift delta
#

Offsets

tropic ice
#

oh wait is that comma intentional
i do know what you mean if it's not

swift delta
#

Depth

#

Yeah, I didn’t mean to put that there

tropic ice
#

ok then yeah i see what you mean now

humble tulip
#

I might take a look at it later then

dark spruce
#

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?

dark spruce
#

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

blissful relic
#

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");
humble tulip
#

What are the issues/error?

blissful relic
#

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

rocky lynx
solemn scroll
#

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)

proud parrotBOT
dull magnet
#

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

solemn scroll
#

having some sort of documentation link should prevent me from asking more/any questions

dull magnet
#

there are none

#

the documentation is looking at other plugins

#

there are so many plugins

formal charm
grand haven
#

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

dull magnet
#

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

formal charm
#

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

dull magnet
#

there's fairly little point rn

#

we already have so many pending PRs

#

we don't need more contributions at the moment

formal charm
#

for the docs?

dull magnet
#

vencord

solemn scroll
#

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?

#

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

solemn scroll
tropic ice
#

it fits fine in that video imo
I've heard much more... extreme music in videos here

solemn scroll
swift delta
# solemn scroll what do you guys think i should add?

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…

tropic ice
#

(volume warning on that video btw)

solemn scroll
#

dang anything i say makes 0 sense lol

#

lemme try again

solemn scroll
#

frankenstiening

#

this is not too far off of what i was listening to 😭

solemn scroll
swift delta
solemn scroll
#

wait no the one at the bottom

swift delta
#

also eevee

solemn scroll
#

they look quite similar though, I had no idea this existed so huge thanks on showing this to me!

swift delta
#

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

solemn scroll
#

i think im gonna work on that before i add support for multiple cats lol

swift delta
#

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 prayingcar

swift delta
solemn scroll
#

ohh

#

I could always make my own? especially considering im planning on submitting this plugin

swift delta
#

but I made a joke about adding the repo the Vencord org

solemn scroll
#

ohh

solemn scroll
swift delta
#

You have a higher chance of being accepted

solemn scroll
#

thats great!

#

i dont even remember how i got the idea to do this

swift delta
#

although whoever is author on the old one I would keep them as an author on the new one

solemn scroll
swift delta
#

I was in still kind and still kinda of am the exact same way

#

It’s a miracle I was able to fix WriteUpperCase

solemn scroll
#

im suprised that any of my code is working at all, i dont even know javascript/typescript

#

i only know python, nothing else

swift delta
#

vro i start from assembly

#

I barely know Js/Ts too

solemn scroll
#

ctrl c and ctrl v are gonna be in the credits 😭

solemn scroll
#

alr, time to get back to work 😭

solemn scroll
#

wait those are pngs and ive been using gifs, it might not work 😭

#

well we gonna see

swift delta
#

download them, convert to gif, then reupload somewhere

#

prolly a diff git repo

solemn scroll
solemn scroll
#

as proven by maia running around on my screen

swift delta
#

nice

solemn scroll
swift delta
solemn scroll
#

time to test

solemn scroll
#

time to test all of em

#

they all work!

#

time to add custom

#

hypothetically done

#

IT WORKS

#

CUSTOM WORKS

swift delta
# solemn scroll took me a hot minute but whabam, all added (hopefully)

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

solemn scroll
#

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

solemn scroll
swift delta
solemn scroll
#

gonna take a small break then get back to slaving away, just for vencord users to enjoy multiple cats on tehir screen

#

tehir

solemn scroll
#

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

swift delta
solemn scroll
#

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

swift delta
solemn scroll
#

model?

#

like the settings page in disc?

swift delta
#

*module

solemn scroll
#

the js file im using?

swift delta
solemn scroll
#

all im doing is using this to change the values in the code itself

swift delta
#

Thats not im talking about

swift delta
solemn scroll
#

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

swift delta
# solemn scroll

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

solemn scroll
#

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

swift delta
solemn scroll
#

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 😭

hoary pilot
#

and commits are immutable

solemn scroll
solemn scroll
hoary pilot
solemn scroll
green vessel
# solemn scroll

A couple things here

  1. you can use nullish coalescing here instead of if (condition == 0) condition = default_value
  2. fetching a js file from a random github repo is uhhh bad :3
  3. you shouldn't have to do monkeypatching in the code if you have control over the contents already
  4. use template strings please I beg
#

also generally using var is bad practice, but that's bleh who cares

hushed loom
#

at least pin it to a hash

solemn scroll
#

and for 2), im planning on moving the images to my repo soon, just not rn

solemn scroll
#

im like extra brand new to all this, figured it would be a fun project and it was... up unitl the nefarious button

solemn scroll
dull magnet
#

you should learn basic js first most of this is very basic stuff you should know

solemn scroll
tribal sentinel
#

nullish coalescing is simpler than it sounds just give it a quick google

green vessel
#

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
solemn scroll
tribal sentinel
#

yea

solemn scroll
#

i kept running into an error with the if and googled it, got that

green vessel
#

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

green vessel
solemn scroll
#

gotcha

green vessel
#

Although in theory, you should really set up an init function in the actual oneko.js code instead, and just pass parameters

tribal sentinel
#

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?

green vessel
tribal sentinel
#

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

solemn scroll
#

lemme upload what i have to my repo rq

green vessel
#

just throw the link over when it's all ready :>

solemn scroll
#

just my little testing grounds

#

ive been using onek0 instead of the other one

#

i dont remember why though...

tribal sentinel
#

is the MessagePopover api for tooltips? Or is that for something else

#

oh no I found tooltip stuff in common folder

hushed loom
tribal sentinel
#

makes sense

solemn scroll
#

alr im back

#

my formatting might be horrible but at least (most) of my variable names are fire

tribal sentinel
#

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

swift delta
tribal sentinel
#

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)

swift delta
#

what “pill”

tribal sentinel
swift delta
#

See how discord does it

#

Its honestly probably just some CSS

#

:Hover or :Active id assume

tribal sentinel
#

it uses a js animation, i'll see if i can copy it

solemn scroll
#

headed to sleepy, yall have fun!

#

headed to sleepy 😭

humble tulip
#

Who would do such a thing

tropic ice
#

idk can't think of anyone

swift delta
tropic ice
swift delta
tropic ice
#

I didn't hear that word in any of the videos I watched

swift delta
#

It doesn’t matter anyways just music

solemn scroll
hardy adder
#

if i use the normal vencord updater, when does it decide to stop using my dev build of vencord?

formal charm
#

it doesn’t usually lol

amber mantle
#

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

cedar olive
#

normal day at vencord dev branch

warped nacelle
#

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.

vast karma
#

Find is for identifying the module, match is what to replace inside it

tight canyon
#

Now I wonder how did trey became contributor..

vast karma
tight canyon
warped nacelle
#

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.

cedar olive
#

use the break point to jump to the definition of O

warped nacelle
#

Got it, thanks.

solemn scroll
#

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

dull magnet
#

you need tsx dogsmirkreverse

solemn scroll
#

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

solemn scroll
#

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

hushed loom
#

otherwise they are raw normal html elements

solemn scroll
#

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

solemn scroll
#

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?

cedar olive
#

settings.def

solemn scroll
#

also

tropic ice
#

some of the Zz's look a little weird, but very cool

solemn scroll
solemn scroll
cedar olive
#

huh?

solemn scroll
#

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

hushed loom
#

@solemn scroll use cammelCase for the settings instead of snake_case

solemn scroll
#

anyway

#

whoops clicked enter too fast

tropic ice
solemn scroll
#

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 😭

solemn scroll
tropic ice
#

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

solemn scroll
#

ohh gotcha