#š§©-plugin-development
1 messages Ā· Page 72 of 1
src/webpack/webpack.ts: Lines 573-578
export function extractAndLoadChunksLazy(code: CodeFilter, matcher = DefaultExtractAndLoadChunksRegex) {
if (IS_REPORTER) lazyWebpackSearchHistory.push(["extractAndLoadChunks", [code, matcher]]);
return makeLazy(() => extractAndLoadChunks(code, matcher));
}
ah. thank you. I greatly appreciate it
That returns a function that loads the module
You then need to find the module like normal
noted
that's correct
you can use Discord own function for lazy modules for that
no need to use our own
okay I tried this
const requireCustomStatusModal = extractAndLoadChunksLazy(["this.renderCustomStatusInput()", ".CUSTOM_STATUS_MODAL,"]);
to get the modal of the custom status, but idk what's wrong here
it raises Uncaught Error: extractAndLoadChunks: Couldn't find chunk loading in module factory code.
that error been raised in devtools as I was testing if it works or not
you need to find the module that loads the lazy loaded module, not the lazy loaded one
why
i would never send bad code 
Cause it seems almost too stupid to actually work, but it does
new wip
neat
whats a regex patch and how is it different from a monkey patch?? how do i use it to make a plugin?? pls help n thank u
Regexes patch the code before the module is run, monkey patches replace functions after it's run
cool thanks
why are the messages that close? use the entire space you have, give it breathing room.. (suggestion ;3)
It's a proof of concept for now, it's not using chat spacing atm
other than that it looks great, vencord plugins are enabled in it too which is great
Alright ;p
Thanks though
I'd like to just use Discord's chat component but that just takes a channel id and handles loading the messages itself so I can't just give it a list of messages
is there a way to bypass cors for a little private userplugin im making?
Make the request in a native.ts file
@humble tulip hi! you seem knowledgable about making plugins. Could I bother you in DMs about simple questions because i'm new to making plugins ??? (beginner to vencord plugins, decent ish dev [py n some other stuff]) or can you link me some docs i can look at?
Ask here
There are plenty of people that could help you
Yeah tbh basically everyone here is more knowledgeable than me lol
???
lowkey wanna make a character count plugin similar to the BD one, just useful when you're writing a large annoucement or something similar
I setup everything and even built vencord, but i cant figure out how to get UI to show and also the counting itself....did fiddle around and was able to make the plugin settings thing work
the BD char-counter is horrible⦠prolly the best case of the devil bro memory hog/leak phenomenon
i know bd is a pile of steaming garbage, but it's a useful plugin if made correctly
and me a totally dumb person can probably make something better than BD
(let's hope)
And even if I don't sumbit it I'll probably have fun with the experience
bd isnt steaming garbage I actually somewhat enjoy it⦠itās just the people behind it (eg. devilbro that makes it that way)
hm
If you want some learning experience⦠then you need to start something small for example, the first plug-in I ever officially made that I could put my name on
https://github.com/KrstlSkll69/WriteUpperCase
@real sequoia I assume you're having issues with the patches
yes
To this day, I will never truly know how to make a patch
charcounter is a simple idea not gonna lie it's just telling you how many characters you have in your messagebar
manually editing the raw data 1 by 1 like in those hacker movies is easier
do you know what / have experience with webpack or other bundlers in that style
Patch Helper is good for visualising what it's actually doing
Being able to see the replaced code
Let's just say I use python/etc mostly if not always, webdev etc isn't my thing but im trying to get into it,
ok
so discords code is split up into modules
think of them like one file, in a whole project
each module has a number, but that number can change at any time
eg. updates?
yes
what patches do is they find a module by a string (or regex, but you shouldnt need that in 99% of cases)
then within that module they match parts of discors code
and then replace them?
and replace them with your string
few more things
you can use \i to match any javascript identifier
(think variable names)
How would I find a webpack?? I saw something similar in pins of this channel, but I couldn't make sense of it
replace is just an argument passed to string.replace
it can be a string or a function
do you have react dev tools enabled
make sure you have nodevtoolswanring, console janitor, console shortcuts, and react error decoder enabled
they're good to have while making plugins
thats already a webpack module
alright
hmm
@real sequoia each number: function entry here is a module
with the number being the module id
How can i ctl+f with new intl keys in devtools?
wdym exactly
runtimeHashMessageKey
(with console shortcuts)
Thank you 
i ended up doing it so often, i made a keyboard shortcut that hashes my clipboard š
btw are you trying to fix a find?
no, i just had no idea how can i find webpack module from #{intl:} thingy
you can also do this
if you search that it gives all the places it is used, excluding where it's defined
Thank you
does anyone know if flux events are syncronous eg waits for the first callback to finish before calling the next one
pretty sure they dont await
What is the rule about posting mirrors in an unofficial plugin post?
i got bored and made a mirror on git.gay and idk if you allowed to edit a post to add it there
mirror of what
I didnāt know if youāre allowed to use something other than github tho
I mean Nino does tho
vencord has its own mirror on codeburger
nin0 uses his own git
i really dont think it matters all that much
fair⦠plus git.gay is well trusted, and very reputable
werent they only source avilable untill forgejo changed their license
you can say that for a lot of forgejo instances thoā¦
@cedar olive Am i allowed too? 
ya
ok
wrong
almost all forgejo instances retained the MIT license, while gitgay inconsistently licensed under the OQL, which is a source available license, with contradicting statements from the maintainers on what was (not) licensed
but ever since forgejo v9 going gpl theyāve been forced to go gpl too 
good
they are serial yes
git.gay
its just a mirror so i have a backup somewhere⦠plus itās easier then just putting one on codeberg or somethingā¦
plus where else am I gonna put it⦠you gotta do some weird shit to put a mirror on codeberg, Nin0ās forgejo is down, git.lgbt is unstable rn, and Iām not about to host my own
what does that mean 
I think it means that they run in the order they were registered, waiting for each to finish before firing the next
well if its synchronous code that's obvious
you could check the dispatcher code too
but I'm prettyyyy sure it does not await asynchronous functions
it you look in console janitor there's one patch that targets something related to time
it's right where events are processed
just look if there's an await or .then 
Couldn't you just try dispatching a couple of events?
easier to look at the code
Ofc
Did I imply that it did?
that's what I understood from your question
Oh, oops
because else in no case that's possible
JavaScript is single threaded
it's always going to execute everything sync unless it's an async function or promise
I think I just worded myself wrongly 
post the original repo, not a mirror
both of them are there
more mirrors coming soon ā¢ļø
@swift delta
why are you pulling and building manually? use the built in updater
would this update the github repository?
it pulls from the github repo
this is a 2 week old commit
I want the latest patch
because one of the plugins i use is broke in canary, and fixed on the latest patch in the main branch
nothing?
this channel is for help with developing plugins, not for help with installing/updating dev builds
@cedar olive https://github.com/Vendicated/Vencord/blob/main/src/plugins/noScreensharePreview/index.ts this new "plugin" does not import the previous user preference of the same plugin (meaning that it shows as disabled for users that had it enabled)
it's probably a good idea to migrate the preference from the old plugin too (as it was done with the ShowAllRoles plugin)
personally I think it should just be deleted, no need to keep it around
IMO this causes confusion
ig
ideally the plugin should be deleted and users be advised with the @plugin announcements role about it
:p
^ that's why I suggested this
but honestly most people wont even notice
if enabled -> turm discord setting on -> disable itself
so the actual feature keeps working, and it's no longer done by the plugin
yes, but does it take the previous user preference into account?
by user preference I mean the plugin being enabled before this change
I believe it doesn't
it only migrates if its enabled yes
yes, but after the migration you can't tell if the user had it enabled previously
you can only tell if the stock discord setting is enabled or not
yeah
but that doesn't matter much
as the plugin will be deleted in a bit
we don't neee that info unless we wanna undo the migration
but no reason for it
so I think a better way to solve this problem is to keep this code to migrate to the new Discord setting but keep this plugin hidden somehow, so it doesn't cause confusion by being enabled/disabled
"why is this plugin disabled? I had it enabled before"
"what's the difference between having this plugin enabled and the stock Discord setting?"
yes, that's good, but we have to take into account the people that didn't yet
for the people that have already updated we don't have to worry anymore
so for the people that didn't we can make the plugin hidden but still keep the code
and it solves my initial problem
:)
I understand it can be confusing for people enabling the plugin now
That's what we all keep saying
what flux event would i use to get when the user sets their status
got it from user settings proto update, but how would i set the status?
not selfbotting, making a plugin to sync status between platforms
await findByCode(".USER_STATUS_UPDATED,")("idle")
not that one, give me a sec
right now i have ts FluxDispatcher.dispatch({ local: true, partial: true, type: "USER_SETTINGS_PROTO_UPDATE", settings: { status: { customStatus: status ? { text: status, emojiId: settings.store.emojiId === "" ? null : settings.store.emojiId, emojiName: settings.store.emojiName === "" ? null : settings.store.emojiName, } : undefined, } } });
but its untested
findByCode(".DONT_CLEAR?")(text, emoji, clearAfter /* see findByProps("DONT_CLEAR")*/, status)
is emoji an id?
an object
np
why not extnd message logger functionality to storage to sqlite database? or is it denied request?
i see the pinned thing for finding the patch for joining VC, but how would i find something like reacting to a DM?
whats the end goal
the goal is to have like a visual timer that resets when i get a dm
not self-botting
@dull magnet shouldn't the ThemeAttributes plugin be enabled by default (or even be required)? I don't see any possible downsides for having it enabled
because some themes and CSS snipets require it I think it would be good to be enabled by default or transformed into a required plugin
no
use a flux event to run code whenever you get a message
flux event?
discords event system
oh cool
theres prob some event for a direct message
so would that go in le event() member?
from what I understood you want to have a global timer which would be rendered as a visual component somewhere
and you want that timer to reset every time you receive a message from a specific person
correct?
yea pretty much
flux prob of your plugin object
i see, it's just defined as any
example:
yay
ngl there are multiple ways you could do this
hold on let me think

