#👾-core-development

1 messages · Page 44 of 1

austere talon
#

maybe that's what you're thinking of

limber skiff
#

yeah but they use a different endpoint

austere talon
#

yes, the old one is just normal message

limber skiff
#

that's why it doesnt have ratelimit

austere talon
#

no

#

the greet endpoint has super strict rate limit wdym

limber skiff
austere talon
#

it only lets u wave like 3 times before u explode

#

the message send has hardly any rate limit so u can send dozens of waves

#

there's a snippet in general pins that I wrote ages ago when I played around with it

#

it let's u send up to 3 welcome stickers in one message

#

and u can spam that shit

#

and use it without nitro

#

it's funny

limber skiff
#

idk It's been ages since I did the thing with the bot

#

I just remember I spammed a bunch of welcome stickers

#

each were replying to the last sent message

austere talon
#

the normal message sends I mentioned only work in reply to welcome messages iirc

limber skiff
#

oh yeah no the method I was using could reply to non welcome messages

#

it was a chain

austere talon
#

but definitely not the greet endpoint

#

unless discord is tripping

limber skiff
#

I swear it was lol

#

god why cant I find it

austere talon
#

it still works I tried it earlier

#

triple wave is hilarious

#

noone sees it coming

limber skiff
#

I must have deleted it

#

grr

#

LOL

austere talon
#

???

#

how

limber skiff
#

the rate limit is different for each message

austere talon
#

is that just greet

limber skiff
#

yes

austere talon
limber skiff
austere talon
#

I think they only did it to stop greet spam

limber skiff
#

so you can chain it and spam greets

austere talon
#

I'm more so surprised they allow you to greet non welcome messages considering it would be trivial to check

limber skiff
#

you just need to change the message reference

austere talon
#

like I said it only lets u use them in reply to a welcome message

limber skiff
austere talon
#

not sure if the setting needs to be on

#

the greet one

#

wait it sent distok?

#

that might just be an incompatibility between nitro spoof and greeter lol

#

try disabling fake nitro

limber skiff
#

wtf

#

message link emebds jumpscare

#

didnt work

austere talon
#

try enabling greets

#

wait

limber skiff
#

watch this ven

#

ready?

austere talon
#

try now

#

no

#

don't spam lmao

limber skiff
#

a bit

austere talon
#

but try greeter now

#

I enabled welcomes

#

banned for spam

limber skiff
#

so funny

#

insane how they allow this

austere talon
#

yeah so it needs to be on

#

funny

limber skiff
#

yop

austere talon
#

that's like the legacy way of greeting

#

I assume that's why they have so strict checks on it

limber skiff
#

both ways are cursed

austere talon
#

yes

limber skiff
#

I wonder if this still works

austere talon
#

yes

#

it's the same concept as greeter

#

u can send up to 3 stickers per message

#

discord just doesn't let u do it in the client

limber skiff
#

insane discord

#

hell nah

#

aint no way this still works

austere talon
#

maybe should prune third party plugins

#

remove the broken ones

limber skiff
#

insane how no one finished sound changer

#

maybe I should give it a try

charred monolithBOT
austere talon
#

too hacky for my liking

#

and I do like myself some hacky code from time to time

limber skiff
#

is this useful

austere talon
#

it makes errors not have discord voice as location

#

for some reason discord voice monkey patches console

#

So all the errors originate from discord voice even if they're not from there

#

just weird

cunning canyon
#

i cant even enable it when i try to install

limber skiff
#

I never noticed

austere talon
#

discord desktop?

cunning canyon
#

desktop

austere talon
#

should work then!!

#

I need to vencord desktop pill everyone

limber skiff
#

you will implement keybinds

#

and voice/stream support

austere talon
#

and why

#

I never used that feature before

limber skiff
austere talon
#

what do u use it for

limber skiff
#

mute

austere talon
#

u can just make a plugin

#

simple

limber skiff
#

I have it on my mouse

austere talon
#

I used to but I moved to number keys

cunning canyon
#

horror

austere talon
#

I use 4 to toggle mute

limber skiff
#

I use the button to go forward on navigatioh

austere talon
#

yes

limber skiff
#

so useless I only use it to mute and unmute

#

what about voice and stream support

austere talon
#

planned but idc much about it rn

limber skiff
#

😔

austere talon
#

fixing vc should be easy

limber skiff
#

I vc a lot

austere talon
#

streaming slightly harder

limber skiff
#

and stream too

#

lol

austere talon
#

do u Windows or Linux

limber skiff
#

windows

austere talon
#

screen sharing with audio on Linux virtually impossible

#

cause electron sucks

#

do u care about Audio

limber skiff
#

armcord had working stream but sound didnt work

austere talon
#

idk how hard it is on Windows

limber skiff
#

ye

#

I do

austere talon
#

PR

limber skiff
#

no idea how

austere talon
limber skiff
#

literally dont know where to start

austere talon
#

it seems to be easy

limber skiff
#

wait

austere talon
limber skiff
#

is it even possible to make the keybind plugin

#

