#🧩-plugin-development

1 messages · Page 53 of 1

quaint cipher
#

ill name it Section since it's a <section> in html but idk if thats right

glass oracle
#

name it section

tropic ice
#

you should be able to do it client side, but it won't show for other people

quasi sentinel
#

this is github not philosophy 101

muted thunder
#

is there some kind of api for message menu?

vast karma
#

You mean for context/right click menus?

muted thunder
#

yup

vast karma
#

There is

#

It was changed recently to be a bit easier to use, if you're on dev branch

muted thunder
#

ok

#

what is it

vast karma
#

Just grep for ContextMenu in existing plugins

muted thunder
#

i see

#

whats the difference between global and non global?

vast karma
#

Global apply to all menus anywhere; it's never used

muted thunder
#

i see

vast karma
#

Non-global apply to those with a specific navId

muted thunder
#

ok hmm

#

how would i do my types in this case?

vast karma
#

Wdym

#

Just imitate some other plugin

muted thunder
#

is there a way to store a file seperate from settings?

vast karma
#

Grep DataStore

muted thunder
#

do these save locally?

glass oracle
#

datastore uses indexdb
much similar to local storage

dull magnet
#

yeah DataStore is what you want

#

you can dump raw blobs/file instances in there

#

its awesome

#

theres no limit to the size, you can store gigabytes of data there

#

(but have fun with memory usage blobcatcozy )

#

you could probably dump your newborn in indexeddb and it would come out alive

glass oracle
#

lmfao

vast karma
#

I think your plugin might not get merged if you store literal gigabytes without good reason

muted thunder
#

ok but will it actually save

#

and not get deleted

vast karma
#

Unless the user (or the plugin) deletes it, it should

glass oracle
#

^

muted thunder
#

interesting

glass oracle
#

stored on disk

muted thunder
#

wait u cant get the channel with addButton()

#

only message?

vast karma
#

The message has the channel id

muted thunder
#

but i need guild id

vast karma
#

Which is easy to get from channel

#

ChannelStore.getChannel(message.channel_id).guild_id

muted thunder
#

does datastore has something to check it a key exist?

glass oracle
#

await Vencord.Api.DataStore.keys().then(keys => keys.includes("<the key you want to check>"))

muted thunder
#

so im getting this error

#

index.ts:83 Uncaught (in promise) DOMException: Failed to execute 'put' on 'IDBObjectStore': The object store uses out-of-line keys and has no key generator and the key parameter was not provided.

#

not sure what exactly means

dull magnet
#

there's a .has iirc

#

if not, just .get

dull magnet
quaint cipher
#

would it be a bad idea to add a custom route with a plugin?
so far from what I've been trying it's fine except it will 404 when I ctrl+r while on the custom route

vast karma
#

I can't see why you'd want to

dull magnet
#

why would you do that

quaint cipher
#

the other buttons are links to routes so I figured it'd be best to make a custom route to add a new button here

#

it seems to be working fine except ctrl + r doesn't like it

#

maybe I should detect ctrl r and change route to /app or would that be a silly temporary non ideal solution

muted thunder
dull magnet
#

don't use a custom store

#

and make sure notebookName isn't empty

muted thunder
#

why should i not use custom store?

gray imp
#

Hi guys!
Is there any way to install Vencord using a batch script with "silent" option?
Like this: powershell Start-Process "VencordInstaller.exe" -ArgumentList "/silent" -Wait

dull magnet
#

use the cli instead of the normal version

gray imp
#

but the cli gives no option to silent install

#

i'm creating a post-install windows programs after new Windows installation

viral roost
#

it literally does?
VencordInstallerCli.exe -install -branch auto

gray imp
#

i'll try

#

let me sec

muted thunder
#

guh this so hard to explain without pictures but
since i should not use custom store how should i be able to get values from the notes

        return await DataStore.values(HolyNoteStore);

#

i mean would i have to do it the traditional way of object.values()

vast karma
#

Literally just grep how other plugins do it

acoustic coyote
#

@remote kestrel

muted thunder
vast karma
#

You know, the singular most important tool for reading any codebase?

dull magnet
glass oracle
remote kestrel
#

why is it normal

quaint cipher
#

yeah i did this but still 404s on ctrl r

#

i cant send code rn I will later sorr

quaint cipher
vast karma
#

Presumably that 404 is sent from discord's servers as response to the page load, not part of rendering

glass oracle
#

that too

#

you should rather just render a popout for searching

acoustic coyote
remote kestrel
gray imp
# viral roost it literally does? `VencordInstallerCli.exe -install -branch auto`

Script:

@echo off

mkdir %userprofile%\Downloads\Post-install
set softwarePath="%userprofile%\Downloads\Post-install"

echo Installing Vencord...

powershell Invoke-WebRequest -Uri 'https://github.com/Vencord/Installer/releases/latest/download/VencordInstallerCli.exe' -OutFile "%softwarePath%\VencordInstallerCli.exe"
powershell Start-Process "%softwarePath%\VencordInstallerCli.exe" -ArgumentList "-install -branch auto" -Wait

PAUSE
#

Output:

balmy sky
#

I'm trying to make a plugin that enables friend nicknames regardless of if someone is your friend. I made a patch that makes it so the button appears, but if you try set a nickname is just doesnt. ```
{
find: "default.Messages.ADD_FRIEND_NICKNAME",
replacement: {
match: /d.default.isFriend(t)/,
replace: "true"
}
}

this is the patch i made, is it possible? or just downright undoable because of the api end
vast karma
#

You need to find all other places where it uses those friend nicknames and remove the corresponding check there as well

#

Also don't hardcode variable names, use \i

cedar olive
#

I doubt it does without being a friend

vast karma
#

Also that find hits two places

#

I believe it's the context menu and the modal it opens

balmy sky
vast karma
#

If you want only the context menu, perhaps ?"add-friend-nickname":"edit-friend-nickname"

#

Or just a user-context contextMenu

cedar olive
#

it doesnt matter it wont work

vast karma
#

You'd probably have to implement a brand new client-side friend nicknames feature

balmy sky
#

Yup

glass oracle
balmy sky
#

It's a shame that the api doesn't let you

#

Would be really easy

glass oracle
#

why do you think it's called "friend nicknames"

balmy sky
#

Uhhh

#

Typo

glass oracle
#

LOL

steady knot
#

css

balmy sky
#

What's the best way to show an alert before a user tries to send a message? i can't really think of a way to intercept it

muted thunder
#