okay
simplest way would be to:
have a top level variable to store last time you received a message from them
listen for MESSAGE_CREATE using the flux event listeners as pointed above, if it's the right person and channel update the time
make a react component with a forceUpdater, and after updating the time variable, call the force update
and then just make your component calculate the time elapsed using the last time, and write a patch to render it where you want
you could also make it use a custom store, which is the right way, but that would be more complicated and probably overkill for this simple case
wat is an optimistic
hm the types included don't seem to match djs types
how would i get a channel from a message?
inspect it
Vencord.Webpack.Common.FluxDispatcher.subscribe("MESSAGE_CREATE", e => console.log(e))
also yeah djs types match api types
discord client has it's own internal structures

ok the full event had a guild id i can nullcheck to determine if it's a dm, but now i need to differentiate between 1 on 1 dms and group chats
harcode the channel id check
i could but surely i can get a channel object somehow
but why do you need it?
then how are you gonna differentiate the dm user after?
as in, know which person that channel belongs to
nop
yea so i just don't really wanna hardcode two things for one function
bcuz that's LAME

store that in your plugin object to not have to get everytime
(the dm channel id)
and then you only have to hardcode the user id
compare message.author.id and message.channelId
cleaner way: make a custom flux store
and use useStateFromStores
I said it
oh no
it's really not complicated
and for that you gotta use proxyLazy and other stuff to actually get a flux store to work
wait how do i get my stuff into the flux functions
(sure it's the right way, but it's not that much cleaner either)
need more boilerplate for the custom store
const MyStore = proxyLazy(() => {
let whatever = whatever;
class WhateverStore extends Flux.Store {
getWhatever() {
return whatever;
}
}
return new WhateverStore(FluxDispatcher, {
SOME_EVENT(data) {
whatever = whateverNewThing;
}
});
});
function Component() {
const whatever = useStateFromStores([MyStore], () => MyStore.getWhatever());
}
it's pretty clean

