#🧩-plugin-development
1 messages · Page 55 of 1
If another plugin needs to patch it, someone will make a common API or change the patch
I did get a report that one of my userplugins conflicted with SMYN, but it wasn't too hard to fix once I found out
how do i debug plugin errors? ctrl + shift + i is useless
Add more console.log
no it isn't?
the console has your error
where exactly is the error
i think i see what i gotta do for the IPC stuff, i need to add 2 IPC events
- to open the system directory selector dialog to choose the output directory
- to write a file out (with appropriate safety checks etc.)
i think i could add them toipcMain.tsbut i also see there is a fileipcPlugins.tswhich might have been made for this purpose?
oh 😮 awesome ty
our build tool ✨ magic ✨ auto generates bindings for you
how do i run javascript snippets via a plugin? vencord blocks eval()
function constructor
Or just copypaste the code into the plugin
This
But @quasi sentinel is building a JS snippet plugin
Eval does not need glory
Of course it does
It supports arbitrary strings, as long as they contain valid js syntax
If you mean js string literals don't support newlines, then correct
well shit
You can use a template literal (`-enclosed) or \n
vencord blocks eval()
no it doesnt
There's a lint against direct eval I think
idk why everytime i use it, it errors out
Then just put a rule to disable the linter
show the error
yes it is
oh shit im dmub
wait what it works now
im a genious
ok now time to add support for multiple snippets
hmhm, i am trying this in my context but it doesn't seem to see the native function (i get TypeError: Cannot read properties of undefined (reading 'selectImageFolder')).
the name should match the string in definePlugin({name:"",...}) right?
full restart discord
okay
and no, it matches your foldername converted to PascalCase
without any .desktop suffixes and such
~~what about the .desktop -- ~~ okay, that should be the same either way. full restart it is
do both files have to be .ts and not .tsx?
do you use react components? (for example, injecting custom UI elements)
YES: tsx
NO: ts
also I dont think tsx will work for native stuff
ok cool thanks. i found the error, i didn't put an empty parameter at the start. is there a use for it?
At start of what?
at the start of the native function export e.g. export function sayHi(_) {console.log("hello :3");} or whatever
the _ there
from what I can tell it is a IpcMainInvokeEvent
yes the first arg is the ipc event
i just thought of a plugin that would remove all of discord's css and apply a basic theme so its more performant
idk if im stupid or not
.sender is WebContents
good fucking luck
would prob require dom manip 
you will have to restyle everything
yes (if you dont want to write duplicate everything)
actually that's a terrible idea lol
Just tried it, looks terrible and breaks scrolling completely
well i mean after that applying a very basic colorable theme
oh that is actually super useful 🤔 could i get the BrowserWindow instance from it somehow instead of using BrowserWindow.getFocusedWindow() which i would guess is a bit fragile?
or do the WebContents and WebFrameMain not have back references...
i need the BrowserWindow instance for dialog.showOpenDialog i think, to do a directory selector instead of file selector
maybe it doesn't matter
no afaik
not in the console apparently 😅 i wonder if i could grab some other logger on the native side of things...
Maybe it shows up in the terminal that launched vesktop, like nodejs does
you dont need it no
emant to reply to this
correct. if you want console log of the native process you need to launch discord/vesktop from the command line
no i suppose not, it's just for locking the window/modal behaviour
but yes you can get that from the event
hence why we pass it to your func, in case you need it
but 95% of ipc methods just ignore it :p
am i cooking...
Never use direct eval
It messes up all kinds of jit and bundler optimizations
Either (0, eval)(str) or new Function(str)()
oopsie
Also might be good to add a isValid to the settings
how to get the style of a prop? like navbutton
lol was reading your conv in #🗳-plugin-requests
like the prop properties like class?
I am trying to get those classes and replace it with the button style instead of the blue classic blue button
really sorry if what i am saying is non sense. I always chose to program plugins mid night
Classes are usually in className prop
so I can do prop.className? alright makes sense
Depends on what context your code is running in, and like a billion of other factors
why did you disable the header rule
ok this is a bit of a noobie react question but...
i'm making the folder selector Settings component and it's working but i want to have a text field that updates when a folder is selected to display the value to the user. the html/js way to do this is to just give the Text element an id and use document.getElementById(textElementID).innertext = choice but surely there must be a way to enclose a reference to the Text element in the button's onClick handler instead
do you not know how react works?
you do it via state
ah ok
if u dont then i suggest learning react basics first
check the react guide
Do I need to do anything about this? Added myself to the list, thought I had branch updated before doing so.
git pull again
rm -rf *```
lmao, weird bug
any experts in UI? I want some suggestions of how you think this should look like
Having the box empty looks bad, add a placeholder
And set the same border-radius as the cards below
Margins are inconsistent too
heading weights and margins inconsistent
yes, I liked the font of "Explicit image filter" and don't you agree its looks better?
The placeholder is an improvement (personally I'd move the parenthesis from the heading to there)
The heading should look like the other heading
hm, alright. I am gonna change it to match the other heading
that what you meant?
Describing what content is allowed should be in the placeholder, not the heading
ooh, I got you now. you meant to put "supports only filters" in the placeholder itself
done
hello, still working on the image downloader plugin.
right now I am weighing options for the actual fetching & saving of the file.
- electron-dl is not included.
- WebContents.downloadURL is convenient but hooking the event and not messing with other downloads might be tricky.
- copying Quicksave-BD-plugin's method (spooling up the chunks and saving them to disk) is fiddly but might have some advantage like not creating a broken file if the download gets interrupted idk
https/http.get=>response.pipe(file)after the appropriate checks seems the cleanest but isn't very electronny. still, i have a fragile prototype working with this method.
is there another better option?
the last option would indeed be the best
but make sure to verify the url
for example only only discord cdn / media proxy
i made a setting to toggle whether to allow grabbing from other places (on safe by default)
since discord sometimes compresses stuff on its proxy? according to a thing idk
My problem requires me to isolate users video feed and preferably expose it in real time on some local endpoint
and I am thinking about achieving it with vencord
is there some plugin that interacts with user cam that I can look into?
there isn't a plugin that does that as of now
Messing with that is definitely not a starter project
Is there a way to debug my custom plugins other than the console?
Idk like making breakpoints and such?
the sources tab is your friend
you can put breakpoints in it
use react devtools to find the script you need
Meh. Also can I make a pull request to update someone else's plugin? Like adding feature/improvement?
yes
yep
either check the .vscode folder, there's a launch config for attaching vscode as a debugger and instructions how to use it
or way easier, search for your plugin name in devtools via ctrl shift f, open its file and you can just put breakpoints there. if you got sourcemaps enabled it'll show source code there
Pull requests should be made on the dev branch or main?
dev
Who's on the github account of Vendicated? Sho?
Well whoever it is, they should take another look at my pull request
@dull magnet https://github.com/Vendicated/Vencord/pull/2284
Please don’t ping vee 💀
They’ll get around to it
We needa give them some slack
This is discord not slack
venslack when
do u guys know where the source is for Toasts (like the full implementation for show() and stuff)? i don't think it's part of discord
i'm trying to make a persistent toast that i can edit the text of dynamically for my plugin
basically they can search through a list of messages with arrow keys and i tell them their progress (eg 2/5 messages)
also i wanna see how it works
this is a beginner af question, but i've made some changes to the code, how do i test it out in discord before making a PR to make sure my code actually works lmao
ik how to code just, never rlly worked with web stuff/discord stuff before
pnpm build```
then
```shell
pnpm inject```
love you goodbye
After injecting you can just do shell pnpm watch so you don’t have to rerun the command every time (it’ll autobuild every time you save), and make sure to refresh Discord when checking new changes
so i just do this in my vencord local repo?
yes i love you
Hello! The recent changes to the Settings API unfortunately broke my plugin and I'm currently trying to fix it. My plugin uses stores to save its own settings which was useful at the time. I'm not sure if it's still relevant or if Vencord has added its own API for that. Anyways, here is my implementation.
The error that this line of code throws is Uncaught (in promise) Error: An object could not be cloned.. This line of code causes the error to be thrown in the first place once executed. If any property is changed from any plugin in the Settings object, this error will be thrown. The value is still being changed which means if you access it, it has its new value but it still prints this error. I didn't come up with any solution yet. The only thing that seemed to work was using the PlainSettings object instead of the Settings object. But that solution is bad because the settings don't persist after a restart probably because they are not proxied.
As you can see I have almost no idea and the only reason I want to fix this is because some people use my plugin if that weren't the case I would just abandon it. I would be really grateful if someone who maybe worked on the rewrite could quickly look over it and maybe explain the issue because I just can't seem to find it...
previously it would JSON.stringify the settings object before passing it, now it passes the raw object via ipc
this means every member you store in settings needs to be cloneable
things that aren't cloneable include functions, classes, etc
your error implies that you're storing something inside settings that isn't cloneable
json stringify would just discard such members so nothing has changed in functionality
Ohh... yes that would be the issue then. My implementation of stores has functions inside the objects.
why?
that never worked
well it would just discard the function members
what even is the purpose of your store thing?
It did. Before the api changes everything worked fine. I have an idea do you think that would work Settings.plugins[pluginName].stores[storeName] = JSON.parse(JSON.stringify((typeof s === "function" ? s(get()) : s) || get()));? I know that's pretty bad to do but do you think this would achieve the same behaviour before the rewrite?
To be honest I can't even remember. But I know that it was a pain before.
I had so many properties to change so I remembered a library like zustand and implemented similar behaviour
what are the functions in there for
are they part of your api or are you just spreading some object that happens to contain functions
also i still think you don't even need it. the regular settings store already provides reactivity and hooks and such
if you tell me what extra functionality you require, we could think about integrating it natively
I used the functions to change the single properties just look at that code it's pretty self explanatory https://github.com/philhk/Vencord/blob/better-plugins/src/plugins/betterScreenshare.desktop/stores/screenshareStore.ts
I don't know if what I did is good practice so be aware I didn't had and have any Idea what I'm doing there
so the main use case is managing multiple profiles of the same set of settings?
Not really that was an Idea that came later but yes that's also pretty useful. I think my main reason to why I added this whole store functionality was because I needed a clear way of modifying properties. I know there are probably easier ways to do it but at that time I thought this was the best Idea.
i mean in vencord you just
const settings = definePluginSettings({
...
});
settings.store.fooBar = 42;
don't think it gets any simpler
but wouldn't all of that show up in the settings tab? In my plugin I have this custom interface.
if you make it the main definition yes
you can use something like
const settings = definePluginSettings({}).withPrivateSettings<{
profiles?: Record<string, Profile>;
}>();
function getProfile(name: string) {
settings.store.profiles ??= {};
return (settings.store.profiles[name] ??= makeDefaultProfile());
}
getProfile("high-res").bitrate = 1000000;
you can also just set hidden to true
i think hidden is pointless now that we have private settings
no because hidden is still managed with defaults
personally I think private settings is mainly for arrays and stuff
Yeah something like that is certainly possible. But my approach is just easier to handle in my head than this because after a while it just gets more complex and I also made it reusable so it's really really easy to just create a store and also to create middlewares that modify something in the store. Not to say that your approach is bad it's as good as mine but I'm just used to it. But that you for the help and suggestions I really appreciate that :)!
could someone take a look at my plugin code?
https://github.com/programminglaboratorys/Vencord/tree/main/src/plugins/betterModeration
and maybe helps me to fix those
[34mC:\Users\ACER\Downloads\Vencord-main\Vencord\src\plugins\betterModeration\UI.tsx[0m
1:1 [31merror[0m Invalid header simple-header/header
9:1 [31merror[0m Run autofix to sort these imports! simple-import-sort/imports
[34mC:\Users\ACER\Downloads\Vencord-main\Vencord\src\plugins\betterModeration\automod.ts[0m
1:1 [31merror[0m Invalid header simple-header/header
[34mC:\Users\ACER\Downloads\Vencord-main\Vencord\src\plugins\betterModeration\index.tsx[0m
1:1 [31merror[0m Bad header spacing simple-header/header
18:1 [31merror[0m Run autofix to sort these imports! simple-import-sort/imports
Note: if you found unnecessary code its probably for debugging or testing
run autofix
I do pnpm test --fix? because it didn't work for me
pnpm lint --fix
it's annoying that i have 2 import sorting extentions that do the exact opposite
when i save i gotta lint it all over
is this a 3rd party plugin ? looks awesome!
author closed the pr
can someone help me figure out the best way to deal with this bug.
is creating a variable to check if the component is already rendered to not render it again, is the best option?
**UI.tsx: **Lines 17-52
export function TestInputBoxComponent(props: { currentRules: AutoModRule[] | null; }) {
const [inputValue, setInputValue] = useState("");
const [warningText, setWarningText] = useState("");
const { currentRules: currentRulesProp } = props;
const currentRules: null | Array<AutoModRule> = currentRulesProp;
useMemo(() => {
if (!inputValue || !currentRules) return null;
const match: undefined | MatchedRule = currentRules ? match_rules(inputValue, currentRules) : undefined;
console.log(match);
console.log(inputValue);
if (match !== undefined) {
setWarningText(`Match: ${match.rule.name}, filter: ${JSON.stringify(match.filter)}`);
} else {
setWarningText("");
}
}, [inputValue, currentRules]);
return (
<div>
<TextArea
className="automod-test-box"
value={inputValue}
placeholder="Type something to test automod (Supports filters only)"
onChange={setInputValue}
id="AutomodTestBox"
/>
<p
style={{ display: warningText ? "block" : "none" }}
className="automod-test-text-warning"
>
{warningText}
</p>
</div>
);
}
**index.tsx: **Lines 69-75
{
find: ".categoryContainer,children:[",
replacement: [{
match: /\.categoryContainer,children:\[/,
replace: "$&$self.renderTestTextHeader(), $self.renderInputBox(),"
}]
},
categoryContainer sounds like there'd be multiple of them
So if you patch that, it makes sense that it appears in each category
not sure how do I tell if i am on automod settings or on random category cantainer. suggestions and improvements are welcome
first thing you can change your find to .Messages.GUILD_SETTINGS_AUTOMOD_MESSAGE_FILTER_DESCRIPTION
and you want to only render the input once? here?
instead of one in the members, and one in the content
yes
so you need to patch where the arrow is
what I marked with the red line is what renders the Members and the Content
oh alright
Or patch the H perhaps?
oh yeah that should works
I mean both work
I would prefer just patching the place before
should I credit you two in the authors? for the assistant?
{
find: ".Messages.GUILD_SETTINGS_AUTOMOD_MESSAGE_FILTER_DESCRIPTION",
replacement: [{
match: /\.textBadge.+?}\),/,
replace: "$&$self.renderTestTextHeader(), $self.renderInputBox(),"
}]
},
thanks
Not unless you're gonna credit mdn too
who's mdn?
the match is super simple, it matches .textBadge and goes forward until it finds the closing component render }) followed by a comma (which means we are going to the next children)
it works because textBadge is part of the last component rendered there (in that children array)
The definitive reference for all things web https://developer.mozilla.org/en-US/docs/Web/javascript
makes sense, should asked what it does before copying it blindly
gonna see that later, after I fix this bug
there nothing specific to see
it's just docs for web related stuff
css, html, javascript and more
for my homepage plugin, I am adding a few quick access buttons in the main overview header box, I need suggestions for what people need to quickly navigate to
i plan to dynamically populate the rest of the page btw
help i have a stupid button and i hate it
You should add a barrel roll button
i will make this (separately) and post to #1032200195582197831
Do credit me for the idea
do abarrel roll!
get real
The feed card
ok there is still lots to do to flesh it out but it's working all right so far
https://github.com/Vendicated/Vencord/commit/632347fb6e3e428b49d3c2a277dbf96639cf7d32
am i doing anything nonsensical here...
well first of all, you're storing the folder in regular settings that the browser can change
so that defeats the point of the isolation
since the browser can change the folder to whatever it wants to write arbitrary files
i plan to introduce separate native only settings soon which you'll be able to use
oh, gotcha. so the native side code needs to validate and store the folder on its own.
i can do some kind of temporary thing with app.getPath('userData') in the meantime i spose
unless by 'soon' you mean in like the next week or so
work picked up so i'm busier than i expected 😅
i can add it very soon, its only a few lines of code
i recently made a refactor of the settings api to prepare for this
ok, i will just wait on that and work on other improvements in the meantime 
i think adding it as a hover button is strange
why not add it here?
below save image
and also add it on embed images
ReverseImageSearch plugin should be useful reference, does exactly what you want
mostly to reduce number of clicks for my aging fingers 👵 this way you can download e.g. 6 images in one click. i often upload 6 different photos of cooking process in one message and then it's a pain to download each of them individually.
but yes i'll add those options next and change the default away from my own preference to something more familiar
i think having both would be best then
youre acting like youre 60
youre definitely not tthaaaaaaaaaat old right
ok not quite that old...but i'm old enough to get arthritis sometimes and i don't want to make it worse 🤣
youre gonna end up like my dad with one of these
the funny mice
goodness i hope not. though i already did buy a mouse with a recommendation for this purpose, the Logitech MX Master 3S.
there are two different functions and they are both identical and i need to patch one of them
i'm stuck
one of them isn't used and the other is
wait theyre in 2 different modules im stupid
would it be possible to let pnpm watch listen to css file changes too? cause everytime i change the styles for my plugin i have to save another file to build it
what
qhar
yeah it doesnt build when i save it
its always been like this
works on my machine
I've sometimes had to restart the watcher after adding new files
works on my machine
so basically jump to message?
yes but the message is blocked and doesn't exist anymore
so it's really hard/tedious atm in native discord to go and find surrounding messages
to see if they tried to evade or smtn
or generally to see what the convo was about
but given Discord doesn't check if the message you're jumping to actually exists, and only cares about the timestamp in the ID, I jump to the target channel but I use the message ID of the alert
245 unread messages from 1 server is crazy
that’s wild
this happens for me, idk but seems like its decreasing the scope, like when you edit in a folder, its now ignores all the folders but that folder
My css is in the same folder as my plugin and my plugin builds fine
why doesn't it work like normally where clicking on the message itself jumps to context
whar
in vanilla discord, clicking on the automod message jumps to the message
only if it wasn't blocked, though
are you reviewing the pr or smtn
out of curiosity
i'm just making a suggestion
@pure temple might it not confuse people as to why they can't see the message itself
Kangaroo
I copied the name from another part of the code where they also jumped 
wdym
to un-minify it
so we can actually read the code 
there was a community project for Minecraft that collected observations from modders to generate reasonable classnames once they figured out what a given function did
until mojang finally hired enough people out of the modding community that they finally just released the official mappings under a license 😛
specifically Searge, who's now also active in stable diffusion development
we could do something similar................................................. it might be too much of a pain in the ass though
what's the point
the code is perfectly readable
everything is already named properly
the classes change sometimes when updating
that's for css classes. they seem to be talking about js variable names. as for css class names, simply don't hardcode them
nvm sorry for the ping

it could be neat to potentially inject automod-blocked messages into the message cache
handle it in a similar way to how message logger does
that way when you do jump to the context the actual location of the message is obvious
chat can you tell me the difference between the two minus the “ // --- TEST ----“ part
It’s the only way without that it the color doesn’t change
idk, someone just suggested I use the one that says “//--- TEST ----“ above it
even @trail talon we’ll agree with me (since they helped) on how badly that buttons placement is coded”, using the ‘importants’ was the only way to get it to work
did you read at all what i said
yes, and it took me three days to do this because i tried, but that button is stupidly made and this was the only way to do it. As said i even had @trail talon help and they agreed
the button is not stupidly made
you can customise the style of the button via js
the button component takes style as property
well i’m new to this a don’t know how to this, i had to look a different plugin to see how to even do the Style.css then import that
don’t worry bout it
who wants to help me make a plugin that stops crashing and memory leaks when screenshares occurr
i finally got an error to trace down whats causing it
“Memory Leak???” is this a @devilbro reference
it could be
i remember betterdiscord lagging and crashign constantly back in the days
horrors
hey, so, thge usrbg plugin (rather, their server to request changes to your banner) has been having some issues for some time, and a lot of that is down to some issues that have been happening with imgur
I've been talking with the dev about some possible solutions and they're open to trying some different image hosts but the side effect is that we'd need to have cors modified for the plugin to work
I imagine it won't be an issue because decor has to do it too (iirc) but yes, i thought i would at least mention it
The thing was down for like three months even the bot was offline, and now it goes unavailable for like a few weeks at a time but when people are able to send it most the time they don’t get approved and they just end up getting ignored
I know, yeah
they've been getting ratelimited by imgur incredibly hard - like, only being able to upload 5 images a day or their quota not refilling with no explaination
seems like they need to stop using imgur set up with something else
yes, that is the point of me posting about it here
CORS is the big issue though
imgur is allowed through discord's default csppolicy, other hosts are not
do you mean csp, not cors?
decor does not have any cors modifications
csp modifications are not necessary. vencord already lets any images through
alright neat
why dont they just selfhost the images?
you can put cloudflare inbetween with aggressive caching of images to limit bandwidth usage
because usrbg has been a plain css theme since it was first created and didn't have luxury of that
I'm helping them set up with selfhosted images though, yes
just need to deal with csp issues elsewhere
generate unique filenames, for example by using the sha256 image hash, then put cloudflare inbetween and set cache to a year
easy way to save 99.9% bandwidth with no complications
I know, yeah, that was the plan
thats how vencord badges work
if you limit banner size to something reasonable like 2mb (should do that anyway so it doesnt take 3 years to load), you can store thousands of banners with only a few gb of disk use
I already have the infra side set up, it's mostly me just figuring out the logistics and pain of updates for the css and js plugins at this point (then they need to update their bot to use the infa i have)
cool
i wonder why they have imgur whitelisted
they dont use it anywhere
so they can save bandwidth on imgur embeds probably
they don't use it themselves but lots of other things upload to imgur directly and give users links
screenshot tools in particular
reddit watermark 
yep proxied
weird
how the fuck do you get ipbanned from imgur
they ban cloud vm ranges
i use a selfhosted vpn
I read the href not the src
why tf
wikipedia makes more sense tbh
is imgur just worried some bot will spam loads of random shit onto there
or scraping
anyways yes thanks for the answers vee even if I am mildly smoothbrained in terms of remembering acronyms and stuff
:p
ai image dataset scraping 
hold on
how much stuff is hotlinked in vencord anyway
regardless of site
how do u generate these?
do they ever expire?
if they dont expire it could be an easy csp bypass
why answer if u have no clue
i don't know if they expire but if discord is following basic media proxy hygiene it's a signed portion of the url that they generate server side
yeah sadly
would be neat though
hmmm
yeah dont think any of these can be abused

upload banners as yt thumbnails 🔥
flawless
yeah I looked through the list of them as well before going through the effort to get things set up
Heyo, I'm trying to make a plugin for which I want to add a button, so I decided to take inspiration from the gameActivityToggle plugin, where the button code looks like this:
const Button = findComponentByCodeLazy("Button.Sizes.NONE,disabled:");
[...]
return (
<Button
tooltipText={showCurrentGame ? "Disable Game Activity" : "Enable Game Activity"}
icon={makeIcon(showCurrentGame)}
role="switch"
aria-checked={!showCurrentGame}
onClick={() => StatusSettingsStores.ShowCurrentGame.updateSetting(old => !old)}
/>
);
So I tried to copy that into my code, but for some reason the <Button /> tag tries to import things instead of using the const. So how can I make the Buitton tag use the const?
remove the import
i dont have any
you said it's using the import?
import { Settings } from "@api/Settings";
import { disableStyle, enableStyle } from "@api/Styles";
import definePlugin from "@utils/types";
import { findComponentByCodeLazy } from "@webpack";```
it tells me to import something
then don't import it
yea I'm not importing it, and getting this error:
'Button' refers to a value, but is being used as a type here. Did you mean 'typeof Button'?
Is this warning form your code editor or from the build logs? @rare glade
it's an eslint error
so in the editor
this is in the build logs:
X [ERROR] Expected ">" but found "tooltipText"
@frosty otter
I'm building a plugin that sorts your guild list based off of how often you visit the servers
Gauging opinions on the concept
so shoot
it does get rid of folders entirely doe
maybe I could sort within folders instead
idk
I just sort them that way manually
^
true
i have folders 1 to 4 where numbers mean importance
and then you just move the servers around as you feel
ok so I rechecked everything a kazillion times but I still don't see why it refuses to use the const??
const Button = findComponentByCodeLazy("Button.Sizes.NONE,disabled:");
function RPCToggleButton(): JSX.Element {
return (
<Button
tooltipText = "pls work";
/>
);
}
Button' refers to a value, but is being used as a type here. Did you mean 'typeof Button'?
I'm so confused?? it's literally the same layout as in gameActivityToggle but it doesn't work
hm strange, even when i copy the whole gameactivitytoggle code into my script the button doesn't work
I wonder if it'll work when I make it in the plugin folder
still the error hm
this makes 0 sense to me
Weird error message, but try removing the semicolon maybe?
nope, semicolon didn't change anything :c
Is it on the <Button it's complaining?
yea
Is the file named .tsx? That syntax isn't supported in .ts
So perhaps it's interpreting it as a generic parameter to dog-knows-what
this workked 😭
this is so embarrassing, I should've known that as a web dev lmao
thanks a lot o7
so uhh anyone want to help me make this into something that could maybe some day be PR'd? https://github.com/Vencord/plugin-requests/issues/1#issuecomment-1957949593
looks good
what'd you need help with
is it really good enough to PR, because I literally have no idea what I'm doing lol
also I'd really like to add some customization to the relative timestamps like in the documentation I linked but I have no idea how to put that in
or actually maybe it's not that important
wheere can I check discord's color css variables?
open devtools (ctrl+shift+i), scroll down on the styles pane on the right, see them there and/or hit the link to the css files they are coming from
thanks o7
for which class do I need to change the min width so the settings cog is back?
idr if it's container_ca50b9
thanks
but this was relevant for my plugin :)
np
would the text to reaction plugin from powercord be allowed in vencord?
tbh it's not that useful
- vencord users are definitely gonna abuse that for spam

not a good idea imo
maybe I will just make it for personal use
whenever i make plugins i think about the consequences
imagine #🧊-off-topic-iceman-only or #🏥-vencord-support-🏥 once that plugin is added
insane whitenames will flood messages with reactions and maybe even slurs
yeah that's why I asked if it was allowed
lmao
XDDD
I want to make a modification to the friendsSince plugin (just adding an icon to the popout), however there are 2 versions of the popout, where one has the icons and one should not. I have the icon working but it shows on both popups. How can I add the icon only if viewing from the server member popout, and not the DM popout? All I am doing is adding an extra element to the popout.
read discords logic for showing the icon
Do plugins that use external unpkg dependencies need .desktop or a similar suffix?
uhn no
yes
oh they do? I was thinking of fake nitro which doesnt have a suffix
webstore wont allow cdn usage
and wont work on userscript anyway
if u want the plugin to work on web u need to bundle with extension
like the moanco editor is bundled toferger with ext
oh right
How do decor and reviewdb get around csp?
they dont on userscript
Doesn't that make them kinda not work at all?
Would a plugin to change this to the current remaining duration be suited best as an option inside of the existing ShowTimeouts plugin?
oh cool, i have access here now.. again
replace: "const [timeoutRemaining,setTimeoutRemaining]=$self.react().useState($self.getTimeout(arguments[0].message,this));$self.react().useEffect($self.subscribeInterval(1000)(()=>setTimeoutRemaining($self.getTimeout(arguments[0].message,this))),[]);$1timeoutRemaining+''",
this line of code is so fucking disgusting i need to fix
it FINALLY works tho
Why not just do $self.useTimeout(arguments[0].message, this)?
I originally had something like that set up
I wanna clean up the actual output first
i made a bad desision using message patches for channel and guild things
well i made a thing
7 days?
what did you make?
i just started panicing after i noticed a memory leak to find out its literal kilobytes an hour
Hover over timeout icon in chat shows the remaining time
i spent several hours making a fancy a show up in the chat
yeah im not the best with react
fixed it
honestly, im not sure how you all can do the patches in here, im slowly going insane trying to understand and find them
fancy letter A
that was me in the start, eventually you would get better at it
i dont lol
by the way, do i need to do something about this or do I just wait till someone sees it?
Cause I see every other PR as green and am confused.
just wait
it doesnt run for first time contributor
ok, thank you
yo guys i was working on this https://github.com/Vendicated/Vencord/issues/1512 but it's a bit messy to bundle the opus-recorder library into the userscript
like rn i'm turning the entire library js file into a blob and slapping it as a global var
should i still try to make the userscript support the new library
bc i saw someone made a latex plugin and they said they won't support userscript bc it uses an externa llibrary
currently trying to change #1032200195582197831 message to use the apple sounds (say what you will but apple's sound design kinda hot ngl)
now im trying to just play a sound when the user sends a message, which i tried to with just the enter key but that doesnt seem to come through
how can i listen for the message send event and then play a sound?
const keydown = (e: KeyboardEvent) => {
for (const sound of Object.values(sounds)) sound.pause();
if (e.ctrlKey && e.code === "Backspace") {
sounds.massdelete.currentTime = 0;
sounds.massdelete.play();
} else if (e.code === "Enter" && !e.shiftKey) {
sounds.send.currentTime = 0;
sounds.send.play();
} else if (e.code === "Backspace") {
sounds.backspace.currentTime = 0;
sounds.backspace.play();
} else if (e.code === "Space") {
sounds.space.currentTime = 0;
sounds.space.play();
} else {
if (ignoredKeys.includes(e.code)) return;
const click = sounds[`click${Math.floor(Math.random() * 3) + 1}`];
click.currentTime = 0;
click.play();
}
};
you can make it trigger on the MESSAGE_CREATE create event and check if the message is by you, using flux
but this will waybe lag
I just added a PreSendListener and play the sound, works!
I think the button component has an hover style prop
Would it be a good idea to make a plugin that adds permanent classes to elements, so themes don't get effected when discord changes them?
I guess that's true but it would make things a hell of alot simpler

How would i go about getting the file path of the client? (on a dev build)
I want to make a button in the plugins menu to open the userplugin folder

seems ultra laziness but i am a hypocrite
just (cwd)/src/userplugins would probably work lmao idk
Is it stored in the same folder as the themes/settings? If so, you could just use the button in the themes menu to reach in there
(asking because I don't have a dev build)
No, userplugins are part of the source code
Nevermind then 
@orchid cairn why do you need to pass flags to the cli, like what's your goal?
well my ultimate goal is so i can just set an alias to go thru all the built steps & install without any input
for quick building & injecting cus my ass is lazy
when i checked the installer source i see it very much supports cli flags
download the cli manually
run ./cli -install -branch stable
you can pass environment variables to customise where it takes vencord files from (default is to download them from github), see runInstaller.mjs or whatever it is called for those env vars
alright
correct me if im wrong, but arent you supposed to use = for golang cli flags?
or is that no longer a requirement
oh damn nice
it's optional, same as in posix
is there any full plugin docs or do i just ask in here?
not sure if docs have evolved since i last read them
but there is the docs folder, and reading plugins until you understand https://github.com/Vendicated/Vencord/tree/main/docs
thanks
there is also sunnie's version https://gist.github.com/sunnniee/28bd595f8c07992f6d03289911289ba8
yeah thats a bit more in depth, ty
just lookin at the vscode extension
is there a function to start the companion plugin in app?
its not on the plugin list for me
when you do pnpm build --watch you have it
is there anything special i have to do for it running under linux?
not that I know of
but if you use vesktop, instead of injecting you change the vencord location in vesktop settings to the dist directory of the build
Bro really ripped off my patch without giving any credits 💀
https://github.com/Vendicated/Vencord/commit/7fe718a018fa7ec1ddb16b002ab3495ea6ba0c29
@cedar olive
nah I didn't just ripoff
I took inspiration
and I did a lot of research before choosing where to patch
"a lot of research" literally takes 5 mins to find it plus the fact that the only patch required is just the part I patched since the others have server side check
I don't choose a place to find before actually knowing how the thing is used
Could've approved my pull request and made the changes but you decided to attribute it to yourself
so yes I did a lot of research before choosing if I should patch there
and no I don't want the credits to me
just because I made the commit doesn't mean it
and my patch isn't even like yours, I actually made it work for everything there and not target wrong stuff
It's literally the same patch except you add unnecessary things that doesn't work and would probably confuse people since you didn't even add an option to toggle it on/off
SOUNDBOARD_SOUNDS_RECEIVED|GUILD_SOUNDBOARD_SOUND_CREATE|GUILD_SOUNDBOARD_SOUND_UPDATE|GUILD_SOUNDBOARD_SOUNDS_UPDATE
"doesn't work"
do you even know what those are for
your patch was literally a replacement for e.available buddy
"let me just replace every e.available in that code without even making sure it's the right thing"
Which is the only thing required and unique
That's not how it works lmao
literally is
it's like targeting an object with a key called name and expect no other code to include it in the future
"I did a lot of work" bro really just searched for my match string, adding a couple of unnecessary strings to it and said it took a lot of research
All these strings are literally there
yeah yeah you can think I only did that
Anyways it doesn't matter
you can't know what I did before that
and I can't prove to you so it doesn't matter what I say
in fact your patch had a hardcoded e which didn't even target one of the places it should patch cuz the variable was called t
As I said you wanted to attribute it to yourself else you would've approved the PR or just requested some changes or made them yourself
^^
But you took them anyway
That's what the comments are for?
Could've requested the changes or made them yourself. It's not exclusively either approve it immediately or make your own "inspired" patch
Kinda rude af having the PR closed immediately without even understanding it's content then having someone else make the same feature under their name
I hope you see where this is coming from
no way you're this pressed about a 4 line change 😭
what would nuckyz even gain from "attributing" it to himself
seems like i am unable to do this plugin without modifying the api itself, as the plugin is interfering with the api
so is there work arounds?
wait I think I got idea :thonk:
{
find: 'location:"ChannelTextAreaButtons"',
replacement: {
match: /(children:)(\i)\}/,
replace: "$1$self.test($2)}"
}
}
location:"ChannelTextAreaButtons" is not something?
darn it
how would i get all the channels in a guild? i can only see methods for getting specific channel ids
(and get all members in a guild, if thats even possible, because GuildMemberStore.getMemberIds returns a limited list)
try figuring the first one out yourself
look at guildstore and channelstore
the latter is not possible
that button is tiny
how about we make the button size customizable?
yes
possible if you have kick/ban/manage roles perms
use array.map and ChannelStore.getChannel(id)
I'm trying to webpack find class names (to do horrible things) ||Horribly patch over Discord's CSS at runtime, no I cant use [class^=] as there would be conflicts||
Does anyone have any idea why I cant find this specific module?
Die
Hasn't been loaded yet I guess
find* only searches cached aka already loaded modules
if you need more control you can use findModuleId or manually traverse wreq.m
Vencord is loaded after the loading screen
no?
then why tf isnt that loaded
I really am doing cursed thing and recieving even more cursed behaviour
Ah.
What the hell is going on here?
because discord hasn't imported it yet
Does discord even load this?
Is this relevant?
huuuuuuuuuh???
wtf?
its still used in the css
so
???????????????
@dull magnet stupid question but
does discord never clean out their CSS, like ever
OHHHHHHHHH
I KNOW WHAT THIS IS
what
you're making no sense
the module was simply not imported yet
which means they're either not used, or, more likely, the component that uses them has simply not been loaded yet, for example because you need to open some menu or popout to see it
Sounds like those classes are for the login screen
If you don't view the login screen, maybe because you already have a login token, it's not loaded
i'll work on fixing moreusertags in my own pr because it's my job to fix my own patches
what the actual heck a new update changed shit AS I WAS FIXING IT
#announcements message
visible annoyance
time to start using canary so i can have it fixed before it hits
Wooo it's working on canary for messages!
i'm proud of myself
Sorry for the ping
Maybe once I finish all the work of making this PR work with the Discord update you can just merge it and not have to update it yourself (when Discord updates, of course. I'll keep the Canary version of the code in a separate file for when the day comes)
Because fixing it for canary breaks it for stable
they reverted canary too now

Welp all that work for nothing
It was fun though
do you think there's a chance they'll bring that change back? If so, I want to keep the work-in-progress fixes handy
just commit it to some branch
Got it
Refreshing discord and having everything work perfectly is a refreshing feeling
oh no
unintentional pun i'm so sorry
is there a way to get the stickerstore?
is there a way to download all stickers like the emoji one from #📜-js-snippets
should I give credit to MessagePreview dev for the eye icon? prograss
uh, the icon is from discord themselves
Discord deserves no credit
popping out seems weird, so any simple ways to make this look smoother?
@vast karma Where did i get this plugin and why do i have it, i dont remember downloading it
(sorry for the double ping took a better photo of it)
nvm i found it #🗳-plugin-requests message
w
Is there a way to add the streaming status to the status picker?
Not really sure why, i just randomly thought of it
Technically couldn't you just spoof you streaming at that point?
Wait that's what you asked
Lmao yeah
Probably then
I'm half asleep
I would think it's possible to just spoof it and add it
Seems simple enough
Real question is how easy is it lol
So is it impossible to have the streaming status color without actually having a streaming rpc?
I have another question.
Do I need to update the branch every time or will it sort itself out in merging?
latter
Is there a plugin for changing Servers and other people's avatars only on my end?
Css?
It could be easy and fast
like when giving a nickname to a friend
also "server nicknames" could be nice 😄
like a local nicknames and avatars storage to swipe at any time?
hello, how do I match until I reach a suffix of something?
my current match /let (\i)([\i\)\}\)\];]?)/
I want to end the matching until i reach t)})];?
nvm, I finally understood ^
.*?
wtf is that?
what is what?
thanks btw
/let (\i)([\i\)\}\)\];]?)/
wtf is that
that makes no sense
ah, don't mind that shit. i had no idea what I was doing
\i is a vencord exclusive thing
variable names
after like
a bajillion years
i actually did the thing
trying to add rolecoloreverywhere to the bottom left corner of discord was 80% of the reason i joined this server
more like precisely 1 i guess cuz i joined here end of march 2023
how would someone normally target this module? I was trying to do a proof of concept so i used s()(r.title, n), but obviously that's not future-proof. But I'm not sure what about this function is unique enough to be targeted, can we use regex in a find?
function(e, t, n) {
"use strict";
n.r(t),
n.d(t, {
default: function() {
return o
}
});
var l = n("735250");
n("470079");
var a = n("803997")
, s = n.n(a)
, i = n("481060")
, r = n("172626");
function o(e) {
let {children: t, className: n} = e;
return (0,
l.jsx)(i.Text, {
color: "roleColor",
className: s()(r.title, n),
variant: "text-sm/medium",
children: t
})
}
}
that's a rough module to patch
okay so function o is called by a different function in a different module which uses o's properties here like: color and puts it through this switchmap
void 0 !== E)
switch (E) {
case "none":
t = void 0;
break;
case "always-white":
t = "white";
break;
case "roleColor":
t = Vencord.Plugins.plugins["RoleColorEverywhere"].getGuildChannelId();
break;
default:
var A;
t = null === (A = l.default.colors[_[E]]) || void 0 === A ? void 0 : A.css
}
i can't just edit this module tho because then it'll change all the colors that use it to the roleColor. so do i have to target the one above?
I have a feeling this isnt supposed to look like that
why not use css for this?
Perhaps because with css there is no way to get the role color
you don't becsuse this is a super generic text component
xy problem
^ yup
I acknowledged that above, but there's no other module that gets called for the rendering of this text component
It's just the two i discussed
I can't pick another one without no longer influencing the right piece of text
what are you trying to do
Hello, ive been trying to display a message in a modal but ive ran into a problem. Ive got the react component of message with const FindMessage = findComponentByCodeLazy("InlineEmbedMedia.useSetting()", "RenderEmbeds.useSetting()", ".useContextMenuMessage", ".MessageTypes.THREAD_STARTER_MESSAGE"); and i passed in the required field (image). But the problem is, this doesnt show the author's name and pfp if the message doesnt have a reply
it works if the message is a reply msg
if its not a reply msg, it doesnt show the author's name and pfp
I selected the component in the react components menu and went from there
It colors the bottom left modal name with your role color
But there seems to be only two functions that control this piece of text
nvm, i took a look at MessageLinkEmbeds and figured out another way to do this
oh wow
maybe you should think about shortening that name
you don't say?
glad i could help
You might need to set isGroupStart or similar to true
o and c are the two components that seem to make up the lower left hand modal
unless im missing others
hm
Oh yeah forgot about this I'm gonna look into P next time i have the energy
The parent of c and o
Those names are meaningless
Well it's mostly me talking to myself. And I'm not on my computer so I can't highlight what I'm talking about but it's all in the screenshot I sent (still meaningless) but that's what I'm referring to
how do u even sync with computer
is that windows only
i dont have it
look at findStore("ThemeStore")
should have all you need
also what are you even trying to do like whats the bigger picture
oh wait im blind... how did i miss this
the first time i installed arch i spent like 2 hours trying to figure out how to change the system prefered default
oops wrong channel
sorries
only shows while the decoration is equipped
well they are prob gonna remove that eventually sooo
also i was gonna add more items
well
I would call it DiscordMMORPG
you can make and share lootboxes to earn silly badges or something idk
true
it would
1: people would farm them
2: makes vee bankrupt
ugh i actually have to make an api and database for this
maybe a badge for how many stupid lootboxes someone has opened would be a fun idea
oh
but also
botting
i'll rate limit it
luckily i should be able to host all of this for free with vercel and supabase
but if it gets enough traffic then i will have to do something about it
prob will make a different account on both cause i have stuff that i don't want to stop working
should i just make the whole thing a big modal
i dont want to put it in settings
also what should the money be
and what should the boxes be
Geo 
yes
you should have to do something in discord to get the free one
like what
at that point might as well turn the ddr easter egg in the keybinds menu into a proper game
stupid question: i'm trying to use preSendListener to check when you send a reply, but i'm having trouble figuring out how to get the message type from it (which i believe should be 19 for replies?). i originally thought it would be somewhere in MessageExtra but i dont see it there. is it there at all or am i just missing something
if it isnt there, what should i use instead
you can use the extra.replyOptions instead, I believe that message type is only returned from the API and not something provided by the client
makes sense, thank you :>
that worked :D
this is the plugin im tryin to make
How can i get the most frequently used custom emojis?
there's a frecency store
How can i actually find store names? i've never really done much with them yet
the badge and the decor will be gone on April 8th. Source: Avatar Decorations Support Article
Wait they're not permanent? Thought Vee said it was
This?
false
Discord devtools, not chrome devtools
Oh i'm stupid
the badge is going away after 8th, the decor isnt
I read something different here: https://support.discord.com/hc/en-us/articles/13410113109911-Avatar-Decorations#:~:text=From April 1,10%3A00am PT
[...] a limited-time avatar decoration [...]
In top right corner, under the bug icon
yes. limited time as in you can only get it for a limited time
it's staying permanently
hmmmmmmm
trust me
"badge that will be available until April 8, 2024 (10:00am PT) and a limited-time avatar decoration."
available
just trust me :p
A risky prospect
But for something as inconsequential as this I'm willing to take the gamble
naaah this guy's a simp
Top right corner of what 
Next to vencord toolbox and all that
@Triis_0007 The badge is temporary! But the clown is forever :)
@cutewagging You can keep the clown! It'll be a permanent decoration. You can only get it for a limited time however, the loot box isn't sticking around for long.
Am i blind
enable experiments plugin, is staff option on it and devtools in developer options in discord (next to experiments)
WOOO it works
Are the devools safe? or can i fuck things but because this does NOT seem like normal client behaviour
yes
try it
it will override the avatar decoration data asset with an B64 encoded string of the image
I don't but i'm gonna fuck around and find out
oh, I don't use twitter myself, so I didn't know
thanks
I alr found out
nothin' happens
craze
ok so i found it in the devtools store list, how can i get it's content now?
I already did but i can't really tell how i can get data from this
For stores, the interesting stuff is in the prototype
where did you find this?
Devtools > Design Toggles > Enable avatar decoration uploads

I see
im prayin they aint wrong 😭
what are the benefits, of a patch replace being a lambda function?



