#🧩-plugin-development

1 messages · Page 65 of 1

flint bronze
woeful plover
#

oh

#

Im stupid

flint bronze
#

remove the `

woeful plover
#

okay

flint bronze
#

and make sure your file is .tsx

woeful plover
#

I see thank you ❤️

flint bronze
#

also you can get rid of the &si parameter in the URL

woeful plover
#

it worked

woeful plover
#

yea it was just avideo

#

just discord doesnt like OBS its dumb default format

flint bronze
#

😭 this is even worse

#

why would you upload to youtube and mark as private

modest spire
#

Hey there all!
I'm poking around the existing "Friends Since" plugin, and I'm curious how the patches were made.
In particular, an existing patch is using find to look for .PANEL}),nicknameIcons I'm guessing this is searching for a particular area in the UI, where can I see this code so I can find my own arguments to pass?

dull magnet
#

devtools

#

it's discord code

#

ctrl shift f

modest spire
#

Thought it was, thanks. I'll poke around and see what I end up breaking 😅

ruby turtle
#

REALLYMAD discord-types stop being out of date

hushed loom
#

im trying to write a patch for a module with this find .SETTINGS_NOTICE_MESSAGE

patch helper gives (0,n.jsx) after the match, but when i go into devtools i cant find that anywhere in the module.
am i going crazy?

ruby turtle
#

i.e look for (0,s.jsx)

hushed loom
#

both should be n or s

#

not mixed

ruby turtle
#

no idea. I can't even find u.Z.Messages.SETTINGS_NOTICE_MESSAGE

ruby turtle
#

yeah that's why I crossed it out

hushed loom
#

is it possible to add a context menu to something that doesnt have one

vast karma
#

Course it is

hushed loom
#

is there an example somewhere

vast karma
#

There's hundreds of examples in discord's codebase

hushed loom
#

guh i will figure out on my own

#

ty tho

viral roost
#

its a prop react allows you to pass on any html element

#

look at how like any vencord plugin does it

lean vapor
#

What would be the best starting project to learn a bit about how to make a vencord plugin?

hushed loom
#

if you just want to learn, also sort by rejected for low quality/niche

lean vapor
#

Ah

lean vapor
hushed loom
lean vapor
#

My problem is I don’t know how to code a plugin yet, apart from the barebones from the dev starting guide.

hushed loom
lean vapor
#

Yes

hushed loom
#

do you know what patches are

lean vapor
#

Yes

hushed loom
#

i think you just need to start and try to make a plugin

#

you will fail, but with some time, you'll get the hang of it

lean vapor
#

I have no idea how to start though apart from that guide. Like how do I get the base down and allat, this is way different from my normal Node.js.

vast karma
#

First and hardest step is deciding what plugin to make

vast karma
#

Because 70% of them are duplicates and remaining 29% are bad

hushed loom
#

there are a good few

#

@lean vapor while it isnt that useful, this one seems like an easy place to start

lean vapor
#

Yeah saw it too, but again, no idea where I’d start after I would’ve gotten everything inside of the dev guide.

hushed loom
#

have you ever used react devtools

lean vapor
#

Not yet no.

hushed loom
#

use react devtools to inspect the component you want to patch

lean vapor
#

I know some stuff about inspect element but uh, that’s not going to get me far.

lean vapor
#

And then add CSS/HTML code to it and then put that in my code I assumev

hushed loom
lean vapor
#

Well

#

I got time rn actually but might need to head out in a second

#

Nevermind

lean vapor
hushed loom
#

sure, but i dont think that would help you at all

#

there are a lot of other plugins that you could do that to

#

try and find plugins that are just one patch

#

and look at those

lean vapor
#

like slot

#

A lot

#

Probably everything

amber basin
#

WHAT THE FUCK IS THAT

#

WHY IS IT STORING DATA IN THE PRESENCESTORE

#

WHY IS IT RUNNING JSON.stringify ON DOM ELEMENTS

empty sundial
#

how bored are you for you to check forks for unreleased stuff

#

😭

amber basin
#

doing unity work and have to keep myself busy somehow while its building

vast karma
empty sundial
#

solution: switch to GODOT

amber basin
#

oh i didnt see .value

#

whoops

#

i thought it was running addUserToList(inputElement);

remote kestrel
#

I had an idea

#

unless there's already someway to view replies to a message it could be a new plugin

#

@hushed loom

hushed loom
remote kestrel
#

yes

vast karma
#

And how would you find them? Spam the api to load every single channel in the thread to find if it's a reply?

remote kestrel
#

can you reply to a message across channels

hushed loom
#

no

#

thats fowarding

#

i think you could only do that with very recent messages

#

but if ping was on on reply

dim isle
hushed loom
#

then you could do within maybe the past day or 2

dim isle
#

tbh apart from spamming the api (which is a no-no for a plugin), what else can you do

hushed loom
#

and then filter from there

dim isle
#

even then, search returns 25 messages at a time

#

and it may not mention

dim isle
#

bad idea imo

hushed loom
#

thats why i said very recent

dim isle
#

👍

hushed loom
#

where do i import stores from

flint bronze
#

findStoreLazy

hushed loom
#

how the fuck did i not find that

flint bronze
hoary pilot
#

is there a way to get one specific message, considering i have its channel ID and message ID? MessageStore.getMessage() returns undefined for some reason, even when the message does exist

empty sundial
vast karma
#

Check what MessageLinkEmbed does

balmy sky
#

I made a plugin to replace the stock ui texts, probably not useful in any case but cool

#

Settings could also use some work but too lazy to make a textreplace type thing

#

Only sorta use would be very heavy theming to a certain vibe?

dim isle
#

i can't see a use case for this

#

and it's hard to setup, you need to dig through strings in inspect element to get the id of what you want to change

bronze dove
dim isle
#

ideally there'd be a select menu with every single string key, but is that even possible

balmy sky
dim isle
#

that looks confusing to use

vast karma
#

Does it handle things like formatted strings and plurals?

balmy sky
#

It 100% handles formatted strings

#

Let me get an example

north flame
balmy sky
rocky falcon
#

probably

north flame
#

Wtf?

#

I didn’t send that message

oak sundial
#

dementia

balmy sky
#

Dementia

north flame
#

Somebody please make bulk collection plugin

hushed loom
#

what would that do?

north flame
#

Every action a user does is logged

#

Mouse moved? Logged

hushed loom
#

that makes no sense

north flame
#

Key pressed? Logged

#

Become google

#

Turn beecord into a keylogger

balmy sky
balmy sky
kind pike
#

oh make sure to abuse the fact that discord has camera permissions and screen share permissions and make it ss your screen every few seconds and then take a picture of you every few seconds

north flame
#

If somebody is doing bad things, vee can remove their access

#

And send their discord token in every available channel

kind pike
#

i think that you could also easily get the real time location under a "geostatus" plugin that changes your status based on your country

north flame
#

Yeah

balmy sky
#

Mass scrape vencord user actions and train an ai model to replace whitenames

flint bronze
#

is there any way to simulate certified device events?

vast karma
#

What's that

flint bronze
#

you will be exploded

#

nvm

swift delta
balmy sky
#

I remember vee saying there is a function to identify the dominant colors of an image already in discords code, where can i find that function?

vast karma
#

I think it's used in voice chat tiles for example

#

So check their render function I guess

flint bronze
#

Also for profile backgrounds in general

#

They use it there as a fallback

#

I think?

flint bronze
#

What the fuck did I just cook

flint bronze
#

I'm not cooking

flint bronze
#

special channel conditional adder hook thing: 761091

#

OH

#

wpex so good

#

I should add named webpack extract

#

channel list item renderer: 373274

#

dont mind me dumping notes

#

desktop visual refresh special channei icon entries (guessing based on code): 471995

#

channel renderer: 176299

#

analytics shit for special channel routes: 15379

#

has permission to view route, not confident: 849027

cedar olive
#

you should identify the module with a find instead

flint bronze
#

i am

cedar olive
#

since the number can change

flint bronze
#

i'm taking notes

cedar olive
#

oh nice

flint bronze
#

I dont ACTUALLY intend to hardcode any of this

cedar olive
#

it's actually possible to name all modules

flint bronze
#

these are just modules I intend to inject patches into later so I can pull them up and know what they do

flint bronze
cedar olive
#

the decompiled react native leaks file names

#

and export names too

flint bronze
#

even web stuff?

vast karma
#

On mobile app or what?

cedar olive
#

it's horror to read the code on it though

cedar olive
vast karma
#

That is very interesting indeed

flint bronze
#

ok

#

time to get to injecting my own custom special channel route

cedar olive
#

let me try to show you an example

flint bronze
#

what

#

do you mean example of decompiled react native code

#

am I about to cook

flint bronze
flint bronze
cedar olive
#

yeah

#

but there's the file name for that

hushed loom
cedar olive
#

it's hard to find the matching module though

proud parrotBOT
flint bronze
#

do you just

#

love blindly copy pasting code into regex and not escaping the function call ()

hushed loom
#

It should be a path seperator

flint bronze
#

those are just [GuildStore, UserStore] twice

vast karma
flint bronze
flint bronze
#

i now have a button

#

"button"

#

more like test element

#

Am I cooking

swift delta
flint bronze
balmy sky
#

I'm attempting to make a plugin that adds preview support for a new file type, does anyone know where the stock file previewing code is? (for videos, images, etc). Would it be worth patching that system? or just hook into the attachment component and make my own

hushed loom
#

is it possble to intercept flux events?

flint bronze
#

Yes

hushed loom
#

is there any example in vencord code

flint bronze
#

No, but there is literally a method called FluxDispatcher.addInterceptor

hushed loom
#

oh 😭 how did i miss that

cedar olive
#

I still feel like its a xy problem

hushed loom
cedar olive
#

ye

hushed loom
#

is it a known issue that messages send from these things dont get intercepted by the pre send listeners?

flint bronze
#

No

hushed loom
#

well, they dont

flint bronze
#

Does /msg get intercepted?

hushed loom
balmy sky
#

Guh

north flame
#

Currently working on a SecureTokens plugin

#

Saves your token to an external db for safekeeping, then queries for it on startup

hushed loom
#

nice!, i was planing on doing something like that

dull magnet
#

what

#

why

#

that's useless

vast karma
#

All those things about "securing your token" all sound like bullshit and fearmongering

#

First thing first, what exactly are you trying to protect against

hushed loom
#

Wait, I misread that

flint bronze
#

go work on implementing secure cookie and localStorage in chromium

gleaming marsh
dull magnet
#

it's already stored encrypted

#

(not on windows casue windows moment)

#

anyway just don't run malware on ur pc

balmy sky
viral roost
#

"secure token" mfs when i read their login from chrome

vast karma
#

🧠 is the only token protection that works

rocky falcon
vast karma
#

But then a mind reader can steal it

#

Muscle memory is more secure

gleaming marsh
#

Write your token on paper and put it in a safe or something

north flame
#

Probably will just use a json file saved to a public google drive

gleaming marsh
#

a token on a public google drive? ohnoshiro

north flame
#

Harddrive = secure ❌
Google = secure ✅

north flame
#

Every user who uses voicecord

#

lol

rocky falcon
gleaming marsh
balmy sky
vast karma
#

Hired muscle is very efficient at extracting secrets yes

empty sundial
#

plugin that, on every request, pulls up a popup having to confirm your password to generate a new token (and invalidates the old one)

vast karma
#

Can't have your token stolen if it's invalidated four times per second blobcatcool

empty sundial
#

exactly

balmy sky
dull magnet
#

tokendb

runic talon
runic talon
runic talon
sand ember
#

these days there is a lot of malware which only purpose is stealing discord token

sand ember
gleaming marsh
#

yes, and along with their paid token botting service, they have a disclaimer not to give your tokens to anyone thumbeline

vast karma
#

Trustworthy blobcatblue

north flame
#

However, how would I go about setting a user's token?

hushed loom
#

how would you get the users token?

north flame
hushed loom
#

do i use the store or the module?

north flame
#

const token = getToken["getToken"]();

#

why does deleting the token key in localstorage make it think it's in browser?

swift delta
#

inbestigator making a token logger (/joke)

north flame
#

Ok, I've made it extract the token and patched Discord to read from my plugin instead of how it normally should

#

now, just how should I store it? (securely)

hushed loom
empty sundial
hushed bloomBOT
# empty sundial vencord.app

⚠️ vencord.app is a fake malicious site! The only real website is https://vencord.dev! If you have downloaded anything from vencord.app, remove everything you have downloaded immediately, run a malware scan and change your Discord password.

flint bronze
#

tokenduper plugin when

hushed loom
#

that sounds minecraft malware

flint bronze
#

real

dull magnet
#

free token dupe glitch: dm your token to me and I'll send you it back twice

hushed loom
#

Lowballing discord tokens: /msg me or visit my island

north flame
hushed loom
north flame
whole gullBOT
#
Error 40062

Service resource is being rate limited.

clear parcel
#

good blobcatcozy

simple folio
#

selfapp

amber mantle
#

i have plenty of selfapps

balmy sky
#

We do a little trolley...

north flame
#

Stores token locally in a different place and encrypts it

swift delta
dull magnet
#

it wouldn't be approved

rocky falcon
#

lol

balmy sky
#

Like isn't that entirely useless unless you're stupid and get scammed

#

In either case you're practically done for if you're that dumb anyway

north flame
north flame
#

I'm trying to patch where Discord fetches userdata (name etc.), but it doesn't seem to be the correct place? (even though it's where everything else points to as the correct place)

{
    find: ".USER(",
    replacement: {
        match: /(\i)=\i.default.getUser\(\i\);/,
        replace: "$& alert('Triggered');"
    }
}```
hushed loom
north flame
tropic ice
#