ok ...await DataStore.values(HolyNoteStore) is something i need but every single time i get `

#

guh im fucking going to

#

I need to get { "Main": {} }
but i keep getting {"0": { "Main": {}, }, }

        return { ...await DataStore.values(HolyNoteStore) } ;

vast karma
#

Are you sure you're not supposed to use .get()?

#

Because .values probably returns an array of something

muted thunder
vast karma
#

Then do that

muted thunder
#

but i need to get all the keys

#

and values of them

vast karma
#

Store your whole object under that key

muted thunder
#

i wish i could show u a picture of what im trying to do

crude iron
#

Do some magic with Object.fromEntries() if the DataStore object doesn't have some method for this.

#

Or just make a custom sortDataValues func that does this. If you don't plan to use it twice, just inline it.

vast karma
#

Why is it that you need a custom store, which is something no other plugin does

muted thunder
#

ok im not sure what im doing anymore

#

maybe im doing something wrong or not but how can i make my noteHandler not use await

vast karma
#

You cannot perform asynchronous operations synchronously

muted thunder
#

ok so

vast karma
#

You can have a local, sync copy and have it asynchronously update datastore when edited

muted thunder
#

how would i be able to do this

vast karma
#

Or you can use useEffect + useState to run stuff asynchronously and update when done

muted thunder
#

ok

#

im going to continue working on this tomorrow

#

or tonight

dull magnet
#

use the DataStore.entries() function

muted thunder
#

is there a way to actually show a example of what im actually trying to do?

iron epoch
#

can you listen for all flux events?

#

I am trying to find the automod rules without making patchs

jagged briar
#

Listening to flux events won’t help with that

#

I’m not sure if it’s possible with patches though cause that data is never on the client

#

Unless you have permission to view/edit auto mod rules

#

You could listen to MESSAGE_CREATE and gather a list of them but keeping track of deleted/new rules is tricky

#

Assuming you have perms for whatever channel auto mod goes into

iron epoch
#

saw function called syncRules but doesn't look its dispatching anything or i am just blind

jagged briar
#

Look at the requests tab when you open the auto mod tab and see where the request is called

#

Then add a breakpoint and figure it out

iron epoch
#

add a breakpoint? good idea, I hate when I forget basic things

dull magnet
flint bronze
#

I want to subscribe to events on the BrowserWindow from a plugin that otherwise works without a native module

#

Just dropping a native.ts in does not work

#

Would making a plugin for native code and marking it as a dependency be a good idea?

#

wtfffffffff shit not working for no reason Thinkies

#

i forgot to restart the app

#

ok fuck i will admit i am still asking xy

north flame
#

W descriptive commits

#

(I was shortening some functions to be arrowed (they were only one line so 🤷‍♂️))

frosty otter
# balmy sky It's so joever 😔

just do it by modifying the user store and saving it in the plugin settings as an array of ID's and nicknames, and load them into the user store at start-up

muted thunder
#

is there a way to clear everything from the datastorage?

vast karma
#

There's a .clear method so I'd assume so

muted thunder
#

omg

#

i got it working

#

finally

frosty otter
muted thunder
frosty otter
#

why are you logging the component?

#

you need to warp it in a error boundary I think

proud parrotBOT
frosty otter
#

example for error boundary

frosty otter
muted thunder
#

im logging why is it undefined i remove the return but im logging render

cedar olive
#

you need to return it though

vast karma
#

Function that does not return anything gives undefined. Hmm.

frosty otter
muted thunder
#

:/

#

ok so i added return

#

same shit

frosty otter
frosty otter
#

you need to render it somewhere

muted thunder
#

ok i got this actually working

#

but my css

#

is wrong

#

or i broke it somehow

balmy sky
#

Obviously

#

I was trying to make it work with friend nicknames though

muted thunder
#

Does <Flex/> not have align prop?

vast karma
#

Not sure about vencords's, but discord's sure does

muted thunder
#

yeah the vencord one

#

vencord one doesnt have it

vast karma
#

I don't know why vencord has its own instead of just exporting discord's

muted thunder
#

so what should i do?

vast karma
#

Well, easiest is just style=

muted thunder
#

yeah idk how this style stuff works

#

or css

frosty otter
#

look at the types

muted thunder
#

ok where the types

vast karma
#

Right there in your autocomplete

muted thunder
#
// TODO - type maybe idk probably not that useful other than the constants
export type Flex = ComponentType<PropsWithChildren<any>> & {
    Align: Record<"START" | "END" | "CENTER" | "STRETCH" | "BASELINE", string>;
    Direction: Record<"VERTICAL" | "HORIZONTAL" | "HORIZONTAL_REVERSE", string>;
    Justify: Record<"START" | "END" | "CENTER" | "BETWEEN" | "AROUND", string>;
    Wrap: Record<"NO_WRAP" | "WRAP" | "WRAP_REVERSE", string>;
};
#

it gives me error trying to use Align

#
Type '{ children: Element[]; Align: string; className: any; }' is not assignable to type 'IntrinsicAttributes & { flexDirection?: FlexDirection | undefined; style?: CSSProperties | undefined; className?: string | undefined; } & HTMLProps<...> & { ...; }'.
  Property 'Align' does not exist on type 'IntrinsicAttributes & { flexDirection?: FlexDirection | undefined; style?: CSSProperties | undefined; className?: string | undefined; } & HTMLProps<...> & { ...; }'.ts(2322)
(property) Align: string
muted thunder
#

yeah not align is not working

muted thunder
#

ok

#

is there any reason why my Flex has horizontal?

#

of all classes

flex_f5fbb7 horizontal__992f6 justifyStart__42744 alignStretch_e239ef noWrap__5c413 vc-notebook-flex
vast karma
#

Probably you set direction to horizontal (or undefined)

muted thunder
#

cant be

#
                <Flex className={classes("vc-notebook-flex")} flexDirection={Flex.Direction.VERTICAL} style={{ width: "100%" }}>

#

is correct

vast karma
#

Isn't it just direction=

muted thunder
#

maybe u were right

#

there use to be some classes for emptyResultsWrap but it doesn seem to exit anymore i think i have idea on how to find them

#

actually

#

they exist

#

but they only appear when searching something on the search bar and not finding a result

#

nvm

muted thunder
#

is there somekind of api to add button where the hide member list button is?

#

also why are the DataStore.entries() like this?

    [
        "Shiggy Collection",
        {}
    ]

is there no way to maybe get them like

  [
    "Shiggy Collection": {}
  ]
#

i figured this out but kinda sucks

muted thunder
#

im trying to add button on messagecontextMenu but it seems i cant add a button on a button

#
children.push(
        <Menu.MenuItem label="Add Messagge To" id="add-message-to-note">
            {Object.keys(await noteHandler.getAllNotes()).map((notebook: string, index: number) => (
                <Menu.MenuItem
                    key={index}
                    label={notebook}
                    id={notebook}
                    action={() => noteHandler.addNote(message, notebook)}
                />
            ))}
        </Menu.MenuItem>
    );
proud parrotBOT
# cedar olive https://github.com/Vendicated/Vencord/blob/main/src/plugins/greetStickerPicker/i...

**index.tsx: **Lines 122-143

<Menu.MenuItem
    label="Unholy Multi-Greet"
    id="unholy-multi-greet"
>
    {WELCOME_STICKERS.map(sticker => {
        const checked = multiGreetChoices.some(s => s === sticker.id);

        return (
            <Menu.MenuCheckboxItem
                key={sticker.id}
                id={"multi-greet-" + sticker.id}
                label={sticker.description.split(" ")[0]}
                checked={checked}
                disabled={!checked && multiGreetChoices.length >= 3}
                action={() => {
                    s.multiGreetChoices = checked
                        ? multiGreetChoices.filter(s => s !== sticker.id)
                        : [...multiGreetChoices, sticker.id];
                }}
            />
        );
    })}
cedar olive
#

or hmm

#

something you did wrong, but I'm not sure what

#

I know you dont want a checkbox item

#

nvm I see

#

you are once again trying to use async in a place where you can't

muted thunder
#

no way

cedar olive
#

please just cache your stuff in a variable and use that instead

#

you can have a allNotes variable which is a cache

#

when you update the datastore, also update the cache

muted thunder
#

cache

#

uh

cedar olive
#

and when you load your plugin, load the data into the cache

muted thunder
#

how do i make a cache

cedar olive
#

a cache is just a fancy name for a variable which contains the same stuff you have in your datastore

#

but already loaded into it

#

so you dont need to always request it again

#

let me show you an old example

#

see how ignoredActivitiesCache is used

muted thunder
#

i see

#

hmm

#

i would probably need to redo most of my noteHandler then

cedar olive
#

it's worth it

#

requesting the datastore everytime is only going to bring issues

#

because it's async

muted thunder
#

yeah

#

i think i got idea of how to do this

muted thunder
#

awesome context menu is working

#

this cache thingy is very easy

iron epoch
#

I am adding a new feature for the MoreUserTags plugin, but for some reason when changing the name of any tag, it breaks with reading "ShowInChat" undefined. did someone tried to modify it before?

muted thunder
#

so i think im missing one more thing is that conextMenu when trying to switch like sort type and contextMenu when u right click on messages in notes

https://github.com/Wolfkid200444/Vencord/blob/79621f67ef4c778b5ee13e0d95ac5ca51c8b60b1/src/plugins/holynotes/components/modals/Notebook.tsx#L133-L160

This one is weird since when i right click it instantly sends me discord.com browser
https://github.com/Wolfkid200444/Vencord/blob/79621f67ef4c778b5ee13e0d95ac5ca51c8b60b1/src/plugins/holynotes/components/modals/RenderMessage.tsx#L124-L150

proud parrotBOT
# muted thunder so i think im missing one more thing is that conextMenu when trying to switch li...

**Notebook.tsx: **Lines 133-160

ContextMenuApi.openContextMenu(event, () => (
    <>
        <Menu.MenuItem
            label="Ascending / Date Added"
            id="ada"
            action={() => {
                setSortDirection(true);
                setSortType(true);
            }} /><Menu.MenuItem
            label="Ascending / Message Date"
            id="amd"
            action={() => {
                setSortDirection(true);
                setSortType(false);
            }} /><Menu.MenuItem
            label="Descending / Date Added"
            id="dda"
            action={() => {
                setSortDirection(false);
                setSortType(true);
            }} /><Menu.MenuItem
            label="Descending / Message Date"
            id="dmd"
            action={() => {
                setSortDirection(false);
                setSortType(false);
            }} />
    </>

**RenderMessage.tsx: **Lines 124-150

return (
    <div onContextMenu={e => {
        ContextMenuApi.openContextMenu(e, () =>
            <Menu.Menu
                navId="holynotes"
                onClose={() => FluxDispatcher.dispatch({ type: "CONTEXT_MENU_CLOSE" })}
                aria-label="Holy Notes"
            >
                <Menu.MenuItem
                    label="Jump To Message"
                    id="jump"
                    action={() => {
                        NavigationRouter.transitionTo(`/channels/${note.guild_id ?? "@me"}/${note.channel_id}/${note.id}`);
                        closeModal?.();
                    }}
                />
                <Menu.MenuItem
                    label="Delete Note"
                    id="delete"
                    action={() => {
                        noteHandler.deleteNote(note.id, notebook);
                        updateParent?.();
                    }}
                />
            </Menu.Menu>
        );
    }}></div>
green vessel
#

New chanel

flint bronze
#

nope

#

this is just progaming

green vessel
#

O

#

Anyway, question,
in discord you can have 'intents' but when i import it using

import { Intents } from 'discord.js';

i get and error that it doesnt exist in my discord.js version, i keep uptating it and it always keep bringing this error,
the command i use to update it is

npm install discord.js@latest

is the command wrong, if so can you provide the new one? thank you

fathom carbon
#

instead of here

green vessel
fathom carbon
green vessel
#

Didnt know

#

Will do that

#

Thanks

#

A ha

#

Thanks bro

vast karma
muted thunder
#

ok

muted thunder
#

ok im finished

#

like the plugin works and everything "perfectly"

#

looks is something that can do better

#

but yeah

#

now to wait for next 5 months

muted oak
#

Hey, I'm writing a plugin and I want to test it. I downloaded vencord and added index.ts in Vencord/src/userplugins/<PluginName>/, ran pnpm build, but it doesn't show up in discord, even after restarting
(Linux, Vencord installed from sh -c $(curl ...))

viral roost
muted oak
#

nope, I wasn't, after using sudo pnpm inject it works well (sad there isn't a way to reload plugin without calling sudo each time tought, or that I don't know it)

viral roost
#

then you only need to build, or auto build on save with pnom watch

vast karma
#

What pnpm inject does is that it patches discord to load vencord from your build directory

#

Not copy your current build into discord

muted oak
#

ok, thx

#

is there a similar plugin to textReplace that edits (visually ofc) other users' messages when loading them ?

jagged briar
#

no

muted oak
#

ok, is there any easy way to do so ?

jagged briar
#

make a plugin

vast karma
#

Patching the message render function sounds fairly simple; probably want to inject something before it's sent to the markdown parser

jagged briar
#

actually you would want to make it an option in TextReplace

bronze python
#

I'm trying to make a plugin that acts kind of like a middle man between discord's rich presence and applications so that they can have more control over it (specifically its name).
I was gonna make it use a websocket server but that doesn't seem to be possible to do from a plugin, what could I use instead?

vast karma
#

Probably you'd hook into the existing rich presence handler, rather than making a secondary channel

#

Keeping those in sync sounds like it'd be a hassle

bronze python
#

how would I do that? I don't know where to look

frosty otter
bronze python
#

yeah my plugin is based off of that, I'm able to spawn activities through it but I dont know how I would hook into the handler

#

is that a javascript thing I should look into?

frosty otter
#

maybe get the presence update event and modify it 🤔

flint bronze
#

@north flame I remember you said something about adding a new tab to the friends page, did you ever end up making that work?

flint bronze
#

Am I crazy?

vast karma
#

There was someone trying to add a new entry below the shops but ran into issues with the router

flint bronze
#

Hmm

north flame
# flint bronze Am I crazy?

No, I do remember somebody trying to remove the friends and shop tabs, but they got redirected to just use css

violet sand
#

I kinda wish Discord had tabs like a browser.

flint bronze
#

ChannelTabs trolley

#

Pros: useful
Cons: Exposes how actually unbearably slow Discord is

violet sand
#

I basically have a nasa computer, so I should be fine lol.

flint bronze
gloomy terrace
flint bronze
#

discord will still lag

gloomy terrace
#

oh lol

#

I wish it was the other way around trolley

flint bronze
honest umbra
violet sand
#

XD.
Nokia make better phones.

honest umbra
#

bedrock phones

lean acorn
#

guys what's the difference between userplugins and Plugins?

gusty maple
#

userplugins are gitignored

slender barn
#

Do you guys have any idea on how to resolve cors issues when fetching data?

vast karma
#

Don't fetch stuff that doesn't allow it

#

Or I guess there's a couple of cors-stripping proxes out there

slender barn
#

cors stripping proxies do not work 😦

#

This is what I've been trying to query

#

Im specifically trying to query the "rich presence"

tropic ice
#

💀

muted thunder
#

is there some kind of api for toolbar?

vast karma
#

Check what the toolbox does

muted thunder
#

i mean i know what toolbox does but why is there no toolbar api

vast karma
#

Because it's not common enough

muted thunder
#

that means i gotta do plaintext patching

vast karma
#

That's how you do most things yes

muted thunder
#

idk how to do plaintext patching

vast karma
#

Skill issue

flint bronze
#

Learn how to make patches, then make a toolbar API and make VencordToolbox use the new API

muted thunder
#

im not sure how to explain this but is something weird which i actually cant explain with words but can datastores cross with each other?

#

yeah i can access other plugin datastores thats not good

#

any way to prevent this?

vast karma
#

Nope

#

And there's no reason to since all plugins are trusted

muted thunder
vast karma
#

I have no idea what that picture depicts

muted thunder
#

The names show there are notes that people can store messages, but since it can access other plugin datastores, they show names from other datastores that users didn't create, leading it to breaking or erroing

#

what i ended up doing was creating custom store

vast karma
#

Usually each plugin would have a single top-level key

#

And then you can put whatever you want under that

muted thunder
#

usually yeah

cedar olive
#

instead of creating a new store have a single top level item which is an object or array

#

very easy to fix

muted thunder
#

well i will think if something

#

when i come back home

dull magnet
#

actually using a dedicated store is not a bad idea, although at that point you might want to manually manage your store so you can create an index and gain a huge performance gain

#

if you use a dedicated store with an index, you basically gain equivalent performance to an sql database

#

which would mean you could technically store millions of notes with no performance loss

#

this is also why i recommend usage of it for message logger enhanced

muted thunder
#

actually, i took inspiration from MLE for storing data stuff mostly

dull magnet
#

i don't think having such a plugin makes sense

#

discord will likely fix it soon

#

and just don't dm weirdos who'd use that

pure temple
#

yeah why did he make this video
why would you do this

gloomy terrace
#

that's what I said as well

pure temple
#

it's not ip logger
is it that worrying?

gloomy terrace
#

it's just creepy lul

#

also the victim might not even be aware of it

pure temple
flint bronze
#

horror

#

i just watched that video

pure temple
#

seeing javascript in jetbrains ide looks weird

#

it gives me java and c++ flashbacks

#

it's instantly clear for me

#

blocking vercel.app isn't a great solution

dull magnet
#

how is exposing ur ip to the person any better than exposing that u saw the message

#

it's even worse xd

pure temple
#

wait, you use the whole content as url

dull magnet
#

me omw to send a vercel.app link to grab ur ip

#

wow this is a nice fucking ip did u make it yourself

#

horror

pure temple
#

can we just add a plugin which requests every image directly to make ip loggers happy

dull magnet
#

because discord doesn't use that discordbot agent always

#

they have another user agent

#

"This is an intentional design decision, and is working as intended. when discord crawls a URL we perform that action as a bot. however, when we proxy images we are acting in response to a user loading that image. because of this distinction we provide a user agent of a user, not a bot."

#

night has not understood how user agents work

#

he could have just said "we don't want to be flagged as bot"

#

this is the other UA they use Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0

#

they can fix the read receipt problem by only using one single user agent from what i gathered

#

or always fetching the media even if you don't open it

#

huh?

#

it shouldn't matter

#

basically yeah

#

just don't do anything

#

why do you care if someone knows you saw their message

#

it's not that bad

#

and discord will probably fix it soon anyway just wait venniecozycat

#

then why make plugin 😭

#

you could just disable embeds in settings

#

and it'll likely fix it

#

huh how

frosty otter
#

just use canary

balmy sky
#

Wtf lmao

frosty otter
#

message render func probably

#

don't know exactly, but ntts said it in the video

muted thunder
frosty otter
#

overflow scroll probably

muted thunder
#

thats uh css right?

tropic ice
muted thunder
#

look at my roles

frosty otter
#
.class {
     overflow: scroll;
}
tropic raft
frosty otter
#

or smth

tropic ice
balmy sky
muted thunder
#

dont ask

#
div {
  overflow: auto;
}
#

should do it

muted thunder
tropic raft
balmy sky
#

Why why is toad timed out lmao

vast karma
#

Use an image host that doesn't suck and maybe people will be more inclined to look

oblique lark
#

catbox.moe fiure

muted thunder
#

this is honestly the only way to show something

swift delta
balmy sky
#

In bed

muted thunder
#

bed perms

balmy sky
#

The server just has a bedroom you can eep in if you're a contributor

swift delta
muted thunder
#

so true

#

this is honestly affecting me to get help

#

i think red scroll bar would look sick

vast karma
#

Could consider an overflow menu like in devtools, too

muted thunder
#

interesting

pure temple
#

@tropic raft gave role

tropic raft
#

thankyou

pure temple
#

yeah this is the most huskworthy thing i've seen in a while

hushed bloomBOT
tropic raft
#

i dont really know what possessed me to even make this

muted thunder
#

anyways i found this one

ResizeOrientation.VERTICAL_TOP

vast karma
#

Just grep for overflowChevron_c06200

muted thunder
#

thats just a css class isnt it?

vast karma
#

Yes, and finding that will quickly point you to the implementation

muted thunder
#

i mean i already found the implementation

pulsar briar
#

plugin is coming along somewhat nicely, still learning how the RestAPI works in Vencord but other than that itspretty good

flint bronze
#

Trying to sort an array of {guildId, channelId}, I have sorted by guildId using ["@me", "@favorites", ...SortedGuildStore.getFlattenedGuildIds()]; then a comparator function of ```js
const agp = sortedGuilds.indexOf(a.guildId);
const bgp = sortedGuilds.indexOf(b.guildId);
if (agp !== bgp) return agp - bgp;

