#π§©-plugin-development
1 messages Β· Page 15 of 1
Ig it's time e to learn
make the request man it wonβt hurt you plus itβll show you have atleast something under your belt
ok I will see what we can do
can i have help with this
open(url, "_blank");
i guess 
oh lol thanks
how can i log something to console? console. log didn't seem to work
what, it should work
my react element doesnt seem to be updating or is taking a while how can i make it update faster
there is useForceUpdater() from @utils/misc
thanks
i was just past midnight noobing
i had a filter on in my console
by the way, any way to get function name of the function im currently in?
function foo() {
console.log(...);
}```->
foo
what's the use case
im testing out multiple functions and events, and i'd rather have a global const that tells which functions to work or not instead of commenting out the FluxDispatcher.subscribe lines
maybe i should just comment them out tbf
tbf i still would like to know the function name, because it'd make it easier to test events quickly
function onMessageUpdate(e: any) {
console.log("onMessageUpdate");
console.log(e);
}
i'd have to type the name 1 time less
no there's no way
alright π
technically there's arguments.callee.name
but that's longer and won't work in strict mode
yeah i tried that
wtf did you know you can do this??
named function in place of anonymous function ?
I don't see anything weird there
its weird in other languages but ive seen it before while diggin through js code
I do named function args often
the fact that you can have named function args and recurse
in python we have to do this for that ```py
map((f:=lambda x: 1 if x == 0 else x*f(x - 1)),
[1, 2, 3, 4, 5])
use some weird ass operator to assign a "anonymous" function to a named variable
@cedar olive why is there editPermission but not createPermission
even the api doesnt have a create method?
does edit just create if not exists?
cause jsdoc not helpful
from discord docs it does seem to be this
editPermission works
and it's technically consistent with the discord api
it's just a bit confusing coming from other frameworks that for some reason have createPermissionOverwrite too
and the jsdoc doesnt mention creating
it only says edit
yeah definitely an issue with jsdoc
it should mention that
editPermission creates one too
vencord codebase is very clean
Im confused on how I get a patch from this?
I tried to follow https://github.com/Vendicated/Vencord/blob/main/CONTRIBUTING.md and didn't really understand anything after that point
i think i figured it out
private static final List<Pair<Integer,Integer>> canonColors = new ArrayList<>();
static {
for(int i = 11; i <= 75; i+=16)
for(int j = 78; j <= 114; j+=12)
canonColors.add(Pair.of(i, j));
}
least convoluted java array
i got my plugin to work :)
oh intreesting what does it use
Whoa that's really great!
.
how can i delete a message from sendBotMessage
use the MessageStore
it's like MessageStore.deleteMessage(channelId, messageId)
or smth
is it possible to intercept a message_create before it's sent to the server? and be able to cancel it? just curious
yep
message events api from vencord
and even if there wasnt an api for that, anything is possible lol
i cant find any delete function in MessageStore
check the message store source code and see if you can find the delete function
in discord console can you run Vencord.Webpack.Common.MessageStore and look at its funcs
maybe it just isn't documented
I used it accidentally on my program recently so it definitely exists
dont see it in the console either
whaa
check the prototype
lemme check
of the thing you logged on the console
oh ^
not there then
whaa
give me a sec I will find it for you
thanks
last resort, was there anything in \proto :p
guh markdown
DISCORD WHY
thats just a recursive loop of the same thing
hmm
const MessageActions = Vencord.Webpack.findByProps("deleteMessage");
var position: number = findOption<number>(args, "position", 0);
CiderStore.seek(position);
var message: Message = sendBotMessage(ctx.channel.id, {
embeds: [
{
type: "rich",
title: "Cider",
description: `Set the track position to ${position}.`,
color: 0xB22841,
fields: []
}
] as any
});
setTimeout(() => {
MessageActions.deleteMessage(message.channel_id, message.id);
}, 1000 * 5);
is it a problem in my code
weird
formatting bit bad
oh ok
sorry on phone so can't help too much xd
its fine im really new to vencord so im not familiar with much
what are the arguments?
the same
ok thanks
MessageActions.deleteMessage(message.channel_id, message.id, true);
works
i found it in the source for dismissAutomatedMessage
its literally what dismissblabla does lol
lol
yeah idk lol
What?
the whole list just shows itself as that
Take a screenshot of entire screen?? Idk what the fuck to do with that
i havent got it again i had to quit discord then start it again
it appeared a few times
but i dont know how to trigger it
right now the list is empty though
my vencord is updated
does anyone know a decent code editing app for ios?
wrong
best you can do is use github
and actions to compile

