#πΎ-core-development
1 messages Β· Page 165 of 1
SettingTextComponent does the same thing lol
i feel like it's kinda unnecessary to make a whole css file for one class with one attribute
Then check if discord already has a class for that I guess
porbablyt
Would be surprised if it doesn't
I do agree that single-rule sheets does feel a bit silly, but classes do have benefits regarding theming
oh nvm found a css file that is related to the components im working in
i'll just put it in that
i just didnt want to make a whole new css file
Tauri fixes none of the issues you have described, plus requires a significant amount of rewriting of Vesktop and potentially Vencord to accomplish.
Electron is incredibly heavy and eats RAM like an American eats, well, anything.
So does Tauri. Yes, it's reduced, but it's still using WebViews which are still going to be Chromium-based most of the time, so there isn't really much of an improvement.
annoying bugs such as the occasional error when opening the app without internet wo...
this person also thinks that you can just
- "electron": "^28.1.3",
+ "tauri": "whatever"
fyi there is already a vencord mobile app but it's borderline unusable: https://github.com/Vencord/Vendroid
then refactor it. a bunch of our code is legacy code from when we didn't have native css support
- then don't?
- why? it doesn't matter much
the point is that inline styles are meh and awful for themes to override because they have to spam !important
v+ programming @bleak gyro
thank you
What are the chances of this getting merged? I find this extremely useful for privacy reasons.
google still shows this is just extra browsers

vee its not ment to show the google in the plugin in the end we just made it as more engines to use
okay so an idea for third-party resources is (amazingly draw by moxxie)
we might not need the filters on the side since from what we've thought of there are only 2
im a grate artist and i can totally spell fr fr
why did you star your own message
Why didn't you?
if you star your own msg it will make ppl want to star it fr fr
vee will take down starboard machine again
updated it to show under the "search with Google" as #2218 (comment) asked
that's absolutely not what i asked.. i suggested to replace the Google search option
i don't like the multiple choice because it is not extendable... what if we add it in a third place? we'd have to change how it works and migrate old settings. it would be better to just use multiple boolean options
I think Vencord needs a dedicated "select one or more" settings type for these kinds of things at this point
It should probably just be 2 toggles, and just let the user turn all of them off if they really want to do that for some reason
None
None
None
None
None
None
None
None
just let the user turn all of them off if they really want to do that for some reason
you severely underestimate how dumb some users are, I think a safety check for this is a good idea
don't add pointless checks. it doesn't hurt to have it on with no features enabled
Describe the bug
fcitx doesn't work, I can't write in any language other than english even if I run a vesktop with the relevant arguments.
To Reproduce
Steps to reproduce the behavior:
- install fcitx5
- check guide for electron apps
- run vesktop with /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=startvesktop dev.vencord.Vesktop --enable-features=UseOzonePlatform --ozone-platform=way...
Discord Account
flamehead83#9404
What happens when the bug or crash occurs?
When I try to open discord through a speed dial link on opera GX it gives me:
Cloud Settings
Could not synchronize settings from the cloud [TypeError: Failed to fetch].
But once I refresh the page then it goes away.
It only appears after clicking the speed dial link button that opens a new tab and then when I refresh in that tab it doesn't show the error.
 array (un)shifts.
However, as both push() and unshift() called run(), which called next() - all methods were O(n).
Swap the time complexity of these methods by reversing the order of the underlying array.
Queue#unshift is now constant time, and Queue#push is now O(n) - which is the same as before, as it previously called an O(n)...
Before this commit, MessageLinkEmbeds loaded embeds from oldest to newest. This was especially noticeable in channels with many message links - the most recent embeds would only load after all the old embeds were loaded first.
Additionally, if a channel had many message links, switching to another channel would prevent message link embeds from loading in the newly switched channel until the old channel's embeds are loaded first.
Swap the Queue#push with Queue#unshift to simulate a F...
Very nice branch names, mcpower:push-znykrnwkpypw mcpower:push-ymqkwqwlyrmr mcpower:push-quorwosyorxo mcpower:push-otqpxxlwqnuk
yeah
this will very likely mess up scrolling. you could just achieve something similar to this by using queue.unshift instead of queue.push, this way messages will be fetched from bottom to top
i just noticed you opened another pr just like that. why open multiple prs that achieve the same thing?
Specifically, it will result in less API requests and faster loading for channels. This is independent of the ordering change, but I agree that the main issue - that it takes a while to load recent embeds - is fixed by either commit.
The (default-off) option was added specifically due to the scrolling issue you mentioned. I personally don't mind this and would rather have better performance / less API requests, but I understand that the option may not be useful to most people, and is proba...
Okay that's a pretty weird bug in FastMenu/BetterSettings... Why does changing the name of a role make the left sidebar disappear
Cause found... Attempting to rectify
Right, fixed. What was I thinking when I wrote that patch like that
it actually need milisecond, not second
the full rpc (the one with image or details) somehow works with both and make me thinking second was correct π
How could I improve this?
ill probably add something like "Copy this content and put it in your Quick CSS file"
would there be any way to have a simple button to auto-append it to your quickcss?
That could be a great feature
Alternatively, have a link to the raw css that you can put in the themes list (and maybe a way to automatically add it there)
i have a cool idea for fakenitro maybe @limber skiff
it could let you use emotes from anywhere
like you just copy paste an emote and it sends it even if youre not in that server
you can already do that by copying the emote link when someone else sends it but it doesnt get the fakenitrogoodies like name
right clicking an emoji or /emojis/ embed could have an option to store the link locally as a pseudo-emote-server
and how do we get the emoji info
you are right, none actually
the emoji code is everything thats needed
so you mean like our own emote browser
noo
okay I dont quite get it
it likes its idea :3
vee's idea is basically just let fakenitro use emojis that other people have posted, not just from your servers
it thinks itd be cool if you could also store a local list of emoji links and names by right clicking
oh yeah it's very doable
emoji links don't even need the guild id
I think we just need to modify the preSend a bit?
i dont understand the use case. just make a proper server and use emotecloner
idk saves making a server
@austere talon btw if you plan or merging something, merge to dev2 since it already has commits we need to merge too
merge dev2 into dev1
sure
π
627ee19 Modify how wreq is grab; beforeWebpackInit API;... - Nuckyz
76ea0d2 make reporter log normally if level is not erro... - Nuckyz
0f402ea ClientTherme: do not use lodash on start method - Nuckyz
11defb1 oversights and cleanups for latest webpack rela... - Nuckyz
b3fa577 Fix hyperLinkText setting for fake stickers - Nuckyz
oh not those
not the webpack changes
they work fine
may prevent us future issues
specially reporter related
let me reset to previous commit for now
wtff lma
how did I not notice that
Isn't it easier to use like an interactive rebase for that
please format your commit messages like PluginName: message
ye
you should rebase your webpack changes in a different branch and make them a single commit
aight
i need to properly look at them first
Webpack: Refactor for future proofing
- Rework how webpackRequire is grabbed
- Add beforeWebpackInit and factory listener apis
- Future proof extractAndLoadChunks & reporter
Summary
While Server Home was deprecated client-side, the UI for it is still there and the backend will probably continue to exist for the foreseeable future. This plugin makes it functional again.
Issues
- Message history retrieval is broken. It repeatedly refetches the same few message contexts, seemingly not caching them.
- The tab doesn't show up if the Server Guide tab is visible, as Server Guide replaces Server Home. Not sure if this is easily fixable.

