#🧩-plugin-development

1 messages · Page 60 of 1

iron epoch
#

use react tools to find the react component, you could use findComponentByCode to get the component

kind pike
#

someone did it in an extension of silent typing

#

look into that source code

#

also, wheres a list of all the apis for devs?

#

is it just the react devtools

stable moss
#

can someone review #2555, specially the patches and react code

balmy sky
safe glade
#

yeah that's fine iirc

viral roost
stable moss
thin coral
#

wow

flint bronze
stable moss
balmy sky
#

How can i get the function that opens the modal from the user area in the bottom left? I'm essentially trying to replicate the functionality of that button, but in a different place

vital mist
#

Can you link me to it if possible?

#

I'd love to look at the source code juice

proud parrotBOT
# tight canyon https://github.com/Vendicated/Vencord/blob/dev/src/plugins/textReplace/index.tsx...

index.tsx: Lines 52-77

const settings = definePluginSettings({
    replace: {
        type: OptionType.COMPONENT,
        description: "",
        component: () => {
            const update = useForceUpdater();
            return (
                <>
                    <TextReplace
                        title="Using String"
                        rulesArray={stringRules}
                        rulesKey={STRING_RULES_KEY}
                        update={update}
                    />
                    <TextReplace
                        title="Using Regex"
                        rulesArray={regexRules}
                        rulesKey={REGEX_RULES_KEY}
                        update={update}
                    />
                    <TextReplaceTesting />
                </>
            );
        }
    },
});
kind pike
#

(it is that one)

vital mist
#

I'll be looking into the source code in a bit. Thanks so much, so excited to get this plugin out with comfy settings!!

hushed loom
#

does discord have data for when friend requests were recived/sent

flint bronze
#

look at SortFriendRequests

hushed loom
#

Thanks

iron epoch
cosmic goblet
#

Hey! I'm looking for a way to run commands using Vencord. Maybe using eval somehow? The way I wanted to do it is kind of confusing, I first wanted to create an express server, then when a request is sent with the command, it will eval the command. But that seems like a really bad way to do it. Is there any other better way? Since I'm thinking of making a pull request of this plugin, I'd want this to be done the best way possible.

sullen stone
#

@unreal lintel

#

hi

#

i need help

tight canyon
cosmic goblet
# tight canyon Honestly it sounds like something that wouldn't be accepted What do you mean by...

by run command I mean run a command with child_process. I mean yeah I can do that natively as well, but my main question was to know if that would get accepted in the main repo. Which I think won't happen. Let me share my actual plugin idea, I'm trying to make a plugin called DiscordClips that would clip voice calls in Discord (without the need of streaming your screen of course). So I thought of recording the audio of Discord's window using ffmpeg, for which I would need to eval. I can't think of any other better way to do it though.

tight canyon
# cosmic goblet by `run command` I mean run a command with child_process. I mean yeah I can do t...

There is a plugin request with the similar functionality, which is not closed, so maybe you have luck to get it accept and there is a pull request that uses child_process, so you don't need to create a express server just for that

GitHub

Plugin Description I know there is a bot for this kind of thing called Craig but it is painful to bring them in and mess around with the website to get a recording. Having it play a "now recod...

GitHub

This is a plugin that adds a yt-dlp command. You pass a url, it downloads it and readies it as an attachment. See the gif for a quick example.

It supports any URL supported by https://github.com/y...

#

So you can just spawn ffmpeg without using eval

honest stump
#

"Now using Fafa Theme Library for themes" 😭 what??

honest stump
#

why owuld they use it

safe glade
#

becausen't

swift delta
honest stump
#

insane

swift delta
#

also, I love the theme library plug-in and I use it/regularly submit things to it and think it should be a lot bigger than what it is but it is not big enough to depend on it as the only way to get themes/CSS stuff

orchid moss
#