that's a terrible workflow
ehh i hope youre on some kind of ipad, but it would probably be the online version of vscode
like gitlab or some shit?
ya i checked in another server and all the good apps seem to be online tho i found a few ok apps
github.dev
when rust compability with Vencord mods? π
never
(trust me im not a Rust elitist π)
you can already run wasm fine
hmm
might look into making a example rust wasm for vencord mods
idk what usecase it wouldnt really have, maybe a little bit of speed in some cases, more librarys and support of other languages?
using python in rust and compiling it to wasm π₯΄
horrid
wasm is slow cause you gotta use ipc for everything
So 99% of the time wasm will be slower than js
how do i patch a discord react element? To be specific i want to patch the user popout and add something at the bottom of it.
you just patch it
there's no one truth, it's different for each component
So that's not a question that we can give a good answer to
gotta be more specific :P
hm oka
to be specific specific, i'm trying to replicate the UserVoiceShow plugin from BD
i think i got the patch working though
wtf
deprecated js features were all so good
wait does this let u go back in the callstack with caller.caller.caller
yeah
it's a really neat feature but if you try to access arguments.callee in strict mode you will explode TypeErrors
prob optimization
yea lmfao

but im sure strict mode does it yea
but this is actually incredibly useful
it was added initially to allow recursion in named function expressions
err
it was added to allow recursion because named function expressions didn't exist
(ignore my deleted message, named function expressions are just named functions in general and I got confused)
probably because of spread parade maybe
params *
no
Does anyone here know any good and easy to install administration panels for Ubuntu 22.x? I already use pm2 but it's only for my node projects so. I say easy to install because it seems all of them are hard as fuck to install
vendy did you see my ping about richerCider
I removed it because it doesn't comply with our code of conduct, this is not something I want our project to be associated with
https://www.reddit.com/r/AppleMusic/comments/vydyj8/i_know_everyone_likes_cider_but_the_devs_are/
the commit removing it just gave me a good opportunity to remove it because it didn't comply with the structure required by that feature anyway. I didn't mention it further because I was hoping it would just fly under the radar, since I don't really want to start silly drama over this
understandable
it being included in the commit with no context kinda looked like a possible mistake which is why I asked more about it
@dull magnet run Object.prototype['0'] = 0 in discord
wtf
what does that even do
does that make discord think random stuff is an array
amazinbg
notice
unhinged π wont comment on further
the main thing is that [][0] != null
i think
ye
but length still 0
yea true that would do it
MLFAO
dz made her tiny toml parser use null prototype objects to prevent proto pollution but i wanted to find an insane bug in the normal object version
yea only empty slots
her parser heavily uses sparse arrays
wait it wont
im stupid
it still returns null
simply reimplement arrays @green vessel
so i was seeing if i could trick it into parsing the same token over and over
need to be safe from prototype pollution
fake
is there even a way to reimplement arrays while being safe from prototype pollution
u can definitely reimplement arrays but idk if prototype pollution free
π₯Ή
[[a]]
[[a.b]]
__proto__.__proto__.constructor.0 = "meow"
would try to assign __proto__ to [[a]], which is an array
this is valid toml though and it should instead assign to the last element of [[a]]
which is an empty table in that case
this hurts my head
same
the [[a]] syntax is so hard to intuit
[[gayming]]
bleh = true
[[gayming]]
meow = true
in json, is ```json
{
"gayming": [
{ "bleh": true },
{ "meow": true },
]
}
[[]] is cool
nested [[]] is fake
IMPLEMENT NOW
INSANE
How can I delete/hide the gift element using CSS?
i did this
button[aria-label="Send a gift"] {
display: none;
}
Thanks.
@green vessel you will rewview NOW https://github.com/Vendicated/Vencord/pull/483
they put extra effort to make it configurable
LGTM
if u want changes lookie now or i will merge
lgtm but I haven't tested that code
where suggestion channel
dleeted
@gaunt sluice hardcoding classnames like that is a bad idea for snippets cause they'll break in the future
- .assetsLargeImageSpotify-17ME3M
+ [class^=assetsLargeImageSpotify-]
isn't doing that method bad for performance?
or does it make no difference these days
i made those snippets so long ago, i just reposted them from bd
no
i c
I mean they probably do slightly
but not noticeably
I've seen complex themes exclusively use them and didn't notice a difference in performance
I just don't like broken snippets so I try to avoid the mangled classnames
i remember some theme on bd use them and it tanked my performance so much when i used it
this one
oh ok!
how could I achieve this?
The original css (https://gist.github.com/ivan/3cfa15b854103690f266ecacf4f81504) is broken and I'm having trouble selecting the timestamp, the username and the message without using hashed class name
What I would need to know is the equivalent in today discords css of:
div.markupspan.timestampspan.username-wrapperspan.message-contentstrong.user-name
What if you implement a Test Notification feature in the Dev Companion plugin
So you can test notifs and how they look like
add notices with it too :)
why not just use an alt account
wdym
I mean like when you are making a plugin
with notifs
you just click test notif like test patch and it shows the notif
instead of pasting code into devtools
like just send a message to yourself in dms or ping in a server
using an alt
unless you mean a diff kind of notification
I'm not talking about message notifs, I'm talking about notifs that are shown through Vencord's Notification API
no idea that existed tbh mb
β¨ the more you know β¨
is there any way to have popup windows inside of the active discord window or even a whole window for itself
how wanted would this plugin for spotify commands be? is it enough to make a pull request to vencord
I think it's kinda pointless, why would someone use this over just using the Spotify controls
but maybe that's just me
i use it because i like to use the keyboard a lot
most of my workflow is without my mouse
i can imagine type /play and a lot music bot commands show up
how do i / what is the reccomended way of storing data? both temporary and permanently (during session and between sessions)
DataStore api
i'm looking into how plugins work and i keep seeing \i in the patch regexes to get variables but i don't know what that means, couldn't find any info online, am i just dumb?
\i is a custom regex escape we've added that matches identifiers
very much so
planned with the upcoming website soon https://vencord-website.vercel.app/docs
Documentation for contributing to Vencord
@trail ginkgo you will merge ur docs stuff with the website 
bet
10/10
great stuff
wait how did u get a 404
lol
the site still needs a bunch of work but I wanna release it very soon
plugin request
w
does anyone know any way to get I can get the language of the codeblock? I have this patch but the first arg is just the actual code inside the block
could do something like
{
match: /\{lang:[^,]+,content:[^,]+,inQuote:[^,]+\}/,
replace: "$self.format($&)",
}```
the insanity that i wrote before sending that was fucked up
what does the $& do again?
the whole match
yea so ur format would be like
format(code: { lang: string, content: string, inQuote: string }) {
if (code.inQuote) return code;
if (isFormattable(code.lang)) code.content = realFormat(code.lang, code.content);
return code
}```
or something
u are
ur just modifying it
oh i see
i thought it was getting destructured at first but i see that's its the type lmao
but im p sure it doesnt even need to be the same object
cus the obj is created in the return statement, not much significance there
except in the patch helper
there too
i only saw it now
Well I guess it's still useful for visualising the matches
could add that to vencord companion
companion?
you don't know?
WHAT
patch helper built into vscode
I just realised that the second patch in the screenshot uses a minified variable lmao
bad practices
i mean it tells me my patch does nothing when it really does do something
what's the patch?
oh i have comments might cause problems
nope
heh wanted to send as dm but whatever
{
find: ".USER_SETTINGS_PROFILE_THEME_ACCENT",
replacement: {
match: /(\i)=(\i)\[0\],(\i)=\2\[1\].{0,700}className:(\i).{0,700}ACCENT}\)}\)}\)/,
replace: "$&,$self.addButton($1,$3)"
}
}```
i know it's awful
please don't judge my code lmao
oh no
\w
i missed that one
doesn't fix lol
and that patch works in patch helper?
lemme test again
yup
copy pasted from patch helper into vscode and it the extension still says it fails
huh
yeah ive had that happen with a couple of patches
some of the RCE patches are flagged as not working when they do
i thought its because it was trying to work on already-patched code
i havent investigated it yet
how do i check if the user has nitro?
sounds good
oh and ven, yes my regex is too complex for the output i know i haven't simplified it yet, there's stuff i don't need anymore
what r u making?
i just realised none of our plugins have spaces in their names
which i believe is a port from that one desktop client mod i forgot the name of
i guess thats sort of client mod tradition though isnt it lol
they could
yeah i know
**devCompanion.dev.tsx: **Line 161
let src = String(candidates[keys[0]]);
we facilitate spaces
I would usually recommend against it, I'm not a fan of it
we account for it in some places but not others
it also looks very silly in objects
yeah
but i suppose the main reason against it is tradition
i cant really think of a time where plugins ever had spaces in any mod besides BD
lol
btw are u gonna put the installer on win store or
cause I made the release with nsis installer
do u need anything else from me?
when the website is done and on a permanent domain
ah I see
cause i need a place for the builds to be hosted that isnt github (cause of the redirect issue)
does vercel even let u serve arbitrary files
then ill handle doing versioning and publishes from there on
no clue
probably not
so we'll just run it on vendymachine
die
flatpak installer
Is there a better way that I can control the layout of settings, this is super not ideal and will only get more unwieldy as more options are added
I'm not entirely sure, something like collapsible config sections
on PC I had things grouped together, and a collapsed by default section that had advanced settings in it
Discord UX itself for settings is lots of scrolling. The only thing I'd suggest is if the settings are toggles, to use a toggle instead of a dropdown, but it'll still take the same amount of vertical space with padding between options, anyway.
even discord's settings have sectioning and information text within them, it's not just a wall of controls
I feel like this is kind of bad anyway, a multiple choice radio kinda thing would probably be better
though we don't exactly have a component for that so you'd have to make it yourself
can you point to an example?
the accessibility page, or most any of the other settings pages
do you know what I mean?
Choose what to notify you for
[ ] Silent messages
[ ] Group Removals
[ ] Spammers
like checkboxes
that makes sense yeah, I've just been using the things that I found quick examples for
I also think notifications for group removals should be part of friend notifications (?) (unless I'm misunderstanding what that does)
yeah like I said we don't actually have a component for that so you'd need to use a custom component and handle it yourself
when someone is removed from a group, discord doesn't send a notification for the system message that's sent in the chat
accessibility page is a wall of controls too
where it shows drop down options and you can choose multiple
I feel like that would also be great for your settings
but there's section titles and descriptive text, that's what I was trying to talk about
I don't have an example right now but I'm fairly certain they do
there's a few different discord control elements that I need to figure out how to yoink anyways, yeah
like the tag input box
nowhere in the stock Discord UI have I seen checkboxes - only toggles
the sectioning and descriptive text I'm talking about
radio buttons, yes
oh if you want to add section headers, yeah that would be an easy feature request
there is a checkbox in my screenshot xd
want help?
sure, if you want to figure out how to get the tag input text box that'd be good
where is it?
The only place I know of that it's in use (there's probably more) is the dev portal to specify your bot's tags but it's still bundled in the client because discordβ’οΈ
oh, it's not actually in use in the client? hm
it's probably in the client for server discovery tags or smth too but I've never seen those settings pages
yeah, having an in-client example to inspect would make it a whole lot easier, lol
simply window.location = "/developers"
the dev Portal just uses the same js as the normal client
I know, yeah
you'd think they'd do some sort of better optimization of things that 99% of users don't need though
it's a fairly complex control
<div class="inputWrapper-x">
<span class="tag-x">tagname<div class="closeWrapper-x" role="button" tabindex="0"><svg>...</svg></div></span>
<input class="inputDefault-x input-x size16-x inputInner-x" type="text">
</div>
I am aware it's complex, there's a reason I don't want to implement it myself xd
yeah, the juice probably isn't worth the squeeze tbh
it is
its the same control
should be fixed now
could u retest and let me know if it's fixed please? :3
u need to build with --watch to have the plugin
right
;-;
{
find: "getUserProfile=",
replacement: {
match: /(getUserProfile=function\(\i\){return )(\i\[\i\])/,
replace: "$1$self.colorDecodeHook($2)"
}
}, {
find: ".USER_SETTINGS_PROFILE_THEME_ACCENT",
replacement: {
match: /},color:(\i).{0,400}},color:(\i).{0,400}ACCENT}\)}\)}\)/,
replace: "$&,$self.addCopy3y3Button($1,$2)"
}
}```
first works
second nope
bro what π
also my port is done, if you're interested in reviewing the quality
poggermode was during last year's april fool's
i ran the updater
god these emojis are ugly i need to undo the renames
i'm on latest commit yeah
it says no effect, is it because i have the plugin enabled?
ohh that explains why
but i swear my button is here
im having like the hardest time implementing the split message into chunks of 2000 or 4000 characters π
thought it was gonna be easy
why
and again it works in patch helper
https://img.remty.xyz/ZM4b4eP2.png
i cant just use presendlisteners because something before that stops me from hitting ENTER or clicking the Send Message button
im trying to search for it in devtools but damn
nah thats way too easy
i set up the plugin settings already as well
just gotta patch discord somehow to stop this popup:
i tried searching if somethings listening to the button.onclick but nah
use react devtools to get to the component code, put a breakpoint, then follow the callstack
pretty simple :P
how do i get react devtools
its a toggle in settings
alright thanks im gonna check it out
@dull magnet does the patch engine remove all newlines
yes
that's the reason then
how do i put a breakpoint?
newlines are always removed you can rely on that
idk what u ported
profile colours based on invisible text in bio
i was typing ;-;
a picture is worth a thousand words anyway
i guess it would be a candidate for fakenitro but since it requires user intervention maybe not
if integrated into fakenitro it would allow more people to see custom colors
it kinda fits fake nitro well
but right now i have it standalone
the problem with having it in fakenitro is that it requires the use to edit their bio
thats p cool tbh
:)
no problem
i feel like it should be a separate plugin
just leave the button there
FakeProfileThemes
lol
where do you want me to send the code
le PR
since if it ends up being part of fakenitro maybe i shouldn't PR rn
no
_ _
pr it as a different plugin
this
then you'll choose to integrate or not?
honestly having it as its own plugin will have less people using it, which kind of sucks
having it part of fakenitro could allow more people to see others' custom colors
yeah I thought of that too
good point
but putting only the decoding part in fakenitro wouldn't make much sense
well you can always choose to integrate it later
i'll rename it to fakeprofilethemes like you said so that it ends up next to fakenitro
but again the problem is that other people need compatible plugins to see the effects
unlike screensharing and other fakenitro features
alright i tried adding a breakpoint on different spots but it just fires off whenever i focus back into discord...
alright no
im so fing done
apperently its almost 3:30 am
yeah somehow
how do i get themes working
ok apperently the clock wnet forward an hour but still fuck
@amber condor this is a terrible patch and will break probably next discord update but it works and you can figure out how to make it better
{
find: ".MESSAGE_TOO_LONG",
replacement: {
match: /T&&null.{0,500}I\({/,
replace: "I({"
}
}```
just match this function
and make it return Promise.resolve()
btw @snow jetty a tip for matching variable names in way earlier code
instead of doing stuff like
/(\i)\.someUniqueMethodOrSmth{0,1000}actualMatchStuff/
you can use lookbehinds
/actualMatchStuff(?<=(\i)\.someUniqueMethodOrSmth)/```
this will first match actualMatchStuff then walk back until it finds the stuff in the lookbehind
Oh right
nookies discovered this, i didnt even know u could use lookbehinds like this
They create groups?
I'll improve my regex tomorrow
/MESSAGE_TOO_LONG_BODY_TEXT(?<=function (.).{0,50}openWarningPopout.+?)/
first matches the MESSAGE_TOO_LONG_BODY_TEXT deep inside the function, then walks back to find function R
and you can now just replace MESSAGE_TOO_LONG_BODY_TEXT
way cleaner, more performant and you don't have to specify length so it's less likely to break
Yeah
gonna put a section on this in docs too
it's very epic
@cedar olive yes
but confusing to understand if you don't know how it works
That's why I'll look into it tomorrow lol
I tried using lookbehinds and my regex ran 100x slower so I didn't try again, I must've been using it wrong
I've had my moments where using lookbehinds made the code way worse lol
i didnt know they worked that way π
when u told me i first was like
I didn't either
π
and then i was like holy shit this is revolutionary
ikrr
theyre like double edged sword
really easy to fuck up
if u put like a dynamic length thing in ur lookarounds they can become mega slow
but if used directly you can match way less of the string which leads to better performance
lookaheads are super epic too
like when matching an object prop value
/channel:\i(?=,)/
I've done the slowing down part, will try the speeding up tomorrow lol
you can always ask for help here
I've done a lotttttt of patches, so if you need anything
woah
does it reverse the tokens or somethging
thats interesting
I'm trying to get the reply ping @ON to only change color when the property of .actions-1mkm4H switch[aria-checked="true"], but I have no idea how to do that in CSS. Here's what I have so far, apologize for the noobness (checked stackoverflow but I couldn't find anything, probably due to poorly phrased questions π)
.actions-1mkm4H switch[aria-checked="true"] .text-sm-bold-2BCfqW {
color: var(--dracula-color12) !important;
}```
It works without the switch bit, but I kind of need that in order to keep it gray when it's ``@OFF``. I know I could change the link color overall, but I want to avoid that if possible
looking at the dom it looks like its not a switch element
its a div but the role attribute is switch
[role="switch"][aria-checked="true"]
OHHHH
epic moment
works like a charm, thanks!
I am now a Certified Front End Programmer π
can I just steal this now
theme is the dracula replugged theme
ok cool now my reply button is correctly tinted π
lmao
i don't use replugged anymore
but since the themes are pretty much the same, y'know
Question...
I made some tweaks to a theme i like, but some of the css can't just tacked on to the end as it conflicts. But someone has asked me if i could change it so it would override the original underlying css without them needing to comment anything out
If I made them !important that would give them priority but I've always heard using !important is bad practice. Would it be fine in this case? Are there other ways to do this?
using !important is bad practice in most cases because if you have control over all styles on your application, there should never be a reason to use it
it is somewhat more common to need to use it to overwrite other people's styles though
if you use it sparingly and only where you absolutely need to use it, it'll be okay, but be mindful of what all it will impact
how do u get the channel id here sendBotMessage(channel id here idk, { content: "hi" });?
SelectedChannelStore.getChannelId()
or if you need the entire channel object there's a getCurrentChannel util
just need the id for sendBotMessage but idk i am a noob
do i need to import anything for that?
import { SelectedChannelStore } from "@webpack/common"
however your editor should suggest automatically adding the import when you type in the store name
is there a function or something in vencord to have a pop-up or something similar with buttons?
probably modals
check how the settings page opens plugin settings
vscode
ye i just switched to it for this
@opal fern modified your gofile plugin for fileditch https://fileditch.com/
also has an ability to copy the url with embeds.video in front of it, which should embed videos that normally do not embed on discord
there's probably a better way to make a prompt than that, but i don't even really know typescript and this is my first time messing around with plugins
lol nice
It looks good