doesn't discord have to be focused

austere talon
#

oh

limber skiff
#

even skype did it

austere talon
limber skiff
#

like 8 years ago

austere talon
#

you can share audio only if sharing whole screen

#

not if sharing window

#

just read that doc I sent

#

it's pretty straight forward

limber skiff
#

but sharing whole screen doesnt share audio

#

on current discord

austere talon
#

cause discord uses their own native stuff

#

cursed

limber skiff
#

ew

#

but interesting

#

OHHH

#

THATS WHY ARMCORD AUDIO DIDNT WORK

#

you needed to share the whole screen??

austere talon
#

I think armcord just doesn't support it

limber skiff
austere talon
limber skiff
#

tbh I stopped using armcord cuz lf it

austere talon
#

does that mean it's somehow possible on Linux??

limber skiff
#

I had to change between discord clients to screenshare

#

are you using vencord desktop as main client already?

austere talon
#

yes

#

wait

limber skiff
#

dang

austere talon
#

try running this in vencord desktop navigator.mediaDevices.getUserMedia({ audio: { mandatory: { chromeMediaSource: 'desktop' } }, video: { mandatory: { chromeMediaSource: 'desktop' } } })

limber skiff
#

oh I'm on mobile

#

and my vencord desktop is outdated

austere talon
#

and put it in a video tag or smth and see if it has audio

#

it should

austere talon
limber skiff
austere talon
#

html

limber skiff
#

ah

austere talon
#

const video = document.querySelector('video')
video.srcObject = stream
video.onloadedmetadata = (e) => video.play()

woeful sable
#

I will get upp

limber skiff
#

yes

#

try it

golden gulch
#

i have vague memories of no audio on linux being because of not being able to stop people from streaming music or other copyrighted stuff as easily as it is on windows/mac but I have no actual source for that

#

my brain could have just made it up

woeful sable
limber skiff
#

do you have school?

woeful sable
#

nop

#

I just haven't slept yet

limber skiff
#

same

woeful sable
#

my cat is sleeping on my arm I'm not legally allowed to get up

cedar leaf
#

i don't recall the name of the module but i think discord supports it natively now

charred monolithBOT
charred monolithBOT
#

Discord Account

RyanCaoDev#0428

What happens when the bug or crash occurs?

When you click on an avatar added by the WhoReacted plugin to see the user popout, it also triggers the click and adds a reaction for yourself.

What is the expected behaviour?

The expected behavior is probably to only add the reaction when you click in the box somewhere that isn't a user avatar.

How do you recreate this bug or crash?

  1. Use the WhoReacted
  2. Click an avatar in a reaction

Er...

charred monolithBOT
#

Discord Account

No response

What happens when the bug or crash occurs?

When trying to view any user's profile (even my own), it warns me that it couldn't load the profile banner, About Me and badges.

What is the expected behaviour?

It should show all of the user information as normal.

How do you recreate this bug or crash?

  1. Go to any server
  2. Attempt to view any user's profile, for example via the member list or by clicking on a profile picture in the chat

Er...

woeful sable
#

virus

turbid hatch
#

it was a surprisingly small thing to fix

#

they were complaining about the installer more than the software lmfao

woeful sable
#

RMDir /R /REBOOTOK

#

windows is not ok

#

wtf is THAT

turbid hatch
#

remove dir

#

recursively

#

and if it fails, schedule it for the next reboot

woeful sable
#

what.

turbid hatch
#

this is how installer development works!

#

sometimes you cant remove your installation folders for one reason or another

woeful sable
#

NO ITS NOT

turbid hatch
#

it is

#

autogenerated installers do the same thing

#

:P

woeful sable
#

windows

#

.

turbid hatch
#

you have to manually specify it in NSIS because if it fails then it crashes the uninstall procedure

#

or it shows an ugly messagebox saying that it cant remove its files

woeful sable
#

correct behaviour

#

RMDir /R /REBOOTOK C:\

jagged cloak
#

nop do not

#

me when I remove entire drive

turbid hatch
#

the thing is

#

the other policy violation is a smartscreen error

#

i cant fix that lol

#

OH FINALLY

#

I GOT IT TO SHOW THE ERROR

#

OKAY

#

i had to run it in windows sandbox

#

this is so dumb

woeful sable
#

windows sandbox more like litterbox !!!

brazen phoenix
#

@cunning canyon small issue

#

uh and only on your profile

cunning canyon
#

hmm how

brazen phoenix
#

ah

cunning canyon
#

wut

brazen phoenix
#

screen recorder not working guh

#

well it's just like that when the profile popout doesn't fit the window's height

#

is it a discord issue

cunning canyon
#

looks like my css issue

brazen phoenix
#

looks like you have an avatar patch

#

yeah

cunning canyon
#

😭

cunning canyon
#

how about force them become nitro profile like fakeprofiletheme

charred monolithBOT
somber ginkgo
#

@lean elm @dawn coyote latest UserVoiceShow css fixes appearance in popouts, but breaks full profile view

#

(yes, i tried with no custom css/themes)

