#🧩-plugin-development
1 messages · Page 46 of 1
memory safety is the thing you need to worry about vs other languages ig
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
not too much actually
i tried java a bit again after reddit gave me paranoia, but it was spaghetti
also, use static analyzer tools when possible (cppcheck although I'm not a fan of that, definetly use clang-tidy)
Java is pure chaos
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
my favourite feature is new-and-forget and compile-without-needing-to-make-yourself-a-drink-because-it-takes-so-long
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
something i think everyone should do with discord bots is disable all mentions in the library and explicitly enable them as needed
maybe also let someone else do code review so that there've been multiple eyes that signed it off

but now we're reaching into how do I write non exploitable code in general
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)
i don't think it was js...
i think it was a tinyfd thing...
maybe it only affected fabric because they patched it 🤷♀️
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
is it that hard to make totally 100% secure code...oh
yes because in the end it's not even your code that is somehow exploitable but another library or maybe even the OS lmao
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
maybe that but there's also lots of people that work on stuff they have no idea about
(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
simple rest server
and oh god i love databases /s
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...
write the dashboard in react, vue or whatever
and let it talk to the bot through a rest api
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
yeah but react / vue whatever mostly cares about the reactiveness
not the looks
looks would be component framework then
i wish there was a framework which literally did everything for you
that wouldn't be good
I'm so lazy
(imo)
I know i'm creating my own dsl... but i'm still lazy
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
https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/FriendNotifications
has anyone made a port for this?

but like
so u get dm notifs in app too
mainly like the toast tho
Relationship notifications may have that
does anybody want FriendStalker 😭
i didnt rly mean it like that 😭
its kinda like
how mobile has in app notifs
but in a more desktop way
desktop can use your native notifs i think
im on windows and it looks kinda shit so i turned those off
yea they look goofy asf
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
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
can someone tell me what to run onload if vencord's a <script> tag?
what are you on about
lol
so like if there is a element injected into discord.com and it's
<script src="https://raw.githubusercontent.com/Vencord/builds/main/browser.js"></script>
for example
nop
there is a way
but it has to be injected before load
but I can't do that
its injected before discord is ran
do you know how to inject html before an iframe loads
no
ok
const js = await fetch("url");
createIframe()
ok
it's in reactjs
and the way the iframe works is that first, it gets the url as a subpath, and then well, iframes it
idk if I could do that
I can only run code onLoad
what are you making
this sounds like https://xyproblem.info/
also show code
custom plugin: How do i make it build for node ;-;, i need to use a node builtin
(no idea if i should do it #🏥-vencord-support-🏥 because its programing)
actually yk what, im just going to do this indirectly
you need a native script and to rename your plugin dir to pluginName.desktop
afaik
nope\
Just have a native.ts file in your plugin folder
See how openinapp does it https://github.com/Vendicated/Vencord/blob/main/src/plugins/openInApp/native.ts
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)
Need help asap, my code is on life support and is suicidal
That line number is scary
@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
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)
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 ; -- ;
(^_^) -hello guys
This has already been done in multiple plugins, read their source code
:3
this is one example of such plugin https://github.com/Vendicated/Vencord/blob/main/src/plugins/gameActivityToggle/index.tsx
Ty
hello
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?
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}),
}
)
**index.ts: **Lines 21-23
interface Message {
guild_id: string,
attachments: MessageAttachment[],
actually im not sure for blobs
i dont think attachments will work with that so i have no clue lol
i guess ill have to find another solution then
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
how does one do this... ?
try this https://stackoverflow.com/questions/23150333/html5-javascript-dataurl-to-blob-blob-to-dataurl
#🇱🇺-deutsch-german
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)
what .net program are you running
just run the server in the .net app ?
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
.
you should be able to (never tried)
where will the black hole get stored in the packaged vencord
black hole being the node_modules folder
why do you need a node module in your plugin
well, how can I get an interface to the dbus session bus from native.ts
yeah ig you need a node module for that, although if you plan on pring this it prob wont get accepted cause of it

hm
is dbus even the right thing to implement
does arRPC implement the websocket Origin check
lmao
even worse than i thought https://github.com/OpenAsar/arrpc/issues/66
you cannot do dbus