use the sendMessage used in the spotify plugin
unless youre actually using a bot ig?
i did get that working but i used something different
how did you find that so quickly
Devtools
but thanks I'll look into it when i have time
Breakpoints
Stack trace
Etc
I found the string of the modal, found where it's referenced, put a breakpoint and went up the stack trace
where did you put your breakpoints? because whenever i put them my discord paused when i focussed back into discord
ohhh
the modal being THE_UPPERCASE_VARIABLES thingies?
i really dont know much π
yea
which modal did you search for?
very very useful thanks
just edited a plugin from #1032200195582197831 (the opera gx keyboard sounds one) and i added mx blue sounds, with different sounds for spacebar and enter
and to capture the enter key i had to patch discord's event handler
lookarounds are very much a double-edged sword
how can I style the landing messages?
landing messages?
Ty for the response! :)
how can I style the popup that appears while overlining text you are typing?
Is it ok to add a dependency to Vencord that my plugin needs? It has an MIT license, so there shouldn't be any conflicts.
hm
i guess this would be up to @dull magnet but more likely than not no, even if it is just a dev dependency
you can't use this
Use the default event emitter of the events module in node.js
plugins have no node access so you also can't use the event emitter
what do u want that for?
I'm only using it as a dev dependency to add the events with types. It's possible with the default event emitter as well but It gets really repetitive after time. But if you don't want it it's okay like I said it's not necessary π
what default event emitter?
there is none because plugins don't have node access
I'm not really following I think
I mean the emitter from events. I only use it for types. I think discord uses something like this https://www.npmjs.com/package/events for it's events. So most of the types are identical to those in the node events type library or what it's called. Hopefully that was a bit clearer.
oh
I'm pretty sure Discord just uses Flux and doesn't bother with lesser event emitters
if it's only for types then sure but you usually shouldn't need to use EventEmitter in any way
Why shouldn't I use an EventEmitter?
why are you using one
I cannot imagine a use case where eventemitter would be the correct choice
discord already has a very extensive implementation of their own events so if you're using your own events you're likely doing something wrong
again, what's your use case?
There is a function in the MediaEngineStore called getMediaEngine which returns the MediaEngine. In this MediaEngine object I add an listener for the event connection. This connection event gets fired when there is a new voice connection or video connection (screenshare). The event returns a new object called Connection which stores important functions like the ones to set the stream quality of your own stream. I wasn't able to find a better way than this. Of course I'm removing all the events once the stop function is called.
There is a way to get all current connections as well but I need to get the connection as soon as it get's created so I thought an event listener is ideal.
yeah
but you'd likely use discord flux stores
which aren't anything like event emitters
You are right but I mean the MediaEngine object which the store returns. I added a screenshot of the __proto__ object which looks like an event listener.
that's not using any special module
i dont believe
or it could be
hm
well regardless, what are you actually doing?
I'm trying to port my bd plugin to vencord https://github.com/philhk/better-discord-screenshare-plugin
i thought someone was already trying to port this 
I already said it once on this server. Maybe it was me. I don't think someone else would do it because it's relatively new and almost nobody knows about it.
well anyway, i dont see the reason why you'd need to install a module to type it when you can just type the callback manually
seems like a waste of a dependency
Do you mean the Event Listener?
i mean the typed-events package
if you're only using one or two events from that listener then there's no point
especially since you aren't exposing them anywhere else
No I added all events.
listener.on("someEvent", (someArg: someType) => {
});
I mean if it's just types it doesn't matter much