MemberCount.tsx: Lines 24-27
let onlineCount = useStateFromStores(
[OnlineMemberCountStore],
() => OnlineMemberCountStore.getCount(guildId)
);
MemberCount.tsx: Lines 47-49
useEffect(() => {
OnlineMemberCountStore.ensureCount(guildId);
}, [guildId]);
compared to
let time;
let forceUpdate;
function Component() {
forceUpdate = useForceUpdater();
return <div>{time}</div>
}
export default definePlugin({
...
flux: {
MESSAGE_CREATE() {
if (...) return;
time = something;
forceUpdate?.();
}
}
})
really not much difference
but yes extending FluxStore is the correct way
maintainability also plays a huge role
the forceUpdate approach quickly becomes a mess when you wanna add more data / logic
im not trying to make an official plugin, just a toy for personal use
they arent gonna add much probably
that's why I suggested the simpler way which had less things to learn about
useStateFromStores, FluxStore, proxyLazy...
but anyways they can choose whay they feel more confortable with now
yeh
ohh right react is coming back to me, you have to tell it when you wanna update stuff lol
which approach are you using
that's the point of useForceUpdater and useStateFromStores
macro-ish syntax
since discord now hashes the keys of localization messages, that macro lets you write finds and matches using the non hash key and later it gets turned into the hashed version
oki so what's the difference between find and match?
what if i just want to like... append to the end of the find
find -> unique string that only the module you want to patch has
match -> the regex to match the code to modify
replace -> the replacement code
probably js noob question but how wide is a "module"?
and does that mean i can just use the same thing in find and match?
discords code is split up into modules
think of them like one file, in a whole project
each module has a number, but that number can change at any time
ohh wait do you just mean the big long js file that its in?
that big file web-somehash.js has a bunch of modules
oh
oh, huh
i see
do the silly one letter variable names stay the same between updates?
yes and no
but you should not use them in your patches
you can use \i to match any javascript identifier
and if you're having an issue with a find or match, let me know and i can try and help
use a capturing group
aw man
the replacement is just what is passed to String.replace
\i isn't real regex and is just something that gets replaced with some real regex internally
don't remember what exactly it gets replaced with though
const canonSource = partialCanon.replaceAll("\\i", String.raw`(?:[A-Za-z_$][\w$]*)`);
ah nice
how do i capture a variable outside the scope of my match? i could just put o in but ofc icky
or i could use a massive match
is there a better way?
send module
like the whole thing or
oh lemme find it
(normally 6 digits)
if you have a match, run wpexs(<your find>) and double click the result
838440
what do you want patch here
changing the slowmode condition null != v.getGuildId() && T && l.Z.getSlowmodeCooldownGuess(v.id) > 0 to append my function after it
so like null != v.getGuildId() && T && l.Z.getSlowmodeCooldownGuess(v.id) > 0 || myFunction()
one moment
wanna get v (channel) into my function
oh wait im stupid lmao
v is right there
tunnel visioned
still useful info tho so if there's a better solution to that general problem that would be cool
{
find: "\"Message Too Long Alert\"",
replacement: {
match: /({if\()(null!=(\i).{0,100}>0)/,
replace: "$1($2)||$self.myFunc($3)"
}
}
@hardy adder that should work
if you still want to know a way:
lookbehind after the match
/someMatch(?<=channel:(\i).+?)/
I found that trick while working with vencord lol
extremely useful for capturing stuff without matching and does not impact performance
sorry about the ping but it seems this is only loaded once the status changer opens, is there anything else i can use?
ah, you can require it your code so that it is loaded
copy paste into your plugin
oki
also remember to add UserSettingsAPI dependency now
oki
thanks!! had to make a few changes to allow passing undefined as text and null as expiresAt but it works!
of course!
that implementation was a 1x1 copy from the discord one, but you can always change it to how you want
Hey hey! Im curious about the best way of retrieving the users display name if we are in a DM. Im not currently sure how to do that so i just did getCurrentChannel()?.rawRecipients[0].username for their name and
parsed MultiAccountStore from localstorage to get mine. I am fairly new to this so im curious if theres any api for getting the recipients display name as well as my own.
The package used for typing those types is outdated
Inspect it in console and the prop you want should be there
im using generic typings for them. Are the username props viable? Does discord randomize class names like other sites orrr
It shouldn't be
On mobile rn
Send code and I'll take a look at in a voty
Bit*
Voty 
Ahh i feel like pulling from the html isnt the best practice
Is there a func that takes a user ID and returns their object?
Nope
Use patches
When i finish a plugin, how can i share it with people so they can add it to vencord?
#š©-modmail to submit as a thrid party plugin or pr it
@hushed loom As I mentioned previously, I need the function that sends the package containing the video and audio of a transmission, is there any documentation about Discord modules or something like that?
the petpet plugin uploads files
It doesn't immediately send it though
I'm not involved in your plugin i know but i dont really understand what this means? What exactly are you trying to do?
Documentation is mostly other plugins
I'll explain the idea behind the plugin and where I need help. I'm creating a plugin that amplifies the sound of the payloads sent to the Discord server during a stream. The reason for this is a bug that I and some other people are facing. When streaming, the sound becomes extremely low, and we have to increase all the computer's audio levels just so people can hear the minimum. The solution is simple to implement; my main problem right now is that this is my first time interacting with Discord. I don't understand how the modules work or if there is any unofficial documentation created by the community for these modules. Regardless of whether such documentation exists, my first approach was to backtrace the logs sent when the stream starts. I found several error handlers and event listeners but not what I was looking for: the function that captures these packets or the function that sends them to Discord's server. Either of these would allow me to create a hook to amplify the payload. Where I need help is understanding the best way to find these functions or if someone has already found them and can tell me where they are or how to locate them
I'm sure if you've got this far then you've looked into this already but just in case, you've turned attenuation off in voice settings, right?
Also I could be wrong but I think the audio streaming is done in native code
that is highly out of scope for a vencord plugin
it would be eaiser to do this via another program
The problem is when I'm streaming
@vocal ether are you on discord desktop, vesktop or browser
The function that sends the packets of a transmission to the server is not in Discord desktop?
Desktop
not that, its just that why do it as a plugin when it can be done as a dekstop app
however if you want a place to start, id take a look at vesktop
vesktop has a feature where it has its own implimentation of screensharing
via a native module
so look at what it patches
Ok, this is extremely helpful
One question, what is the best way to locate functions?
enable react dev tools
then use the view source button in the top left of selected components in the components page
how can I get the last two messages from a channel with the channel id? like that preview channel plugin
Got it, thanks for the help
MessageStore.getMessages("channelId").toArray().reverse().slice(0,2)
not sure how that will interact with message logger
if you care about that
I don't use it much. so that shouldn't be an issue
depends on if it's web based or not
A chrome extension might be able to do it
Isn't it almost the same thing as VolumeBooster
holy https://discord.com/channels/1015060230222131221/1256395889354997771 is mad dead rn
Id love to upload mine but i just cant get an icon for it lmao
the chatbar icon i found wont work

heckin pizza slice
works well with The Fridgeā¢ļø
haha
is there any better way to test plugins? Im having to run pnpm build and then inject to test it
maybe a "live update" thing (no clue if thats a thing)
are you trying to use an svg as an icon?
yes
send code
sure
const ChatBarIcon: ChatBarButton = ({ isMainChat }) => {
if (!isMainChat) return null;
return (
<ChatBarButton
tooltip="Use QuickSnip"
onClick={() => {
const key = openModal(props => (
<SnippetModal
rootProps={props}
close={() => closeModal(key)}
/>
));
}}
buttonProps={{ "aria-haspopup": "dialog" }}
>
<svg
fill="#000000"
version="1.1"
id="quickSnip"
width="24"
height="24"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<g
id="g3"
fill="#aeaeae"
fillOpacity="1"
transform="translate(-0.0005,-29.198)"
>
<g id="g2" fill="#aeaeae" fillOpacity="1">
<path
d="M 28.715,215.714 C 12.883,215.714 0,202.833 0,187.005 V 57.91 C 0,42.076 12.883,29.198 28.715,29.198 h 220.147 c 15.829,0 28.715,12.877 28.715,28.712 V 76.588 H 88.15 c -22.614,0 -41.006,18.399 -41.006,41.016 v 98.11 z"
id="path1"
fill="#aeaeae"
fillOpacity="1"
/>
<path
d="m 337.013,246.692 c 0,15.834 -12.874,28.715 -28.703,28.715 h -14.705 c -3.394,0 -6.149,2.75 -6.149,6.148 v 26.26 l -25.58,-30.229 c -1.171,-1.387 -2.889,-2.18 -4.689,-2.18 H 88.15 c -15.826,0 -28.708,-12.881 -28.708,-28.715 v -18.682 -12.297 -98.11 c 0,-15.829 12.883,-28.718 28.708,-28.718 h 189.427 12.298 18.435 c 15.829,0 28.703,12.89 28.703,28.718 z"
id="path2"
fill="#aeaeae"
fillOpacity="1"
/>
</g>
</g>
</svg>
</ChatBarButton>
);
};
thats the icon
do you want the entire plugin code?
You don't need to inject every time
Just build and reload
Nah, give me a moment
ty 
You can also use pnpm watch which will automatically rebuild whenever you make a change but you'll still need to reload discord to apply
It's just ctrl + r
im stupid lol
Same tbf
Its been one of those days so far 
do you want the raw svg file too or nah
yea
I think you just need to put viewBox="0 0 337.01199 278.617" back to how it was
yea
view box doesnt change how its scaled
afaik it just says what the size to reference when scaling is
yeah
@burnt ermine also change all mentions of #aeaeae to currentColor
that way it has the color based off the users themes
ohhh bet ok
whatre the classes for primary color and accent color i need to update my colors and stylings
is there a sheet/convention for it?
you dont need to style the charbaricon
no not for the icon for the ui in my plugin
š
can i get what you did for this icon?
already deleted it
but change view box to viewBox="0 0 337.01199 278.617"
for the svg tag
bet ty
heyy, i have a small question, i am starting to try to dev some vencord plugins and i just wanna beggin with some basics things, i opened the "noF1" plugin and the plugin is simple to understand BUT where i have to find this on discord:
{
find: ',"f1"],comboKeysBindGlobal:',
replacement: {
match: ',"f1"],comboKeysBindGlobal:',
replace: "],comboKeysBindGlobal:",
},
},
in devtools
ctrl shift i, ctrl shirt f, type something, enter
im just about ready to submit my plugin as a pr. Any thoughts on the styling? (I've never touched frontend let alone react in my life lmao)
i love that style !
ty
I wanna try something, I have 6 accounts and can only switch to 5 (max), I tried something like that:
{
find: "maxNumAccounts: g.$H",
replacement: {
match: "maxNumAccounts: g.$H",
replace: "maxNumAccounts: 6"
}
}
I don't wanna the answer or something like that, i wanna learn how to do this type of things
for that, I searched "you can only add" and find [2, "maxNumAccounts"] so i searched maxNumAccounts and found the match, I don't thing that's correct š¦
so alt manager?
The code you see in dev tools is formatted but in the actual code basically all unnecessary whitespace is removed, so things like "maxNumAccounts: g.$H" are actually "maxNumAccounts:g.$H"
oh so if there's space in dev tools i have to remove it ?
Yeah
Newlines too
Also for the variables g.$H you should use the regex \i.\i to match as they'll likely change in updates
and if there's that, for the find i put switch-accounts-modal, the match i can put let i = 5 ?
or I can't touched any let ?
Yeah but you'd wanna do let \i=5
So remove the spaces and use the regex special char for the variable in case it changes
But the space between let and i is obviously necessary for the let keyword
ok tysm
What does pring a plugin look like? Is there any specific way i should be doing this or just pr in the plugin in its folder?
Check the first pin in this channel
You'll wanna put the plugin in the main plugins folder in the new fork
If you currently have it in userplugins
hey, I am so sorry that i am bad with that but I have another question, It didn't work so I don't think the find is correct. How can I find the find and match for my case (I don't want the code/answer, i wanna learn so sorry š„²)
Can you show the patch you used? switch-accounts-modal should be a good find
{
find: "switch-accounts-modal",
replacement: {
match: "let \i=5",
replace: "let \i=6"
}
}
maybe i have to take more things ?
I don't know if the let i = 5 is really for the Account Switcher
I found the number 5 just above and for me it was obvious that it was linked to the switcher
btw, there's a little { } icon in bottom left when viewing the file that toggles the auto formatting so you can press that if you want to see the raw js without formatting that the regex is used on
That i is the g.$H you referenced in your other patch so it is linked but there may be more to it than just that int
Also your match should be a regex string, this only works by coincidence because the variable is actually i
So you'd wanna do like (\i) and in your replace you can use the group you matched there in your replacement string like $1
ooh ty i didn't knew it
so i have to do let (\i)=$1 ?
if i understand it
No like
match: "let (\i)=5",
replace: "let $1=6"``` like if you were just using a regular regex replace
aaaok
This still doesn't work, how can I find out where the problem is coming from? According to the plugin, it's supposed to replace 5 with 6 but it always gives me the same error
and I noticed the text was related to this
so I was wondering if I should change that rather than the let i = 5
but maybe the let i is related to g.$H
It is, you see the function that returns i is called $H, that's what you were targeting here
Does the error say you can only add 5 accounts still?
yea
Also dumb question but did you enable your plugin?
Congrats 
So i just submitted a PR for my plugin that i made, do i need to do anything else or just leave it there? I see quite a few PRs and i have no clue if it'll get lost lol
Just wait, it will get looked at eventually.
Whoa I just realized pinned messages don't have any right click
Thanks I hate it
are you going to make FullSearchContext but for pins now? :)
i am too lazy to do so
seY
heyy ! I am working on a "Spoofer" plugin like that:
i tried something just for testing to emulate the ps5 client and it worked:
find: "os:e,browser:\"Discord Client\"",
match: "os:e,browser:\"Discord Client\"",
replace: "os:\"Windows\",browser:\"Discord Embedded\""
but now i wanna sync with the settings, i did an object with all the platforms:
so if i do infos[settings.store.plateforme] I'm supposed to get:
{ os: "Windows", browser: "Discord Embedded" }
but didn't get it and connected as the normal Client š¦
have you tried just console logging for debug the value of infos[settings.store.plateforme]
oh wait
i might be stupid but youre using the entire object settings.store.platforme to get infos
add these lines somewhere to log stuff
console.log(JSON.stringify(infos))
console.log(JSON.stringify(settings.store.platforme))
i have to place it where ?
in the function getData ?
or anywhere ?
i am trying outside every objects
okk
another dumb question but how to log them into the console ?
oh, just do console.log(value)
^
uhh look for console tab
hmmm im not sure
my real problem is "how can i see console"
bcs if I can see it, I can check it by myself
just putting some console.log until it works
Sure yeah i do have to go so im not sure
just know you probably are getting this error here
const infos = {
foo: { name: "foo", value: "foovalue" },
bar: { name: "bar", value: "bar1" }
}
const settings = {
store: {
platforme: [
{ label: "windows", value: "windows", default: true },
{ label: "Linux", value: "linux" },
]
}
}
console.log(infos[settings.store.platforme])
Type '({ label: string; value: string; default: boolean; } | { label: string; value: string; default?: undefined; })[]' cannot be used as an index type.
you cant get a value of infos with an array
ty
Would this cause any issues with Discord identifying the wrong platform for the features that are available in the client or is that just entirely seperate?
[LilC]: quick question. pnmp inject, is there a command line way to to auto select repair and the instillation path? Looking to speed up deployment for testing.
For the first time do pnpm build then pnpm inject and after the initial time just do pnpm watch and ctrl/cmd + R on discord each time you make a change to the plugin
awesome, thank you
of course! Helped me a crap ton when i first learned it haha
you litterly saved me days š
ok, next silly question. I have my plugin working and wish to test on another machine. Do I need everything in the dist folder or just the installer?
ah ha! batch file for the win š
Use git to push your changes to your repo
Then clone and use that repo
Why does this re-render x3?
openModal(props => {
{ console.log("Executed"); }
})
I have an async request in the modal (when a button is clicked) and it causes a 429 because of the 3 re-renders at the same time
it's normal for react components to re-render a lot of times
if you don't memo it, a simple on mouse hover will cause a re-render
but either way, memoing is not the solution
if you want code to execute only when the component is rendered for the first time, and not everytime it re-renders, use useEffect with an empty dependency list
hi, is it possible to get a file in the file section like this. https://media.nijhuissven.nl/XUZu7/YEvejAsE50.png
But it doenst upload to discord just showing up. And maybe using the upload animation
findByProps("getUploads").promptToUpload(File[], Channel, DraftType)
see more in src/plugins/petpet/index.ts
Thank you sooo much
But i already have the code in a useEffect depending on something
you can have another
wdym?
send code
useEffect(() => {
async function getMembersWithRole(guildId, roleId) {
setLoading(true);
try {
const { body } = await RestAPI.get({
url: Constants.Endpoints.GUILD_ROLE_MEMBER_IDS(guildId, roleId),
});
// const members = await GuildUtils.requestMembersById(guildId, body, !1);
setMembers(body);
console.log(body);
} catch (error) {
console.error("Error fetching members:", error);
} finally {
setLoading(false);
}
}
getMembersWithRole(guildId, roleId);
}, [roleId]);
useEffect(() => {
async function getMembersWithRole(guildId, roleId) {
setLoading(true);
try {
const { body } = await RestAPI.get({
url: Constants.Endpoints.GUILD_ROLE_MEMBER_IDS(guildId, roleId),
});
// const members = await GuildUtils.requestMembersById(guildId, body, !1);
setMembers(body);
console.log(body);
} catch (error) {
console.error("Error fetching members:", error);
} finally {
setLoading(false);
}
}
getMembersWithRole(guildId, roleId);
}, [roleId]);
useEffect(() => {
console.log("boop");
}, []);
you can have another 
But i mean the console.log() was just for debugging, the code that shouldn't repeat is the one in the useEffect
what is the issue then
for some reason, even if roleId doesnt seem to change, it will still rerender it, and do the request 3x
resulting in a 429
thats a rate limit
yes, so i want it to not rerender to not ratelimit
i don't think it has what i need
if that isnt what you need, what do you need
How do you import these commands in the console?
doesn't this just get roles from members online for big servers?
I need to be able to get every member from each role(if it has less than 100 members) which this request allows
thats gonna be really useful, thx
Sooo i tried afew things and it didnt work i wanna have if you click on a button(preview in the images) and when you select a file it will be showing up like you uploaded a file to discord but it will be uploaded to the server.
not sure
checkout https://discord.sex for the endpoint details
and dig around in the javascript for how the store is implimented
Youāve found the Unofficial Discord User API Documentation! These pages are dedicated to showing you all the ways that you can use Discord to make cool stuff. It is not an official source of informati...
Anyways I think I might've found a workaround:
Saving an array with all the data I need, and when I need the data, I check if the data is already in the array, else I make the function to get it
@kindred perch it seems to work for offline users
not sure if you can do much more without having permissions in said server
I'll check it's limits better then tmrw, I gotta go sleep now tho
So this part of the code await GuildUtils.requestMembersById(guildId, body, !1); (GuildUtils is from findByProps) will load all of the inputted member IDs in guildMemberStore, and adding all (up to 100) of the member IDs not in it
?remindme 12h fix
Alright @flint bronze, in 12 hours: fix
@flint bronze, <t:1734612960:R>: fix
How do i get the name of a user?
i have a list of members from GuildMemberStore.getMembers(), but it only includes a nick, and no names
fall back to UserStore
look at how TypingIndicator does it
you can probably keep using the nick property directly
if the members are cached within guildstore, are they cached in userstore?
yes..?
thanks
How can i make it so the modal appears like clicking @mentions/user name on messages?
heres my code so far
function openServerProfile(props: ModalProps, userId: string, guildId: string) {
openModal(props =>
<div className={styles.accountProfilePopoutWrapper}>
<UserProfile {...props} userId={userId} guildId={guildId} />
</div>
);
}
use a Popup instead of modal
@hoary pilot @median flare tysm
np
i come across with another problem
discord is open with devcompanion on but that appears
try the reconnect button
Couldn't find a plugin with that name, and there are no plugins with similar names.
Adds a button next to the inbox button in the channel header that houses Vencord quick actions
Vee, AutumnVN
indeed
would you set me on fire if im getting help from chatgpt / copilot and still cant fix 2 errors (i only have basic knowledge in coding but i just NEED to get this one done)
chatgpt knows nothing about vencord/discord modification
ggs..
v- programming
does anyone know how to make a context menu on emotes

like how Clone Emoji shows up on Emotes and Stickers only
context menus can have properties
look at that
you want to check the favoriteableType property
index.tsx: Lines 317-323
const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => {
const { favoriteableId, itemHref, itemSrc, favoriteableType } = props ?? {};
if (!favoriteableId) return;
const menuItem = (() => {
switch (favoriteableType) {
index.tsx: Lines 369-372
contextMenus: {
"message": messageContextMenuPatch,
"expression-picker": expressionPickerPatch
}
should I make mod view tweaks plugin already
if yes; would it make sense to move https://github.com/Vendicated/Vencord/pull/2747 patch to it?
actually why not just depreciate that code in a different way by making it so you can open mod view for non-members
discord is insane for this
does anyone know how to make a user profile popout
I MISS THIS SO MUCH I SHOULD DO IT ALL AGAIN
Nuckyz would've had to have done that for the member profile in account panel plugin right?
I can't remember what it's called lol
This I mean
Ohhhhh yes
guh
while i was searching i can't tell if some user was using my plugin that isn't merged in yet or if it's a theme in support lol #š„-vencord-support-š„ message
WHAT IS THAT
if clan applications can do it so can mod view
(albeit, it pops open a modal)
look at account panel patch
and copy how discord does it
(or change the component to the guild profile if u need too)
i did find that
nice
the magic lmao
does anyone know if this is the proper way to use props in an error boundary fallback
{UserMentionComponent: ErrorBoundary.wrap((props: UserMentionComponentProps) => {
return <UserMentionComponent
// This seems to be constant
className="mention"
userId={props.id}
channelId={props.channelId}
/>;
}, {
fallback: props => {
let username: string | null = null;
try {
username = UserStore.getUser((props as any)?.children?.props?.id)?.username;
if (username == null) {
throw Error("Error getting fallback username");
}
} catch (e) {
console.error(e);
}
username ||= "Unknown User";
return <span style={{
color: "red",
}}>@{username}</span>;
}
}),}```
props.children is a ReactNode
it should work?
i know it does work
but is this the correct way to do it
is there any way to test out a plugin before submitting it?
wdym
tells you everything on how to setup a vencord clone ready for development
i know basics of javascript, other things i need to get started are mentioned here also? figured out
what is the purpose of the "find" in patches?
it finds the module that the regex will be used on
like the specific file?
kinda
discords code is split into modules
each number here coresponds to a module
yea
the find is a unique string
that matches the module to patch
it can be regex, but 99% of the time
it can be done with a string
ah that makes sense
i figured it out
it does something !!
how do i play with state and make calls to the discord api ?
doesnt discord have some kind of built in state management
should i just raw dog it and use fetch and useToken or does vencord have some builtin functions for that already
i would look around and see if there is already a function in discords code that you can use for what you want to do
there isnt i dotn think
the specific api call im trying to make is only supported on mobile
what are you trying to do?
it isnt implement on desktop at all
making a better quick search
using the same api that the mobile search uses
i did proxied my phone and took a look at the api calls
should be too hard to implement once i get a hang of how plugins are written
never use fetch
i assumed so
but most of the time you can use discords built-in stores and functions
what are you trying to do
^
is there already a plugin for that?
you also might want to take a look at https://discord.sex
Youāve found the Unofficial Discord User API Documentation! These pages are dedicated to showing you all the ways that you can use Discord to make cool stuff. It is not an official source of informati...
what state do you need to manage?
data fetching and also tracking a textinput
there is a onChange prop on TextInput but idk where i would store it lmao
you have plugin settings for things like that
can i store variables inside the definePlugin and access them via this or soemthing
yeah
the state probably wont need to persist
but noted
just use a variable or prop on your definePlugin object
got it
you should also know that if anything at the top-level of your plugin errors, all of vencord wont load
even if i use ErrorBoundary?
yes
i think you misunderstood top level
what did u mean by top level?
yes
do i have to write all the styles directly in a style prop or is there a library like tailwind or styled components or something
or atleast put the styles in a seperate css file
import "./styles.css"
nop but stock css is actually tolerable now
fair enough
you will enjoy :has
i need some kind of state management to trigger rerenders
bru
i could just do it in 1 big component
what is flux?
discords event system
look at how other plugins use flux
The documentation is unfortunately heavily unfinished and the only way to really learn is by looking at existing plugin code
yeah uh
how do i use vencord to send a message in current channel
ok nvm found it, theres a func for that under webpack
oik uhm
why is it sending empty messages
AHH
see how other plugins use it
yeah it took an hour I figured it out
I'll publish it tomorrow :3
just open pr and ticket right
fully automated ai chatbot
just fixing up some twerps and itll be done
it automagically replies to messages in ur current active tab if enabled
since u can set the default prompt its good for support staff and common problems ig but more or less jst a fun project i could see people using
So a selfbot?
that wont get accepted into vencord
not rlly
ill post it in my git anyway
jst a random fun project
In what way is an autoresponder not a selfbot
-# #rules
### Rule 11
Do not ask for, talk about, or use the following plugins:
- Stereo Mic
- FakeDeafen or other similar creepy plugins
- Animated Status
- Message Mass Delete
- Selfbots, Spammers, MassMentions, NitroSnipers or similar
aaanyway
So? Breaking vencord rules in vencord chat is still not allowed
anyone have any idea of how this code is an invalid hook call?
OutputVolumeComponent() {
const [outputVolume, setOutputVolume] = useState(findByProps("getOutputVolume").getOutputVolume());
return (
<div style={{ marginTop: "10px" }}>
<Slider maxValue={200} minValue={0} initialValue={outputVolume} />
</div>
);
}
As long as OutputVolueComponent is indeed used as a component that looks fine
Though you should move that findByProps to a findByPropsLazy on the top scope
doesnt look like one
If you call OutputVolumeComponent as a function you're doing it wrong
but do what @vast karma said and move the findByProps to top-level
i am calling as a component
show code
guhh
how do i not call it as a function
isn't this the only way to inject a component?
renderOutputVolumeComponent() { return <OutputVolumeComponent />; }
react moment
guhh i never reacted
oh btw is there a func to return slowmode time
getSlowmodeCooldownGuess might be what you're looking for
ChannelStore.getChannel("channel id here").rateLimitPerUser_
<3 ty
does anyone have an idea of what can be used to make the Slider component (in @webpack/common) use a different max value in the tooltip
like this slider has it at 200 max
uh isn't that done for user vc volume thing
yeah
they use the same component last i checked
maxValue prop I think
can't you look at how that does it then
its set to 200
and yes the max value is 200
still shows 100% on 200 tho
inspect the props
true
why didn't i think of that 
turns out it was
onValueRender={v => `${v.toFixed(0)}%`}
Whatre the chances a plugin i made a couple weeks ago gets accepted in?
what is the plugin
idk, no harm in trying
but personally id make it as an addition to message tags
oh
its already a pr
idk wait
i have some from a few months ago
I can always update it, im def gonna add more message tags later
wdym have some from a few months ago?
i think that was brought up but in my opinion having a chat icon is better then having to type a slash command
*i might be horribly wrong
*
ohhhh boy
thats quite a few
No worries if you cant get to mine i respect your time 
how do I remove my settings for a specific plugin? im trying to make sure the default values work right. I removed it from settings.json and restarted but it still has my modified settings
ah I just had to fully shut discord down
can the get_ functions from stores error ever or do they just return nothing if nothing was found
nothing
nice
i am making the most horrid plugin
proud of you
idk if this will even work
can I use a sc of your message for my pr :)
of course
thankies
is there a way to load .wav files
i currently have it where i modified build.mjs to add load .wav via the file loader
but its not playing audio
anyone know what dictates if a replied to message shows the @ before the user's name cause it seems random to me
ping on or off
You can turn pings off ^
yeah just found out. thats crazy
yup
Hiya! Does anyone know how to access the Quick Switcher query and modify the results? Thanks!
Also how do I make the React DevTools show up, I only get the normal DevTools
it's in settings > vencord tab
yeah
I enabled it
but it doesn't show up
like when I do Ctrl + Mayus + I it shows normal DevTools but not React DevTools
I think you need to restart discord
I did
you can drag them to reorder them too
so you dont have to go into that tab every time
What is profiler for? Every time i click it it just breaks everything.
profiles react if i had to guess
but afaik you need a devbuild of react
We should attempt to inject this
Iirc some of the react modules are duplicated
So keep that in mind when injecting it
Also make sure you don't break my Classify plugin
What does that do again, I forgot
Give proper names to (some) hashed classes
yep, it's not there
did you completely shut down discord
@dull magnet is this the proper way to use props in a fallback in an errorboundarry
cant find any other plugins that use props in an error boundary to compare with
are there any docs or an option where i could learn about vencord's webpack and involve in js snippet making?
wdym vencord's webpack?
things like these
Vencord.Util.openUserProfile("521819891141967883")
most of that is just looking at the code
how do i find them tho, discord's props and functions
you can find discords functions by just looking at the code
i know javascript
(discords code)
