#🧩-plugin-development

1 messages · Page 51 of 1

dull magnet
#

so useless

trim cedar
#

True xdd

vast karma
#

Since they have no need for writing foreign symbols

dull magnet
#

horror

#

why

#

i use right alt for € @

#

and its useful for norwegian letters

#

æø

#

also u can type micro with altgr

#

µ

#

and þ

#

↓↓↓→→→→←←←

#

how arrow up

#

it doesnt have arrow up

#

zui = ←↓→

vast karma
#

I have the arrows on hjkl

#

Where they belong

trim cedar
#

Micro is def. needed 😵‍💫

dull magnet
#
qwertzuiopü  @ſ€¶ŧ←↓→øþ¨
asdfghjklöä  æſðđŋħ.ĸł˝^
yxcvbnm      »«¢„“”µ
#

funny

#

horror

#

my main hatred about german layout is that it sucks for coding

#

cause {}[]~| are altgr combo

#

and ()?! requires shift

pure temple
#

omg

#

awful

dull magnet
#

idk which of those also require shift on US layout

pure temple
#

all of the keys you mentioned that require Shift on the German layout also need it on US and UK

trim cedar
#

Never

pure temple
#

(i usually use UK blobcatcozy)

dull magnet
#

yeah but {}[] dont need altgr

#

alrtgr is horror

pure temple
#

they need shift instead

#

uh [] = no shift, {} = shift

dull magnet
#

< needs shift?

#

it doesnt on german

pure temple
#

it needs shift

vast karma
#

I use a mostly us-ascii layout, with åäö on altgr+aeo because I use those less than brackets

pure temple
#

it's weird, i find it hard to say whether something needs shift but my hands definitely know xd

#

i just see what my hands do

dull magnet
vast karma
#

I moved escape to the <>| key (between shift and z) because vim uses that key a lot

#

Caps lock is my compose key

dull magnet
#

←↓→↑

#

all the arrows yayyy

vast karma
#

As for the physical esc key, that one is ime toggle

dull magnet
#

okay who tf types & with ctrl + altgr + k we need to have a talk

pure temple
#

←↓→ how do you do up on uk

#

or us

dull magnet
#

Ħ

#

among us

cunning tundra
#

im not devloper :3

dull magnet
ionic breach
dull magnet
#

yeah but the other one is on my keyboard

vast karma
#

Is this how it's supposed to look

pure temple
#

ßalls gaming

dull magnet
dull magnet
vast karma
#

Doesn't look very sus to me

dull magnet
#

its a little crewmate

#

how do u type öäüß

#

on other layout

#

also did u buy a qwerty keyboard or do u use a qwertz keyboard with different layout

vast karma
#

I think most layouts don't support those

#

Maybe with dead keys for the umlauts

dull magnet
#

this is kinda cursed

vast karma
#

That looks swedish

stiff cargo
#

Swedish :D

stiff cargo
dull magnet
stiff cargo
#

Or well iso nordic

dull magnet
stiff cargo
dull magnet
#

norwegian and danish dont use äö

#

so how tf is it gonna be nordic

stiff cargo
#

Just look different

#

Æø

dull magnet
#

those are different letters....

#

😭

vast karma
#

They put æ and ø on the same keys I think

dull magnet
#

yea

vast karma
#

Or maybe they're swapped around

pure temple
#

ae

stiff cargo
dull magnet
#

norwegian keyb is same just with æøand the blahaj a

stiff cargo
#

å

dull magnet
#

idk how to type blahaj a on german layout

vast karma
stiff cargo
vast karma
#

Copypaste a å I guess

dull magnet
#

that sucks damn

vast karma
#

But blahaj is fine, really

dull magnet
#

you need to use compose key

dull magnet
#

but it looks cursed

stiff cargo
#

Def closer

vast karma
#

Phonetically yes

#

Morally no

pure temple
#

blaohaj

dull magnet
#

well

#

i have the power

vast karma
#

Fancy

stiff cargo
#

Evil webm sender marisad

dull magnet
#

but then it also switches mz y and z

dull magnet
#

bro how did zou get used to qwerty

#

i tried multiple times it drives me crayz

#

im so used to z being up

#

ZESSS

stiff cargo
dull magnet
#

OTHER KEZS ARE NO PROBLEM

#

but the fucking zy

#

its unreal how hard it is to break zour muscle memorz

#

okay im back on german

#

i think cause most special keys you consciously type

#

while typing normal text is a flow

#

where you dont think about it

#

its mostly muscle memory

dull magnet
#

gonna make it a required vencord plugin

#

webm doesn't embed on ios

#

it's funny

#

you can bully ios users by only sending webm

#

not possible

#

xd

#

unless you compile a decoder to js

#

which might be possible actually

#

anyway im not even sending webm on purpose it's just that gnome records as webm

vast karma
#

Back at the computer, here's my layout ```
1234567890-= ¹²³⁴⁵⁶⁷⁸⁹⁰–≡
qwertyuiop[] ∀wäℝ⊤y∪∈öπ⟦⟧
asdfghjkl;'\ å★δƒ↔←↓↑→↕'λ
zxcvbnm,./ ℤ×ℂ∨bℕμ,…÷

!@#$%^&*()_+ ₁₂₃₄₅₆₇₈₉₀—≠
QWERTYUIOP{} ∃WÄℝ⊥Y∩⊆Öτ«»
ASDFGHJKL:"| Å☆ΔƑ⇔⇐⇓⇑⇒⇕"Λ
ZXCVBNM<>? ℤ·ℂ∧B∅μ≤≥?

dull magnet
#

because guess what webm is a really good format with good compatibility on anything that isn't crapple

dull magnet
#

on my keyboard it does a few of powers then it does fractions and other random shit

vast karma
#

What do you mean, they're useful

#

I put them there on purpose

dull magnet
#

oh

#

is that not the default

#

im not saying it's bad

#

but also you can just type ^ and then type a normal digit

#

and it should turn it into a proper power

vast karma
#

I don't have any dead keys because they suck

gloomy terrace
silk sorrel
vast karma
#

What is this

#

It looks sort of like a huge mess ngl

silk sorrel
#

it actually fucks up (most) uwp apps if you install it
I used it for a while lol

#

entirely based on dead keys and keybinds that shouldn't be possible (it even rebinds the nav cluster and function keys to be used in character combos)

vast karma
#

I'm gonna stick with my compose script for anything not in the layout

frigid bay
#

rust is c++ for javascript users

vast karma
#

C++ is rust for masochists

flint bronze
#

wut

oblique lark
#

how messed up is your font man