Even ones I don't use for the future
but also I don't think u need to subscribe to events for this?
i dont really see the point of adding it though since its meant to be for typing for libraries mainly
I'm fairly certain you can just dispatch flux events with these things
you can just add it it doesn't matter much
but im not sure whether that plugin is appropriate to be included in vencord itself so it might be better off as a user plugin. It seems massive and fairly niche while possibly being somewhat sus to the api? I haven't looked into it much though , this is just my first impression
Isn't it like a small library? I'm not adding just one event. If so it would really be a waste but I add multiple events to multiple objects. But maybe you are right I don't really know it's just my opinion.
Oh that's weird I didn't know it's that massive.
you mean my plugin?
im not even sure of the use case of such a plugin
why would you need custom resolutions
I thought you mean the module I talked about
yeah im talking about the plugin, not the module :P
i mean the module at runtime is 0 size so xd
Maybe not the resolution but the bitrate is a game changer trust me.
dev dependencies are whatever you can always add them if necessary as long as they're not like super bloated
I added both a capture and encode resolution which was a bit stupid of me but I'm gonna change that
the bitrate?

i dont know if it would genuinely help or not since discord's bitrate is always terrible
That's cool. Thanks for letting me use it π
the only reason I asked was because I thought you were talking about wanting to add some event emitter library to your code
which is just terrible because it'd be adding unnecessary bloat

