#🧩-plugin-development
1 messages · Page 52 of 1
It's still decently usable.....
yeah
Through the chrome dev tools? I'm assuming theres different ones for the react stuff
Yes.
If you're using Vesktop the React DevTools should be preinstalled
Nope, just using the external version
Should I use that one instead?
Vesktop is much easier to use for Vencord dev
Ohhh ok
you only need to change the dist dir in settings once then pnpm watch in the project dir then reload to reload your changes
instead of build/watch, inject then restart the whole client
also it actually supports screensharing on linux with sound, something discord never did themselves
That's really cool
Jokes on you i have a rebuild button on my toolbox 
show me
is this your own fork
Yeah i made my own version
you should contribute it to upstream and make it replace the updater menu
maybe
idk

its supposed to be green
its probably just the theme you're using but that dropdown doesn't have any depth
I noticed the Vesktop source dosn't have a plugins section
Is it because it's pre-embedded into the program?
you can change where vesktop loads plugins from later
So, use Vesktop as a tool to analyze react events, but the regular Vencord for actually working on the plugin
Oh I see okay
The dist names for Vencord and Vesktop are different. Will that cause an issue?
you should not be pointing your dist at your injected vencord
point vesktop at the dist generated in your Vencord git repository
Okay I see

I've been on vencord all this time 💀
Amazing
i said that wrong didnt i
i think the way I am doing it is right (PLEASE correct me if there is a more formal way of doing it)
@flint bronze Sorry if my questions seem naive, it's because I am not a super experienced developer, and this is the first time I've worked on a large collaborated project
I've figured a decent amount myself so far so I don't put the burdens of my inexperience on you guys
You're fine
Ty !
As long as it's not in support and you're not having problems with actually installing the dev build then ur good 
Haha yeah
Just figuring out how to log to the console was quite exciting lol
Can someone send me a screenshot of where the react tools are?
Haha wait nvm
Haha yeah
I couldn't see them, but I found the toggle just after I asked
Don't worry, I am also experiencing a bit of imposter syndrome
But I am an imposter idk what I'm doing 😭
Don't worry, this is how a lot of plugin dev goes. The thing you're missing is how to find what to patch
Haha yeahh
it's a bit hard to explain but it's a lot of ctrl+shift+f in sources and look for keywords
also make sure to read the docs dir and contributing.md
Okok
I'm just trying to make sense of what I'm seeing
I'm learning react as we speak lol
you might want to look at the parent elements of whatever you've selected
Don't worry, you're fine. I have barely any idea on how to use react either 
We are so back
I took like 30 minutes to port it from using settings to store the sticker ids, to datastore
It just makes my brain stop hurting
dont worry
Omg I just found out how to find the react source
1 step closer
Now, I have to read it
Why the fuck did i burst out laughing from this 💀
HOW DOES A BUG LIKE THSI EVEN HAPPEN
Probably react's pre-emptive stufff
Yeah
I'm having issues with force re rendering the component
Since if you unblock a sticker, it won't disappear til you reload
So it's really weird
Guh yeah i have no idea how to do this

can someone fall asleep on their keyboard in here for me, thanks
@slow charm i was modifying your TypingIndicator plugin to add avatars, thats what I have been doing in #🧊-off-topic-iceman-only
thanks for the snippet link in there

In the future, just use this
It's been a hit minute, so it might need some updates
I got linked to this already
.
I think i'm doing something very fucking wrong
How the fuck did you even manage that

Are you using a component optiontype with a select? that's literally the only situation i can think of where that would happen
Wait so are you using the select optiontype
Yeah. Is there a better way to do this?
It's kinda hard to assess the situation but i'm pretty sure you're not doing it right
Could you share more of your code
Bitmask hell instead of having a "both/all" option
Christ
It's probably not worth the effort lmao
At the cost of just adding an extra ||
this is probably the cleanest way of doing it 
why did you husk your own message 
needed to inspect the reaction
now completely self reliant, no more special npm packages!!!
(The string in the attachment is the message below it)
yeah, maximum string length bc of the key sizes
at 2048 I can have max 190 per chunk
Lemme try 4096, before it was being wack and causing discord to take longer (noticably) to load (not good for UX)
4096 works better now, (maybe node-forge was causing the wackiness)
much much better
and I can make the chunk size be 446 chars now!
void Main()
{
print(Text::ParseInt("hijklmno")); // returns 0, should instead raise an exception
print(Text::ParseFloat("hijklmno")); // returns 0.0
print(Text::ParseHexColor("hijklmno")); // returns vec4(1.32549, 1.21176, 1.47059, 1.60392)
}
hi what the fuck
angelscript
Never heard of it, sounds shit
it is
Might be something similar to https://stackoverflow.com/questions/8318911/why-does-html-think-chucknorris-is-a-color#8333464
because there is no .IsNumeric or .IsHexadecimal property for strings, i have to do this shit:
bool IsNumeric(string _s)
{
const array<string> NUMBERS = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
for (int i = 0; i <= _s.Length; i++)
{
for (int j = 0; j <= 10; j++)
{
if (_s[i] != NUMBERS[j])
return false;
}
}
return true;
}
I love how this looks extremely stupid until you realize how it works 
also this code is literally wrong lmao
it will return false for everything
unless "0"
"0" isn't equal to every digit simultaneously
oh right
how much does it make difference
it doesn't
tbh idk why anyone would ever use Object.frezee
most useless function in javascript
No that's print()