dawn coyote
#

doesn’t really@look broken to me

somber ginkgo
#

there's no left/right padding

#

bit more apparent with no theme

dawn coyote
#

tbh didn’t even know it shows on the profile there too

#

will try to fix it when i’m home if none else does before me

somber ginkgo
#

lol

lean elm
somber ginkgo
dawn coyote
#

lol

#

wait that shit had a css file? kek

lean elm
#

@dawn coyote no front xd

dawn coyote
#

I only used vsc search to find the plug-in and added the margin, it looked fine to me so I put it on github kek

#

oh it was in a folder, that why I wasn’t able to find the ts file lmfao

lean elm
#

Omg

lean elm
dawn coyote
#

lmao

#

It was like 11pm and randomly saw it while in vc

#

didn’t bother too much to look in how the plug-in works

#

for protest, I’ll keep my version on local

lean elm
#

Yea tho in the beginning I also didn't check if the styling was right when I click my own profile

austere talon
#

macos skill issue

#

works for me on Windows :P

#

I'm curious if it works on Linux

austere talon
#

@woeful sable meow

cold patio
#

Does anyone know how I can add my built version of Vencord to my browser as an extension? I tried adding the browser folder to my extensions and it failed and said something was wrong with the version so I fixed that and it loaded but it doesn't change anything in discord. I tried it in chrome and edge.

austere talon
#

you need to build it

#

pnpm buildWeb

#

then there's extension.zip and extension-unpacked in dist

austere talon
#

same goes for the other default menus, could add them all

cold patio
austere talon
#

Note: The default menu will be created automatically if the app does not set one. It contains standard items such as File, Edit, View, Window and Help.

#

are any other of these relevant?

#

could add them too

charred monolithBOT
austere talon
#

(the name)

turbid hatch
#

oh well i thought that come second review they might get a bit upsetti

#

because the tool is called installer

#

but im installing it as patcher

#

and it seems like they changed the policy cuz i looked and there's loads of "installer"s

austere talon
#

I didn't know it was this simple to add the entire menu row back

#

but if it is then by all means go ahead

charred monolithBOT
austere talon
#

ah but u need to make a new release right

turbid hatch
#

i can update the existing bundle

austere talon
#

virus

turbid hatch
#

just have to wait for it to build in actions

austere talon
#

why not build it urself

turbid hatch
#

i cant compile the installer on my PC gon

#

it just

#

doesnt

charred monolithBOT
#

Currently, the plugin functions by inserting the encrypted text into the message box, and then the user must press "enter" to send the message. However, it could be made more efficient by having the plugin send the encrypted message directly to the server, thus eliminating the extra step. Additionally, the button in the modal window is labelled "send," which may mislead users into believing that the message is being sent to the server, even though it is not.