you can just run a websocket server or named pipe
but really you should build on top of arrpc
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
It's been going for 20 minutes
there are a lot of flux events
why not do the same thing as discover-overlay
it won't work with vesktop unfortunately 🤷♀️
hop off dbus 🚌
What's that
Let me guess, 3rd party overlay that integrates with the discord RPC server?
Read this for why I cant
Yup that uses the RPC server, with an origin set. Discord's RPC server does not allow connections without an Origin and the QML websockets library does not support setting an origin
@dull magnet so sorry for your prior insanity
i have learned how to log flux events and holy shit it is overwhelming
Plasmoids support C++ as well right? If so you can simply use a C++ WebSockets lIbrary and forward the data to qml
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
I see you have an opinion there
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"
👀
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.
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
Huh, I'd have thought that with all the newer protections in place for memory it would be pretty challenging to share memory between two completely unrelated processes
The OS usually supports that (an it's the case for windows and Linux)
But seems like I'll have to look into running a ws server and bundling asp.net core or something with the c# plugin
The OS Apis for it are pretty easy as well
ASP seems way too over kill
Why asp???
cause i dont know what im doing and thats the only thing i know 😭
was gonna be my first choice, but I'd still look into it more of course
A TCP Socket will absolutely suffice
alright, thanks for all the advice ❤️
np ^^
for a vencord plugin you'll probably only be able to use websockets though
unless you do native stuff
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
there never was a way to hot reload
yeah
you can ctrl+r no need for a full restart
and as long as I build --watch it'll just work
yes
awesome, thanks
Easy
the ability to understand code from just reading it, without requiring documentation
Cap, this is a godly power bot granted to mortals
Only the shiggy is powerful enough to grant such a thing
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?
I mean thare is one in #1032200195582197831 message
@dry patio
that’s mine
lmao
I just saw lmao didnt even look at the name
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
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
I sacrificed @remote kestrel's soul to get client theme merged. Don't tell him though
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)
it’s such a shame
not really with the current api. if your data is json serialisable, i recommend just using executeJavascript to eval renderer code from main and embedding your json string into it
but i think ill look into adding a proper api for this
it's not... I wanted to create an http server in native and respond to requests dynamically in renderer
oh well, I have alternatives
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
oh you're completely right
veinticinco dolores para KeywordNotify en el Vencord por favor amigo
describe your exact use case better and i can give better advice
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
very simple
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
// 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);
})```
is there an api to get a pr reviewed
I tried using webContents but couldn't figure out how to get a reference to the main window
**ipcMain.ts: **Line 128
export function initIpc(mainWindow: BrowserWindow) {
you'll want to edit this file to export a global variable that this is stored in
Okay, I'll give that a shot. Thanks
no
can we make a plugin that merges my pr
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
I scuffed my way to a working solution:
// native.ts
let window: Electron.BrowserWindow | null = null;
app.on("browser-window-created", (_, win) => {
window = win;
});
see if I can't make a more intentional solution
don't do that
well your "idea" is just turning vencord into bd
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
lol
this would be a good system if good plugins were actually added in a timely manner
you can create and distribute plugins yourself, but it's just not supported by vencord
such as
if they're that good they'll probably be merged
[]
nuh uh
actually nvm still waiting for timedones
the review system is really inefficient
the system works like this
- plugin is made by someone
- they make a pr
- wait for pr to get merged
- done
and how long is the wait
or the user just puts in #1032200195582197831 and doesnt pr it
yes we know you want keyword notify
anyway we dont need a poll system for plugins to get added
that's just stupid
it kinda is?
victim of what? do u lose money from not having ur pull requests merged? wtf are u talking about
actually stop complaining
its annoying
victim is funny lmao
many different people make many different plugins
no
whoever wants to make a plugin can make a plugin
so what’s the other option, let it be forgotten?
there is no real "dev team" for plugins
what are my options here
just be patient??
it will be forgotten
all plugins go through the owner, ven
if the plugin is good it will get accepted
if not then it wont
Bribe vee
tried already
my plugins have most definitely been forgotten
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
lmao
uhh cuz i’ve waited multiple months and im a little annoyed
140 built in, there are some in #1032200195582197831
i dont know why you want to turn vencord into bd still
i’d even throw $50 at ven
$100 for right now today but i doubt that’s happening regardless
dude
chill tf out
im not gonna lie this is kinda pathetic sorry
the world is not going to end if your pr isnt gonna get merged
you dont need money holy crap
i’m not asking for money i’m offering to give money
i meant you dont need to give money to get a pr merged
#1032200195582197831 are for plugins that won't get built in for various reasons or if the author decides not to merge it in
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
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
i get the plugin in the main repo
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
yeah well it isnt
and you are willing to pay money for this to happen
true! the owner should be a robot checking PRs 24/7
half a days worth of money is tossable for an instant merge
the more you complain the longer it's gonna take for your pr to get merged
i will tell you that
and how’s that working for you?
no
i doubt anyone else cares lol u can just use ur plugin in a dev build
instead of complaining
why lol
by ignoring it?
this is really not productive please just drop it
accepting that ur plugins will just be lost to time
that’s so sad
u know
george washington didn’t just ignore the taxes
are u trolling
what
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
bc its not necessary
i like to say funny things
this is a descent into insanity
does that include the pr thing
gandhi didn’t just ignore the oppression in india
true
honestly my switch to closed source has been very great financially
so
i’m trying to remember whoever did the women’s rights to vote marches but i’m blanking on the name
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
a pr getting merged is not equivelent to women's right to vote
if i try contributing something and it doesnt go through who gives a fuck?
right
fastest way to get blocked
what’s the slowest way
i remeber! susan b anthony
she was kinda racist tho so i don’t wanna compare myself
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)?
also easymention or whatever it was called
is there a way to do it with css ?
oh i see
Cascading Style Sheets (CSS) is a style sheet language used for specifying the presentation and styling of a document written in a markup language such as HTML or XML.
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
they did
it's because of something called gbd?
gdb is a debugger on linux yes
you have your launch configuration wrongly configured
how can I set it in the right way?
I only have the task configuration file
this is the launch file
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
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
how does the packaging of vencord work
like
how are plugins packaged
how is it made so un-modularly
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
react devtools
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
everything is bundled into one single large file
what happens if the file is unbundled
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
javascript
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
Use devbuild i guess?
yes, by building from source
see docs folder on github
oh interesting so will that only change the mod in question for me? or for everyone
u
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
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
thank you for clarifying this, yes there are a lot of prs and considering the amount of them this approach is reasonable
I would like this too
not possible
discord making everything native modules strikes again
it's handled by their native module so you'd need to write C/rust/whatever code that hooks into it
oh also i know this sounds dumb but what is the first argument of a native exported function
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
Does anyone know what the second argument to User.getAvatarURL is for?
huh
seems like a size
is there a way i can hook theme changing (light -> dark or vice versa)
what do you want to achieve specifically?
if discord theme is changed to light change the clienttheme color
might find something in
flux event USER_SETTINGS_PROTO_UPDATE
class list of html
content of head style[data-client-themes="true"]
yes
and the clienttheme color is stored in variables in :root
this is about the clientthemes plugin right
yes
just use css selector of the html element class and !important override the variable
what the fuck is wrong with nodejs devs
getConnections method
look inside
doesnt actually return connections
What the fuck
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
it's only meant to tell you how many connections there are, not to give you the actual connections 
It's a bit misleading to name it that imo that's why I'm going insane over it
true it is misleading
yop
what?
it literally takes a callback
getConnections((err, amount) => console.log(amount, "connections"))
seems like massive xy problem anyway
why would u neee to query the connections
keep track of them urself :p
this
i'd rather not have to do that
I have kept track of them myself
What's so bad about it?
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
How can I subscribe to plugin settings being changed?
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
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
shrimply don't use nemo
/s
I'm sure many people will be happy if this is fixed xd
well me being happy about it is good enough ig
nautilus doesnt have many features and dolphin looks, imo, ugly
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
maybe I just switch to waybar
this is way faster than I'd have thought
that's actually really cool
my favorite code is when the coder guy was like i will function today
i will object today
if you want to clone the whole vencord repo and build it and inject it then yeah thats possible
if you do make this feature be aware it probably will Not be implemented into upstream or will be locked behind some hidden setting by design
my ass is NOT coding
my buttocks are creating cpp and hpp files and writing silly things in them
at 6:30 am
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
I wonder can you make a plugin just for your self to use?
check pins in #1032200195582197831
Yeah that’s what I thought
what is this horror rust
I dont write rust 😎
or when I do i cry
hopefully that's enough info
understandable
I wanna continue https://github.com/ToxicMushroom/tagfs tho
😭
although you should probably handle the i/o errors (write! result) gracefully rather than just ignoring them
it was just a testing program tho
fair enough
So umm, how can I get this working in vencord?
the main value I want is
data.d.properties = {
browser: "Discord iOS",
os: "iOS",
};
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)
Umm, I don't think so. I've been using it on bots and alot of alts, discord doesn't seems to even notice
make sure you set up CORS on your server
write a regex patch that replaces the browser and os in discords code
ohh
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
what
what
no
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.
Got it working. I dumbly had a stray https instead of http in my plugin e.e
yop
check pins of #1032200195582197831
great progress for powertoys quick switcher
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
Oooooo
Absolute horror
Horror yes. Interesting also yes
i doubt this will suck less 😭
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
why not just invert the if
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
is there any proper way to call exported functions in renderer space from native space
essentially the opposite of what already exists
Yes
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
Got example code for that?
Sure one moment
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
I probably should've specified this is for a Vencord plugin btw
Oh-
thought it was for a electron application
Technically it is 
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
you could also use http-sockets
no
hm
I already have a native module for socket purposes
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
RPC is not an option before you suggest that
hmm okay, well you could work with dom manipulation
to interact with the ui directly
you could try giving the renderer a setup function and pass around mute/deafen/disconnect methods
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
I'm building a plugin that listens on a local socket that accepts commands to control the voice channel (and vice versa)
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
// 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)
hm, but can you elaborate further why you need the local socket for it?
other apps to control it
okay okay,
as I said, RPC is not an option
mostly because vesktop
and also because it doesnt implement half the stuff I need anyway 
.
then just call them from the preload process
is this your actual solution
I already call from the renderer to native on plugin start anyway
This could probably work
check, vc also uses some ipc calls so not sure if it can serialize function args
I know it does
No
Yeah that’s the ipc
Yes
Extremely similar to what I'm doing, I'm using http to get/send channel info that allows you to change channel
Thats the powertoys run plugin right?
Yeah
So, how are you doing it
Turning on my PC hold on
https://cdn.discordapp.com/emojis/1155918238442606713.gif?size=48
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}")`);
// native.ts - this is where it gets a bit scuffed
at least you admit it
BTW that will probably break as soon as the user pops out anything
oh god you're right
was told to expose it directly from ipcMain but I gave up on that pretty fast
#🧩-plugin-development message
you might have more luck
nah i'll just steal the webContents from the first argument I was told to ignore instead
Fuck this
You saw nothing 

