#🧩-plugin-development

1 messages · Page 9 of 1

cursive plank
#

might be because im inserting a snippet

#

might be bc im saving the settings

#

either way it feels slow

dull magnet
#

if you're inserting a stylesheet that's why

cursive plank
#

great

#

👏

#

wanna see the plugin so far? (in a screenshare)

dull magnet
#

I'm on phone rn tonguecat

#

send video

cursive plank
#

ugh

#

ok

eternal lion
#

that says it was deleted

cursive plank
cursive plank
#

jk

eternal lion
opal fern
muted thunder
#

How can i get user id when i click on their profile?

cursive plank
wind jay
#

also, right click is cool

muted thunder
#

i meant with the userstore

eternal lion
#

nice i made it so the webview is gray when loading

#

now i just need to make it gray when the app is loading

ember hatch
#

guys is there any guide of how plugins work? like a how to make a hello world plugin

dull magnet
#

yes

opal fern
#

yes

ember hatch
#

where?

austere gulch
#

on our github

#

in the readme

ember hatch
#

oh true the megumin guide

muted thunder
#

Ok How can i get the user id with UserStore when i click someone profile?

muted thunder
#

yeah your not getting me

cursive plank
#

@muted thunder you get the wrong answers bc you asked the wrong question

#

the user store has nothing to do with the UI

#

it doesnt depend on it

#

you included the UI in your question

#

so you get UI answers

jagged dune
#

Extract

#

inate

cursive plank
#

devilbro?

#

ayo

jagged dune
#

devil bro

cursive plank
#

do you want code to execute whenever you click on someone's profile?

#

what do you exactly want to do?

cursive plank
muted thunder
#

i want to give me the user id so i could use it for a api

cursive plank
#

that gave me zero new information

#

do you even know what you want to do?
lets start with that

#

can you break down the thing you want to do into small steps?

#

set some small objectives

#

you wont achieve anything if you dont do that

#

so you want to get the user ID, to use it on an API
possibly an API that has info about that user i would assume

#

what will you do with that data?
will it be displayed to the user?

#

if so, a command might suffice

muted thunder
#

Ok firstly i want to do add Global Badges to vencord

im using my api for this https://api.obamabot.me/v2/text/badges?user=

When i click a user profile it should automatically fetch the user badges and add the corresponding badges to set user

cursive plank
#

great

#

this is a great step

#

so what you want, is to make a patch

#

I'll help ya a bit and look into it

muted thunder
proud parrotBOT
cursive plank
#

yes yes, looks like there is already an API for that

#

first step is import { addBadge } from "@api/Badges"

#

if you look into it, there is a shouldShow callback

#

that is where you get the user ID

#

(you should cache the badges ofc)

#

if you are lost, this is the basic code

#

i wont do much more to not steal the joy of making a plugin

#

good luck!

muted thunder
#

this is actually much simpler than i though wow

#

thanks

cursive plank
cursive plank
#

cause the code i sent is only for one badge

#

dunno what the API you use for the badges is

muted thunder
#

is quite simplier
but i think i might need to change the code on the api side

#

this is how the data look

cursive plank
#

hoh

#

those are roles, not badges
unless you are talking about the goosemod stuff

muted thunder
#

all of that are badges

#

roles is a place holder i had but never changed it

#

Aliu = Aliucord

cursive plank
#

oh well

#

gl

jagged dune
chrome folio
#

it hurts that the api uses like 3 different styles of displaying badges

#
  • string array
  • boolean
  • objects with booleans
muted thunder
#

im definitely going to improve

#

it

#

because is ugly and bad pratice

muted thunder
#

this looks way more cleaner now

chrome folio
#

bd is uppercase and not an object

green vessel
#

what even is bd's badge

muted thunder
#

funny thing

#

is that only 2 people have it

green vessel
#

guh?

eternal lion
muted thunder
#

Enmity badges are cursed need to make it better but this so far what ive gotten

muted thunder
dull magnet
#

add vencord badges when

muted thunder
rigid coral
#

How can i get a store when i need to get it when its available and i cant use lazy?

trail ginkgo
#

why cant u use lazy curious

rigid coral
#

because it is undefined

trail ginkgo
#

the lazy methods basically make a dummy object

#

and it only finds the value when u do something to it

#

like call it, access a property, etc

trail ginkgo
#

and going val._isInitialized

rigid coral
#

returns true even when it isnt cached

south ridge
#

How to use a react.createElement in openModal()

trail ginkgo
#

its only cached for that proxy instance

trail ginkgo
south ridge
#

My bad, openModal

#

It opens modal

trail ginkgo
#

oo

#

i think u can just use jsx/tsx syntax

#

without importing anything

#

the jsx factory is set to a global in the build options iirc

south ridge
trail ginkgo
#

u can use a function component

south ridge
#

Doesn't look dynamic to me

#

As in, I tried. There is no forceupdate

trail ginkgo
#

theres a forceupdate hook in utils somewhere

#

its probably best to use states appropriately

#

i can write an example if ur trying to get the hang of it

south ridge
#

That'd be nice :)

trail ginkgo
#

whats ur like situation

#

like whats dynamic in ur situation*

south ridge
proud parrotBOT
trail ginkgo
#

ah i see

south ridge
#

The variable changes correctly, but it doesn't update the button

