#🧩-plugin-development
1 messages · Page 33 of 1
i flip between i and idx for that
depending on what side of the bed we woke up on that day
i was writing a lot of java and i insisted on making everything as verbose as possible
i avoid traditional for loops as much as possible anyway
oh my god
average java dev
for (int studentsArrayCurrentElementIndex```
that's the true java way
surprised you didnt wrap it as an EnumerableIndexFactory
the java development experience: add a load of fields and then press eclipse's generate thingy
I did
I should find some of my java garbage
all of them were in like 10 nested folders with stupid names
(I have got slightly better.?)
i am struggling to find garbage
i can just find stuff that's not great
is this bad enough 😭
(I tried writing a http server because i didn't like any of the existing libraries which seemed to be super bloated)
uh yeah that's bad
that is horrible
what.......................
what....................................................................................
are you ok?
what............................................................................................................................................................................................................................................................
not after seeing that code
i dont even know what it does i cant understand it
for (int iStudentsArrayCurrentElementIndex)
• clones a project from source, and installs dependencies
• attempts to build with gradle
• catastrophe 
how on earth do you get into coding 
make sure android sdk is set up correctly
oh and make sure JAVA_HOME is set to jdk 17
java is a bit messy
*gradle
im not going back on my words
the project they're doing is kotlin
kotlin is java
nop
in some sense that's what the jvm target does
there is not a single good jvm language
kotlin
bytecode
bad
kotlin does have native target
least bad but still terrible
no jvm required
in that case kotlin normal bad
kotlin can also compile to js
i hate yiu
wait so i can
i haven't really seen anyone use it though
transpile kotlin to v8 bytecode
no it compiles to js
kjs does support react
i did NOT need ti know thrt
no one uses
im not sure if that makes it worse or better honestly
anyone doing web dev with kotlin is likely using the experimental compose for web lib
i want to punch you for ever telling me avout any of this
a fist is coming your way as we speak
compose is good though
not on web
well its extremely experimental so yeah
thoughts on new java @simple folio
i don't use java anymore
dont even follow releases?
welp. i think the problem was how i cloned it into the wrong directory. instead of cloning it into my studio projects folder (~/StudioProjects/Gloom), i cloned it into a completely unrelated folder, where most of my personal data is stored (~/Jank2/Projects/Gloom) so gradle had no idea where the sdk folder was.
why would i
weird that the environment variable doesn't work in a particular directory
can i just say i hate that font
respectfully
try a different new thing then 
though that font is nowhere near as bad as My current System Font 
out of curiosity what are you planning on contributing to gloom
i really dont know yet. since java seemed like a useful language to learn, i wanted to use your apps as an entry point into programming.
and then i realized java isnt the same as kotlin... i think
kotlin is a bit easier than java imo
but java is more likely to be used in enterprise environments
and compose is probably a bad starting place to learning kotlin
yea. though i may just need to try kotlin, or java later, and start elsewhere, if i cant even build an unmodified project atm 
also

GRADLE MOMENT!!!
i am not kidding when i say that i fucking DESPISE gradle
more than maven?
maven is way better than gradle
in fact i actually enjoy using maven most of the time
and others see them normally, except if I misunderstood and that's what you wanted
can someone pretty please make a plugin that forces avatar decorations, animated profile pics when reduced motion is enabled to play?
well I don't want them to always play
would just like same behavior as when reduced motion is disabled
then disable it 😭
yeah but reduced motion makes switching channels, scrolling and clicking on stuff pretty much instant

you mean jumping?
i don't think so
and opening settings
and like anything lmao
it probably doens't wait for the spinning animation to end though
ofc
in any case if its just about blocking some low quality sites
[data-async-context^="query:"] {
display: flex;
flex-direction: column;
}
[data-async-context^="query:"] > div:has(a[href^="https://modrinth.com/"]) {
order: -1;
}
hmm it causes some issues with margins sometimes
idk how to fix that
@prime lodge
rust standard library my beloved
someone should make a joke language where you actually have to do that
reverse c#
who thw fuck thinks C# when they see unsafe
no that's the joke
a language that's always unsafe and requires explicit safety
c# would be a perfect contender because of its ability to become unsafe
although i have done native stuff in c# with pointers and shit xd
c# has unsafe blocks
safe funct main[void] => int
| `print hello world to stdout`
| safe
| | message :: const String
| | message <- `Hello, World!`
| | standard#io#stdout#print message
| | return 0x0
i think we have a winner here
yes and then
which has the exact same feature
stolen by c# apparently
what do you guys think of my snippet
love it
make it even more shit by making safe blocks only valid in safe function contexts
safe funct main

tbh this is probably because i had to do a lot of native C# recently so my brain just thinks C# when i see unsafe blocks now
i love fixed pointer blocks and ImGui.GetIO()->IniFileName = "";
i should stop editing it probably
you somehow keep making it worse
unsafe constdata
| 0 -> `Hello, World!`
mixedsafety funct main[void] => int
| `print hello world to stdout`
| safe
| | message :: container<String>
| unsafe
| | message <- unsafe:loadconst 0
| safe
| | standard#io#stdout#print! { message }
| | return 0x0
if you're going to do unsafe code you should get out of the safe block
oh yeah my mistake
using funct standard#math#add
safe funct main[void] => OSint
| safe
| | `add two numbers`
| | one :: 1
| | const one <- 1
| | two :: 2
| | const two <- 2
| | two :: int
| | two <- standard#math#add one, two
| | standard#io#stdout#print result
| | return 0x0
the + operator is reserved for string concatination, and cannot be used to add numbers. instead, use standard#math#add
it doesn't work at all 🙂
your class hash is outdated. Parametrize it to avoid that:css [class*="messageContent-"] { text-transform: lowercase; }
just said it doesn't work
¯_(ツ)_/¯
it looked like you thought it works only for my side
This one does work, altho I meant not to remove lowercase from all existing messages (cosmetic) but to automatically transform every message I send into lowercase only (no idea how to do that)
with the TextReplace plugin
^^
i'm typing fullcaps and it works
cheers
at least i think it does
tyyysm!!
gladly!! :D
@chrome elbow you made a user happy 😊
xd
wait how do u do it with text replace
you need to add like 26 rules, one for each letter
yeah i suppose. (One could semi-automatically generate such rules if this person’s pr is merged ↑)
True but I was told that ven doesn't like the idea of the rules being stored in the settings.json apparently. It was suggested before and got declined: #🧩-plugin-development message
I think I'm gonna close my PR :(
settings.json is a very inefficient storage
it's blocking & json is inherently kinda shit
it's also stored in localStorage in browsers which is potentially limited to a few kb
DataStore/indexeddb is much more efficient, not blocking (async) and has no storage limit
settings should only be used for basic booleans and small data. text replace rules can potentially become plenty and large storing them in settings is bad
Oh okay, wasn't aware of that. These are the arguments I was looking for when I posted here originally.
also syncing text replace rules would be kinda an anti feature to me
they may potentially contain sensitive info
some people wouldn't want us to have access to their text replace rules while still using settings sync
okay, i understand
a better idea would be to refactor the offline import / export to also include DataStore settings from several plugins
maybe just allow plugins to have their own json files?
I mean you could create a switch in the TextReplace settings that lets users decide where the rules should be stored. But that's not going to change anything about the other drawbacks you mentioned of course.
that doesn't solve any of the problems
did you read any of this
because async is inconvenient
and vencord needs settings synchronously
sync settings are okay if used for small data
not if used for many MB of data
if you are storing that much then you definitely have too many TextReplace rules lmao
people put insane stuff there
^
discord already stores a shit ton of stuff in localstorage
we're potentially working with very little space
Isn't Vencord only compatible with the desktop versions of Discord? Doesn't this mean it's always the Chromium browser we're talking about?
but you could just all of the data at once and parse it still?
The limit for local storage seems to be 10MB for Chromium.
surely the browser asks before using that much
there are browser extension and userscript
oh okay
yeah
nvm :derp:
vencord runs in every modern browser
could we have the best of both worlds by (a)syncing° a settings.json in the filesystem with the IndexedDB or another fast data storage like just an object in RAM?
° reading it only on startup (and maybe when the filesystem alerts that it has been changed), otherwise reading from fast RAM/db; effecting fs writes async with low priority in idle time
i think that may be how bd does it
that's already how it works
😅👌
it reads settings.json once at startup then keeps it as a variable and every time you change anything it writes it back to settings.json
then @amber plover what was your pr supposed to improve on that?
ah nvm i think i got it
In short: Put more (too much) stuff into the settings.json because i thought it would be more convenient.
nice summary^^
i don't think it'd be too much in most cases
but yeah i guess you may have a lot of rules
This ^ would be a good alternative
i was more concerned about storing sounds in my CustomSounds plugin though lol
you need the LHSs in memory anyway if i’m not mistaken; but ig if you use abbreviations for long templates, you could save some RAM by storing the RHSs away in a db
lhs = finds?
you can literally store blobs or even audios in DataStore
with no data limit
yeah, i thought of doing that
left hand side: what to match, what gets replaced
I once wrote 50gb to DataStore and it worked fine
but... uh
lol
40gb discord folder
surely browsers need to ask the user?
otherwise you could just visit a site and it could fill your disk lol
but yeah i planned to use IndexedDB
/DataStore whatever
(is that some kind of wrapper?)
yeah this sounds essential actually, not just for TextReplace
For example, Chrome and Chromium-based browsers allow up to 80% disk space. If you have 100GB, Indexed DB can use up to 80GB of space, and 60GB by a single origin.
but on desktop i think it'd be better to store it in actual files
I thought the same btw
currently all DataStore settings would have to be ported by hand?
couldn't you add a flag on settings to get it to magicly use DataStore or something
eviction xd
indexeddb is a very efficient storage mechanism
why would we not use it
it's way better and more robust than anything we could manually implement
hmm
not to mention sending large blobs via ipc is slow
also overcomplicates things
indexeddb is very very good
you can dump random js structures in there
Maps, blobs, etc
i just thought it'd be nicer for the uesr because they can see all of their custom sounds in a folder
then totally forget about them 😎
but i wanted to store the URLs (which should be fairly short) in settings.json
and/or a trusted° cloud storage provider like GDrive
° notably in terms of reliability

Google take my data
idc enough lol
wouldn't you just put the link?
lol but this is definitely very bad
^^

this is small enough that it somehow works lmao
but i put something bigger and Discord stopped responding
and of course it likely wouldn't work in browser at all
idk if there’s a reason not to use it, ig the question is what data gets synched how to fs additionally
related & fun^^ https://omar.website/tabfs/
mount discord chats to fs

mlv2 essentially
even more cursed than my minecraftchestfs idea
your. WHAT
this page makes good arguments for it
actually i think this would not need to be coded specifically for vc/ plugins. It should be a module you can link to any set of data in IndexedDB; plausibly someone has made that alr
semi related but i used to be on the web port team for an indie game and apparently emscripten has "idbfs" that literally mounts a folder to indexeddb
used to store saves in localstorage before i joined, ppl were running out of space
cool, tx!
rate my packet system
normally have a constructor for a packet but its not in devtools
constuctored would be ts const proxiedPacket = new Packet(WsEvent.EVAL, "console.log('a')"); const outPacket = new Packet(WsEvent.PROXY, { id: 1, packet: proxiedPacket, }) outPacket.send(ws);
what's this for?
fevered dream i had
you put a stack of chromebooks on a website and you can remotely send webassembly payloads
currently, the core server is done, working on the managment ui rn and i need to actually make payloads
i cant get the context menu to work properly
it builds and runs but im having trouble doing sleep for testing
mod utils;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
fn alert(s: &str);
}
#[wasm_bindgen]
pub fn main() {
alert("Hello, world!");
}
works though and will alert
moving to the right channel, anybody have any tips?
#🏥-vencord-support-🏥 message
the question being, is there any reason why settings wouldn't persist?
did you add the settings to the plugin definition
yes
if it's of any help, here's my fork: https://github.com/Battlesquid/Vencord
i'm just bamboozled, it was definitely working earlier today
nothing that seems relevant
weird
me when it works again
maybe some cosmic ray looked upon me with malice and flipped the bits involved in saving my settings
resulting in them not saving
probable
Wow
anyone have css snippet to change someones profile picture, me and my friend wanna put our faces on ours but we dont want others to see
[src^="https://cdn.discordapp.com/avatars/YOUR_ID/"] {
content: url(IMAGE_LINK);
}
guh?
The Experiment. GONE
they want an add-on to disable media mosaic
The broadcasting thing ?
i reckon a css snippo might do it even
Nah can't be done with just css, the image on the page there is after they've done all their wacky stuff to it
to quote a theme developer
... videos in a mosaic will always open in a popout and images may end up being blurry
lol
So I'm trying to make a plugin for Vencord but i dont know where to start.
I think it would be pretty simple (i want to add thumbnails to folders), however i have very little knowledge in JS or CSS
right now my serverlist looks hectic because of all the folders and none of them make sense, but i was wondering if it would even be possible to give them thumbnails
it's possible to code this yes
you can also use css (bad ux though)
maybe see what part of the code PlainFolderIcons is patching
ive noticed with plain foldericons, i cant set colors or that would be sufficient
i might be because im using better folders too then
ah no it was my theme
discord looks so wierd without a theme after all this time
fr! It needs to be made
(i’d lowercase the S tho, like calm down jesus)
managed to get it working lol, i might look into making a plugin for it soon if i need it
my folders are looking wierd too for some reason
it's a cool plugin
a what??
yes
sanic my beloved
i like doing things with python that i shouldnt do with python
yeah
its basically flask but ✨ new ✨
and good
i enjoy making random apis to do random stuff
(using a json db because i was too lazy to learn sql but its now a required module on my course)
so sorry for you i hope they find a cure
you should be
let it out sibling
what did i do to you 😭
gender neutral
what did you do the world? what did you do to yourself? are the questions you should be asking
are you my therapist now?
yes
btw i have no issue with you using py for anything, i’m just hopping aboard the meme train here
don't know if this was said, but no, it can't unfortunately
python my beloved ❤️
the thumbnail images themselves are cropped
maybe js to remove ?width=x&height=y from the src + css could work
banned ||/j||
ayo what did i do?
i was simply saying i like python in wierd ways
i implied you were being nsfw
as in, i enjoy doing things with python that python shouldnt be used for
ik lmao
hmmmmmm
^^ like what (apart from web dev ig)
i found something malicious
code embedding
you can put code in other files which is not smart
hehe
unironically use python
rule 9.6 it is not allowed to write python code that isnt mocking the language
i dontsee that rule sir/maam
lol

i write code in java
i love java
although c#'s also somewhat nice, only if you don't use that .net framework garbage, especially using vscode and linux
i enjoy telling poeople about why c# exists
it was made out of spite
it's microsoft java
yes
the whole sun microsystems vs microsoft lawsuit
because microsoft said "hey can we use java" and got a no
all because microsoft tried to do theri eee strategy on java
so microsoft said " fine were gonna make our own java!"
by not being complient with java and also adding their own proprietary stuff
yea and they made their own java 💀
Lmao I'm Greek and this is the first time I hear about this
yeah i dont think its greek
Can't think of any rini related word or name that means lovely, closest name that exists is irini maybe but that means peace
is there any coder who wants to collaborate to a project for a custom profile decors plugin?
(there's already a vendetta version but we need a vencord one)
i'd guess the plugin is easier than the backend
you could also ask in #👾-core-development and you should prbly contact the vendetta version’s dev – they might be motivated to help out, at least with the interoperability
also instead of a standalone plugin, you might want to add it as a feature to the similar free custom profile bg plugin (i forget the name) (does vencord have it?) or the FakeNitro one
true; surely the vendetta one’s backend could be used
somebody wise once said you don't need a backend when you can have a json file hosted on github pages
Very real
maybe they mean having a json file in a repo and making commits serve as updates
i think then you’d still need a thin backend to accept hem
unless you write your interface so as to read the PRs hmm
lmao
xd
kinda intriguing I wonder how well it would work
yeah^^
I could imagine a bot that accepts structured commits
such a lib would prbly be fairly viral too
err, that will only merge structures commits
that way no manual review is required
oh dear the intrusive thoughts are going to win
i’m thinking you’ll actually want to keep them as PRs so you can use GH’s search function to filter them
otherwise it won’t scale
or maybe rather issues instead of PRs
yeah
I can see that
would have to be processed by each client if it’s all one blobtastic json
How would I make my own custom theme?
there’s a site for that
and/or you learn css
ahh k
this shows the 6 most recently created custom colorways
so this is my plugin injector
apploader.onload = () => {
const useProxy = localStorage.getItem('useProxy') === 'true';
const proxyOption = localStorage.getItem('proxyOption');
const pluginUrls = JSON.parse(localStorage.getItem('websitePlugins')) || [];
pluginUrls.forEach(pluginUrl => {
const script = document.createElement('script');
if (useProxy) {
if (proxyOption && proxyOption.toLowerCase() === "dynamic") {
script.src = `${window.location.origin}/service/route?url=${pluginUrl}`;
} else {
script.src = `${window.location.origin}/uv/service/${Ultraviolet.codec.xor.encode(pluginUrl)}`;
}
} else {
script.src = pluginUrl;
}
const iframeDocument = apploader.contentWindow.document;
iframeDocument.head.appendChild(script);
console.log(`Plugin injected into the iframe: ${pluginUrl}`);
});
};
And because vencord needs to be injected first how can I adapt my script to bypass this or do I have to redo my plugin injector...
if u want me to send the vencord script I can
the vencord script? Do you mean a custom plugin you made?
how do the plugins get into localStorage.getItem('websitePlugins')?
i fucking hate ci
thank you stackoverflow
FUCKING FINALLY
it better have done the artifact correctly
FUCK YES
@stray imp i fixed it

im a bit stupor
in my addons page it adds the script: https://cdn.z1g-project.repl.co/sodium/plugins/vencord.js and then inject it into the iframe
except I belive earlier last month someone told me it has to be injected before discord starts loading or smth is there a way to bypass that tho
why is loading before discord not an option
what addons page?
and why are you even making whatever you're making
what is vencord.js?
// Vencord 6227777
// Standalone: true
// Platform: Universal
// Updater disabled: false
"use strict";console.log('Vencord for Sodium is loading!');
What is Sodium?
custom client?
its a proxy site I made
I added some logging to it and a CSS injector for the vencord css
it has "plugins" on it so that you can use it on the site
basically
are you saying vencord is just a single .js?
someone told me to use browser.js and browser.css
yeah
in this chanell
there is a single file for renderer
cool
so thats the js file just with the console.log's in it
the only difference rly in the file is this line
console.log('Vencord for Sodium is loading!');const cssLink = document.createElement('link'); cssLink.rel = 'stylesheet'; cssLink.href = 'https://cdn.z1g-project.repl.co/sodium/plugins/vencord.css'; document.head.appendChild(cssLink);
public yet?
why wouldn't you execute this and then load vencord
yes its been public for a bit
cus it waits for iframe.onload im pretty sure
internet censorship
how to bypass a school filter
yea it works
are you like running a whole vm there to use for free?
Cloudflare Pages is free
my friend hosts a "bare server" so I just route the proxy stuff to there
i wouldn't trust this with my login details
anyways uh
LMAO
https://sodium-5h8.pages.dev/discord/stealth/
doesn’t seem to work for me tho
Sodium is a site used for evading internet censorship
needs login via token o.o
I would never lmao
i made one forever ago in 8th grade that had qr code auth
why? @inner pendant
theres jsut a couple of... bugs...
cool:)
maybe you can use a free one from Oracle
hmmmm
anyways what could I do to my plugin injector to fix it: #🧩-plugin-development message
They using Hetzner lmao
is this thing open source
my site? yes
source available is not open source
the scripts on replit those u can see via replit view but I dont have a github connected to it
you should probably link the source code in the website
I did
This button opens the github
huh what’s the diff?
can you have open source but no source available?
source available does not mean you can modify and redistribute it
no
on the contrary, not licensing your software usually means "all rights reserved"
i had doubt, but confirmed your definition via Wikipedia
Open-source software is computer software that is released under a license in which the copyright holder grants users the rights to use, study, change, and distribute the software and its source code …
(thought that’s FLOSS then)
so like this?
const injectVencord = async () => {
const {responseText: css } = await ("https://cdn.z1g-project.repl.co/sodium/plugins/vencord.css");
const {responseText: js } = await ("https://cdn.z1g-project.repl.co/sodium/plugins/vencord.js");
document.head.appendChild(Object.assign(document.createElement("style"), { innerHTML: css}));
console.log('Injected');
}
you’re not using the js variable there
damn i cant believe the children are trying to inject vencord into the proxies they use to bypass school internet filters
children reinvent boss keys from ms-dos
why not just load it as a normal extension
async
no.
school chromebooks prevent you from installing extensions
make your proxy rewrite the html to inject script taps at the top then send that modified html
;)
you will use https://github.com/shigandco/venproxy
ok
in case anyone is wondering what proxy is the defualt its Titanium networks Ultraviolet
I might be able to get it to work
use the userscript
this is also why im trying to get vencord to work on my plugin injector so then people with locked down chromebooks can use discord with vencord
various bugs 
this is so annoying
2 files are giving me errors because I am using custom flux event names
even though they work
how should I communicate info properly between "files"/components?
I have a ws client in my index file and want to send the data it receives to specific files accordingly
just call the functions that need to be called?
I want to update specific states in a modal, basically the ws client receives the stringified json, it has a "type" of "SET_COLORWAY", along with the appropriate data to make it a colorway. I want to send that to the selector modal if it's open
so that the selection updates
I might try something different, but I doubt it'll work
and it's gonna be a lot of work
just use an EventEmitter
or equivalent implementation
it has 2 
one is from a "stream" module
and the other is from an "events" module
nvm
none of the modules work
both give ELIFECYCLE errors
ok so I somehow did it, and by somehow I mean made the ws an export
hola
Matching pfp 
to say that im an idiot would be an understatement
I've been looking for a way to store data using either indexeddb, which was too complicated for me, or a version of DataStore, simmilar to vencord's
and what do you know, vencord's datastore uses indexeddb
DataStore is just https://github.com/jakearchibald/idb-keyval
oh well
are there any simple scripts to disable discord's csp?
depends a lot on your environment
but just look at vencord codebase
it has for both chrome and electron
I was kinda looking for firefox
, well not really
I made the UI work without official colorways as well so as long as it can render random css, im fine
just use electron 
i love my memory
uses electron
where is my memory
not electron issue
on the topic of memory, what the fuck
steam is closed
there is no reason that shit should even be running
steam, while doing nothing, uses more memory than idea on full blast
I can't get a wp module because I can't find it by props, yay
(I know I can find it by code, I want to try to find it using props, to be able to find it directly from webpackChunkdiscord_app)
which module?
the colorpicker
Vencord.Webpack.findByCode("showEyeDropper") this returns the module
uh
open settings, then run again
oh it's lazy loaded
yea
why can't you find by code from webpackchunk?
how do you think client mods do it..
and that's where I'm stuck
I can't for the life of me make a working findByCode function
and neither can I find a ready-made one
why do you write like that?
lol
v annoying, no offense
tbh I thought about that
monospace kinda lowtier typing quirk tbh
typing quirk?
oic!
ouch
wh2ts 2p
no clue
no more typing quirk yay
i need to pull out our typing quirk machine but idk where i put the textreplace rules
guys im so sad rn
I wanna make a function
but discord source code is kinda long
and like I dont have the time
hey speaking of homestuck
😭😭😭😭😭😭😭
homestuck^2 updated for the first time in three years
I Should Really Get My Own Typing Quirk Tbh
is this helpful? https://discord-userdoccers.vercel.app/
just type with proper grammar and youll do well in no time
prbly vencord also has api docs
fr?
please don’t and thank you!
never seen them or heard of them
i may be wrong
but somehow plugin devs have to know where to find stuff; maybe they just use intellisense
maybe tbh
didnt save it anywhere ☹️
yeah no, i scoured vencord.dev and the gh and all i found is https://github.com/Vendicated/Vencord/blob/main/CONTRIBUTING.md which has no infos on api
ig intellisense it is
possibly not even that, maybe you have to run a function to list the available modules (“webpacks”?) as strings
whar
? you reverse engineer discord to find stuff
there is no intellisense
damn insulting ur headmate
xd
here’s a snippet i had at hand (not vencord specific), we can prbly go from there
// get server count
let stores = {};
let webpack = window.webpackChunkdiscord_app.push([[ Symbol() ], {}, ({ c }) => Object.values(c)]);
webpack.find(x => x?.exports?.ZP?.Store).exports.ZP.Store.getAll().forEach(x => stores[x.getName()] = x);
stores.GuildStore.getGuildCount();```
ig that’s about as simple as a dc snippet gets 😭
actually yes
with the first 3 lines of the above snippet
does displaying the plugins tab on the userscript entail using gm_xmlhttprequest
wha should I code
I want to make this always false. Is it right how I do this?
patches: [{
find: "showTimestampOnHover:",
replacement: {
match: /showTimestampOnHover:.*?\.REPLY,/,
replace: "showTimestampOnHover: false,",
}
}],
the find need to be more specific
"showTimestampOnHover:!" will works
What is the meaning of !?
Oh I see.
How do I know whether the patch is successfully applied to the place I wanted?
you can test with patch helper tab in vencord
it will appear when you build vencord with pnpm watch
Oh that is convenient.
Will the code seen in dev tools change when a patch is applied? The patch helper looks fine, but I can see that the codes still remain original in the dev tools after I pnpm build and reload Discord.
it changes in WebpackModulexxxxxx.js file, not the original
I looked at WebpackModulexxxxxx.js, and it is also unchanged.
did u turn on the plugin u made
Spent some hours trying to find where I can change this time format and no luck. How can I find that?
enable react dev tools
go to component tab, inspect it, click <> to view its source
I saw this, but I still cannot find where is the format.
That format is for tooltip, but I got the idea. I think maybe I can figure out the rest.
for the one in chat its the one with LT format
Yeah but Discord seems to have different time format for different locales.
It looks strange if there is only LT here.
Oh I see, LT itself is locale dependent.
yeah moment itself also has global format settings for locale but im not sure where discord hid that
Finally! Thank you guys.
started porting presets, this will mark the full transition of the plugin to vencord, and soon to any and all clients
so this works... for some reason
pr / new plugin / other?
Is there a way to add description like this to settings of my user plugin with type: OptionType.STRING?
Currently there is no description, and the description field is shown as the title of this setting.
The main problem with showing as the title is that it is all capitalized, but I want to use lower case letters.
you can use OptionType.COMPONENT
Writing a component seems complicated. Is there a doc?
odd!
idk if it’s the same type of component, but you could see if https://discord-userdoccers.vercel.app/interactions/message-components helps somehow.
More useful would prbly be an example, so you may wanna search the vencord github (plugin folder) for OptionType.COMPONENT i suppose. Or gh at large
OK.
The examples I can find are all somehow simple, but I think they are useful enough.
nice 🙂
those might be incoming requests
Do we have Vencord API doc?
no
oops, i think you’re right, ty!^^`
(i mean it’s literally pending, smh discord!)
well i’m glad we get useful names in those webpack stores at all, not just single/double letter minimized variable names!
no. But:
• an excellent plugin development guide by @viral roost: https://gist.github.com/sunnniee/28bd595f8c07992f6d03289911289ba8 It also links to official guides by @dull magnet & @austere gulch.
• https://discord-userdoccers.vercel.app/
• [broken as of ’23-11-02, need to fix] ~~This snippet gives you autocompletion after stores. (see screenshot):
let stores = {};
let webpack = window.webpackChunkdiscord_app.push([[ Symbol() ], {}, ({ c }) => Object.values(c)]);
webpack.find(x => x?.exports?.ZP?.Store).exports.ZP.Store.getAll().forEach(x => stores[x.getName()] = x);```
example of a discord function you can access this way:
```js
stores.GuildStore.getGuildCount();```
~~
originally posted in #🏥-vencord-support-🏥
is there a way to use js somehow to determine whether someone (i dont have their user ID, only username) is in any mutual servers with me, and if so, which ones
answered: #🏥-vencord-support-🏥 message
finally got it working by rewriting the proxys config to make it inject before load and its so cool lol it just takes while to load
thanks for your help guys
that error notification is uh oh tho
means localStorage is undefined aka you're likely still loading too late
Oh
I’m glad it at least works
Does Vencord have webRTC?
Is there a hook that runs whenever a setting of my plugin changes? I want to run some codes when a setting toggles so that I do not have to Ctrl+R to make it effective.
if it's a setting, it saves automatically, I presume. If you have a custom modal/UI, you have to find a way/place to save your settings, for example inside indexedDB using vencord's datastore api
The plugin runs something in start(), and it is dependent on the settings. If the settings change, that function needs rerunning to apply the new settings.
add onChange to the setting definition
OK. Let me try.
#🏥-vencord-support-🏥 message Opened pr #1785 for this.
I think its injecting on time because when looking at the console they seem to load vencord at the exact same time then again the proxy im using ultraviolet saves Localstorage at __uv$<itemname>
do I need to modify the script im using the ones from the repo itself instead of the custom one
this is how it stores it
Can someone explain how findByPropsLazy works?
iirc it gives you a "component" that when the target hasnt been loaded, errors, but replaces itself with the real thing once discord loads it
and it might let you set a placeholder, i dont remember
that's LazyComponent
oh
in that case i guess itd return a proxy that when something tries to get it it looks for the target and either caches it or errors
ill check in a bit
look at all the others
I was playing around with a plugin I made and found this function "disconnect" which disconnects the user from the vc when called : const disconnect = findByPropsLazy("disconnect");
but im tryna find the function that mutes people
it finds a function by its exports
use react devtools to find the correct function
ight ty
Don't know much about TS, but when I need to write a really long regexp, how do I split it into multiple lines of source codes?
you cannot
don't write a regex this long
you can use the regexp constructor with a string but that's ugly as well
How to avoid writing long regexps?
you could use something like this
function regex(...args) {
const s = String.raw(...args)
.trim()
.split("\n")
.map(line => {
line = line.trimStart();
if (line.startsWith("#")) return null;
return line;
})
.filter(Boolean)
.join("")
return new RegExp(s);
}
horror
Sweet!

should we unironically add this to vencord
i think it could be decent for patches
only if its bre
we could make a bre variant
Can patch replace function use named regex groups? $1,$2 etc gets cursed when there are many of them.
lmao
I use legacy chat input (turn on in accessibility settings), no such problem.
yeah
i was reading the comments for so long trying to understand what processed meant
this fire i think
i think that could actually be helpful for vencord
Syntax?
i think it encourages writing insane patches i dont really like it
i think the mid-patch comments are prob good for long patches
old:
match: /return ?(.{0,30}\(.{1,3},\{[^}]+?,showTaglessAccountPanel:.+?\}\))/,
new: ```js
match: re`
return ?
React.createElement(
(.{0,30}(
AccountPanel,
.{1,3},
{ ...props,
{[^]+?,
showTaglessAcountPanel:.+?}))
`
hmm idk how much more readable that is
maybe comments at end of line would be better
match: re`
return ?
(.{0,30}\( # React.createElement(
.{1,3}, # AccountPanel,
\{[^\]+?, # { ...props,
showTaglessAcountPanel:.+?\}\))
`
IDK
horror
is there any possible way i can make a timezone plugin like in BD 🙏
actually nvm it doesnt suck
i thought it used the showTaglessAccountPanel value, that would be horror. but its just used as anchor
new: ```js
match: re`
return ?
React.createElement(
(.{0,30}(
AccountPanel,
.{1,3},
{ ...props,
{[^]+?,
showTaglessAcountPanel:.+?}))
`
this is kinda more readable ig
but also not really
i think the idea is cool but idk how to implement it well
yeah it would literally be so good 😭
match: re`return\((0,\i.jsx)(\i,{\[^}\]\.\+\?,showTaglessAccountPanel:\.\+\?})\)`
\\\\\\\\\\\\
if we dont have someway of getting it i might combust in 10 different ways
goofy
isnt timezonedb a thing
yes, find out yourself
why tf does oceanic not have guild.deleteChannel
also category.channels is always empty

how do i make oceanic cache all guild channels
back end like typescript
I don't speak English I speak typescript
Ok I don't think it's "completely random" after all, it definitely has to do something with the device going to sleep and then waking up, like when it shows that split second discord spinning icon. I'm not 100% but I think that's the point that breaks stuff and makes vencord unable to fetch stores and stuff
Btw that settings problem with the bazillion undefined webpack modules magically fixed itself, without me doing anything
But this problem still holds
And I notice it especially on file upload, I use the find filter from the voice message plugin, and I prefetch it when discord loads and keep it around (since yk it breaks later) but this prefetched version of uploadFileToCloud, once it breaks is inoperable because some internal enum or whatever is undefined and it throws an error that upload status is undefined
what browser is that?
also, finally finished the browser version of the creator
only thing remaining to wrap this up is the preview component and a mutation observer to add the colorways button (I don't know how to patch on vanilla, or if it's even possible)
could always
basically patch on the spot?
dunno how to do that either, I will have to basically look both at how vencord and bd do patches
looks like firefox
yeah, but not quite
The shield and tab style are 100% firefox
Firefox has quite extensive user css support so it might look a little different
I mean my Firefox looks like this
omg firefox adw theme
adw?
adwaita
ah it's not meant to look like adwaita but I can see the similarities xd
o
it reminds me of uhh
Wow that looks really similar
there's an error
Hey guys
new here
trying to code a custom plugin for vencord, is that possible?
better discord has a plugins folder that I could add to, but I cant seem to find that for Vencord
docs
Im not seeing them in there
peak web design
OH THERE WE GO LMAO
TOOK LIKE 3 MINUTES
HAHSDKJHAHFDJSKLSJDAA
Hey everyone, is it possible to grab a reactive property? I want to do something with the notes of a user but it's not updating correctly after changing channels.
yeah in sunnie’s guide #🧩-plugin-development message
I'm not familiar with React at all either, only Vue so my knowledge of React internals is very limited
idk if my opinion is much qualified here but i for one love it
no correction below
idk what that does but why wouldn’t you, why do you ask?
I can't code :')
then your possible way would be to learn it ig
Does Discord use a library to format using these template or they implemented their own formatting library?
Looked around on the internet and found FormatJS. Should be it.
actually yeah, i found i find aligned comments with distance at end of line look good:
match: re`
return ?
(.{0,30}\( # React.createElement(
.{1,3}, # AccountPanel,
\{[^\]+?, # { ...props,
showTaglessAcountPanel:.+?\}\))
`
```(not sure whether i favor ^ or [#🧩-plugin-development message](/guild/1015060230222131221/channel/1032770730703716362/) )
possible bug:
.{1,3},
does not match
AccountPanel,
oh so in like the source map it’s AccountPanel but in the actual transferred js it’s like lb
there are no sourcemaps 😭
then where do you even get the AccountPanel part from?
oic
well good that you enjoy reverse engineering! 😋
yeah!

const settings = definePluginSettings({
includeGuilds: {
description: "If disabled, server emojis will not be shown in the autocomplete menu at all.",
type: OptionType.BOOLEAN,
default: false
},
includeExternalGuilds: {
description: "If disabled, emojis from external servers will not be shown in the autocomplete menu.",
type: OptionType.BOOLEAN,
default: false
}
}, {
includeExternalGuilds: {
disabled(this: DefinedSettings): boolean {
return !this.store.includeGuilds;
}
}
});
How do I get access to the "current setting" instead of the saved setting in the disabled function?
Note that the settings are not written into store until the user hit Save & Close button.
shouldnt that be a select
- No server emojis
- Current server emojis
- All server emojis
i dont actually know what the plugin is for but it looks like a select like that would be more natural
Sounds good, I would like to switch to that.
But is there an answer to my original question?
Just curious because I may need this when developing future plugins.
i dont think theres a good way to do that for the options themselves
but if you need to access the temporary settings values for something like a preview
u can see how shiki does it
I see.
nice codes
the theme toggle looks cute
I need to patch to several places in a file, but they are considered the same module, so I have to let a single regex match 30,000 characters...
It becomes very slow due to the length of the matched string.
change replacement: { ...patch } to replacement: [ { ...patch1}, { ...patch2}]