i have no idea how to fix the message history thing though

I can also confirm this. Tried armcord and vesktop, both sent my voice with delay.
i just thought of something
what if there was a button in css code blocks that just adds the css to your quickcss
So you mean like, I write ```css
- { transform: rotate(1deg) !important; }
That'd be cool
yeah
OH MY GOD
DOLFIES HOLY SHEET
wait
dolfies pred before too
I always thought you as a person that is too busy with other stuff so you couldnt pr ever

@Vendicated Working on improvements based on your pointers a few weeks ago. Thinking of having a single dedicated page for Vencord and placing Downloads button at botom of page after listing all the benefits of Vesktop with images?
yes that sounds good, about what i had in mind!
try having a style similar to https://discord.com: basically screenshots and for each screenshot a short headline and extended description
a few of those to highlight the main features
on the top there should also be a short headline introducing vesktop and a download button that jumps you to the download section
i recommend using https://github.com/Synqat/Vencord-theme in at least one (but not all) of the screenshots
try to avoid showing things that might infringe discords trademarks (for example discord icon)
don't show vencord things, only vesktop specific things. so for example the vesktop settings section, the custom screenshare & sound options on linux, and such
also it would be a lot better if you joined & discussed on our Discord server, in the #vencord-dev channel
yes that sounds good, about what i had in mind!
try having a style similar to https://discord.com: basically screenshots and for each screenshot a short headline and extended description
a few of those to highlight the main features
on the top there should also be a short headline introducing vesktop and a download button that jumps you to the download section
Good suggestions! I want to also try to keep design consistent with existing pages like home page and plugin...
None
None
None
None
None
None
None
None
I noticed this behavior as well, and I agree
Desktop:
- OS: Windows 11
- Version: 1.5.0
None
None
None
None
None
None
None
None
this is terrifying
(Resubmission after requested fixes)
Encryptcord allows you to have an end-to-end encrypted conversation with your friends by simple clicking the lock icon in your chatbar:
The system uses a 4096 bit RSA keypair to ensure that your message is safe. The keys are regenerated after every restart.
Adding that plugin fixed the issue.
why is it haha
just force push to main

man i love how all the app command search stuff is still in the client
despite that backend service being deactivated
what fucking branch are y'all even supppsed to base your new stuff on
how do you even find that stuff
what?
search for Endpoints.APPLICATION_COMMANDS_SEARCH
yeah but I mean why are you looking into that?
dev or main
oh ran into it accidentally lol
I see
Do not manually call the create private channel endpoint.
What should I use instead?
pick the weirdest branch you can find
based
commit to my personal stable branch in my own fork directly and PR all my fucked up code to upstream
Slight Mistake
that plugin won't be merged anyway

let me guess, hacky
yeah i don't think this is a concept that works very well lol
sending encrypted text files on discord is kinda insane
and you can't prevent discord from being able to mitm
@jagged reef userplugin time
very true
(unless a bot or someone with an older client joins)
unless you add like some key verification process
oh actually did that even roll out lol
certainly something Iβd might use if it was a third party
but even then you would never be able to prevent discord from accessing the key if fhey really wanted
what is the usecase for this
I bet shoulder surfing is a bigger security issue than mitming
Agreed
The shit I say on Discord would horrify people IRL
Oh don't worry I'm sure it horrifies people online too
Real
how do you even encrypt the messages?
how do you even encrypt the messages?
export const encryptData = async (pemPublicKey, data) => {
const publicKey = await importPemPublicKey(pemPublicKey);
const chunkSize = 446;
const encryptedChunks: any[] = [];
const encoder = new TextEncoder();
for (let i = 0; i < data.length; i += chunkSize) {
const chunk = await data.substring(i, i + chunkSize);
const encryptedChunk = await crypto.subtle.encrypt(
{
...
Lets be real will they write specific code to do that
I think this is not a Vesktop bug, actually, it's just Hyprland being very shoddy with IMEs in Chromium apps. I think I found a fix for this at some point, but after every problem disappeared when I switched back to KDE, I seriously doubt it has anything to do with the apps and everything to do with how Hyprland implements the various text input protocols
HEARTWARMING: User discovers their issue is unrelated to the project by themselves
lol
hyprland users:
hyprland users are an even smaller subset of people than arch users
I am not fatphobic but hyprland users are really something else
@median rapids it's actually so shit to fix the home issue with server guide
it's a single boolean, but adding a second thing to the channel list for the home/server guide to appear at the same time is horrible
the fact they share the same route π
Add a new path to the router 
channel tabs if it was epic
@median rapids this took more than an hour but I fixed request spam for the home
turns out when LOAD_MESSAGES_SUCCESS is dispatched, if isBefore or isAfter are both false, it resets the cache
and the focusMessage function which the home uses fetches messages around an id, but since it tries more than one message in the same channel it would reset and clear the messages previously fetched
the fix... add a before which is the same id as the message π
@D3SOX this is not push yet right ?
if you read the console output you shared, you'll notice that it's not actually passing the flag you --enable-wayland-ime flag you specified.
this might be an issue specific to the flatpak wrapper script, where it's not correctly forwarding user flags
try on a non flatpak version of vesktop to see if it works there
people really love blaming vencord for every single issue that arises #π₯-vencord-support-π₯ message
this is like the 20th complaint about listen along not working
you'd think people would at least put in the minimum effort of testing if the issue also happens on stock discord but no

i'm playing around with channel tabs Thinkies
this is fine
i just had an awful fucking idea
holy fuck the existing code is already just as fucked up as my idea
cool vencord facts: someone has already made a hackier plugin than you
shit is fucked
what is?
my attempt to inject channeltabs instead of the titlebar and update it properly
I mean dont you just need to change where it patches
just useStateFromStore with SelectedChannelStore
linux
still fucked up
what about it
yeah this worked
if you do this it won't support linux
should've listened
Just override the entire switch statement deciding which titlebar to use 
linux doesn't have any titlebar though?
i don't think mac does either nvm, there's probably a drag area
it does a check even if there is no titlebar applied in the end
please rate my custom titlebar
That is so fucking sick
I need it
Immediately
Change the background to some sick flames and it'll be 33% more rad
you're a genius
yea idk if this one's possible π
maybe a setting to just outright replace server guide with home is better
or a toggle when you right click
You can blame the upstream channel tabs devs for that
okay that's not a bad idea
I think it uses a hook so we can change the value and the button will update
but if it doesn't we can make the function do
git conflict hell on a branch with 200+ commits 
Thinkies Still needs some work
@median rapids we can add a context menu check mark to force useCanSeeOnboardingHome to return false
it's a hook so if we add a state and update it accordingly, server guide will turn into home and vice versa reactively
seems doable, but I wont do it rn cuz sleep
what is this
channeltabs
i made it look nice but since then it has become very inconsistent
amazing
gn π₯°
I think this is not a Vesktop bug, actually, it's just Hyprland being very shoddy with IMEs in Chromium apps. I think I found a fix for this at some point, but after every problem disappeared when I switched back to KDE, I seriously doubt it has anything to do with the apps and everything to do with how Hyprland implements the various text input protocols
EDIT: See more about how to fix this issue at https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland, though your mileage may dramat...
Describe the bug
when an app makes a new audio channel, vesktop does not always pick it up. this is most obvious when playing back videos in a web browser, like youtube, as web browsers make a new audio channel every time a video is played, and then delete their own channel when the video stops playing (although this behavior in itself is inconsistent, so it might take a few tries to reproduce the bug)
To Reproduce
- start a screenshare on vesktop with audio
- watch a youtube ...
Describe the bug
when an app makes a new audio channel, vesktop does not always pick it up. this is most obvious when playing back videos in a web browser, like youtube, as web browsers make a new audio channel every time a video is played, and then delete their own channel when the video stops playing (although this behavior in itself is inconsistent, so it might take a few tries to reproduce the bug)
To Reproduce
- start a screenshare on vesktop with "entire system" audio
- ...
@still wasp werenβt you working on a sticker blocker?
Summary
This should allow you to change what popups get removed with AlwaysTrust, defaulting to all, before you would need to have both popups hidden. This addon allows you to choose which popup(s) to remove, instead of all of them.
Warning
This is my first experience with TypeScript, please check my work before merging. I have checked this with my own Vencord installation, so it should work.
None
None
None
None
None
None
None
None
Try setting noise suppression to Standard or None (i.e. not Krisp). This got rid of the delay for me.
Any chance of getting different media categories?
Try setting noise suppression to Standard or None (i.e. not Krisp). This got rid of the delay for me.
This does not have any effect for me. (see the start of the issue thread, where my tests have all of that disabled). Others should try this. If it works for them, use Nvidia Broadcast or RTX Voice, since they have significantly less delay
I keep seeing terms like upsell and sku in the code. I assume upsell is related to nitro shilling, but wtf is a sku
related to decorations
it's something to do with their identification
that's all I know
Oh there's docs https://discord.com/developers/docs/monetization/skus
So marketing stuff, nothing to care about
upsells is related to nitro ads maybe?
Well, I'd assume the term refers to selling something
yeah makes sense
upsell is basically just nitro ads yeah
So eliminate on sight but otherwise not worth caring about
upselling is a sales technique where a seller invites the customer to purchase more expensive items, upgrades, or other add-ons to generate more revenue. while it usually involves marketing more profitable services or products,[1] it can be simply exposing the customer to other options that were perhaps not considered
so like when you open someone else's profile and it says "wow such a shiny banner don't you want one too?"
that's a nitro upsell
I am still super proud of this despite it being super jank under the hood
sku is a LOT more
they were first used for the game store
then billing was rebuilt untop of them
then server subs was hacked into them
then server products
then app subs
then avatar decos
then profile effects
etc...
yeah it makes sense from the docs
I mentioned decorations cuz I reviewed decor so I saw them being used
Any chance of getting different media categories?
This plugin was only intended to let you favorite other types of media, so no.
Yeah its fully finished but I lost motivation because of a bug
i wonder what my custom channel tabs looks like on my desktop
channel taaaaaaaaaaaaaaaaaaabs
Refactor shit code time
@median rapids https://github.com/Vendicated/Vencord/pull/2232/commits/9f33c5e6f7ddfd1a0f4c66e9afcb2dca97f2779f
alien jumpscare
tell me if everything is good and I can merge
WHY HUSK ME
I'M LAZY
π
what was the bug?
When you unblock a sticker in the settings ui, it stays there until you refresh
I couldn't figure out how to re render the component lmao
hmm
it's prob an issue with how the Datastore is async
I don't know how you did, but I recommend having a cache and use it to render the components
so you always update the cache and later update the datastore async
Oh i didn't think of that
NEVERMIND I AM AN IDIOT 
I was calling the update function before the sticker was unblocked 
lol
Works great now 

I decoupled my titlebar from the channeltabs component please judge :)
https://github.com/Sqaaakoi/Vencord/commit/2c069d395cb332679daae307f4fe1f39a9c10c3c
This is absolutely horrible so far btw
yet it looks so clean
very true
i hang around here, #π§©-plugin-development and #π§-off-topic-iceman-only, occasionally i might dip my eyes into #π₯-vencord-support-π₯ and if it isn't too brain rotting, say something
yeah I help in support sometimes too
sometimes
That place is too braindead for me
Yeah occasionally ill be in support too but rarely
I've gotten enough damage from support channels
Pro tip: Copy random bullshit
Well yeah that's why discord's code is there
But why the leading comma format
It's ugly
That's how it was when I stole it from DevTools 
Consider rewriting your code into something human readable after copypasting
Got a really nasty case of comma operator there
Badge Obtained
looks perfect 
hm the jumping to message when clicking is still slightly broken
but it works if you click if a couple times π
I have the same issue, I Use Pop_os and I have enabled "Run in background" for this app but still, it still suspends when out of focus.
it's okay normal messages are like that tooπ
Now that's how you report a bug
Find a year-old merged PR and provide no relevant details
true
why has this got the old rounded tabs
what commit did you base on
Latest channeltabs branch but I did WAY too many changes, including that
so you reverted the style changes?
that's how they looked before my commit to make them firefox style xd
firefox style just makes more sense because it's impossible to make them look attached due to the multiple colours
looks so weird
but at least the height is back to being consistent
Can you link your commit? I reparented the actual clickable tab to contain the information instead of tab with button information
Sorry if this makes no sense I am running on not enough sleep
since then tabs started having inconsistent height :(
but in that commit i changed the tabs to be rounded on all sides
How much of ChannelTabs was removed and forgotten about since then

wdym
Native discord experiment favourites support got completely removed in favour of the favourites bar
Leading to broken display when in the favourites experiment
Take your time with your long message
it's not long (ocd moment)
That's also fine
xd
i'm confused whether you're on an old commit or reverted the tab changes
oh i think you said you did

I reworked it to effectively make the button hitbox bigger
The tab style could be a setting
well, i thought firefox style was a more sane default - and you can use css
doesn't middle click close tabs anyway
other tweaks look cool though
thats not what I changed
ohh
Each tab is now just a button itself instead of a div containing the button to activate it
It's visually no different the way I have styled it, but you can FEEL it.
In other words, you can throw your cursor to the top and actually click the tab
it wasn't removed because of the favorites bar, it was removed before adding it because it was a broken mess even beforehand
make the hitbox extend outside the actual area like firefox then
i mainly use gnome and macos so throwing cursor to top places your mouse on the time etc. xd
Thats what I did...?
Sounds about right
fair
sounds good then ig
Describe the bug
There is no button on macOS to exit fullscreen once entered. By this, I mean there is no button in the top left to get out of fullscreen once entered.
To Reproduce
Steps to reproduce the behavior:
- Open Vesktop on macOS
- Click on the green button in the top left
- You will be in fullscreen, but will not be able to get out of it.
Expected behavior
There should be a button to exit fullscreen like most macOS apps.
Screenshots
![image]...
Describe the bug
I noticed that you cannot mark folders as read on Vesktop, compared to the official Discord app where marking folders as read works.
To Reproduce
Steps to reproduce the behavior:
- Make sure you have a channel that you have not read and is in a folder
- Right click on that folder
- You will notice that the 'Mark Folder As Read' button is greyed out when it should be clickable
Expected behavior
The 'Mark Folder As Read' button should be clickab...
have you tried making sure there is a guild to be marked as read?
also this probably has nothing to do with vesktop at all??
o o o o o o o i am answering stupid issues
Yes. The folder I want to mark as read actually has a server that I want to make as read but when I try to mark it, it does not work.
Have reproduced in the past, not Vesktop specific. Can someone move this to the Vencord repo or close it if it's a duplicate?
nothing to do with vesktop.
thank you vee
it was probably mute
the folder treats muted guilds as read
@austere talon any idea how to fix states in our context menu patches not updating the components? I think it has something to do with the context we call the patches, like if they arent in react or something
you know more than me about react so perhaps you have an idea
could you explain a bit deeper?
or show a code example
yeah
say I have this patch
if I click the checkmark it doesnt re-render the checkmark as checked
well the way the api works the func is only called once per identical children array
you'd need to not use the callback
and even then it might not work
at this point it might be a good idea to patch the menu api to add our own menu item component so we can use a proper component with state and not have to do this cursed workaround
You could add a custom component to the menu that wraps a MenuCheckboxItem and has hooks
this is shit
maybe there is a better place to patch
hmmm but I see what yall mean
that could work prob yeah
I'll experiment later
On the other hand, the menu api only allows a few specific component types, so that probably wouldn't work...
that's what i mean by patching it
to add our own component to it
but also i think there's a way to use a custom react component in a menu
There is MenuControlItem
...Why does it use .reduce instead of .flatmap
Discord's menu code, that is
I may be mistaken, but isn't the whole problem with the context menu stuff that it does _patchContextMenu(props); rather than props = _patchContextMenu(props);?
how so?
Mutating the props makes rendering impure, which requires the menu hooks to be run only once, which makes react hooks not work
If you do not mutate the props, this would allow the menu hooks to be run as part of the regular rendering cycle, including react hooks
they already run more than once
however our callback to push items to the children only runs once
because otherwise the menu would get 1000000 copies of the same button
If you say so
I'm not that much of an expert on react to know that deep
but if that does fix the problem, then thanks a lot
okay I cannot find the assets place
I'll have to experiment a bit to know for sure, but I'm pretty sure that is at least part of the issue
Do you have a repo or similar with this non-working code? Wanna see if my fix does indeed fix it
pull from dev and modify resurrect home
it's pretty easy
you have to remove ContextMenuApi.closeContextMenu();btw
that's the hacky fix for it not updating
ideally the menu should re-render a billion times and our old items disappear
@brazen bone is that what you think it should fix?
Yes
okay don't forget to push the child in the first callback instead of the second
because the second only runs once
just return nothing
if that works we can remove all of that anyways
Though an issue is that many of the patches mutate children deeply, so a shallow clone won't be enough
don't worry about it
use lodash deep clone
only 1 context menu can be open at once anyways
Yep, this seems to work; the menu item is not duplicated and the hook works
how did you do?
Pretty much just inserting a deepClone on the props
Though I don't like that; it might break things if some menuitem is passed a ref or something
hm
I think it's fine for now
easier than wrapping components
how does it perform on user settings context menu
that's the biggest I think
I don't notice any slowdown
Sure
If things do need to be done once in the menus, I think that can be done with a plain ol' useLayout or similar
changing the second patch is needed?
Without that, lodash clones the Arguments object into { 0: a, 1: b } instead of [a, b]
horror
Won't be necessary once I make a more fine-grained cloning I think
There we go, this is much more selective about what it clones
Actually on second thought, if something edits a menu in the once part, this will make those edits ineffectual
maybe use window.structuredClone instead of lodash if its available
likely a lot faster
That won't work, mdn says structuredClone throws errors on functions
And those menu items often contain callbacks
the once part will be removed
the only reason it exists is because we were getting duplicates
Yeah but someone would have to go around and clean it up everywhere
yes
Actually wasn't there talk of making a ```js
contextMenuPatches: {
"guild-context"(children, props) { ... }
},
that's no issue
yea
None
None
None
None
I can do it if you don't want to
None
None
None
None
dont worry about refactorsl ike this, theyre really easy and quick to do
unless its like the settings api
Yeah optionsβsettings is a bit overdue
theres not really any benefit to migrating it
so itd just kinda be a waste of time
Perhaps
I haven't really looked into how they differ, I just know that any new plugins should use settings
its the same, in fact even the new settings api still uses the options field internally
its just strongly typed instead of typed as any like nookies said, and also more convenient and shorter
I'm not sure how the contextMenuPatches: api would deal with addGlobalContextMenuPatch, but that one doesn't seem to ever be used anyway so
also you don't have to repeat your plugin name everywhere (which leads to easy bugs if you try to rename the plugin)
well you could just export some symbol like
contextMenuPatches: {
[CONTEXT_MENU_GLOBAL]() {
}
}
Or just "*"() {}
true
but also yeah that api isnt that useful, i cant think of a usecase for it xd
other than debugging ig?
I mean no need to remove it though
In most cases it'd probably be more efficient to just patch the Menu component
like a quick addGlobalPatch(console.log)
in console
but other than that i cant think of much
I'm gonna try making the contextMenuPatches: api
Is it just iterate over all plugins or is there some more performant way to do it?
we already iterate over all the plugins anyway
check how the flux prop is implemented :p
and replicate
Yeah I figure flux triggers way more often than menu, so if it's fast enough for that
or rather change that code to also do the other one
uh what
do you mean whenever a context menu is opened it checks all plugins
dont do that
just keep the old api and make the property a wrapper around it
That makes more sense
Do you prefer contextMenuPatches: or contextMenus: or something else?
actually im not really happy with the current flux: implementation
because its done inside startPlugin, which is called very late
**index.ts: **Lines 121-158
export const startPlugin = traceFunction("startPlugin", function startPlugin(p: Plugin) {
const { name, commands, flux } = p;
if (p.start) {
logger.info("Starting plugin", name);
if (p.started) {
logger.warn(`${name} already started`);
return false;
}
try {
p.start();
p.started = true;
} catch (e) {
logger.error(`Failed to start ${name}\n`, e);
return false;
}
}
if (commands?.length) {
logger.info("Registering commands of plugin", name);
for (const cmd of commands) {
try {
registerCommand(cmd, name);
} catch (e) {
logger.error(`Failed to register command ${cmd.name}\n`, e);
return false;
}
}
}
if (flux) {
for (const event in flux) {
FluxDispatcher.subscribe(event as FluxEvents, flux[event]);
}
}
return true;
}, p => `startPlugin ${p.name}`);
it would likely be good to refactor it to add the necessary subscriptions immediately
but thats a task for a separate pr
Sounds fine for commands and menus, but yeah for flux it'd be good to have it immediately
we could just add the flux listeners when it's waitFor callback is ran
the same place where it sets the export
that's too hacky or not? what do you think ven
Remember to also add the listeners when the plugin is enabled from the menu
true
This also makes a good opportunity to fix a longstanding bug in ViewRaw where the plugin doesn't unregister its context menus properly when disabled
...Oh I'm dumb
The check for whether the once-callback has been run happens after cloning the props, so it's run always
but remove it
Feels silly to remove the check separately from actually removing the callback, which I won't do until I've removed all the () => () => from everywhere
oh yaya
Do you think it's better to have ```js
contextMenus: {
"message": messageContextMenuPatch,
}
like that is fine
but this is good cuz you can type the function
and we don't need to use a const to type anymore
I'll have to move some of the patch definitions to above the plugin definition so it's in scope
That produces slightly bigger diffs than I'd quite like, but no way to avoid it
wdym
There was one case where export default definePlugin() was before const ctxMenuPatch: NavContextMenuPatchCallback so I had to move that to be before
Summary
Fetching a user ignores the accent color, banner, and premium type given. We can also deduce nearly all badges from the flags (like it used to work :p, but means the badge text will always be English).
jumpscare
so this just fills the profile info we can deduce from fetching the user?
Clones the context menu props so that they are not mutated (React doesn't like it when you mutate stuff). This makes it safe to run context menu patches at every rerender, so the thing with returning a closure which is run once is removed.[^useEffect] Additionally, since I had to edit all plugins that use context menu patches, I took the opportunity to add a contextMenus key to the plugin definition, and made all plugins use that.
yea
Is there a Statusupdate then or if this Plugin get merged?
Have the same Problem with Friends. Or exist a way to install this plugin byself?
Thanks.
Using Fedora 39 KDE here. I don't see the notification badge.
Icon from Papirus icon theme.
@brazen bone what's the reason for this check if it's a MenuControlItem, and why not for MenuItem too?
that's my only question, the rest looks good and I did some cleanups already
Discord does not recurse on MenuControlItem, so I do the sane
I don't understand
The MenuControlItem does n.props.children rather than recursing with e(n.props.children) like other cases do
- Rework how webpack require is grabbed:
-
Instead of trying to push a fake module to webpackChunkdiscord_app everytime it is value is defined again, it now monkey patches the init callback Discord runs to initialize the app after all needed chunks are loaded
-
This lets us more reliably get the webpack require as soon as we can, but of course not too soon in a point where needed properties would not be yet defined.
-
- Add beforeWebpackInit API:
- By monkey patching the init call...
wall of text jumpscare
Incomplete URL substring sanitization
'discord.com' can be anywhere in the URL, and arbitrary hosts may come before or after it.
Incomplete URL substring sanitization
'discord.com' can be anywhere in the URL, and arbitrary hosts may come before or after it.
@median rapids checkout this branch and look at the force server home button working https://github.com/Vendicated/Vencord/pull/2236
it looks even better
because the menu no longer closes
I would say this is a perfect pr to explode
wtf
Discord Development went back to Electron 22
can you explain this better, I can't understand why we shouldnt clone that
Because blindly cloning stuff can have weird side effects, like messing up arguments objects and probably breaking react refs
I can't say for certain that anything would indeed break, but I'd rather play it safe and only clone what's necessary
And as mentioned, it's not like window.structuredClone would be of use since that doesn't work on functions, so it's either a custom function or lodash
okay then
we also need to do this
it's likely another case where we do not know what it can be
and the reason for the second predicate
well actually the third is not needed
If we want to be very faithful to discord's code it'd be ```js
if (obj.type === Menu.MenuGroup || (obj.type === Menu.MenuItem && obj.props.render == null)) {
// clone children
}
MenuItem doesnt have children anyways
It does though, that's how you make submenus
I mean
when it has render it doesnt have children
so we dont need the predicate
I think this works, we can change if it causes issues but I doubt it will
as I said the third predicate is not needed because it render is present, then children isnt
I guess (type === MenuGroup || type === MenuItem) && children would be enough
hm okay
But what's going on with this module (the one where MenuControlItem and all that are supposedly defined) ```js
function (e, t, n) {
"use strict";
function i() { return null; }
function r(e) { return null; }
function o(e) { return null; }
function a(e) { return null; }
function s(e) { return null; }
function _(e) { return null; }
n.r(t),
n.d(t, {
MenuCheckboxItem: function () { return a; },
MenuControlItem: function () { return _; },
MenuGroup: function () { return r; },
MenuItem: function () { return o; },
MenuRadioItem: function () { return s; },
MenuSeparator: function () { return i; },
});
};
...I guess those aren't real components, since they just check for identity of the type
Β» Vencord.Webpack.Common.Menu.MenuCheckboxItem.toString()
function a(e){return null}
``` Yep those are the real definitions, fun
I sure wonder why they made it in such a convoluted way
it's sad that we have to deal with this cloning stuff
but it's honestly the least hacky way we can have a api which still gets access to the original context menu props
hmm actually
The only alternative I can see is making plugins manually patch each individual menu they need and that's bad
there is another way but it's complicated
need to patch openContextMenu but also need a way for the contextMenuApiArguments to reach it
and we would need to build our menu items manually too
this is okay for now
it's not
for some reason in some context menu items are being duplicated
I'm gonna keep this
seem to work for all
yeah like why not just make the menu components be the actual thing that's rendered
btw it was even funnier back when we had mangled exports so there was no way of knowing which function is which menu item
i wrote a cursed patch that properly named all of them
and nookies and i together wrote a really cursed dynamic patch generator that found all menu api usages in other files based on a minified name
**apiMenuItemDeobfuscator.ts: **Lines 41-77
{
find: '"Menu API',
replacement: {
match: /function.{0,80}type===(.{1,3})\..{1,3}\).{0,50}navigable:.+?Menu API/s,
replace: (m, mod) => {
let nicenNames = "";
const redefines = [] as string[];
// if (t.type === m.MenuItem)
const typeCheckRe = /\(.{1,3}\.type===(.{1,5})\)/g;
// push({type:"item"})
const pushTypeRe = /type:"(\w+)"/g;
let typeMatch: RegExpExecArray | null;
// for each if (t.type === ...)
while ((typeMatch = typeCheckRe.exec(m)) !== null) {
// extract the current menu item
const item = typeMatch[1];
// Set the starting index of the second regex to that of the first to start
// matching from after the if
pushTypeRe.lastIndex = typeCheckRe.lastIndex;
// extract the first type: "..."
const type = pushTypeRe.exec(m)?.[1];
if (type && type in nameMap) {
const name = nameMap[type];
nicenNames += `Object.defineProperty(${item},"name",{value:"${name}"});`;
redefines.push(`${name}:${item}`);
}
}
if (redefines.length < 6) {
console.warn("[ApiMenuItemDeobfuscator] Expected to at least remap 6 items, only remapped", redefines.length);
}
// Merge all our redefines with the actual module
return `${nicenNames}Object.assign(${mod},{${redefines.join(",")}});${m}`;
},
},
},
basically it used this type: "control" to know which one it was
this was when we removed the curse
in fact the day I made that dynamic patch was when I learned about proxies
Exports having names is quite convenient
Discord could make this much harder if they wanted
it wasn't that worse
it was fine yeah
you just had to guess more
like this was the only cursed thing
like hmmmm what does this function do
and you had to findByCode everything
but other than that it was whatever
oh and their old compiler aggressively merged modules and killed a shit ton of exports
so we often had to use patches just to grab discord functions
while other mods just coped without those modules
findByCode was pretty stable anyways
I guess you still had prop names to navigate by
yeah
this was incredibly cursed
Decor still does it for some not exported stuff lol
honestly Vencord went to another level when ven made the reporter
it's life saving
Automated diagnostics is always good
but we didn't have webpack finds testing for a long time
only patches and bad starts
vencord has so many crazy things that other mods don't have
and discord errors which has never been useful besides showing discord shit code when a variable isnt defined
we're the future π
some of the errors I wrote to ignore still happen
and it is not our fault
lmaooo yeah it's mostly useless
but i originally added it to like see if our patches cause errors you know
yeah vencord has me 
because the reporter nowdays loads chunks using their entry points
yeah
if you merge my webpack refactor pr we will be the first mod to use that way of grabbing webpack stuff too
all the rest still push to the array
how does the new system work?
tbh i love that the webpack runtime is so monkey patchable
i wonder if they did that on purpose
**patchWebpack.ts: **Lines 53-96
// wreq.O is the webpack onChunksLoaded function
// Discord uses it to await for all the chunks to be loaded before initializing the app
// We monkey patch it to get immediate access to the webpack require before the app runs,
// and to monkey patch the initialize app callback to run our listeners before doing it
Object.defineProperty(Function.prototype, "O", {
set(onChunksLoaded: any) {
const wreq = this;
// When using react devtools or other extensions, or even when discord loads the sentry, we may also catch their webpack here.
// This ensures we actually got the right one
if (new Error().stack?.includes("discord.com") && wreq.p === "/assets/") {
logger.info("Found Webpack onChunksLoaded");
delete (Function.prototype as any).O;
const originalOnChunksLoaded = onChunksLoaded.bind(wreq);
onChunksLoaded = function (result: any, chunkIds: string[], callback: () => any, priority: number) {
if (callback != null && initCallbackRegex.test(callback.toString())) {
Object.defineProperty(wreq, "O", {
value: originalOnChunksLoaded,
configurable: true
});
const originalCallback = callback;
callback = function () {
_initWebpack(wreq);
for (const beforeInitListener of beforeInitListeners) {
beforeInitListener();
}
originalCallback();
};
}
originalOnChunksLoaded(result, chunkIds, callback, priority);
};
}
Object.defineProperty(this, "O", {
value: onChunksLoaded,
configurable: true
});
},
configurable: true
});
o that's smart
so it's basically
initVencordWebpack()
beforeInitListeners()
callDiscordEntryPoint()
but all with monkey patch
I kinda don't think so; like if they wanted that, they'd have made .u() a plain object instead of a function wrapping an object which I can only assume is to make it non-iterable
wdym?
Not that it works, there are ways to get hold of it anyway
i forgot what u is, remind me again
u is the chunk id to asset url map
Chunk id -> javascript asset mapping
Yeah
yeah
yeah i extracted the map in the past it's really easy
const map = eval(wreq.u.toString().match(regex);```

not so long ago they made it worse
You can extract it either with prototype pollution or regex
you can't do that anymore
ofc its .toString
tbh i wonder why it even is that way
don't you lose some performance by always declaring the object inline
instead of caching it in a variable
Probably not much, but yeah must be nonzero
i wonder if browser's js engine does some optimization
Though getting chunk urls is hardly a bottleneck compared to the subsequent http request
the https request pales in comparison to discord code performance
thank you gboard for correcting http to https
Blocks messages containing certain keywords (defined by the user) as if they were sent by a blocked user.
yes ofc
that is very true yeah
and it's nothing compared to discords own performance issues

Bypass DND allows you to set specific guilds/channels/users to still receive a notification from when in DND mode.
You will only get the notification if:
- The message is pinging you (for guild and channel bypasses)
- All messages in DMs
.id) because message.mentioned returns undefined π€·ββοΈ
Discard all of the changes in this file
This is typescript, not javascript. Give this a type
Wrap this in a try catch cause any error in here will cause a gateway disconnect
Run eslint to add the header and make your code look nice (also the pr is blocked from merging if it fails linting)
Alrighty, Iβll fix these when I get home
I think Iβve fixed it?
channeltabs has made me realise how fucking slow discord really is
Why are these bots special-cased? (used in a function getSystemMessageBotJoin) ```js
let a0 = {
"234395307759108106": "https://groovy.bot/commands",
"365975655608745985": "https://www.pokecord.com/getting-started",
"512412940897484800": "http://jameslantz.net/smilebot",
};
Thinkies Discord jank
It was for 2017/2018
they had a section in guild settings
similiar to app directory or so
but they hand picked like 6 bots
and thats what its used for
well more like no longer used
i think i can vaguely remember something like that
react intentionally doesn't allow using important within the style property. i wanted to make the color important because plenty of themes break it, but it's likely fine to remove
Why does channel.getGuildId() exist? It's just return this.guild_id
idk, it causes no harm though
Except for being unnecessarily confusing
look at this disgusting hack i made yesterday
works really well btw
https://github.com/Sqaaakoi/Vencord/blob/betterChannelTabs/src/plugins/channelTabs/titlebarVars.css
Can someone judge this hackiness though (It has hardcoded class names in it, what should I do instead?)
don't do that
what should I do instead
because i'm sure there is a Proper Wayβ’οΈ
@austere talon this is worse though
See this
(Overriding heights used for the original Discord titlebar)
Oh and before anyone screams too hard at me, Yes I know that file is undisputably a hack
and I will not PR that into ChannelTabs
Is your feature request related to a problem? Please describe.
The Notification Badge option only works when libunity is installed, but this might not be exactly clear to non-Ubuntu users.
Describe the solution you'd like
In the option's description, add a help text such as:
Note: if this is not working for you, be sure to install the "libunity" package for your distro.
**De...
it should just be added as a dependency
What if :root { transform: rotate(90deg) }
why husk my idea
What if * { transform: rotate(0.005deg) }

So true bestie
What have I done
:root { transform: rotate(-90deg); width: 100vh; height: 100vw; right: 0; bottom: 0; }
to like
get the guild id? idk man
I have a stupid question
Would automatically muting yourself in a voice channel be considered selfbotting
depends how the action is triggered ig?
inactivity
Inactivity is the opposite of action

I will respectfully refrain from submitting a PR until it has been determined whether the act of automatically muting yourself is considered selfbotting
what is it
Automatically muting yourself in a voice channel if you haven't spoken for a certain amount of time
Well it is a self bot but I think its fine since it will barely happen
not really imo
anything that doesn't spam requests is fine
my idea definitely doesnt spam requests
if the requests could reasonably be triggered by normal app usage, it's fine
the most it would send is a single mute yourself event
yeah the request could be triggered normally too
the only concern I have is how it would precisely trigger after a certain time
which..... is the whole point
reusing code I already wrote time!!!!!
Would this be considered hacky
What's wrong with [15, ...makeRange(60, 900, 60)]?
Nothing at all.
Thank you for the suggestion on how to improve because I forgot you could do that with an array (for a moment)
None
None
None
None
None
None
None
None
veetop
Describe the bug
Screen flickering after opening a pop-up, as in full user profiles
This bug is happening after upgrading plasma from 5 to 6
The "flickering" is the user profile disappearing quickly then coming back
This issue seems to happen around 5 seconds after opening the full user profile pop-up
To Reproduce
Select user from server member list
Open the profile fully by selecting the profile image
Wait around five seconds
Elements disappear and reappear i...
try to disable hardware acceleration
[Vendicated/Vendroid] New star added
)