#

Yea

trail ginkgo
#

hold on im looking at where buildEncModal is used

south ridge
#

ChatbarLock.tsx is assets

trail ginkgo
#

nice

#

im gonna write it rq and send a hastebin

south ridge
#

Alright, thank you so much bcaThinkingLove

trail ginkgo
#

sike hastebin is broken

#
import { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
import { Button, React, TextInput } from "@webpack/common";

function EncModal(props: ModalProps) {
    const [secret, setSecret] = React.useState("");
    const [cover, setCover] = React.useState("");
    const [password, setPassword] = React.useState("password");

    const valid = secret && cover && cover.match(/\w \w/);

    return (
        <ModalRoot {...props} size={ModalSize.MEDIUM}>
            <ModalHeader>
                <div style={{ color: "gray", fontSize: "30px" }}>Encrypt Message</div>
            </ModalHeader>
            <ModalContent>
                <div style={{ color: "gray" }}>Secret</div>
                <TextInput
                    onChange={(e: string) => {
                        setSecret(e);
                    }}></TextInput>
                <div style={{ color: "gray" }}>Cover (2 or more Words!!)</div>
                <TextInput
                    onChange={(e: string) => {
                        setCover(e);
                    }}></TextInput>
                <div style={{ color: "gray" }}>Password</div>
                <TextInput
                    defaultValue={"password"}
                    onChange={(e: string) => {
                        setPassword(e);
                    }}></TextInput>
            </ModalContent>
            <ModalFooter>
                <Button
                    onClick={() => {
                        if (!valid) return;

                        const toSend = encrypt(secret, password, cover);
                        if (!toSend) return;

                        webpack.common.messages.sendMessage(
                            webpack.common.channels.getCurrentlySelectedChannelId(),
                            { content: toSend },
                        );
                        props.onClose();
                    }}>
                    Send
                </Button>
                <Button
                    style={{ left: 15, position: "absolute" }}
                    onClick={() => {
                        props.onClose();
                    }}>
                    Cancel
                </Button>
            </ModalFooter>
        </ModalRoot>
    );
}

export function buildEncModal() {
    openModal(props => <EncModal {...props} />);
}
trail ginkgo
#

useState will make the component keep track of a value between renders

#

and returns a [currentValue, valueSetter]

#

and when u set the value it will rerender for u

#

it knows which value is which by the order that hooks like useState is called in the component, so avoid putting hooks like that in if statements

south ridge
#

Ooh

#

Okay got it!

trail ginkgo
#

also the modal props has its own onClose so u can call that to manually close im p sure

south ridge
#

Hmm.. I see

#

Thank you do much ^^ pepelove

trail ginkgo
#

yaa

#

the only errors in that file are gonna be missing encrypt import, and you'll have to do a findLazy for sendMessage and getCurrentlySelectedChannelId prob

south ridge
#

That's fine, I can fix that up :D

trail ginkgo
#

epic

#

pushing the functional component agenda

south ridge
south ridge
#

did i do something wrong?

trail ginkgo
#

no thats a valid FC

#

as long as the React ur using is the same as discord's react

south ridge
#

what version of react is discord using?

trail ginkgo
#

its not the version

#

like it has to be the same instance

#

in runtime

#

and also u have to be initializing the component with createElement or jsx or something

#

which i though this was for vencord but idk how replugged has their jsx factory set up

#

and i really hope they arent bundling react xd

south ridge
#

about that

trail ginkgo
#

literally horror

#

well

#

are they replacing discord's react module at least

south ridge
#

i will fix

trail ginkgo
#

yea you cannot have two runtimes interact with each other

#

although

south ridge
#

i removed react from bundle and plugin not loading anymore

trail ginkgo
south ridge
#

i love

trail ginkgo
#

like ur using one runtime to create the component

#

and another runtime to create the states

south ridge
#

idk how that would work

trail ginkgo
#

i will read replugged source code

south ridge
#

alright

#

wait

trail ginkgo
#

they do not customize the jsx factory

south ridge
#

????

#

why that 16.8 and i have like 18.2

trail ginkgo
#

i think thats for when it was added to react

south ridge
#

oh

trail ginkgo
#

thats when they added hooks

south ridge
trail ginkgo
#

are u doing import React from 'react' in ur imports

south ridge
#

yeah

trail ginkgo
#

the second error

#

ur React is null 💀

south ridge
#

????

#

how the fuck

trail ginkgo
#

this makes me wonder what would happen

#

if u replaced discord's react with react development

#

discord uses 18.2 so theoretically nothing bad should happen

#

other than probably 5x memory usage

south ridge
trail ginkgo
#

and a very slow client

south ridge
#

i will not try that

trail ginkgo
#

wait so this is for a plugin?

south ridge
#

yes

trail ginkgo
#

how is the plugin going to access react if its an asar

#

and replugged doesnt use discords react

south ridge
#

dont tell me, tell that the geniuses at replugged

trail ginkgo
#

zzzzzzzzzzz

#

i will not

south ridge
#

i will screenshot and tell

#

because this is husk

trail ginkgo
#

ok i will ask because middleman is cringe

south ridge
#

okay :D

#

you might get an answer in 4-10 business days

#

but looking at a plugin from one of the main developers, its exactly that

trail ginkgo
#

guh

#

send github

south ridge
#

it builds into renderer crap if it helps you in any way

south ridge
trail ginkgo
#

i love vapcord + vencord = replugged

south ridge
#

vancord

trail ginkgo
#

WHAT THE HELL

#

207KB PLUGIN

#

WHY

#

WHY

south ridge
#

"bundling"

trail ginkgo
#

WHY IS OVER HALF OF IT A SOURCEMAP

#

WHY DOES EACH PLUGIN USE ITS OWN REACT RUNTIME

#

HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR

#

HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR HORROR V

#

AND THEY ARE ALL IN DEVELOPMENT MODE

south ridge
trail ginkgo
#

this is officially a figure it out moment

south ridge
#

but while im at it, i can port what i have to vencord

trail ginkgo
#

thats probably pretty easy

south ridge
#

very easy actually

trail ginkgo
#

you will probably have less code in the end

south ridge
#

i will still push my stuff to window because fuck you

trail ginkgo
#

your pr will not survive

south ridge
#

you love

south ridge
trail ginkgo
#

is that for the patches

south ridge
#

aye

trail ginkgo
#

you will put those values in the definePlugin({ ... })

south ridge
#

husk

trail ginkgo
#

if my pr was merged ur patch could use $self.popoverIcon

#

it is not merged yet though

south ridge
#

aight

trail ginkgo
south ridge
#

guh

solemn star
trail ginkgo
#

xd

solemn star
#

I am already aware of this, and I’m not sure exactly how messing around with types ended up getting React bundled in every damn plugin

#

Fuck it, this takes higher priority to fix than the settings API that I want to gut

south ridge
#

🙏

trail ginkgo
#

and using the jsxFactory option in esbuild

#

and there may be a esbuild module to replace module imports to constants

solemn star
#

Went to do a quick fix on that, and uh, our common modules implementation is so bad 😂

#

Shut up dumb bot

south ridge
solemn star
#

||I think I should have just made this into Fificord and avoided allowing a dev team to partake in design decisions||

#

Ven seems to have figured out how to not be saddled with that

#

I’m kicking myself a bit for not doing the same

#

Anyway, enough of me complaining about the others who work on my mod

south ridge
#

you got this fifi bcaHeadPatts3

solemn star
#

Yayyyy it works

#

No more React bundled in the mod

#

Presumably pushing this should also trickle down to plugins

trail ginkgo
#

doubt

#

you'll need to change the build process on plugins

solemn star
#

React is currently a dependency of the replugged npm package

#

But yeah ig

#

Gotta update the template

#

And finalize where I want to put the React global, if I want it global or whatever

#

Idk it’s 4:30 AM and I should have been in bed hours ago

trail ginkgo
#

for typings

solemn star
#

We have @types/react

trail ginkgo
#

oh then LOL

solemn star
#

Ya

trail ginkgo
#

so plugins will update their replugged dependency

#

and i assume plugin code will do require('react')?

#

either that or esbuild will error

solemn star
#

I believe plugins are supposed to be able to import from common modules or something?

#

Honestly I’m not sure what the plugin dev experience is rn, I’ve gotten used to working within the confines of the mod

trail ginkgo
#

oh when u say trickle down to plugins i thought u meant they wouldnt have to do anything

#

but yea they will def need to change the way they import react

cursive plank
#

Oh

#

It was about replugged

#

Nvm then

trail ginkgo
#

xd

trail ginkgo
#

did you do it

dull magnet
#

and don't turn this server into replugged dev please, stick to replugged server else it becomes confusing KoishiXD

dull magnet
trail ginkgo
dull magnet
#

do you promise me that Vencord will not explode if I merge ur pr @trail ginkgo

trail ginkgo
#

:3

#

i mean yea

#

if \i doesnt show up

#

and $self doesnt show up

#

anywhere else

#

just TEST it

#

turn on EVERY plugin at ONCE

dull magnet
#

I'm lazy to test rn

#

Well I'm on phone

#

I also wonder how the performance impact of it is

#

since you're stringifying and recompiling every regex

#

maybe do it on demand instead of on initial plugin add? as in, only do it once the regex is consumed

cursive plank
#

how would one go about programmatically closing the settings UI?

#

(im talking about the entire settings UI)

cursive plank
#

eh, this works ig
document.querySelector(`[class^="toolsContainer-"] [class^="closeButton-"]`)?.click()

muted thunder
#

if it works then it works

eternal lion
#

alr so its gray now when loading

#

ig i should add some kind of spinner now

#

woohoo did it

#

alr

#

ig i should pr now

#

I also added an applicationIdSuffix of .dbg for the debug buildtype

cursive plank
#

the text input component is misusing the onChange callback

#

it is supposed to be called after the settings are saved

#

not as you are typing

eternal lion
#

my first pr ever :p

#

Why are the screenshots so huge lmao

dull magnet
#

It also adds .dbg as an applicationIdSuffix for the debug build, as it is very useful to be able to have a stable and debug build at once.

#

I love that, thanks

eternal lion
dull magnet
#

could you make this still support light theme?

eternal lion
#

oh

#

yeah

#

uh

dull magnet
#

Use the dark colour when the system is dark theme

eternal lion
#

ok

dull magnet
#

and light colour when the system is light theme

eternal lion
#

time to figure out how to do that :p

dull magnet
#

it shouldn't be too hard

#

just gotta make two themes

potent fox
#

LIGHT THEME SO BAD

#

IT SHOULD BE NEVER SUPPORTED

eternal lion
dull magnet
#

this explains it

eternal lion
#

alr ty

dull magnet
#

(timestamped)

eternal lion
#

i already found a way i think but if it doesnt work will take a look ty

#

nvm

#

yeah will take a look

dull magnet
#

I think just specify values/colors.xml and values-night/colors.xml

#

specify the colours in the respective folder then use the variable in the theme

eternal lion
#

i assume i also need to change @android:style/Theme.Material.Light.NoActionBar to be daynight and not light

#

but maybe not

dull magnet
#

I mean we don't use any ui elements

#

so it shouldn't matter

#

but yeah idk

eternal lion
#

hmm ok

#

let me do that then.

#

alright should be done, let me test

#

alr it works :)