How can I get the content of a text file?
It shows in the network tab and it has the whole file, but after opening it in sources, reveal in navigator sidebar links to a js file, not the text file
wait now it's not linking to anything
maybe it never was linking to the js file

#

my quickcss for reference:

#

(I want to add a copy button to text files)

dull magnet
#

just fetch it

tropic ice
#

oh
ok

tropic ice
#

Is there a guide to making patches somewhere?
I'm quite confused on how to find where to patch

and I don't exactly understand what the \i vencord regex thingy is

tropic ice
#

ah ok

#

why was that removed

rocky falcon
tropic ice
#

but patches arent on there

rocky falcon
iron epoch
#

not yet at least

#

vee could be planning to create a section

rocky falcon
#

at least wait till the new ones are on par

iron epoch
tropic ice
#

How do I get react devtools in discord?
Do I have to use it in browser?

iron epoch
#

you will see the option to enable react devtools

#

than fully restart discord

tropic ice
#

oh ty

tropic ice
iron epoch
#

oh huh where did I get the explantion from? ohh sqaaakoi

#

searching for the conv...

#

welp in short i matchs variables

#

for example

e.Message.CookieClickerTitle

could match this str with \i.Message\.CookieClickerTitle btw starting with \i in your regex is bad

#

\i in the regex would match e