![image](https://user-images.gi...

lime stone
#

yummy

austere talon
#

don't edit the zoom menu

#

the default one doesn't work on qwertz and some other layouts

#

see the second one that has a comment on top

#

you removed the custom accelerator

#

that won't work

#

oh

#

the git diff is being weird

tight vapor
#

GitHub in Discord plugin when

somber ginkgo
#

imagine a place™ where permissionsviewer and joinvoicesettings were available

fleet depot
#

impossible

cold patio
#

Is there a way to specify in a plugin that it isn't browser compatible?

verbal pumice
cold patio
#

Should I only name the index file like this or all files? And what does the x mean?

verbal pumice
#

and (x) as in .ts|.tsx

cold patio
#

Ahhh. Thanks for the help 🙂

austere talon
#

just the index file

#

src/plugins/MyPlugin/index.desktop.ts

grave mangoBOT
cold patio
# austere talon just the index file

That's weird if I rename my index file from index.tsx -> index.desktop.tsx I get

Build failed
Build failed with 1 error:
import-plugins:~plugins:20:16: ERROR: Could not resolve "./plugins/betterScreenshare"

Did I miss something?

austere talon
#

ah

#

yeah that makes sense

#

what do you prefer

plugins/BetterScreenshare/index.desktop.ts
plugins/BetterScreenshare.desktop/index.ts

cold patio
#

The first one

#

But I think the second one is better because you will see it immediately in the plugins folder instead of having to open it first.

turbid hatch
upbeat spindle
verbal pumice
#

2nd one

austere talon
#

lmao why did u delete ur triple greet @limber skiff

#

are u worried about getting banned

#

you won't

azure jay
jagged cloak
#

true

#

make user figure it out best solution

#

||(obvious sarcasm)||

limber skiff
#

@jagged cloak what did you ping me for lol

jagged cloak
#

distok

limber skiff
#

oh

somber ginkgo
#

@limber skiff

limber skiff
#

me

somber ginkgo
#

merge everything immediately xdd

#

also funny ping

austere talon
#

fire

limber skiff
#

I got jumpscared with audio loop

charred monolithBOT
charred monolithBOT
charred monolithBOT
gloomy heart
#

btw the Fake nitro emojis are broken again, it dont hide links, and shows as normal picture...

charred monolithBOT
jagged cloak
#

nooooppp you are literally devilbro

woeful sable
#

😭

jagged cloak
#

looks fine from glancing at this giant ass pr

#

this begins the era of vencord plugin libraries trolley

azure jay
#

why is it called philspluginlibrary lmao

#

thats not very descriptive

jagged cloak
#

idk lol #notmyjob

lament nimbus
#

If I setup a selfhosted backend is it possible to limit who can use it

#

I don't see an env var but can you do that through discord dev portal or something

austere talon
#

i think u can make the app private or smth

#

other than that ucould pr that as a feature

lament nimbus
#

idk go
I'm sure I could figure out how to add an if block though, not sure how go tooling works though

austere talon
lament nimbus
#

also I assume size limit is in bytes?

austere talon
#

i learned it in one weekend to pr to aliucord backend

#

xd

austere talon
lament nimbus
#

me omw to sync the original doom game

#

guess ill pr

#

actually I shouldn't really need to use tooling at all because docker lol

frail skyBOT
#
Bad Patches

WebContextMenus (had no effect):
ID: 638525
Match: /(?<=showApplicationCommandSuggestions;)if\(![A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*\)/

WebContextMenus (had no effect):
ID: 638525
Match: /("submit-button".+?)(\(0,[A-Za-z_$][\w$]*\.jsx\)\([A-Za-z_$][\w$]*\.MenuGroup,\{children:[A-Za-z_$][\w$]*\}\),){2}/

Bad Starts

None

Discord Errors

JSHandle@error

honest geyser
#

oh no

charred monolithBOT
frail skyBOT
#
Bad Patches

WebContextMenus (had no effect):
ID: 638525
Match: /(?<=showApplicationCommandSuggestions;)if\(![A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*\)/

WebContextMenus (had no effect):
ID: 638525
Match: /("submit-button".+?)(\(0,[A-Za-z_$][\w$]*\.jsx\)\([A-Za-z_$][\w$]*\.MenuGroup,\{children:[A-Za-z_$][\w$]*\}\),){2}/

DisableDMCallIdle (found no module):
ID: -
Match: .Messages.BOT_CALL_IDLE_DISCONNECT

Bad Starts

None

Discord Errors

JSHandle@error

woeful sable
#

shouldnt disabledmcallidle be yoinked

austere talon
#

ye gonna delete

austere talon
#

@limber skiff

#

u know how ctx menu api forces u to check children so u dont add duplicates?

#

we can just do this instead

limber skiff
#

yeah

#

hmm

austere talon
#

adding this btw

limber skiff
#

tbh I dont like both ways

austere talon
#

yeah

#

it would be better to not have this issue

#

but shrug

limber skiff
#

yeah

#

hmm

#

honesntly

#

I think we should not let the duplicates

austere talon
#

lol it doesnt use context menu api

limber skiff
#

2 elements shouldnt have the same id

austere talon
limber skiff
#

so we can just filter it

austere talon
#

but that only works for top level unless u wanna walk the entire thing

#

explosion

limber skiff
#

hmmm

austere talon
#

do u think i guessed the name correctly

#

i did

limber skiff
#

what if we proxy the push method

#

when you use findGroup blabla

austere talon
#

eeeh

#

idk

#

is everyone on electron 22 now

#

or still some 13

limber skiff
#

ido

#

idk

charred monolithBOT
austere talon
#

completely rewrote plugin

#

u infected me @limber skiff

limber skiff
#

niceee

charred monolithBOT
limber skiff
#

how is this even being found

austere talon
#

phone

#

mobile discord has that

limber skiff
#

ahhh

charred monolithBOT
knotty horizon
#

egg

#

I got web crypto API working :3

austere talon
#

would this be useful?

#

lets u run react stuff in the console

honest geyser
#

yes

jagged cloak
#

yepp

lament nimbus
#

is there really no standard way to check if a []string contains a string in go

#

wtf

lament nimbus
#

I hate go already

woeful sable
#

we will rewrite the backend in rust inshallah

lament nimbus
#

lol what

#

oh

#

@ ven you are bad at docker

woeful sable
#

hop off docker

lament nimbus
#

docker is great

woeful sable
#

docker is evil

#

also ven isnt a contributor in the repo trolley

lament nimbus
#

well whoever made this is bad at docker then

#

oh I guess the readme says to change it

#

but why isn't it redis:6379 by default

#

thats dumb

lament nimbus
#

Also, as a side question, is the discord client the one making the request to /v1/oauth/callback?

#

thanks sans

charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
austere talon
#

but im pretty sure they added that method along with generics

#

slices.Contains()

#

oh u found it

charred monolithBOT
#

Discord Account

me

What happens when the bug or crash occurs?

when disableMinSize is false, it doesn't check if the user has put in a custom MIN_WIDTH or MIN_HEIGHT

https://github.com/Vendicated/Vencord/blob/main/src/main/patcher.ts#L115-L124

What is the expected behaviour?

The patcher should respect the user's MIN_WIDTH and MIN_HEIGHT, only setting defaults if it doesn't already exist.

How do you recreate this bug or crash?

Set custom MIN_WIDTH and MIN_HEIGHT and t...

charred monolithBOT
austere talon
#

?

lime stone
#

seems to also be blocked by csp

#

or am i getting it the wrong way around?

austere talon
lime stone
#

oh, is that a good idea?

#

what if discord has a vulnerability?

#

seems i can't do fetch("https://raw.githubusercontent.com/") on a local server which has no csp header

#

nvm, i'm dumb

#

it's removing the header from github's response

#

or any response (it seems)

#

is this relevant?

lament nimbus
#

@turbid hatch why did you merge so weird

#

You had permissions to add commits to my fork

turbid hatch
#

because i tried pushing to your fork and it refused to let me

#

so i just did it myself

#

it rejected my push when i tried doing so

#

dont know why

lament nimbus
#

The entire commits name is now "optimize slightly"

austere talon
#

huh

turbid hatch
turbid hatch
lament nimbus
#

Could you at least add me as a co-author to the commit if you can

turbid hatch
#

ignore that

#

it varies on OS

#

i dont know what it is on linux or mac

#

lol

austere talon
#

Backend

turbid hatch
#

is it?

austere talon
#

Backend
Backend.exe

#

yes

turbid hatch
#

alright

#

whats your coauthor line @lament nimbus

lament nimbus
austere talon
#

blackman530

turbid hatch
#

what the fuck is git on

#

i edit 5899743

#

and it creates a NEW commit

#

i literally told it to amend the message

#

okay

#

im done im too tired for this lol

austere talon
#

lol

turbid hatch
#

git is pissing me off

austere talon
#

want me to fix it up

turbid hatch
#

🙏

austere talon
#

okay in a bit

turbid hatch
#

ty

lament nimbus
austere talon
#

oh wait

#

I read it completely wrong

#

tbeckman530

#

I think it's cause tbeck isn't a word so my brain just "fixed" it to the nearest word

woeful sable
charred monolithBOT
charred monolithBOT
charred monolithBOT
charred monolithBOT
lime stone
#

just a bit verified

austere talon
charred monolithBOT
charred monolithBOT
austere talon
charred monolithBOT
lime stone
#

somehow i forgot about breakpoints

charred monolithBOT
lime stone
#

use breakpoints!

charred monolithBOT
lime stone
#

ok, kind of managed to get viewicons to work with webhooks!

#

can't find a good way that doesn't break with name changes

#

the distance between a possible name capture and the actual target is very far

#

is there a good solution other than writing all of the code in-between?

lime stone
#

kind of hard to see, but how could you capture "Z"?

#

well, better would be "W"

verbal pumice
#

small nitpick about FakeNitro but if you switch to a light client theme from dark stock then discord won't save that you switched to a light theme on other devices

lime stone
#

kind of makes sense i guess

limber skiff
#

can you explain a bit better

lime stone
#

hmm, maybe not a bug, i just realised why this is a feature!

#

but you can bypass it

charred monolithBOT
verbal pumice
#

great plugin

lime stone
#

can you rearrange them?

limber skiff
#

pogggg

austere talon
#

but wouldnt be hard to do

#

i don't think i will add categories

#

kinda useless imo

lime stone
limber skiff
#

ya

limber skiff
lime stone
verbal pumice
#

fnd

austere talon
#

should i add a setting to also show the dms in the normal list?

#

i think thatd be kinda useless

#

why would someone want duplicate entries

#

but would be easy peasy to do

#

i might as well ig

verbal pumice
#

muscle memory ig?

lime stone
#
{
    find: "().avatarWrapperNonUserBot",
    replacement: {
        match: /(onClick:)(\i\|\|\i)\?(void 0)/,
        replace: "style:($2)?{cursor:\"pointer\"}:{},$1$2?()=>{$self.openImage(W)}"
    }
}
limber skiff
lime stone
#

yes!

#

W

austere talon
#

\i=(\i).avatarSrc,

lime stone
#

i need to capture it in the same patch though

#

unless... i guess i could store it in a variable? (using lambda)

#

is there a better way though?

limber skiff
#

nah just wait

#

regex101 insane

lime stone
#

i have used that site likely more times than i've eaten

#

i have used discord in my entire life more time than i've spent photographing sushi!

#

i don't know whether this should worry me

fleet depot
#

Also shout-out to regexr

#

There's a replace function

lime stone
#

:O

charred monolithBOT
limber skiff
#
{
    find: "().avatarWrapperNonUserBot",
    replacement: {
        match: /(avatarPositionPanel.+?)onClick:(\i\|\|\i)\?void 0(?<=,(\i)=\i\.avatarSrc.+?))/,
        replace: '$1style:($2)?{cursor:"pointer"}:{},onClick:$2?()=>{$self.openImage($3)}'
    }
}
limber skiff
austere talon
#

the code is so hacky cause discord's dm code is mega deranged

lime stone
#

i will surely break it :3

lime stone
austere talon
#

i had to monkey patch the return type and walk the react tree

limber skiff
#

monkey patch 🤨

austere talon
lime stone
#

return type??

grave mangoBOT
# austere talon https://github.com/Vendicated/Vencord/blob/pinDms/src/plugins/pinDms/index.tsx#L...

**index.tsx: **Lines 73-100

Wrapper: ErrorBoundary.wrap((props: { originalComponent: React.ComponentType<any>; selectedChannelId: string; }) => {
    const original = <props.originalComponent {...props} />;

    const originalRender = original.type.render;
    original.type.render = (...args: any[]) => {
        const res = originalRender(...args);
        try {
            if (seen.has(res)) return res;
            seen.add(res);

            const container = findInReactTree(res, node => node?.props?.containerRef);
            const idx = container.props.children.findIndex(n => n?.props?.className?.startsWith("privateChannelsHeaderContainer"));
            if (idx !== -1)
                container.props.children.splice(
                    idx - 1,
                    0,
                    <PinnedDmsComponent />
                );

        } catch (e) {
            new Logger("PinDMs").error("Failed to patch DM list", e);
        }

        return res;
    };

    return original;
})
verbal pumice
#

"vencord so much better cause regex patching"

lime stone
#

javascript has no return types, right??

austere talon
lime stone
#

that's what makes so great! 🌈🗑️ /s

limber skiff
#

ven insane

austere talon
#

because discord uses their abstract List component

verbal pumice
austere talon
#

so you can't really regex patch it

#

cause it's so abstract

lime stone
#

oh i see

lime stone
limber skiff
#

I can try making it use regex patch later if you want

austere talon
#

sure but i doubt u can

#

you will see what i mean once u look into it

limber skiff
lime stone
limber skiff
#

it's fine on that case

lime stone
#

most frequently .+ and .*

limber skiff
#

you will also have better performance likely

lime stone
#

huh?

#

i feel like using a wildcard would slow down startup

#

(maybe not noticeable though :p)

#

let's see what the rest of vencord is doing

limber skiff
#

(avatarPositionPanel.+?)onClick:(\i\|\|\i)\?void 0(?<=,(\i)=\i\.avatarSrc.+?))
^ match avatarPositionPanel ^ match predicate ^ look behind to capture the var name
and walk til find onClick and rest of things

lime stone
#

oh, you can look behind?

limber skiff
#

avatarPositionPanel is wayyy less common than onClick

#

that gives you better performance

lime stone
#

i thought that was only supported on Google Chrome v. 28519258912589582959

#

or something

austere talon
#

.+ is fine but you should always make them lazy, never ever nest them (ReDOS) and try to avoid using them in lookarounds

lime stone
#

lol outdated stackoverflow posts my beloved

#

maybe it's most efficient to capture into a var using a lambda though?

limber skiff
lime stone
#

is that just dirty?

#

yes....

#

x3

limber skiff
#

it's okay in that case

#

ven knows that

austere talon
limber skiff
#

ye

lime stone
#

ven approved™

austere talon
#

but lookarounds and other extensions mean ur engine is more vulnerable

lime stone
#

outdated stackoverflow probably :p

limber skiff
#

lookarounds in js so good cuz they support non fixed lengths matches

austere talon
#

Javascript regular expressions have the potential to take hours to complete

lime stone
#

doesn't seem to work though

lime stone
limber skiff
austere talon
#

that's what i mentioned just now, ReDoS (regex denial of service)

limber skiff
#

send me the regex that your console prints

charred monolithBOT
lime stone
#

ah, unmatched parens

austere talon
#

it's caused by exponential runtime when nesting quantifiers

limber skiff
#

oh

lime stone
#

it's OK now

limber skiff
#

wait huh

austere talon
#

like (a+)+b will take hours on an input string of many a not followed by b (because it will not match so the js regex engine will try every single path of possibly matching)

limber skiff
#

where?

austere talon
#

silly js

lime stone
#

at the end

limber skiff
#

oh

#

I added an extra )