#

gonna push it now

#

@dull magnet done :D

dull magnet
#

why not use discords white?

eternal lion
#

its #FFFFFF

#

i think

#

i used a color picker

#

i dont have one on my phone so i took an ss on my phone and sent it to my pc and did it there

#

but it said #FFFFFF

#

i can try again

dull magnet
#

🤔

#

is it?

eternal lion
#

let me see

#

yeah it is

#

#FFFFFF

#

at least when i set vencord android to light mode its that color

#

ig i could be wrong

#

but every time i tried it was that

#

so idk

#

are you testing?

#

also @dull magnet i may make another pr soon that opens links in the external browser if thats ok

#

bc rn links just open as plaintext html with no way to get back

dull magnet
#

yes

#

that's just an oversight and I haven't gotten around to fixing it

#

so that'd be appreciated

eternal lion
#

alr

#

shouldnt be hard

#

so @dull magnet are you gonna merge my pr?

#

oh nice you did!

compact mesa
austere gulch
#

I think light theme is fine

compact mesa
#

wait a second i want to refresh my memory

#

yeah just as i remember

#

it looks like someone applied a negative filter to discord

#

and called it a day

muted thunder
eternal lion
#

Alr yeah IMA start on that external links thing soon

proud parrotBOT
dull magnet
#