Is there a proper way to then further sort by channel order shown in the sidebar?
#

I have been looking at GuildChannelStore.getChannels(guildId)

#

It has some weird keys

flint bronze
#

found it out

#

just use getSelectableChannels

pulsar briar
#

anyone know why this gives me an error? It's supposed to get the webhook's username but instead it errors out.

                await RestAPI.get({
                    url: "" + findOption(option, "url")
                }).then(response => response.json())
                    .then(response => {
                        sendBotMessage(ctx.channel.id, {
                            content: "Webhook Information:  \n " + response.name + "\n "
                        });
                    });```

TypeError: o.json is not a function
    at VencordRenderer:218:33702
    at async Object.execute (VencordRenderer:218:33657)
    at async handleSendMessage (WebpackModule176347:2:7059)
flint bronze
#

shitcode

dull magnet
#

it returns something else

#

use fetch()

pulsar briar
#

NekoNod alright

swift delta
#

(honestly I probably just need to be patience and see if they get back to me)

dull magnet
#

anyway you should not manually fetch these

#

just make the badge api plugin export them and import from there

swift delta
#

That sounds like beyond my skill level right now

#

so I need to find a way for this plug-in to read .json files is the problem

#

got any idea to a more permanent solution to the contributor badge so it doesn’t expire

swift delta
swift delta
# dull magnet wdym

unless it’s just my computer being shitty like it normally does for some reason some donor badges don’t render

#

those badges that aren’t loaded in are the letter badges

slender barn
#

Is there anyway I can access this image dynamically?

swift delta
# dull magnet ?

An imgur link would fix the vencord contributor badge, but I honestly don’t know what to do about the donor badges

#

am I even allowed to use imgur links?

dull magnet
#

just use the BadgeAPI

swift delta
#

nvm I was just being stupid and overlooking it

pulsar briar
# dull magnet use fetch()

I switched to using fetch() and now I'm getting the error "Object literal may only specify known properties, and 'webhookthing' does not exist in type 'Request | URL'."

 var webhookthing = findOption(option, "url");
                await fetch({ webhookthing }).then(response => response.json())
                    .then(response => {
                        sendBotMessage(ctx.channel.id, {
                            content: "Webhook Information:  \n " + response.name + "\n "
                        });
                    });```