not like this is any better lol
you know that's probably more reliable
I really didn't want to have to do this btw
]
test time!!!
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
read my bullshit https://github.com/Sqaaakoi/Vencord/blob/d95ef91e7ebb91dd42f8c224fbf23719a76e5e77/src/plugins/voiceStatusSocket.desktop/native.ts
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
I'm not opening ports

Guys is it possible to trigger the deafen desync thing at will without spamming it
What do you mean
If you mean fake deafen we do not speak of nor make anything related to fake deafen
why not
read rule 9 for a reason why
alright
Always been curious why fake deafen is crossing the line but message logger isn't
Both should be banned imo
Message logger is fine because you could've seen the message
Fake deafen allows you to hear things people didn't think you could hear
In both cases people should have the right to you not knowing whatever was said/sent
Guess that makes sense
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
o o o o o i am hacking discord i enable showhiddenchannels
horrible no good dumb 4:42am dumb bad question:
how do i mute/deafen the user
anything you post publicly on the internet is public
hello vee
i have ruin my sleep schedule for vencord
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
i need to explode ‼️
yeah I do agree now
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
the current or any user
use react devtools to inspect the mute and deafen buttons
see what their onClick is
and you have it
speaking of, is there a better way of getting a reference to a function than just $self.funcname = w.default.funcname
what's your use case
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
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
guess it's kinda a stupid question too
are you using a patch to grab an export?
that's what webpack finds are for
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
findByProps("funcname")
i am failing miserably
why
hold on
use the react devtools element picker on the button in question
that seems way easier than what i've been doing
walk down/up the component tree until you find the button component that has an onClick or action prop
search this.handleToggleSelfMute
what if I need the setSelfMute
uhh
glhf
probably get the current mute status on start, then just keep track of it
wtf it is 6am for me
sleep
you also have bad sleep schedule apparently