is it that easy lol

simple folio
#

just add check for discord.com authority and you're good

dull magnet
#

hop off webview

#

why do you use one

simple folio
dull magnet
#

ye ik

#

I don't like extension functions tbh

simple folio
dull magnet
#

I prefer functional programming

#

extension functions make code harder to understand

simple folio
#

agree to disagree

dull magnet
#

you will kt ctx.ext.openLink()

simple folio
#

nop

#

actually openLink uses custom tabs

#

well it does now

#

eventually there'll be an option to disable that

eternal lion
#

Oh nice im a contributor and a cool person :p

simple folio
#

@dull magnet contributor role NOW

simple folio
dull magnet
#

got a new cpu, just uninstalled the old one

#

😁

delicate totem
#

NO

#

NO

#

NO

dull magnet
delicate totem
#

PLEASE

dull magnet
potent fox
#

rich

dull magnet
#

I applied too much thermal paste help

potent fox
#

not enough

#

guhh what subreddit is this @dull magnet

granite wharf
granite wharf
potent fox
#

linus tech tips is sane

granite wharf
#

ltt

dull magnet
#

Linus posted that

delicate totem
delicate totem
potent fox
#

horr

delicate totem
#

PLEASE BRO

potent fox
dull magnet
potent fox
#

is this the thing used to prevent nitrogen from damaging motherboard

delicate totem
#

IT'S LINUS INSANE?

#

NO

#

STOP

granite wharf
delicate totem
#

where do you get these bro

granite wharf
#

or dialectic grease

#

forgor which one

delicate totem
dull magnet
#

@delicate totem

delicate totem
#

HOW

granite wharf
delicate totem
#

WHY

#

WTF

granite wharf
#

close

dull magnet
#

need a good heatsink for crazy cpu blobcatcozy

delicate totem
#

no

#

you

#

no

#

stop

#

please

#

I'm begging you

granite wharf
#

Commit of session 2002015650 failed: Failed reading AndroidManifest.xml in java.util.jar.StrictJarFile@1a85f5e0: META-INF/MANIFEST.MF has invalid digest for AndroidManifest.xml in AndroidManifest.xml

#

@dull magnet fix

dull magnet
granite wharf
#

@dull magnet do you know of any other jar/apk signing libs

delicate totem
#

that's such a curse

#

what the fuck

#

I feel like my PC is gonna explode magically

potent fox
#

@dull magnet GUHH SUBREDDIT NOW

delicate totem
#

give

potent fox
#

I think I knew that kind of subreddit

#

but I dont remember

granite wharf
#

NOP

#

explode

delicate totem
#

how

#

wtf

#

how does that happen

#

that HAS to be intentional

potent fox
muted thunder
#

by doing this i get my own id coool

delicate totem
#

wtf do you mean "battery?"

muted thunder
#

I like this

potent fox
#

when batteries fail they get big like that

#

it also happens on phones a lot

dull magnet
dull magnet
modest yacht
muted thunder
#

ok thats alot of people

modest yacht
#

quite safe

#

once its done exploding

delicate totem
dull magnet
#

Google swollen battery

