#🧩-plugin-development

1 messages · Page 46 of 1

trim cedar
#

just make sure you don't assume too much and look out for potential errors as always

#

always handle errors and don't assume there will be none

pure temple
#

memory safety is the thing you need to worry about vs other languages ig

trim cedar
#

and try to not allocate stuff your own (malloc) and refrain from using fixed size buffers unless you are absolutely 100% sure you really control the size

pure temple
#

i tried java a bit again after reddit gave me paranoia, but it was spaghetti

trim cedar
#

also, use static analyzer tools when possible (cppcheck although I'm not a fan of that, definetly use clang-tidy)

trim cedar
#

They apparently took "only the good parts of c++"

#

my ass

#

they took the worst and made them worse

#

but I guess I'm kinda biased in that regard lmao

pure temple
#

my favourite feature is new-and-forget and compile-without-needing-to-make-yourself-a-drink-because-it-takes-so-long

trim cedar
#

apart from what you should to do to keep things safe

#

the chances that someone will figure out a use-after-free or buffer-overflow in your discord bot and then gather engough information to make your bot do crazy shit is pretty slim

#

keep good logs and always report crashes so in case that it is possible you will know before they figure it out

pure temple
#

something i think everyone should do with discord bots is disable all mentions in the library and explicitly enable them as needed

trim cedar
#

maybe also let someone else do code review so that there've been multiple eyes that signed it off

pure temple
trim cedar
pure temple
#

i guess a common way to do that is if you don't know much about the libraries you are using, and it turns out the string you pass happens to have full JS scripting support...

#

(lol i swear minecraft had a vulnerability where translation strings could run code)

trim cedar
#

lmfao

#

no way

pure temple
#

i don't think it was js...

#

i think it was a tinyfd thing...

#

maybe it only affected fabric because they patched it 🤷‍♀️

trim cedar
#

at the end of the day

#

if someone wants to break your shit really bad

#

they probably will

#

make sure you got good security measures and a fuck up plan

pure temple
#

is it that hard to make totally 100% secure code...oh

trim cedar
#

yes because in the end it's not even your code that is somehow exploitable but another library or maybe even the OS lmao

pure temple
#

lol often i hear about things which i'm sure i wouldn't be stupid enough to do... i'm guessing the code was written at 3 am

trim cedar
#

maybe that but there's also lots of people that work on stuff they have no idea about

pure temple
#

(see the bot vulnerabilities found by xyzeva)

#

uhh i wonder how a web dashboard could be implemented

#

this is where c++ doesn't feel like the obvious choice lmao

trim cedar
pure temple
#

and oh god i love databases /s

pure temple
# trim cedar simple rest server

with web development you can either choose a super bloated framework which does everything, or create a really bad site which looks like a router configuration page...

trim cedar
#

write the dashboard in react, vue or whatever

#

and let it talk to the bot through a rest api

pure temple
#

actually, it's probably not hard to create something which looks nice without a framework xd

#

you'd need to write css in either case afaik

trim cedar
#

yeah but react / vue whatever mostly cares about the reactiveness

#

not the looks

#

looks would be component framework then

pure temple
trim cedar
#

that wouldn't be good

pure temple
#

trolley I'm so lazy

trim cedar
#

(imo)

pure temple
#

I know i'm creating my own dsl... but i'm still lazy

oblique lark
#

i think my least favourite part of intellij is that ctrl-clicking for the source of a method from an interface sends you to the interface instead of the implementation from the variable you're using

grizzled narwhal
#

but like

#

so u get dm notifs in app too

#

mainly like the toast tho

cedar marsh
#

Relationship notifications may have that

grizzled narwhal
#

will have a loko 🔥

#

look*

pure temple
grizzled narwhal
#

i didnt rly mean it like that 😭

#

its kinda like

#

how mobile has in app notifs

#

but in a more desktop way

oblique lark
#

desktop can use your native notifs i think

#

im on windows and it looks kinda shit so i turned those off

grizzled narwhal
#

yea they look goofy asf

green vessel
#

if i can ask for regex assistance here:
i have this thing: Mock the Week (2012) - s11e0${start=1} - Season 11, Episode ${start=1}
but specifically at s11e0${start=1} i would like it so that when the counter is =>10 it removes the 0 before it
any insight?

#

e.g. here it starts doing this

floral plaza
#

/(?<=s11e)0(?=\d\d)/

#

should do it

green vessel
#

maybe this isn't really regex, its whatever "language" the replace field uses in powertoys powerrename

#

cheers, i'll see what it does

#

i cant figure it out

#

wait i see what you mean now, i need to bulk rename the files first then bulk rename them with that regex string to catch out the 0s i want to remove

robust hedge
#

can someone tell me what to run onload if vencord's a <script> tag?

jagged briar
#

what are you on about

frigid bay
#

lol

robust hedge
#

for example

jagged briar
#

nop

robust hedge
#

but it has to be injected before load

#

but I can't do that

jagged briar
#

its injected before discord is ran

robust hedge
jagged briar
#

no

robust hedge
dull magnet
robust hedge
#

I can only run code onLoad

jagged briar
#

also show code

whole jungle
#

custom plugin: How do i make it build for node ;-;, i need to use a node builtin

#

actually yk what, im just going to do this indirectly

flint bronze
#

afaik

whole jungle
#

nope\

floral plaza
#

Just have a native.ts file in your plugin folder

whole jungle
#

its not finding my native functions ;-;

#

TypeError: Cannot read properties of undefined (reading 'setupBot')
at Object.start (index.ts:76:16)
at index.ts:131:15
at index.ts:97:13
at pL (Vencord.ts:84:5)

(Bot for a diffrent platform btw)

pliant pasture
#

Need help asap, my code is on life support and is suicidal

gusty maple
grim hare
#

@onyx remnant you can ask your questions about plugin development here

#

I'm going to sleep pretty soon so I wouldn't be able to answer right away but others read through this channel too ofc

#

regarding your issues with fetch, seeing a bit of the plugin code you're using would be beneficial in helping debug

onyx remnant
# grim hare <@125756499094929409> you can ask your questions about plugin development here

Thanks, I'll restate the issue here.

I'm using typst-vencord as a base to connect to my own typst rendering API via a local python Flask server. I figured it'd be a pretty quick patch job, but when I execute the /math cmd the request doesn't make it to the server despite a fetch() on localhost in my Vencord dev console working as expected.

An Error occurred while executing command "math":
TypeError: Failed to fetch
    at Object.execute (VencordRenderer:215:31556)
    at Object.XI (VencordRenderer:20:54)
    at j (WebpackModule916565:2:5825)
    at async handleSendMessage (WebpackModule176347:2:7058)
spare sky
#

Hi
I need help
How can I put my button there? To the left of the mute button
I already have a button with my plugin but I can't put it where I want ; -- ;

green vessel
#
(^_^) -hello guys
balmy sky
#

:3

steady knot
spare sky
#

Ty

green vessel
balmy sky
#

It's probably painfully obvious but i've been looking for a solid 15 minutes and i don't have a clue. Does anyone know the segment of the code that checks if do not disturb is enabled before sending a notification?

frigid bay
turbid spruce
#

if i make a request like this, how can i send the image using sendBotMessage() in an embed, ive got everything except this part down, all i think i know is that i need to use the response.blob() part of the response (i am a pesky python dev please be patient with me 🙏 ) ```tsx
const response = await fetch(
"https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2-1",
{
headers: { Authorization: settings.store.hfToken },
method: "POST",
body: JSON.stringify({"inputs": prompt}),
}
)

proud parrotBOT
jagged briar
#

actually im not sure for blobs

#

i dont think attachments will work with that so i have no clue lol

turbid spruce
#

i guess ill have to find another solution then

jagged briar
#

you might be able to put it in a data url

#

and then send it through attachments

#

that's all i could come up with tbh

turbid spruce
jagged briar
jagged kestrel
#

#🇱🇺-deutsch-german

gentle marten
#

Is there a recommended way to get a plugin to communicate with a (.net) program running on the computer? My understanding is that I won't be able to start a websocket/http server in a plugin, can start clients and could use IPC to connect (though I've never used IPC before)

jagged briar
#

what .net program are you running

minor jolt
#

just run the server in the .net app ?

jagged briar
#

also that

flint bronze
#

semi related but is there an established standard within vencord for node native modules or calling external binaries or whatever?
i want to build a plugin to expose discord apis over dbus

floral plaza
#

.

flint bronze
#

I know native.ts exists

#

Can I just import regular node modules into there?

floral plaza
#

you should be able to (never tried)

flint bronze
#

where will the black hole get stored in the packaged vencord

#

black hole being the node_modules folder

jagged briar
#

why do you need a node module in your plugin

flint bronze
#

well, how can I get an interface to the dbus session bus from native.ts

jagged briar
#

yeah ig you need a node module for that, although if you plan on pring this it prob wont get accepted cause of it

flint bronze
#

hm

#

is dbus even the right thing to implement

#

does arRPC implement the websocket Origin check

#

lmao

dull magnet
#

you cannot do dbus

flint bronze
dull magnet
#

you can just run a websocket server or named pipe

#

but really you should build on top of arrpc

flint bronze
#

okay.

#

to clarify what i want to build; a plasmoid that shows the current voice channel status

looking in the arrpc issues tracker also shows that it basically supports nothing that I need to build upon that
The websockets module in QML from my memory does NOT support the Origin header for the websocket, so I can't interface with standard Discord's RPC either (unless I implement a fix there, which I doubt is possible because it's probably in a native module)

#

so

#

what do I do

#

i'm committing a crime against my sanity again (scp my projects/vencord folder to my laptop)

#

i think the best option is probably a local socket in the runtime folder

flint bronze
flint bronze
#

there are a lot of flux events

pure temple
#

why not do the same thing as discover-overlay

#

it won't work with vesktop unfortunately 🤷‍♀️

pure temple
flint bronze
#

Let me guess, 3rd party overlay that integrates with the discord RPC server?

flint bronze
#

@dull magnet so sorry for your prior insanity

flint bronze
#

i have learned how to log flux events and holy shit it is overwhelming

trim cedar
flint bronze
#

Yes they do

#

I'd rather not have to play around with that

#

Also iirc discord RPC muting is different to regular in client muting and it can't do deafening anyways

flint bronze
trim cedar
#

This is totally not biased :P

gentle marten
# jagged briar but this sounds like https://xyproblem.info

yeah realised the question was super undescriptive, sorry. I want to create a PowerToys Run plugin that implements the quick switcher from discord. My original idea was to have an http server listening from Vencord on some port, and PowerToys would then send a request with the search query and get a response.

#

As far as I understand I have 2 real options, websocket server in the c# plugin or IPC. Doesn't really seem like there's much documentation around IPC with this usecase, so I'm leaning towards the websocket server but I don't like the idea of putting the server in the c# plugin as it's really supposed to be the one "requesting data"

gentle marten
trim cedar
#

Local Sockets is a form of IPC

#

What IPC were you thinking of? Shared Memory?

gentle marten
#

Just to preface I have never looked at IPC before, but I was thinking something like that yeah, though the feasibility of it seems unrealistic.

trim cedar
#

Well shared memory is nothing complicated

#

But the most robust solution would probably be sockets - Shared Memory (along with the required Synchronisation) leaves more room for mistakes and usually the system is less helpful in case of crashes or similar than it would be with sockets

#

Also I have no idea how well electron supports shared memory

gentle marten
trim cedar
#

The OS usually supports that (an it's the case for windows and Linux)

gentle marten
#

But seems like I'll have to look into running a ws server and bundling asp.net core or something with the c# plugin

trim cedar
#

The OS Apis for it are pretty easy as well

trim cedar
#

Why asp???

gentle marten
#

cause i dont know what im doing and thats the only thing i know 😭

trim cedar
#

Just use basic sockets

#

It's nothing complicated you don't need a web framework xD

gentle marten
trim cedar
gentle marten
#

alright, thanks for all the advice ❤️

trim cedar
#

np ^^

austere mauve
#

for a vencord plugin you'll probably only be able to use websockets though

#

unless you do native stuff

gentle marten
#

are there like, docs for plugin development? I've seen the plugins.md, but it doesn't explain much. Last time I made plugins I feel like there was a way to get it to hot reload, but I can't seem to get it to work now

viral roost
#

there never was a way to hot reload

gentle marten
#

alzheimers

#

so I just reload discord for every change?

viral roost
#

you can ctrl+r no need for a full restart

gentle marten
#

and as long as I build --watch it'll just work

viral roost
#

yes

gentle marten
#

awesome, thanks

gusty maple
hoary sierra
#

Only the shiggy is powerful enough to grant such a thing

dry patio
#

still waiting on keywordnotify....

#

this is so sad

#

"it takes time!" it has been almost three months

#

do i have to sacrifice something??

#

a child?

vapid otter
vapid otter
dry patio
#

i’m talking about the time it takes for merge

#

into main repo

#

it’s such a useful plugin idk why it’s not in yet

jagged briar
#

I’ve been waiting on 3 different PRs for a very long time now

#

Once a pr gets buried it probably won’t get merged for a while

cedar marsh
gentle marten
#

can I send events from native.ts to index.ts? Trying to pass around callback functions results in "object could not be cloned" since they're not serializable.

(I'm still trying to set up a small http server in the vencord plugin)

dull magnet
#

but i think ill look into adding a proper api for this

dry patio
#

when will

#

keyword

#

💔

#

how much money do u want

#

$25

gentle marten
#

oh well, I have alternatives

dull magnet
#

you can't do that very well via ipc

#

but i don't understand anyway

#

you can only send serialisable data via http

#

so you shouldn't have any issues

gentle marten
#

oh you're completely right

dry patio
#

veinticinco dolores para KeywordNotify en el Vencord por favor amigo

dull magnet
#

describe your exact use case better and i can give better advice

gentle marten
#

what I want is program A sends a string to my http server, http server forwards string to renderer, renderer gets returns array all the way back to app A

dull magnet
#

very simple

gentle marten
#

the string is a query and the renderer will simulate quick switcher

#

only thing i cant figure out is how to get the renderer process to listen for events created in native

dull magnet
#
// index.ts
definePlugin({
    handleRequest(value: string) { return [] }
})

// native.ts

server.handle(async (req, res) => {
    const value = req.body.string();
    const result = await mainWindow.webContents.executeJavascript(`Vencord.Plugins.plugins.YourPlugin.handleRequest(${JSON.stringify(value)})`);
    res.send(value);
})```
dry patio
#

is there an api to get a pr reviewed

gentle marten
dull magnet
#

there isn't i think

proud parrotBOT
dull magnet
#

you'll want to edit this file to export a global variable that this is stored in

gentle marten
#

Okay, I'll give that a shot. Thanks

jagged briar
#

no

dry patio
#

can we make a plugin that merges my pr

jagged briar
#

the point of vencord is all of the plugins are built in

#

third party plugins are totally unsupported

#

yes but then vencord is just turning into bd and thats exactly what we want to avoid

#

the reason all the plugins are built in is so they get fixed really quick

#

if we let users import plugins that easily then it's just gonna turn into bd

gentle marten
dull magnet
#

don't do that

jagged briar
#

well your "idea" is just turning vencord into bd

dull magnet
#

vencord will never have functionality to add external plugins

#

it is not modular, by design

#

you can add plugins by compiling them in

#

it's really not that hard

#

not being modular has a lot of benefits

#

being modular has very little benefits while eliminating all these benefits

gentle marten
#

lol

dry patio
gentle marten
#

you can create and distribute plugins yourself, but it's just not supported by vencord

dry patio
#

such as

gentle marten
#

if they're that good they'll probably be merged

dry patio
#

[]

gentle marten
dry patio
#

the review system is really inefficient

jagged briar
#

the system works like this

  1. plugin is made by someone
  2. they make a pr
  3. wait for pr to get merged
  4. done
jagged briar
jagged briar
dry patio
#

longer than a month is insane imo

#

2 months is absurd

jagged briar
#

i have one going for like 3

#

do you see me complaining

dry patio
#

should be imo

#

i’d complain for u

#

devs supporting devs

jagged briar
#

anyway we dont need a poll system for plugins to get added

#

that's just stupid

#

it kinda is?

dry patio
#

the current system has u waiting 3 months

#

u are a victim too

#

u just don’t recognize

frigid bay
#

victim of what? do u lose money from not having ur pull requests merged? wtf are u talking about

jagged briar
#

its annoying

wet valve
#

victim is funny lmao

jagged briar
#

many different people make many different plugins

#

no

#

whoever wants to make a plugin can make a plugin

dry patio
jagged briar
#

there is no real "dev team" for plugins

dry patio
#

what are my options here

jagged briar
dry patio
#

it will be forgotten

jagged briar
#

all plugins go through the owner, ven

#

if the plugin is good it will get accepted

#

if not then it wont

stiff cargo
#

Bribe vee

dry patio
jagged briar
dry patio
#

i’m willing to throw $25

#

exactly

frigid bay
#

why are u acting like u will get murdered on the spot for not having ur pr merged in time LMFAO ur not getting paid for any of this stop being childish

dry patio
jagged briar
#

i dont know why you want to turn vencord into bd still

dry patio
#

i’d even throw $50 at ven

#

$100 for right now today but i doubt that’s happening regardless

frigid bay
#

dude

frigid bay
#

im not gonna lie this is kinda pathetic sorry

jagged briar
#

the world is not going to end if your pr isnt gonna get merged

dry patio
#

i have money to throw around

#

idc

jagged briar
#

you dont need money holy crap

dry patio
#

i’m not asking for money i’m offering to give money

jagged briar
#

#1032200195582197831 are for plugins that won't get built in for various reasons or if the author decides not to merge it in

frigid bay
#

why is it so important to have ur pr merged, u dont get anything from it, u wont even get exposure lol, this is just weird

#

if u do want to spend money that bad tho i will be ur friend for 100

dull magnet
#

i look at prs when i have the time and motivation to do so, at my own pace

there are more than 100 prs and even more if you counter in the other repos, and ofc all of them think their idea is very useful and should be merged asap

it really doesn't matter how useful you think your feature is

i wish i could merge everything right away but there's a lot more to it than just merging

dry patio
#

u can scrub my name from it idc it’s not for exposure

#

i think it’s something everyone should have default access to

#

i am a woman of the people

jagged briar
#

yeah well it isnt

jagged briar
frigid bay
#

true! the owner should be a robot checking PRs 24/7

jagged briar
#

why

#

that is so not worth it

dry patio
#

ok

#

it’s not ur money

#

lol

jagged briar
#

literally just wait

#

omg

dry patio
#

half a days worth of money is tossable for an instant merge

jagged briar
#

the more you complain the longer it's gonna take for your pr to get merged

#

i will tell you that

dry patio
jagged briar
#

no

jagged briar
#

like a normal person

frigid bay
jagged briar
#

instead of complaining

frigid bay
#

why lol

dry patio
jagged briar
#

yes

#

like a normal person

dull magnet
#

this is really not productive please just drop it

dry patio
#

accepting that ur plugins will just be lost to time

#

that’s so sad

#

u know

#

george washington didn’t just ignore the taxes

frigid bay
#

are u trolling

gentle marten
#

what

dull magnet
#

if you can't deal with your contribution not being merged timely or possibly even never being merged, you shouldn't contribute to open source

frigid bay
#

bc its not necessary

dry patio
jagged briar
#

this is a descent into insanity

frigid bay
dry patio
#

gandhi didn’t just ignore the oppression in india

dry patio
#

so

frigid bay
#

ok lol

#

good for u

dry patio
#

i’m trying to remember whoever did the women’s rights to vote marches but i’m blanking on the name

frigid bay
#

u treat contributing to open source projects like its something ppl only do attention

#

its to contribute to a project, not to brag about adding a few lines of code

jagged briar
frigid bay
#

if i try contributing something and it doesnt go through who gives a fuck?

dull magnet
#

🤫

#

just drop it

frigid bay
#

right

pliant pasture
#

Just spam bump

#

and fixed

dull magnet
#

fastest way to get blocked

dry patio
#

what’s the slowest way

dry patio
#

she was kinda racist tho so i don’t wanna compare myself

slow bobcat
#

hey is there a way to add the copy text option to the quick actions (the actions that pop up when u hover a massage)?

trim cedar
#

ViewRaw has it

#

might wanna look at how it's done there

frigid bay
#

also easymention or whatever it was called

slow bobcat
#

is there a way to do it with css ?

dull magnet
#

viewraw has exactly what you want

slow bobcat
#

oh i see

frigid bay
lunar pecan
#

guys

#

anyone knows why the debug menu appers when I try to run a c/cpp program in wsl?

#

I mean it runs but it's like I'm debugging

frigid bay
#

"the" debug menu

#

doesn't say anything

#

at least post a screenshot of it

viral roost
#

they did

frigid bay
#

oh, thats the menu?

#

oh ok i see it

#

i expected it to be more than 7 small lol

lunar pecan
#

it's because of something called gbd?

frigid bay
#

gdb is a debugger on linux yes

dull magnet
#

you have your launch configuration wrongly configured

lunar pecan
lunar pecan
#

this is the launch file

dull magnet
lunar pecan
#

but this is in wsl

#

it is the same?

#

there is no option for g++.exe

#

but if I do whereis g++ it shows me that it's in the bin

dull magnet
#

youre using .c

#

so you need gcc not g++

lunar pecan
#

yes but everytime i run the code

#

it creates the last terminal

#

and the menu appears

#

it's not like I'm debugging

#

it's only showing the menu

#

but the program runs normally

dry patio
#

how does the packaging of vencord work

#

like

#

how are plugins packaged

#

how is it made so un-modularly

gentle marten
#

how the hell do y'all find the parts of the discord code you want to patch

#

I've been looking for like 2 or 3 hours now

dull magnet
#

react devtools

gentle marten
#

keep stepping through code a million times hoping to find where a variable changed. this is just me finding something else to do for a few minutes

dull magnet
dry patio
#

what happens if the file is unbundled

dull magnet
#

then you cant load it

#

how do you expect to load other files

#

i already wrote an external plugin loader ages ago but i decided against that idea

dry patio
#

what format is it

austere mauve
#

javascript

green vessel
#

Just wondering, is it possible to edit pre existing vencord plugins locally

#

or are all the plugins stored on a server and as such cannot be edited

livid egret
dull magnet
#

see docs folder on github

green vessel
#

oh interesting so will that only change the mod in question for me? or for everyone

dull magnet
#

u

green vessel
#

perfect that's exactly what I want

#

I'll take a look at the guithub

teal storm
#

how would i find what functions a given store has?
e.g in the betterFolders plugin, it calls SortedGuildStore.getGuildFolders() but i cant seem to find anything using either the react dev tools or the dev console

#

I'm specifically looking for a way to get the server profiles I used,
I'm assuming thats either GuildIdentitySettingsStore or UserProfileStore

dusky cipher
#

I don't know how possible this is, but I came up with the idea of a plugin for vencord that basically changes the behaviour of voice channels

Explanation: Discord has two outputs, one purely for voice channels and one for sounds in the discord app, I want to make a plugin that splits the audio stream between every user in a VC, for example, if I have 3 guys in VC, I have an audio output for one, an audio output for another, and an audio output for the last person in VC too, what i mean by "split audio stream" is that in the system's sound & mixer settings, it adds one output for every user in VC, the screenshot below would be an example of two users in VC.

#

Why: Because i want to work on a seperate project, but first i need to figure out how to split audio streams between users

#

Does anyone know if this is possible at all? if so, some guidance may be helpful

flint bronze
dull magnet
#

on web / vesktop maybe

#

on desktop no

flint bronze
dull magnet
#

it's handled by their native module so you'd need to write C/rust/whatever code that hooks into it

dusky cipher
#

i know rust but the issue is i wouldnt even know where to begin 🤣

#

ah well

flint bronze
#

oh also i know this sounds dumb but what is the first argument of a native exported function

flint bronze
#

lame

#

is there any way to send stuff back or is it recommended to just execute javascript in the window

#

gonna be honest here and admit i haven't touched electron apis properly for at least 3-4 years

flint bronze
#

Does anyone know what the second argument to User.getAvatarURL is for?

#

huh

#

seems like a size

plush topaz
#

is there a way i can hook theme changing (light -> dark or vice versa)

steady knot
#

what do you want to achieve specifically?

plush topaz
#

if discord theme is changed to light change the clienttheme color

flint bronze
#

might find something in
flux event USER_SETTINGS_PROTO_UPDATE
class list of html
content of head style[data-client-themes="true"]

steady knot
#

you could also just do it all in css

#

html element has class .theme-dark

flint bronze
#

yes

steady knot
#

and the clienttheme color is stored in variables in :root

flint bronze
#

this is about the clientthemes plugin right

plush topaz
#

yes

flint bronze
#

just use css selector of the html element class and !important override the variable

flint bronze
#

what the fuck is wrong with nodejs devs

#

getConnections method
look inside
doesnt actually return connections

#

What the fuck

gentle marten
#

going insane with these devtools, is there a way to find out where a component got its props from? I've been chasing the source of e.pendingProps for what feel like forever trying to figure out where the Quick Switcher source code is

pliant pasture
flint bronze
frigid bay
#

true it is misleading

dull magnet
#

what?

#

it literally takes a callback

#
getConnections((err, amount) => console.log(amount, "connections"))
trim cedar
#

he want's to get the actual connections I think

#

not the amount of cons

dull magnet
#

seems like massive xy problem anyway

#

why would u neee to query the connections

#

keep track of them urself :p

trim cedar
flint bronze
#

I have kept track of them myself

trim cedar
#

What's so bad about it?

flint bronze
#

Absolutely nothing

#

I was just expecting something that didn't exist

#

Now: back to researching the list of possible flux events that occur from being in a voice channel

flint bronze
#

How can I subscribe to plugin settings being changed?

trail talon
#

does anyone know if its is at all possible where lets say you implement a repository link then click a button where it clones the repo from that link and places it into a userplugins folder then restarts

#

because so far from what ive been looking at I cant figure out a way on how i could do that

stuck herald
#

I found how to reproduce the nemo -> chromium dnd issue

#
            if (mime == "text/plain") {
                let _ = write!(f, "/home/merlijn/Downloads/Ab.pdf\r\n");
                // write!(f, "5").unwrap();
            } else if (mime == "text/uri-list") {
                let _ = write!(f, "file:////home/merlijn/Downloads/Ab.pdf\r\n");
            } else if (mime == "text/plain;charset=utf-8"){
                let _ = write!(f, "file:///");
                // write!(f, "Dropped via sctk").unwrap();
            }```
#

If I dare to write a file:/// in a text/plain mime type transfer it just doesnt accept the file lol

gentle marten
#

2 days of scouring source code for this

stuck herald
dull magnet
#

/s

stuck herald
#

I'm sure many people will be happy if this is fixed xd

#

well me being happy about it is good enough ig

stuck herald
#

nautilus is also slow on big folders

#

next on the list is swaybar's awful appindicator thing

#

idk how this is possible to spawn a window lol

#

but I'm fine with the ozone flag being a default, the issues I was experiencing are not vesktop related lol

stuck herald
#

maybe I just switch to waybar

gentle marten
jagged briar
#

that's actually really cool

thin elm
#

my favorite code is when the coder guy was like i will function today

#

i will object today

flint bronze
flint bronze
frigid bay
#

coding

#

im so coding right now

flint bronze
#

my ass is NOT coding

frigid bay
#

my buttocks are creating cpp and hpp files and writing silly things in them

#

at 6:30 am

balmy sky
#

Is there a way i can see all of the svgs in discord? i'm trying to find a suitable icon that already exists for a plugin button nvm found it :P

copper snow
#

I wonder can you make a plugin just for your self to use?

floral plaza
#

yes

#

make one and just don't share it

copper snow
#

how cloud you use it?

#

I cant find a pulgins folder in my pc

junior cove
copper snow
#

I made it

#

yey just a calculator 2

#

{1+1} -> 2

glass oracle
stuck herald
#

or when I do i cry

#

hopefully that's enough info

glass oracle
#

understandable

stuck herald
#

😭

glass oracle
#

although you should probably handle the i/o errors (write! result) gracefully rather than just ignoring them

stuck herald
glass oracle
#

fair enough

neat cargo
#

the main value I want is

data.d.properties = {
              browser: "Discord iOS",
              os: "iOS",
            };
dull magnet
#

don't do that

#

you might get your account banned

onyx remnant
#

Gonna re-ask something I haven't solved yet:

I'm using typst-vencord as a base to connect to my own typst rendering API via a local python Flask server. I figured it'd be a pretty quick patch job, but when I execute the /math cmd the request doesn't make it to the server despite a fetch() on localhost in my Vencord dev console working as expected.

An Error occurred while executing command "math":
TypeError: Failed to fetch
    at Object.execute (VencordRenderer:215:31556)
    at Object.XI (VencordRenderer:20:54)
    at j (WebpackModule916565:2:5825)
    at async handleSendMessage (WebpackModule176347:2:7058)
neat cargo
dull magnet
dull magnet
neat cargo
#
if (code.includes("data.d.properties")) {
            code = code.replace(/data\.d\.properties = \{[\s\S]*?\};/, `data.d.properties = { browser: "Discord iOS", os: "iOS" };`);
        }```
#

like this? @dull magnet

dull magnet
#

what

neat cargo
#

what

dull magnet
#

no

onyx remnant
# dull magnet make sure you set up CORS on your server

Setting up CORS was what made it so I could get requests from the dev console.

from flask import Flask, request, Response
from flask_cors import CORS

app = Flask(__name__)
CORS(app, origins=['*'])

That's all the config I did; not sure if I'm missing anything.

dull magnet
#

there's a different error in the console alongside yours

#

check all errors

onyx remnant
dull magnet
dusty cape
#

Is it possible to upload and create your own plugins?

#

only for myself

gentle marten
dull magnet
#

horror

#

why not just use discord quick switcher lmao

gentle marten
#

cause discord fucking SUCKS

#

it's so slow

#

and i dont like having to switch to discord just to open up the quick switcher and choose a channel

hoary sierra
gusty maple
hoary sierra
#

Horror yes. Interesting also yes

pure temple
dull magnet
#

why is go so bad

#
func WinOnly() {
  if runtime.GOOS != "windows" {
    return
  }

  windows.Thing() // compile error on linux: 'undefined: windows'
#

FUCK YOU GO

#

why cant you not be stupid

oblique lark
#

why not just invert the if

dull magnet
#

same issue

#

go is stupid

#

you need to make a separate source file thats only windows and has the func with impl

#

then make another file for non windows where you make the func a noop

#

its so terrible

flint bronze
#

is there any proper way to call exported functions in renderer space from native space
essentially the opposite of what already exists

dusty cove
#

You can use electrons ipcRenderer

#

And context bridge

#

I do it in a way where i create my functions in separate files

#

And import them into the main fine

#

And the ipcrenderer sends the signal to the main file through the appropriated channel to call it

flint bronze
#

Got example code for that?

dusty cove
dusty cove
# flint bronze Got example code for that?

main.ts

  mainWindow = new BrowserWindow({
    show: false,
    width: 1024,
    height: 728,
    icon: getAssetPath('icon.png'),
    webPreferences: {
      preload: app.isPackaged
        ? path.join(__dirname, 'preload.js')
        : path.join(__dirname, '../../.erb/dll/preload.js'),
    },
  });

ipcMain.on(IPC_CHANNELS.INJECT_JS, async (event, arg) => {
    console.log(arg);
    let result = await inject(arg);
    if (result) {
      event.reply(IPC_CHANNELS.INJECT_JS, {
        message: `a backup already for ${arg} exists, aborted injection`,
        result: false
      });
    } else {
      event.reply(IPC_CHANNELS.INJECT_JS, {
        message: `Injected into: ${arg}`,
        result: false
      });
    }
  });

preload.ts

// Disable no-unused-vars, broken for spread args
/* eslint no-unused-vars: off */
import { contextBridge, ipcMain, ipcRenderer, IpcRendererEvent, BrowserWindow } from 'electron';

const IPC_CHANNELS = {
  INJECT_JS: 'EvilDel:InjectJS',
  CHECK_CLIENT: 'EvilDel:CheckClients',
} as const;

export interface MainHandlers {
  onInjectJs?: (event: Electron.IpcMainEvent, ...args: any[]) => void;
  onCheckClients?: (event: Electron.IpcMainEvent, ...args: any[]) => void;
}


export function registerIpcMainHandlers(mainWindow: BrowserWindow, mainHandlers: MainHandlers) {
  ipcMain.on(IPC_CHANNELS.INJECT_JS, (event, ...args) => mainHandlers.onInjectJs!(event, ...args, mainWindow));
  ipcMain.on(IPC_CHANNELS.CHECK_CLIENT, (event, ...args) => mainHandlers.onCheckClients!(event, ...args, mainWindow));
}

const electronHandler = {
  ipcRenderer: {
    inject_js: {
      send(arg: string) {
        ipcRenderer.send(IPC_CHANNELS.INJECT_JS, arg);
      },
      on(func: (...args: any[]) => void) {
        const subscription = (_event: IpcRendererEvent, ...args: unknown[]) =>
        func(...args);
        ipcRenderer.on(IPC_CHANNELS.INJECT_JS, subscription);
      },
    },
    check_clients: {
      send() {
        ipcRenderer.send(IPC_CHANNELS.CHECK_CLIENT);
      },
      on(func: (...args: any[]) => void) {
        const subscription = (_event: IpcRendererEvent, ...args: unknown[]) =>
        func(...args);
        ipcRenderer.on(IPC_CHANNELS.CHECK_CLIENT, subscription);
      },
    },
  },
};

contextBridge.exposeInMainWorld('electron', electronHandler);

export type ElectronHandler = typeof electronHandler;```
renderer file (in my case App.tsx)
```tsx
    const handleBtnClick = (which_discord: string) => {
      console.log('clicked');
      setLocked(true);
      setMessage("injecting please wait..");
      window.electron.ipcRenderer.inject_js.send(which_discord);
    }

preload.d.ts (type definitions (only for typescript needed)

import { ElectronHandler } from '../main/preload';

declare global {
  // eslint-disable-next-line no-unused-vars
  interface Window {
    electron: ElectronHandler;
  }
}

export {};
#

be sure to declare all variables as you need them

flint bronze
#

I probably should've specified this is for a Vencord plugin btw

dusty cove
#

thought it was for a electron application

flint bronze
#

Technically it is shiddohwell

dusty cove
#

yes

flint bronze
#

In that case
How do I get the IPC stuff without relying on the first argument of the renderer to native calls

#

That just feels jank

#

Or

#

Should I just patch the existing stuff tow ork the other way around too

#

and PR that to upstream

dusty cove
#

you could also use http-sockets

flint bronze
dusty cove
#

hm

flint bronze
#

I already have a native module for socket purposes

dusty cove
#

i see

#

what are you trying to achieve first ?

flint bronze
#

call mute/deafen/disconnect users from vc on commands sent to a server made in the native code

#

which that is all in renderer code

dusty cove
#

hm i see

#

you can also use the discord api for that

#

iirc

flint bronze
dusty cove
#

to interact with the ui directly

floral plaza
#

you could try giving the renderer a setup function and pass around mute/deafen/disconnect methods

flint bronze
#

I don't care about the specifics in the renderer

#

i think I'm confusing everyone

dusty cove
#

well a little more details would be good to know kinda

#

there are multiple ways to achieve your goal i suppose

#

if i understood correctly i would just recommend dom maniuplation

flint bronze
#

I'm building a plugin that listens on a local socket that accepts commands to control the voice channel (and vice versa)

dusty cove
#

ahhhhh

#

now i get it

flint bronze
#

Vice versa already is sorted

#

I need to send the commands from the socket listeners to the Renderer space somehow

#

That is my issue

#

Afaik this has not been done anywhere

#

The remote function calls only exist from renderer to native

floral plaza
#
// native.ts
let mute: () => {}
let deafen: () => {}

export const setup = (_mute, _deafen) => {
  mute = _mute;
  deafen = _deafen;
}
// index.ts

const Native = VencordNative.pluginHelpers.whatever

const mute, deafen = ...

Native.setup(mute, deafen)
dusty cove
flint bronze
dusty cove
flint bronze
#

as I said, RPC is not an option

#

mostly because vesktop

#

and also because it doesnt implement half the stuff I need anyway shiddohwell

floral plaza
#

then just call them from the preload process

floral plaza
#

it's something you could try

#

iirc contextBridge can pass functions

flint bronze
#

I already call from the renderer to native on plugin start anyway

#

This could probably work

floral plaza
#

check, vc also uses some ipc calls so not sure if it can serialize function args

flint bronze
#

I know it does

flint bronze
floral plaza
#

Yeah that’s the ipc

flint bronze
#

yeah it is

#

well

#

guess i better go do the thing the not hacky way

gentle marten
flint bronze
#

Thats the powertoys run plugin right?

gentle marten
#

Yeah

flint bronze
#

So, how are you doing it

gentle marten
gentle marten
#

Call function in native from renderer:

// index.ts
const Native = VencordNative.pluginHelpers.YOURPLUGINNAME as PluginNative<typeof import("./native")>;

const results = await Native.myFunc(args);
// native.ts
export async function myFunc(_: Electron.IpcMainInvokeEvent, args) { /* stuff */ }

Call function in renderer from native:

// index.ts
export default definePlugin({
    myFunc: (arg) => { /* stuff */ }
});
// native.ts - this is where it gets a bit scuffed
import { app } from "electron";

let window: Electron.BrowserWindow | null = null;
app.on("browser-window-created", (_, win) => {
    window = win;
});

const results = await window.webContents.executeJavaScript(`Vencord.Plugins.plugins.YOURPLUGINNAME.myFunc("${arg}")`);
flint bronze
gentle marten
#

you can only pass serializable data so no Discord Users or anything

#

promises work

flint bronze
#

i know what i am doing

#

i just need other people's jank

flint bronze
#

BTW that will probably break as soon as the user pops out anything

gentle marten
#

oh god you're right

#

you might have more luck

flint bronze
#

nah i'll just steal the webContents from the first argument I was told to ignore instead

gentle marten
gentle marten
gentle marten
#

you know that's probably more reliable

flint bronze
#

test time!!!

flint bronze
#
TypeError: Cannot read properties of undefined (reading 'getURL')
    at waitTillCanExecuteJavaScript (node:electron/js2c/browser_init:2:78873)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:79566)
    at remoteCall (VencordDesktopMain:384:3)
    at Socket.<anonymous> (VencordDesktopMain:400:7)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:335:12)
    at readableAddChunk (node:internal/streams/readable:308:9)
    at Readable.push (node:internal/streams/readable:245:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

??????????????????

#

oh i bet its something stupid like not knowing this

#

it was

#

i didn't have this bind call

#

🎉 I have made this shit work

gentle marten
#

Nice

#

If a lot of extensions begin exposing parts of the discord api it probably makes sense to create a centralized listener so each extension doesn't take up another port right

gentle marten
#

How do you expose apis then?

#

Nvm

#

This is just me not knowing how sockets work

flint bronze
restive bluff
lament pivot
#

Guys is it possible to trigger the deafen desync thing at will without spamming it

flint bronze
#

If you mean fake deafen we do not speak of nor make anything related to fake deafen

lament pivot
#

why not

flint bronze
#

read rule 9 for a reason why

lament pivot
#

alright

gentle marten
#

Always been curious why fake deafen is crossing the line but message logger isn't

#

Both should be banned imo

flint bronze
gentle marten
#

In both cases people should have the right to you not knowing whatever was said/sent

gentle marten
#

Still think message logger is creepy in the same vein though

#

Yeah, faking is worse

#

Guess you could compare it to "hacking" access to a channel where you shouldn't be able to read messages

flint bronze
#

o o o o o i am hacking discord i enable showhiddenchannels

flint bronze
#

horrible no good dumb 4:42am dumb bad question:
how do i mute/deafen the user

flint bronze
dull magnet
flint bronze
#

i have ruin my sleep schedule for vencord

dull magnet
#

in the case of message logger, you willingly post a message online, knowing that everyone will see it

in the case of fake deafen you believe the person can't hear you

#

there's a very big difference between the two

flint bronze
#

i need to explode ‼️

flint bronze
#

i should go to sleep if i cant find (or have help finding) the call to mute the user

#

has it even been done before

dull magnet
#

the current or any user

flint bronze
#

self mute

#

and deafen

dull magnet
#

use react devtools to inspect the mute and deafen buttons

#

see what their onClick is

#

and you have it

flint bronze
#

wtf why is the components tab just

#

empty

gentle marten
#

speaking of, is there a better way of getting a reference to a function than just $self.funcname = w.default.funcname

dull magnet
#

what's your use case

junior cove
#

Message loggers can be countered by following safe web practices. It's generally safe to assume someone somewhere is logging chat history somehow, even without the use of message logger plugins. We generally assume calls to be a little safer for some reason though, and are more willing to say things we'd wish others not to hear

gentle marten
#

i mean just in general, if there's a built in js function or method i wanna call. I've just been setting it like above and calling it when needed, but I was wondering if there's another method that's better

dull magnet
#

i don't really understand your question

#

seems like xyproblem

gentle marten
#

guess it's kinda a stupid question too

dull magnet
#

that's what webpack finds are for

gentle marten
#

not really a problem i have, just curious about what the convention is for patches but I could probably just look at few plugins to figure it out

dull magnet
#

findByProps("funcname")

flint bronze
dull magnet
#

why

flint bronze
#

hold on

dull magnet
#

use the react devtools element picker on the button in question

gentle marten
dull magnet
#

walk down/up the component tree until you find the button component that has an onClick or action prop

gentle marten
flint bronze
gentle marten
#

uhh

#

glhf

#

probably get the current mute status on start, then just keep track of it

flint bronze
#

wtf it is 6am for me

dull magnet
#

sleep

flint bronze
dull magnet
#

yes

#

i went to sleep at 9 in the morning tomorrow

flint bronze
pure temple
#

rewriting in python 🚀

#

(why can i not stick with a language)

#

(I literally went from Java to C++ to Python)

cedar marsh
pure temple
#

i've been over this a few times already. serenity doesn't seem particularly good in some ways...

cedar marsh
#

You will rewrite in ruby

pure temple
#

c++ is too much work

#

considering performance isn't a huge deal

#

is it actually that hard compared to python, especially considering i'm more familiar with it

cedar marsh
#

Honestly if you don't want to do a lot of work, ruby on rails takes you 99% of the way there with close to 0 effort

pure temple
#

🚀

#

python does feel like a fun language where you're unlikely to be fighting with the compiler

frigid bay
#

id like python more if its syntax was different

#

i dont like how it depends on indentation

pure temple
#

nobody else is insane enough to collaborate with me if i use c++

pure temple
#

it's still a bit weird...

#

with tabs it makes it clear imo

#

actually, long functions can be a pain to parse with your eyes

frigid bay
#

yeah i dont like it i wish there was a way to make it look like c

#

id relearn it

gusty maple
#

import braces from futures

#

then you can use them trolley

#

(would be funny if it actually worked)

#

/run

from __future__ import braces
worldly oxideBOT
#

@gusty maple I only received py(3.10.0) error output

  File "/piston/jobs/8ef96dd7-78a2-4cd6-a036-7f94226530bd/file0.code", line 1
    from __future__ import braces
    ^
SyntaxError: not a chance
frigid bay
#

i feel like theres someone thats already made a thing to convert from {} to real python syntax

#

ive heard of some project that does similar with lua but the opposite

#

makes it look like python

#

(husk)

gusty maple
#

python > lua

frigid bay
#

python is fine probably but i forgot most of it

#

i never had an issue with lua tho

#

i kinda like lua

#

feels very simple and i prefer its syntax over pythons i think

gusty maple
frigid bay
#

decorations, built in libraries, i remember nothing about classes

#

decorators*

#

i think

#

msot likely more

#

i only know basics

gusty maple
#

decorators are silly

frigid bay
#

i literally only use it as a calculator rn

gusty maple
#

lmao

frigid bay
#

whenever i need to calculate something

#

i just open the python shell

#

hex((a+b)/4) or whatever

#

and done

#

its silly but it works and its fairly convenient

gusty maple
#

true

frigid bay
#

i have a c++ class thats like this (its a bit dumb but its just temporary)```cpp
class c_var {
public:
constexpr c_var(const char* _name, size_t* _out_offset) : type{ e_type::var }, name{ _name }, out_offset{ _out_offset } {};
constexpr c_var(const char* _name, const c_var& _var) : type{ e_type::dt }, name{ _name }, var{ &_var } {};

enum class e_type {
    none, var, dt
};

e_type type;
const char* name;

union {
    size_t* out_offset;
    const c_var* var;
};

};

id like to do something like this:```cpp
constexpr c_var test = {
    "test1", {
        "test2", nullptr
    }
};
```but that results in an error because its not constexpr for some reason. i THINK i found a solution but godbolt gives mixed results so im not so sure.. i tried making a consteval func that just makes a constexpr variable out of the argument and returns it. its an ugly solution anyway.
this works but it sucks:```cpp
constexpr c_var test2 = { "test2", nullptr };
constexpr c_var test1 = { "test1", test2 };
```if anyone knows a solution if one is even possible that would be great, sry if this iss a dumb question
#

@ me if u have anything to say about it

#

ill be afk for a bit from now

#

but ill respond once im back

junior thunder
#

hey

frigid bay
#

hi

frigid bay
#

true

oblique lark
#

/run

proc doThing(a: int, b: int) =
  echo "separate args"

proc doThing(val: (int, int)) =
  echo "tuple arg"

doThing(1, 2)
doThing (1, 2)
worldly oxideBOT
#

Here is your nim(1.6.2) output @oblique lark

separate args
tuple arg
oblique lark
#

when the whitespace is mandatory SKULL_SKELETON

lyric bison
#

winded up a development install of vencord

#

clearly i'm using this in a very productive manner

shrewd yacht
#

meow

oblique lark
#

meow

frigid bay
steady knot
#

meow

trim cedar
frigid bay
#

might have to give up and make it non constexpr, it prob wont even work anyway

#

but the specific example i sent should work anyway

#

idk why it doesnt

dull magnet
#

in that one message

#

cursed

frigid bay
#

i didnt i was pointing out

#

which channel he was in

#

:p

dull magnet
#

ah

remote kestrel
#

ven detecetd

frigid bay
#

discord native modules are interesting

#

why do they hook windows api functions

livid egret
native walrus
#

thats default vscode

jagged briar
#

they meant the discord theme

frigid bay
#

lol

frigid bay
ruby fractal
#

no idea where to put this but someone should make a plugin that lets you middle click on a server to mark it as read

vital path
#

anyways, im also here to worthlessly make a plugin request

#

cause i cannot for the life of me figure out anything related to how to learn how to make these

#

well a bit just not like making new menu optiosn and whatnot

#

anyways, somebody make a hypesquad changer, and message timestamps where they show the seconds, or configurable would be nice eg; 1/24/2024 at 10:52:30, o also a port of the copier plugin from bd which allows u to basically copy everything from server banners to custom formatted user info

#

i saw u typing, dont lurk

#

if anybody would be willing to school me i will fall in love i already know js very well just nothing ab react or discord internals that much

trim cedar
#

(if with hook you mean registering ll/global events)

#

In case they actually hook functions that'd be interesting to know but couldn't be something too useful since the hooked functions will only be relevant for the process they're loaded in

frigid bay
trim cedar
#

Lol

#

Lmao why

frigid bay
#

I have no clue

#

I didn't look further into it

#

actually I think it only crashes when the argument is non zero

#

but still not sure why

frigid bay
#

if u do then @ me because I might go back to sleep and not notice ty in advance

trim cedar
# frigid bay i have a c++ class thats like this (its a bit dumb but its just temporary)```cpp...
  1. const c_var* var is dangling when initialized in your preferred way
  2. I don't think you can do this constexpr in the way you want to, because you cannot have a member with type of the same class, only pointers to it, so:
    • You'd either have to keep the pointer to another constexpr value as in your last code example
    • Come up with something else xd
    • C++23 has some magic related to constexpr unique_ptr, maybe fiddle around with that
#

Maybe it works with raw pointers somehow

#

I'll take a look

frigid bay
#

hm yeah idk, I don't need to do it that way but it's the cleanest way I could think of

trim cedar
#

Ok yeah I don't see any way how this would work without some C++23 constexpr allocation magic

#

If you wouldn't have a recursive class it would work

frigid bay
#

I'll try that later then

vital path
chrome elbow
#

it is not plugin request reopened, it's just a thread made by a random member

twin cradle
#

anyone knows what name left meta key have in glfw?

radiant parrot
#

One message removed from a suspended account.

#

One message removed from a suspended account.

dusk bronze
#

is there a way to add extension but on safari browser?

frigid bay
#

worthless

#

id rather get paid with monopoly money than server boosts

pliant pasture
#

hell even in the roblox devforums

radiant parrot
pure temple
#

help, i need to remove a jar from the classpath in an agent

#

i have until friday

dull magnet
#

horror

#

like at runtime?

#

you love reflect

#

i did smth very similar for Aliucord but other way round

#

adding dex at runtime

proud parrotBOT
# dull magnet https://github.com/Aliucord/Aliucord/blob/main/Injector/src/main/java/com/aliuco...

**Injector.kt: **Lines 162-175

@SuppressLint("DiscouragedPrivateApi") // this private api seems to be stable, thanks to facebook who use it in the facebook app
@Throws(Throwable::class)
private fun addDexToClasspath(dex: File, classLoader: ClassLoader) {
    Logger.d("Adding Aliucord to the classpath...")

    // https://android.googlesource.com/platform/libcore/+/58b4e5dbb06579bec9a8fc892012093b6f4fbe20/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java#59
    val pathListField = BaseDexClassLoader::class.java.getDeclaredField("pathList")
        .apply { isAccessible = true }
    val pathList = pathListField[classLoader]!!
    val addDexPath = pathList.javaClass.getDeclaredMethod("addDexPath", String::class.java, File::class.java)
        .apply { isAccessible = true }
    addDexPath.invoke(pathList, dex.absolutePath, null)
    Logger.d("Successfully added Aliucord to the classpath")
}
dull magnet
#

funny

pure temple
#

i guess i could just create another URLClassLoader

#

or a transformer that just provides the contents of a JarFile

#

big-brain idea. can't think of a package name? use a uuid!

pure temple
#

simple

#

oh, wouldn't work

#

I was imagining MainWrapper would then invoke clazz.name.Here.main2(args) on its own URLClassLoader

#

but that would be a duplicate definition

#

so simply rename clazz.name.Here to clazz.name.Here2

#

then replace clazz.name.Here with your own custom class which wraps clazz.name.Here2.main

#

then use asm remapping to access clazz.name.Here2 instead of clazz.name.Here everywhere in the code

steep dirge
#

What's a good way to learn website stuff like html CSS JavaScript and react. Basically zero knowledge of any of them. Only coding things I know is some python I taught myself to write badly.

floral plaza
frank pecan
#

hey i'm new to vencord coding, but how could i make a plugin so it has all free soundboards

cedar marsh
#

Impossible

#

If it was we would have made it

ashen gale
#

I think this is the best place for asking something like this. Is it possible to somehow block joining servers on a modded Discord client?

#

I tried hiding the join server button, and a few other things using custom CSS, but clicking an invite link will immediately join the server, so that failed.

pliant pasture
#

Yes? You can try to make the button return nothing. Or well better, hide it with css

steady knot
#

I think they mean clicking an invite link outside discord (or what?)

flint bronze
flint bronze
# dull magnet what's the use case

1: links in bios, rich presence buttons, a whole load of other places skip the invite modal entirely
2: just generally to stop accidentally joining some horrible scam server someone pinged everyone for in general chat for the 14th time today

tacit cedar
#

is there like a "remove bloat/annoyances" css somewhere 🐱

dull magnet
#

* { display: none; }

tacit cedar
#

love it

green vessel
#

hi, is there a way to hot reload a plugin?

#

without building it and injecting again

dull magnet
#

no

#

you need to always build

#

you dont have to inject again

green vessel
#

then how can i update the vencord in the discord client?

jagged briar
#

just build it

#

and crtl+r

green vessel
#

how do i import node modules? like fs and path?

floral plaza
#

.

green vessel
floral plaza
#

inside of native.ts you can import builtin modules and provide function that you can call from the renderer

#

so if you want to read a file just export a function that does it

green vessel
floral plaza
#

yes and try it shrug

green vessel
floral plaza
#

are you trying to directly import the native file

#

you have to use pluginHelpers

#

if not, then just try path