rewriting in python 🚀
(why can i not stick with a language)
(I literally went from Java to C++ to Python)
You will rewrite in js
i've been over this a few times already. serenity doesn't seem particularly good in some ways...
You will rewrite in ruby
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
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
🚀

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

id like python more if its syntax was different
i dont like how it depends on indentation
nobody else is insane enough to collaborate with me if i use c++
honestly with tabs it's not too bad
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
import braces from futures
then you can use them 
(would be funny if it actually worked)
/run
from __future__ import braces
@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
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)
python > lua
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
what is there even to forget about it
decorations, built in libraries, i remember nothing about classes
decorators*
i think
msot likely more
i only know basics
decorators are silly
i literally only use it as a calculator rn
lmao
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
true
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
hey
curve knows everything
true
/run
proc doThing(a: int, b: int) =
echo "separate args"
proc doThing(val: (int, int)) =
echo "tuple arg"
doThing(1, 2)
doThing (1, 2)
Here is your nim(1.6.2) output @oblique lark
separate args
tuple arg
when the whitespace is mandatory 
winded up a development install of vencord
clearly i'm using this in a very productive manner
meow
meow
Crazy
meow
Remind me tomorrow
will do thank u <3 the issue is pissing me off, the only way i can make a part of my code look good doesnt want to work
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
ah
ven detecetd
hi, gib your theme, thanks.
thats default vscode
they meant the discord theme
lol
good 1
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
readallnotificationsbutton?
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
Hotkeys and so on
(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
they trampoline hook RtlExitUserProcess (called by ExitProcess, probably more) in discord using minhook to make it crash but it doesn't get called when u quit discord so I'm not super sure what that's for
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
also do you have any clue what I could do here
if u do then @ me because I might go back to sleep and not notice ty in advance
const c_var* varis dangling when initialized in your preferred way- 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
hm yeah idk, I don't need to do it that way but it's the cleanest way I could think of
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
I'll try that later then
oh, sorry, didnt know this was reopened..
it is not plugin request reopened, it's just a thread made by a random member
anyone knows what name left meta key have in glfw?
One message removed from a suspended account.
One message removed from a suspended account.
is there a way to add extension but on safari browser?
lmfao
worthless
id rather get paid with monopoly money than server boosts
Just search it in google
hell even in the roblox devforums
One message removed from a suspended account.
horror
like at runtime?
you love reflect
i did smth very similar for Aliucord but other way round
adding dex at runtime
**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")
}
funny
i wanted to make a java agent that replaced a library with something newer
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!
add a custom "main wrapper" library in the agent, then add a transformer which for the first main function it finds renames it to main2, then creates a main function which calls MainWrapper.main("clazz.name.Here", args)
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
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.
https://javascript.info/
https://react.dev/learn
https://www.w3schools.com/ for css and html
hey i'm new to vencord coding, but how could i make a plugin so it has all free soundboards
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.
Yes? You can try to make the button return nothing. Or well better, hide it with css
I think they mean clicking an invite link outside discord (or what?)
Try setting a breakpoint on any API requests to join servers and use a plugin to override the function that makes that API call
why?
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
is there like a "remove bloat/annoyances" css somewhere 🐱
* { display: none; }
love it
then how can i update the vencord in the discord client?
how do i import node modules? like fs and path?
.
that doesn't tell me anything that much though
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
is that supposed to be on the root folder of the plugin? and can i just export it like this instead? export { join } from "node:path";
yes and try it 
im getting Could not resolve "node:path" whenever i build it