tropic ice
#

ok

#

i'm still struggling

#

I think i found the right function for the download button, but I can't make sense of it at all

#

I'm trying to look at a userplugin that adds this button for reference, but I can't find where it's patching and vencord companion just says a match was found, but not where the match is

cedar olive
#

did you search for the find in devtools

tropic ice
#

No

cedar olive
tropic ice
#

is the find not just a label for the patch?

cedar olive
#

no lol

tropic ice
#

I don't really get the find

cedar olive
#

find is (supposedly) a unique string in the module you want to patch

finite zenith
#

Wai

cedar olive
#

it's what vencord uses to decide whether to try your match or not

#

on every module added

tropic ice
cedar olive
#

so it's supposed to be a unique string (or regex if really needed) that only exists in the module you want to patch

tropic ice
#

ok i definitely have the right id (981729), but i can't find where the buttons are made
i had the wrong id (:

cedar olive
#

that's not the right

cedar olive
#

and click the result

tropic ice
#

I did

#

but I need to put a button here

#

or on the left of download button, idrk

#

but same thing still

cedar olive
#

didnt you say holy notes did what you wanted

#

cuz that's a different place yes

tropic ice
#

holy notes does something similar, not really though

tropic ice
#

holy notes adds a button here that opens the modal for it

#

only similarity is that they add buttons

#

probably shouldve looked at vencordToolbox instead

cedar olive
#

.Messages.PREVIEW_BYTES_LEFT.format(

#

might be where you want

#

here or maybe under, but similar

#

I think those are these buttons

tropic ice
#

oh
that's not the same function i found

cedar olive
#

I recommend using react devtools to find those

#

that's how I did

tropic ice
#

ig i found what is run when the buttons re clicked

#

i did lmao

#

and still failed ig

cedar olive
#

what you found was the Tooltip component I think

tropic ice
#

oh this?

cedar olive
#

yeah

#

981729 is the component responsible for that

tropic ice
#

ah

cedar olive
#

its easy to find that in accident

tropic ice
#

ok yeah this makes so much more sense

cedar olive
#

what I did was look for this

tropic ice
#

ah

#

i tried doing that, but still ended up at the same place as clicking the button

cedar olive
#

but as you can see it has a children prop already with the values

#

which means that Anonymous component is not the one with the code rendering those

cedar olive
#

so I went up

#

until I found the parent of that

#

which is the whole thing

cedar olive
tropic ice
#

oh

#

i did find that actually

#

where did you click go to source from

cedar olive
tropic ice
#

oh im blind

#

you dont need to account for line breaks or whitespace in the regex right?

#

the match regex

cedar olive
#

nop

#

no need to!

#

and if its ever needed vencord will take care of it

tropic ice
#

i assume the regex is matching the output this right?
(from the old version of contributing.md)

cedar olive
#

yes

#

if you have issues with it I can screenshare for you and show me doing it

#

(if I havent left yet)

cedar olive
#

the patch

tropic ice
#

oh

#

I think i can probably make the regex?

#

although not quite sure how to add the button

#

like i have the html needed, but i probably won't actually use it, and i'll use something else?
(the icon is this)

<svg aria-label="Copy File" aria-expanded="false" class="codeIcon_d8e2d0" aria-hidden="false" role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="currentColor" d="M3 16a1 1 0 0 1-1-1v-5a8 8 0 0 1 8-8h5a1 1 0 0 1 1 1v.5a.5.5 0 0 1-.5.5H10a6 6 0 0 0-6 6v5.5a.5.5 0 0 1-.5.5H3Z M6 18a4 4 0 0 0 4 4h8a4 4 0 0 0 4-4v-4h-3a5 5 0 0 1-5-5V6h-4a4 4 0 0 0-4 4v8Z M21.73 12a3 3 0 0 0-.6-.88l-4.25-4.24a3 3 0 0 0-.88-.61V9a3 3 0 0 0 3 3h2.73Z" class=""></path></svg>
cedar olive
#

you need to use react

#

have you done this before?

#

inserted an element with a patch?

tropic ice
#

no

#

and is this how i'll get the url of the file?
(i need that for the fetch)

#

i can't join that vc

cedar olive
#

what about using react?

tropic ice
#

the react devtools?
i just turned that on today

cedar olive
#

Vencord.Webpack.findByProps("getInputDevices").getInputDevices()

#

@inner monolith

#

"input-devices",disabled:

#
{
    find: 'input-devices",disabled:',
    replacement: {
        match: /return \i(?=\.map)/,
        replace: "$&.sort(({name:a},{name:b})=>a.localeCompare(b))"
    }
}
#
/*
 * Vencord, a Discord client mod
 * Copyright (c) 2024 Vendicated and contributors
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

import definePlugin from "@utils/types";

export default definePlugin({
    name: "dsfjkgdfhsfd",
    description: "dsfdsfdfdsfsd",
    authors: [],

    patches: [
        {
            find: 'input-devices",disabled:',
            replacement: {
                match: /return \i(?=\.map)/,
                replace: "$&.sort(({name:a},{name:b})=>a.localeCompare(b))"
            }
        }
    ]
});
swift delta
cedar olive
#

<CopyIcon color="currentColor" />

swift delta
tropic ice
#

one thing I don't like is having a css file with barely anything in it though

#

can I just have it in the tsx file instead?

cedar olive
#

you even wrote a new webpack find yourself

tropic ice
#

i think the "box shadow" is just shitty gif compression

hushed loom
#

i can see some type of shadow and the 256 colors dont help

tropic ice
#

its just the hover color, but gif compression makes it look weird

#

and yeah ik about style= but I don't think that works for hover

tropic ice
#

also should my css be style.css or styles.css
it seems like it's kind of used interchangeably in the plugins?

north flame
#

It doesn’t really matter, personally I used styles.css

#

The main thing is just that the classnames are vc-<plugin>-<name>

tropic ice
#

i'm using vc-copy-file-contents
is that fine?

#

the name is CopyFileContents

vast karma
#

Or vc-cfc-..., that's kinda long

tropic ice
#

what would the ... be

vast karma
#

The name of your element

tropic ice
#

button?

vast karma
#

Perhaps

tropic ice
#

the element is the copy file contents button

#

ig vc-cfc-button isn't terrible

worthy rose
#

I'm making a plugin that changes the role and role dot colours to a different one.
It was a fairly simple process to swap the role colour, now the role dot is being a bit complicated
Essentially, I need to get the message author related to the role dot, but it seems no such information is supplied around this. Any thoughts?

#

Information regarding the same module doesn't seem very helpful either

dull magnet
#

wdym change to a different one?

#

and why do u need access to the user?

worthy rose
#

I'm making a plugin that syncs role dot and role color to the user's profile picture dominant color, so I'd need to access the user avatar

dull magnet
#

well you need to patch the parent component

#

that passes the color down

#

and then do it there

worthy rose
#

Ye I thought of doing that
I've just found out I was searching the wrong module id and Discord has some readable name to component mappings somewhere 😭

#

mb

kind pike
signal goblet
#

@thorny solar I've found an issue for betteractivities. not sure if you knew but basically it works then id goes undefined then restarting the activity fixes it. shouldn't a ?.id fix it?

versed osprey
#

is there a list for all the discord props that i can find with findbyprops and findbypropslazy?

hushed loom
#

find by props is mostly for grabbing functions you already have found in discords code

#

(in my experience)

versed osprey
#

ok im just trying to find a replacement for some old props that are not a thing anymore

hushed loom
#

prob got nuked in discord update

#

use findByCode

versed osprey
#

will try

finite zenith
#

Lmao I made a typo

cedar olive
#

and an export using one of its inner properties

#

for example

#

let a = { hii: "yes" }
export a;

findByProps("hii").hii

versed osprey
#

ya ik in an old version of discord me and fres used 2 different props to get the current sound board volume but they both got nuked by discord in an update so it brakes the plugin now

cedar olive
#

what's the props

versed osprey
#

amplitudeToPerceptual and getAmplitudinalSoundboardVolume they are both lazy loaded

cedar olive
#

oh

#

lmaoooooo

#

there is a pr which includes that exact find

versed osprey
#

oh

#

do u have the pr link?

cedar olive
#

let me get them for you

#

const amplitudeToPerceptual = findByCodeLazy("6+1:");

#

let me try to find the other

versed osprey
#

if this is the code

const v1 = findByPropsLazy("amplitudeToPerceptual");
const v2 = findByPropsLazy("getAmplitudinalSoundboardVolume");

export const getSoundboardVolume = () => v1.amplitudeToPerceptual(v2.getAmplitudinalSoundboardVolume());

how do i replace what i have here with that?

cedar olive
#
const amplitudeToPerceptual = findByCodeLazy("6+1:");
const v2 = findByPropsLazy("getAmplitudinalSoundboardVolume");

export const getSoundboardVolume = () => amplitudeToPerceptual(v2.getAmplitudinalSoundboardVolume());
versed osprey
#

ty

cedar olive
#

stil ltrying to find the ohter

versed osprey
#

fres made this part and i have no clue how it works 🫠

hushed loom
#

guhhh i love volume boposter

#

also now i know why vee named it that lol

cedar olive
#
const amplitudeToPerceptual = findByCodeLazy("6+1:");
const { getAmplitudinalSoundboardVolume } = mapMangledModuleLazy("CUSTOM_CALL_SOUNDS_SPARKLES);", {
  getAmplitudinalSoundboardVolume: filters.byCode("getSetting()", ".volume)")
});

export const getSoundboardVolume = () => amplitudeToPerceptual(getAmplitudinalSoundboardVolume());
versed osprey
cedar olive
#

does the finds work

versed osprey
#

ya it dose

cedar olive
#

nice

versed osprey
#

i just saw that the place i took the patch to place the button in the chat box changed it to not use a patch husk

cedar olive
#

what

versed osprey
#

my brain dosent work anymore

hushed loom
#

get sleep

cedar olive
#

what did you just say lol

versed osprey
versed osprey
cedar olive
#

yes

versed osprey
#

so i had a patch to add the soundboardlogger button there

#

but it no worki now

cedar olive
#

these?

versed osprey
#

and the plugin i took the patch from is not using a normal patch now

versed osprey
hushed loom
cedar olive
#

there's an api for it now

versed osprey
#

ya ik

#

but last time i touched the code for the soundboardlogger was like 7 months ago lol

cedar olive
#

if anything it's easier now

versed osprey
#

so it looks like this

cedar olive
#

it's an api

#

what if we made these decorators

versed osprey
#

do i need to change the buttons themselves? or can i just switch the patch for an api?

cedar olive
#

ye

#

you need to use the ChatBarButton component

versed osprey
#

wat

cedar olive
#

look at SilentMessageToggle

versed osprey
#

i havent been in the plugin dev thing for a few months and everything changes 😭

hushed loom
cedar olive
#

that's the issue

hushed loom
#

can decorators take args

cedar olive
#

I would need to cook a solution for that

#

yes

#

but passing the plugin name on every decorator would be ewww

hushed loom
#

eg

@chatbarbutton(() => true)
function foo() {
return <Bar/>
}
cedar olive
#

oh I see what you mean

#

but there's also the issue of enabling/disabling a plugin

cedar olive
hushed loom
#

does javascript have reflection?

cedar olive
#

what black magic are you thinking of?

#

javascript makes a lot of stuff possible

hushed loom
cedar olive
#

lets take for example settings

finite zenith
#

Is it possible to inject react elements into a settings modal?

cedar olive
#

you need to put it in the plugin obj

#

for it to acquire the name of the plugin

#

which is not practical with decorators

#

so it needs another way of discovering the plugin name

cedar olive
finite zenith
#

Trying to dynamically add into the settings like this CB_birddance

finite zenith
cedar olive
#

ye you can do custom components

finite zenith
#

Yuh yuh

cedar olive
#

OptionType.COMPONENT

hushed loom
#

look at text replace for a good example of them

finite zenith
#

And how would I do dropdowns?

cedar olive
#

well that's just normal react

#

do it normally how you would already do

hushed loom
#

discord might have some compontents you could steal

versed osprey
#

guys how do i move form a patch with this to the api?

hushed loom
#

also might just be me, but something like a command to open a modal would be nicer. too many chat bar icons as there is

versed osprey
hushed loom
cedar olive
#

unsure if that can access the plugin obj

#

however I still dont really like it

#

I think some esbuild magic can insert the plugin name in the decorators automatically for us

hushed loom
cedar olive
#

it would be dope ngl

#

you could make a lot of the apis be decorators

#

flux listeners

#

context menus patches

#

chat bar buttons

#

and more

hushed loom
#

guhhh does mdn not have an article

cedar olive
#

it's a typescript feature

hushed loom
#

oh

#

@cedar olive am i stupid, or can decorators not be attached to function?

cedar olive
#

oh hell nah

#

😭

#

whyy

hushed loom
#

guhhhh

cedar olive
#

rest in peace my idea blobwob

hushed loom
cedar olive
#

nuh

flint bronze
#

js classes are Weird

flint bronze
#

yes, this also breaks due to some destructuring within Discord itself I think

#

as I reported recently

#

and don't know how to reproduce blobcatcozy

#

though that might be a similar issue

signal goblet
#

The only problem with that is we don't know how to reproduce it you just click someone's profile and the popout may or may not crash you lol

inner monolith
#

Is there a way to make the discord source more readable?

#

I loaded all lazy chunks, and i'm trying to find the part where the deafen button is, because i'm trying to decouple the deafen and mute

#

since on deafen, it automatically mutes me

dull magnet
#

you don't need to load lazy chunks for that its already loaded

#

just use react devtools to inspect

inner monolith
#

also are normal devtools that come with electron bad? iI saw Nuckyz using it and he made it look easy lol

#

I know how to find the element, which is

#

but now I'm looking at the event listeners

#

I looked at toggle and click

#

toggle was an empty function

#

the function bound to click was called on any click in the entire window

#

what is @deep atlas

vast karma
#

Discord's builtin spambot

#

Thought they scrapped it though

inner monolith
#

yeah me too

#

still in beta i suppose

dull magnet
inner monolith
#

Okay, i got react devtools and installed vencord on the web

#

Ohhh, Nuckyz was using this

#

I wonder if i can get it on normal discord

#

Oh, it's a setting on vencord

inner monolith
cedar olive
#

guess I made someone try to make a plugin :)

inner monolith
unkempt dove
#

is there a way to mark a plugin as a conflict with another plugin? like completely disable you from turning one on with the other?

reason: i'm building a plugin that uploads files to a different site on upload (instead of discord), so it makes no sense to be able to turn anonfilenames on since it wouldn't really matter + some of my patches conflict

hushed loom
#

you can make two different patches, one marked with preticate: () => isPluiginEnabled(other plugin)

#

and another for if its not

tight canyon
#

Can someone please explain the usage of ErrorBoundary.wrap and how exactly it works pleadey

#

Oh, nvm, Props Interface is pretty good self-explanatory

flint bronze
#

You still need help with that?

tight canyon
#

No, thanks, i have more than enough example usage

#

I just had no idea what it does venniecozycat

flint bronze
ruby turtle
#

Hey maybe I am being dumb but how would I replacement patch to get a function from a class?

class ed extends (i = r.PureComponent) {
    scrollToChannel(e) {
        
        }
}

i.e I want to use scrollToChannel within my plugin but this isn't exported.
is the only way to do it within the function body?
that sucks because in that case the function has to be run at least once for the function to be available in my plugin

#

module is 373274
I've also tried using wreq but doesn't seem to be accesible from it (but I am unfamiliar with how that works)

#

wait can I patch the constructor Hmm

dull magnet
#

you just grab the entire class

#

it's probably exported

ruby turtle
#

unless I am doing it wrong I don't think it's exported
or at the very least:

Vencord.Webpack.find(m => m?.prototype?.scrollToChannel != null)

does not return the class

dull magnet
#

why do you want it anyway

#

you likely can use ComponentDispatch

#

some event

ruby turtle
#

I want to scroll to a channel in the channel list by id

ruby turtle
#

Didn't find one that relates to channel list scrolling unfortunately

balmy sky
#

Is there a specific onEnable function for plugins? I want a function to only run when the plugin is enabled from the ui, not when the client starts

ruby turtle
ruby turtle
#

wait I am so confused.
calling

Vencord.Plugins.plugins.ScrollTo.getChannelList().scrollToChannel("994702739139477544");

works perfectly but
doing the EXACT same thing within the plugin does nothing (no exception no nothing)

where getChannelList just calls return channelList
scrajj confusion

#

sorry just blabbing atm while confused

#

peepoTalk wait but hard-coding the id works scrajj

balmy sky
#

I just want to prompt the user for an auth on first time enable and it would feel weird to prompt on open

ruby turtle
#

oh I see I was calling toString on a string. Thinking SelectedChannelStore.getChannelId() was returning a ulong or whatever the ts equivalent is

ruby turtle
cedar olive
#

there's some magic you can prob do with setTimeout but it's better if you don't rely on having some code execute only on a manual enable

flint bronze
#

can someone explain how the audit log menu even works

hushed loom
cedar olive
#
let isConnectionOpen = false;
let subscription;

FluxDispatcher.subscribe("CONNECTION_OPEN", (subscription = () => {
  isConnectionOpen = true;
  setTimeout(() => (isConnectionOpen = false));
  FluxDispatcher.unsubscribe(subscription);
}));



// on the start method
if (isConnectionOpen) return;
your logic here
#

might need to use addInterception instead of subscribe

vast karma
#

startAt: "never" as any SKULL_SKELETON

cedar olive
#

but even then, that's very magic

hushed loom
#

did you type that on your phone 😭

cedar olive
#

yes

#

actually my method wouldn't even work

#

cuz you would need that to run outside of the start method

#

and flux dispatcher wouldn't be initialized

#

what kyuu suggested would work though

#

(even though it's just abusing the fact an invalid value would make it never start) 😂

dull magnet
dull magnet
cedar olive
#

forgot about that😂

balmy sky
#

the tooltip is "Jump To Thread Start"

amber basin
#

id assume

balmy sky
#

Yeah

swift delta
balmy sky
#

yeah i just changed that

swift delta
# balmy sky

yeah that’s better i like it 9/10 (-1 because torg)

jagged briar
#

i want to make a plugin to screenshare the current app when you press a key but i have absolutely no clue how to get the currently focused app without some library or something

#

any ideas?

hushed loom
jagged briar
#
Add-Type @"
  using System;
  using System.Runtime.InteropServices;
  public class Tricks {
    [DllImport("user32.dll")]
    public static extern IntPtr GetForegroundWindow();
}
"@
get-process | ? { $_.mainwindowhandle -eq [tricks]::GetForegroundWindow() }
#

absolutely no clue how to do it on mac

hushed loom
jagged briar
#

looks janky but i think you have to use ps

ripe smelt
#

is there a way to make some plugin settings not appear until a specific setting from a dropdown is selected?

balmy sky
#

Easiest way would probably be to put all of the settings in a single react component

#

And from there you can do the normal stuff

ripe smelt
#

alright, thanks

boreal vessel
#

anyone know how to fix this
Refused to connect to 'url here' because it violates the following Content Security Policy directive: "connect-src 'self'

#

im trynna send a get request to somewhere but discord blocks it with that message

dull magnet
#

what are you trying to fetch

#

and why

boreal vessel
#

for ppl to set whether they wanna be @'d on reply by default or not

dull magnet
#

awful

empty sundial
#

awful

boreal vessel
#

?

#

u 2 r awful

#

so how do i do it

jagged briar
#
  1. That sounds incredibly useless, I don’t think anyone would really use it
  2. Send the request from native
boreal vessel
#

wdym from native

jagged briar
#

From the native side, not the client side. Look at other plugins with a native.ts file

swift delta
boreal vessel
#

just one client side that doesnt have a db

swift delta
#

bro yes it does

boreal vessel
#

what

jagged briar
#

The difference with this one is that they want to make a database to store who wants to be pinged or not

boreal vessel
#

^

dull magnet
#

u dont have to send from native

boreal vessel
boreal vessel
empty sundial
#

just is

#

quit having fun

#

vencord is serious business

boreal vessel
#

this isnt for fun

#

this is the end of a war

swift delta
# boreal vessel how so?

Because there’s no reason for a database to be needed all of this info is perfectly fine being client side

boreal vessel
#

between those who like being binged

#

and those who dont

swift delta
#

If anything a database just seems like a safety concern

boreal vessel
#

no?

#

thats like saying being in a discord server is a safety concern

jagged briar
#

Using a database is incredibly over engineered, just check if someone has something in their bio or username

boreal vessel
#

maybe

#

not like its a real database

#

i just use json maps {userid:boolean}

empty sundial
#

awful

boreal vessel
#

no it good

swift delta
boreal vessel
#

yall r just haters

swift delta
#

If hating something that is very unnecessary and just a waste is bad then sign me up

boreal vessel
#

its not tho

empty sundial
boreal vessel
#

ig not

#

i think they were lying

swift delta
#

wild saying the owner and maker of Vencord is a liar

boreal vessel
#

its true

swift delta
#

nin0 is typing… horror

boreal vessel
#

k

hoary pilot
#

i do find this plugin to not be that useful
(also having one huge JSON map isnt that efficient. you might be better off using a sqlite db on the long term)

boreal vessel
#

only devs seem to be haters

#

other ppl want it

#

you do know us here

#

we are vencord users

hoary pilot
#
  • always fetching from an API, possibly untrusted, can be bad
    (maybe make the plugin detect (@ON) | (@OFF) in a nick, or a 3y3 in bio? or other signs you want pings to be on or off idk)
boreal vessel
#

right @swift delta

boreal vessel
swift delta
#

that what we are saying

boreal vessel
#
  • is painful to remove
empty sundial
boreal vessel
#

oh yeah fs

#

bc that would be less sus

#

and more efficient

empty sundial
#

it is

hoary pilot
#

are you serious rn

#

i will NOT wait 10 seconds for a generative AI to tell me if pinging someone is okay potOfGreed

empty sundial
#

im trolling

#

i thought that was obvious

boreal vessel
#

it was

empty sundial
boreal vessel
#

whats that 1 bar thingy

hoary pilot
shrewd tundraBOT
boreal vessel
boreal vessel
#

oh

#

ohhhh

hoary pilot
#

vh plugin

shrewd tundraBOT
boreal vessel
#

kk

#

vh

shrewd tundraBOT
# boreal vessel vh

​ chars Inspect the unicode characters in a string
emoji-leaderboard Check who sent an emoji the most
reaction-leaderboard Check who reacted with an emoji the most
sticker-leaderboard Check who sent a sticker the most
top Get stats about most used emojis or stickers
mytop Get stats about your most used emojis or stickers
help List all commands or get help for a specific command
minky minker
ban Ban one or more users with an optional reason and delete message days
role-add Add a role to one or more users
role-remove Remove a role from one or more users
prune Delete a number of messages
slowmode Set the slowmode for the channel
submissionpass Allow this user to post one submission
unban Unban one or more users
whybanne Why Banne?
notsupport Create a graphic guiding people to the correct channel (usually support)
eval Evaluate javascript code
plugin Provides information on a plugin
source-code Get the source code for this bot
faq Get an answer from the FAQ
support Query a support tag

Use vhelp <command> for more information on a specific command!

boreal vessel
#

what would eval do

#

would it run it and send output?

boreal vessel
#

vh eval

shrewd tundraBOT
boreal vessel
#

thats a funny name, veval

#

veval console.log("test")

shrewd tundraBOT
boreal vessel
#

ah

#

so it turns it into an ai generated voice clip of the output (real)

rocky falcon
#

what

flint bronze
#

guh idk anymore

#

hate being terminally online

boreal vessel
#

same

#

not worth it

empty sundial
#

Go outside then

boreal vessel
#

to go outside?

#

outlandish.

tropic ice
# tropic ice

For this version of my copy file contents plugin, it just uses the filecontents that the client already has, but the client only has up to 50kb, more than that and you have to fetch it
I have a version that fetches it if what the client has isn't the full file, but it'll still fetch it if it's like 500mb (haven't actually tested with 500mb file, but it will at least try to fetch it in that case)
Which treatment should I use or should I add a dropdown to choose? e.g. Normal (just copy the 50kb that the client has), None (hide the copy button when it's over 50kb), or Fetch (fetch the file even if it's huge)
If i have the fetch option, I think I should probably have a slider for the max file size it'll fetch, but the file is over that size, which treatment should I use?

boreal vessel
#

GOD DAMN

#

SO MUCH TEXT

#

gonnna needa have gpt sumarize

tropic ice
boreal vessel
#

like a warning

empty sundial
#

should i make funny discord ai plugin

boreal vessel
#

im pretty sure you can check the file size before fetching

boreal vessel
#

would it use

empty sundial
#

openai

tropic ice
boreal vessel
boreal vessel
empty sundial
#

api

boreal vessel
#

api sucks

#

costs money

empty sundial
#

☹️

boreal vessel
#

u could still do it tho

#

would be cool

empty sundial
#

just scrape .ai sites for openai keys

boreal vessel
#

or make it a discord bot

boreal vessel
tropic ice
boreal vessel
#

cancel = doesnt copy

tropic ice
#

also, what's the convention for modifying components\icons.tsx?

boreal vessel
#

yes = copies

empty sundial
tropic ice
tropic ice
tropic ice
#

oh

boreal vessel
empty sundial
boreal vessel
#

xd

tropic ice
#

50kb is a size i'd actually like to copy
but that probablty would be the best, simplest solution

empty sundial
#

i dont think copying over 50kb is even useful as like

#

why do you even want that in your clipboard

tropic ice
tropic ice
empty sundial
#

from what i read 4mb is the maximum size for the windows clipboard anyway

tropic ice
#

because 10mb and 25mb still copied but just didn't show in clipboard history

empty sundial
#

i just dont get why youd want so much text inside your clipboard

#

like

#

even if its an entire 2k line file

boreal vessel
#

fr

empty sundial
#

just download it

tropic ice
#

yeah

#

i think i'll do that for the version i pr

#

ty

empty sundial
#

alright!

tropic ice
tribal stump
#

So how can I add autofill options to comands with CommandAPI

#

Like the members but custom

hushed loom
#

is it possible to tell if a module has been patched just from the module ID

dull magnet
#

wreq.m[id].$$vencordOriginal

hushed loom
hushed loom
boreal vessel
#

Object.keys(wreq.m)

#

check if it has 768419

#

if so try without the $$vencordoriginal

hushed loom
boreal vessel
#

o

#

can you dynamically add patches

#

or toggle them

hushed loom
#

no

boreal vessel
#

would be cool

#

tho probs not possible

hushed loom
#

not possible

dull magnet
cedar olive
hushed loom
#

thanks

dull magnet
#

indeed

#

inconsistent names mm

#

well whatever

hushed loom
cedar olive
#

all

#

¯_(ツ)_/¯

hushed loom
#

oh

dull magnet
#

actually yes but on unpatched modules it'll be the same function

#

wreq.m[id].original === wreq.m[id]

hushed loom
#

doesnt seem to

cedar olive
#

vencord makes all wreq.ms the wrapper

hushed loom
#

wreq.m[id] gives vencord wrapper

cedar olive
#

it needs to be able to run waitFors

#

and other stuff

#

no current way to see if a module is patched I think

dull magnet
#

yeah true

tribal stump
#

If thats even possible

dull magnet
#

you can use options

#

if you mean dynamically generate you can't

#

vencord command api doesn't implement that

tribal stump
#

Ah alright, thought so from what I saw looking at the code for it

#

Dynamic is what I meant

dull magnet
#

if you just need a user option then use the user type

tribal stump
#

Nah not for users, custom

dull magnet
#

make modal instead of command

#

you can have the command open the modal

tribal stump
#

True, thanks

cedar olive
#

1st is non patched, non required
2nd is non patched, required
3rd is patched, required
4th would be patched, required and would work regardless too

#

and $$vencordPatchedSource is a string containing the patched src

hushed loom
cedar olive
#

the string of it

#

not the function

hushed loom
#

😍

cedar olive
#

which means you can do diffs

#

but even then bad news cuz this is in my branch that changes lots of stuff

hushed loom
#

huge for my side project that one person will use(me)

cedar olive
#

I could maybe port it to current version

#

let me see

dull magnet
#

u should pr them

hushed loom
#

draft rn

hushed loom
cedar olive
#

oh I should make it dev only

hushed loom
#

i dont see a use other than that

cedar olive
#

nah IS_DEV is fine

indigo oriole
#

hello

#

i needa ask something

#

i was going through an unofficial vencord plugin guide after going through the official one

#

when it showed this

#

find: ".EMOJI_POPOUT_STANDARD_EMOJI_DESCRIPTION",

#

now my problem here isnt that i dont understand what it does

#

its that

#

how do you know what EMOJI_POPOUT_STANDARD_EMOJI_DESCRIPTION

#

like its self explanatory but where do you get this name from? and dont know if its gonna be named something else yk

#

it might be a dumb question but i genuninely dont know where the person got it from