#

my badd

lime stone
#

anyway thanks for this! you are one of the most regex god/goddess/[insert] of all time!

fleet depot
#

Deity

turbid hatch
#

this is why @umbral hill has a regex implementation that isnt in javascript

#

despite the rest of the bot being js

fleet depot
#

What's the regex implemented in

turbid hatch
#

rust

fleet depot
#

Oo

austere talon
#

Its syntax is similar to Perl-style regular expressions, but lacks a few features like look around and backreferences. In exchange, all searches execute in linear time with respect to the size of the regular expression and search text.

#

js regex doesn't guarantee that so worst case is exponential time growth in regard to input length

turbid hatch
#

aka sacrifice a few features that people dont generally use to protect against ReDoS

lime stone
turbid hatch
#

explode

austere talon
#

probably also for simplicity :P

turbid hatch
lime stone
#

(joke)

#

well, i guess there was a java version of discord?

austere talon
lime stone
#

@limber skiff should i co-author?

limber skiff
#

nah it's fine

lime stone
#

assuming that's indifference rather than total repulsion i will anyway :3

turbid hatch
#

well

#

not even trivial

#

just impossible with finite automata

#

as far as im aware, im only partially fluent in the theory of it

austere talon
#

with pure fininite automata yeah but yo could combine them with other logic perhaps