delicate totem
muted thunder
#

hmm

#

do i need to do something when i click someones profile to get there info or something like that?

delicate totem
#

FUCK

dull magnet
delicate totem
#

4 people with older accounts than me in here

#

cringe

dull magnet
#

@delicate totem

delicate totem
#

STOP

#

PLEASE

dull magnet
muted thunder
#

Ive been looking and there no profile modal or close to it exactly

trail ginkgo
#

what is a patch/replacement predicate

#

i didnt notice this earlier

dull magnet
#

whether it should be applied

#

as in js predicate: () => Settings.plugins.MyPlugin.featureEnabled

trail ginkgo
#

ah i see

#

makes sense

#

ok time to test this comit

#

yup these all successfully patched

dull magnet
#

wtf is wrong with ur font

trail ginkgo
#

wdym

dull magnet
#

it looks so squished

trail ginkgo
#

yea it does

dull magnet
#

do u always use that font

#

or did u just squish the image somehow

trail ginkgo
#

no changes

#

oh i zoomed out a lot

#

to get them all

dull magnet
#

lol maybe that's why

trail ginkgo
#

but that should be proportional

#

no zoom

dull magnet
#

ah okay it was the zoom lmao

south ridge
#

ven i love plaintext patches

#

help

proud cargo
#

so true bestie

south ridge
#

cant even use React elements in plaintext patches😔

south ridge
#

shit platform smh

dull magnet
#

you can

#

wtf are u doing

#

show code

south ridge
#
    patches: [
        {
            // Minipopover Lock
            find: ".MESSAGE_TODOS_MARK_AS_DONE",
            replacement: {
                match: /.\?(..)\(\{key:"reply",label:.{1,40},icon:.{1,40},channel:(.{1,3}),message:(.{1,3}),onClick:.{1,5}\}\):null/gm,
                replace: "$&,$3.content.match(Vencord.Plugins.plugins.InvisibleChat.INV_DETECTION)?$1({key:\"decrypt\",label:\"Decrypt Message\",icon:Vencord.Plugins.plugins.InvisibleChat.popoverIcon,channel:$2,message:$3,onClick:()=>Vencord.Plugins.plugins.InvisibleChat.receiver($3)}):null"
            }
        },
        {
            // Indicator
            find: ".Messages.MESSAGE_EDITED,",
            replacement: {
                match: /var .,.,.=(.)\.className,.=.\.message,.=.\.children,.=.\.content,.=.\.onUpdate/gm,
                replace: "try{$1?.content[0].match(Vencord.Plugins.plugins.InvisibleChat.INV_DETECTION)?$1?.content.push(Vencord.Plugins.plugins.InvisibleChat.Indicator):null}catch(e){};$&"
            }
        },
        {
            // Chatbar Lock
            find: ".activeCommandOption",
            replacement: {
                match: /.=.\.activeCommand,.=.\.activeCommandOption,(.)=\[\];/,
                replace: "$&;$1.push(Vencord.Plugins.plugins.InvisibleChat.ChatBarLock);",
            }
        },
    ],
#

using React works (at least on replugged)

#

on vencord it either kills webpack or tells me react is undefined

austere gulch
#

you should be importing from @webpack/common

#

not react

south ridge
#

i am

austere gulch
#

import {React} from "@webpack/common"

south ridge
#

its undefined

austere gulch
#

oh

south ridge
austere gulch
#

lower case vs upper case

#

it's a bit annoying that you're only showing snippets so I can't see the whole logic

#

xd#

south ridge
#

sec

#

wait

austere gulch
#

yeah you dont export anything called Indicator

#

you do export indicator tho

#

popoverIcon should work tho

south ridge
#

it does

#

gimme a sec, ill try again

#

changed the other ones to the correct capitalization but uhhh afais it still doesnt do much

austere gulch
#

btw you import React but don't actually use it

dull magnet
#

you can't use React on the top level

south ridge
#

noticed.

#

horrid

dull magnet
#

yes that means you're using React too early

south ridge
#

i see

#

sorry im a bit dumm

dull magnet
#

figure out where you're using React too early (this would either be top-level jsx, or a top level createElement or you're attempting to destructure React)

south ridge
#

top level creatElement

dull magnet
#

yeah don't use bleh

#

make a proper component

#

function MyComponent() {
return <blah>
}

south ridge
#

yea nothings working, ill add some console logs to see if its doing the thing it should

dull magnet
#

no need to

#

check the console first of all

south ridge
#

i am

dull magnet
#

Filter for Vencord and see if there's any warnings

#

Also did you write the patches with patchhelper to make sure they actually work

south ridge
#

yes

#

no warnings or errors btw

dull magnet
#

search for InvisibleChat in the sources tab

#

Also dumb question but did you enable the plugin

#

🦆

south ridge
#

yes

#

otherwise the minipopover icon wouldnt show

#

its pushing what i want it to but... wrong format

dull magnet
#

wdym wrong format

south ridge
#

i dont need a function i need the direct react component thingy

dull magnet
#

you want 1 but got 2 instead?

#

or other way round

south ridge
#

i need the Symbol(react.element) thingy but got Indicator()