I had done this previously in JS+HTML and it worked fine, so I don't know what's causing it since the wording on the error is a little funny
vast karma
#

Aren't you supposed to give it an url

pulsar briar
#

oh shit i forgot to fully put the code

#

it should just get the value of the url command and then input it in fetch

vast karma
#

fetch() does not know any webhookthing parameter

cedar olive
#

okay you need to search the docs for the fetch api

#

quick search and you will know what you are doing wrong

vast karma
#

Could it be that you are not aware that { foo } is shorthand for { foo: foo }?

pulsar briar
#

oh

#

wait

#

ok yea i think that solved part of it

#

didn't notice i had curly braces inside

#

alright i think i fixed it

#

just a silly oopsie on my end

#

ltu got it

swift delta
# dull magnet just use the BadgeAPI

i don’t know how to use the BadgesAPI, what do i import and how do i get the code to read it
(I’m honestly kind of stumped)
(also sorry i’m still new to this)

acoustic flame
#

Is there a flux event to handle file downloads?

#

I just wanna rename them before saving

acoustic flame
#

Actual lifesaver, thank you

dull magnet
#

in my video you can see its already patched by the "WebContextMenus" plugin but you can just add ur own patch with ur own plugin, as long as you make sure they are compatible

muted thunder
swift delta
muted thunder
#