lime stone
#

don't mind me, just stealing your email address

austere talon
#

idk

turbid hatch
#

possibly but the mix would introduce vulns

#

id imagine

lime stone
#

oopsie

#

i forgot about let

limber skiff
lime stone
#

single quotes! unacceptable

#

so much cleaner... to escape everything

#

ahhh

limber skiff
#

🤮

lime stone
#

oh well, consistency

#

🤮

#

smiley dealer should webhookify the new emojis

austere talon
#

wdym

lime stone
#

resend them under a webhook

#

generally how you make people say things they didn't here on discord :3

lament nimbus
#

that would be horrible

#

smiley dealer is already bad enough

austere talon
#

lmao

jagged cloak
#

lol

austere talon
#

I love smiley dealer

jagged cloak
#

lore pog

lime stone
austere talon
#

lore pog

jagged cloak
#

slow smiley as usual smh

lament nimbus
#

pog

#

haha

austere talon
#

it's okay it doesn't get paid so it's a bit slow

lament nimbus
#

blocked :3

#

ok now that my pr was (jankily) merged time to selfhost vencord backend

jagged cloak
#

lore jumpscare

lime stone
#

pog

lament nimbus
austere talon
#

by fix default avatars you mean fix the fact that the format setting will make them use not png?

#

oh i see what u mean