nah idk i freeze my stuff so i dont accidentally write to it
better safe than sorry
I can see benefits of freeze, but nothing a good type system doesn't do better
the typescript in question:
ok?
^
don't you get an error if you try to write to a frozen object
You get a compile error if you even try
well yeah thats why i do it
tbh i can't even imagine a case where id accidently write to some random object
maybe if you typo if (foo.bar = "hi")
me neither but thats not really the point
but typescript can catch that
Maybe if you're handing it into some untrusted function
freezing it costs me like nothing
why are u using things u don't trust in the first place 
js is not the right language to be doing that
Discord is full of functions I don't trust
idk i mean do you trust the plugin authors of vencord?
There will be no point-making in this household

idk just use const enums :/
let's be happy they don't
Hey, y'all! I have a problem that would like to solve using vencord.
I'm a moderator of a relative big gaming server and would like to automatically check if any of the members there are also part of another specifics servers (hacker servers) so I can know who I should ban or not. (No automatic ban, just retrieve their ids so I can ban them manually)
Would it be possible with vencord? Risky to do so?
I am part of them, I check members by going to the "servers in common" manually, I just want to automate it since its a big server
yeah i guess
for a normal discord bot, the bot would have to be added to the hacker servers, no?
yeah the bot would have to be added
20k+ members, the vencord plugin would access the list members of my server through my account and go to their "servers in commom" page through my account to check
I don't mind creating a fake acc to use it if necessary
not the server itself, its a gaming server focused on a specific game, and I want to keep it free com cheaters of that game
there's a bunch of hacker servers that sell cheaters for the game
nop, GTA V
nah, normal game
ye, and like to keep the community free of cheaters to the best of my capabilities
wait s
but with 20k+ members its hard to check them all manually
players reports, socialclub info, screenshare, etc
thats waaaay to much effort for just a gta server
i reckon you just
move to five m
its incredible more easier to moderate, and there are quite alot of discord intergrations
I mean, how I moderate is not really needed to the problem I wanna solve
fair enough, was just letting you know
Apprectiate it but we won't move to fivem
alright
well the only solution that is plausible without getting banned is a discord bot
because getting the members from another server and checking if they're in yours is kinda selfbot
yea, I don't mind creating a burner acc if needed
dont get banned
?
it's not possible
you would need to spam the shit out of the discord api to get all mutual members and its just not feasible at all
ye, I was thinking of limiting the request per second and only checking the online members
unless you have moderator permissions there, it's not even possible to just fetch members
Super trivial to circumvent too, just use an alt
so instead you would have to fetch the profile of every member of your server to get their mutual servers
which would mean one request per member, so in your case 20k requests?
that's not possible + we won't help with such api abuse
also just because they're member of that server doesn't mean they're cheaters.. you're a member there too after all
Hi, i tried making my own plugin and i used the https://github.com/Vendicated/Vencord/blob/main/docs/2_PLUGINS.md i just edited the Values mentioned to change, but i get a error at pnpm test witht the following error:
1:1 error Missing header simple-header/header
16:4 error Newline required at end of file but not found eol-last
✖ 2 problems (2 errors, 0 warnings)
2 errors and 0 warnings potentially fixable with the --fix option.
ELIFECYCLE Command failed with exit code 1.
ELIFECYCLE Test failed. See above for more details.
i already helped you in #🏥-vencord-support-🏥 why post the question again
the --fix is used with build or test or what?
we know what servers are sus and what servers are just for selling cheats. I could just use it on the online members only and limit the request per second, like I said. But oh well, I will just give up
pnpm build --fix does the same as without, it doesnt really help
It's pnpm lint --fix
what does lint do?
Run the linter
thanks
Yes, pnpm lint runs eslint
I thought maybe object.freeze had like some performance gains
but if it doesnt its really pointless 🥴
then only thing you would lose by using regular enum is few more bytes of transpiled code
nah it doesn't
maybe marginally at first but jit compiler will make these optimisations for you
v8 my beloved
p sure someones made that plugin for bd or replugged before
looking at how that works might help
cant help with learning the vencord api tho
You don't read the localstorage directly, use the stores
what the fuck
Wasn't the experiment for disabling notifications without dnd? Or maybe it's separating the two in general
lmfao
data data data data
why are you making a end-to-end encryption plugin?
discord is pretty secure by default
Your private key is [object EncryptKey], gonna haxx you now
You can send custom emojis, without Nitro
and it's not just attaching an image to the message
huh
(It's because the decrypted messages aren't being sent from a real user, it's just the receive message function)
the emojis are bypassed bc they're encrypted and thus discord doesn't see it
But it's no fun if it's not visible to vanilla clients
yeah, it's just a cool bonus I found
and the messages aren't visible to vanilla clients no matter what
nop
@dull magnet@vast karma it was focus mode, which is implemented as a DND or Focus mode silences notifications
sounds interesting, you mind handing up your github? or you don't post them in github?
How hard would it be to monitor people's voices in vcs and normalize the volume 
Probably pretty hard, isn't the audio handling in a wasm blob?
I have no idea 😁
I have a pretty major update that I have yet to push
on discord app: impossible
on web or vesktop: doable
dang
How can I check whether a user has a specific permission?
I had a look at PermissionsViewer but my tiny brain can't comprehend the magic
I think there was a few plugins that do that you could look at
Couldn't name them off the top of my head though
look at any plugin using PermissionStore.can
but that will return false for DM channels so you need to handle those differently
depending on the permission it's safe to assume dm channel will have it because, for obvious reasons, dm channels always have permissions like embed links and stuff
Ty, but I’m gonna “fix” it by just not using an attachment
I’ll just have the public key be appended to the join message
this is very much a 
would it be possible to make the soundboard work everywhere, by intercepting the RTC traffic?
real time clock traffic
Lmao
That’s just unfair 💀
I’d hate to not be able to mute somebody’s constant meme sounds
yes, so I can change others time
that's not how it works
theoretically yes you could inject soundboard directly into voice streams but that would get annoying very quickly
You can mute a user’s soundboard
and you can mute a user too
Hi, I have an idea for a plugin for Vencord but as I've seen no one do it, is it possible to make a menu like the gif but for something else unless you have to recode the whole thing?
what would the menu do?
It will offer the ability to select videos from a video library (meme) like Tenor
so, favouritemedia + gif categories which are in dev?
something like that, with your own backend provider for the content maybe?
Yes or another platform
cool facts: discord already uses tenor to provide the gif picker
It's for gif but for video
(Web) RTC = Web Realtime Communication
n.value > 0 || n?.multiplier > 1 isn't an expression that makes sense under any circumstances, is it?
what
undefined > 1 always evaluates to false so
I think that makes sense however you're doing some gross type casting
I mean that the ?. will never trigger because n.value will throw an error first
how about you just use rust
ah yes that's true
Difficult to use for discord stuff
But I do for most everything else
😔
I don't agree, rust isn't a magic bullet for everything and people who think it is are kinda annoying 
lol
the point wasn't about using rust specifically
bro thinks discord is gonna switch to tauri because of some random guy on the Internet 💀
I don't agree :)
||but yeah it def is not||
scripting in rust 😬
tauri shills are so braindead
tauri sucks ass
it's ok
it also takes security more seriously, by isolating the client environment from the outside world, and letting the developers manually enable features as needed for their specific app
this person obviously has no idea what they're talking about. electron also has this
but I'm too dumb to use rust
tauri is also missing some features 😉
It's still running a whole browser isn't it
memory and cpu usage will remain similar
because most of your app happens inside the browser. both tauri and electron use chromium
if you know what you're doing, the native backend (nodejs) will only be a very small portion of the performance usage so it's irrelevant
tauri has no upsiders other than smaller install size
but it has plenty of downsides such as:
- lack of features/apis. electron is way more feature rich
- smaller ecosystem
- less popular
yes but it's not shipping it, but uses the system webview (Edge on Windows 🤮)
and even then you still have node native modules 
I want to contribute to the project, is there any documentation?
I cannot find any in the repo and on the website
3mb is better than 300mb
stil better than electorn
how would i remove my theme but be able to keep the title and logo edit up here
its lagging my client
Find the part of the theme that govern that part and remove everything else
nicenice, thanks
hmmm
i cant get the discord icon to change
oh
i managed it
nvm
I asked chatgpt to draw an svg of a hummer from the front
here's it's idea of a poodle
chatgpt moment
@remote kestrel
creature
Is there a way to get js bookmarklets in discord app?
(maybe not the best channel for this, but idrk where else)
like a plugin or something that adds this
Progaming
Progayming
Breh
Swift is the best language ever 💯
Citation?
-No one ever
I didn't know Odysseus had opinions on programming languages
how do you get all members with a certain role
Impossible unless you're a mod I think
im trying to learn how to make plugins but i dont know much about discord api should i try learning discord bots first?
where is GuildStore documentation and stuff
no
where are docs
idk
whats that
wheres the docs for internals 😭

Discord Inc haven't shared them
The documentation for the stores
is it in there?
those are examples of like how they work i think
horror
its proprietary code by discord obviously there isnt documentation
read the code
see how it works
see how discord uses them
thats what ive been doing 😢
basic reverse engineering
why nobody not writing no docs cmon
because there are tens of thousands of discord modules
why would anyone document them
cause skids gotta skid
if you need documentation this isnt the right thing for you
Also it's closed source lmao
you can just check the methods it has to see if anything is interesting
then read the code of those funcs and search for usages across Discord's code
and boom you found out how they work
be happy that we have full names and not minified names
whered u find that
Or open the module where it's defined, the stores are easy to find
where is that
it's all what
Yeah that is the code
Ctrl+shift+f
goated
I find that https://github.com/Kyuuhachi/VencordPlugins/tree/main/WebpackTarball and https://github.com/Kyuuhachi/discombobulate help considerably with making sense of the code (shameless plug)
im curious how those help you
its not obfuscated
its just minified
obfuscation would look way worse
Having each module in a separate file is extremely useful, and things like inferring variable names and undoing comma-minification makes the code way more readable
the wpexs in question

Wpexs?
I mean sure that works too, but it's way less convenient than being able to run a grep and open it in a proper text editor
Hm? Why does discombobulate crash on that module, it's not supposed to do that
Okay figured it out, it's because babel's scope tracking fucking sucks
you mean console?
that would make it so I have to copy the script, open the console, and then run it
instead of just clicking it
Pretty trivial to make ```ts
import definePlugin from "@utils/types";
export default definePlugin({
name: ""Bookmarklets"",
description: "Does stuff idk",
authors: [],
toolboxActions: {
"Example"() { window.location = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
},
});
How can I install this?
Like any userplugin
so I'd have to build vencord myself?
I've never built vencord myself
Am I supposed to use vscode?
ok found the sync - edits vid
Does stuff idk*
PR accepted
do I not need to put in javascript: (() => { })();?
bc that's how bookmarklets are formatted
javascript: (() => {
alert("example");
})();
That'd be syntactically valid, but unnecessary
My most humble apologies for not being able to supply a satisfactory rickrolling experience. I hope you will find it in your heart to someday forgive this most capricious oversight.
hmmm
would there be a way to make it so I can edit the bookmarklets without having to rebuild an d restart discord every time
Dunno, probably
why are you doing javascript:
that's already javascript you dont need to do that
Mutating toolboxActions at runtime works fine, so you'd just have to make a nice ui for it
this is not a bookmark.
yeah i'm doing it without now
How can I copy to clipboard?
navigator.clipboard.writeText() isn't working
no discord app
you need an explicit user action to copy to clipboard
how do I grant that?
but you can also try Clipboard.copy from webpack commons
Is clicking a toolbox button not an explicit user action?
you don't. explicit user action means the user clicking something
if your action is a toolbox action, that's an explicit user action
also i don't really need to copy to clipboard
if it put it in the text input box (where i'm typing) that would actually be even better
so you just https://xyproblem.info dyourself :p
don't do that
look how QuickMention does it
oops
well
i did want to copy to clipboard
but putting it in chat would work too
well this works nicely!
Very important business there
yes
How bad is my code
"Fibonacci"() {
var selection = window.getSelection();
if (!selection) return;
var input = eval(selection.toString());
if (isNaN(input)) return;
var eps = Math.pow(10, -10);
var phi = (1 + Math.sqrt(5)) / 2;
var index = Math.round(Math.log(input * Math.sqrt(5) + eps) / Math.log(phi));
var result = Math.round((Math.pow(0.5 * (1 + Math.sqrt(5)), index + 1) - Math.pow(0.5 * (1 - Math.sqrt(5)), index + 1)) / Math.sqrt(5));
insertTextIntoChatInputBox(result.toString());
}```
yeah but i want to be able to highlight things like this
also i did not figure out the formulas myself lmao
There's plenty of libraries for evaluating mathematical expressions (I assume), but you'd have to fetch those scripts first and that's a pain
Bare eval is also bad for performance since it messes with local variable scope; I think (0, eval)(...) is a somewhat obtuse way to avoid that
Compare ```js
function foo() { let a = 4; eval("a = 8"); return a}
foo() // 8
function foo2() { let a = 4; (0,eval)("a = 8"); return a}
foo2() // 4
eval(...) gets access to the function's local variables
would it make a var for 4181+610+(2*987)+4181?
This requires the variables to actually exist, which prevents the jit from doing a lot of optimizations
comma operator my beloved
And from how js bundling works, I'm pretty sure that'll make it so that quite a bit of vencord's code is not optimized
I absolutely hate it but it does have its uses
yeah i was being sarcastic i don't know why it exists
What userdata
I've tried all the things I can find
That's more of a lua term
like when it gets their globalname
Especially when minification writes things like return x=8,foo()&&alert("hi"),2+x; instead of a sane x = 8; if(foo()) alert("hi"); return 2+x;
but imagine the three (3) bytes we could save
You making a local user renamer?
yep
Should I try to prevent this
Uncaught ReferenceError: patch is not defined
at eval (eval at Fibonacci (1032770730703716362:218:31602), <anonymous>:1:1)
at Fibonacci (index.tsx:12:25)
at 21201.da6142151f12490392a7.js:1:119742```
WHY WOULD YOU EVAL
evil
just use the Number constructor???
does that work for expressions?
in fact you get a compiler warning if you use direct eval
Number() parses numbers, not expressions
it can't minimise anything that eval might have access to
yeah i got that
isn't that what eval does
Indirect eval has most of the security issues but less of the performance
But it's not like something like this would ever be merged so just yolo it
also probably needless to say no plugin using eval for smth like this will be approved
but it's fine for personal use
What?!?
crazy
yeah it's for calculating the next fibonacci number lmao
it's just for me
If you were making a proper plugin you'd use a library or a different library
now the next question why in the world do you need to calculate fibonacci numbers
fun
counting
Petition to rename eval to yolo
I saw the request and thought "I can do that"
var yolo = eval
-var
+const
why does venbot react to that lmao
because ar is an alias for addrole
and v is the prefix
var image sender @tropic ice
huh
var is more global than const anyways
Yes and global variables are not good
wtf is this lmao
why
well in this case its an alias so its fine
omg
wait can venbot give a role higher than the one using the command has DFDSFD
The more local your shit is the less risk of some other part of the program fucking your shit up
it's a role
- try it and see
- no
nice nice
Who is in @me role
var the almighty @cedar olive
idk but seems like it's donor role
top right
I think I should probably switch to a list
Circling back, what would be the function to patch to change a user's globalname locally?
Easiest would be to change it in rendering for a specific component, but I assume you want something more global than that
The transformUser function (same module as UserStore) seems like a good candidate if you ask me
It's not patching, even though patch helper says it should json { find: "transformUser:", replacement: { match: /return g/, replace: "$self.check(g);$&" } }
That's a terrible patch
Are you sure it's even patching the right place
Because it sure won't be patching the right place in a week even if it somehow is now
Yeah that's definitely not the right place
oh lmao
Patching the exports table is generally not useful
You want to patch the function itself
it's the only transformUser I can find
Yeah but you'll want to transform the actual function, not the export table
What's that check function do?
If it does a console.log it should show up exactly once pretty early during loading
...Wait of course it's not, that function is never imported anywhere else so that's never called in the first place
The export table isn't used when calling the function from the same module
gtg
What is that require.d(exports, { ... }) indirection for anyway? Prevent monkeypatching?
Hello, thought this would be more related to here, are there any docuementation explaining how to make vencord plugins?
Did you check the docs folder
A yes i see it, thank you
no it doesn't prevent monkey patching
it assigns the second object to the first
why it exists? I don't know I haven't looked for an explanation of that in webpack
I think they would need a more sophisticated system than that one to prevent monkey patching, lmao
even then I don't think they can
If they tried you could just patch that prevention out
^
yes you could
I'm trying to like patch this: json { find: "_.Endpoints.USER(e)", replacement: { match: /getUser\(e\);/, replace: "$&console.log(t);" } }
it's not logging t though
here it is all patched up
to define exports as getters
because that's the only correct way to implement es modules
modules can reassign their exports at any time and importers will have their imports update in real time
the only way to achieve this is via getters that return variables
Fine, here’s the x problem: what do I need to do to intercept requests for a user’s globalName (so I can replace it with another name)?
consider instead patching the place(s) it is rendered in
try to understand how the chat and similar places obtain it
patch that instead
there's one plugin that changes the way usernames are rendered in chat. that might also be of interest
Take a look how friend nicknames work then remove the friend checks and replace the output?
anyway
Alr
Does anyone know a the proper way to get s sum of all mentions, and render it?
Did discord update the mobile app so you can’t swipe out of channels now?
So annoying
I think its some quick tab thing they added, I use tablet layout mobile discord so I wouldn't know
mobile discord gets worse by the day
There trying to make somewhat better
Before I try and continue this, can somebody let me know if this is a fruitless idea, I.E. it’ll be denied immediately
And also the fact that it’ll have to compile at runtime 
yes it will be denied
Ven has already worked on 3rd party plugins and discarded the idea
Looks like a perfect way to get more people asking for support because of 3rd party plugins
Cool idea but such a feature really doesn't work well with Vencord's architecture and as it has already been stated, this will be discarded immediately
Idea discarded
how much worse is this
var selection = window.getSelection();
if (!selection) return;
var fibminus2 = 0n;
var fibminus1 = 1n;
var fib = 1n;
var fixedSelection = selection.toString().split('\n');
var input = BigInt(eval(fixedSelection[0]));
for (let i = 3; fib < input; i++) {
fib = fibminus2 + fibminus1;
fibminus2 = fibminus1;
fibminus1 = fib;
}
fib = fibminus2 + fibminus1;
insertTextIntoChatInputBox(fib.toString());```
also is there a way to replace the chatinputbox if there's something already in there
and .split('/n' is so it works if i triple click a msg
I'm trying to patch the module that has the newleaf message, but it seems like there's 2 of them? is there a way that i can patch both of them
I know you can set all to true in the patch to "apply to multiple modules" but it doesn't appear to do anything in the patch tester, or in the actual client
Oh that makes sense
Is it a better idea to just patch the code that displays the message instead of patching the message then?
Absolutely
if it's only used in one place yeah
or even if not actually
you can set the patch to all too
amazing
Is there a way i can export all datastore data to a file so i can port it between devices/installations?
Dunno, probably some way to export localstorage in devtools
💀
Me 🗿🤝
is there a way to add something to the right click context menu/buttons panel thing that only shows up if the msg meets a requirement (like being all numbers)
**index.tsx: **Line 156
addButton("ViewRaw", msg => {
I would assume returning nullish works to hide the button
read this
so both null and unefined are nullish?
oh cool pnpm watch exists
wish i knew that yesterday :)
although doesn't seem that much easier than build
What's the best way to not use eval(), but still have it work with like 1+2+3*4
pretty simple expressions
what would I do if i were to make a pr'ed plugin (prob won't actually make) that evaluates math expressions
bc I don't think downloading a fancy library would be good for a pr
Either add it as a dependency or load it at runtime
Is there a way to work with highlighted text built into addContextMenuPatch() or do I use window.getSelection()?
If nothing is highlighted, i want to use message.content, but if something is highlighted, i want to use that
this is only working for highlighted text
Also how do I stop pnpm watch
Can I just close the console
^C, as always
Ctrl-c (sigint) is how you close just about any terminal program
ok
*(Reposting so it doesn't get buried in the previous convo) *
How can I update a user's custom status?
update your status and look at the requests tab in devtools
also it sounds like your about to make a selfbot
they're making a local user edit plugin
i don't mean to be mean but you should honestly just quit because you seem to have no clue what you're doing and asking for help very poorly (xyprobleming) at every minor step
that's just not productive because you're not even learning anything from it
try to do your own research and use tools like react devtools or searching the sources for keywords to find out how to do these things yourself
hey guys, the plugin requests, is it handled by the third party plugin people aswell? or is it solely the vencord dev team?
my plugin request has been there for 3 weeks now, i don't think its being open and closed in order 😢
If the devs think it's a good ideas they'll make it, like how they made member count toggleable but that needs to be merged
plugin request is like lottery
Fr
just because you made a suggestion, doesn't mean it will ever be made. only if someone likes the idea and picks it up
if you want it this badly, make it yourself or pay someone to make it for you
Didn't realize there was a way to pay someone for it, possible to pay vencord team for services?
u can technially make ur own plugin and just use it with vencord
im pretty sure there is a way
dont ask me how i have no idea
Okay haha, sorry to you guys for being a pain, I'll do some research!
no prob
You can pay people for anything
As long as you find the right person and it's not illegal
tbh there is lots of ppl on fivverr making trash plugins for $50 smth
It's just a plugin that makes every users webcam and video shares pop out separately
I don't think would be illegal @vast karma
Also Vee sorry for replying, I just read you bio saying don't reply for support
cant you do that natively?
like without mods
I don't think so
You can pop out the full vc menu
But not seperate cameras
ah
Yeah , it happens all at once which sucks
is it possible to open new windows from a plugin?
like window.open("https://google.com", "popup")?
yes, but does this work in electron
too lazy 😴
how to use it
searched but couldn't find
forgot I have my run code command, and console exsists 💀
eval() probably
yes
ruh roh
so I don't have to open console all the time
ik it's not good for optimisation
ESBuild warned me
but doing window.eval() dind't work
That seems kinda impractical
because opening dev tools has a big impact on performance for me
Pc with 2.4 mb of ram 🙏
that's not normal
from where do I know what module to search?
for the find property?
I always forget to disable the devtools, bc I have a 21:9 monitor, so it doesn't take up too much real estate 😆
for 8GB RAM Laptop it is
Not sure why you replied to a day old message
But ctrl shift f
Devtools makes things slow in firefox too
because of the screenshot
Accidentally doing while (true) in Firefox was not fun
how do i know what to put in the find property
Find some string that is unique
Messages.SOMETHING and the exports block are often good choices
Find something unique that's close to the replacement
so an parent function/object/class
Just has to be something in the same module, but something that is relevant is best both for documentation purposes and resilience against refactoring
Heavy on the resilience against refactoring
Also important to not include any minified variable names, since they change with every discord build
I can't seem to find a specific channel change/load function (like ChannelStore.setChannel(id)), so are we just supposed to use location.assign()?
look in webpack commons
alr
Pretty sure you're supposed to use NavigationRouter
Either find a plugin that does something similar and copy that, or find something in discord itself and dig out how it does it
also if you look one function below you'll literally find a function called "transitionToGuild" which takes a guildId, a channelId, and a messageId
💀
In the patching docs stands I should press CTRL + SHIFT + F to search all bundles. In the DevTools or where?
in a chunk datamining repo?
In devtools usually, yes
I am trying to replace the default avatar in the shop, but I can't get it to work
bad find:
but I can't find a string that is "near the function"
or a variable that contains the URL for the default avatar
how can I find a better string?
{
find: ".getIsProductNew(",
replacement: {
match: /(?<=\.avatarContainer,.+?src:).+?(?=,)/,
replace: '"your new url"'
}
}
I made it for you
it changes this
or if you want to change in all places
{
find: "f6c7b8245d3a54cf98b2",
all: true,
replacement: {
match: /\i\.p\+"f6c7b8245d3a54cf98b2\.png"/,
replace: '"new url"'
}
}
try this if you want to change in all places the placeholder is used
\i.p+ seems more suitable

Use patch helper, it tells you if your find sucks
I saw the patch wasn't good, but I didn't kwno how to do it better
I am trying to make a plugin that removes zalgo text from messages, I have a regex I want to use, how would I remove that from text (mainly usernames and messages). I dont currently know if I can do it through the patches: tag, because that seems like it is only for core components.
a patch can patch anything as long as you can find the component through a constant string
Ah, any way to run it through a regex? I dont want to manually add each zalgo character.
couldn't you just use the text replace plugin?
or does it only work on message contents 🤔
That only works on messages you send
.replace takes in a regex
Patch the message component, redirect the content to a function in the plugin then filter it there
by zalgo do you mean weird unicode
Yes
javascript has unicode normalisation built in
you want NFKC iirc
it won't catch something like russian letters iirc because well those are normal letters too
Thank you, I will try this first.
**index.tsx: **Lines 62-71
function clean(str: string) {
const replacer = Settings.plugins.VcNarrator.latinOnly
? /[^\p{Script=Latin}\p{Number}\p{Punctuation}\s]/gu
: /[^\p{Letter}\p{Number}\p{Punctuation}\s]/gu;
return str.normalize("NFKC")
.replace(replacer, "")
.replace(/_{2,}/g, "_")
.trim();
}
so I made this :(
clean(str: string) {
return str.normalize("NFKC");
},
patches: [
{
find: ".Messages.MESSAGE_EDITED,",
replacement: {
match: /let\{className:\w+,message:\w+[^}]*\}=(\w+)/,
replace: "$self.clean($1.message.content)"
}
}
]```
and it just crashes my discord whenever I open any sort of chat, it seems like it is assigning to the wrong place. (I was using references from InvisibleChat for message replacement)
you're removing all that code you're matching
and replacing it with something that does nothing
Use patch helper
Yeah I think I am going to just leave it here, I can't seem to get anything to work automatically, I may go the invisiblechat route of requiring a separate button press
i trying to make a bot for discord in python but i cant get it to import form the responses
help pls
ok
forgot
import token
from typing import Final
import os
from dotenv import load_dotenv
from discord import Intents, Client, Message
from responses import get_response
bot token thingy
load_dotenv()
token: final[str] = os.getenv('DISCORD_TOKEN')
intents: intents = intents.default()
intents.message.content = True
#message dead chat
async def send_message(message: Message, user_message: str) -> str
join discord.py discord or some other programming discord
alt
paste here and use python syntax highlighting
you didn't even send your full code and i can see like 3 mistakes
intents: intents = intents.default()
intents is not capitalized
intents.message.content
message_content*
token: final[str] = os.getenv('DISCORD_TOKEN')
final is not defined
I’ll fix those
^
Ik
waiting
One sec
like i said please take it elsewhere
like it says in the channel topic, this channel is not for beginner questions. there are better places for that
Sorry I forgot
are u serious
u didn't even finish the code
you must have generated this or something
Nope
this is like 1/4 of the code that you need
Then I’ll just code the rest
ok so come back when you're done
but what am i supposed to help you with
the code doesn't work because it's unfinished
^
I got chatgpt to finish it for you.
you're welcome
this is NOT correct
idfk what get_response but i simplified it
https://pastes.dev/h65FjzVjej
wow, what prompt did you say to get chatgpt to simplify it that well?
I’d hate if they start making pizza with AI. That’d ruin my business.
!catloot @jagged matrix
what
I DO NOT NEED AI IN MY FOOD
mfs will put fucking cyanide in apple juice
If they so dare touch pizza.
im sorry, I was trying to make a joke. The joke being that Mudkip simplified the code by hand, but I pretended as if he asked chatgpt to do it. It was probably quite unfunny to anyone but me.
this vencord shit real serious
you dont have to use ChatGPT to explain why your joke was unfunny yourself
||now that's called "sarcasm"||
im wondering if there's a mathematical way to get the selected color based on position in a color circle rather than the more straightforward way of capturing the pixel data underneath the cursor
find distance between the center and the coordinate (for lightness)
find angle made by center and the coordinate (for hue)
hmm
how reliable would that be
like
would that match up with the actual displayed color
it would if done correctly
i wonder if I can get the color at a position in the gradient
you could also draw the color wheel itself with those equations
how
canvas and webgl/webgpu
I'm doing this with compose
Skia canvas
uhh I hope there's a method that I can use to get a color from a gradient
maybe I'm overlooking
// x, y
origin = [2, 2]; // center of the color wheel
cursor = [4, 4]; // position of picked color
maxdist = 8 // max possible distance
sqr = (n) => n * n;
// distance = sqrt( (x2-x1)^2 + (y2-y1)^2 )
lightness = Math.sqrt(sqr(cursor[0] - origin[0]) + sqr(cursor[1] - origin[1])) / maxdist;
// angle = arctan2( (y2-y1), (x2-x1) )
hue = Math.atan2((cursor[1] - origin[1]), (cursor[0] - origin[0]));
[hue, 1, lightness] // h (radian) s (0-1) l (0-1)
this is how you would get the HSL values from 2 points in your gradient
oh
you'd need to adjust the hue variable to fit your gradient
interesting
the example coords give this
How can I be like this?
oh
ohh hue is 0-360
which would make sense for circle
the gradient I have now is hard coded colors
How do I do this? @remote kestrel
you can't
is this bad ?
const Thing: React.ComponentType<React.HTMLAttributes<HTMLTableSectionElement> & {
transparent?: boolean,
toolbar?: React.ReactNode,
}> & {
Icon: React.FunctionComponent<{
className?: string;
iconClassName?: string;
children?: React.ReactNode;
selected?: boolean;
disabled?: boolean;
showBadge?: boolean;
color?: string; // SVG color (e.g. "currentColor") -- passed as prop to the icon component
foreground?: string; // passed as prop to the icon component
background?: string; // passed as prop to the icon component
icon: React.ComponentType<any>;
onContextMenu?: () => any;
onClick?: () => any;
tooltip?: string | null;
tooltipColor?: unknown;
tooltipPosition?: unknown | "top" | "bottom";
tooltipDisabled?: boolean;
hideOnClick?: boolean;
role?: string; // (?)
"aria-label"?: string;
"aria-hidden"?: boolean;
"aria-checked"?: boolean;
"aria-expanded"?: boolean;
"aria-haspopup"?: boolean;
}>;
Title: React.FunctionComponent<{
className?: string;
wrapperClassName?: string;
onContextMenu?: () => any;
onClick?: () => any;
id?: unknown;
muted?: boolean;
level?: unknown;
children?: React.ReactNode;
}>;
Caret: React.FunctionComponent<{
direction?: "right" | "left";
}>;
Divider: React.FunctionComponent<{
className?: string;
}>;
} = findByPropsLazy("default", "Divider", "Icon").default as any;
Idk if ther was a better way