u think is posssible to find what kind of component discord is using in this code?

(h, {
                            id: t,
                            selected: r === t,
                            ref: e=>{
                                var r, a, n;
                                let i = null !== (a = null === (r = m.current.get(t)) || void 0 === r ? void 0 : r.width) && void 0 !== a ? a : 0;
                                m.current.set(t, {
                                    node: e,
                                    width: null !== (n = null == e ? void 0 : e.getBoundingClientRect().width) && void 0 !== n ? n : i
                                })
                            }
                            ,
                            onClick: r !== t ? ()=>i(t) : void 0,
                            children: n
                        }, t)
```?
dull magnet
#

do you mean find what h is

muted thunder
#

h

dull magnet
#

set a breakpoint, trigger it, then you can hover all variables to see their values

muted thunder
#

yup

oblique lark
#

this indentation is killing me

acoustic flame
#

Son please use a prettier before sending

muted thunder
oblique lark
muted thunder
muted thunder
#

theres more

#

:o

#

i think i actually found it

#

sum about forwardRef

acoustic flame
#
    getCurrentDate(): string {
        const date = new Date();
        const hour = date.getHours().toString().padStart(2, "0");
        const minutes = date.getMinutes().toString().padStart(2, "0");
        const seconds = date.getSeconds().toString().padStart(2, "0");
        const day = date.getDate().toString().padStart(2, "0");
        const month = (date.getMonth() + 1).toString().padStart(2, "0");
        const year = date.getFullYear();

        return `${hour}:${minutes}:${seconds} ${day}-${month}-${year}`;
    },

    async saveImage(url: string) {
        const data = await fetchImage(url);
        if (!data) return;

        const filenameData = getFilenameData(new URL(url).pathname.split("/").pop()!);
        const name = `${filenameData.name} ${this.getCurrentDate()}.${filenameData.extension}`;
        const file = new File([data], name, { type: data.type });

        saveFile(file);
    }

This getCurrentDate returns a hh:mm:ss dd:mm:yyyy timestamp string as intented, but when the "select download location" windows shows up it turns a hh_mm_ss dd:mm:yyyy

how

acoustic flame
# dull magnet

Example using this image, the first image is a print of file.name value, and the second one is the save file window ||im using fedora linux, i may test this later in windows to see if this is an out of hands issue if i get no response||

pulsar briar
iron epoch
dull magnet
#

why would u search the badges for fubuki

#

goofball behaviour

flint bronze
#

funny edge case

frosty otter
#

Why are my styles not applying

(I also enabled the styles via enableStyle(noticeStyle))

.ping-blocked [class*="contents"]> :is(div, h1, h2, h3, p) {
    color: #f04747 !important;
}
        {
            find: "Message must not be a thread starter message",
            replacement: [
                {
                    match: /\)\("li",\{(.+?),className:/,
                    replace: ")(\"li\",{$1,className:(arguments[0].message.content.includes('@ping blocked: ') ? \"ping-blocked \" : \"\")+"
                }
            ]
        },
#

and now they are randomly applying husk

vast karma
#

Does the class show up in devtools

frosty otter
#

for the randomly applyed text?

#

yes

#

󠁰󠁩󠁮󠁧󠀠󠁢󠁬󠁯󠁣󠁫󠁥󠁤 a

#

nvm now it works

full sapphire
#

hey, I have been using vencord for a bit and can't find any info anywhere on how to make plugins. Is there documentation anywhere, or any good starting point? I am proficient in js and know a few other programming languages.

vast karma
#

Did you check the docs folder

steady knot
swift delta
vast karma
#

A bit too much spacing I think, but nice

frosty otter
#

looks a bit flooded

balmy sky
#

Is there a way i can conditionally render a setting without making it a component?

#

I would check myself but i couldn't find the definition for some reason

frosty otter
#

think no

#

tried, but couldn't, because you can't access the settings inside the settings while initializing them

balmy sky
#

Eh i'll just add it myself lmao

swift delta
# swift delta <@343383572805058560> Yippe got it working

I’m sorry if i’m just being stupid or if this isn’t the proper place to be doing this. But, I don’t know how GitHub works. So I don’t know how to submit the changes, but I do know that with this plug-in if you do just one line wrong, you can accidentally turn it into a crasher. So I was just wondering if I could submit it as a whole new PR or uploaded to #1032200195582197831 because I’m pretty sure this is just abandoned by the original devs

vast karma
#

Just wrap the component in an error boundary, that'll catch any error during rendering

pulsar briar
#

I realized that I was supposed to make my plugin inside of the plugins folder, but when I did this I now get this error

#

It only seems to fix if I remove it from it's own folder (aka keep it as it's own .tsx file)

swift delta
vast karma
#

Github has nothing to do with error boundaries or crashes, it's just where you host the code

swift delta
#

i’m sorry i’m an idiot just don’t know how to submit the changes (or whatever) I made since I had to change a whole section of the code

vast karma
# pulsar briar

Do you perhaps not have a plugins/WebhookManager/index.{js,ts,tsx}?

pulsar briar
#

ah

#

ah

#

ah

#

thats right

#

THANK YOU

#

i had named it wrong

pulsar briar
vast karma
#

No, I mean a react ErrorBoundary

pulsar briar
#

oh

#

i havent messed with react

vast karma
#

Instead of return <YourBadgeRenderer {...props} />, do return <ErrorBoundary><YourBadgeRenderer {...props} /></ErrorBoundary>

#

Basically the react counterpart of a try/catch

swift delta
#

i have no idea the hell y’all are talking about i dont how to use GITHUB

pulsar briar
#

its in ur code

vast karma
#

Github has nothing to do with the code you write

swift delta
vast karma
#

You did express concerns about crashing

pulsar briar
swift delta
#

I just don’t know how to submit the changes to the GitHub PR because it’s a whole section I had to change

swift delta
#

idk what to do

frosty otter
#

push to your fork and open a pr

red harbor
#

Hey, I'm new to creating plugins (or trying third party ones) I don't get how to add third party plugins 😔. I cloned the Vencord repo, installed pnpm and installed the dependencies. I then installed a third party plugin and put it into src/userplugins/FakeBadges and I put in the index.ts of that plugin, then run pnpm watch but I can't see the plugin in the plugins list. Did I do something wrong in the process??

swift delta
#

then restart your client

dull magnet
#

watch = build

#

you probably forgot to pnpm inject

vast karma
#

You need pnpm inject first

swift delta
red harbor
#

Ah yes, I forgot to mention that I did it. I did pnpm build and pnpm inject after that, because I uninstalled Vencord with it's graphical installer

#

Ah wait, I need to restart Discord

vast karma
#

If you have run pnpm inject and pnpm build or watch without any errors, then it should be successfully installed

red harbor
#

(Well at least something changed)

vast karma
#

Forgot to set a name on your plugin?

#

pnpm test should catch that when running tsc, right?

red harbor
#

Oh no, sorry, it's because I was creating a plugin but then decided to try a third party one before coding my own, the watch failed because there is a folder with nothing inside of it in src/userplugins

vast karma
#

Why is there an empty folder then

red harbor
#

I created a index.ts file because I wanted to make a plugin, but then I decided to try a third party one before creating one right after I created the file and the folder. I forgot to delete them (or add the code to define it)

balmy sky
#

So delete them

red harbor
#

Yeah

swift delta
vast karma
#

You upload it

red harbor
#

Ok, everything works fine now. Thanks for the help everyone :D

swift delta
balmy sky
#

Yes

#

Make a mod mail ticket and ask for perms

#

Oh you already have the role

#

Lmao

vast karma
#

I mean my latest thing I posted there would never have gotten in if it needed permission

balmy sky
#

How would i go about getting a function that sets the users status?

#

unless it already exists and i'm insanely blind

swift delta
vast karma
#

You'd consider very very carefully if that is selfbotting

balmy sky
#

Oh yeah ofc

#

It's for a status preset thing

#

Where you can define statuses to quick switch to (manually ofc)

vast karma
#

After that you'd find it the same way you find any other function

balmy sky
#

Uhhhhhhhhhhhh

#

Which is? 😭 ohgodohfuck

acoustic flame
#

Sup

#

Just finished my first plugin

#

is there a guide or something to post them?

#

i've read that one must fork vesktop and include the plugin in there but i've lost that post

pulsar briar
#

sooooo uhh

#

while trying to make webhooks send messages on desktop, it gives me the error
{"message": "Invalid request origin", "code": 50067}

#

I'd assume its because the origin is discord.com and discord doesn't like hat

#
   execute: async (option, ctx) => {
                var webhookUrl = findOption(option, "url");
                var webhookMessage = findOption(option, "message");

                await fetch("" + webhookUrl).then(response => response.json())
                    .then(response => {
                        webhookDefaultName = response.name;
                    });


                const request = new XMLHttpRequest();
                request.open("POST", "" + webhookUrl);
                request.setRequestHeader('Content-type', 'application/json');

                const params = {
                    content: webhookMessage,
                    username: webhookDefaultName ?? "User",
                    avatar_url: ""
                };
                request.send(JSON.stringify(params));

                sendBotMessage(ctx.channel.id, {
                    content: "Message sent. Output: " + JSON.stringify(params)
                });

            }```