It does. I don't have the best upload but setting it to the half of it (10000 kbits) makes the stream way more watchable. Or another use case I found really helpful was setting a custom framerate especially for watching an anime or something because setting the fps to 24 which is about the same as an anime makes the bitrate more efficient because it encodes only the necessary frames. But 144 fps screenshares are great too but you need a good upload for that.
Yeah that's true
i'd be happy to see such a plugin, then i can finally stream 1080p with decent bitrate
whatever is in find should be closely before the match and replace right?
module being the same file?
@dull magnet when u gonna merge my pr? ;-;
adding whole-npm to devDependencies brb
whenever I merge it
oka
I already gave u feedback on it
it looks pretty bad and not native
The other bd plugin looked too chunky for just a join my friend's vc button imo
ven, the user profile object has a themeColors property for the custom profile colors, but the User type in vencord doesn't seem to have it
i'm not blaming anyone because i'm a noob at typing code, can you help me figure out what i have to do?
ps: i said ven because they're active but any help from anyone will be highly appreciated
User != UserProfile
right
but i couldn't find the themeColors property referenced anywhere
in the whole vencord codebase
and the User type does have the premiumType property, just not the themeColors one
would a button like this be native enough?
that doesn't really look like it should be there either

hey ven
i'll just release it as userplugin
hiii
nah we can get it merged, it's a plugin many people want
the thing is just it should look nice and native
π₯Ή
are you sure it's just a type issue?
have you looked at the object and it's actually there?
it definitely is on some users
okay, imma make a compromise, a setting to choose the design, which is defaulted on your design suggestion, but also has mine as option
sounds good?
you have it for example
then just update the type in the code or cast it to what you need in ur own plugin
a lot of the types (mainly the ones in discord-types dependency) were written ages ago
my main nit with this is that it's not obvious what that even means
maybe add a formtitle above
i see, yea
i have no clue how to do either
not good with typescript?
i think i got it to work
i just didn't know how to do it
interface UserProfile extends User {
themeColors: Array<number> | undefined;
}```
this right?
that works
i think you can add a ? after themeColors
right
thanks
adding a toggle in options to let users select whether or not nitro colors take priority
how do i retrieve information from settings?
plugin settings?
yeah
Settings.plugins.[plugin name].[setting name]```
i saw some stuff about Plugins.plugins but couldnt find user made plugins there
yep rip
it has to be the plugin name from the definePlugin section
i have a userplugin with settings and it works
it's the same thing
what is there's a space in the name?
Settings.plugins["plugin name"].settingName```
this is outdated btw
can someone make a css snippet to remove all role icons with aria-label :heart:?
i don't know how to select role icons
const settings = defineSettings(optionsObject);
definePlugin({
...,
settings
})
settings.store.foo // get value
settings.store.foo = "banana" // set value```
it's very similar but better DX
and strongly typed
SplitLargeMessages
i can't fine definesettings
import { definePluginSettings } from "@api/settings";
guys whats the easiest plugin that already exists that someone can check to get started?
right
the only issue i'll have with the plugin is that i cant check if it detects nitro right
ven i think an example plugin with all latest methods would be cool
currently i use UserStore.getCurrentUser().hasPremiumPerks
a .dev plugin
swish said "someone should fork it already" lol
okay i added a setting to choose priority if both are present
it's UserStore.getCurrentUser().premiumType
it returns a number or undefined
if the number is 0 the user doesnt have nitro
1 is nitro classic
2 is nitro
3 is nitro basic
only nitro can send large messages
thanks ! :)
is it possible to edit a plugin code locally? I wanted to change the fakenitro size to 56 as I had with bd
you can try editing the config file?
Vencord.Settings.plugins.FakeNitro.emojiSize=56```
in console
im very glad the splitLargeMessages plugin is almost done :)
i'll do a bit of cleanup tmrw and then make it public
what should my plugin layout be?
A:
- imports
- consts
- definePlugin & defineSettings
- functions
or
B:
- imports
- consts
- functions
- definePlugin & defineSettings
because themeColors isn't a thing on the user object
it doesn't exist on it
in any way shape or form
It's on user profiles
correct
alyxia is throwing the game vote her off
But then again does premiumType exist on the user object
What about bio
defineplugin
Welp
nookies is responding to @amber condor
no bio on User
I have to amend my commit anyway to add the devs
I should have did it on a single message lol
xd
noted
But the discord-types User type has bio
So it represents the profile as well, meaning it should have themeColors
It's just not maintained
why does it have bio thats silly
then it's wrong
literally run getCurrentUser and you'll see it's BS
??????
another time, i would take maintainership of the package but i definitely do not have the time to maintain a package that three people use
here's a possible solution
wait ur trynig to use the profile
u could type it userself tho
before consts
done π
i made a pr, ive looked over the whole file multiple times, yet i wouldnt be amazed if my dumb ass 2am brain still missed something.
wanna put this here for shits and giggles
@next stone what name do you want here https://img.remty.xyz/3y2TSDb3.png
because i have to add us both in the constants
@amber condor heres a patch i made to get rid of the text for max message length (second patch ive made so might be bad)
{
find: "i=e.maxCharacterCount",
replacement: {
match: /(var ?.,.=e\.type,.=e\.textValue,.=e\.maxCharacterCount,y=e\.className)/,
replace: "return null; $1"
}
},