dull magnet
#
-...push(...Indicator)
+...push(...Indicator())```
#

you're not calling your function

south ridge
#

holy fuck

#

its there!

#

Thank you so much for helping my stupid ass HugHug

#

that should actually be everything, the plugin is fully functional now

dull magnet
#

did they finally add mv3

#

FINALLY

south ridge
#

what

#

o no manifest v3 oh_fuck

dull magnet
#

manifest v3 good

south ridge
#

but my adblock :(

dull magnet
#

other than that

south ridge
#

how do i release

#

i release

#

why is .test better than .match?

muted thunder
#

regex sometimes is crazy

dull magnet
#

whereas test is to test if it matches

cursive plank
#

Still doesn't make sense

#

If it gets the match, then it matches

muted thunder
cursive plank
#

Ven, when will you review my PR?

dull magnet
#

regex.test is way faster

#

and doesn't waste memory

cursive plank
#

We are not talking about speed

muted thunder
cursive plank
#

Or memory efficiency

dull magnet
#

wha

#

he asked why .test is better than .match for this use case

#

I answered

#

using .match to test for whether a string matches a regex is an antipattern

muted thunder
#

does it actually affect the memory if u use match?

dull magnet
#

only use match if you actually need the match

cursive plank
#

Sometimes if (djdjd.match(/bdd/)) is false, when it should be true

dull magnet
#

using match wastes memory, does unnecessary allocations then unnecessary garbage collection

cursive plank
#

The garbage collector slows shit down

dull magnet
#

you're wasting memory and cpu cycles

muted thunder
#

the more u know wow

dull magnet
#

it usually shouldn't matter but if you use it in a hot spot like teal said it might start to matter

muted thunder
#

interesting

cursive plank
#

Me when if ((lol = "".match(regex))) { /* use lol */ }

#

Bad code pattern, but you can save a line that way

#

Lol

dull magnet
#

it's not bad tbh

#

it makes sense if you want all matches in a string

#
const re = /.../g
let match;
while ((match = re.exec(string)) !== null) {
    Blah
}```
#

I do this a bunch

south ridge
cursive plank
#

Nah

proud parrotBOT
cursive plank
#

You just add a dependency like that

south ridge
#

ah

#

thank you!

cursive plank
proud parrotBOT
south ridge
dull magnet
#

if anything it will just waste like 20 bytes

#

I'm sure there's more similar non type imports

cursive plank
#

Also, that file is a mess
We should refactor a lot of shit in there

dull magnet
#

refactor how exactly?

cursive plank
#

There is no need for waitFor

dull magnet
#

if you mean migrating everything to findLazy then no

#

waitFor is much more performant than findLazy

cursive plank
#

Hmm

#

What if waitFor returned a promise?

#

And we directly saved that

#

Instead of using a callback to update the exported value

dull magnet
#

how

#

that's no prettier

south ridge
#

i hate remote libs husk

dull magnet
#

why

cursive plank
#

const smth = waitFor(...) is better than