Maybe I'm wrong though, because on my website this exact code works just fine
dull magnet
#

why are you trying to execute a webhook from a plugin

pulsar briar
#

send messages, delete, and get info

#

it can be considered a niche to some, but can also be utilized and having an actual purpose

dull magnet
#

via native.ts file

pulsar briar
#

I'll see what i can do

pulsar briar
dull magnet
#

no

#

files can have native code by creating a file called native.ts

#

search for it in the files and you'll find examples

pulsar briar
#

ohhhh

#

thank you

#

i'm very stupid sometimes

pulsar briar
#

okay i might be a little lost

dull magnet
#
// native.ts
import https from "https";

export function executeWebhook(_, url: string, body: object) {
  const req = https.request(url, { method: "POST", ... });
  req.write(body);
  req.end();
}

// index.ts
const Native = VencordNative.pluginHelpers.YourPluginName as PluginNative<typeof import("./native")>;

Native.executeWebhook("https://discord.com/api/...", {
  content: "hi"
})
pulsar briar
#

thank you so much !!!!!! Yay

#

i just realized i wasnt too far off from this

dull magnet
#

probably needless to say that this makes your plugin not function on web

pulsar briar
dull magnet
#

you might be able to do some iframe fuckery

#

to get rid of the origin

pulsar briar
#

ooh true

#

this should be implemented properly now (although it tells me https.post does not exist), i gtg for half an hour but ill be back soon

// index
const Native = VencordNative.pluginHelpers.WebhookManager as PluginNative<typeof import("./native")>; // approx line 13 before definePlugin


  Native.executeWebhook("" + webhookUrl, {
                    content: webhookMessage,
                    username: webhookDefaultName,
                    avatar_url: ""
                }); // approx line 120 in the execute sendwebhookmessage


// native
import https from "https";

export function executeWebhook(_, url: string, body: object) {
    const req = https.post(url,
        {
            method: "POST"
        });
    req.write(body);
    req.end();
}

dull magnet
#

got it

#
const iframe = document.createElement("iframe")
iframe.sandbox = "allow-scripts"
iframe.srcdoc = `
<script nonce="NDEsMjksMTM0LDU4LDIzNyw4OSw0NiwyMTY=">
fetch("http://localhost:8080")
</script>
`
document.body.append(iframe);
setTimeout(() => iframe.remove(), 1000);
#