#

to me it shows up as normal text

pure temple
#

mobile

jagged briar
#

Mobile just does that

balmy sky
#

ok this is weird, i'm trying to get the globalName property of a user (i know it exists because i logged the user to console and it had the property, AND when i actually read it the code works fine, but vscode just insists it doesn't exist and keeps giving me an error??? weird asf

vast karma
#

Yeah the ts types aren't accurate

balmy sky
#

Ah

#

Should i just ignore it then?

vast karma
#

Or send a pr to discord-types

jagged briar
#

or we just need to update discord-types

#

i may be spreading misinformation though

balmy sky
#

I just ignored it for now. Anyway, i made an upgraded version of showmeyourname, should i pr it?

dawn timber
#

i hear this is a pro gamer channel

north flame
rose hamlet
#

is it possible to use node.js modules like "fs" in a plugin?

#

and/or any way to communicate with the outside world?
worst comes to worst, I suppose could ping a local web server. but I'd like to avoid that if possible

flint bronze
pure temple
balmy sky
#

OH GOD OK THAT'S NOT NORMAL 💀

#

Banger plugin ngl

gloomy terrace
balmy sky
#

Hmmmmmmmm

#

Maaaaaaybe

#

OH MY FUCKING GOD SOMEHOW I MANAGED TO MOVE IT BUT NOT FIX IT 💀

gloomy terrace
#

It is expanding, quite rapidly at that too

balmy sky
#

I fixed it yippee

#

oh and it just breaks vencord whenever i try to use openContributorModal

#

lovely

#

yeah this is really weird, as soon as i try to call openContributorModal in the plugin, my discord just appears as stock discord until i rebuild with the line removed or disable the plugin

gloomy terrace
#

So you made a nyaboom button

balmy sky
frosty otter
dull magnet
#

you can't.

#

use the global Vencord.Plugins

noble coral
#