waitFor(...)```
dull magnet
#

and not possible lol

#

unless you wanna have to await every webpack common in your plugin

#

there's just no good way to do that lol

#

you'd have to await every waitFor which isn't really doable without being even uglier than waitFor and more unstable because now if one single module isn't found all modules will be uninitialised

south ridge
#

i will try with github link

#

not workie

dull magnet
#

you're trying to import a commonjs file with esm

#

it also won't work because that file doesn't bundle its dependencies

south ridge
#

so what do i do now

dull magnet
#

make ur own cdn release

#

make ur own npm package stegcloak-dist or smth and just push esbuilt esm bundle trolley

#

shouldn't take longer than 5 minutes if you've ever used npm

south ridge
dull magnet
#

I can do it for u if u want

south ridge
#

that would be nice, i have 0 idea how npm works outside of npm i

dull magnet
#

maybe a nice learning experience

#

it's really easy tbh

#

make npm account, add account to npm cli, run npm publish in folder with package.json with proper data filled in

#

done

south ridge
#

im too dum for that

eternal lion
#

What is the url of the quickcss page?

#

Oh is it about:blank

eternal lion
#

could someone tell me what it is?

#

this is confusing me :p

#

my current code is java @Override public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { var url = request.getUrl(); if(url.toString().contains("discord.com")) { view.loadUrl(url.toString()); } else { Intent intent = new Intent(Intent.ACTION_VIEW, request.getUrl()); view.getContext().startActivity(intent); } return true; }

But that means the app crashes whenever i open quick css :p

dull magnet
#

it's about:blank

eternal lion
#

hmm

dull magnet
#

Also check url.authority instead of url.toString

eternal lion
#

i tried this but it didnt work java @Override public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { var url = request.getUrl(); if(url.toString().contains("discord.com") || url.toString().contains("about:blank")) { view.loadUrl(url.toString()); } else { Intent intent = new Intent(Intent.ACTION_VIEW, request.getUrl()); view.getContext().startActivity(intent); } return true; }

eternal lion
#

url.getAuthority()?

dull magnet
#

you'll figure it out

dull magnet
eternal lion
eternal lion
dull magnet
#

no lol

eternal lion
dull magnet
#

A Uniform Resource Identifier (URI) is a unique sequence of characters that identifies a logical or physical resource used by web technologies. URIs may be used to identify anything, including real-world objects, such as people and places, concepts, or information resources such as web pages and books. Some URIs provide a means of locating and r...

#

Read design > syntax

#

urls consist of SCHEME://AUTHORITY/PATH?QUERY#FRAGMENT

eternal lion
#

alr thx :)

#

ah i see

#

so i want to use authority there

#

but to load the whole url i just use tostring

dull magnet
eternal lion
#

yeah

#

i see

#

thanks

#

this is my code now: java @Override public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { var url = request.getUrl(); if(url.getAuthority().contains("discord.com") || url.getAuthority().contains("about:blank")) { view.loadUrl(url.toString()); } else { Intent intent = new Intent(Intent.ACTION_VIEW, request.getUrl()); view.getContext().startActivity(intent); } return true; }

dull magnet
#

you can just do equals instead of contains

eternal lion
#

yeah alr

#

there

#

perfect

dull magnet
#

Also your current code has an anti pattern

eternal lion
#

now i just need a way to get back to the main screen after going into quickcss

eternal lion
dull magnet
#

replace view.loadUrl with return false

eternal lion
#

oh

dull magnet
#

hover over shouldOverrideUrlLoading

#

it will tell you this

eternal lion
dull magnet
#

uh feel free to add

eternal lion
#

alr will include in this pr

#

if i can figure it out

dull magnet
#

there's a back press handler in res/raw/VencordNative.js

#

you would likely just need to store the return of window.open()

#

and call window.close() on it on back press

eternal lion
#

hmm ok

#

ty

south ridge
#

ven when stegcloak-dist :<

dull magnet
#

soon

south ridge
#

™️

eternal lion
#

the ide is telling me i shoudl use Object.equals() instead of ==

#

because its null safe

#

so ig i should do that

#

seems like weird syntax tho

dull magnet
#

where

#

oh

#

you can't compare strings with == in java

#

you need to use .equals

south ridge
#

btw, unrelated to vencord how would i fetch ComponentDispatch via getByProps/getBySource

dull magnet
#

huh

#

don't u already have a filter to it

south ridge
#

replugged doesnt trolley

#

it doesnt have findLazy either

dull magnet
#

replugged issue

south ridge
#

yeh

eternal lion
#

Anyone else have an issue where the debugger decides to just not work? looking at the debugger console it spams Waiting for application to come online: dev.vendicated.vencord.dbg, and then eventually says Could not connect to remote process. Aborting debug session.

solemn star
south ridge
#

It doesn't exist

solemn star
#

Tf do you mean it doesn’t exist

dull magnet
#

it doesnt

solemn star
#

I’ll head back to Replugged to figure out if you guys are blind or trolling, or if I need to go kill someone

dull magnet
south ridge
#

it wont

dull magnet
#

it simply will not

south ridge
#

It is unable to will

dull magnet
#

when r u guys gonna start squashing pointless commits

south ridge
#

soon

cursive plank
proud cargo
#

shoggy!!

cursive plank
#

huh, can non-nitro people use animated stickers?

proud cargo
#

yes inside the guild

tired terrace
south ridge
#

@dull magnet there. have your damn remote lib husk

#

all just to save 200kb...

vernal gullBOT
dull magnet
#

"just 200kb"

austere gulch
#

487324957x the size of vencord bundle

#

you love

#

(vencord is like 220kb or something)

south ridge
austere gulch
#

you'd be doubling the size of vencord bundle

south ridge
#

sounds goody

austere gulch
#

NOP

south ridge
#

anyway, everything should be good now. all tested and dragged my balls on

tired terrace
#

balls

wind jay
#

balls

granite vault
rigid coral
#

Is there something like onStart?

dull magnet
#

start() and stop()

rigid coral
#

thx

eternal lion
dull magnet
#

yes

eternal lion
#

maybe i will just do this another time

#

for now links opening is good

dull magnet
#

I can do the quick css

eternal lion
#

oke sounds good :)

#

just made a pr

#

(@PresentMachine)

#

why does that not ping husk

#

@dull magnet

eternal lion
#

so

#

what should i do next 🤔

wraith carbon
#

When Vencord/iOS

dull magnet
#

never

tired terrace
#

ios shivers

muted thunder
viral roost
#

contribuitor role

muted thunder
#

thats dumb

dull magnet
#

u have role

viral roost
muted thunder
#

Do i need to do a pull request to this so it shows im the author on the plugin info?

dull magnet
#

no

potent fox
#

you can directly put userinfo to devs

muted thunder
#

got it

potent fox
#

like
Devs: [
{name:"morb"}
]

#

blablablabla

ember hatch
#

what does the No RPC plugin do?

dull magnet
#

disables rpc

ember hatch
#

sorry wrong question, what is RPC used for in discord, i googled what RPC is but not sure the usage

dull magnet
#

rich presence

ember hatch
#

the "Playing somthing..." ?

#

anyways i found a tiny bug. If you go to the plugins tab, enable one that requests a reload, and you disable it, the message doesnt disappear and when you leave you get the popup to reload

opal fern
#

Stupid bug

grim hare
# dull magnet rich presence

pretty late but more specifically it's used for external programs controlling the client, this includes rich presence as well as invite links opening in app and local OAuth granting (for games/programs that integrate with and control discord)

dull magnet
#

ya shiggy

trail ginkgo
#

@dull magnet is there a reason the release workflow is manually caching the golang build cache

#

rather than using the cache option in actions/setup-go

dull magnet
#

idk

trail ginkgo
#

did u write them

dull magnet
#

ya

trail ginkgo
#

m

#

i wonder why the builds take ~10m if ur still caching the build cache

#

i'll cehck it out later when i stop being scared of imgui

shadow ruin
#

who the fuck still uses www. subdomain

granite wharf
#

legacy sites

chrome folio
#

even i do, but it’s just a redirect to the root

shadow ruin
#

look in general trolley

chrome folio
#

no

rigid coral
#

@viral roost Why are you using props.decorations[1]?.find(i => i.key === "new-member")?.props.message?.author instead of props.message?.author for getting the author in PlatformIndicators? This breaks the Indicators for the chat in DMs

viral roost
#

i think there's no reason lol
only after the pr was merged i went like "oh wait, the message is a prop"

#

i just somehow found that before the pr and just ctrl+c ctrl+v it

rigid coral
#

oh lol

trail ginkgo
#

pr time

pulsar zodiac
#

does anyone know where the client does the req to /api/v9/activities/guilds/{guild.id}/shelf, to lazy to find it, but been thinking about mocking the endpoint and seeing if custom activities are feasible, should be since it's just an iframe

trail ginkgo
pulsar zodiac
#

I'd be down to do all the backend stuff needed tbh, I just cba to mess with electron and all that crap

#

backend guy through and through

trail ginkgo
#

just a lot of RPC through postMessage

#

from what i remember when i last looked

#

although thats kinda just a library

dull magnet
#

go to sleep bro

pulsar zodiac
#

otherwise you'd need to hardcode all custom activities

trail ginkgo
#

i plan on napping in like 4 hours

trail ginkgo
#

just compared to the rest of what custom activities need

#

also: reminder that the network tab has an Initiator column that u can hover over for a stacktrace

#

@pulsar zodiac

#

ugh i have to type it out because i forgot to copy it

#
{
  find: "dispatch({type:\"EMBEDDED_ACTIVITY_FETCH_SHELF_SUCCESS\"",
  replacement: {
    match: /(\i)=\i\.body\.activity_bundle_items;/,
    replace: "$&$self.injectActivities($1);",
  },
}```
green vessel
#

