#🧩-plugin-development

1 messages · Page 74 of 1

humble tulip
#

I think you're overthinking it ngl

#

People will see a preview button and know what it does regardless of where it is

pure temple
#

i like it where it is :(

flint bronze
#

Is there any way to set the z-index of a layerContainer containing a context menu?

#

Do I need to use :has

#

i tried

#

it is so bad for my use case

flint bronze
#

i made something very useful

#

real world example, in a debugger

cedar olive
#

actually good

flint bronze
#

should this be marked as a dev build only plugin?

cedar olive
#

pr to console shortcuts

flint bronze
#

it's a patch

#

is that still alright?

#

done

#

worth adding myself to devs for this @cedar olive?

#

eh probably not

#

nobody else has

humble tulip
#

I finally updated ReorderAttachments to use react-dnd (as per #👾-core-development message), do you think this green border serves as a good enough hint as to where the attachment will drop?
I did mess with having a full size placeholder in place of where it'd drop but it was kinda jank and I don't wanna put a lot of work into it if this is good enough

#

No music today, you're safe

flint bronze
humble tulip
#

I'll make it extra loud next time

#

I also had to add a small patch to make the attachment thumbnail not draggable otherwise it triggers the file drop again and adds it as a new attachment

flint bronze
#

hmm

#

i wonder if i should expand my name injection to other things

#

custom react hooks?

#

webpack modules?

#

horror

flint bronze
hushed loom
#

I didn't do that much

winter tartan
#

is there a way to know if someone has vencord or not? regardless custom badges

vast karma
#

No

winter tartan
#

UserStore or sum

vast karma
#

You can tell whether the current user has vencord though

dull magnet
torpid jolt
#

Hello I want to dev a plugin (adds an icon next to users in voice chats and when clicked a command like .v add_owner @clickeduser will be tipped) but I need some help and guidance

iron epoch
iron epoch
humble tulip
#

I'll move the styles to css so you can just quickcss over them

oak sundial
#

selfbotting despairge

swift delta
oak sundial
#

just a little bit

#

Either way this goes under rule 11 unless anybody wants to disagree with me you aren't really gonna get help with that here, you can look at other plugins but stuff that automatically sends messages and stuff is a no go

torpid jolt
# hushed loom Use a patch to add the button

I wanna add a button next to my user when i log in vc , I have this code who make a html code appear in a menu by using <Menu.MenuGroup> I don't know what to replace in order to have the button next to my user instead

green vessel
#

how to add the patch

#

help usssss

hoary pilot
#

v- programming

#

you won’t get support for a selfbot.

swift delta
timber remnant
#

Any guide on how I would add a button under Themes in Settings menu? Sorry I'm new to this whole patching thing

hoary pilot
timber remnant
#

i wanna add a way to download thems directly inside discord

timber remnant
#

oh

#

nvm then

swift delta
#

It’s actually a very good implementation too. They’ve got a website and everything.

frigid heron
#

how to use storage not reset when dc restarts

To store multiple guildid, channeldid, etc...

torpid jolt
hoary pilot
hoary pilot
echo siren
#
const { addFavoriteGIF, removeFavoriteGIF } = webpack.findByProps("addFavoriteGIF", "removeFavoriteGIF")
const { FrecencyUserSettingsActionCreators } = webpack.findByProps("FrecencyUserSettingsActionCreators")
const { GIFType } = webpack.findByProps("GIFType")

all of these modules are now gone, are there newer methods for adding and removing favorite gif and finding the gif type?
~~Ah it's something like this now

const FrecencyUserSettings = find(m => m.ProtoClass?.typeName.endsWith("FrecencyUserSettings"))

// get current favourite gifs
FrecencyUserSettings.getCurrentValue().favoriteGifs.gifs

// add favourite
const data = {
    url: "https://tenor.com/view/wumpus-discord-repost-if-you-repost-gif-20674712",
    src: "https://media.tenor.com/citg5i4shIwAAAPo/wumpus-discord.mp4",
    format: 2,
    height: 640,
    width: 640,
}
FrecencyUserSettings.updateAsync("favoriteGifs", state => {
    state.gifs[data.url] = {
        ...data,
        order: Math.max(...Object.values(state.gifs).map(g => g.order)) + 1
    }
}, 0)
```~~

Well this now
```js
const FrecencyUserSettings = window.Vencord?.Webpack.find((mod) => mod?.ProtoClass?.typeName?.endsWith("FrecencyUserSettings")) ?? null;

// getting current gifs
FrecencyUserSettings.getCurrentValue()?.favoriteGifs?.gifs ?? {}

// adding favorites
const data = {
    url: 'https://tenor.com/view/wumpus-discord-repost-if-you-repost-gif-20674712',
    src: 'https://media.tenor.com/citg5i4shIwAAAPo/wumpus-discord.mp4',
    format: 2,
    height: 640,
    width: 640,
};

FrecencyUserSettings.updateAsync('favoriteGifs', (state) => {
    state.gifs ??= {};
    if (state.gifs[data.url]) return false;

    const orders = Object.values(state.gifs).map((gif) => gif.order ?? 0);
    const nextOrder = (orders.length ? Math.max(...orders) : 0) + 1;

    state.gifs[data.url] = {
        ...data,
        order: nextOrder,
    };

    return true;
}, 0);
torpid jolt
humble tulip
#

It might be in the overflow menu in the dev tools tabs

torpid jolt
torpid jolt
#

I am not sure if this is what I should look for
const content = children.find(c => c?.props?.className?.includes('content_d80634'));
?

vast karma
#

What are you doing dom manip for

hoary pilot
#

you can use the <> button in react devtools to open the module where this is rendered

#

and try patching it

flint bronze
#

i just found something horrible

humble tulip
#

Mirror?

flint bronze
#

i have been struck by Wayland security disease

#

You love windows returning that they are at 0,0 coordinates

#

I just want to make a dynamic custom window rounding thing (don't ask why)

flint bronze
#

ok theres nothing interesting

#

discord desktop is still deranged

flint bronze
#

this is openasar

stone wedge
#

no

flint bronze
#

yes

#

oh

#

this is an old version of the same thing

#

is it?

stone wedge
#

this is just datamining

#

mirror of windows modules and host

flint bronze
#

OH

#

i totally missed this

#

i never looked at the modules

#

sorry for assuming this was the openasar patched version

#

this will help a lot

stone wedge
stone wedge
flint bronze
exotic saddle
#

.

haughty trail
#

just tried them, they no longer work sadly

humble tulip
#

Trying to work on a plugin that puts unread forum posts first but it's such a pain in the ass to work with, I can't figure out how to get it to re-render the list when you click the option atm

#

Other than that it works nicely

#

lol nvm it's literally just a flux event

clear parcel
#

fire

flint bronze
clear parcel
#

huh

flint bronze
#

was I not

hushed loom
flint bronze
#

calling stopPropgation on a onKeyDown event doesn't stop the onKeyPress event

stopImmediatePropagation might, I didn't try

hushed loom
#

guhhhh

clear parcel
#

i have those off

#

i think?

#

didnt get em at least

flint bronze
stiff dragon
#

I need some help

#

Can someone guide me onto making a sticker right click action?

#

like how there's Clone Sticker

#

I want to do that but I don't know how

tropic ice
#

look at how clone sticker does it

stiff dragon
#

but its hella complex

#

and doesn't work

hushed loom
stiff dragon
#

like

#

i dont know what to do because theres 4 different things just to make it show up

hushed loom
stiff dragon
#

get a functioning menu patch without having to do all of this

#

literally ported from EmoteClone because of its complexity

cedar olive
#

that's like super simple tho

#

it could have been way more complex without the API magic

stiff dragon
#

i just want it to show up before adding anything else

#

is there ANY simpler way

dull magnet
#

no

#

the way sticker clone does it is how you do it

#

copy paste the file, change name

dull magnet
stiff dragon
#

time to SKID!!!!! /j

#

yea why didnt i think of doing that lmao

#
    return (
        <Menu.MenuItem
            id="bla"
            key="bla"
            label={"blah blah"}
            action={() => {
                const res = fetchData();
                const data = { t: type, ...res } as Sticker;
                const url = getUrl(data);
                console.log("URL: " + url + "\n" + "Data: " + data);
                Toasts.show({
                    message: "Placeholderr!",
                    type: Toasts.Type.SUCCESS,
                    id: Toasts.genId()
                });
            }
            }
        />
    );
}```
stiff dragon
cedar olive
#

huh?

#

is your file .tsx

humble tulip
#

Are you talking about the Data: [object Object]? If so it's just because of the "Data: " + data
Either replace the + with a , or stringify data

#

Oh I see the undefined in the url as well

cedar olive
#

fetchData is a promise...

hushed loom
#

oh its being spread

#

im stupid

cedar olive
#
const res = fetchData();
const data = { t: type, ...res } as Sticker;
#

yeah

stiff dragon
#

it shows up as undefined for some reason

#

even though daa is being passed

hushed loom
#

@stiff dragon add a breakpoint to your plguins code

#

(i have forgotten i can do that too many times)

#

(considering how often i use them in discords code)

raw maple
#

Hello! I was working on my plugin earlier and restarted, and now it doesn't work. I can clone the main repo, build and patch from that fine but when I add in my plugin (in src/userplugins cause I'm testing for now), build, and patch, vencord does not appear to be patched. The discord launches no themes, no other plugins, even though it seems like it is active when ran via terminal
╰─❯ discord [Vencord] Starting up... [Vencord] Loading original Discord app.asar Discord 0.0.81 Starting app.
Tried reinstalling discord (pacman) + Vencord (provided bash script) but same issue.

Is there any ways to get more verbose logs, or am I doing something rlly stupid? Help appreciated :3

oak sundial
#

you fucked up

#

something is wrong in what you added

raw maple
oak sundial
#

Well whats the contents of the plugin you added

dull magnet
#

you need to look at that console

raw maple
#

Okay I got it tysm

raw maple
#

is there anything like addPreEditListener or addPreSendListener, but for directly after the message is sent? i need to access the id of the message sent by the user (which isn't in the MessageObject from addPreSendListener)

cedar olive
#

hmm

#

seems like a xy problem

#

why do you need the message id exactly?

dull magnet
raw maple
#

auto-deleting messages after x time since they were sent - a channel can be flagged by the user to have autodeletion, and then whenever the user sends a message in that channel the message_id + channel is added to a queue of messages to be deleted after x time expires

dull magnet
#

insane

raw maple
#

message_id seemed to me the easiest way to do this, so i dont think it's xy but idk

dull magnet
#

yeah just sub to MESSAGE_CREATE

raw maple
proud parrotBOT
dull magnet
#

example

raw maple
#

wait what is that moyai plugin??

#

gonna have to try this

cedar olive
#

🗿🗿🗿🗿🗿🗿🗿🗿

raw maple
#

🗿

#

im keeping this on

raw maple
#

okay finished the basic plugin

#

is it worth polishing it and making it public?

swift delta
raw maple
raw maple
swift delta
raw maple
#

oop nvm then

iron epoch
#

when did errror boundry require a key prop?
Missing "key" prop for element in iterator eslint(react/jsx-key)

hushed forum
#

Hi, just wondering, is it possible at all to change the user bio? I've tried for a little bit, found out how to change a status, and can't quite figure it out

hushed forum
iron epoch
hushed forum
#

oh :/

kindred perch
bronze dove
hoary pilot
kindred perch
#

How can i use server profiles instead of user profiles in mentions

Parser.parse(`<@${x.id}>`)
proud parrotBOT
hoary pilot
#

channelId being the channel id of the server you’d want the mention to be from

kindred perch
hoary pilot
kindred perch
#

works now, thx

#

How do i submit an unofficial plugin?

humble tulip
green cypress
#

I've got an idea I'm not quite sure how I'd implement correctly. What I want is to "redirect" or perhaps "pool" some messages (which ones are to be decided by code) from multiple channels into the current one, but just client side. I need reactions and interactions to work as if it was the original message in the original channel, and to have them updated in real time. Basically, take messages sent from another channel and show them as if they had been sent in the current channel (excluding things like reply of course).

I could probably fake message events with the same data but with the channel changed to current, but I don't think that approach would have the messages "linked" how I want it.

worthy path
#

How can I add a menu item for the context that doesn't have a navid?

dull magnet
worthy path
dull magnet
#

uhh

#

how do u get that

worthy path
dull magnet
#

thats not a context menu

worthy path
hushed loom
#

vp account server

shrewd tundraBOT
hushed loom
#

vp accountserver

shrewd tundraBOT
hushed loom
#

Guhhhhhhhhhj

tropic ice
#

vp accountpanelserverprofile

shrewd tundraBOT
tropic ice
#

that?

hushed loom
#

Yea

iron epoch
#

which is better for the ExpressionPickerTabsAPI. as I really want to allow customization of the tab name, other ideas are also welcome

||it's also valid if only the component been passed as it will use the plugin name as the tab name (in the work)||

humble tulip
#

I think first but maybe call it title instead of tab

vast karma
#

And the object version is better, since it allows using an array for defining multiple tabs

iron epoch
vast karma
#

Could also do js expressionPicker: { Cookie: CookieClickerTabComponent, }

#

Though using localized strings as keys is a bit iffy

humble tulip
#

If the title could take a React element that could be cool too, you could add icons or badges up there or something

iron epoch
vast karma
#

Object form allows predicates and stuff too, so it's probably better

iron epoch
iron epoch
#

basically the idea is to allow it to grow when required

humble tulip
#

They could also just return null in their component based on whatever they want

vast karma
iron epoch
humble tulip
#

I guess it depends on how it's implemented, by which point it may as well have been a predicate lol

iron epoch
#

too complex?

cedar olive
#

seems fine I think

vast karma
#

I'd just do a for loop rather than forEach but that's a nitpick

iron epoch
#

@cedar olive what's pluginKeysToBind and should I add expressionPickerTabs to the list?

cedar olive
#

yes

#

but no actually

#

expressionpickertabs is different

#

im not sure if types are gonna work well for it

#

for this case yes, for the others no

iron epoch
#

ts complains abt expressionPickerTabs

cedar olive
#

push your changes let me take a look at fixing the types

#

or better yet, do expressionPickerTab and expressionPickerTabs separately

#

the name is kinda misleading if it's a single function

cedar olive
#

hmm

#

okay idk how to type this properly

iron epoch
#

can't it be treated as CommandsAPI and not be added to that list or that list is somewhat important?

flint bronze
vast karma
#

That there's precedent doesn't mean it's not iffy

flint bronze
#

My proposed solution:

Make both APIs array of objects with definitions
Add a render(): MenuItem | MenuGroup or similar to VencordToolbox

hushed loom
flint bronze
#

i know its possible but its so ugly

raven rock
#

genuinely have no idea where to ask this because there is not a js snippet development channel (probably for the best, that's decently niche) LOLLL
how would one make either a css or js snippet to make a very basic custom markdown rule
or something other than a snippet if need be but the simpler the better

i would like to maybe Not make a plugin but i will do it if i have to

clear parcel
#

i think you have to here

raven rock
#

Damn

swift delta
raven rock
#

Funnily enough I actually did but it kinda went over my head

#

particularly the last part of index.tsx with the rule and stuff

green cypress
#

Is there a way to make some kind of linked copy of messages from another channel into the current channel, such that reactions and interactions work seamlessly as if it was the original message shown in its own channel? I want to "pool" messages from multiple specific channels into the current one and be able to interact with them like mentioned.

cedar olive
raven rock
#

not only do I actually not know what's going on here ( I kind of do but like I also don't understand what the wiggly is in the replace )
edit: nvm

#

i also do not know how i'd make this compatible with the normal wigglytext plugin (i'm just forking wigglytext because it's simple enough and basically does exactly what i want in my plugin but i just want to apply different css (dont worry, i'm crediting))

#

because correct me if i'm wrong but wouldn't the two plugins conflict since they're replacing the same part of the same thing

tribal stump
#

Jellyfin and Plex status plugin I made

#

would anyone want

cedar olive
raven rock
#

how would one include an asset, e.g. a ttf file with a plugin and then like use it

iron epoch
raven rock
#

it would help if there were docs cuz i cannot find anything on the normal docs site

oak sundial
#

Well docs for what

#

because 90% of vencord development is poking around discord internals and writing regex

raven rock
#

Fair enough

#

Okay but still lol I'm not sure how to get it to be compatible since they're both replacing the same part of the same function

flint bronze
#

?remindme 1h fix checkbox horror

fathom pivotBOT
#

Alright @flint bronze, in 1 hour: fix checkbox horror

flint bronze
#

i already fixed it

fathom pivotBOT
#

@flint bronze, <t:1738130902:R>: fix checkbox horror

grand haven
#

mainly things i'm struggling with, aka global keybinds via chrome extensions [while adding said keybinds via extensions side is easy, how to make them execute the respective discord events discord normally has?, would also be nice to override the "hey no keybinds here, go desktop" UI], and unlocking screenshare resolution which is somehow somewhere forced to 720p30fps

#

I do not know how to make discord overlay tho, while you can do it easily via PiP and a fake video element with shit generated via canvases, and even if the video is transparent, PiP itself doesn't support transparency, so i think discord overlay idea is out the window

#

it's also untested on macos, since i'd rather kill myself than own an apple device, so it would be nice if some1 could check if the macos part works fine, but i dont see why it wouldnt

flint bronze
#

it doesnt even try to fake it

flint bronze
#

just patch the overlay client to use some other form of rpc trolley

grand haven
#

it's totally possible with the extension popup, but once again, you cant have transparency for that

grand haven
#

not vesktop

flint bronze
#

i know

#

is the stock overlay entirely useless?

grand haven
#

what?

#

there's no stock overlay on web

flint bronze
#

hang on

#

you're looking into overlay stuff for go live streams

grand haven
#

no

#

i mean overlay overlay

#

the thing that injects into games

#

and displays status icons on the top of the screen

flint bronze
#

yeah..?

grand haven
#

then proceeds to get you anti-cheat banned

#

that overlay

#

this shit

#

anyways, it was just an idea

flint bronze
#

holy half decade old UI

grand haven
#

i'm more intetested in unlocking screenshare

flint bronze
#

i think i've told you this in the past but

screenshare UI (and also now keybinds) should probably implemented in a way where web and vesktop can both use it somehow

grand haven
#

that isnt possible

#

you know that

#

so instead of wrapping it around in "whatever", just say no, because it is NOT possible to do that

#

vesktop calls native, with previews, ids etc, web doesnt have that, and never will, so already there it's not possible

#

all you could do is a simple "resolution and fps" picker before calling the screenshare

#

which is already different from vesktop, which lets u pick windows, shows previews etc

flint bronze
grand haven
#

so at this point, it's already not possible

grand haven
#

the 2 implementations are just way too different

flint bronze
flint bronze
#

actually now that we've discussed it

grand haven
#

also this is a plugin, which you enable, vesktop code runs on startuop

#

its also separate repos

#

so importing it across repos and enviorments will be pure cancer

#

it also means we'd need to introduce a new build ttarget to target: "discordDesktop" | "vencordDesktop" | "desktop" | "web" | "dev" aka | extension

#

because from what i understand web runs on vesktop too

flint bronze
#

the actual logic makes sense to keep entirely separate
i would ideally say UI should use shared code but if one side wants to add a new feature thats horror
keep doing it as its own thing and if you make a better UI then I would encourage porting it to Vesktop

grand haven
#

i've thought about it, and nah its just a no-go

#

also idk how to navigate or patch discord's code

#

ever since goosemod died so did my will to navigate discord's code

#

its ass

#

i spent like 2h trying to figure out how to unresctrict the res and fps

#

and gave up\

flint bronze
grand haven
#

okay sure, but at that point, whats the point of build targets?

flint bronze
#

it wouldnt even be at runtime

grand haven
#

like at that point 80% of the code should just be built into the extension by default, like notifications and the screenshare fixes

flint bronze
#

vencord build process does tree shaking

grand haven
#

so it'd get built in anyways

#

from what i understand

#

and if i want to add extension only global keybinds, we'd still need an extension build target, to make sure vesktop people dont enable it

flint bronze
flint bronze
grand haven
grand haven
flint bronze
#

OHHHH

#

i get what you mean now

#

i totally forgot for a moment you can do this

grand haven
#

yeah, which is why i'm saying "web should be extension"

#

and not vesktop

flint bronze
#

my brain was thinking it would be faked the entire time

grand haven
#

vesktop has its own build target

#

but extension doesnt

#

SUX

flint bronze
#

actually extension build target should exist IMO

#

you know how there are plugin natives

grand haven
flint bronze
#

vencord could really do with extension natives

grand haven
#

and web is imported on vesktop

#

see: screenshareFixes

#

and getPluginTarget doesnt support multiple targets

#

which means simply we'd need an "extension only" ver

#

or "chromium"

#

since that's twhat its called in the build process

#

but i feel like thats out of scope for this PR

#

and there's 0 reason to add this to firefox

#

because SURPRISE firefox supports none of this

flint bronze
#

shiddohwell vencord extension isnt even officially distributed for firefox due to some insane issue

grand haven
#

yeah firefox extension submissions are unhinged

#

i'm surprised ven even considered publishing there

#

anyways, i dont know whats your level on the "I make big changes to vencord" ladder, so idk if you're the person to talk to about this

#

if you know who is, bring it up to them

#

idk

flint bronze
grand haven
#

wish i knew what that means no i dont

flint bronze
#

i will tell you what it means

#

I make a lot of plugins for my own use
Sometimes I contribute them upstream

#

If you want a serious answer about core Vencord APIs, ask @cedar olive or Vee
If you're looking for someone who does fixes and works on making a sane developer experience (unofficially), talk to @hushed loom

flint bronze
#

A lot of plugins use a native script to bypass CORS

grand haven
inner monolith
#

well this is fun

grand haven
#

hm, at least something works

grand haven
#

any idea how i can obtain this? Vencord.Webpack.findByProps('TOGGLE_GO_LIVE_STREAMING') doesnt do the right thing

#

it yields a diff module

tight canyon
#

Is there any api/const in vencord that allows to get this classes directly or should i use my own find?

dull magnet
#

just findByProps

tight canyon
dull magnet
#

findByProps

iron epoch
grand haven
#

which is insane to me

tight canyon
#

yeah, i already figured it out, was easier than i thought, thanks

grand haven
#

and i have tried everything

#

at wits end

iron epoch
#

they probably don't

dull magnet
cedar olive
#

first of what you are trying to find is not even exported

dull magnet
#

then run wreq(thatId) to import the module and check the exports

grand haven
cedar olive
cedar olive
#

however you can abuse the fact it is dispatching that object

dull magnet
cedar olive
#

add a flux listener in your plugin, listen for KEYBINDS_REGISTER_GLOBAL_KEYBIND_ACTIONS and then obtain A from keybinds

dull magnet
#

most useful store

grand haven
cedar olive
#

register listener

#

use the flux key in the plugin definition

humble tulip
#

How awful is it to patch something that's not exported and wrap it in your own function to take a reference to it?

grand haven
#

let me tell ya

#

pretty fucking bad

#

this is hell for me

cedar olive
#

if it's a variable with a small assignment, easy

#

if it's a function, you gotta match all the way after it's definition

humble tulip
cedar olive
grand haven
#

nah

#

i got it

#

that part is documented

#

has typing

#

discovering that is piss

humble tulip
grand haven
#

i just have too many winddows open at this point and i'm struggling navigating to reload everything XD

cedar olive
#

function x(){} are the hardest to export

#

with variable definitions you can do like let a = $self.theObject = ...

#

iirc

dull magnet
#

we did that a bunch in the past since some things weren't exported

grand haven
#

IT WORKS

#

HOLY

#

finally global keybinds

humble tulip
cedar olive
#

oh

#

not really horror

#

but it can be difficult sometimes

#

vee said pretty easy, but it really depends on what it is

dull magnet
cedar olive
#

oh wait they are hoisted... right

grand haven
#

some shit is rly hard to find with mangled code, especially their screenshare restrictions, i still have not found them :/

cedar olive
#

I think I never thought of that

#

not sure

humble tulip
#

I had a patch that just wrapped something in $self.yoink() for SortForumsByUnread but I realised I didn't need it in the end so it's gone anyway

#

But good to know it's valid

cedar olive
#

oh yeah I did this like 2 days ago

proud parrotBOT
# cedar olive https://github.com/Vendicated/Vencord/blob/discord-fixes/src/plugins/_core/disco...

index.tsx: Lines 98-109

    // Fix member supplemental caching code and export cache object to use within the plugin code,
    // there is no other way around it besides patching again
    {
        find: ".MEMBER_SAFETY_SUPPLEMENTAL(",
        replacement: [
            {
                match: /(let (\i)={};)(function \i\(\i,\i\){return \i\+)(\i})/,
                replace: (_, rest1, cache, rest2, rest3) => `${rest1}$self.setMemberSupplementalCache(${cache});${rest2}"-"+${rest3}`
            }
        ]
    }
],
cedar olive
#

their cache is so broken I had to manually set as unfetched before attempting to fetch

humble tulip
#

Nice

cedar olive
#

and makes some other things easier to use

#

making it a dependency would be so shit honestly

#

it does these for example

proud parrotBOT
# cedar olive https://github.com/Vendicated/Vencord/blob/discord-fixes/src/plugins/_core/disco...

index.tsx: Lines 56-81

// Make username wrapper a div instead of a span, to align items to center easier with flex
{
    find: '"Message Username"',
    replacement: {
        match: /"span"(?=,{id:)/,
        replace: "$self.UsernameWrapper"
    }
},
// Make MediaModal use the Discord media component instead of a simple "img" component,
// if any of height or width exists and is not 0. Default behavior is to only use the component if both exist.
{
    find: "SCALE_DOWN:",
    replacement: {
        match: /!\(null==(\i)\|\|0===\i\|\|null==(\i)\|\|0===\i\)/,
        replace: (_, width, height) => `!((null==${width}||0===${width})&&(null==${height}||0===${height}))`
    }
},
// Make buttons show up for your own activities
{
    find: ".party?(0",
    all: true,
    replacement: {
        match: /\i\.id===\i\.id\?null:/,
        replace: ""
    }
},
grand haven
#

welp this actually works now, actual peak

#

problem is gotta get rid of this somehow

#

i assume there's no a11y in ven?

iron epoch
grand haven
#

just english?

dull magnet
#

like hide it?

grand haven
#

probably

#

or override it

#

with "go to chrome extension shortcuts for keybinds"

#

oh also, we need an "extension only" build target

cedar olive
#

okay that's actually huge

grand haven
#

its so fucking simple

#

you have no idea

#

and u can port it in like 10 seconds to vesktop if u care

#

since electron just lets u load extension code

#

configuring it via ui from vesktop will SUCK tho

grand haven
grand haven
#

or should it be another plugin

grand haven
#

daum

#

that sux

#

i get it doe

#

unfortunately out of time this day/week/month to finish this

inner monolith
#

If i wanted to proxy a prop, how would i go about doing that? I'm running into all kinda of recursion issues and maxing out the call stack

#

I have this setup but this just hits the call stack size limit

const moduleObj = findByPropsLazy(prop);
const originalProp = moduleObj[prop];

const safeContext = {
    ...moduleObj,
    [prop]: originalProp
};

moduleObj[prop] = new Proxy(originalProp, {
    apply(target, thisArg, argumentsList) {
        console.log(prop, argumentsList);
        return Reflect.apply(target, safeContext, argumentsList);
    }
});
#

i tried this before:

const originalProp = findByPropsLazy(prop)[prop];
findByPropsLazy(prop)[prop] = new Proxy(originalProp, {
    apply(target, thisArg, argumentsList) {
        console.log(prop, argumentsList);
        return Reflect.apply(target, thisArg, argumentsList);
    }
});

same issue.

#

yippie

humble tulip
#

I didn't even know you could assign to findByProps ngl

cedar olive
#

proxy a find? why tho

#

you cant lol

humble tulip
#

Are you sure?

cedar olive
#

I mean that's an object

#

you are not really assigning to findByProps, you are assigning to the object it returns

humble tulip
#

Yeah that's what I meant I didn't know you could do

#

Bad wording

#

I assumed it just returned a copy

cedar olive
#

that would be very bad

humble tulip
#

That's why you wrote it and not me thumb

inner monolith
cedar olive
#

seems like you are basically trying to do monkey patching

#

patch it instead of doing monkey patching

inner monolith
#

monkey patching

#

🐒

soft blaze
#

does anyone know the patch for intercepting the message fetch request before it actually does it?

#

also how do i create a dm channel

soft blaze
#

where can i find all the pre send listener types?

soft blaze
#

and i'm trying to intercept the client fetching messages

#

i dont see a presendlistener for that

vast karma
#

What did they fuck up now that I need to fix in my userplugins?

cedar olive
#

do you use Icons.*?

#

or anything from the huge non mangled module?

kindred perch
vast karma
#

I do use a couple of things from the components module, yeah

cedar olive
#

cuz that's all mangled now you need to find without relying on the keys

vast karma
#

So find all the things from the modules they're originally from rather than those reexports?

cedar olive
#

yepp

#

exactly

cedar olive
#

and just stop relying on non mangled keys at a whole

vast karma
#

Yeah

soft blaze
vast karma
#

Convenient while it worked, but too volatile

kindred perch
soft blaze
#

that's how i concluded that CHANNEL_CREATE is the right event

#

but i wasnt sure what the error meant

#

e.isPrivate is not a function

kindred perch
#

including e.isPrivate

vast karma
#

Is there any way to find patches that haven't found any matching module? Like reporter but local

soft blaze
#

thanks

humble tulip
#

Might not be the right arg, I can't double check atm

#

nvm you build with the arg not run

vast karma
#

It's kinda weird that the module ids are still stable despite all this

hushed loom
#

how is my code this bad 😭

humble tulip
#

I was messing with those recently too, sucks ass

#

Working on making a search bar for the member list

inner monolith
hushed loom
inner monolith
#

it's probably somewhat possible surely... no?

#

like partial member list search

#

very scuffed

vast karma
#

That list is lazy loaded, which makes it pretty hard to deal with

cedar olive
#

the member list is all lazy loaded

#

yep

humble tulip
#

Yeah that's why it was a pain

vast karma
#

I once tried to make a plugin to strip away those silly ! prefixes and stuff before sorting it

#

Didn't work

humble tulip
#

It gets 25k rows deeper down but it was a bit of a mess to filter and I think it would've caused issues if I tested more

#

But I changed approaches and the new approach didn't work out so I'll be going back to that

#

But yeah I think it's gonna be next to impossible, we'll see

vast karma
#

Did discord change so forwarding to the same channel is allowed now? Because my patch for that fails, but it works anyway

humble tulip
#

It's always been allowed, it just didn't show up in the picker until you typed the name

#

Or was very far down

vast karma
#

It was explicitly filtered out from the picker at some point

hushed loom
#

im trying to make a plugin that modifies the member list, and its such a pain in the ass i might make it an api

vast karma
#

Doesn't look like it's changed compared to the old tab I have, at least

#

Eh, if that plugin isn't needed, I'm not complaining

hushed loom
#

this took me wayyyyy too long

#

i can now remove entries and sections from the member list without having it go crazy

swift delta
kindred perch
#

how can i store data over restarts without settings.store?

kindred perch
hushed loom
#

or look at references

cedar olive
#

what data do you want to use

#

most times you do not want datastore over settings

kindred perch
cedar olive
#

more control?

#

so you want to store an arbitrary value in settings

#

like an object with your own props

#

and then make your own ui for it?

kindred perch
#

like place buttons better, more compact, not 1 line per setting

cedar olive
#

you can have settings with hide: true

#

or use OptionType.CUSTOM and store your own object with your settings

kindred perch
#

that should work, thx

cedar olive
#

lets you store anything in that setting

#

without an UI

humble tulip
#

Needs polish but it's okay

hushed loom
humble tulip
#

The lazy loading makes it a mess

hushed loom
#

hmmmm

#

i feel like it would look a lot better tho

humble tulip
#

I could probably fake it and just hide the actual member list while the search results are showing there instead

hushed loom
#

if thats what you need

humble tulip
#

I'll mess around with it more tomorrow, it's 4am and I have work in the morning suffoPeepoSleep

hushed loom
#

alr

hushed loom
humble tulip
#

Oh yeah, baby's first one line pr

#

No longer a whitename

kindred perch
#

Where can i find checkboxes?

flint bronze
kindred perch
flint bronze
#

what's weird is that barely anything uses a checkbox, instead opting for a Switch

#

the Switch component used to be imported into @webpack/common for use in Vencord from the same module that had Checkbox
until a few days ago trolley

#

@cedar olive where is my token lagger

#

what did you do

#

gone :(

flint bronze
kindred perch
humble tulip
#

What's the crash?

#

Also checked={} should be value={}

kindred perch
humble tulip
#

This is how I typed it

export type Checkbox = ComponentType<PropsWithChildren<{
    value: boolean;
    onChange(value: boolean): void;

    align?: string;
    disabled?: boolean;
    displayOnly?: boolean;
    readOnly?: boolean;
    reverse?: boolean;
    shape?: string;
    size?: number;
    type?: string;
}>> & {
    Aligns: Record<"CENTER" | "TOP", string>;
    Shapes: Record<"BOX" | "ROUND" | "SMALL_BOX", string>;
    Types: Record<"DEFAULT" | "INVERTED" | "GHOST" | "ROW", string>;
};```
kindred perch
humble tulip
#

I looked in the design systems tab in settings

#

I think anyway, it's been a while lol

kindred perch
humble tulip
#

I think you need to enable the experiments plugin

#

Give you the dev settings tabs too

grand haven
#

does vencord have color utilities?

#

specifically for example read the value of var(--background-tertiary);

#

or do we need to do that manually via JS

kindred perch
grand haven
#

so discord sets --background-tertiary via JS most likely

grand haven
#

are the values it assignes availabe as utilities?

humble tulip
#

You'd have to do it manually I think, I did it in the past by just applying the css to an element and then taking the computed styles from it

grand haven
#

yeah okay, expected that

#

thanks for verifying

grand haven
#

cuz good luck trying to convert

color-mix(
    in oklab,
    hsl(222.85714285714283 6.666666666666663% calc(20.588235294117645% - 8.04%) / 1) 100%,
    black 0%
  )
#

into hex

#

XD

#

with getComputedStyle you can normalize it down to oklab(0.239616 -0.00015831 -0.00607598)

#

but that's still hell of math to do

kindred perch
grand haven
#

WAIT THEY CHANGED IT

#

web manifest now accepts non-hex values

#

nvm dont worky

#

so its still a dumbed down version of color

grand haven
#

man, patching components is impossible

#

well

#

at least this specific one

#

its as generic as it gets

#

its a generic notice element, which is parented in a generic title element which is parented in a generic root layout

bronze dove
grand haven
#

nah modify it

#

i think i'm, onto something tho

#

managed to find this, just gotta learn how the hell to override its children with my own thing

bronze dove
#

make a patch

grand haven
#

yah ik

#

i'm learnding

#

trying to find some existing examples in vencords plugins

#

struglging bad doe

#

XD

humble tulip
#

Look further up where that ternary is and force it to true

bronze dove
grand haven
#

"override children" part

#

with my own react component/text

bronze dove
#

match the children and replace with yours

grand haven
#

isnt that a very... violatile method?

humble tulip
bronze dove
#

no

#

like 70% of vencord plugins does that

grand haven
#

wouldnt matching browserNotice and then replacing children in match be better?

bronze dove
#

yeah thats what i meant

grand haven
#

yeah thats the part of "fuckin how"

bronze dove
#

regex

grand haven
#

but i think the badges plugin has a good example

grand haven
#

like when u have find.... does it find the module, place in code?

bronze dove
#

its just regex, there isnt much more to it

bronze dove
grand haven
#

is the patches[].find the same as findByCode?

humble tulip
#

It finds the whole module and then you use the match/replace on the module's code

bronze dove
#

find is module.toString().match

grand haven
#

ah so there's no runtime equiv for patches.find

#

also what is fullpatch in patchhelper?

humble tulip
#

You can use wp.search() in console if you have console shortcuts on

humble tulip
grand haven
#

huh

#

how does that help

bronze dove
#

faster

humble tulip
#

Just a quick way to fill it in if you have an existing patch you need to change

grand haven
humble tulip
#

Yep

#

tsx though

grand haven
#

it replaces the entire match case? or just the match group?

#

cuz idk if im readting this wrong

#

but it seems like it nuked the className too

humble tulip
#

The entire match, it's just a regular regex replace

#

So you can use groups and $1, $2 etc

grand haven
#

ah makes more sense

bronze dove
humble tulip
#

You're definitely getting the hang of it

grand haven
#

yeah its not bad, just fucking cancer, and slow

humble tulip
#

Cancer, famously not bad lol

humble tulip
grand haven
#

man... the fact that this is what i'm doing with my day off

#

i doubt this plugin will even be accepted

#

this is way more effort than it was worth

#

but whatever

#

this can definitely be extended to mod the discord UI, to simply re-enable the desktop keybinds UI, then manage the keybinds via extension in discord's UI

#

but that seems insanely hard and way above me

#

nvm extensions dont have that permission

flint bronze
#

this is a good idea

kindred perch
#

What shortcuts should i add to my plugin?

humble tulip
#

What's the plugin?

#

Just general additional keybinds?

kindred perch
grand haven
# flint bronze this is a good idea

unfortunately its not possible, chrome extensions cant edit their own keybinds, nor create new ones, this has to be pre-defined in the manifest

#

sux

flint bronze
#

@grand haven did you know discord used to have an extension for screensharing

grand haven
#

i know, i made multiple for many previous mods

#

last and best one i made was for goosemod

flint bronze
humble tulip
#

It requires native so it'll only work in the app but I have ctrl+shift+R as a hard reload, could be useful in a keybinds plugin

kindred perch
# kindred perch yh

with a good framework which allows easy addition of new plugins and changing keybinds

flint bronze
#

that sucks

humble tulip
#

I guess you could technically make it open a new tab or something in web, I dunno how that works lol

grand haven
#

minor problem is that you cant have "PUSH TO X"

grand haven
#

because the shortcuts are only "on key down"

flint bronze
grand haven
#

so no hold, repeat etc event

#

i usually do it by simply having a debounce

#

and holding a key sends the event like 20 times per second

iron epoch
grand haven
#

but not here unfrotunately

flint bronze
#

😭

grand haven
#

this is still way better than what we had b4 tho

flint bronze
#

definitely

grand haven
#

yeah i'm not doing the screenshare fixes tho

#

thats not for my pay grade

humble tulip
#

So I have this, and then it's used in the main plugin file like

const { fullRestart } = VencordNative.pluginHelpers.QualityOfLife as PluginNative<typeof import("./native")>;

const ctrlShiftRListener = e => {
    if (e.ctrlKey && e.shiftKey && e.key === "R") {
        fullRestart();
    }
};```
#

It actually just needs app.relaunch(), I forgot to remove the path for my own thing for the screenshot

grand haven
#

oh no, quickcss brokey in browser

bronze dove
humble tulip
#

Oh yeah, I forgot about that

kindred perch
#

@grand haven what are you working on?

grand haven
#

discord as PWA via vencord

#

aka fixing all the bullshit discord for some reason doesnt implement

#

that would take them 5 seconds to

#

aka notifications on web, installability, platform native title bar, fixing auto-dark extensions

#

@humble tulip need ya help

#

can ya ping me on demand?

humble tulip
#

Sure

grand haven
#

okay give me 1 minute

#

do it

humble tulip
#

@grand haven

grand haven
#

thanks

#

i think i covered everything

#

hm

#

gotta cut out 1 frame

#

part of phone number is visible

#

also the fact that the screen recorder i wrote works

#

is insane to me XD

#

"works" its fucking GREEN AS FUCK

#

can't cut it

#

D:

#

should i submit a plugin via #📩-modmail or just... leave it here?

kindred perch
humble tulip
#

Yeah either PR it if you want it to be an official plugin or submit to modmail for #1256395889354997771

#

It'll disappear here quickly

kindred perch
humble tulip
#

Yeah a few of the plugins in there have PRs waiting as well

kindred perch
#

well then do both, cuz theres a pretty long wait for official plugins @grand haven

humble tulip
#

You'd need separate repos though as #1256395889354997771 just wants the plugin folder as the root whereas a PR would obviously need the whole vencord branch

kindred perch
tight canyon
tight canyon
#

Ah, yes

#

Like

#

So you can just

cd src/userplugins
git clone plugin.git

kindred perch
#

go in github vencord repo, and upload your files there, and name them src/plugins/pluginfolder

grand haven
#

yah ik dw

#

i meant more "bring attention to it"

#

ive been doing open source for years, i know the gist of it

kindred perch
tight canyon
kindred perch
iron epoch
#

if you want to post a plugin

humble tulip
#

I think they mean to pr an official one

#

You need to fork anyway so you can add yourself to devs

tight canyon
grand haven
#

got yelled at

tight canyon
#

Why

oak sundial
#

i didn't yell at you

grand haven
#

i know

#

more "scolded"

#

didnt kno

humble tulip
#

I haven't submitted a user plugin myself, mb

tight canyon
#

Like??

oak sundial
#

you just opened a ticket for plugin-submission (which is for #1256395889354997771) when your plugin cannot be cleanly cloned into the userplugins directory

dull magnet
#

since it touches vencord files

#

people would have to apply a patch which then would cause conflicts for them and stuff

tight canyon
grand haven
#

yeah im aware, it just said "plugin submission" so i wasnt sure if it meant official or unofficial

dull magnet
#

just pr is all

tight canyon
#

And wait for one eternity

grand haven
#

and it wouldnt be unnatural for people to have a review process outside of github

#

i've seen it happen MANY MANY times

kindred perch
tight canyon
humble tulip
#

Maybe my sorting forums by unread thing should've just been part of overrideforumdefaults, I didn't really think about it tbh

kindred perch
#

How can i cause an event listener to rerender a component?

kindred perch
flint bronze
#

who responded to the modmail ticket

kindred perch
flint bronze
#

okay; so partial bias

tight canyon
#

It's a react hook which returns a function

humble tulip
#

useForceUpdater

tight canyon
tight canyon
grand haven
# humble tulip Sick

yeah if this gets merged [i have a feeling half of it will be split into separate plugins tbf], i'll maybe fix screenshare on web

#

and then this will be actually competetive with vesktop XD

flint bronze
# kindred perch ven and nin0

honestly after looking at it; i think you should ask about it further, and ask if a disclaimer that it's similar is fine
i can't promise anything though

flint bronze
#

just say it's similar to another plugin

kindred perch
#

like tell them that it could be risky?

flint bronze
kindred perch
flint bronze
#

not in the plugin itself

#

ask if you can submit it and say in the submission it is similar to the other plugin

#

again; i can't promise anything

kindred perch
#

ok, ill do it when i have time

grand haven
#

when chrome was first introducing PWA's

#

and its general schtick was that you can make PWAs that can replace desktop apps

#

and noone would even notice

#

and the experiment officially succeded

#

for example, the video you watched was made with one such PWA

#

dont use the manga reader unless u want to brick ur browser tho

#

i never finished it and the image calc and manipulation it does is awful

#

and torrent client was made in react

#

that is to say, it doesnt work

#

because i never bothered fucking with react ever again

dull magnet
#

wtf that screen recorder 😭

grand haven
#

everything you'd ever need from a screen reocrder

grand haven
#

it legit just navigator mediadevices capture

#

unchanged

#

then i just raw-dog pipe that data into a file, then on end i modify the file metadata header to change duration

dull magnet
#

it's just gnome video player skill issue i think

grand haven
#

duration fix works like 70% of the time

#

EBML is hard

dull magnet
#

plays fine in vlc / mpv

grand haven
#

the video is a stream

#

not a video

dull magnet
grand haven
#

streams dont have shit like duration etc

#

and a lot of video players dont like that

#

i do append some duration information

#

but a lot of video players just dont care

#

mpv, vlc, mphc works fine

#

web also plays the video file

#

ffmpeg will cry that duration is infinity, but will process the video file

#

the video player i made is unironically somewhat usable

#

and the image viewer is fucking S tier

#

i've been using it as my default image viewer for years XD

dull magnet
#

youre insane

grand haven
#

because PWAs can register as file handlers in your OS, so when u click an image it will open the PWA

grand haven
#

XD

#

it unironically isnt hard to do, the image viewer is like 90 lines of code iirc

dull magnet
#

add thumbnails

grand haven
#

permissions

#

click on any of those and you'll see why

dull magnet
#

and how do you get back from here to the main menu

dull magnet
#

what was supposed to happen

grand haven
#

ask for permissiion "hey can i open this file?"

dull magnet
#

not for me

grand haven
#

1:1 same ui as "can i have access to microphone" on websites

dull magnet
#

well after restarting browser it does

grand haven
#

i think chrome removed that then

#

yeah

dull magnet
#

"Allow on every visit"

#

then u can add thumbnails

grand haven
#

i cant prompt "allow on every visit" only

#

so i cant have certainty that i will have access to the file

dull magnet
#

can u not check whether u have access

#

without prompting

grand haven
#

and asking for permission requires a trusted event, aka user input like click

#

no

#

this is HEAVILY sandboxed

#

so its stupidly safe by definition too

grand haven
#

it reloads instantly anyways because its cached via service worker

#

so works offline

#

x)

#

you can also just drag another image

#

and a menu to cycle between them will show up

#

i wrote this code like 3 or 4 years ago, i wasnt as good at making apps as i am now

dull magnet
#

youre a bit insane

grand haven
#

why?

#

this is unironically really fucking cool

dull magnet
#

PWA obsession like this cant be healthy...

#

most people dont even know what a PWA is

#

its okay im insane too

grand haven
#

image viewer is 300 loc together with the css and html markup

#

most of it is fucking positioning math for dragging etc

grand haven
#

if you think the image player is unhealthy, you'd shit yourself at the video player

#

the image viewer is the simplest thing

#

video player is 10's of thousands of lines of code

grand haven
#

or 5...?

#

i think 4 tho