#🧩-plugin-development
1 messages · Page 66 of 1
the find is a unique string from the module you are trying to edit
it doesnt need to have any relation to what you want to edit, it just has to be in the same module
its how vencord knows its editing the right module
yes, im talking bout EMOJI_POPOUT_STANDARD_EMOJI_DESCRIPTION was found to be the string that represents the popup that appears when u click on a standard emoji
now thats an i18n string so you could either ctrl+shift+f the text for it, or you could inspect it in react devtools and click the view source button to see where the code that makes the popup is
hmmm
and then from the source code that you get shown from clicking "the view source" button
you can find that i18n string?
well you would see that that variable is being used there
but to find the actual contents of it youd need to set breakpoints or ctrl+shift+f the variable name
hmmm
im honestly having a hard time seeing that
but wdym by breakpoints? i didnt know u can set breakpoints in dev tools
for breakpoints click here
thank you
ight
thanks for your help and lilith's
Is there a way to do fallback in ErrorBoundary without typescript telling me to fuck off
fallback: data => {
return <>{data.children?.props?.text}</>;
},
I'm getting Property 'props' does not exist on type 'string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal'. Property 'props' does not exist on type 'string'.ts(2339) while doing so
try (data.children as ReactElement<any>)
oh, it works now. Thanks!
I'm trying to make it so the plugin upload files to files.offshore.cat (using sharex config values), but I keep getting this error. I believe its because I'm passing through the header wrong. Would appreciate some help.
Error: Access to fetch at 'https://any.corsbypass-f43.workers.dev/?https://files.offshore.cat/api/upload' from origin 'https://canary.discord.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
POST https://any.corsbypass-f43.workers.dev/?https://files.offshore.cat/api/upload net::ERR_FAILED
Code:
async function uploadOffShoreCat(file: File, channelId: string) {
try {
const formData = new FormData();
formData.append("file[]", file);
const headers = new Headers({
"x-api-key": "OFFSHORE.CAT KEY HERE"
});
const corsBypassURL = "https://any.corsbypass-f43.workers.dev/?";
const uploadResponse = await fetch(corsBypassURL + "https://files.offshore.cat/api/upload", {
method: "POST",
body: formData,
headers: headers
});
const uploadResult = await uploadResponse.text();
if (uploadResult.startsWith("https://")) {
setTimeout(() => insertTextIntoChatInputBox(`${uploadResult}`), 10);
UploadManager.clearAll(channelId, DraftType.SlashCommand);
} else {
console.error("Error uploading file:", uploadResult);
sendBotMessage(channelId, { content: "Error uploading file. Check the console for more info." });
UploadManager.clearAll(channelId, DraftType.SlashCommand);
}
} catch (error) {
console.error("Error uploading file:", error);
sendBotMessage(channelId, { content: "Error uploading file. Check the console for more info." });
UploadManager.clearAll(channelId, DraftType.SlashCommand);
}
}```
I tried to but that seemed to not work either. it only worked in native.ts for me when I added the cors proxy there as well
same was true with this native.ts
export async function uploadFileToCatbox(_, data) {
try {
const userhash = "";
const blob = JSON.parse(data).blobData;
const formData = new FormData();
formData.append("reqtype", "fileupload");
formData.append("fileToUpload", new Blob([blob]));
const catboxApiResponse = await fetch("https://catbox.moe/user/api.php", {
method: "POST",
body: formData
});
const contentType = catboxApiResponse.headers.get("content-type");
if (contentType && contentType.includes("application/json")) {
return await catboxApiResponse.json();
} else {
const textResponse = await catboxApiResponse.text();
return JSON.stringify({
success: true,
url: textResponse
});
}
} catch (error: any) {
return JSON.stringify({
error: "oh shit",
errorData: {
message: error.message,
stack: error.stack
}
});
}
}
it would just error without the cors proxy
it just tells me something like "the function native.uploadFileToCatbox is undefined or invalid"
and I'm not aware of a way that allows native.ts to log/show specific errors that occur within native.ts
restart discord fully
oh it works without any issues
so you should always fully restart when making changes to native?
that just errors out for me
look at consoleShortcuts/native.ts
you can import from the main folder
it exports the global settings object
so just like this?
import { settings } from "./index";
@dull magnet my plugin's first party feature is now deployed to canary, prob best to have the vencord plugin removed before it hits stable
what
I asked my friend at Discord to make it a first party feature
make what a what party feature
jethro my beloved
Make party mode a party feature
ah
i feel like "Jump to Context" or something like that sounds better tho
well
Discord can bikeshed it
fr
no way lmaooooo
@acoustic nest literally the same method we used haha
I did guide him a bit on how it worked
He wasn’t familiar with that part of the code base
He’s on the bots team rn iirc? Apps and activities or smtn
I don’t often talk work with him
I also told him about the quirk that makes it all work at all
Specifically the message jump only using the timestamp
I mean i'm not even sure if it's a quirk
it's very much intended that message jumps work like that
yes it is
is there any way to detect typing in the chatbox and dynamically change it in-app?
kinda like AHK?
wdym
oh
textreplace does that when you send a message
but probably for while youre typing its possible
yea, but i want it to be in the chatbox, not the sent message
yeah ofc
(obviously it should end up in the sent message, but i mean i want to change it while the user is typing, not after they send it)
Hook the key-down event
Also clear then append text to edit the chatbox
wait if you hook and event dont you get access to the element
or would it be a vencord hook not js
is something like this gonna be worthy of being an official plugin if i make it, or is that too niche?
the old experiment is completely removed so im gonna have to recreate the channel icons
i can use discord's emoji data cause it should be available somewhere in the webpack modules
but i'll also remove the brackets/dashes/dots/other fancy charactes people use (using regex) so that it doesnt look weird like #《》general or #-general with the separated emoji
please make that 🥺
although im not sure how to get the color of the emoji
I hate to break it to you but
I made that
where
since theyre all svgs i could just try to extract the colors like this (?:fill|stroke)="?#([\da-fA-F]{3,6})"?
where is it i want it in my fork
oh
I mean feel free to remake it the code is shit
It uses a local ollama server and i'm not sure how else you would get emojis for channels without emoji names (?) so not sure if it's a good idea for stock
my idea is just to replace the channel icon if theres already an emoji
no AI or anything
replacing the hashtag icon looks good enough
so some will look like just the hashtag and some will have an emoji
also removes the need for the circle whose color matches the most common color of the emoji
which is kinda a hacky thing to do in a plugin
and i dont like including large predefined stuff in userscripts/plugins
just some string manipulation and regex fuckery to use an emoji from the channels name as the channels icon and remove the brackets/dashes/dots/etc surrounding the emoji
im trying to figure out how to add text under names like a status?
also specifically when the user doesnt have a status showing, i want to put some custom text there
find the status text component and patch it
{
find: ".MEMBER_LIST_ITEM_AVATAR_DECORATION_PADDING)",
replacement: {
match: /subText:(\i){1,2}\(\),/,
replace: "subText:[\"test\"],",
}
}```
now make a function that gives an output for it
also console.log when that function is ran (so you can see the interval that subtext thingy is ran/checked)
ah good idea thanks
np
how to get the guild member version of a User obj for a specific guild
Replace that with a function and pass props so you can not replace it when there is an actual status.
i just did that :) thank u tho
also why are you matching \i{1,2}
oh good question! idk lol, i stole some stuff from a different plugin
it works so i kept it