lime stone
#

it causes an error in the console

austere talon
#
let { format } = settings.store;

if (url.startsWith("/")) {
    url = window.location.protocol + "//" + window.location.host + url;
    format = "png";
}
const u = new URL(url);
#
const format = url.startsWith("/") ? "png" : settings.store.format;
const u = new URL(url, location);
#

this does the same

lime stone
#

it does, i just don't like inline if

#

will change

#

should prioritise const i guess

austere talon
#

you should always aspire to make your code redeclare as little variables as possible imo

#

makes it more readable

lime stone
#

i thought that was sarcastic lol

austere talon
#

no i just brainfarted

lime stone
#

toot

#

wouldn't you have to duplicate the check to modify the url to be correct?

#

this one

austere talon
#

what

austere talon
#

look at the screenshot i sent

lime stone
#

ohh

#

sorry :P

#

didn't notice the other change

charred monolithBOT
lime stone
#

where is location from?

#

should that be url?

austere talon
#

window.location

lime stone
#

i thought location was a string

austere talon
#

you're using it in ur own code as not a string

austere talon
lime stone
#

i guess just add toString()?

austere talon
#

no

lime stone
#

or href?

austere talon
#

actually toString() works

lament nimbus
austere talon
#

you can pass location just fine

nocturne haven
#

the types for it are wrong

lament nimbus
#

yeah

nocturne haven
#

I had the same happening with other global apis, it's really annoying

lament nimbus
#

which if the types are default JS types it is the problem of the TS devs but whatever

#

its not the language itself, it is doing what is asked of it (checking if location is a string or url, which it is not)

lime stone
#

well i assume it compiles but vscode will bully me :'(

austere talon
#

just use location.href ye

nocturne haven
#

//@ts-expect-error or what ven said

lament nimbus
#

ts expect error is a bad idea

nocturne haven
#

ts bug you can't account for 🤷‍♂️

lime stone
#

sign it if you care that much :p

austere talon
#

i think passing location is actually not correct and the reason it works is because the URL constructor like many other js apis just implicitly converts the input to a string

lime stone
austere talon
nocturne haven
#

ah, yeah it's not a TS bug

austere talon
#

this could be fixed by porting rusts Into<T> type

lament nimbus
#

rewrite vencord in rust

#

easiest solution

nocturne haven
#

the actual spec says URL(url: string, base: string)

turbid hatch
#

you're correct ven

#

it's implicitly tostringing it

#

its technically wrong so typescript is right in this regard

austere talon
#

passing URL is also allowed tho

turbid hatch
#

yep

#

you can use that for copying or for doing what it says there

austere talon
#

I'm more surprised that location.origin does not derive from URL

lime stone
turbid hatch
#

i guess for most use cases people prefer strings

#

or its a legacy handover

austere talon
lament nimbus
austere talon
#

yeah but its hella slow cause serialisation & ipc is slow

austere talon
#

speedy web compiler

lime stone
#

speedy web compiler?

#

ah

austere talon
#

is that actually what it stands for

turbid hatch
#

yeah

#

it is

lament nimbus
#

it has a JS AST

austere talon
#

but yeah it's super slow because serialisation

turbid hatch
#

Slower Web Compiler

austere talon
#

swc took ~1s to parse a 1.2mb module, acorn was nearly instant

lime stone
lament nimbus
austere talon
#

naaah its not swcs fault

nocturne haven
austere talon
#

pure js js parser

lament nimbus
#

did you actually end up using it

lime stone
#

i see it a lot!

austere talon
#