but u have to somehow figure out the nonce or it will fail due to csp

misty sundial
#

I'm trying to make a checkbox appear next to the download button on a zip file but when I use patches it appears on videos instead? But shouldn't this be a zip because it has the class of nonMediaAttachment while a video has the class of mediaAttachment?

patches: [
        {
            find: ".nonMediaAttachment]",
            replacement: {
                match: /\.nonMediaAttachment\]:!(\i).{0,10}children:\[(\S)/,
                replace: "$&,$1&&$2&&$self.renderCheckbox(),"
            },
        },
    ],

    renderCheckbox: ErrorBoundary.wrap(() => {
        return (
            <input type={"checkbox"}></input>
        );
    }, { noop: true })
dull magnet
#

yeah should work

#

works for PiP

misty sundial
#

Yea it shows it on a video when I'm trying to only show it on zips but it wont show on a zip for some reason?

#

Cuz on a video it looks like this

dull magnet
#

oh

#

well

proud citrus
#

I'm looking at the source for FixYoutubeEmbeds and trying to understand how it works. I was wondering how reloading the page with location.reload() fixes the issue, or am I looking at the snippet wrongly?

frame.executeJavaScript(`
                new MutationObserver(() => {
                    if(
                        document.querySelector('div.ytp-error-content-wrap-subreason a[href*="www.youtube.com/watch?v="]')
                    ) location.reload()
                }).observe(document.body, { childList: true, subtree:true });
                `);
dull magnet
dull magnet
#

inside iframe in discord, the parent origin will be discord

#

but reloading the page makes it lose its parent so it wont have a parent anymore and their check fails

proud citrus
#

Ah I see, is losing the parent origin via reloading the page an intended interaction or is it more of a happy coincidence?

dull magnet
#

intended

proud citrus
#

Gotcha, thanks. I wonder if I can find a reason behind why that's so in youtube's documentation

#

Since right now I can't see the reasoning for why it would be designed that way

dull magnet
#

its not by youtube

#

its how the browser works

proud citrus
#

In that case should I be looking at chromium docu?

#

Either way I doubt I'll be able to find a concrete reason since this sounds like quirk territory.

dull magnet
#

its not quirk

#

i already explained why it happens

proud citrus
#

I'm trying to figure out now why reloading the page in the iframe makes it lose it's parent origin

dull magnet
#

from mdn docs on window.parent:

When a window is loaded in an <iframe>, <object>, or <frame>, its parent is the window with the element embedding the window.

location.reload() reloads the youtube embed which makes it so that it's now loaded regularly and not by the iframe

proud citrus
#

When you put it that way it makes sense now.

#

Thanks for clearing that up.

dull magnet
#

idk how whoever wrote the plugin even came up with that

#

but its cool

pulsar briar
#

this is a weird error (in console)

1170555935396216834:1 Uncaught (in promise) Error: Error invoking remote method 'VencordPluginNative_WebhookManager_executeWebhook': TypeError: Er.default.post is not a function```
vast karma
#

Sounds like https library is not used how you expect

#

Doesn't pnpm test show any typescript output?

pulsar briar
#

running that rn

#

ah

#

i wish i knew that command earlier, still new to pnpm / npm as a whole

#

i have no idea what eqeqeq is

vast karma
#

It says exactly what it is

pulsar briar
#

i dont even have a === in my code

vast karma
#

Yes, that is what it's saying

pulsar briar
#

ohhhh

#

i see i see

#

misread it lmao

#

aand fixed

#

no more errors

#

wait

#

didn't mean to delete*

1170555935396216834:1 Uncaught (in promise) Error: Error invoking remote method 'VencordPluginNative_WebhookManager_executeWebhook': TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object```

```ts
export function executeWebhook(_, url: string, body: object) {
    const req = https.request(url,
        {
            method: "POST",
            headers: {
                'Content-Type': 'application/json',
            }
        });
    req.write(body);
    req.end();
}```

I'm still a little stuck on this since it *SHOULD* work, unless I'm thinking about fetch()
vast karma
#

Why do you not use fetch()?

pulsar briar
#

previously i tried to use it, and a few other methods

#

but i get the uhhh

vast karma
#

Yes, why do you not use fetch in nodejs

pulsar briar
#

wait a damn minute

#

wait just a damn fuckin minute

#

brb

#

bruh im boutta lose it

dull magnet
pulsar briar
#

i just learned that ^

dull magnet
#

you cannot

dull magnet
#

oh you have a new error

#

well the error tells you exactly what's wrong

pulsar briar
#

i see something about a chunk needing to be a string

#

now the way i counter this (which probably is not a good code practice at all) is by doing "" + whateverIneedtoadd

#

i could also just (string) whateverthethingis but sometimes that won't work

vast karma
#

[object Object]

#

JSON.stringify() would be more likely

vast karma
pulsar briar
#

where you can cast

#

I FOUND WHAT I NEEDED TO DO

#

YUESSSS

#

🎉🎉🎉🎉🎉🎉🎉🎉🎉

vivid stratus
#

a

acoustic flame
#

you have no idea how much i wish vscode had a git ui manager intuitive as jetbrains environments have

jagged briar
#

i use this

#

super intuitive

vast karma
#

I just use the cli, it works fine

jagged briar
#

i just use gitui cause i no no wanna use git commands and its good for visualizing

acoustic flame
#

I use gitfiend

#

But i can check it

green vessel
#

finally, I think I'll get somewhere asking things in this channel

#

forever finding myself asking things in the wrong places

#

anyway, hi \o

#

i'm new here

flint bronze
#

yes

green vessel
#

ah

#

you followed me

flint bronze
#

i am looking into how that sidebar menu is opened

green vessel
#

thanks for pointing me in the right direction

flint bronze
#

oh, that's discord jank showing up again

green vessel
#

was that me?

#

👀

#

i didn't start a thread...

#

maybe I should? either way, does anyone know how I can be in more than once place at once in the desktop app?

#

like multiple windows viewing diff channels?

#

someone mentioned the channeltabs thing and I'm chasing that down rn trying to see if I can make it fit my use case scenario here

flint bronze
#

I'm looking at the sidebar functionality

#

like when you view a thread

green vessel
#

OH

cedar olive
#

btw when you click a message on the server home it also opens the sidebar

green vessel
flint bronze
green vessel
#

shiny

#

I've only ever interacted with server side code (bot development)

#

new territory for me here

flint bronze
#

a lot of discord client modding is

  • open devtools
  • find something
  • play with it in the console using vencord's webpack findByProps/findStore/findByCode
  • profit
#

very useful

green vessel
#

\o/

flint bronze
#

@green vessel so it seems like I've found how to open the sidebar

const { openChannelAsSidebar } = findByProps("openChannelAsSidebar");

takes an object of {guildId, channelId, baseChannelId}
baseChannelId should be the current channel id

green vessel
#

current as in the one I want to open yeah?

cedar olive
#

seems easily usable

#

but hardly extensible

