#🧩-plugin-development
1 messages · Page 74 of 1
i like it where it is :(
Is there any way to set the z-index of a layerContainer containing a context menu?
Do I need to use :has
i tried
it is so bad for my use case
actually good
should this be marked as a dev build only plugin?
I intend to submit this in a PR (or put it in #1256395889354997771)
pr to console shortcuts
it's a patch
is that still alright?
done
worth adding myself to devs for this @cedar olive?
eh probably not
nobody else has
I finally updated ReorderAttachments to use react-dnd (as per #👾-core-development message), do you think this green border serves as a good enough hint as to where the attachment will drop?
I did mess with having a full size placeholder in place of where it'd drop but it was kinda jank and I don't wanna put a lot of work into it if this is good enough
No music today, you're safe
It feels like demonstration videos without music are a rare thing in here these days
I'll make it extra loud next time
I also had to add a small patch to make the attachment thumbnail not draggable otherwise it triggers the file drop again and adds it as a new attachment
hmm
i wonder if i should expand my name injection to other things
custom react hooks?
webpack modules?
horror
You deserve to be in there and so does @cedar olive then?
I didn't do that much
is there a way to know if someone has vencord or not? regardless custom badges
No
hmm i thought i could search for a prop through a store
UserStore or sum
You can tell whether the current user has vencord though
query the vencord user token database
Hello I want to dev a plugin (adds an icon next to users in voice chats and when clicked a command like .v add_owner @clickeduser will be tipped) but I need some help and guidance
Use a patch to add the button
minor change but big impact in vencord development imo deserved
as long as the color is customizable. as I want it to fit the dark theme
I'll move the styles to css so you can just quickcss over them
selfbotting 
(also looks slightly AI generated)
just a little bit
Either way this goes under rule 11 unless anybody wants to disagree with me you aren't really gonna get help with that here, you can look at other plugins but stuff that automatically sends messages and stuff is a no go
Nah im agreeing with you
I wanna add a button next to my user when i log in vc , I have this code who make a html code appear in a menu by using <Menu.MenuGroup> I don't know what to replace in order to have the button next to my user instead
- figure out where the element is rendered with react devtools. on the right pane u should see some user specific info, and youll know you’re close that way
- patch the module where this happens to add your own component
- enjoy
v- programming
you won’t get support for a selfbot.
slighty AI generated selfbot
Any guide on how I would add a button under Themes in Settings menu? Sorry I'm new to this whole patching thing
you cannot patch existing vencord code
vencord has apis to add to settings
but why do you even wanna do this
i wanna add a way to download thems directly inside discord
this already exists
It’s actually a very good implementation too. They’ve got a website and everything.
how to use storage not reset when dc restarts
To store multiple guildid, channeldid, etc...
how to install react devtools ?
enable them in vencord settings
await DataStore.get(key)
await DataStore.set(key, value)
your key should contain the plugin name in it
const { addFavoriteGIF, removeFavoriteGIF } = webpack.findByProps("addFavoriteGIF", "removeFavoriteGIF")
const { FrecencyUserSettingsActionCreators } = webpack.findByProps("FrecencyUserSettingsActionCreators")
const { GIFType } = webpack.findByProps("GIFType")
all of these modules are now gone, are there newer methods for adding and removing favorite gif and finding the gif type?
~~Ah it's something like this now
const FrecencyUserSettings = find(m => m.ProtoClass?.typeName.endsWith("FrecencyUserSettings"))
// get current favourite gifs
FrecencyUserSettings.getCurrentValue().favoriteGifs.gifs
// add favourite
const data = {
url: "https://tenor.com/view/wumpus-discord-repost-if-you-repost-gif-20674712",
src: "https://media.tenor.com/citg5i4shIwAAAPo/wumpus-discord.mp4",
format: 2,
height: 640,
width: 640,
}
FrecencyUserSettings.updateAsync("favoriteGifs", state => {
state.gifs[data.url] = {
...data,
order: Math.max(...Object.values(state.gifs).map(g => g.order)) + 1
}
}, 0)
```~~
Well this now
```js
const FrecencyUserSettings = window.Vencord?.Webpack.find((mod) => mod?.ProtoClass?.typeName?.endsWith("FrecencyUserSettings")) ?? null;
// getting current gifs
FrecencyUserSettings.getCurrentValue()?.favoriteGifs?.gifs ?? {}
// adding favorites
const data = {
url: 'https://tenor.com/view/wumpus-discord-repost-if-you-repost-gif-20674712',
src: 'https://media.tenor.com/citg5i4shIwAAAPo/wumpus-discord.mp4',
format: 2,
height: 640,
width: 640,
};
FrecencyUserSettings.updateAsync('favoriteGifs', (state) => {
state.gifs ??= {};
if (state.gifs[data.url]) return false;
const orders = Object.values(state.gifs).map((gif) => gif.order ?? 0);
const nextOrder = (orders.length ? Math.max(...orders) : 0) + 1;
state.gifs[data.url] = {
...data,
order: nextOrder,
};
return true;
}, 0);
even after enablin them I don't see it in the dev tools is that normal ? i even restarted discord but I see no change
It might be in the overflow menu in the dev tools tabs
I see it now, I think it doesnt activate instantly maybe download time or smt
I am not sure if this is what I should look for
const content = children.find(c => c?.props?.className?.includes('content_d80634'));
?
What are you doing dom manip for
probably idk
you can use the <> button in react devtools to open the module where this is rendered
and try patching it
Mirror?
i have been struck by Wayland security disease
You love windows returning that they are at 0,0 coordinates
I just want to make a dynamic custom window rounding thing (don't ask why)
Does anyone know how Discord Desktop uses https://www.electronjs.org/docs/latest/api/web-contents#contentssetwindowopenhandlerhandler
Render and control web pages.
this is openasar
no
OH
i totally missed this
i never looked at the modules
sorry for assuming this was the openasar patched version
this will help a lot
oh what is that?
awesome :)
oh
.
just tried them, they no longer work sadly
Trying to work on a plugin that puts unread forum posts first but it's such a pain in the ass to work with, I can't figure out how to get it to re-render the list when you click the option atm
Other than that it works nicely
lol nvm it's literally just a flux event
fire
i'm spamming your notifications testing a plugin aren't I
sorry about that
huh
was I not
i swear i tried that
calling stopPropgation on a onKeyDown event doesn't stop the onKeyPress event
stopImmediatePropagation might, I didn't try
guhhhh
ohh you meant reactions
i have those off
i think?
didnt get em at least

I need some help
Can someone guide me onto making a sticker right click action?
like how there's Clone Sticker
I want to do that but I don't know how
look at how clone sticker does it
ive tried
but its hella complex
and doesn't work
should be simple depending on what you want to do with the sticker
its just hard to setup the patch
like
i dont know what to do because theres 4 different things just to make it show up
xy issue, what is your end goal
get a functioning menu patch without having to do all of this
literally ported from EmoteClone because of its complexity
that's like super simple tho
it could have been way more complex without the API magic
i havent even been able to make it show up tho
i just want it to show up before adding anything else

is there ANY simpler way
no
the way sticker clone does it is how you do it
copy paste the file, change name
muh pixels


time to SKID!!!!! /j
yea why didnt i think of doing that lmao
hmn
return (
<Menu.MenuItem
id="bla"
key="bla"
label={"blah blah"}
action={() => {
const res = fetchData();
const data = { t: type, ...res } as Sticker;
const url = getUrl(data);
console.log("URL: " + url + "\n" + "Data: " + data);
Toasts.show({
message: "Placeholderr!",
type: Toasts.Type.SUCCESS,
id: Toasts.genId()
});
}
}
/>
);
}```
why doesnt this reutnr properly
Are you talking about the Data: [object Object]? If so it's just because of the "Data: " + data
Either replace the + with a , or stringify data
Oh I see the undefined in the url as well
fetchData is a promise...
dont promises stringify as [object Promise]
oh its being spread
im stupid
oooh yea i forgot about that
mhm
it shows up as undefined for some reason
even though daa is being passed
@stiff dragon add a breakpoint to your plguins code
(i have forgotten i can do that too many times)
(considering how often i use them in discords code)
Hello! I was working on my plugin earlier and restarted, and now it doesn't work. I can clone the main repo, build and patch from that fine but when I add in my plugin (in src/userplugins cause I'm testing for now), build, and patch, vencord does not appear to be patched. The discord launches no themes, no other plugins, even though it seems like it is active when ran via terminal
╰─❯ discord [Vencord] Starting up... [Vencord] Loading original Discord app.asar Discord 0.0.81 Starting app.
Tried reinstalling discord (pacman) + Vencord (provided bash script) but same issue.
Is there any ways to get more verbose logs, or am I doing something rlly stupid? Help appreciated :3
Yeah most likely, do you know if there'd be anything I can look at for logs to figure out what it is? or should i just delete stuff until it works
Well whats the contents of the plugin you added
crtl shift i
you need to look at that console
is there anything like addPreEditListener or addPreSendListener, but for directly after the message is sent? i need to access the id of the message sent by the user (which isn't in the MessageObject from addPreSendListener)
subscribe to MESSAGE_CREATE event, but yeah ^
auto-deleting messages after x time since they were sent - a channel can be flagged by the user to have autodeletion, and then whenever the user sends a message in that channel the message_id + channel is added to a queue of messages to be deleted after x time expires
insane
message_id seemed to me the easiest way to do this, so i dont think it's xy but idk
yeah just sub to MESSAGE_CREATE
thanks for the help!
index.ts: Line 100
async MESSAGE_CREATE({ optimistic, type, message, channelId }: IMessageCreate) {
example
🗿🗿🗿🗿🗿🗿🗿🗿
depends if you plan on sharing it to the public
i mean in the FOSS aspect it'd be nice
is it hard to get plugins accepted
main vencord yes most of the time, #1256395889354997771 depends
oop nvm then
when did errror boundry require a key prop?
Missing "key" prop for element in iterator eslint(react/jsx-key)
Google react keys
Hi, just wondering, is it possible at all to change the user bio? I've tried for a little bit, found out how to change a status, and can't quite figure it out
why do you want to do that?
I want to update a quote at the top of my bio every ~ time interval
can't help with that. that's self botting
oh :/
how can i use this loading icon?
see what typingindicator does
yes most of the time
not really, the main issue is getting a review but once thats done you solve issues and it gets merged
How can i use server profiles instead of user profiles in mentions
Parser.parse(`<@${x.id}>`)
RoleMembersModal.tsx: Line 32
{Parser.parse(`<@${member.userId}>`, true, { channelId, viewingChannelId: channelId })}
channelId being the channel id of the server you’d want the mention to be from
how can i do that from only the server id? or get a channel id from the server id?
yeah get server channels and take the first channel id you get
I've got an idea I'm not quite sure how I'd implement correctly. What I want is to "redirect" or perhaps "pool" some messages (which ones are to be decided by code) from multiple channels into the current one, but just client side. I need reactions and interactions to work as if it was the original message in the original channel, and to have them updated in real time. Basically, take messages sent from another channel and show them as if they had been sent in the current channel (excluding things like reply of course).
I could probably fake message events with the same data but with the channel changed to current, but I don't think that approach would have the messages "linked" how I want it.
How can I add a menu item for the context that doesn't have a navid?
what menu has no navId?
"account"
Actually, it used to have it, but after the update it's gone and I cannot add a button before "Edit Profile"
This one
thats not a context menu
Yeah, kinda, but it behaves kinda like it and previously I succeeded adding a button there via
addContextMenuPatch("account", children => { /* ... */ })
You might want to check out this plugin
vp account server
Couldn't find a plugin with that name, and there are no plugins with similar names.
vp accountserver
Couldn't find a plugin with that name, and there are no plugins with similar names.
Guhhhhhhhhhj
vp accountpanelserverprofile
Right click your account panel in the bottom left to view your profile in the current server
Nuckyz, Relitrix
that?
Yea
which is better for the ExpressionPickerTabsAPI. as I really want to allow customization of the tab name, other ideas are also welcome
||it's also valid if only the component been passed as it will use the plugin name as the tab name (in the work)||
I think first but maybe call it title instead of tab
object
also @fallen sandal clicker
First
Since it doesn't actually do the rendering, I think just expressionPickerTab would be better
And the object version is better, since it allows using an array for defining multiple tabs
that's actually a solid idea (I haven't thought of this)
good point
Could also do js expressionPicker: { Cookie: CookieClickerTabComponent, }
Though using localized strings as keys is a bit iffy
If the title could take a React element that could be cool too, you could add icons or badges up there or something
that made it easier to implement
Object form allows predicates and stuff too, so it's probably better
I think the original implementation allowed that
not sure about implementing predicates, when someone really wants it they could implement it or ask for an implementation
basically the idea is to allow it to grow when required
They could also just return null in their component based on whatever they want
But it would still be in the tab bar, no?
yeah that's true that if buttons are made as react elements
I guess it depends on how it's implemented, by which point it may as well have been a predicate lol
too complex?
seems fine I think
I'd just do a for loop rather than forEach but that's a nitpick
@cedar olive what's pluginKeysToBind and should I add expressionPickerTabs to the list?
yes
but no actually
expressionpickertabs is different
im not sure if types are gonna work well for it
for this case yes, for the others no
ts complains abt expressionPickerTabs
push your changes let me take a look at fixing the types
or better yet, do expressionPickerTab and expressionPickerTabs separately
the name is kinda misleading if it's a single function
pushed
fair point
can't it be treated as CommandsAPI and not be added to that list or that list is somewhat important?
VencordToolbox does it and it's not a problem there
(the api for VencordToolbox sucks for a different reason)
That there's precedent doesn't mean it's not iffy
My proposed solution:
Make both APIs array of objects with definitions
Add a render(): MenuItem | MenuGroup or similar to VencordToolbox
i have used context menu patches for toolbox more than once
i know its possible but its so ugly
genuinely have no idea where to ask this because there is not a js snippet development channel (probably for the best, that's decently niche) LOLLL
how would one make either a css or js snippet to make a very basic custom markdown rule
or something other than a snippet if need be but the simpler the better
i would like to maybe Not make a plugin but i will do it if i have to
i think you have to here
Damn
although you could probably look at something like https://discord.com/channels/1015060230222131221/1265070008074240181 for an example for how to do it
Funnily enough I actually did but it kinda went over my head
particularly the last part of index.tsx with the rule and stuff
Is there a way to make some kind of linked copy of messages from another channel into the current channel, such that reactions and interactions work seamlessly as if it was the original message shown in its own channel? I want to "pool" messages from multiple specific channels into the current one and be able to interact with them like mentioned.
you mighttt be able to insert messages into the cache of that channel, but I'm not sure if that's going to work completely out of the box
not only do I actually not know what's going on here ( I kind of do but like I also don't understand what the wiggly is in the replace )
edit: nvm
i also do not know how i'd make this compatible with the normal wigglytext plugin (i'm just forking wigglytext because it's simple enough and basically does exactly what i want in my plugin but i just want to apply different css (dont worry, i'm crediting))
because correct me if i'm wrong but wouldn't the two plugins conflict since they're replacing the same part of the same thing
@green cypress this did work to get the messages inside the channel but it didnt update in real time and reacting didnt work sadly
how would one include an asset, e.g. a ttf file with a plugin and then like use it
also this
I see
check the MarkdownAPI pr and KeywordHighlighter pr (and also Message Colors)
they all patch the markdown rules of discord
uhh yea i still am not quite sure how to get it to not break wigglytext
it would help if there were docs cuz i cannot find anything on the normal docs site
Well docs for what
because 90% of vencord development is poking around discord internals and writing regex
Fair enough
Okay but still lol I'm not sure how to get it to be compatible since they're both replacing the same part of the same function
?remindme 1h fix checkbox horror
Alright @flint bronze, in 1 hour: fix checkbox horror
i already fixed it
@flint bronze, <t:1738130902:R>: fix checkbox horror
henlo, made plugin: https://github.com/Vendicated/Vencord/pull/2994, it's working and mergable, but there's a lot more that can be added
mainly things i'm struggling with, aka global keybinds via chrome extensions [while adding said keybinds via extensions side is easy, how to make them execute the respective discord events discord normally has?, would also be nice to override the "hey no keybinds here, go desktop" UI], and unlocking screenshare resolution which is somehow somewhere forced to 720p30fps
I do not know how to make discord overlay tho, while you can do it easily via PiP and a fake video element with shit generated via canvases, and even if the video is transparent, PiP itself doesn't support transparency, so i think discord overlay idea is out the window
it's also untested on macos, since i'd rather kill myself than own an apple device, so it would be nice if some1 could check if the macos part works fine, but i dont see why it wouldnt
vesktop doesnt even support the overlay
it doesnt even try to fake it
cool, but unrelated, that doesnt stop me from trying
just patch the overlay client to use some other form of rpc 
it's totally possible with the extension popup, but once again, you cant have transparency for that
this is for web, aka extension
not vesktop
no
i mean overlay overlay
the thing that injects into games
and displays status icons on the top of the screen
yeah..?
then proceeds to get you anti-cheat banned
that overlay
this shit
anyways, it was just an idea
holy half decade old UI
i'm more intetested in unlocking screenshare
i think i've told you this in the past but
screenshare UI (and also now keybinds) should probably implemented in a way where web and vesktop can both use it somehow
that isnt possible
you know that
so instead of wrapping it around in "whatever", just say no, because it is NOT possible to do that
vesktop calls native, with previews, ids etc, web doesnt have that, and never will, so already there it's not possible
all you could do is a simple "resolution and fps" picker before calling the screenshare
which is already different from vesktop, which lets u pick windows, shows previews etc
just unify that part somehow? or do you think it's still a bad idea
so at this point, it's already not possible
its waaaaaaaaaaaaaaaay more effort than its worth, like the idea is sound, but its not possible
the 2 implementations are just way too different
no, vesktop will fall back to the native picker
could the UI be unified? or is that stupid
actually now that we've discussed it
also this is a plugin, which you enable, vesktop code runs on startuop
its also separate repos
so importing it across repos and enviorments will be pure cancer
it also means we'd need to introduce a new build ttarget to target: "discordDesktop" | "vencordDesktop" | "desktop" | "web" | "dev" aka | extension
because from what i understand web runs on vesktop too
the actual logic makes sense to keep entirely separate
i would ideally say UI should use shared code but if one side wants to add a new feature thats horror
keep doing it as its own thing and if you make a better UI then I would encourage porting it to Vesktop

i've thought about it, and nah its just a no-go
also idk how to navigate or patch discord's code
ever since goosemod died so did my will to navigate discord's code
its ass
i spent like 2h trying to figure out how to unresctrict the res and fps
and gave up\
wouldnt you implement that as checking for vesktop at runtime?
it wouldnt even be at runtime
like at that point 80% of the code should just be built into the extension by default, like notifications and the screenshare fixes
vencord build process does tree shaking
this is still a plugin
so it'd get built in anyways
from what i understand
and if i want to add extension only global keybinds, we'd still need an extension build target, to make sure vesktop people dont enable it
isnt the notifications thing just to enable it by default
tbh that wouldn't even be "global"
yeah, that'd require a separate plugin, which is for extension only, because vencord has its own notification implementation
my brain was thinking it would be faked the entire time
actually extension build target should exist IMO
you know how there are plugin natives
vencord could really do with extension natives
and web is imported on vesktop
see: screenshareFixes
and getPluginTarget doesnt support multiple targets
which means simply we'd need an "extension only" ver
or "chromium"
since that's twhat its called in the build process
but i feel like thats out of scope for this PR
and there's 0 reason to add this to firefox
because SURPRISE firefox supports none of this
vencord extension isnt even officially distributed for firefox due to some insane issue
yeah firefox extension submissions are unhinged
i'm surprised ven even considered publishing there
anyways, i dont know whats your level on the "I make big changes to vencord" ladder, so idk if you're the person to talk to about this
if you know who is, bring it up to them
idk
I make many plugins that get sent to my personal landfill.
wish i knew what that means no i dont
i will tell you what it means
I make a lot of plugins for my own use
Sometimes I contribute them upstream
If you want a serious answer about core Vencord APIs, ask @cedar olive or Vee
If you're looking for someone who does fixes and works on making a sane developer experience (unofficially), talk to @hushed loom
i never actually explained this
A lot of plugins use a native script to bypass CORS
bump, cuz dissapeared in message spam
well this is fun
hm, at least something works
any idea how i can obtain this? Vencord.Webpack.findByProps('TOGGLE_GO_LIVE_STREAMING') doesnt do the right thing
it yields a diff module
Is there any api/const in vencord that allows to get this classes directly or should i use my own find?
just findByProps
Well, the whole module just exports this, how can i find it?
findByProps
findByProps searchs modules exports, it takes more than one string, make it search till you find the correct module ez
none of the find functions can find this
which is insane to me
yeah, i already figured it out, was easier than i thought, thanks
that means it's not exported, or idk about this but I don't think the finds searches child objects so be aware of that
they probably don't
scroll up a tiny bit in that module until you see 223457: () => { }
chill
first of what you are trying to find is not even exported
then run wreq(thatId) to import the module and check the exports
how do you even know that?
however you can abuse the fact it is dispatching that object
wtf is discord doing lol
add a flux listener in your plugin, listen for KEYBINDS_REGISTER_GLOBAL_KEYBIND_ACTIONS and then obtain A from keybinds
most useful store
find store or register listener?
How awful is it to patch something that's not exported and wrap it in your own function to take a reference to it?
it really depends on the thing
if it's a variable with a small assignment, easy
if it's a function, you gotta match all the way after it's definition
I meant like from a general best practices point of view, not shitting on what you're trying to do
same with this object
do you want me to show you what I mean?
I did it once when I was fucking around with something but I found a better way in the end, didn't know how frowned upon it'd be though
i just have too many winddows open at this point and i'm struggling navigating to reload everything XD
function x(){} are the hardest to export
with variable definitions you can do like let a = $self.theObject = ...
iirc
yeah
pretty easy
we did that a bunch in the past since some things weren't exported
By awful I meant something you'd look at and go "HORROR", not like difficulty-wise
oh
not really horror
but it can be difficult sometimes
vee said pretty easy, but it really depends on what it is
for functions it's easy too, you can just change the code to
$self.thing = x;
function x() {
}
oh wait they are hoisted... right
some shit is rly hard to find with mangled code, especially their screenshare restrictions, i still have not found them :/
I had a patch that just wrapped something in $self.yoink() for SortForumsByUnread but I realised I didn't need it in the end so it's gone anyway
But good to know it's valid
index.tsx: Lines 98-109
// Fix member supplemental caching code and export cache object to use within the plugin code,
// there is no other way around it besides patching again
{
find: ".MEMBER_SAFETY_SUPPLEMENTAL(",
replacement: [
{
match: /(let (\i)={};)(function \i\(\i,\i\){return \i\+)(\i})/,
replace: (_, rest1, cache, rest2, rest3) => `${rest1}$self.setMemberSupplementalCache(${cache});${rest2}"-"+${rest3}`
}
]
}
],
their cache is so broken I had to manually set as unfetched before attempting to fetch
Nice
@dull magnet btw you havent really answered but are you fine with a required plugin that fixes issues
https://github.com/Vendicated/Vencord/blob/discord-fixes/src/plugins/_core/discordFixes
and makes some other things easier to use
making it a dependency would be so shit honestly
it does these for example
index.tsx: Lines 56-81
// Make username wrapper a div instead of a span, to align items to center easier with flex
{
find: '"Message Username"',
replacement: {
match: /"span"(?=,{id:)/,
replace: "$self.UsernameWrapper"
}
},
// Make MediaModal use the Discord media component instead of a simple "img" component,
// if any of height or width exists and is not 0. Default behavior is to only use the component if both exist.
{
find: "SCALE_DOWN:",
replacement: {
match: /!\(null==(\i)\|\|0===\i\|\|null==(\i)\|\|0===\i\)/,
replace: (_, width, height) => `!((null==${width}||0===${width})&&(null==${height}||0===${height}))`
}
},
// Make buttons show up for your own activities
{
find: ".party?(0",
all: true,
replacement: {
match: /\i\.id===\i\.id\?null:/,
replace: ""
}
},
welp this actually works now, actual peak
problem is gotta get rid of this somehow
i assume there's no a11y in ven?
react dev tools 
just english?
probably
or override it
with "go to chrome extension shortcuts for keybinds"
oh also, we need an "extension only" build target
woah
okay that's actually huge
its so fucking simple
you have no idea
and u can port it in like 10 seconds to vesktop if u care
since electron just lets u load extension code
configuring it via ui from vesktop will SUCK tho
if i find the component, how would i override it? findByProps('browserNotice_f916fc') didnt seem to work
question, should this be part of https://github.com/Vendicated/Vencord/pull/2994
or should it be another plugin
the answer is patches
daum
that sux
i get it doe
unfortunately out of time this day/week/month to finish this
https://github.com/Vendicated/Vencord/pull/2994/commits/25cd0946ca001999c032122ae7848a41c1362e64 keybinds idea itself is quite simple doe
If i wanted to proxy a prop, how would i go about doing that? I'm running into all kinda of recursion issues and maxing out the call stack
I have this setup but this just hits the call stack size limit
const moduleObj = findByPropsLazy(prop);
const originalProp = moduleObj[prop];
const safeContext = {
...moduleObj,
[prop]: originalProp
};
moduleObj[prop] = new Proxy(originalProp, {
apply(target, thisArg, argumentsList) {
console.log(prop, argumentsList);
return Reflect.apply(target, safeContext, argumentsList);
}
});
i tried this before:
const originalProp = findByPropsLazy(prop)[prop];
findByPropsLazy(prop)[prop] = new Proxy(originalProp, {
apply(target, thisArg, argumentsList) {
console.log(prop, argumentsList);
return Reflect.apply(target, thisArg, argumentsList);
}
});
same issue.
yippie
I didn't even know you could assign to findByProps ngl
Are you sure?
I mean that's an object
you are not really assigning to findByProps, you are assigning to the object it returns
Yeah that's what I meant I didn't know you could do
Bad wording
I assumed it just returned a copy
that would be very bad
That's why you wrote it and not me 
to make it cancelable
seems like you are basically trying to do monkey patching
patch it instead of doing monkey patching
does anyone know the patch for intercepting the message fetch request before it actually does it?
also how do i create a dm channel
pre send listener?
where can i find all the pre send listener types?
😭
and i'm trying to intercept the client fetching messages
i dont see a presendlistener for that
What did they fuck up now that I need to fix in my userplugins?
go in the requests tab of devtools and look down the fetch requests initiators until you see what you want
I do use a couple of things from the components module, yeah
cuz that's all mangled now you need to find without relying on the keys
So find all the things from the modules they're originally from rather than those reexports?
good point
and just stop relying on non mangled keys at a whole
Yeah
i want it to virtually create a dm channel on the client. how can i do that by emitting using fluxdispatcher. CHANNEL_CREATE seems to be the right type from intercepting legit ones
Convenient while it worked, but too volatile
if theres a network request in doing so, you can follow call trace too
that's how i concluded that CHANNEL_CREATE is the right event
but i wasnt sure what the error meant
e.isPrivate is not a function
use breakpoints to determine the error, stop it at the function, then see the value of all variables
including e.isPrivate
Is there any way to find patches that haven't found any matching module? Like reporter but local
thanks
I think you can just run with --reporter from command line
Might not be the right arg, I can't double check atm
nvm you build with the arg not run
It's kinda weird that the module ids are still stable despite all this
I was messing with those recently too, sucks ass
Working on making a search bar for the member list
oh good luck
dont think that possible
it's probably somewhat possible surely... no?
like partial member list search
very scuffed
That list is lazy loaded, which makes it pretty hard to deal with
Yeah that's why it was a pain
I once tried to make a plugin to strip away those silly ! prefixes and stuff before sorting it
Didn't work
It gets 25k rows deeper down but it was a bit of a mess to filter and I think it would've caused issues if I tested more
But I changed approaches and the new approach didn't work out so I'll be going back to that
But yeah I think it's gonna be next to impossible, we'll see
Did discord change so forwarding to the same channel is allowed now? Because my patch for that fails, but it works anyway
It's always been allowed, it just didn't show up in the picker until you typed the name
Or was very far down
It was explicitly filtered out from the picker at some point
im trying to make a plugin that modifies the member list, and its such a pain in the ass i might make it an api
Doesn't look like it's changed compared to the old tab I have, at least
Eh, if that plugin isn't needed, I'm not complaining
this took me wayyyyy too long
i can now remove entries and sections from the member list without having it go crazy
support helpers at the top like we should be
how can i store data over restarts without settings.store?
DataStore
any plugin that uses that?
just do a search over the codebase
or look at references
why tho?
what data do you want to use
most times you do not want datastore over settings
i need settings, but i need to have more control over it cuz rn the ui would really be a mess
more control?
so you want to store an arbitrary value in settings
like an object with your own props
and then make your own ui for it?
like place buttons better, more compact, not 1 line per setting
you can have settings with hide: true
or use OptionType.CUSTOM and store your own object with your settings
that should work, thx
Decided to just do it with the request members endpoint for now, I don't think using the store is feasible at all, as expected
Needs polish but it's okay
why not filter in the actual list
The lazy loading makes it a mess
I could probably fake it and just hide the actual member list while the search results are showing there instead
i have code for rendering whatever users and sections you want in the list
if thats what you need
I'll mess around with it more tomorrow, it's 4am and I have work in the morning 
alr
oh, also run vgh to get contrib role
average coding music
Where can i find checkboxes?
They're still not a common component.
findComponentByCodeLazy(".checkboxWrapperDisabled:") worked for me
what is a common component?
something you can import from @webpack/common
what's weird is that barely anything uses a checkbox, instead opting for a Switch
the Switch component used to be imported into @webpack/common for use in Vencord from the same module that had Checkbox
until a few days ago 
@cedar olive where is my token lagger
what did you do
gone :(
this is what the file for components used to look like https://github.com/Vendicated/Vencord/blob/43501bad07632b586950b5bddfb81e5823786ce9/src/webpack/common/components.ts
how does it work, tried that: <Checkbox checked={keybindSettings.enabled} onChange={keybindSettings.enabled = !keybindSettings.enabled} /> but it crashes for some reason
freezes and loops over react component code forever
This is how I typed it
export type Checkbox = ComponentType<PropsWithChildren<{
value: boolean;
onChange(value: boolean): void;
align?: string;
disabled?: boolean;
displayOnly?: boolean;
readOnly?: boolean;
reverse?: boolean;
shape?: string;
size?: number;
type?: string;
}>> & {
Aligns: Record<"CENTER" | "TOP", string>;
Shapes: Record<"BOX" | "ROUND" | "SMALL_BOX", string>;
Types: Record<"DEFAULT" | "INVERTED" | "GHOST" | "ROW", string>;
};```
how did you find that?
I looked in the design systems tab in settings
I think anyway, it's been a while lol
where did you find this settings menu?
I think you need to enable the experiments plugin
Give you the dev settings tabs too
does vencord have color utilities?
specifically for example read the value of var(--background-tertiary);
or do we need to do that manually via JS
what do you mean by that?
so discord sets --background-tertiary via JS most likely
its css
are the values it assignes availabe as utilities?
You'd have to do it manually I think, I did it in the past by just applying the css to an element and then taking the computed styles from it
yeah that sucks
cuz good luck trying to convert
color-mix(
in oklab,
hsl(222.85714285714283 6.666666666666663% calc(20.588235294117645% - 8.04%) / 1) 100%,
black 0%
)
into hex
XD
with getComputedStyle you can normalize it down to oklab(0.239616 -0.00015831 -0.00607598)
but that's still hell of math to do
idk much abt that, but wouldn't smth like that work?
.text:after {
content: color-mix(...)
}
WAIT THEY CHANGED IT
web manifest now accepts non-hex values
nvm dont worky
so its still a dumbed down version of color
man, patching components is impossible
well
at least this specific one
its as generic as it gets
its a generic notice element, which is parented in a generic title element which is parented in a generic root layout
you want to hide it i assume?
nah modify it
i think i'm, onto something tho
managed to find this, just gotta learn how the hell to override its children with my own thing
make a patch
yah ik
i'm learnding
trying to find some existing examples in vencords plugins
struglging bad doe
XD
Look further up where that ternary is and force it to true
what part
match the children and replace with yours
isnt that a very... violatile method?
nvm I didn't see you wanted to modify, not hide
wouldnt matching browserNotice and then replacing children in match be better?
yeah thats what i meant
yeah thats the part of "fuckin how"
regex
but i think the badges plugin has a good example
i mainly dont know how vencords patching engine works
like when u have find.... does it find the module, place in code?
its just regex, there isnt much more to it
find is the module
is the patches[].find the same as findByCode?
It finds the whole module and then you use the match/replace on the module's code
no, findbycode finds from exported
find is module.toString().match
ah so there's no runtime equiv for patches.find
also what is fullpatch in patchhelper?
You can use wp.search() in console if you have console shortcuts on
You enter this whole bit and it fills the inputs below for you
faster
Just a quick way to fill it in if you have an existing patch you need to change
lemme run 1 thing by you real quick, in replacement i can do $self.functionsThatReturnsJSX() and the plugin needs to be a .jsx, then i can simply write react in the plugin function?
it replaces the entire match case? or just the match group?
cuz idk if im readting this wrong
but it seems like it nuked the className too
The entire match, it's just a regular regex replace
So you can use groups and $1, $2 etc
ah makes more sense
theres \i which you can use for js identifiers instead of [A-z]+
You're definitely getting the hang of it
yeah its not bad, just fucking cancer, and slow
Cancer, famously not bad lol

man... the fact that this is what i'm doing with my day off
i doubt this plugin will even be accepted
this is way more effort than it was worth
but whatever
this can definitely be extended to mod the discord UI, to simply re-enable the desktop keybinds UI, then manage the keybinds via extension in discord's UI
but that seems insanely hard and way above me
nvm extensions dont have that permission
this is a good idea
What shortcuts should i add to my plugin?
yh
unfortunately its not possible, chrome extensions cant edit their own keybinds, nor create new ones, this has to be pre-defined in the manifest
sux
@grand haven did you know discord used to have an extension for screensharing
i know, i made multiple for many previous mods
last and best one i made was for goosemod
Contribute to ThaUnknown/GMPlugins development by creating an account on GitHub.
nor create new ones, this has to be pre-defined in the manifest
It requires native so it'll only work in the app but I have ctrl+shift+R as a hard reload, could be useful in a keybinds plugin
with a good framework which allows easy addition of new plugins and changing keybinds
that sucks
I guess you could technically make it open a new tab or something in web, I dunno how that works lol
just pre-define them all!
minor problem is that you cant have "PUSH TO X"
whats native?
because the shortcuts are only "on key down"
yes, this is the problem Vesktop devs are having
so no hold, repeat etc event
i usually do it by simply having a debounce
and holding a key sends the event like 20 times per second
a way of importing node.js code
but not here unfrotunately
😭
this is still way better than what we had b4 tho
definitely
You can use a native.ts file in your plugin folder to run code in the native process rather than the browser one
So I have this, and then it's used in the main plugin file like
const { fullRestart } = VencordNative.pluginHelpers.QualityOfLife as PluginNative<typeof import("./native")>;
const ctrlShiftRListener = e => {
if (e.ctrlKey && e.shiftKey && e.key === "R") {
fullRestart();
}
};```
It actually just needs app.relaunch(), I forgot to remove the path for my own thing for the screenshot
import { relaunch } from "@utils/native"; no need for a plugin native lol
Oh yeah, I forgot about that
@grand haven what are you working on?
discord as PWA via vencord
aka fixing all the bullshit discord for some reason doesnt implement
that would take them 5 seconds to
aka notifications on web, installability, platform native title bar, fixing auto-dark extensions
@humble tulip need ya help
can ya ping me on demand?
Sure
@grand haven
thanks
i think i covered everything
hm
gotta cut out 1 frame
part of phone number is visible
also the fact that the screen recorder i wrote works
is insane to me XD
"works" its fucking GREEN AS FUCK
can't cut it
D:
should i submit a plugin via #📩-modmail or just... leave it here?
if you leave it here, i dont think it will be seen by a lot of people
Yeah either PR it if you want it to be an official plugin or submit to modmail for #1256395889354997771
It'll disappear here quickly
can you make it an unofficial plugin while you wait for it to become official
Yeah a few of the plugins in there have PRs waiting as well
well then do both, cuz theres a pretty long wait for official plugins @grand haven
You'd need separate repos though as #1256395889354997771 just wants the plugin folder as the root whereas a PR would obviously need the whole vencord branch
Ofc
https://discord.com/channels/1015060230222131221/1271080235114434642
I have one like this for example
you just upload the unofficial plugin files in the main one directly
It's a lot faster to get into #1256395889354997771
Huh?
Ah, yes
Like
So you can just
cd src/userplugins
git clone plugin.git
go in github vencord repo, and upload your files there, and name them src/plugins/pluginfolder
yah ik dw
i meant more "bring attention to it"
ive been doing open source for years, i know the gist of it
pun intended?
Honestly i don't understand what exactly are you trying to say
huh that shouldn't show up?
@kindred perch read the guidelines in #🧩-plugin-development
if you want to post a plugin
I think they mean to pr an official one
You need to fork anyway so you can add yourself to devs
https://github.com/RyfterWasTaken/viewMembersWithRole
You already have a right repo for #1256395889354997771 setup
Vencord plugin. Contribute to RyfterWasTaken/viewMembersWithRole development by creating an account on GitHub.
modmail is not the way to go
got yelled at
i didn't yell at you
I haven't submitted a user plugin myself, mb
Like??
you just opened a ticket for plugin-submission (which is for #1256395889354997771) when your plugin cannot be cleanly cloned into the userplugins directory
cause yours isn't a simple plugin that can be installed by people
since it touches vencord files
people would have to apply a patch which then would cause conflicts for them and stuff

yeah im aware, it just said "plugin submission" so i wasnt sure if it meant official or unofficial
And wait for one eternity
and it wouldnt be unnatural for people to have a review process outside of github
i've seen it happen MANY MANY times
i asked, but as inRole already exists they declined(even tho mine worked way better, and very differently)

Maybe my sorting forums by unread thing should've just been part of overrideforumdefaults, I didn't really think about it tbh
was there bias?
here u go mate ur famous https://github.com/user-attachments/assets/1f66f423-2ce0-4cc5-a4e2-a45796096b44
How can i cause an event listener to rerender a component?
wym?
who responded to the modmail ticket
Sick
ven and nin0
okay; so partial bias
There should be a forceRerender function or smtg similar
It's a react hook which returns a function
useForceUpdater
Yeah, this one
You call it and your component updates
yeah if this gets merged [i have a feeling half of it will be split into separate plugins tbf], i'll maybe fix screenshare on web
and then this will be actually competetive with vesktop XD
honestly after looking at it; i think you should ask about it further, and ask if a disclaimer that it's similar is fine
i can't promise anything though
wdym disclaimer?
just say it's similar to another plugin
like tell them that it could be risky?
no; where is the risk in using it (there isn't one)
idk
where should i put it?
not in the plugin itself
ask if you can submit it and say in the submission it is similar to the other plugin
again; i can't promise anything
ok, ill do it when i have time
(hentai) haven video player??
yeah its a thing i made like... 5 years ago
when chrome was first introducing PWA's
and its general schtick was that you can make PWAs that can replace desktop apps
and noone would even notice
and the experiment officially succeded
for example, the video you watched was made with one such PWA
Collection of small, fast, simple PWA's to replace native OS apps.
dont use the manga reader unless u want to brick ur browser tho
i never finished it and the image calc and manipulation it does is awful
and torrent client was made in react
that is to say, it doesnt work
because i never bothered fucking with react ever again
everything you'd ever need from a screen reocrder
laugh at this linux user
it legit just navigator mediadevices capture
unchanged
then i just raw-dog pipe that data into a file, then on end i modify the file metadata header to change duration
it's just gnome video player skill issue i think
plays fine in vlc / mpv
its partially my fault
the video is a stream
not a video

streams dont have shit like duration etc
and a lot of video players dont like that
i do append some duration information
but a lot of video players just dont care
mpv, vlc, mphc works fine
web also plays the video file
ffmpeg will cry that duration is infinity, but will process the video file
the video player i made is unironically somewhat usable
and the image viewer is fucking S tier
i've been using it as my default image viewer for years XD
youre insane
because PWAs can register as file handlers in your OS, so when u click an image it will open the PWA
insult, or compliment?
XD
it unironically isnt hard to do, the image viewer is like 90 lines of code iirc
cant
permissions
click on any of those and you'll see why
and how do you get back from here to the main menu
it just opened
what was supposed to happen
ask for permissiion "hey can i open this file?"
not for me
1:1 same ui as "can i have access to microphone" on websites
well after restarting browser it does
i cant prompt "allow on every visit" only
so i cant have certainty that i will have access to the file
and asking for permission requires a trusted event, aka user input like click
no
this is HEAVILY sandboxed
so its stupidly safe by definition too
unironically, ctrl+r
it reloads instantly anyways because its cached via service worker
so works offline
x)
you can also just drag another image
and a menu to cycle between them will show up
i wrote this code like 3 or 4 years ago, i wasnt as good at making apps as i am now
youre a bit insane
PWA obsession like this cant be healthy...
most people dont even know what a PWA is
its okay im insane too
image viewer is 300 loc together with the css and html markup
most of it is fucking positioning math for dragging etc
you have NO fucking idea what the video player does
if you think the image player is unhealthy, you'd shit yourself at the video player
the image viewer is the simplest thing
video player is 10's of thousands of lines of code
wtf?
this functionality has existed for 4 years, people just dont know!
or 5...?
i think 4 tho