Hey! It's my first time submitting a plugin to Vencord and I have a question. I've opened a PR (#2560), did the required changes according to the code review and made sure my branch is up to date with the dev branch. Still, GitHub says there's one workflow waiting for approval by a maintainer. Is there something else I must do, or do I just have to wait at this point? Thanks!

stable moss
dull magnet
#

indeed

#

for your first contribution, a maintainer has to approve the workflow run to prevent abuse

orchid moss
#

All righty, that's understandable - thanks for the info! ^^

amber mantle
#

true

#

vr in your name on github + only forks/lowquality code = no

balmy sky
#

Vr in your name ~~ on github + only forks/lowquality code~~ = no

amber mantle
#

i am biased to disagree with your strikethrough but fair enough

desert agate
#

Quick question. I am a bit smooth brain but is there a way to make the message logger save messages indefinitely or possibly export chat history prior to edited messages to a notepad file?

safe glade
ionic sparrow
#

anyone know what the function / component prop is to detect right clicks?
ik onClick will detect left and ive seen the onContextMenu detects right clicks in react but idk what to use for disc / electron iirc

balmy sky
#

Discord uses react

#

You can use oncontextmenu i'm pretty sure

ionic sparrow
#

looking through the chats it appears you are supposed to use onContextMenu but im guesing the component im adding it to doesnt register that

#

im trying to detect a right click on a gif (in the gif search), left clicking ive been able to detect and edit but when i add the onContextMenu it doesnt detect the right clicks

#

since im guessing the gifs dont have that prop do yall know if there is any other way to detect a right click

vapid crane
#

Hemlo i'm trying to make myself customCSS where my messages appear on the right side and other ones are on the left, like on screenshot (screenshot is not mine). Person that created that theme said that you need "Self-Messages plugin" that person created, but it's for better discord, so i wanted to try and remade it, but the thing is i don't know where to test it, because i cannot find "src/userplugins" folder, where do i look for it?

vapid crane
#

But question is, are you able to do that? XD Because i don't know how to determine if sent message is mine or not

#

(my nickname and profile picture changes)

tight canyon
#

li[data-is-self="true"] {
/* Make right */
}

vapid crane
#

noway it's that simple XD

iron epoch
tight canyon
#

But it requires this plugin

dull magnet
#

v+ needy @vapid crane @desert agate

#

read rule 5.1 people

tight canyon
dull magnet
tight canyon
hoary pilot
#

if they can't read it's their punishment

#

but others can see vee's message

winter tartan
#

I want to make a plugin, how do I get started?

balmy sky
dull magnet
tight canyon
#

:(

iron epoch
winter tartan
#

there is already a folder in src on vencord repo

#

do I have to create one called userplugins to have my plugins there?

#

or create my plugin's folder in plugins

tight canyon
#

userplugins are not tracked by git, so you have an easier time with updates if you're not planning to make pr

winter tartan
cedar marsh
#

why the fuck would they force disable favoriting DMs?

#
!(e.isDM() || e.isThread()) || a && (null == u ? void 0 : u.isStaff()) === !0
winter tartan
#

i dont think having my plugins there would do it

winter tartan
# winter tartan

i'll create a folder in src called userplugins and have mine there likewise..

tight canyon
#

Just a simple plugin for yourself - userplugins
Plugin for a PR - just plugins, so git can track it

potent axle
#

.

cedar marsh
#

@dull magnet am I supposed to base PRs on dev or main?

shrewd tundraBOT
dull magnet
#

main you wont have merge conflicts

cedar marsh
#

ok

honest stump
#

can I somehow stop discord from fucking with my audio while being in a voice channel

shrewd tundraBOT
honest stump
#

ig its not possible to change then via patching or similar

cedar marsh
#

"fucking with my audio" is VERY vauge and could be 9 quadrillion things

honest stump
#

it somehow SOMETIMES turns my whole system audio to mono or something

#

let me try to record it rq

#

i feel like its a windows issue lmfao

#

mb

#

the issue is so random but yeah turns out its a windows issue i guess??

#

while recording it also turns whole system audio to mono

ionic sparrow
#

im trying to add a system where if you right click on smth it has a button, the component doesnt have the onContextMenu prop so im unable to detect a right click, is there any other way i could either add this prop or get a detection of a right click

sacred oak
#

Hi, I'm trying to create a small plugin for myself to hide a user in the Channel Member's list. I'm pretty new to React and I understand how to get the ChannelMemberStore but I'm unsure how to get the list of users or prevent the rendering of a specific user's element. Can anyone point me in the right direction? Like a pre-existing plugin that prevents elements of a FluxStore from being rendered?

cedar olive
#

you need to find the code that renders the member list, not the channel member store

#

stores are most of the time cache/places where data is stored, which the components on discord use to obtain the data and render something with them

#

enable the react devtools, select a member and inspect the components

sacred oak
#

Sorry inspect the components using react devtools and not normal devtools right? Because I'm not seeing that button.

cedar olive
#

yes!

#

you need to enable it in vencord settings

#

then it will appear as a tab in the normal devtools

sacred oak
#

Thanks

cedar olive
sacred oak
#

lol okay not sure what's going on but I don't see anything in the text area

cedar olive
#

close the devtools and ctrl + R discord

#

then open again

sacred oak
#

yep that did it. Thanks

median flax
#

hey i wanna get started into creating a plugin and i have a question, does the plugin have to be coded in typescript or can it be also coded in javascript?

safe glade
#

TypeScript is just JavaScript but superior

median flax
#

i'm still not comfortable using it tho

#

is it required?

dull magnet
#

you wont even notice youre using typescript

safe glade
#

Anything in JavaScript is valid TypeScript anyways

dull magnet
#

just use a .ts file

median flax
#

i guess shrug

median flax
#

ermm what the flip

#

the docs are NOT helping

cedar olive
#

look at any other plugin blobwob

median flax
#

genius

cedar olive
#

but also try restarting your window

#

ctrl + shift + p -> Reload window

median flax
#

didn't fix it

#

still cant find the module

cedar olive
#

where is purple.ts located

median flax
#

1\Vencord\src\userplugins

cedar olive
#

what do you have open in vscode

#

the whole vencord folder or just the plugin

median flax
#

oh..

#

i only got the plugin open

#

💀

cedar olive
#

yeah open all of it

median flax
#

igh

#

now it works

#

ty

cedar olive
#

nice!

median flax
#

i've never made a plugin before Cryingsadsobstears how can i add a chat bar button?

#

or whatever these are called

runic talon
#

hey, MessageLinkEmbeds uses this Embed component:

const Embed = findComponentByCodeLazy(".inlineMediaEmbed");
#

what is that?

#

at first I assumed the embeds have HTML generated from scratch by the plugin

#

but it seems like this is some internal Discord thing

#

I know nothing about React so maybe I should just submit an issue about this instead of trying to fix it myself...

dull magnet
runic talon
#

where is this used in vanilla?

#

do you mean like, the base used for images and stuff?

#

or wait

dull magnet
#

for embeds

runic talon
#

Discord is dying ;_;

dull magnet
runic talon
#

oh, bot embeds

#

sorry

dull magnet
#

not just bots

runic talon
#

yeah websites and stuff, I get it now

#

I just was confused because I think attached video files and images are also called "embeds"

#

or maybe I just need to sleep it's 4 AM

#

oh yeah the code makes sense now, since those embeds consist of description, title, author and things like that, here a ChannelMessage component is placed in the description instead of text

#

ohhh it uses search results in the chatbox

#

no wonder this is broken

#

I think just the regular message component could be used

#

sounds very useful

#

ooo this is basically this

#

"Anonymous" is the div

#

it has a key, and some actual component as a child

cedar olive
#

it can't be

#

the div is not a memo

runic talon
#

I don't know React, I don't know what a "memo" is

cedar olive
#

memoized component

#

either no

#

that's another component

#

not the div

runic talon
#

yes it's a different thing, I said basically because I recognized this structure in the existing code

cedar olive
#

yeah but it's a completely different thing

runic talon
#

basically I am trying to fix this by replacing the ChannelMessage with the regular message component, whatever that'd be

runic talon
cedar olive
#

what do you want to do?

runic talon
cedar olive
#

fix what?

runic talon
#

fix this hell

#

the MessageLinkEmbeds plugin

#

it uses a search result component in the chatbox

#

which breaks Compact mode

#

I want to make it use the chatbox message component

#

that sounds like something that'd work

cedar olive
#

but it does

#

this is it

runic talon
#

well I know nothing about React but I know a thing or two about HTML

#

and this is the search result HTML

cedar olive
#

though the one you screenshot is the one that uses the AutomodEmbed

runic talon
#

or at least looks like it is

cedar olive
#

and that one uses whatever the automod thing uses internally

runic talon
#

well it definitely does something

#

because if I enable it, it works

#

as AutoMod embeds work with Compact mode

#

somewhat at least

cedar olive
#

it uses the regular message component

runic talon
cedar olive
#

the same

runic talon
#

nope, notice the lack of .avatar_ sibling and the message_ parent

obtuse kindle
proud parrotBOT
cedar olive
#

the parent is just a wrapper, it is not needed

runic talon
#

ok right forgot most people use Cozy mode
the Cozy mode HTML is indeed the same as the search result HTML, I think

cedar olive
#

I dont use cozy mode...

runic talon
#

wait ok right

#

I am wrong right

cedar olive
#

yeah

#

it's not an issue with the component used

#

just a css thing probably

runic talon
#

wait no I'm right, since when the .contents_ has a ._avatar child

#

it doesn't

#

what

#

what element is this screenshot even showing

cedar olive
#

a regular message

runic talon
#

Compact mode messages don't look like this

#

they look like this

#

unless it's search results

#

I swear I am not insane

cedar olive
#

trust me

runic talon
#

you must be using Cozy mode

cedar olive
#

the right component is being used

runic talon
#

that's how compact mode messages look

cedar olive
#

but my message does not look like that??

runic talon
#

yes it doesn't

#

so it's wrong

#

it must be Cozy mode

cedar olive
#

yes because I am not using compact mode

#

oh yeah it is cozy mode

runic talon
cedar olive
#

I forgot that was the normal

runic talon
#

so I am right
on Compact mode messages don't look like this, only on Cozy mode or if they are search results

#

and there was something that made me think this is search results

#

let me think

#

oh yeah the classes applied!

#

ok we established that I am not crazy

#

what now

cedar olive
#

it's probably css

runic talon
#

no it's HTML

#

the message isn't using Compact mode HTML

#

it's using search results HTML, or Cozy mode HTML, since it's the same thing

#

visible proof

cedar olive
#

oh

runic talon
#

decorations don't exist in Compact HTML

cedar olive
#

try removing the search result classes

runic talon
#

that won't change the HTML...

#

unless React is insane

cedar olive
#

I dont understand anymore what's happening

runic talon
#

search result/Cozy messages are inserted into a Compact mode chatbox

#

which breaks everything

#

is that understandable

cedar olive
#

oh

dull magnet
#

this is such an XY problem lol

runic talon
#

how

cedar olive
#

you could have told me that before...

runic talon
#

I DID

#

MANY TIMES

#

maybe in a horribly non-understandable manner

#

but still

dull magnet
runic talon
#

cool

cedar olive
#

that's what you need

runic talon
#

yeah Ven did that already if you look a message up

dull magnet
#

how does copilot know

cedar olive
#

yeah but that's also how you get if the setting is on or not

cedar olive
dull magnet
#

oh lmao

dull magnet
#

also idk how people use compact

#

awful

runic talon
#

Compact is great with some CSS

cedar olive
#

without avatars is horrible

runic talon
#

danke

#

and sorry

runic talon
#

reading the message history

dull magnet
#

theres nothing special about search it uses the normal message component

runic talon
dull magnet
obtuse kindle
runic talon
dull magnet
#

avatars so important

#

u can do smth like this

#

compact with avatars

runic talon
#

you know vanilla has Compact with avatars

dull magnet
#

how

runic talon
#

it's a setting

cedar olive
#

it's a setting

runic talon
#

in settings

dull magnet
#

oh im blind

cedar olive
#

but still looks awful

#

so much text

dull magnet
#

i fucking hate this dude

#

i love when i accidently hover it while trying to type in chat

cedar olive
#

look it's me twice

dull magnet
#

and ESC DOESNT CLOSE IT

#

WHYYYY

cedar olive
#

just disable the experiment for it

dull magnet
#

how

#

which is it

#

i disabled like 10 experiments and it was still there

cedar olive
#

i have no idea cuz I dont have it

runic talon
#

Discord likes me I think because they don't test it on me

cedar olive
#

but if I dont have it, then it's an experiment which you can control

#

I also still don't have simplified profiles

obtuse kindle
runic talon
#

same

runic talon
cedar olive
#

nah it's bad

dull magnet
#

just use vesktop

#

it has working afk on wayland

#

cause funny web

runic talon
#

is it visible that I don't use Vesktop

#

oh

#

nevermind

dull magnet
runic talon
#

it was to Colonial

obtuse kindle
#

wait i'm confused lmao

runic talon
cedar olive
#

but I personally still dont like it

obtuse kindle
runic talon
#

understandable

cedar olive
#

sorry for saying it was bad, didnt realize it was modified

runic talon
#

which wraps around the web client

#

and since everything on the native side can be controlled that way, it fixes many things

#

for example, screenshare with audio on Linux

obtuse kindle
#

oh that makes sense
didn't realize this was a web wrapper
and I guess i never tested if AFK worked or not lmao

#

i just saw someone ask about my BD plugin in this server a while ago

runic talon
#

well that depends on whether you use Vesktop or not

obtuse kindle
#

yea I;m using vesktop

#

fresh off flathub

runic talon
#

mm

obtuse kindle
#

then my work here is done 👍
good excuse to get VScode containers working at least

dull magnet
#

well it should be working fine

#

iirc there was a discussion about it on github

obtuse kindle
#

works fine for me 🙏

dull magnet
#

i don't really understand that issue

obtuse kindle
#

i would prefer discord not be aware that i'm typing if the window isn't focused, lol

dull magnet
#

wait what's "user input" @hexed plank

#

do you mean mouse/keyboard activity?

#

or chat input focused

hexed plank
#

Input device activity, yes, mouse and keyboard.

dull magnet
#

ohhh

#

i thought you meant that the input box is focused

runic talon
#

love ❤️ thank

#

not only for putting up with me being basically drunk from no sleep but also fixing it for me lmao

dull magnet
dull magnet
#

unless there's some portal on wayland for getting it

obtuse kindle
obtuse kindle
#

might be a proposal idk

runic talon
hexed plank
#

I personally use X11. Wayland would be a bit difficult indeed.

#

Does Discord official client know input activity on Wayland?

runic talon
#

the official Discord client is X11 only

obtuse kindle
#

yeah it runs in XWayland

#

which is... mid

runic talon
#

so, no it doesn't

dull magnet
#

wayland deliberately makes it so that only the focused app can get keyboard and mouse input and stuff

#

for privacy / safety

runic talon
#

one of the things left to solve for Wayland adoption

#

idk if it should be a portal or a protocol but it should be something

dull magnet
#

that's also why global keybinds are hard to do in vesktop

#

cause there's not really a good way to do that on wayland

runic talon
#

yeah...

dull magnet
#

there is a portal for keybinds but it's not very mature and not implemented by all desktop environments

dull magnet
#

just needs portals for such stuff and then it's gonna be perfect

runic talon
#

it makes sense but needs to be opt-out somehow

#

does the hacky way of running Vesktop under XWayland and redirecting all input to XWayland work btw

#

that's how people deal with OBS on Wayland

dull magnet
#

well programs in xwayland can access it i think

runic talon
#

assuming the compositor permits them yes, but can Vesktop do global keybinds on X11?

dull magnet
#

oh god this is cursed

#

so basically if you run an app in xwayland, it can access all keystrokes and stuff, but ONLY if any xwayland app is focused

as soon as a wayland app is focused it can't access anymore

#

that's so funny

#

so basically even if you run vesktop in xwayland, global keybinds will still be broken most of the time cause most other programs are gonna be native wayland

runic talon
#

that's also true yes, but at least some compositors can allow all XWayland programs to get all input all the time

#

I know KWin can do that

dull magnet
#

another solution is running vesktop as root xdd

#

(not recommended please don't)

#

but there was a vesktop pr that added a pipe that you can write commands to

for push to talk

#

that's probably the best solution for now

#

you just create a keybind with your DE/WM that writes to the pipe

runic talon
swift spear
#

is there any solid way to turn on/off patch depends on plugin settings?

iron epoch
#

look into betterNotes plugin

swift spear
north flame
#

Read the error

chrome folio
#

those are linting errors

north flame
old dawn
#

I have this too

#

but idk

#

it's weird

chrome folio
#

thats a notice, not an error

#

read it

amber basin
#

fake deafen

#

you wont get any more help with it

#

have fun

stiff dragon
#

i'll need help with slme@stuff on my plugin

iron epoch
vestal ginkgo
#

how could i get started making a plugin?
i do apologize if there's something obvious about this, but i couldn't find anything lol

rose fiber
vestal ginkgo
#

i did find that, but i didn't quite understand as it is quite vague with what you're meant to do
i cloned the repo and made a new folder, opened code there and tried initializing a node project and such, but the pnpm watch didnt work
so i tried opening code into the main repo folder and doing the pnpm watch and pnpm build but neither worked
it just gives "Cannot find package 'esbuild' imported from F:\Programming\Vencord\Vencord\scripts\build\build.mjs"

tight canyon
#

You haven't installed dependencies
pnpm i --frozen-lockfile

vestal ginkgo
#

ahh alright, thank you

balmy sky
#

How can i get if a user id has the "i'm new here, say hi!" in a specific guild

#

There may be a way to do it with join date checking

#

From what i can tell the user object doesn't contain it

dull magnet
#
  1. search for I'm new here to find string name
  2. search for .STRING_NAME to find the module where the string is used. scroll up until you find this id part
  3. search for MODULE_ID" to find modules that import it
  4. get the id of that module, then use wpex to into their own module for easy viewing, if they aren't already
  5. find the condition it is used on
  6. profit??
#

alternative: use react devbtools to inspect the ui element if applicable and jump to the component code

viral roost
#

wait you can right click to show function definition?????

balmy sky
#

That is insanely fucking useful thank you

dull magnet
viral roost
#

howthe fuck did i never find this by accident

balmy sky
dull magnet
#

look at its code

#

see how it works

swift spear
#

I'm totally lost.. can someone explain me what I'm doing wrong here? everything renders fine but when visibleNotes updates then in NotesDataRow userId and userNotes have correct values but userInfo.name and userInfo.id have incorrect values and <Avatar> too (next have to be strange explanation but I just place video attach here)

function NotesDataModal(...) {
    const [searchQuery, setSearchQuery] = useState(""); // search bar
    const [visibleNotesNum, setVisibleNotesNum] = useState(10);

    const usersNotesData: [string, string][] = useMemo(() => {
        return Array.from(usersNotesMap);
    }, []);

    const filteredNotes = useMemo(() => {
        if (searchQuery === "") {
            return usersNotesData;
        }

        return usersNotesData
            .filter(([userId, userNotes]) =>
                userId.includes(searchQuery) ||
                userNotes.toLowerCase().includes(searchQuery.toLowerCase())
            );
    }, [searchQuery]);

    const visibleNotes = filteredNotes.slice(0, visibleNotesNum);

    return (
        <ModalRoot ...>
        ...
            <ModalContent className={cl("content")}>
                {
                    !visibleNotes.length ? NoNotes() : (
                        <NotesDataContent
                            visibleNotes={visibleNotes}
                        />
                    )
                }
            </ModalContent>
        ...
        </ModalRoot>
}

function NotesDataContent({ visibleNotes }: {
    visibleNotes: [string, string][];
}) {
    if (!visibleNotes.length)
        return NoNotes();

    return (
        <div className={cl("content-inner")}>
            {
                visibleNotes
                    .map(([userId, userNotes]) => (
                        <NotesDataRow
                            userId={userId}
                            userNotes={userNotes}
                        />
                    ))
            }
        </div>
    );
}

function NotesDataRow({ userId, userNotes }: {
    userId: string;
    userNotes: string;
}) {
    const [userInfo, status] = requestUserInfo(userId);

    return (
        <div
            className={cl("user")}
        >
            {
                status === 0 ? LoaderSpinner() :
                    <Avatar
                        className={cl("user-avatar")}
                        size="SIZE_56"
                        src={userInfo.avatar}
                    />
            }
            <div className={cl("user-info")}>
                <Text variant="text-lg/bold">{userInfo.name}</Text>
                <Text variant="text-md/normal">{userInfo.id}</Text>
                <Text variant="text-md/normal">{userId}</Text>
            </div>
            <Text variant="text-md/normal">{userNotes}</Text>
        </div>
    );
}
function requestUserInfo(...) {
    const [state, setState] = useState({
        userInfo: {...}
        status: 0
    })
 
    useEffect(() => {
        ...
        setState(...)
    }, [])

    return [state.userInfo, state.status]
}
dull magnet
#

you're missing keys

#

every time you are mapping some data to components and the array may change, you need to use keys that are unique to the current data

#
data.map(v => <div key={v.somethingUnique} />)
dull magnet
#

also requestUserInfo looks like you're doing async. if so, use the useAwaiter hook

#

for example a good key in your case would be the user id, assuming every user has only one single entry in the array

swift spear
dull magnet
#

so why is that not desired?

swift spear
#

I'm was surprised that fallbackValue in useAwaiter options means only initial value instead initial value + value if factory function errors

dull magnet
#

i mean u can always just skip the fallbackValue and do it manually lol

#

no need to make ur own hook

swift spear
dull magnet
#
[userInfo,...] = useAwaiter()
userInfo ??= {...}
swift spear
#

there's onError callback in useAwaiter but I can't update userInfo there cos it's a part of useState

swift spear
dull magnet
#

yes

swift spear
#

ah, I thought it won't

#

then useAwaiter is fine, yea

#

thanks again

dull magnet
#

react functionality is pretty simple:
if you set state, it rerenders, unless there is some memo

proud parrotBOT
swift spear
#

good to know yes

flint bronze
broken mesa
#

2 questions, 1) how do i remove that white button on the second bar and 2) how do i change the size of the bottom bar to match the top?

#

nvm just needed the same class

dull magnet
#

2 progress bars why 😭

chrome folio
#

is there smth like "on settings update", so I don't need to force a restart after changing them

broken mesa
dull magnet
#

right click the album cover

broken mesa
#

too hard

chrome folio
#

cuz I tried onclick for a button and it did nothing

#

gonna try

#

ah nice thanks

outer solstice
#

gi

outer solstice
#

f

swift spear
#

idk how to test it so better just ask here: when user was added into UserStore can Discord remove it from there (to free memory or smth else)? basically question is "UserStore contains user entry forever?"

wind ferry
#

Is there a good documentation for vencord?

#

I wanna code my own plugin but the /docs one just dips a but in

balmy sky
#

The source code

wind ferry
#

i meant things like notifications

#

or badges

balmy sky
#

Anything you want to do, another plugin has already done most likely

#

You can read how they did it for a good idea of how it's done

rose fiber
shrewd hollow
#

how do i run the vencord build on vs code?

chrome folio
#

pnpm build

#

or pnpm watch

civic yoke
amber basin
#

ASSETEXPLORER IS DEAD NOOOOOOO

#

@cursive plank will fix

balmy sky
#

Wtf does it do lmao

amber basin
#

shows all svg icons

balmy sky
#

Oh sick

amber basin
#

heres what it looked like

cursive plank
amber basin
#

fair

#

imight fix it once i get home from vacation

cursive plank
#

Feel free to do the same for my other dead PRs, I kinda lost interest and don't plan on reviving them

#

Warning: shit code

iron epoch
#

can you hand it?

balmy sky
#

😭

amber basin
#

nuh uh

#

did you not read

iron epoch
#

I believe I can try to fix it

amber basin
iron epoch
#

oh.. let's pretend this conv never happened

#

the embarrassment..

crisp knoll
#

how to add them plugins

#

to vencord

rose fiber
crisp knoll
rose fiber
crisp knoll
rose fiber
#

no

crisp knoll
#

😔

#

is there any vids tho

rose fiber
#

get some js and ts knowledge before developing vencord plugins, youll probably understand the steps better after that (and will be able to actually do something functional)

echo siren
#

how do I get the user's gifs? I can't find the store that has it

bronze dove
echo siren
#

Thanks!

Vencord.Webpack.findByProps("FrecencyUserSettingsActionCreators").FrecencyUserSettingsActionCreators.getCurrentValue().favoriteGifs.gifs

33

cobalt radish
#

noob question, can I import npm packages on a plugin?

#

i mean, can I have a module on it without causing it to be a dependency on Vencord?

amber basin
#

no

#

you have to add it as a dependency to all of vencord

cobalt radish
#

this is sad

amber basin
#

what were you looking to add

#

small npm packages are fine i think

cobalt radish
#

Im planning on making a plugin to detect C2PA metadata, but that would require inclusing the C2PA lib
which would make so the lib where part of Vencord even for users not running the plugin

balmy sky
cobalt radish
#

(I mean, if it was ever added for real, im making it for me and I don't mind doing it for me only just like I do with my silly local plugins)

amber basin
#

oh ive never heard of thatt

#

that seems nice

viral roost
#

you can lazy load libs if necessary, InvisibleChat does that

amber basin
#

biggest issue is bundle size tho

cobalt radish
viral roost
#

but if you're using it only for yourself you're free to install deps (though thatll probably cause conflicts)

amber basin
#

remember when someones pr added a lib that added 40smt kilobytes to the bundle clueless

cobalt radish
#

thx

viral roost
#

souncs too niche to get merged into main vencord anyway

amber basin
#

yeah

cobalt radish
#

would be udnerstandable tho, that would make Vencord really fat

balmy sky
cobalt radish
#

I'll check that lazy load suggestion, seems about the best option

stiff dragon
#

big shoutout to idk

#

i forgot

#

but

#
// TODO: fix webhooks not sending, fix probable undefined when null issue, add sending as raw again (wanted to make it a checkbox but i cant find checkbox)
function WebhookMessageModal(props: ModalProps) {
    return <ModalRoot {...props} size={ModalSize.MEDIUM} className={"wm-send-webhook"} >
        <ModalContent className="wm-send-webhook-content">
            <Forms.FormTitle className={Margins.top20}>Webhook URL</Forms.FormTitle>
            <TextInput
                placeholder={"https://discord.com/api/webhooks/1235349630980722698/QQv06cMyTurEIU8nQsZRQMKxdmnnN6FA8Eaa9zbDqGwqeeACx9UAS6CcnVt7B3v8r8t2"}
                onChange={v => {
                    v = url;
                    console.log(url); // why the FUCK is it undefined.
                }}
            />
            <Forms.FormTitle className={Margins.top20}>Webhook Message</Forms.FormTitle>
            <TextInput
                placeholder={"Hello World!"}
                onChange={v => {
                    v = message;
                }}
            />
            <Switch
                key="wm-raw"
                value={jsonMode}
                onChange={v => {
                    v = jsonMode;
                    console.log("hi");
                }} // maybe switch? don't use shitcode where i make an int and set it to 2 and then check if the int is 2 thats too much shitcode.
            >Send as Raw JSON</Switch>
            <Forms.FormTitle className={Margins.top20}>Webhook Username</Forms.FormTitle>
            <TextInput
                placeholder={"byeoon"}
                onChange={v => {
                    v = username;
                }}
            />
            <Forms.FormTitle className={Margins.top20}>Webhook Avatar URL</Forms.FormTitle>
            <TextInput
                placeholder={"https://cdn.discordapp.com/emojis/1221015075922513990.png"}
                onChange={v => {
                    v = avatarUrl;
                }}
            />
            <Button
                onClick={() => {
                    Native.executeWebhook(url, {
                        content: message,
                        username: username,
                        avatar_url: avatarUrl
                    });
                }}
            >Send Webhook</Button>
        </ModalContent>
    </ModalRoot >;
}```
#

i have no idea

#

why it doesnt work

#

because

#

i checked logs

#

and for some reason everything shows up as undefined

#

my code notes might add a little clarity

swift spear
#

console.log(url) > console.log(v)

#

what's the url at all

stiff dragon
#

let url, message, username, avatarUrl = "";

#

trying to set the url to v when something is typed in

#

or uh

#

idk my brains confuised

swift spear
# stiff dragon ```ts // TODO: fix webhooks not sending, fix probable undefined when null issue,...
const [params, setParams] = useState({ content: "", username: "", avatarUrl: "" });

const onContent = (content: string) => setParams(prev => ({ ...prev, content }));
const onUsername = (username: string) => setParams(prev => ({ ...prev, username }));
const onAvatar = (avatarUrl: string) => setParams(prev => ({ ...prev, avatarUrl }));

// same thing with username/avatar
<TextInput
    placeholder={"..."}
    value={params.content}
    onChange={onContent}
/>

Native.executeWebhook(url, {
    content: params.content,
    username: params.username,
    avatar_url: params.avatarUrl,
});
velvet vessel
#

Any way to trigger push to talk with JS?

#

Or simulate a key press

velvet vessel
#

Got it const setSpeaking = (speaking) => Vencord.Webpack.Common.FluxDispatcher.dispatch({type: 'SPEAKING', context: 'default', userId: '128545421579517952', speakingFlags: speaking ? 1 : 0})

#

Now how do I get my own user id?

dull magnet
#

there are a shit ton of plugins that do

#

you'll figure it out

#

just look around

raven kernel
velvet vessel
#

I dunno, just poked around the source files

#

Is there any documentation or something?

#

Got it Vencord.Webpack.Common.UserStore.getCurrentUser().id, thanks

meager palm
#

how can i find like... the message component?

#

i want to intercept the onclick handler on the profile picture and username part

dull magnet
#

react devtrools

rocky falcon
meager palm
#

idk what keywords would lead me there

#

oh wait.

#

oh

#

wait how do i get react devtools to work

#

does it have to be on the desktop version

#

i am blind.

balmy sky
green vessel
#

how do I get access to react devtools?

dapper escarp
#

Is there any interest in me updating shiki so it supports more themes

#

Namely the Catppuccin themes

#

From my understanding, Vencord is using a fork of shiki right?

dreamy belfry
#

this plugin does not work after last update

dreamy belfry
elder cove
iron epoch
#

@elder cove @dreamy belfry

Canary Broken (open settings crashes / grey screen on load)

use stable.

please refer to the latest post in #announcements

elder cove
iron epoch
#

just use stable for now

elder cove
#

okay

#

just fix pls

iron epoch
#

omg

iron epoch
#

I am trying to fix BetterSessions patch

        {
            // Add the ability to change BlobMask's lower badge height
            // (it allows changing width so we can mirror that logic)
            find: "this.getBadgePositionInterpolation(",
            replacement: {
                match: /(\i\.animated\.rect,{id:\i,x:48-\(\i\+8\)\+4,y:)28(,width:\i\+8,height:)24,/,
                replace: (_, leftPart, rightPart) => `${leftPart} 48 - ((this.props.lowerBadgeHeight ?? 16) + 8) + 4 ${rightPart} (this.props.lowerBadgeHeight ?? 16) + 8,`
            }
        }

but this match /(\i.animated.rect,\{id:\i,x:48-\(\i+8\)+4,y:)48-\(\i+8\)+4(,width:\i+8,height:)\i+8,/ is evil

how do I de-evil it erm

#

@green vessel what husk

chrome elbow
#

escape plus

iron epoch
flint bronze
#

this code should be bombed

flint bronze
dry patio
#

idk where else to put this but uhhh

#

this will negatively impact the keywordnotify economy

hoary pilot
#

vee likely limited interaction because vencord exploded

#

and idiots were opening issues

amber basin
#

@vernal mortar discord is compiled together using webpack

#

the functions in vencord are for searching thru discord's webpack modules to find exported components

iron epoch
#

what with whitenames opening random threads?

balmy sky
#

Probably something to do with the chat lockdown

dull magnet
#

they cant write in threads either

balmy sky
#

😭

dry patio
#

yeah i had a contact a mod because i couldn’t write in the thread for my own plugin

#

😨

balmy sky
#

Seems legit

dry patio
#

very opinionated on the way this place handles customer support sometimes

balmy sky
#

"customer" 😭

dry patio
#

client, user, customer, same thing

dry patio
#

they also close my pr 😢

#

is the inability to open a new one temporary or am i just forever doomed

iron epoch
dry patio
#

i haven’t touched it

#

i was informed by someone else that it got closed

woven lion
iron epoch
woven lion
#

oops

dry patio
#

what the freak

#

well

#

either way

balmy sky
dry patio
#

i can’t reopen it

woven lion
#

your force push probably did it

#

i have reopened it

dry patio
#

yippee!!

#

maybe in 2026 it’ll get looked at

woven lion
#

plugins in the mod atm are the ones that will be taken care of first

dry patio
#

wdym

woven lion
#

because of the update

#

we wont be looking at plugin prs too much

dry patio
#

i already fixed my plugin for the update

iron epoch
woven lion
#

until every plugin in the mod is confirmed working

woven lion
iron epoch
woven lion
#

so its just best that we sort everything else out first and then merge in new stuff

dry patio
#

understandable

#

by a month you think you’d be done?

woven lion
#

dont think itd take that long lol

#

but we'll get around to it when we get around to it

amber basin
woven lion
#

we have some other things in the works too like translation which includes plugins so we'll have to update all the plugins to support that too

dry patio
#

is there a beta system for vencord

woven lion
#

😭

woven lion
dry patio
#

yeah but an official one

#

like

woven lion
#

that is the official one

#

you use a git install

#

if you want to try stuff

dry patio
#

in my server i have a beta team

#

and i specifically give them things to test

woven lion
#

no

dry patio
#

and they report back to me

#

that kind of system

woven lion
#

a lot of the devs here run devbuilds

#

you can just ask people to try things out but there's no guarantee

iron epoch
amber basin
#

dont ask me

iron epoch
#

oh okay

dry patio
woven lion
dry patio
#

do a quick review of all the prs to make sure nothing is virus

#

merge it all into a beta form

woven lion
#

and not everyone wants to review prs

#

or test plugins

#

or whatever

#

we already ask devs to do that

#

it doesnt happen

dry patio
#

and then give people that and be like “ok if someone fucks up tell me”

amber basin
#

if someone wants to test prs they will

woven lion
#

yeah you're describing stuff we've already got besides a form

amber basin
#

dont push people into doing it

woven lion
#

no one really wants to be a dedicated tester for stuff, if they want to test they can do

dry patio
#

if all plugins are somewhat useful, all plugins will eventually be tested by people who are just doing day-to-day activities

#

if you can’t reliably test certain plugins because nobody uses them, perhaps the plugin shouldn’t be included in the first place

woven lion
#

..then by that definition, yours wouldnt be included because no one is testing it

amber basin
#

thats not how that works

#

lmao

dry patio
woven lion
#

and by that definition, some* plugins wouldnt be included either, some have merged with only the dev and vee testing it

#

again, not everyone wants to be a dedicated tester, and thats fine

#

the people who do are other plugin or core devs

#

so a testing team would be redundant

#

its just another role for a subset of a subset of people who use the mod

#

and we would have no motive to push them into doing things, the best you can do is ask around

dry patio
#

you wouldn’t need dedicated testers, just a large group of people who are willing to use a bleeding-edge version of vencord that might have a few links it

woven lion
#

so the devs

dry patio
#

not large enough

woven lion
#

we arent getting more people than that

amber basin
#

i dont know what you want us to do lmao

#

thats all youre gonna get

woven lion
#

most people wont or cant install the devbuilds of vencord, and to be completely honest if you want to start teaching people how to maintain a git installation thats detached from master so you can try PRs out, be my guest

#

it is an uphill battle

#

right i wanna go home

dry patio
#

have an alpha dev branch on the repo where all prs from existing devs that aren’t straight up virus get merged

#

then, you have a centralized repo to test all the brand new things

woven lion
#

no

#

that's quite literally what the dev branch is for

amber basin
#

the amount of idiots who would use that and complain that vencord isnt working

#

plus that would be horrible to maintain

woven lion
#

it would increase our PR volume massively by people who want to make updates to their existing things

amber basin
#

the amount of prs that vee themself would ahve to review

#

yeah

woven lion
#

it is much better to encourage people to work on their own forks and branches until they have a fully working plugin

#

PLUS it reduces the likelihood that changes conflict and will break each other with nasty interactions

#

if you want to structure it like how discord does their update branches:

  • canary wise, we have an unlimited number of deviations with all sorts of plugins that people self-maintain
  • ptb lines up with dev
  • stable lines up with main
dry patio
#

canary works because it’s one thing

woven lion
#

okay more accurately then

#

dev

dull magnet
#

thats the worst idea ever

dry patio
#

i can think of worse ideas

woven lion
#

look camila in the end its not going to work this way

#

you wont get enough people to be beta testers that actually do things, and having a unified "experimental branch with everything soup" will lead to tons of problems

dry patio
#

that’s js canary

#

but yeah i don’t really expect things to change

woven lion
#

canary is more stable than everything soup

dull magnet
#

the current model is perfect the way it is and not changing

#

if anything we might let u choose between main and dev branch (we already have a dev branch, for grouping & testing merges before they get into main), but that'd be the most we'd do

woven lion
#

yes prs are slow but thats because of the lack of people wanting to review and test, and you wont get any more than we do now by having a dedicated team

dry patio
dull magnet
#

the main issue is that there are about 10 new prs every week and with that + the amount of backlog, it is impossible to cater to every pr for just one person (that's me)

#

if not even more

dry patio
#

i meannn there’s nobody forcing you to review every pr by yourself

#

but that’s probably not changing

woven lion
#

vee has to review them to go in because no one else does :p

#

if we had more community reviews stuff would go so much quicker

#

and yes me and nuckyz will merge the occasional thing but we are also busy with other things so we cant always substitute

dry patio
#

concept: in order to get your plugin reviewed you must review 3 other plugins

woven lion
#

terrible

amber basin
#

thats a horrible idea

dull magnet
#

that won't really work

dry patio
#

💀

dull magnet
#

being able to give a good review requires decent knowledge & experience

woven lion
#

especially for first time contribs

#

thatd suck

dull magnet
#

there are only few people with that and none of them seem to have much interest reviewing stuff

#

so it's just me

dry patio
#

so it’s an information problem

dull magnet
dry patio
#

not enough people know enough to be able to review well

woven lion
#

(i dont have this knowledge)

#

(im good at writing things but not reviewing)

dry patio
#

plugin review course

amber basin
#

what

dry patio
#

educate the masses on plugin review

#

idk

amber basin
#

no???

#

lmfao

#

thats horrible

junior cove
#

If the blind leading the poor wasn't a proven method, why would we all know about it?

dry patio
#

the devs not the end users

amber basin
#

yeah

#

i know

iron epoch
dry patio
#

i’m trying to

#

it’s still early

iron epoch
#

when I started creating plugins I had no idea how things even work and reviewing requires experience to be vaild, creating a course won't give experience

#

sqaaakoi can approve, he saw my code husk

dry patio
#

not all devs are entry level

amber basin
#

most are

dull magnet
#

you seem to heavily underestimate how much work and care goes into review

amber basin
#

yeah

dull magnet
#

if i could pay some indian to review prs for me i fucking would

amber basin
#

i dont think you understand how the project is layed out

#

its not like geode

#

its a community project

#

we cant trust everyone

dry patio
#

geode 🤤

amber basin
#

dude

dry patio
#

hi

sly flower
#

geode website svelte rewrite moment

dry patio
#

i feel like i’d be okay at reviewing pr

#

💪

amber basin
#

do i need to review your pr to test that

#

:3c

dry patio
#

sure

amber basin
#

off to a great start

dry patio
#

now idk what that means

amber basin
#

then you arent fit to review

#

simple

balmy sky
#

Would you rather

- stock vencord has horror code plugins with shit quality
- wait for prs to be reviewed

dry patio
#

well i’m also tired

balmy sky
dry patio
#

and on mobile

sly flower
#

just installs and tests stuff

dry patio
#

i know it’s a github action

#

if i was on computer id click details

sly flower
#

It just installs dependencies and makes sure it can compile on desktop and web

#

Validates plugin structure and lints

dry patio
balmy sky
stray imp
balmy sky
dry patio
sly flower
#

pretty sure that's for commits

stray imp
dry patio
#

oh i know why

#

its because all the latest stuff is on the new branch i made

#

prbranch

#

and i was gonna open a new pr

#

but then it wouldnt let me

stray imp
#

you have to push your changes to the branch of yours that your pull request is attached to

dry patio
#

i did that just now

#

last night i tried to just forget the old pr and make a new one

amber basin
#

hey @dull magnet do plugin starts rerun on account switch

dry patio
#

but everything is synced now

amber basin
#

jesus the amount of comments on this

#

im only 2/3 of the way thru

amber basin
balmy sky
amber basin
chrome folio
#

if err != nil {}

amber basin
#

go wild

dry patio
#

okay wdym make them more readable

#

popout is popout

amber basin
#

wtf is the find tho

dry patio
#

it used to literally be called ItemPopout

amber basin
#

how do you know thats a popout

#

what is this

#

not a popout

#

lmao

dry patio
#

erm

#

because it used to be a find by props

#

for ItemPopout

#

and then the update broke that

chrome folio
dry patio
#

so i cross-compared and found that that little section of code is only used in the original ItemPopout thing

#

that is how i know with certainty its a popout

#

idk what you want me to do to make it more readable, the class name got removed

amber basin
#

two finds

#

lmao

dry patio
#

erm

amber basin
dry patio
#

is there a find by regex

dry patio
#

i think .loadingMore&&null== will work without regex anyway

amber basin
#

oh

#

no then

dry patio
#

wha

amber basin
#

Dispatch.dispatch(...) called without an action type

#

so much better

#

wont be ate with minification in the future

dry patio
#

i guess they both work

#

if i remember, UserStore.getCurrentUser didn't give me the information i needed

amber basin
#

lemme check

dry patio
#

look inside it

bronze dove
dry patio
#

wtf

#

did not used to be like that

#

also

#

what 😭

#

its not my class

#

notmyclass

amber basin
#

oh wait

#

i assumed it was stored in a constant

#

nvm

#

sorry

#

whoopsie

balmy sky
#

Need

#

Instantly

#

WAIT IT'S MERGED LMAO

dry patio
#

i dont think this should be a problem

#

dms are caught by the top one, with author id

#

actually no i think its just caught with channel id cuz dms can be a channel

#

i'm pretty sure i do this because of some weird react hook stuff

#

because later i do this

viral roost
#

and the guild id is @me

dull magnet
#

anyway nothing new will be merged for now :p

#

cause of the big breakage

amber basin
#

ah, i didnt remember if dms were considered @\me internally or just in the url

viral roost
#

remember the funny MuteNewGuilds bug trolley

amber basin
dry patio
#

wouldn't doing this make it break because the class rules are defined in a separate css file

amber basin
#

it keeps everything in the css the same

#

just prefixes class names

#

makes code more readable

#
/**
 * @param prefix The prefix to add to each class, defaults to `""`
 * @returns A classname generator function
 * @example
 * const cl = classNameFactory("plugin-");
 *
 * cl("base", ["item", "editable"], { selected: null, disabled: true })
 * // => "plugin-base plugin-item plugin-editable plugin-disabled"
 */```
dry patio
#

so i would do like

#

const cl = classNameFactory("vc-keywordnotify-");

amber basin
#

yea

dry patio
#

can i just wrap it in a try tbh

#

this is so much to nullcheck

dull magnet
#

please don't use res.props.children.props.children.props*

dry patio
#

alternative?

woven lion
#

what are you trying to do

dry patio
#

i call a discord function to render one of these things for me

#

and then i need to make the "x" button remove the message from the log

woven lion
dry patio
#

and then i need to also add highlighting

woven lion
#

use a patch to add your custom logic

dry patio
#

i do

woven lion
#

you're not

dry patio
amber basin
#

youre monkeypatching onclick

#

regex patch it

woven lion
#

alternatively, use it as an actual component instead of this way

#

then you can wire up the button properly

dry patio
#

ill work on it

#

ok i turned delete into a patch

#

yummy yummy

rocky falcon
#

can someone point me in the direction of simulating a profile popout?

#

like having a popup of a profile, with customised banner, pfp, roles, pronouns, etc. etc.
not askin for handhold, just, where would i start?

dry patio
rocky falcon
#

either or

#

i just wanna be able to make a profile popout where i can edit the data (username, roles, banner, etc.)

dry patio
#

open the react inspector and find the component for the popout

rocky falcon
#

is this what im lookin for?

#

this seems closer to what i want

dry patio
#

yeah

rocky falcon
#

could ya point me where ta go from here?

#

sorry if im being pestersome

iron epoch
#

how to get the private channels?

#

(dms)

oak sundial
#

Couple questions, that I haven't seen answered anywhere (could've also missed them who knows!).

  1. I assume its currently impossible to send a request with RestAPI with headers? Specifically what I have in mind here is adding support forX-Audit-Log-Reason.
  • Its how bans have reasons, but right now you have to unban through the guild's settings and thats a pain in the ass and you can't set a reason. But the request supports the header but I don't see a nice way to do this.
  1. How would I one of my contextMenus appear only in a guild, even better if I can permission gate it like Timeout name etc etc? And if I can do this, how do I get the Guild's Id it was opened from?

Hopefully if anything is out of scope/not supported we can work towards a fix but if there isn't a way to do what I'm after i'm willing to compromise in some way.

dull magnet
#

impossible to send a request with RestAPI with headers
no it is possible

#
RestAPI.post({
    url: Endpoints.Stuff(...),
    reason: "meow"
})
dull magnet