#

allowing more than one sidebar would be likely very hard

green vessel
#

I'll settle for one

#

for now

#

lol

#

time to go learn how this works i guess

flint bronze
#

you might find Vencord's ContextMenuAPI useful

#

do note

#

there has been a major change to it in the past ~week

green vessel
#

that's fair.

#

necessity is the mother of invention and I'm a firm believer of the KISS protocol

#

so, I just want to right click a channel and open it in the sidebar (and have it stay there)

#

that'll do enough for me

green vessel
#

I was thinking I could possibly run multiple instances of discord at one point, but I don't need it to take up that much ram. I just want to have the ability to monitor comms in a main channel while cycling through dms etc

#

admin problems...

flint bronze
proud parrotBOT
cedar olive
#

no need to mention the changes lol

#

they are new

flint bronze
#

true

#

both new and old still works

cedar olive
#

they don't know about the old way

green vessel
#

uh

#

I know nothing

#

literally new

flint bronze
cedar olive
#

they wont

#

all plugins were converted to the new way

flint bronze
flint bronze
cedar olive
#

yes

flint bronze
#

oh really

#

when was that

cedar olive
#

all the plugins in the main repo at least

#

sometime in the past week

flint bronze
#

@vast karma I'm stupid

#

note to self

#

do not assume legacy code exists

#

pretend I said nothing about the old way of doing it

green vessel
#

so, where's that channeltab plugin at?

flint bronze
green vessel
#

not on the main list

#

heard

flint bronze
#

a

green vessel
#

oh

#

well, it's already running

#

so

#

I made it that far

#

i kinda know what i'm doing

#

(i hope)

flint bronze
#

this might also be useful to you

#

(experiment)

green vessel
#

OMG THAT'S PERFECT

#

who made that? I wanna hug them...

flint bronze
#

discord trolley

green vessel
#

oh

jagged rain
#

make it to where yall aint gotta download this stuff

#

I got way to much files for this

flint bronze
#

what

jagged rain
#

STFU

flint bronze
#

Mods, literally rot this user's brain

green vessel
#

oof

flint bronze
#

will the order of this change and break my patch?

cedar olive
#

that's a bad match

flint bronze
#

yes it is

cedar olive
#

it's too generic in the beginning

flint bronze
#

i know

#

ok

#

this is getting very xy

#

what I really need

#

is to capture the first argument

cedar olive
#

you prob dont need to create a variable

#

just use arguments[0] where you need

flint bronze
#

oh

#

that

#

makes so much more sense

#

works

dull magnet
dull magnet
#

in is weird

flint bronze
#

PS

#

blame the fact someone linked the font in the server here trolley

dull magnet
#

THAT WAS ME

flint bronze
#

i will explode you

#

ok but really

#

what if i told you i programmed with splatoon font once

#

HORROR

acoustic flame
#

Do i have a way to close the plugin settings dialog from inside of a component?

dull magnet
#

ModalStack.pop() should work

#

or dispatch modal close with flux dispatcher

acoustic flame
#

cant find the correct flux event for the dispatcher

#

how risky is calling closeAllMethods()?

iron epoch
#

why can't I use useState in my component?
i am getting this: https://react.dev/errors/300?invariant=300

export function InputBoxComponent(currentRules: null | Array<>) {
  const [inputValue, setInputValue] = useState('');
  console.log("hook setupped");
  const handleInputChange = (e) => {
    const newValue = e.target.value;
    setInputValue(newValue);
  };
  return (
    <div>
      <TextArea
        value={inputValue}
        onChange={handleInputChange}
      ></TextArea>
    </div>
  );
}

The library for web and native user interfaces

cedar olive
#

you are returning somewhere before a hook is called

viral roost
iron epoch
viral roost
#

wheres the function used

iron epoch
iron epoch
# viral roost wheres the function used

using it in a patch

    {
      find: "return(0,a.jsxs)(\"div\",{className:L.categoryContainer,children:[",
      replacement: [{
        match: /return\(0,a\.jsxs\)\("div",\{className:L\.categoryContainer,children:\[/, // return(0,a.jsxs)("div",{className:L.categoryContainer,children:[
        replace: "$&$self.renderTestText(), $self.renderInputBox(),"
      }]
    }
dull magnet
#

use react properly

iron epoch
#
  renderInputBox: () => { return TestInputBoxComponent(currentRules); },

and wrapping it

dull magnet
#

that's not how you create a component

iron epoch
dull magnet
#

<TestInputBoxComponent rules={} />

iron epoch
#

I am not into ui at all lol

#

ah makes sense, now it all make sense

iron epoch
#

alright, is there way to correct this?
(method) onChange(v: string): void
I expect an InputEvent

#

not a string

flint bronze
#

I've made a plugin to patch the built in +:emoji: add reaction command to add the reaction to the message you're replying to, what should I name the plugin?

versed osprey
flint bronze
versed osprey
#

idk i didnt really understand the plugin tbh

flint bronze
#

so you know how you can use +:emoji: to react to the last message in chat

#

my plugin patches that so that if you try to reply to a message when using that command it adds the reaction to the message you are replying to

versed osprey
#

oh

#

reaction reply

#

?

flint bronze
#

discord doesn't do that by default trolley

versed osprey
#

idk thats the only thing that is coming to mind

flint bronze
#

let me stall for a few hours before committing this

#

every day i hate discord shitcode more and more

versed osprey
#

my brain no work when i see it

versed osprey
#

we should get husk sticker fr fr

flint bronze
#

REAL

swift delta
flint bronze
iron epoch
vast karma
#

Because onChange gets a string as parameter

#

Next question?

iron epoch
vast karma
#

You get it as argument

iron epoch
vast karma
#

You provide a callback. That callback gets the string. I don't see what is so hard to understand.

frosty otter
iron epoch
iron epoch
vast karma
#

Well you haven't said anything about what your problem is yet, other than you're surprised that you're getting a string

iron epoch
#

going to test something hope it work

iron epoch
vast karma
#

Why are you changing the value on every change btw

#

The textbox already does that

iron epoch
#

when the box updates, I want to get the text inside

vast karma
#

And do what with it?

iron epoch
#

I believe its going to be ugly if I put a button

iron epoch
#

anything in that text matchs a list of keyword*

vast karma
#

That makes sense I suppose

#

But I don't see how that relates to changing value= every time the value changes

iron epoch
vast karma
#

Yes, that's what onChange does

#

No reason feedback-loop that back into itself

iron epoch
#

it was a bad old code, i am just matching the logic of the old one with a refactor version.

iron epoch
vast karma
#

All I'm asking is why you're doing value={currentValue} instead of value={initialValue}

vast karma
#

And why do you do that

iron epoch
vast karma
#

What

iron epoch
#

like it doesn't update it passes it to onchange instead

vast karma
#

Yes

iron epoch
# vast karma Yes

you gave me an idea, why don't I use useEffect and listen for inputValue changes instead

#

and remove onchange

vast karma
#

...?

#

What exactly is it that onChange does not do that you want it to do

cedar olive
#

what's even is the issue here

#

value is using the state and onChange updates the state