the reason SWC was so slow is because you have to run wasm in a separate thread. To communicate with it, you need to first serialise the input string and send it over, then later serialise the return object

nocturne haven
austere talon
#

that's the slow part

austere talon
#

tbh even for binary manipulation, TypedArrays are incredibly fast so it's usually not worth it to use wasm

lament nimbus
jagged cloak
#

shitcode is programmer slang

lime stone
#

yea

lament nimbus
#

yop

nocturne haven
#

it feels like manually passing sparks in your CPU, not really the concept JS was made for

turbid hatch
#

wasm is only good if you're doing most of your stuff in wasm and the js bit is just a thin wrapper

#

if you're constantly passing data then its not worth it

lime stone
#

pins always seem to go to the bottom

#

if you can't reorder them that's annoying :(

#

anyway i wasn't sure whether you were saying my idea was pointless or another one

#

kind of obvious but pins also don't work for "buried" dms

#

well, not even buried

#

just any dm that's not on the list any more

nocturne haven
#

open it again then

charred monolithBOT
austere talon
lime stone
#

:O

#

nice

#

i think i needs a little preview though

jagged cloak
#

so true

lime stone
#

like with channels

austere talon
#

then id have to figure out how those work

#

i just used html drag & drop api

lime stone
#

html is nice

#

/s

#

discord makes it a nightmare to type that

nocturne haven
#

I've done such plugin before too, only issue I was facing was that the dms list is lazy scrolled and you'd have to patch it

austere talon
#

wdym

nocturne haven
#

typo, edited

austere talon
#

i don't touch any of the original ui

nocturne haven
#

well, the dms list of people is a lazy scroller, meaning it'll only render as much as screen height allows

austere talon
#

i just patched the DMChannel component to render null if it's pinned and not rendered by me and then just render each pinned channel myself

nocturne haven
#

that'll cause issues with the scroller, I can tell from experience

#

this is what you need to patch

#

you essentially patch the parent to modify sections

austere talon
#

wow discord's code for that is even more terrible than i thought

jagged cloak
#

holy shit horror

austere talon
#

discord carefully writing the worst react code you've ever seen

#

question is whether i care

#

just dont pin that many channels

nocturne haven
#

I mean, there could be better implementations of lazy scrolling honest

austere talon
#

if u pin that many channels u might as well just not use the plugin

nocturne haven
#

I wouldn't go that route

jagged cloak
#

we all go that route (lazy devs)

lime stone
#

haha

woeful sable
#

.

lime stone
#

i think it's best to make a feature work :P

jagged cloak
#

yeah

lime stone
#

why are you lame?

#

we can mention you fine, right

woeful sable
#

wtf bruh

#

vencord

#

ven

lime stone
#

ohh

woeful sable
#

why my shit get deleted

#

for asking about stereo

#

💀

jagged cloak
#

ig they were lame when they joined then changed name

austere talon
#

read the rules dumbass

woeful sable
#

pretty stupid

#

welp dont matter ill just do it my self

jagged cloak
#

have fun

nocturne haven
jagged cloak
#

lmao

austere talon
#

oh he left

lime stone
#

cyrillic possibly?

jagged cloak
#

oh no i cant earrape people on discord.com whatever will i do

red rock
#

anime gif :D

sudden pilot
#

Егор

#

egor

lime stone
jagged cloak
#

apparently russian military use discord

#

lmao

lime stone
#

i think it's related in some way

#

i just sound smarter using that term :)

#

even though it could be totally wrong

sudden pilot
#

literally a name smh

austere talon
#

@nocturne haven i assume sections stands for how many items each section has. So to render 3 pinnes dms I would need to change Sections from 5, 184 to 3, 5, 181 and then patch renderSection and renderRow to add my own handling?

lime stone
#

but possibly both sounds very smart and also makes you sound less stupid if you were wrong

sudden pilot
#

y'all should transliterate it instead of just lame face

austere talon
#

no

sudden pilot
#

yes

lime stone
#

set to uuid?

#

"I am a lame face" makes it even harder to mention x3

sudden pilot
#

ya

lime stone
#

vencord logic though, won't argue

sudden pilot
#

husk

lime stone
#

we're on the server that created <@&1073655264923881602>

sudden pilot
#

<@&1073655264923881602> explod

red rock
#

explod

nocturne haven
austere talon
#

isnt that exactly what i said

nocturne haven
#

I might be confusing it I guess

austere talon
#

why did they do it this way

#

weird af

nocturne haven
#

It's a library, back when discord was made this was best software

lime stone
#

hm, does viewicons work on the sidebar card for users?

austere talon
#

does that library ignore 0 sections

nocturne haven
#

reading your message again makes sense now, my bad zere_zoom3

nocturne haven
shut socket
#

For creating new UI component do I patch the parent component?

austere talon
#

ew wtf is preRenderedChildren

#

is that cached children or what

#

seems to only be the non dms

nocturne haven
#

it's just a number it seems

austere talon
#

yeah

nocturne haven
#

weird name though

austere talon
#

its always 5