how tf do I add items to the settings menu

muted thunder
#

Ive come here seeking for help and i wanted to ask how can i get this?
do i need to use regex to get it?

#

and if so i need to match what i exactly want to replace with my own?

green vessel
#

do you ever just wana tear out your lungs

cursive plank
#

we need more info

#

looks like a component to me

#

so you most likely want to edit it?

muted thunder
#

i just need the user info

dull magnet
#

wha

trail ginkgo
#

huh

muted thunder
trail ginkgo
#

what do you want to do with it

muted thunder
trail ginkgo
#

ah

#

have u found where the badge list is @muted thunder

muted thunder
#

badge list?

trail ginkgo
#

like how are u gonna inject the badges

#

into the profile card

dull magnet
#

use the badge api??

muted thunder
#

using badge api

trail ginkgo
#

wouldnt the badge api give u a user id

#

i havent seen it

dull magnet
#

it does

trail ginkgo
#

dont worry docs will fix

muted thunder
#

ive not seen that on the api

trail ginkgo
#

yea it does

#

the real issue is that the display check is synchronous

dull magnet
#

you can just make your badge component use the normal async flow

#

probably

#

with useAwaiter

trail ginkgo
#

oh yea if the display check happens inside teh component that'd work

south ledge
#

does anyone have react devtools working on linux

#

it is being very goofy

near aurora
#

uhh so

#

if i have an array like this

#

[ programmers, services, art, people ]

#

wheere each is a variable

#

is there any way to get the strings of the variable names?

#

[ "programmers", "services", "art", "people" ]

#

like this

#

(in js)

granite vault
#

what

near aurora
#

i mean like programatically

#

not by typing it out

granite vault
#

dont think u can

#

bc it's a array bleh

#

wha

near aurora
#

i can't

#

i'll move them to an object and do object keys

granite vault
#

yop

green vessel
#

literally change braces and you'll get an object with exactly what you want
{ programmers, services, art, people }

trail ginkgo
granite wharf
#

is there a way to match the text

dull magnet
#

what text exactly

#

and how

#

via css? no

covert nimbus
#

just to make sure, it's okay if i make a plugin for replugged that loads vencord, right?

grim hare
#

that generally sounds like a bad idea to be honest but there's nothing stopping you from trying I guess (that said I am saying this purely from a licensing perspective and cannot give you the Ven Seal Of Approval™️)

covert nimbus
#

I'll wait until I get the Ven Seal Of Approval™️ before I publish it then (if I do finish it).

grim hare
#

does the replugged rewrite plugin api even let you load plugins early enough to be able to inject vencord

covert nimbus
#

no clue™️

covert nimbus
#

update: it works™️, but barely. Loading vencord works, but breaks replugged, and anything that requires the webpack breaks discord entirely

grim hare
#

that's about what I expected to be honest

covert nimbus
#

same

#

at the very most i could probably make an rp-compat for vencord or vc-compat for replugged

dull magnet
#

loading it is a really bad idea because they will conflict in multiple ways

#

both of them monkeypatck webpack

opal fern
stuck falcon
near aurora
#

proud

dull magnet
#

make 200% smaller