doesnt that part just mean any two characters?
or 1 to 2 characters
im not sure now
ohh thank u
yeah i think it makes sense to have that part right?
why not
currently its subText: eR()
Why is it not (?:)'d?
I guess \i? is pretty uncommon
(?:) is a verb now
this doesnt actually look like it's editing the status itself, instead it looks like it's editing where the status component itself is
@flint bronze i got it looking like this now
👀
want to hear a fun fact
there was an experiment that did this and got removed
yes i know, i'm making this because i miss it 😭
W

it basically works now
i got it to patch into a "subtext" thingy, and i manually added the right divs so it styles correctly
i think its basically ready, ill probably share it soon after some tweaks
WWWWW
WWW
i like this
makes it easier to stalk my friends
jkjkjkjk
lmk when its out 🙏
not stalking, just being socially one step ahead 
i think you mean one step behind 
i feel kinda stupid but idk why Vencord is undefined
it only happens when i use a rect svg element
its really weird
how are you using it
it errors right when it comes to the rect element
ok i think i understand what to do thank you
nl I think this would have to have a “opt-out” feature if if not it’s kinda creepy gang
i feel you
but idk how that would be possible
other than just offline/invisible mode
make a little express server with discord auth and allow ppl to opt out
like reviewdb
^ this
hmm okay cool idea
vee's untrusted apis rule can prob be ignored if you ask them to host it on their vps
I mean, that’s why this could nuke the experiment because you know creepy
if anything I feel like this would be the opposite of reviewdb where you would have to opt into it
i mean people would just be able to modify the code since it only enforces who's opted in on the client side right?
most people wont do that, but still
imma edit the code to bypass my own opting out rather than just opting in
you could easily make that server side
i'll share the repo when i'm done, im not 100% sure what the best way to implement this would be
discord spyware and stalking !! love it
aint spyware if you have to opt in
people will just edit that to be client side and there is no opting out of that
then they made spyware lol
what if, and hear me out, we didnt make creepy plugins
also that really isnt spyware
SO TRUE!
But the white names can’t resist
(that and for some reason totally butchering a perfectly fine plug-in by adding very unnecessary things to it)
insane idea
the white names yearn to be the creepiest people alive
its soooo hard to resist stalking people
- average vencord whitename
now this is spyware: .
this entire plugin is a really REALLY bad idea no matter how much you twist it
okay guys
hear me out
what if we killed people like this
to make people actually afraid of making stuff like this
?
good idea? yeah? thanks for agreeing with me
to clarify, this is too far, im not trying to endorse it 😭
why even post it 
should i unpost it?
then how about we don’t also make another creepy plug-in?
YES
i didnt make this with malintent, im sorry 😔
maybe i wont share it with the world if you think its harmful
guys can I get a plugin to track all changes to a specific persons profile and send me a text when ANYTHING changes
Yes!
activity changes? TEXT!
Why don’t we go ahead and add animated status into it while we’re at it?
run this code for me ❤️
findByProps("getToken").getToken()
help I installed Vencord and now my PC is slow is this normal
shouldve made it send it in chat too
too lazy
where's that ultimate token logger plugin I was promised
@hoary pilot will make
@balmy sky will help
ive never been triple husked so fast lmao
quintuple, damn
rip tobleronecord 🙏🙏
THATS WHAT IAM SAYING
guys should i add live physical location tracking to vencord, you can opt out for a small fee :3
small fee of $1000 monthly to Vee’s bank account
What's the point of location tracking if you don't have a keylogger
thats why we need people like you
incredible innovation
sextuple, love yall
youtube comment thanking people for likes:
Thanks, hate you too
i didnt say i hate you :(
septuple
okay ill stop now
Rest in pee
will be pissed
what's wrong here?
problem with : in replace: "guild:$1," and I have no idea why
click this in the error and screenshot
wtf, I can guess it's conflict with other plugin but then why even in vscode it says error. or it checks already rendered code?
conflicted with other plugin or bad patch
yeah, thank u
your patch is bad
you don't match anything yet add new guild:$1
I'm capturing in lookbehind group, just fixed it just changing pronouns to nicknameIcons, idk why it didn't work before cos no other plugin touches this part of module
because your match makes no sense
why? I'm capturing guild variable in lookbehind group and adds it between this group and last one with pronouns
rn I'm adding it before nicknameIcons and it works
stop doing that
match only the place you need to change
don't match 2km away
and make your match more specific
you can use arguments[0] or find closer usage of the thing you need or use lookbehind after your normal match
and don't overuse lookarounds
matching 0 characters and only using lookarounds is confusing
and why are you even adding guild there
what's the point?
fuck my head.. I'm using this one everywhere but here I completely forgot about it
I think it's time to sleep for me
creating alternative tags for users depends on their permissions and want to put it right after nickname in profile popout
so you are passing it to a different component just to be able to use it there?
yea, there's better way?
that's terrible never do that unless you really have to
why can't you just use getCurrentGuild()
ah, u right that's better idea
thanks
and good night for me xd

Pretty simple but d'you think this is something anyone would be interested in using? If not I'm just gonna leave it as a basic "I only really care about chrome" plugin for myself lol
Only needed on desktop obviously
This seems cool, simple but cool with specific use cases, I like it
I mean, I can see it being used for web just to save a few more clicks (if not already in an incognito tab probably)
Yeah maybe. I got into the habit of always opening like one-off suggested youtube videos in incognito so it didn't affect my recommendations too much and it evolved into me just opening everything in incognito now
So it's nice to be able to do straight from discord as well
I often open incognito when doing searches for things, like while developing and I do a quick search for stackoverflow. I guess I just got in the habit of it as well
Also considering the custom option is just you writing your own shell command, I imagine it could be expanded into a general "Open with..." but I don't wanna think about that right now
I would use it. The Incognito part is not that important to me, but I love that I can quickly open a browser with only 1 page without interfering with my main window
I mean "open link in new window" has been a thing in browsers for decades
I know
But not from discord window
Shift right click
I often use it when just browsing
I actually also made a plugin but idk if I can share it or not since it wasn’t accepted in unofficial plugins (though it was quite buggy so glad it wasn’t), but it’d be especially nice to show it to some people with my recent update
I have a second one too but it requires a slight change to core and allows people to execute arbitrary code ("run" button on codeblocks) so I imagine it would be shot down lol
And then on top of that it's also just pretty niche. I just wanted a quicker way to store and run useful snippets or try stuff from #🎨-css-snippets and #📜-js-snippets
The change to core is allowing plugins to amend web request headers (without exposing it to openasar and causing conflicts) so it can allow code to run in iframes, etc
Sorta risky
Yeah I figured that too, that's why I haven't submitted it for anything
I've made a plugin that extracts css code from code blocks and insert it in quickcss
the plugin name is quicksnippet ig?
if you wanna borrow code go ahead
Yeah I found it like a week after I made it myself lol
But that's okay, it was a good learning experience, I've never used react before
I have a new plan for that name but because my frontend skills don't allow me to execute it sadly
Would it be okay? Maybe just images? (I just don’t wanna do something wrong here and idk if it’d be okay in this channel)
we dont even know what it is
Well that’s why I wasn’t sure if I could even say what it was because it was denied, idk how far that goes but sorry
just say what it is
Well it’s a plugin which utilizes Vencord’s badge api to create profile badges exclusively visible to the user through locally stored data. (Used to use JSON but now DataStores)
well it probably wasnt allowed because badges are supposed to be exclusively for donators
Yeah I know, I was told that
But I meant just talking about it since I recently updated it to make it better, not having it posted there
im trying to create a settings option where i can turn off showing the "@" but im bad with discord patches and i cant find anyway to do it, any help please?
what?
more context?
this option but for role mentions
Hide replies to messages from blocked users:
{
find: ".messageListItem",
replacement: {
match: /(?<=\i=)(?=\(0,(\i)\.jsx)/,
replace: "!$self.isReplyToBlocked(arguments[0].message)&&"
}
}
isReplyToBlocked(message: Message) {
const { messageReference } = message;
if (!messageReference) return false;
const replyMessage = getMessageByReference(messageReference).message;
return this.isBlocked(replyMessage);
},
@cedar olive this works, but I honestly have no idea if its the correct way of going about it
what does message reference contain
const { getMessageByReference } = findByPropsLazy("getMessageByReference");
an example messageReference is
{type: 0, channel_id: '1032770730703716362', message_id: '1276689815106093076', guild_id: '1015060230222131221'}
is the replied message always loaded?
I have no idea
I just found getMessageByReference by looking at how discord got replied message
where do you patch this
the li containing each message
screenshot 
I have no idea how to test that
honestly spent like an hour going through discord code finding how it turns messageReference into what is used by reply component
No clue what is going on most of the time
I don't know how caches work in this app
you could have done a simple MessageStore.getMessage
like
const replyMessage = MessageStore.getMessage(messageReference.channel_id, messageReference.message_id);
oki that works
how does MessageStore.getMessage handle uncached messages? @cedar olive
also I don't have any useEffect to make sure this runs once per message
so this is probably rerunning every time react decides to shit all over the dom
I have literally no idea how I would add a useEffect to minified react code
returns undefined
it doesnt fetch them
MessageStore is the cache
the types don't match that, says it only returns message
Ig my code does handle that though
- isBlocked(message: Message) {
+ isBlocked(message: Message | undefined) {
+ if (!message) return false;
yea, all types of stores have this thing
#🔧-discord-changes message guhhhh this exploded my patch doing a similar thing
how ugly is this code
do more new lines 😭
i know 
also
you have no flux listeners
I don't think useStateFromStores is gonna ever update
unless this is what you want
it is
I dont think you need to use a store but 
i did consider this
but also I hate spamming useSyncExternalStore everywhere
feels wrong
i do not want to do the API call from a component itself btw
no idea what that even is lol
very unholy hack for building your own hook
also isn't there a store for audit logs you can just use to make the reason?
not really
last time I looked at audit log shit i got scared away from finishing my plugin idea by it all
xd
"not really" meaning "there is, but it's super cursed, designed for a totally different purpose, and has a horrible api I don't even understand how it works or why it was made that way"
time to Add Comments
add new lines 
yes that too
Does anyone know how to get offshore cat (using Chibisafe) to work with an account API key that is given in its ShareX config? It works fine without the key. Not sure if I'm inserting the header wrong, but headers work fine for other file uploading services when I structure them like this. (for context if its not obvious enough, I'm trying to make file uploading to offshore cat possible via plugin)
-# And yes I know I included my API key in the code below but its for a dump account I made for testing and I can reset the API key.
Code
async function uploadOffShore(file: File, channelId: string) {
const url = "https://files.offshore.cat/api/upload";
const headers = {
"x-api-key": ""
};
try {
const formData = new FormData();
formData.append("file[]", file);
const uploadResponse = await fetch(url, {
method: "POST",
headers: headers,
body: formData
});
if (!uploadResponse.ok) {
throw new Error(`Upload failed: ${uploadResponse.status}`);
}
const uploadResult = await uploadResponse.json();
if (uploadResult.url) {
setTimeout(() => insertTextIntoChatInputBox(`${uploadResult.url}`), 10);
UploadManager.clearAll(channelId, DraftType.SlashCommand);
} else {
throw new Error("Upload successful, but URL not found in response");
}
} catch (error) {
console.error("Error uploading file:", error);
sendBotMessage(channelId, { content: "Error uploading file. Check the console for more info." });
UploadManager.clearAll(channelId, DraftType.SlashCommand);
}
}
ShareX Config:
{
"Name": "chibisafe",
"DestinationType": "ImageUploader, FileUploader",
"RequestType": "POST",
"RequestURL": "https://files.offshore.cat/api/upload",
"FileFormName": "file[]",
"Headers": {
"x-api-key": ""
},
"ResponseType": "Text",
"URL": "$json:url$",
"ThumbnailURL": "$json:thumb$"
}```
I don't know but I hope that isnt your actual API key
nah its a dump account for testing
it just fails to upload with the API key
Cannot parse Access-Control-Allow-Headers response header field in preflight response.
removing the api key from headers makes it work just fine
then the api doesn't support cors properly
complain to them or use native file
or dont use api key
#🪅-progaming message
cross posting here, was able to optimize out the dependency on virtual-merge in fakeProfileThemes
virtual merge isn't needed since the changes don't actually need to be reflected onto the user object
I'm making a plugin that changes the behaivour of pressing the esc key in settings to the same of pressing the close button. I got to this which works but i feel like it's a horrible way of doing it, is there a way to more directly call the function that gets executed when you press the button?
document.querySelectorAll('div[class^=\"closeButton\"]')[0].click()
😭
-# when you make a vencord plugin you wont ever be allowed to post ^
use patches
i am
ESC ignores unsaved changes
use react devtools to inspect the close button and see what its onClick is
How long does it take pull requests to be reviewed usually?
It's been a little while (about a week. although I thought it was longer) since I made the pr, and there haven't been any reviews yet
https://github.com/Vendicated/Vencord/pull/2790
it can take anywhere from a few weeks, to a few months, to never
from a few hours to years
poggers
new plugin: CopyFileContents coming in 2030!
pretty sure the shiki plugin also allows to copy file contents
unless im tripping
I guess this is about attached files, not code blocks. Does shiki affect those?
W
yeah
this
how can I check if the user has nitro (or more specifically their message sending length limit, but I'm pretty sure checking nitro is the only way to check that)
look at the message length counter thing
thats like
a bad idea
bc it only appears if you have enough message length in the box to make it show up
would badges work?
so UserStore.currentuser or whatever
currentUser?
act premium type
would be the thing id want to check
done
UserStore.getCurrentUser().premiumType
0: none
1: classic
2: premium
3: basic
those are the types for future refrence btw
Look at the message length counter thing's code to find how it gets the limit
i feel like this is for a CharCounter plugin
i made that a while ago
There’s been three other attempts at making it too
i just used the nitro char counter
Pull Request #2000
Pull Request #2399
I can’t find the other one, but I know there was at least three
and also the one you made
#1032200195582197831 message
Is there a way I can open links in my discord itself (vencord)?
I've seen in vesktop thats possible even though its in beta phase. I don't wanna install vesktop because it has a rpc bug for me.
And there is no current fix for that bug according to this [msg](#🏥-vencord-support-🏥 message).
can we put on our thinking caps here
^
this was already resolved?
what
ikr
""
@swift delta i sent that bc it just didnt make sense why you said it
idk i’m confused on what is happening in this convo anymore so i deleted them
k
Probably esaier to use css
Hello, is there a plugin/way to disable pings/red dot/sound from a specific server?
I know muting a server is an option but that still shows the rec icon. I don't want that to be shown either.
And if possible, if we can specifically supress a specific ping of @role or from a @member.
use css to hide the red dot
for a specific server?
@tough otter you might want to ask in #🎨-theme-development
I see, thanks!
how would you disable a plugin
Settings.plugins[name].enabled = false
i think
theres probably more logic based on patches but that should work if im not going crazy
Wouldn't that not run the stop function?
function toggleEnabled() {
const wasEnabled = isEnabled();
// If we're enabling a plugin, make sure all deps are enabled recursively.
if (!wasEnabled) {
const { restartNeeded, failures } = startDependenciesRecursive(plugin);
if (failures.length) {
logger.error(`Failed to start dependencies for ${plugin.name}: ${failures.join(", ")}`);
showNotice("Failed to start dependencies: " + failures.join(", "), "Close", () => null);
return;
} else if (restartNeeded) {
// If any dependencies have patches, don't start the plugin yet.
settings.enabled = true;
onRestartNeeded(plugin.name);
return;
}
}
// if the plugin has patches, dont use stopPlugin/startPlugin. Wait for restart to apply changes.
if (plugin.patches?.length) {
settings.enabled = !wasEnabled;
onRestartNeeded(plugin.name);
return;
}
// If the plugin is enabled, but hasn't been started, then we can just toggle it off.
if (wasEnabled && !plugin.started) {
settings.enabled = !wasEnabled;
return;
}
const result = wasEnabled ? stopPlugin(plugin) : startPlugin(plugin);
if (!result) {
settings.enabled = false;
const msg = `Error while ${wasEnabled ? "stopping" : "starting"} plugin ${plugin.name}`;
logger.error(msg);
showErrorToast(msg);
return;
}
settings.enabled = !wasEnabled;
}
thats the whole thing
doesnt matter for what im doing
is there no component or api thing that lets me add something like the (edited) text next to messages?
the closest thing i could find is a message accessory which adds text below
If there's no api, just patch it
that's the part im still not really good at, but thanks
Not really big support, but wanted to find where i can just ask or get documents if vencord plugins are able to run external files
i tried to search and dint found anything, and i saw that on this server you dont provide support about it, just wanted to know if it was possible, otherwise
if you cant answer, is there somewhere i can ask on the server on an other server, i dont want to break the rules of the server or smth...
yes, vencord plugins can run external files (at least on desktop and vesktop)
achieved via native modules, which run in a separate process using node
alr
using nodejs to start python code
ironical but ye..
ill try make this, any good repo for base plugin code?
i found one, but just want to know if y'all have good examples too
for the future
you can use the vencord companion vsc extension to generate the plugin boilerplate afaik
they have a vsc extension
thats nice
ill check this
thanks for the info
i found this base:
https://github.com/AshAxolotl/Vencord-Plugins/tree/main
is it good?
There are 100+ plugins in the vencord repo why would you choose a forks plugin
lol
its discord legal, and its just discord user agent apps
.... cool.
you basically want an in-app button to start up your bot?
best option would probably be to just run a file
but you can also spin up an http server when your computer startsup and that server will startup the bot when you make a request
the first option is better though
i made a script on my desktop to auto start it
i just want to add it to my discord, if possible, why not?
Interesting hosting your discord bot on your desktop
Very interesting
my home server cannot run while the ac is on
summer here is hard for my room
i have many things running in the room
(BIG)Projector, computer, homeserver, screens, ac , 3 ups , xbox 1, 4 monitors, a soundsystem (home theater) with subwoofer a ps3, a ethernet switch a hdd dock and a powebard for charging our phones and testing computers i repair
aint it contradictory?
X [ERROR] [plugin ban-imports] Cannot import node inbuilt modules in browser code. You need to use a native.ts file
src/plugins/KeparAssistantExtras/native.ts:1:21:
1 │ import { exec } from "child_process";
╵ ~~~~~~~~~~~~~~~```
full code?
Might have to do with how you're accessing the native.ts
If you're (erroneously) importing it I can imagine it'd give errors like that
you can't import native file in index file
check out another plugin that uses native to see how it works, you do not require native from your index.ts/x
i.e. openinapp
otherwise:
import { ApplicationCommandInputType, sendBotMessage } from "@api/Commands";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "AssistantStarter",
description: "Command to start the assistant batch file",
authors: [Devs.Arjix],
dependencies: ["CommandsAPI"],
commands: [
{
name: "startassistant",
description: "Starts the assistant by running a batch file",
inputType: ApplicationCommandInputType.BOT,
execute: async (opts, ctx) => {
if (typeof window !== 'undefined') {
sendBotMessage(ctx.channel.id, { content: "This command can only be run in a Node.js environment." });
return;
}
try {
// Use require instead of import, which only gets evaluated in Node.js environment
const { exec } = require("child_process");
exec('C:\\Users\\Kepar\\OneDrive\\Bureau\\Start Kepar Assistant.bat', (error, stdout, stderr) => {
if (error) {
sendBotMessage(ctx.channel.id, { content: `Error starting assistant: ${error.message}` });
return;
}
if (stderr) {
sendBotMessage(ctx.channel.id, { content: `Assistant started with warnings: ${stderr}` });
return;
}
sendBotMessage(ctx.channel.id, { content: `Assistant started successfully:\n${stdout}` });
});
} catch (error) {
sendBotMessage(ctx.channel.id, { content: `Error: ${error.message}` });
}
},
},
]
});
F:\DEV\Vencord>pnpm build
> vencord@1.9.8 build F:\DEV\Vencord
> node --require=./scripts/suppressExperimentalWarnings.js scripts/build/build.mjs
dist\preload.js 2.3kb
dist\preload.js.map 9.3kb
Done in 23ms
dist\vencordDesktopPreload.js 2.2kb
dist\vencordDesktopPreload.js.map 9.2kb
Done in 37ms
X [ERROR]
dist\patcher.js[plugin ban-imports] 40.0kb
Cannot import node inbuilt modules in browser code. You need to use a native.ts file
src/plugins/KeparAssistantExtras/index.ts:23:45:
23 │ const { exec } = require("child_process");
╵ dist\~~~~~~~~~~~~~~~patcher.js.LEGAL.txt 964b
dist\X [patcher.js.map
ERROR]215.4kb
Done in 212msdist\vencordDesktopMain.js
35.2kb
[plugin ban-imports]dist\ vencordDesktopMain.js.LEGAL.txtCannot import node inbuilt modules in browser code. You need to use a native.ts file
src/plugins/KeparAssistantExtras/index.ts:23:45:
964b 23 │ const { exec } = require(
"child_process"dist\);
╵ ~~~~~~~~~~~~~~~vencordDesktopMain.js.map
197.1kb
Done in 299ms
1 error
Build failed
Build failed with 1 error:
src/plugins/KeparAssistantExtras/index.ts:23:45: ERROR: [plugin: ban-imports] Cannot import node inbuilt modules in browser code. You need to use a native.ts file
1 error
ELIFECYCLE Command failed with exit code 1.
F:\DEV\Vencord>
again, please check the source code of a plugin that already uses a native module, this is not how you use native modules
anyway
why does the patch helper sometimes show this nice preview and other times not?
huh?
not a question directed towards you
whats patchhelper
is this something i need?
const { isEnabled, showIcon } = settings.use(["isEnabled", "showIcon"]);```?
can this be replaced with ```js
settings.store.isEnabled
settings.store.showIcon```
and can I entirely replace settings with definePluginSettings with an options object? are they exactly the same?
what?
are you trying to change your plugins settings?
yes, they are changed within the code
settings.store.isEnabled = !settings.store.isEnabled```
definePluginSettings returns a settings object
looking at the code, you only need to use settings.use if you want react to re-render when they are changed
so that's what it does
thanks
i'll keep that then
im not sure what level of disgustingness an official vencord plugin can have in its source code
Hey Folks Wave
Im looking to start getting into writing a Script to automaticly Convert Better Discord Plugins into Vencord plugins.
However, I cant even manage to setup my Dev Env XD
For some reason, the DevCompanien dosnt seem to work. When Starting Discord and VsCode I dont get a connection, and when I retry, (via the Vencord toolkit -> DevCompanion -> Reconnect), I get a WebSocket error in the Console:
js index.tsx:94 WebSocket connection to 'ws://localhost:8485/' failed:
Any idea why?
yeah you can do this
nvm that was resolved mb
I did that, but I'm still facing the same error
I also tried to reinstall Discord, incase its some wierd Discord issue, but no luck :/
I also tried it on my Ubuntu-24.04 VM, but no dice there either
It might be a problem with my VScode, since I dont see a open port via Netstat
dev companion is helpful but not necessary by far
not sure how great a tool to convert betterdiscord plugins into vencord plugins is gonna be, betterdiscord plugins should be very different from vencord ones
use ai /j
thats probs gonna be their plan
who knows maybe they could use ai to write the code too!
oh right, thanks
np
Na, fuck that lmao.
Yes its gonna be quite hard, but atleast most of the API calls should be translatable (more or less lmao)
oh yeah i havent ever learned this
vee what is your thoughts on betterdiscord
do u dislike it cause rivals
or feel bad for it cuz of how shit a platform it is
Hello, its me again
So, Im currently in the process of rewriting BetterCords "SplitLargeMessages" for Vencord, as a unofficial plugin, as its a selfbot.
For that I am using the PreSendListener to "catch" the message before its being send. However, the "Your message is longer then the allowed 2000 Chars" modal seems to still be triggered before.
Anyone got a idea why or if I can even circumvent this? (Cause I'm thinking probably not, but Im stil hopefull XD)
My Code
i <3 bettercord
Message intercepted. LOL
(Also it seems like the "disable" isnt implemented yet... Ups.. XD)
?
so uh we actually
we dont exactly
allow selfbots
r11
For testing I had the "Message intercepted" when the message wasnt over the 2k chars.
And for some reason, when I disable the plugin in the settings, it isnt actually disabled lmao
I noticed, but I thought, according to [this message](#1260497802019082251 message), they where okay for the #1256395889354997771. If not I totally understand, and will stop the development accordingly
@dull magnet whats your thoughts on this
solution: require multiple enter key presses
I like that idea.
oh so like it sends the first 2k then the next 2k etc
yeah that would def work
if it just cuts out the first 2k letters after
for the 2000 characters youll need to add a patch for it @humble flax
Are there any docs on patches?
pins
Maybe I'm blind (or more likly just stupid), but I cant find anything regarding patches in the pins here.
Vee said it herself it's fine as long as it has sane limits iirc
The plugin is entirely useless though
Ah, I see now.
Fair enough XD
I reguarly send emails on Discord tho, and they tend to be longer. And in a file format theyren't searchable
So I can see why its not nessecary in most usecases, but for me its quite handy
oh god
Yes its quite.... Something. XD
...what?
just curious
why do you need to send email content inside of discord so much
Yes... I am the head my Uni's unofficial Discord server and I (manually) forward most of the emails we get, for one to archive them but secondly so that everyone gets them, even if they dont check thier mail often.
I know I could automate this with a bot, but I want that extra level of security, since some mails might be private...
secondly so that everyone gets them, even if they dont check thier mail often.
sounds a lot like nobody bothers to set up their email client, and that their uni email account gets spammed to death with automated junk?
Jep, thats about right
95% of my non-personal account email I recieve is automated junk
Like atleast 5 emails a day for some random bachelor colloquium that noone cares about lmao
roughly 70% of my personal email is junk too though
my email is git forges and spotify trying to sell me overpriced premium
The worse thing is, the spam filter the uni uses is quite good (no "real" spam so far), rather its the Teachers spamming us XD
my email gets spammed by hoyoverse game marketing (i made the mistake called try these games)
i recieve nothing
i unsub from any mailing list i get added too
this has been my email for the past week ish (the oracle thing wasnt there it was just empty)
Looks like a dream!
i keep all of my emails because a lot arent spam
you will sign up for user discussion mailing lists for random linux distros
hello silly folks, i'm invading now
anyways, i'm here to get feedback on one of these patches (specifically the first one):
{
find: "Messages.USER_ACTIVITY_PLAYING",
replacement: [
// Hide the "badge" timers that count the time since the activity starts
{
match: /\(0,.{0,30}activity:(\i),className:\i\.badges.*?}\)/g,
replace: "($self.settings.store.hideActivityTimerBadges?null:$&),$self.getTimeBar($1)",
},
// Hide the large title on listening activities, to make them look more like Spotify (also visible from hovering over the large icon)
{
match: /(\i).type===(\i\.\i)\.WATCHING/,
replace: "$1.type===$2.LISTENING||$&",
predicate: () => settings.store.hideActivityDetailText
}
]
}
i'm unsure if doing settings checks like this is acceptable? (or if there's a better method i'm not aware of)
i'm updating the timebarallactivities plugin to work with the new activity cards they pushed out, and i need to hide parts of the match conditionally (rather than turning off the whole match with a predicate, since having two almost identical patches felt wrong)
(also thanks vee for the access ^w^)
seems fine to me?
yeah it's fine
also comes with the benefit that you can toggle it at runtime 
alright kewl!
the runtime change doese work well too
discord got sneaky and left the old renderTimebar function in without ripping it out so the patches on the original plugin never failed >.>
reminder, make sure that hideActivityDetailText has restartNeeded: true
honestly might just use the same type of check there as well just to keep them the same
it does already have that flag right now though :>
is it used in any other predicates
these settings are only used here on those matches
this update is practically complete outside of moving it from the temporary userplugin i jammed it in and the questions i had on those
i do also have to ask what happens with the devs array if the entire plugin is replaced
do i leave the original dev there as well or just replace them? (they're no longer in the server)
i'm aware you might not be able to answer that
leave it
alright thanks :>
How would i get the current discod theme? as in either "light" or "dark"?
import { getTheme, Theme } from "@utils/discord";
getTheme() === Theme.Light ? "light" : "dark"
Ty!
arent there two others + all the nitro themes
they are still all categorised as either light or dark
patching out profile colors
oh thats what you wanted
one property of profiles is the base theme color which is either light or dark, i just force set it to the current theme
now all profiles look like this on my client :3
isnt that the same as exploding nitro profiles
Css: 
when the insane lag due to too much css
normal ones
keep in mind that this plugin has many patches kinda everywhere patching out a bunch of different components
im at 17 patches now
oh god
thats horrible
what happens in profile editor
no its not
k
.
nothing
k
was this ever answered?
nope but i figured it out (it only shows up if there actually is a match in that module)
Hey there
I'm currently trying to write a patch that is triggerd when a user is sending a message, but before any of the Discord text length checks get triggered. (I.e. "Your message is longer then the allowed 2k chars.")
This is my current patch:
patches: [
{
find: "onSubmit:", // Locate the module or property containing the 'onSubmit' method
replacement: [
{
// Match the original 'onSubmit' handler
match: /onSubmit:\s*function\(\w+\)\s*{[^}]*}/,
// Replace with custom handling logic
replace: `
onSubmit: function(e2) {
console.log("Message Splitter Plugin: Intercepted message submission");
const messageContent = e2.methodArguments[0].value;
if (messageContent.length > 2000) {
e2.stopOriginalMethodCall(); // Prevent the original method from executing
return handleLongMessage(messageContent); // Call external function to handle long messages
} else {
return e2.callOriginalMethodAfterwards(); // Call the original method if the message is within the limit
}
}
`,
},
],
},
],
The patch was inspired by BetterCords SplitLargeMessage plugin, but so far no dice. When I send any message, the "debug" console.log isnt triggerd, and I am unsure why.
Note that I am new to the whole patch system, and I am not exactly sure how to find the correct handler, as when I set a breakpoint on the "onSubmit" handler, it gets triggerd whenever I click anything inside of Discord
replace: "$self.myFunc(arguments)"
lol
myFunc(args) {
return;
}
Yeah, right now its not the cleanest, but the more complicated functino (i.e. handleLongMessage), is already seperate. I tried to have as much as possible in the replace as, in my mind, it gets "injected" directly in the already existing JS. But it will get fixxed later ™️
A wise person once said "if your patch code is multi line it probably shouldn't be in the patch"
But when I immediately return, wont it just skip the patch alltogether?

write your own code there
Ah, as I said. I'm new with the whole patching, and the docs (apart from the pins here) arnt mentioning any patches. (There is a pull request right now, but it hasnt been merged yet)
Directly in the replace? Cause thats on my todo, as soon I get a functioning console.log
what?
did you use ai
ai can't write vencord plugins
lol
export const definePlugin({
patches: [
{
find: "myFind",
replacement: {
match: /myMatch/,
replace: "$self.myFunc"
}
}
],
myFunc(args) {
return;
}
}
);
I used ai to explain some patches I found (i.e. MessageTags plugin and the mentioned BetterCOrd plugin), but not to write the regex itself
(ignore terrible formatting)
Ah, i get it now. Thx
also, fix the find
ai cant explain patches either, please dont use ai, just ask here and we can help you
I tried several finds, but so far was unlucky.
I already looked via the React Componets inspector, but as I said, when I set a breakpoint on the onSubmit handler, it triggers on every interaction with DC.
So I tried to be a smart ass, and failed XD
While digging around, i found this function:
function o() {
return (0,
r.e7)([i.default], ()=>a.ZP.canUseIncreasedMessageLength(i.default.getCurrentUser())) ? s.en1 : s.J6R
}
I tried to be a big brain, and just patch the a.ZP.canUseIncreasedMessageLength(i.default.getCurrentUser()) to true.
Like so:
find: "a.ZP.canUseIncreasedMessageLength",
replacement: {
match: /a\.ZP\.canUseIncreasedMessageLength\(i\.default\.getCurrentUser\(\)\)/g,
replace: "true"
}
And, when I wrongly match the canUseIncreasedMessage[...], so it crashes DC I can see the patched Webpack in Vencords folder. But when I correctly match it, it just gets overwritten.
Is there a safety feature from Discord (or even Vencord) that I'm missing? (Propably Sentry imo)
(Also its a great way to let DC freeze up constantly lmao)
this is bad this is wrong this is bad and wrong
this will break when discord updates
use \i\.\i\i\.canUseIncreasedMessageLength instead of a\.ZP\.canUseIncreasedMessageLength and \i.\i\i.canUseIncreasedMessageLength instead of a.ZP.canUseIncreasedMessageLength
Or just patch canUseIncreasedMessageLength
I tried that to, but for some reason, when I look (via performance monitor), it is back to the original again
But maybe im looking in the wrong place?
So I picked up your idea again, cause I noticed that when i tried, i didnt have mnpm build --watch running 🙃 ...
I have the following patch (I know it might not work for future updates, but for now I just want it to work for now and fix it later ™️)
{
find: /canUseIncreasedMessageLength:function\([^)]*\){[^}]*}/,
replacement: {
match: /return\(0[^)]+\)\([^,],[^)]+\)/,
replace: "return (true);console.log(here);",
}
}
But when I try to run the plugin I get a:
Patch by Message Splitter Plugin errored (Module id is 74538): /return\s*\(\s*0\s*,\s*[^)]+\)\(\s*[^,]+\s*,\s*[^)]+\)/s
SyntaxError: Unexpected token ')" error
I tried putting the match function in double quotes (I know that wont work, but I was desperate 🤣 ), but then I get a:
Patch by Message Splitter Plugin had no effect (Module id is 74538): /returns*(s*0s*,s*[^)]+)(s*[^,]+s*,s*[^)]+)/
Does that simply meant that its not possible to patch the function, or am I missing something obvious (again...)
Delete all those \s*
Also, if it was successful, where would I see it? Cause so far, whenever I return to my breakpoints, the code is the same
They make it unreadable
Updated my message above
Check with patch helper that it patches what you expect it to
Have done so, and so far it seems like it should work
Looks like ```js
{let r=ef(e,t,n);return (0,L.og)(r,e.interval,e.intervalCount)}
{let r=ef(e,t,n);return (true);console.log(here);}
Other than the console.log never being reachable that looks correct
Does compile button say ok?
Yes
Hmm. Thats wierd cause it should look like this:
I propbaly need to refine the find part
youre patching the first return it finds
find is supposed to find the module not the function
Ah, I see. That makes more sense..
So in my case it should be find: WebpackModule74538? Cause that feels wrong
no remove the regex from the find
find: "canUseIncreasedMessageLength:function",
replacement: {
match: /(?<=canUseIncreasedMessageLength:)(?=function)/,
replace: "(()=>true)??"
}
Ah, okay got you.
Thx
Okay, that seems to work a lot better. Thanks!
However, I still get the
Patch by Settings had no effect (Module id is 394644): /({(?=.+?function ([A-Za-z_$][\w$]*).{0,120}([A-Za-z_$][\w$]*)=[A-Za-z_$][\w$]*\.useMemo.{0,30}return [A-Za-z_$][\w$]*\.useMemo\(\(\)=>[A-Za-z_$][\w$]*\(\3).+?function\(\){return )\2(?=})/
error.
Which seems wierd since there is regex mentined that is not inside of the match. (Again, I am very new to patches, so please bear with me.)
yes
I wouldn't know, I don't write failing patches
wtf
thats a different plugin though
Oh
true
my bad
I was so focused on looking for errors, i didnt look for what the cause was 🤣
If there's a failing patch in Settings, consider updating your vencord
Its the newest version on GH
It was fixed on dev not long ago #👾-core-development message
It works!
Thank you so much!
However, I get a error from Clyde 🤣, which is proably why it wasnt intergated into FakeNitro yet...
Should have thought about that
might fix this
True.
Maybe staying up for 48 hrs to throug this "quick" ™️ plugin together wasnt the smartes idea XD
Admirable, but inadvisable
Just one more reload
sorry but ive never seen someone write throw so wrong before
My tired german genes kicking in XD
Atleast now I know how to look for the right hooks, and how to properly write a patch, so theres that.
not easy to fix
I mean in the console log yes it's easy but it would just be replacing the expanded version to the old
Just monkeypatch .toString() on the expanded regex 🤣

Is there a way I can open links in my discord itself (vencord)?
I've seen in vesktop thats possible even though its in beta phase. I don't wanna install vesktop because it has a rpc bug for me.
would be a pain but technically possible
this isnt support guys !
How long would it take for someone to make that?
...
like if this link was in your browser? <#🧩-plugin-development message>
change it to discord://-/channels/1015060230222131221/1032770730703716362/1279160927341645844
Huh?
I guess you didn't understand what I meant, try using vesktop once.
huh
I want my links in my discord to open inside discord.
so like https://google.com opens in discord?
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
I send https://discord.com -> I don't want this to open in my browser like chrome or something, I want it to open inside discord itself.
Correct, you can do that in vesktop but there is no plugin for vencord.
oh weird
Would it not be easier to try and fix the RPC bug stopping you from using vesktop?
There is no fix, already had a chat with the community regarding this issue.
I see
Is there something I need to do to fix this?
is there an easy way to see if some CSS selector match anything unwanted in discord without running the command constantly ?
like for now what i do is this and navigate around discord
let intervalId = setInterval(() => {console.log(document.querySelectorAll(':has(> [class^=collapseButton])'));}, 1000);
obv i change my css selector
Just set a background: red !important; on it
IG if anything break i'll see (or rather i won't XD)
Julienraptor02/Vencord b36da65
i enabled it if you're fine with the space it takes
i disable it usually cause i find them unecessarily too big
feel free to delete this message
oh my bad gang I just thought you didn’t have embed permission so I was embed serviced you
thanks XD
Is there a plugin to fix channelids?
Example #1032770730703716362 changes to #🧩-plugin-development aka [#🧩-plugin-development](/guild/1015060230222131221/channel/1032770730703716362/)
It's called TextReplace, and is typing the <> that hard?
No but I'm a bit lazy, would be easier if I had to type less.
this is the second time you're posting support questions here...
v- programming
guh i should've redirected to support initially 
is there a sane way to make submenus, considering this is my current code
<Menu.MenuGroup label="Commands">
{SelectedGuildStore.getGuildId() === GUILD_ID &&
<>
<Menu.MenuItem
id="mute-1h"
color="#ff0000"
label="Mute for 1 hour"
action={() => {
showPrefefinedDurationModal("1h", user.id);
}}
icon={SafetyIcon}
/>
// ...
}
</Menu.MenuGroup>
so it would be in commands -> then my options
uhhhhh pretty sure its possible
@hoary pilot it's literally just children of MenuItem to make a submenu
insane
change your MenuGroup to a MenuItem and give it an id
ahh is black
why's it black
#user-context-vc-staff--mute-1h[class*="focused"] {
background-color: var(--menu-item-danger-hover-bg);
color: white;
}
#user-context-vc-staff--mute-2h {
color: var(--status-danger);
}
#user-context-vc-staff--mute-2h[class*="focused"] {
background-color: var(--menu-item-danger-hover-bg);
color: white;
}
#user-context-vc-staff--mute-custom {
color: var(--status-danger);
}
#user-context-vc-staff--mute-custom[class*="focused"] {
background-color: var(--menu-item-danger-hover-bg);
color: white;
}
you love
is there an easy function to check if a user is able to see a channel (or better, get a list of users who can see a channel)
Permissionstore probably
Check show hidden channels
What's the best way to update a component when something changes in plugin settings? (via direct value changing, not ui)
useSettings(["MySetting"])
I might be stupid but isn't that only for vencord settings, not plugins
what?
im stupid, its settings.use
not useSettings
Hello 🙂
Where can i get the "notify" thing like "Script Activated" and the button Okay in blue ?
Which plugin?
index.tsx: Line 57
function PickerModal({ rootProps, close }: { rootProps: ModalProps, close(): void; }) {
index.tsx: Line 133
const key = openModal(props => (
is there examples ??
Did you see the links in the message you literally replied to
ye
i just don't understand this code
Then the answer to "are there examples" should be obvious
what do you not understand about that? (learn typescript and react before making vencord plugins if it's that)
i know a little of ts, i'm better in js thats why but
i don't understand how the modal is created
Do you know jsx
yes
then clarify your problem, cant really help if your question is so genera
look at the structure of the modal there, how to open it and then just look at how it works, experiment with it a bit, and when you get a problem doing that, ask for help again
i don't see where the modal opens
second link
i just see how he is formated
time ta go through every single thing marked as too niche in #🗳-plugin-requests and put them all in one plugin /hj
i wonder how that would even work
theres probably some things that mesh together
actually those are alerts
not modals
look at FakeNitro code and how it creates alerts
oh
I made a plugin to display embeds on a message where the sender surrounded the link in < >
I dunno if it'd be allowed though since getting the embed data is an api request so I don't know if it falls under self bot stuff, although I don't think it constitutes api abuse at all 
Also might confuse people that would (understandably) think this is what the current UnsuppressEmbeds plugin does
what does the current supress embeds do
It lets you undo this moderator action
But that's just if you already suppressed embeds on a message that had them
terrible name
should not count under self bot cause 1 click > one discord action thing
That's cool, conveniently the endpoint takes an array of urls too so even if there's multiple in the message it's still one request
what?
I think it's less that UnsuppressEmbeds is a bad name and more that there's no good name for whatever <this> is
Besides also suppressing embeds
show hidden embeds
Perfect
showHiddenEmbeds
shhhhh
no spaces in names is better
ong
don’t caps the s either
blocking would go crazy rn
not again:(
ShowHiddenEmbeds
ShOwHiDdEnEmBeDs 🧽
👀🙈Embeds
xd
does it work for images
also can you send a link to the code?
I'll upload it after work 
I changed it to not just be <links> but any link that doesn't have a matching embed on the message, so you can use it to retry failed embeds (looking at Spotify smh) or in a channel where the person didn't have embed perms
And put the button in the context menu for each link rather than on the message popover
How would i debug native functions? Apparently something is erroring and im not sure what exactly
run discord from terminal
can a patch predicate depend on other plugin being enabled?
patches: [
{
find: "this.isCopiedStreakGodlike",
replacement: {
match: /VencordOriginal:(\i),/,
replace: "VencordOriginal:$self.wrap($1),"
},
predicate: () => isPluginEnabled("SpotifyControls")
},
],
my current attempt however i dont think it likes calling isPluginEnabled there
ah well i figured it out
predicate: () => Settings.plugins.SpotifyControls.enabled
dont import ispluginenabled
use Vencord.plugins.isPluginEnabled global
or you will get circular import
heyooo, wondering if anyone knows how to forcibly update the server list/guilds bar from a plugin
adding pinning pindms categories to the server list, and i need to trigger it to rerender somehow, otherwise it only updates when the selected channel changes
i am seeing that the array i'm screwing with comes from the PrivateChannelReadStateStore, so if there's a way to force a refresh on that it'd probably do it
scratch that, found out i can emitChange() on the store to trigger it :3
Can i somehow send IPC Events from native and react to them in the frontend? Im running a couple of system commands in native and id love to have an info label so the user knows what exactly is going on and isnt confused by "nothing happening"
I love useSyncExternalStore for this
what does that do?
as in, for react components
its just a thing to easily make a react hook without a full store, idk how much other people recommend it
regarding getting data back to renderer, the first argument in native should be a webcontents iirc
hm
theres a plugin ipc thing
i've never actually used that
idk what i'm saying right now
someone probably said to use executejavascript on the webcontents to send stuff back async
at one point
i cant remember
Would this be a reasonable way to allow masked link pasting if shift is held or is there something I don't know about that would make this dumb for whatever reason?
It works fine but you never know
i wouldnt put it on the window
make it a property of the plugin object, in the replace you can then just do $self.shiftKeyDown
But ctrl-shift-v is a completely different key shortcut, isn't it?
Looking into it more it doesn't feel feasible to use anything but shift because this isn't a paste hotkey I'm registering, just a modifier to check when discord is determining whether to mask the paste
Ctrl+shift+v is just paste as plaintext which doesn't make a difference in discord as far as I know anyway and this also works for shift clicking the paste context menu button
Otherwise I think I'd have to be pasting the text and doing the masking manually or something and I don't think that's feasible
But I could be thinking about it wrong
It doesn't matter much because I doubt this is going anywhere but preference?
Took a bit to get round to it sorry https://github.com/lolsuffocate/vc-showMessageEmbeds
It's still a WIP and needs cleaning up in general but it works 
?remindme 5pm take a look at this plugin
Alright @flint bronze, in 3 hours, 36 minutes and 29 seconds: take a look at this plugin
@flint bronze, <t:1725585811:R>: take a look at this plugin
take a look at this plugin
take a look at this plugin
take a look at [this plugin](https://github.com/Vencord/plugin-requests/issues/1#issuecomment-1957949593)
You mean
take a look at this plugin
yeah my textreplace is bad
@flint bronze, <t:1725598978:R>: take a look at this plugin
is this an OK way to get a module's ID from a findByProps call idk if this is dumb
let results = Vencord.Webpack.search(findByProps("InboxIcon").InboxIcon.toString())
let [id, moduleContent] = Object.entries(results)[0]
I'm looking at Vencord Docs for info on how to create plugins, but I can't find anything on how to reverse engineer Discord/use APIs and stuff to actually do something.
Does anyone have any idea where to get started?
lets start by asking what do you want to do
may I ask what do you need the id for, I wanna know your use case
I've only had one time I needed the id and it was for a very tricky case
I'm testing stuff with finding what other modules a module requires
function findDependents(moduleID) {
let match = Vencord.Util.canonicalizeMatch(RegExp(`(\\i)=n\\(${moduleID}\\)`));
return Object.entries(Vencord.Webpack.wreq.m).filter(([moduleID, module]) => module.toString().match(match));
}
I could not access the full module content with the findByProps i need to use wreq.m[moduleId] for it
srry for shit wording im tired rn
ah, I see
Remember that require() might not be called n, and other functions might be
totally unrelated but String.raw is useful here
let match = Vencord.Util.canonicalizeMatch(RegExp(String.raw`(\i)=n\(${moduleID}\)`));
damn thanks
no need to escape the escape haha
Escape the haha
😭
Nice little side effect I hadn't even considered, you can view embeds for links in other embeds
haha thats so cool
This is so good
+908312908321 if it's automatic
(with an embed count limit)
"automatic" erm... selfbot (/joke)
It gets rate limited quite quickly anyway
is it unfurl endpoint
Yeah
Fair question.
Thing is I don't really know.
When learning something new about coding, I first want to look at the big picture, get an idea of how to get the most basic things done, and only then do I think of what I could do with that knowledge.
For Vencord, I have some vague ideas of things I'd want, but nothing clear.
im prob stupid, but can vesktop use native plugins
ofc
Please keep this
100%
At the moment is also has options to swap out twitter embeds for vxtwitter, instagram -> ddinstagram etc but I'll remove that if I ever PR it or anything since those domains could end up becoming anything in future
Take a look at how TextReplace does something similar
I did think about letting people define their own replacements but I didn't know if it was overcomplicating things
how do you find out where a modal was opened from
been trying to find with devtools for ~30 mins but havent had any luck
you could always breakpoint the open function
but id go the trusty way of looking for i18n strings and seeing where they are used
guhh thanks
always forget about that
also for later reference, wheres the open func
I found:
Vencord.Webpack.findStoreLazy("StickersStore")
Is there a better function I can be using for a js snippet for access to stickersstore ?
And I would need an override to make a button like that right ?
Obviously not with the weird group dm mspaint text
After clicking on that i could do something similar to the layout of friends
is this a known discord type?