this breaks my whole vencord for some reason


            find: "codeBlock:{react(",
            replacement: {
                match: /codeBlock:\{react\((\i),(\i),(\i)\)\{/,
                //replace: "$&return [$self.renderHighlighter($1,$2,$3), console.log(\"custom\")][0];"
                replace: "$&return $self.renderHighlighter($1,$2,$3);"
            }
#

is there a way to wrap the render react function?

#

safer way

vast karma
#

Check what the shiki plugin does I guess

noble coral
noble coral
#

I can't even test the plugin because it breaks, I need to use the ui version of the installer to fix vencord, this doesn't make sense. repair does not work either.
i am putting the code here

import definePlugin from "@utils/types";
import { findByPropsLazy } from "@webpack";

import { Parser } from "@webpack/common";

const CodeContainerClasses = findByPropsLazy("markup", "codeContainer");
const old_react = Parser.defaultRules.codeBlock.react(props, null, {});

export default definePlugin({
    name: "minbutton",
    description: "min button test 11v",
    patches: [
        {
            find: "codeBlock:{react(",
            replacement: {
                match: /codeBlock:\{react\((\i),(\i),(\i)\)\{/,
                replace: "$&return $self.renderHighlighter($1,$2,$3);"
            }
        },
    ],
    //start: async () => {},
    //stop: () => {},n 

    renderHighlighter: ({ lang, content }: { lang: string; content: string; }) => {
        console.log(lang+content);
        return `<div className={CodeContainerClasses.markup}>
                WWW :)
            </div>`;
    },
});
dull magnet
#

you're using the module before it exists

vast karma
#

I suspect that it's the old_react function that's spooking, because Parser is lazy-loaded and noy available yet

#

Put that in start() instead

noble coral
#

damit. let me try

#

... fixed..

north flame
#

*sob* It's b e a utiful *sob*

noble coral
#

hello, guys. is there a way to only make patchs if only if a setting is on? or are patchs safe from other plugins and don't affect them when two plugins make the same patch?

vast karma
#

Patches have a predicate

jagged briar
jagged matrix
#

heyo im gonna send my page not found sites code, need help with smth

#
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>what did you do.</title>
    <link href="/style.css" rel="stylesheet" type="text/css" media="all">
    <style>
    @import url('https://fonts.googleapis.com/css2?family=Rubik+Glitch&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=Anta&display=swap');
    </style>
    <script>
    var timeleft = 5;
    var downloadTimer = setInterval(function() {
    if (timeleft >= 0) {
        document.getElementsByClassName("countdownTimer")[0].innerHTML = timeleft;
        timeleft -= 1;
    } else {
        setTimeout(() => document.getElementsByClassName("dude")[0].src = "https://files.catbox.moe/g4w56a.png", 50)
        setTimeout(() => window.location.replace("https://madelinemaid.neocities.org"), 1000)
    }
}, 1000);
    // why are you snooping? credits to ashley for the code cause i cant code javascript for shit
    </script>
  </head>
  <!--DUDE STOP SNOOPING-->
  <body> <style> 
  body {background-color: black; color:red;}
  </style>
    <h1 style="scale:1.5"> <center> <div class="countdownTimer" style='font-family:"Rubix Glitch" !important'></div> </center> </h1>
    <img class="dude" src="https://files.catbox.moe/m2k7n4.png" alt="how." width="auto" height="400">
    <style> 
    .dude {
      filter: contrast(999999999);
      display:block;
      margin-left:auto;
      margin-right:auto;
    }
    a:link {
      color:red;
      text-decoration:underline
    } 
    a:visited {
    color:red;
    background-color:transparent;
    text-decoration:none;
    } 
    a:hover {
    color:red;
    background-color:transparent;
    text-decoration:none;
    } 
    a:active {
    color:red;
    background-color:
    transparent;
    text-decoration:none;
    } 
    </style>
    <p><center><h1><b><h1 style='font-family:Rubik Glitch'>404: INVALID PAGE</h1></b></h1></center>
  </body>
</html>```
#

i cant seem to get the countdown to have the font itself (the 5 at the top)

#

any idea what i could do to make it have the font? 5 IS supported

#

all numbers are supported with the font im using

#

id suspect its because the countdown is from the script

#

but even then i really cant code js for shit

vast karma
#

Try spelling the font name right

#

Also that code is terrible and you should be either ashamed or proud, your choice

jagged matrix
#

im proud fuck you Troll

jagged matrix
#

i didnt notice it wasnt spelled correctly

#

yeah that definitely fixed it

#

i cant believe it was cause of my stupidity

#

thx

noble coral
jagged matrix
#

what SKULL_SKELETON

noble coral
jagged matrix
noble coral
#

cough i am gonna steal it anyways and put it on discord cough

jagged matrix
#

its a basic website not found page, i dont even think you physically can 💀

noble coral
#

don't disappoint my lil brain like that 😔

jagged matrix
#

💀

vast karma
#

Lol

#

What the fuck is that language anyway

#

str.tostring(), "{{time}}", no json library?

noble coral
#

is there lazy patchs?

vast karma
#

That wouldn't make sense

#

You can't edit code after it's been run

noble coral
vast karma
#

And how would lazy patches, whatever that would mean, solve that?

#

Fix your broken patch instead

tawny tulip
#

What should the payload sent to Discord Gateway look like to indicate that the user is active via Desktop App? (not Web Browser)

I managed to determine that it should look like this for Mobile, but need also Desktop:

op: 2,
d: {
  token: "token",
  intents: 513,
  properties: {
    $os: "iOS",
    $browser: 'Discord iOS',
    $device: "iPhone"
  }
}
tawny tulip
# dull magnet

A useful option, but don't see the payload details I need there

trail talon
#

imagine not coding in whitespace

vast karma
#

Imagine trying to code in whitespace in a program that replaces tabs with spaces

oblique lark
#

wait i think that's what actually happened here lmao

flint bronze
steady knot
#

best domain

flint bronze
#

wtf this is stupid

simple folio
#

@clear parcel fix...

tawny tulip
#

I'm just looking for identify/properties corresponding to the desktop app

clear parcel
small trail
#

yo, how would i put together a simple default discord mod

#

i wanna replace this with a gif of an oc i have

#

DEFAULT DISCORD SUCKS

#

TAKE ME BACK

#

OH GOD PLEASE TAKE ME BACK

#

okay guys, why does it have a tumor

flint bronze
#

i must say
1: thank you
2: funni domain

clear parcel
#

mostly me yea

#

pls contribute!!

vast karma
#

Are golang's maps mutable?

#

Because if they are, it makes sense that they're invariant

noble coral
small trail
#

ok so uh

#

hey gang

noble coral
small trail
#

how would i find elements in the app to edit in css

#

theres no inspect in the app so

noble coral
small trail
#

HUH

#

THE FUCK

noble coral
noble coral
small trail
#

so discord really is a web browser

vast karma
#

Was there ever any doubt?

noble coral
#

than you will get used to it than you could press it once

noble coral
#

don't mind my stupidity 🙂

#

:dancing:

small trail
#

ok so

#

how do i click on something and be directed to it in the little

#

menu

#

inspect menu

vast karma
#

Should be button like this

small trail
#

where do i find that

vast karma
#

I dunno where it is in chrome/download, in firefox it's top left corner

small trail
#

oh

#

well its there too

#

nice

#

i dont know how to do it properly and i fucked it up

#

HAHAHAHAHA

#

what if i delete everything

vast karma
small trail
#

hi radi on phone here

#

i fucked up

#

hi radi back on pc here

#

i unfucked up

north flame
#

Is it possible to store data in localstorage?

#

like keys

vast karma
#

Discord deliberately removes that from the global object

#

Use vencord's DataStore instead

north flame
north flame
#

what's the syntax for that?

vast karma
#

Just grep it

north flame
#

?

vast karma
#

Check how other plugins are doing it

north flame
#

ty

#

you are going on the nice list this year!

vast karma
#

Oh no

north flame
#

is there a way to view it in client?

vast karma
#

View what?

north flame
#

datastore

#

while debugging

vast karma
#

await Vencord.Api.DataStore.entries() perhaps

north flame
#

How do I get the user object of the current user?

E.G. When the user executes command /startGroup it sends a message containing the executor's username

vast karma
#

UserStore.getCurrentUser() would be my guess

north flame
vast karma
#

Dunno

north flame
#

lmao

vast karma
#

You want to send yourself a dm?

north flame
#

another user

#

sorry

#

mixing up stuff

#

like this

#

obviously wrong rn

cedar olive
#

neither does discord itself

north flame
small trail
#

i do

silent hatch
#

rust is based

unreal dock
#

i fucked up my arch install the other day

#

just unfucked it through the power of archiso chroot black magic n shit

#

(i accidentally overwrote libs with 32 bit versions so my system died)

#

on it rn

jagged briar
#

Look at MessageTags

north flame
#

is it possible to do a variant of sendBotMessage that doesn't look ephemeral?

jovial spoke
#

that is not true

#

and never will be

floral plaza
balmy sky
#

Is there a way to get message props if you reply to a message with a command?

vast karma
#

You mean the usual Message object?

#

Probably MessageStore

stable ridge
#

very nice

#

now beat this tho

limpid oar
#

gnome on arch

#

disgusting

#

can't you just

#

install it

#

on other des

#

i always use spectacle on everything

#

i should use hyprland and all the silly random stuff

stable ridge
#

chmod 777 /**/*

#

don't do this actually

noble coral
#

lmao

vast karma
#

Why would one use something that is not maim for screenshots

noble coral
jagged matrix
#

@steady knot wake up

vast karma
#

What cutting off? The scrolling?

jagged matrix
#

cant figure out whats causing it

vast karma
#

Easiest would be setting width: 100% on the iframes

jagged matrix
#

that helps, but its still a tad bit cut off

vast karma
#

Iframes are sorta, y'know, crap

#

Difficult to style

jagged matrix
#

i blame vee

#

they created the widget,,,

#

joking of course its more than likely something in my site causing it

indigo reef
jagged matrix
#

yes

indigo reef
# jagged matrix yes

Oh mah gahhh ‍​​​​​​‌​​​​​​‌​​​‌‎‌​​​‌​​‌‍

jagged matrix
indigo reef
# jagged matrix

Yeeeehaaaww ‍​​​​​​‌​​​​​​‌​​​‌‎‌​​​‌​​‌‍

noble coral
jagged matrix
#
<!DOCTYPE html>
<html>
<head>
    <title>Image Editor</title>
    <style>
        #imageContainer {
            max-width: 500px;
            margin: 0 auto;
            text-align: center;
        }
        img {
            max-width: 100%;
            margin-bottom: 20px;
        }
        input[type="range"] {
            width: 80%;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
    <div id="imageContainer">
        <input type="file" accept="image/*" id="uploadInput">
        <br>
        <label for="sizeSlider">Size:</label>
        <input type="range" min="0.1" max="2" step="0.1" value="1" id="sizeSlider" onchange="updateImage()">
        <br>
        <label for="rotateSlider">Rotation:</label>
        <input type="range" min="-180" max="180" value="0" id="rotateSlider" onchange="updateImage()">
        <br>
        <label for="hueSlider">Hue:</label>
        <input type="range" min="0" max="360" value="0" id="hueSlider" onchange="updateImage()">
        <br>
        <label for="saturationSlider">Saturation:</label>
        <input type="range" min="0" max="200" value="100" id="saturationSlider" onchange="updateImage()">
        <br>
        <button onclick="saveChanges()">Save Changes</button>
        <br>
        <img id="uploadedImage" src="#" alt="Uploaded Image">
    </div>

    <script>
        var originalImageSrc;

        function updateImage() {
            var img = document.getElementById('uploadedImage');
            var size = document.getElementById('sizeSlider').value;
            var rotation = document.getElementById('rotateSlider').value;
            var hue = document.getElementById('hueSlider').value;
            var saturation = document.getElementById('saturationSlider').value;

            var canvas = document.createElement('canvas');
            var ctx = canvas.getContext('2d');
            canvas.width = img.width * size;
            canvas.height = img.height * size;

            ctx.filter = `hue-rotate(${hue}deg) saturate(${saturation}%)`;
            ctx.translate(canvas.width / 2, canvas.height / 2);
            ctx.rotate(rotation * Math.PI / 180);
            ctx.translate(-canvas.width / 2, -canvas.height / 2);
            ctx.drawImage(img, 0, 0, canvas.width, canvas.height);

            img.src = canvas.toDataURL();
        }

        function saveChanges() {
            var img = document.getElementById('uploadedImage');
            var a = document.createElement('a');
            a.href = img.src;
            a.download = 'edited-image.png';
            a.click();
        }

        document.getElementById('uploadInput').addEventListener('change', function (e) {
            var file = e.target.files[0];
            var reader = new FileReader();

            reader.onload = function (event) {
                var img = document.getElementById('uploadedImage');
                img.onload = function () {
                    URL.revokeObjectURL(img.src);  // Release the object URL
                }
                img.src = event.target.result;
                originalImageSrc = event.target.result;
            }
            reader.readAsDataURL(file);
        });
    </script>
</body>
</html>
#

lets never make code with chatgpt

wary dirge
#

how do i mak e a plugin

oblique lark
#

you writ e cod e in a plugin fil e and then compil e it

wary dirge
#

wow

jagged matrix
#

what? they gave you your answer

sick gale
#

does enyone know where the plugins directory is located in windows?

jagged briar
#

Vns

shrewd tundraBOT
sick gale
#

thanks

tribal osprey
#

no vencord for mobile?

jagged briar
#

Vns

shrewd tundraBOT
versed osprey
#

when ever i try to use this im getting an error with a red underline under "timestamp" any and all help appreciated

<Timestamp timestamp={moment(currentUser.plays.at(-1))} />
vast karma
#

Timestamps don't use moment anymore, just plain js dates

versed osprey
#

so how should i use it then?

vast karma
#

Give it a js Date object

versed osprey
#

ok ty

vast karma
#

There shouldn't be any cases where changing let{message:a}=e to let _props={message:a}=e should cause crashes, right?

dull magnet
#

is that even valid

vast karma
#

Pretty sure

#

Works in devtools at least

dull magnet
#

cursed

vast karma
#

Guess I'll try { match: /(\i)=>\{/, replace: "$&let _props=$1;" } instead

#

As in, e=>{ into e=>{let _props=e;

#

But I genuinely can't figure out why the previous patch doesn't work

dull magnet
#

why can you not use e? is it being shadowed?

vast karma
#

I don't like hardcoding variable names

dull magnet
#

not hardcode

#

capture

vast karma
#

Yeah but my patch is much later in the function

noble coral
#

is flux is wrapper for the discord builtin event handler?

vast karma
#

What do you mean?

#

Flux is discord's event dispatcher

dull magnet
vast karma
dull magnet
#

well find the nearest use of e and capture it with a lookahead/behind

noble coral
#

cuz if is, I should review myself

vast karma
#

The nearest (and only) use is 332 bytes before, which imo is a bit too big for a patch

#

So I'm gonna stick with declaring an alias

proud parrotBOT
dull magnet
#

look at that lookbehind at the end

vast karma
#

That's a pretty cool way of doing it, ngl

dull magnet
#

it first matches the normal match, then walks back until it finds {channel:\i,message:\i}=(\i) , then captures the the last one. finally it walks forward up to 400 characters again no matter what they are (just to still match)

#

it's a really cool way to do it yeah

vast karma
#

Currently I have ```js
{
find: "Messages.FORUM_POST_AUTHOR_A11Y_LABEL",
replacement: [
{
match: /(\i)=>{/,
replace: "$&let _props1=$1,_props2;"
},
{
match: /(0,\i.useForumPostAuthor)/,
replace: "_props2=$&"
},
{
match: /children:(\i)/,
replace: "children:$self.wrap({..._props1,..._props2},$1)"
},
]
},

#

Which is admittedly a bit hacky but it works fine

dull magnet
#

that's incredibly dangerous

#

if your first replacement fails, but the others still succeed, they will refer to undefined variables and crash discord

vast karma
#

That's true, but don't patch groups make sure all of them need to happen?

dull magnet
#

yes

vast karma
#

(But yes, discord did crash several times)

dull magnet
#

but you don't seem to use them

vast karma
#

Isn't the replacement: [] a patch group?

dull magnet
#

no

#

you need to set group: true

vast karma
#

Oh

dull magnet
#

for it to group them

vast karma
#

Good to know

#

So I guess without that it's just shorthand for several independent patches

dull magnet
#

usually it's desired to have as many patches as possible still working even if one breaks

#

since most of the time they don't rely on each other so only minor functionality will break

#

so it's opt in

dull magnet
vast karma
#

I'll try to rewrite it then

#

Thanks for the advice

dull magnet
#

if you use the lazy operator it will find the nearest match

#

otherwise it will find the match furthest away which is obviously undesired

vast karma
#

How about ```js
{
find: "Messages.FORUM_POST_AUTHOR_A11Y_LABEL",
replacement: {
match: /children:(\i)(?<=}=(\i),{(user:\i,author:\i)}.{0,350}?)/,
replace: "children:$self.wrap({...$2,$3},$1)"
}
}

cedar olive
#

I recommend making the actual match more specific

#

children:\i is too generic

#

then instead of {0,350}? you just do .+?

vast karma
#

That's true, the actual thing being matched is (n.Fragment,{children:S}) so matching that should be pretty easy

#

(Don't ask why they have a Fragment with only one child)

cedar olive
#

show the code before it

#

like the 30 or more lines before it

vast karma
#
function (e, t, s) {
  "use strict";
  s.r(t),
    s.d(t, {
      default: function () {
        return c;
      },
    });
  var n = s("37983");
  s("884691");
  var a = s("414456"),
    l = s.n(a),
    i = s("77078"),
    r = s("232259"),
    u = s("680986"),
    o = s("782340"),
    d = s("159177"),
    c = (e) => {
      var t, s;
      let { message: a, channel: c, renderColon: h, hasUnreads: f } = e,
        { user: m, author: g } = (0, u.useForumPostAuthor)(c),
        S =
          null !==
            (s =
              null !== (t = null == g ? void 0 : g.nick) && void 0 !== t
                ? t
                : null == m
                ? void 0
                : m.username) && void 0 !== s
            ? s
            : "",
        p = (0, r.useUsernameHook)(
          null == a ? void 0 : a.author,
          c.id,
          c.guild_id,
          !0,
          o.default.Messages.FORUM_POST_AUTHOR_A11Y_LABEL.format({ name: S }),
        )(null != g ? g : void 0)(
          (0, n.jsx)(n.Fragment, { children: S }),
          c.id,
        );
      return (0, n.jsxs)(i.Text, {
        tag: "span",
        className: l(d.author, { [d.hasUnreads]: f }),
        variant: "text-sm/semibold",
        children: [p, !0 === h ? ": " : null],
      });
    };
}
cedar olive
#

you can likely match a class name or a Messages.SOMETHING then do.+? to reach your children

vast karma
#

That's the whole module, it's pretty small

cedar olive
#

ok yeah use that Messages

#

Messages.SOMETHING.+?children:(\i)

#

then normally how you are already doing

vast karma
#

Something like js { find: "Messages.FORUM_POST_AUTHOR_A11Y_LABEL", replacement: { match: /(?<=\}=(\i),\{(user:\i,author:\i)\}=\(0,\i\.useForumPostAuthor\).{0,400}?\(\i\.Fragment,{children:)\i(?=}\),)/, replace: "$self.wrap({...$1,$2},$&)" } } then

cedar olive
#

nono

#
{
    find: "Messages.FORUM_POST_AUTHOR_A11Y_LABEL",
    replacement: {
        match: /(Messages\.FORUM_POST_AUTHOR_A11Y_LABEL.+?children:)(\i)(?<=}=(\i),{(user:\i,author:\i)}.+?)/,
        replace: "$1$self.wrap({...$3,$4},$2)"
    }
} 
#

wait 1 sec

#

okay like that

vast karma
#

Why would that be better?

cedar olive
#

it's trying to match less stuff

#

if you use only children as the first match it will try the look behind on every children it finds

#

this one it only tries the look behind on the children after Messages.the thing

vast karma
#

I changed it to look for \(\i\.Fragment,{children: though

cedar olive
#

yes but that is generic too

#

it's a bit of bias from me but thats generally how I write my matches

vast karma
#

The module is tiny, I don't see the point tbh

cedar olive
#

and they tend to be very stable

small trail
#

would trying to remove spam warning be unwise

north flame
#

Does anybody know how receiveMessage works?

pure temple
small trail
#

no

#

for like

#

OKAY WHY IS MY CLIENT SO FUCKING LAGGY

noble sun
pure temple
#

i really love spam
what are you trying to say?

vast karma
small trail
#

for the use, as in if theyre spamming messages and discords like "nuh uh"

#

user*

north flame
vast karma
#

Pretty sure that's in the rest api docs

pure temple
north flame
small trail
#

makes sense

pure temple
#

why do you need to send messages that fast

north flame
pure temple
#

I remember doing it to "test" a Discord bot (which wasn't mine, on a public server with thousands of members) :3
I would not recommend it as you risk the staff getting mad

flint bronze
#

what is even being made in here today

noble sun
#

Hey, is there a way to listen to messages received on discord ?

vast karma
north flame
floral plaza
noble sun
floral plaza
#

there's probably a plugin in vc that does it so i would search the github

noble sun
#

Yup, I'll use that thanks mate ;)

flint bronze
#

?

north flame
#

forgot it did that lmao

north flame
#

How would I do a patch for when the user receives a DM?

balmy sky
#

It might be easier to use flux events depending on your use case

north flame
balmy sky
north flame
#

parse and do other things (like send a reply for example)

#

I've not used patches before.

north flame
balmy sky
#

Look at vcnarrator for a good flux example

north flame
#

ty

north flame
#

That's working, but my script to send messages seems to be bugged ```js
await MessageActions.receiveMessage(groupChannel, await createMessage(message.content, sender.id, groupChannel, 0));
async function createMessage(message: string, senderId: string, channelId: string, type: number) {
const sender = await UserUtils.getUser(senderId).catch(() => null);
if (!sender) return;
return {
content: message,
author: sender,
channel_id: channelId,
timestamp: new Date().toISOString(),
type,
};
}

#

createmessage definitely returns the correct object

#

but receiveMessage is not sending any content

#

It just looks like this

balmy sky
#

If you want to listen for a message, do

    flux: 
    {
        MESSAGE_CREATE(props)
        {
            //whatever
        }
    }

in your plugin definition

north flame
#

the listening is fine

#

and receiveMessage was working earlier, but it's not sending the content anymore

north flame
#

for anybody wondering, it turns out the object didn't have enough data, here's the fix: js async function createMessage(message: string, senderId: string, channelId: string, type: number) { const messageStart = MessageCreator.createBotMessage({ channelId, content: "", embeds: [] }); const sender = await UserUtils.getUser(senderId).catch(() => null); if (!sender) return; return { ...messageStart, content: message, author: sender, type, flags: 0 }; }

north flame
#

How do I read the contents of message.attachments[0]?

noble coral
#

there could be a flux event which dispatch the fetched content

#

but only if the user was loading the content other than that you must load it yourself

balmy sky
north flame
candid pivot
junior cove
candid pivot
dull magnet
#

oh you want to send a bot message nvm

#

anyway you're asking too many questions and it sounds like xy problem

#

what's your mission

rocky jackal
#

Can someone help me, I can't get autocomplete to work on vscode

dull magnet
#

for?

rocky jackal
#

vencord

dull magnet
#

make sure u installed deps

rocky jackal
#

I did

#

and the extensions

rocky jackal
#

could it have something to do with how symlinks work in linux?

dull magnet
#

make sure u use pnpm nor npm

#

otherwise ignore

rocky jackal
#

so

#

turns out

#

it was codium's fault

#

the flatpak version's autocomplete worked fine

#

but not in the official binary

flint bronze
#

wtf flatpak solving things?

rocky jackal
#

And I didn't want to use flatpak because it was doing a weird thing with bash and sh

#

and bashrc wasn't being loaded

flint bronze
#

wtf flatpak breaking things!?!??!

rocky jackal
#

but I added a terminal profile that ran host-spawn bash

#

and that fixed it

flint bronze
#

interesting

rocky jackal
#

also, what is that args parameter that navigation router's transitionTo has?

flint bronze
#

It's 3 arguments

#
        function S(e, t, n, a) {
            !_(e, "assign") && (d.log("transitionTo - Transitioning to ".concat(e)),
            null != n && (null == t ? t = {
                source: n
            } : t.source = n),
            null == t ? i.push(e) : i.push({
                pathname: e,
                ...t
            }),
            r = n,
            s = a)
        }
junior cove
north flame
#

I needed a way to show messages in the chat on clientside, and I wanted them to look as normal as possible

#

(I've since found my solution)

hard plover
dull magnet
#

just make a js snippet

#

doesn't really warrant being a plugin

small trail
#

how would i like

#

zoom the emote menu in

vast karma
#

Drag the left edge

small trail
#

OH MY GOD

#

THIS WAS ALREADY IN DISCORD

#

I DONT HAVE TO BE BLIND ANYMORE

#

ITS STILL TOO SMALL NVM

#

I CANT SEE DETAILS

#

FUCK

#

my tv is ol'd the pixels are big

flint bronze
#

you cant drag the top though

vast karma
#

If you want it even bigger that's gonna take some work; that menu's layouting is rather complex

balmy sky
vast karma
#

Maybe you can try redefining EmojiSize.MEDIUM or something similar? Pretty sure I saw a set of named constants for that

acoustic yew
#

mow

flint bronze
frosty otter
#

is there a way to modify the "Discord is Starting" Window, because Vencord only starts after the main window opens.

flint bronze
#

Not sure but you could try modifying Vesktop

frosty otter
#

?

north flame
#

Can you create listeners for a message button component?

#

How can I execute a function when the user clicks a button component sent in a message

versed osprey
#

is there a way to look at msg contents of all loaded msgs on screen?

vast karma
#

That "on screen" part suddenly makes it quite a bit harder

versed osprey
#

lol

#

i just want to check if msgs that are on screen have something in them and then edit them locally

vast karma
#
Vencord.Webpack.findByProps("_channelMessages").get(Vencord.Webpack.Common.SelectedChannelStore.getChannelId()).toArray()
#

Gets those in the current channel rather than the ones physically on the screen, because that's way easier

versed osprey
vast karma
#

Add a .slice(-50) I guess

versed osprey
green vessel
#

how can i post in third party plugins?

flint bronze
versed osprey
#

is there a react import for vencord?

#

i wanna use this from repluged but it needs a react import

function ToneIndicator(props: ToneIndicatorProps): React.ReactElement {
  return (
    <Tooltip text={props.desc}>
      <span
        {...props}
        style={{
          backgroundColor: "var(--background-modifier-accent)",
          borderRadius: 3,
          padding: "0 2px",
        }}>
        /{props.indicator}
      </span>
    </Tooltip>
  );
}
#
React.ReactElement
vast karma
#

Return type annotations aren't usually necessary, but you can do import type { ReactElement } from "react"; I guess

versed osprey
#

ty

#

funny error after doing the tooltip import woooo

vast karma
#

That's not how you use Tooltip

#

Check how everything uses it

versed osprey
#

okie

vast karma
#

Which is likely what the error tells you

versed osprey
#

no more error just added {({ onMouseEnter, onMouseLeave }) => (

versed osprey
#

i cant convert this 1 to work proparly

vast karma
#

What do you mean, a specific part?

#

It'll show the tooltip on the part you wrap in <Tooltip>

versed osprey
vast karma
#

Thanks, that clarifies a lot

versed osprey
#

just like "text text text textwithtolltip text text"

vast karma
#

The tooltip will be on the part you put the tooltip on

#

No more, no less

versed osprey
#

just add it localy to a msg that has a spesific string in it

versed osprey
vast karma
#

I have no idea what you're trying to say

versed osprey
vast karma
#

If you're making a plugin, you should probably be patching the renderer rather than editing stuff in stores

versed osprey
#

ok ya

#

ty

trail talon
#

Could someone help me, I'm trying to replace the text content of a message with my own component (so I can add additional things).

north flame
trail talon
#

It doesn't modify the content itself other then adding @silent

#

when the msg gets sent

jagged matrix
#

i cant stress over this enough

#

if you use github (doubt you dont) or code websites, i cant recommend this enough

remote kestrel
#

@jagged matrix

jagged matrix
#

hi

muted shoal
#

guess what i added in Vesktop

#

shiggy is dead

jagged matrix
#

i hate you

muted shoal
jagged matrix
#

shiggy is acceptable for the public eyes

muted shoal
#

nu huh

jagged matrix
#

shiggy is very acceptable for the public

vast karma
#

Shiggy must be used in public

jagged matrix
#

agreed

#

make everyone look at shiggy

muted shoal
jagged matrix
#

probably won’t be added

muted shoal
#

its a toggle tho

#

you can see shiggy if you want

jagged briar
#

Will definitely get closed

slow charm
#

would be added

grim hare
#

cleaning up my disk
wonder why there's a 2 GB file in my projects directory
it's my asm solution for aoc day 2 where I embedded a huge input directly into the file

green vessel
#

hi, uh random question. how do i show the small profile modal/popup ?

green vessel
balmy sky
#

Yapping

frigid bay
#

wtf

north flame
#

W error
<?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Details>No such object: discord/attachments/1120215838952280085/1211917909228523570/file.text</Details></Error... (NaN KB left)

north flame
#

Is it possible to execute a function when a user clicks a button sent by themselves (using the MessageActions.receiveMessage function)

#

like interaction listeners in DJS

glass oracle
#

look at what happens in the network tab when you click the button
go to initiator and visit each to find what you're looking for

green vessel
#

Helo

#

is there any1 here who is expert in doing this discord things and all

#

if yes plss dm

#

me

craggy tangle
#

could u send me the solution? id be interested in that, asm is cool

quaint cipher
#

hey you know when you join a discord server and it tells you to visit a channel?
does anyone know the store where those are saved and whether i could reset the state so it wants me to visit them again?

dull magnet
#

try these stores

#

findStore("GuildOnboardingStore").resetOnboardingStatus(guildId) maybe

grim hare
frosty otter
#

is the "Discord is Loading" window also made electron?

north flame
#

And also, what’s discord?

frosty otter
#

I want to modify it

#

the CSS

north flame
frosty otter
#

I mean this window

north flame
#

Yeah

frosty otter
#

loading tips is for the one in the main window

#

also I dont want to change the tips, but the css

vast karma
#

I think you'd have to edit vesktop or - dog forbid - the native client for that

frosty otter
vast karma
#

Good luck with that

frosty otter
#

just to select canary stable or PTB

north flame
#

It’s kinda interesting how the invisible chat plugin works

#

It just uses invisible Unicode to send the data

vast karma
#

That's the obvious way to do it

#

You could do it with an invisible masked link too, which would be more compact, but some guilds forbid those I think

north flame
north flame
frosty otter
dull magnet
#

why tho

north flame
#

Fr

dull magnet
#

you can already do that in your web browser

#

or by downloading the canary app or by using vesktop or armcord or whatever else floats your boat

frosty otter
#

I know

north flame
#

You just want to overcomplicate it?

frosty otter
#

no

#

wanna make nice UI

#

so I don't have 3 discord icons in my taskbar

north flame
#

You don’t have to pin them all, just use the windows search system

vast karma
#

What are those three anyway? I'd guess one of them is what's conventionally called nightly, but dunno

north flame
vast karma
#

How often do you switch between them that you need to optimize out those seconds

frosty otter
#

don't need to optimize them, but I want to have a good UX

vast karma
#

Totally a worthwhile investment of time

frosty otter
languid moat
#

i am making discord desktop app on tauri too but it is missing some features of electron but if you want to run discord desktop app on some very shitty school laptop like i does then it is worth it

#

my school laptop has a fucking 1.1ghz cpu and 4 gigs of ram

glass oracle
#

and development > canary > ptb > stable for desktop client

cedar olive
#

wtf

#

development is still used?

#

I thought it didnt even work anymore

glass oracle
#

i use development

#

still works

#

and gets updates

cedar olive
#

the electron version is bumped on it

#

I suppose development version only differs in updates not related to the renderer part of discord

#

because it just uses canary in that

glass oracle
#

it uses the canary webapp yes
the only difference is native modules

cedar olive
#

yep

grave barn
#

hello

#

i just started using vencord

#

and was wonding how i can add custom plugins

jagged briar
#

Vns

shrewd tundraBOT
grave barn
junior cove
#

It's not. You're asking about how to use Vencord. It belongs in support, or ideally, read the docs

frosty otter
#

like all the pings

frosty otter
#

are there plans for the FakeNitro Plugin to support Nitro Emojis in user bio?

balmy sky
#

We can't mod the discord servers/api, some things you just can't do

frosty otter
#

should be possible, cause fakeProfile themes modifies the bio too

#

but the emojis must be in a different pattern than the normal ones

balmy sky
#

Well yes, it's possible to make a fake bio emoji that's only visible to users with a plugin

#

But there's not much point in that

frosty otter
flint bronze
pure temple
#

you could probably automatically replace links the same way as in messages

frosty otter
amber plover
#

Is there a SelectComponent that allows you to type in it to filter the available options?

vast karma
#

The experiments menu in the settings cog's right click comes to mind, but I guess that's not really a Select

amber plover
#

yeah i was thinking about building something similar myself if i can't find an existing component that does that

dull magnet
#

discord has it

#

i don't remember where they use it but yes

vast karma
#

Here it is

amber plover
#

oh damn, right

#

yeah, that's what i meant

vast karma
#

Conveniently available as Common.Forms.SearchableSelect

dull magnet
#

don't use that

amber plover
#

oh :( why not?

dull magnet
vast karma
#

Oh, it's at Common.SearchableSelect too

dull magnet
#

Common.Forms is the entire components module for simplicity but you're not supposed to use it for anything other than forms

#

aka what's typed

#

everything else is also exported outside of forms

amber plover
dull magnet
#

yes

amber plover
#

thanks guys, i appreciate it!

vast karma
#

Why is it structured that way? Why not just call that module Components or something?

dull magnet
#

wdym

vast karma
#

Why is that module only to be used for forms, even though it's the entire components library?

versed osprey
#

if i wanna pr somthing how do i do it without removing my old pr cuz its not letting me get another fork of vencord on my github account?

vast karma
#

Make a separate branch on your fork

versed osprey
#

wdym?

balmy sky
#

On your fork repo, press the branch, then view all branches

#

Then you can make a new branch

versed osprey
#

ya got it after talking to my rubber duck but ty

balmy sky
#

Rubber ducking is so goated

versed osprey
#

fr

#

you wanna see the plugin me ethan and fres made?

balmy sky
#

Is it the uhhhhhhh

vast karma
#

Who are ethan and fres

balmy sky
#

Tone tags

#

Thingy

versed osprey
balmy sky
#

I guessed because you were asking about tooltips lmao

#

Sure

vast karma
#

From what I can tell, out of the 236 things currently in Forms, 19 are exported

dull magnet
#

everything relevant.

#

if you need anything else, export it properly

vast karma
#

You're probably gonna hate me for doing ```ts
const { FocusLock } = proxyLazy(() => Forms as any as {
FocusLock: ComponentType<PropsWithChildren<{
containerRef: RefObject<HTMLElement>
}>>,
});

#

I'd of course put it in the proper place if I PR it, but as long as it's third party I think this is fine

dull magnet
#

????

#

dont do that

dull magnet
#

how do i get this to be the type of the subclass

#

so in ```ts
class MyClass extends FluxStore {
}

new MyClass(Dispatcher, {
THING() {
this // should be typed as MyClass
}
})

#

is this the only way?

class MyClass extends FluxStore {
}

new MyClass(Dispatcher, {
  THING(this: MyClass) {
    this // should be typed as MyClass
  }
})
#

mmmm looks like its just not possible with constructors

#

its possible with normal methods but not constructor

vast karma
#

Pretty sure in c++ the common solution is the equivalent of class MyClass extends FluxStore<MyClass>

#

Dunno about TS

dull magnet
#

that indeed works but its kinda ugly

dull magnet
vast karma
#

How do you deal with errors in discord-types? Just as any?

lean acorn
#

hi, I'm trying to make a discord soundcloud rich presence but I don't know if directly send requests or use an external website (that i will make, external to soundcloud) to send the requests and all that, I don't even know what I was thinking for, First time using tsx

#

because in the soundcloud api guide says you can to put a button to connect and disconnect

jagged briar
vast karma
#

Yeah I've tried ts declare module "discord-types/general" { interface Message { timestamp: Date; editedTimestamp: Date; } } but it says Subsequent property declarations must have the same type. Property 'timestamp' must be of type 'Moment', but here has type 'Date'.

jagged briar
#

I meant just making a new interface that intersects the old one

jagged briar
#

no

north flame
#

is it possible to change the state of a ChatBarButton outside of it's codeblock?

vast karma
#

In general react components can't be controlled from outside, other than by passing props to it

north flame
dull magnet
#

you absolute can, just make your state global

#

or use vencord settings api

vast karma
#

Yeah connecting to some suitable store works too

dull magnet
#

or discord FluxStore

north flame
dull magnet
#

wdym

vast karma
#

You can just do settings.store.key = true

dull magnet
#

users settings?

north flame
#

for the plugin, like "how many moai to append to every message"

#

(I'd assume settings is way more private than the datastore, because RSA keys should be private)

north flame
dull magnet
#

but also depends on what you define as private

north flame
#

like other plugins can do datastore.privatekey

dull magnet
#

why do you care

#

there is no risk of malicious plugins

#

well unless you add them explicitly

north flame
#

I guess

dull magnet
vast karma
dull magnet
#

they're all running in the same scope

north flame
vast karma
#

Why do you intend to run malicious code in your discord

#

Sounds like a bad idea imo

north flame
#

I could just define a variable in the script ig

vast karma
#

If you don't have malicious code, what's the problem

north flame
#

creating problems for myself shrug

vast karma
#

A good hobby for sure

north flame
#

fr

fathom carbon
#
window.open(https://youtu.be/dQw4w9WgXcQ?si=uCYxTSXINLlzSrDq)
jagged briar
fathom carbon
jagged briar
#

it did not make my vencord experience 10x better

#

you are spreading dangerous misinformation

frigid bay
fathom carbon
north flame
fathom carbon
#

im gonna fucking find you 😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂

north flame
#

I’m gone

#

Womp womp

stable ridge
mossy cedar
#

how would i add a button here? my current method is to patch the props list to add a button, but it ends up adding it to every tablist. any ideas? ive tried the unique function that renders this list, but react tools always ends up giving the general/non unique tablist.

#

(example of another tablist)

vast karma
#

Isn't there a list that's passed to the tablist component?

mossy cedar
#

i was trying to find it 😭

green vessel
#

Uwu

mossy cedar
#

i think im stupid cause I tried for an hour searching react devtools and control f ing

green vessel
#

censured

balmy sky
green vessel
#

What

balmy sky
#

Don't worry

#

💀

mossy cedar
#

the view source button only points me to the right source after the 2nd click

balmy sky
#

Huh

#

Weird

mossy cedar
#

yeah idk prob a bug

north flame
vast karma
#

React devtools is just empty for me

#

Do you need to do something on the discord side to enable it?

frosty otter
#

should work just fine with that

ruby kettle
#

What does canary do

vast karma
#

Damage buff against devs, mostly

glossy steppe
#

howdy all. is there plugin development docs somewhere around? should I just be looking at the source of other plugins to see how things are done?

i have been thinking about building a mod to help with language learners, like including translation functions right inside discord. has anyone already worked on that?

vast karma
#

You mean like the builtin translation plugin?

glossy steppe
#

Ah sorry, I was browsing the website, my bad yeah. Thanks though 🙏

#

No idea how I missed the translation plugin, I was just there! 🤦

north flame
#

is Discord suddenly enforcing cors differently?

#

I'm on stable...

dull magnet
#

link expired maybe?

north flame
dull magnet
#

if the link is expired they send an error response

#

error responses dont set cors

north flame
#

this started happening just now, same system as an hour ago

dull magnet
#

send link

flint bronze
# north flame I'm on stable...

CORS is enforced based on what accesses the resource afaik
The CORS probably allows images and videos directly embedded to be accessed, but not to be fetched

#

i dont think that is the case though brainBasket

north flame
#

I accidentally did response.json() instead of response.text()

glass oracle
#

horror

#

dont

#

you need response.blob()

flint bronze
versed osprey
green vessel
#

Help pls i wont limme delete the file

fathom carbon
#

which file

green vessel
#

Nvm

flint bronze
#

mods, lobotomise this user

hushed bloomBOT
versed osprey
#

if all my settings for a plugin are bool is there a quick way to check if all are disabled?

vast karma
#

Something like Object.values(settings.store).every(a=>a) maybe, but don't do that

#

Love that js uses .every and .some instead of .all and .any like every other language

acoustic yew
#

Object.values(settings).every(value => value === false);

#

or value => !value lol

limpid oar
#

this channel makes me not wanna learn js

#

every time i try to it scares me off

acoustic yew
#

js is very fun

vast karma
#

Js sure is a language

#

One of the languages of all time, even

oblique lark
#
const settings = Object.values(settings.store);
for (const value in settings) {
  if (value !== false) {
    return false;
  }
}
return true;

it's that simple

vast karma
#

Sorry but no it is not

#

Because neither 0, 1, 2, 3, or 4 is === true

oblique lark
#

fixed

vast karma
#

That also won't particularly work

#

Also if I'm not mistaken it'll even be "0", "1", "2", not 0, 1, 2

#

(for..in is a piece of shit)

oblique lark
#

js moment

#

i should be using for...of right

vast karma
oblique lark
#

wait better idea: reduce and check if the sum is equal to zero

#

no downsides whatsoever

vast karma
#

Flawless

swift delta
cosmic coral
#

?

cedar marsh
north moss
#

Is this channel an alright place to ask a question about Vencord stuff? I'm trying to make a plugin but I don't have access to any of the channels in the "Nerd Corner"

flint bronze
#

I've asked about Vencord plugin development here before

#

also, don't ask to ask
if it's suited better in another channel someone will tell you

flint bronze
vast karma
north moss
#

At the moment, I'm working to add a button to this menu

#

The easiest but probably least clean way to do it is to loop until the right div is present and then push the HTML content (since the HTML for the menu loads and unloads constantly)

#

I'm wondering if Vencord possesses a better way to do such a thing

flint bronze
balmy sky
#

Patch the component

#

Dom manip is inefficient and there are way better ways to do it

north moss
#

I'm assuming its somewhere in the sources tab in the inspector

#

But I don't where I should navigate to find the html files

balmy sky
#

There are no html files

balmy sky
#

Discord is made with react

#

Open devtools and navigate to the react component viewer

#

From there you can eyedrop components and view the functions for them

flint bronze
north moss
flint bronze
#

React is a blessing and a curse

Blessing as it's easier
Curse as it's React and bloat bloat bloat bloated app