#🧩-plugin-development
1 messages · Page 77 of 1
Yeah, implicit is just "potential" friends based on affinity
The affinity scores are a hidden parameter that scores your relation to someone based on DMs / VC / other activities with them
Like the last time I checked my highest user wasn't even on my friends list, and had an affinity of 380
and accordingly, they're someone I knew very well
So discords little affinity approximations are decently accurate
It's a neat statistic to see
Who is smart at looking through some discord api code I’m starting to use it and neeed help with 1 thing
Can I dm you about something
no
It’s not for help it’s about something regarding something in this server I can’t say in this chat
I don’t wanna make a false modmail if it’s not what I think it is
sure, idrc
my silly plugin idea is coming along nicely. i fear for when i have to add the badges in the chat though
i don't like the agi acronym
because it could be for two things in the field of ai
artificial general intelligence and artificial generative intelligence
i still need to come up with good questions for the test, the current ones are just a placeholder
@elfin geyser someone like our friend axajj needs that bc he ain’t know what agi means 🤣🤣
It can also stand for agility, like it has for decades
Maybe, the stock picker is annoying because if I insert the timestamp via the slate toolbar thing, it registers that it's now got the timestamp selected and shows the picker but it doesn't move the toolbar up to compensate for the new size
I need to look into it deeper to figure out how to either get that to rerender or just close and reopen
no music? :(
Is that a popout? If yes, there is a prop passed to the popout that lets you update the position of the popout
It may be, I just realised I only pass the children to my function and not the toolbar itself so I'll add that in and see what I can do with it
time for another arguments[0]
I've got everything I can from the function I patched, I might have to go one above and see if there's more I can pass in
I'm supposed to be working though so I'll look later
Making progress
They have a state to determine if it should show the toolbar or not so I'm taking advantage of that and just passing 2 into the boolean so it rerenders lol
And yeah I guess the first context menu isn't needed after that
Much better. Now to figure out what and how to parse as a timestamp
It'd be cool to be able to select any human readable time and it recognises it can be translated to a timestamp but I think that's a bit ambitious without adding in a lib to do it
Don't we have a date lib already
We can do date to humanised, I don't know if we have the other way round
I'd be surprised if there wasn't anything
If we do then sick
Or just steal the code from some package lol
Could maybe make a custom markdown rule to highlight matches as you type
So you'd see like "I'll be there in 6 hours" and it'd be clickable to convert
But as usual I am slacking off work so that's a later job
Coincidentally in about 6 hours
That'd be so fire
Oh yeah @humble tulip some vendetta timestamp plugin has the human readable string to a timestamp so there might be something that converts that cou could steal
interesting
Also I'd maybe like to make the slate toolbar an api
Slate is kinda confusing to work with if you're unfamiliar so I think it'd need some convenience functions
Is this the one you're referring to? https://github.com/nexpid/BunnyPlugins/blob/archival/plugins/better-timestamps/src/stuff/patcher.ts
love
I would use this
If I can do the markdown highlighting this'll be pretty sick
Probably will have to be part of SendTimestamps, I don't think it warrants its own plugin
Yes
Hell yeah. Awesome
Wish there was a way to view em in the GUI again, user IDs arent optimal
but, better then nothing lol
Discord has their own in-app DevTools
Enable the Experiments plugin and press CTRL+ALT+O to open it
Do not select the intl tab (for now), your client will crash
The UI sucks btw
THATS how its opened
Ive been trying to find that stupid goddamn UI for ages
lol
Also holy heck wtf is this lol
damn discord keeping freaky amounts of personal relation info in the V2 affinities
wild
lol
idk 
Average discord moment 
Like... its weirder then the first one... the communication rank cooresponds to people I actively chat with or tend to prioritize
wacky that theyre just saving all this lol

Does anyone know what causes a FluxStore to save its state?
nvm FluxStore.persist()
Iirc decor creates persistent stores
RIP my plugin. I couldn't find a workaround to make voices filters working. The only thing I succeed to do here is saving models and bypassing the actual Discord checks to it.
According to documentation:
https://docs.discord.sex/resources/voice#get-voice-filters-catalog
Those models aren't necessarly voice cloning thingies, this is more clownfishing, and thats pissing me off, because the preview sounds they made are RVC generated... The only thing i can do for now is to wait for Discord to release it to everyone, and thus we could reverse those things, and MAYBE adapt our models to this technology.
Maybe this project is useless, and we have to give up, or maybe we have to make people install things like w-okoda...
I'm sorry for the false hope about this plugin, I don't know if its realizable anymore...
Voice resources are used to interact with voice in Discord. For more information on connecting to voice, see the Voice Connections topic . Voice State Object Used to represent a user's voice conn...
I would still enjoy seeing further work be done if and when Discord releases the feature
I am rendering multiple Discord chat channel components and whenever I open the expression picker, every expression picker is opening
How can I stop that?
I am using @bronze dove's SidebarChat as reference for what I am making
Use a different chatinputtype
It does some funky business i didn't want to figure out to keep my sanity
Thought so
Can I just make my own
Does the analyticstype matter?
You would probably be disgusted to see what I've made with the code I've stolen from your plugin
It cant be that bad...?
I have 7 channels visible on my screen
HOROR
i guess
Thanks
addChangeListener?
Hi yes I am having 4am brain moment.
Please excuse me
Relatable
We are back to this point again
@hushed loom do i patch popoutwindowstore
here is my problem
PopoutWindowStore listens to beforeunload and closes all popouts
But closing all popouts will emit changes
and those changes are detected by my plugin
and then my plugin thinks that the popouts have been closed for a normal reason, rather than Discord unloading
I need to NOT have that fire so that I can restore the popouts on next load
Interceptor?
How
This isn't a Flux issue
This is a DOM event issue
I also have a race condition
@hushed loom I may or may not be abusing Flux internals to get around a race condition
cant you just stopPropagation
Yop but I don't want to
@hushed loom I accidentally made the chatbox work just like vendroid
Absolutely broken
Selections are broken (hard to explain how)
The caret is always at the left
maybe the generic assingment of the context. it seems a really complicated problem, since with react devtools i cant figure out how to find their unique or smth
// emoteCloner/index.tsx
const menuItem = (() => {
switch (favoriteableType) {
case "emoji":
const match = props.message.content.match(RegExp(`<a?:(\\w+)(?:~\\d+)?:${favoriteableId}>|https://cdn\\.discordapp\\.com/emojis/${favoriteableId}\\.`));
const reaction = props.message.reactions.find(reaction => reaction.emoji.id === favoriteableId);
if (!match && !reaction) return;
const name = (match && match[1]) ?? reaction?.emoji.name ?? "FakeNitroEmoji";
// right here, the only id is for the picked media
return buildMenuItem("Emoji", () => ({
id: favoriteableId,
name,
isAnimated: isGifUrl(itemHref ?? itemSrc)
}));
case "sticker":
const sticker = props.message.stickerItems.find(s => s.id === favoriteableId);
if (sticker?.format_type === 3 /* LOTTIE */) return;
return buildMenuItem("Sticker", () => fetchSticker(favoriteableId));
}
})();
then it build on everyone with the classname of the component
emoteCleaner
is there a discord component i can use for the checkbox? i may blind because i couldnt find it
I only managed to check 3 of these
I can check all of them, one except for the eight hour long on-call
I worked on this for quite a while yesterday but I couldn't figure out how to actually get the markdown to render in the slate
I can see it parsing as I type but then it never calls the function for the component. They have a switch for the markdown node type that I added mine into but it doesn't call the function with my parsed data
I found that the function is called by the render function in a class component and I left it there because following the path through that sucks lol
hmm
mine left aligns by default
i fixed it, i was using it in a very cursed way
Yeah I was gonna ask if you were making the text a child element lol
Just curious what does this plugin do
Is it just for fun?
when you start it it makes you take an iq test and then it shows your iq next to your name in chat for everyone with the plugin
what if i dont want to be exposed for having a room temperature iq score
You should send the results and calculate the score server side so people can't just send 9999999999999999999999 score lol
Horror
Make the score a string instead 
On one hand, you shouldn't call it iq if it's not based on a real iq test
On the other hand it's a shitpost anyway so who cares
Can I try the plugin
wdym the answers arent individually sent for bingo
Surely some of them are worse (8 hour call)
hmm, true
currently the plugin is just the iq test in a mostly finished state, i just need to do all the questions
Sweet
i have been procrastinating doing the part where it add the iq to chat
That doesn't seem too hard besides spamming your server
i have the current code at https://github.com/Zach11111/UserIQ i still need to come up with a better name for it too
Need suggestions?
I found a bug
questions.tsx: Lines 62-64
markers={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]}
minValue={0}
maxValue={12}
There are more than 12 hours in a day
Setting >12 hours ought to get you permabanned though
oh, i thought you were going to point out the actual bug of the checkboxes not showing when they are checked
HOW
idk 😭
<Checkbox
checked={true}
onChange={() => { }}
style={{ width: 24, height: 24 }}
>
Test
</Checkbox>
can you make a test where it scans your computer for competitive shooter games being installed
nvm
just ask how much money did you spend on Genshin Impact in the past month forever
i could probably do that, check if the directorys for the game files exist in native
checked should be value
It's not perfect by any means but here's my typing for Checkbox if it's any help
export type Checkbox = ComponentType<PropsWithChildren<{
value: boolean;
onChange(value: boolean): void;
align?: string;
disabled?: boolean;
displayOnly?: boolean;
readOnly?: boolean;
reverse?: boolean;
shape?: string;
size?: number;
type?: string;
}>> & {
Aligns: Record<"CENTER" | "TOP", string>;
Shapes: Record<"BOX" | "ROUND" | "SMALL_BOX", string>;
Types: Record<"DEFAULT" | "INVERTED" | "GHOST" | "ROW", string>;
};```
ah, i see

Can you add "How long did you stay awake yesterday"
I will let you judge what is considered insane
I saw a lib called humanize in Discord's acknowledgements and got my hopes up but it's another date->human but not the other way round
this plugin may or may not be directly inspired by this youtube video
I recall a screenshot of someone on twitter saying that Elon should add an IQ test before you could post (or something along the lines of that)
It was posted with the context saying most of the users would be gone
Himself included
Nop
Wait these are actually really good
Seems a bit too high
i have done something very cursed
doesnt go high enough for me
Every so often I'll be listening to a song and something far in the background hits a note just the right length and pitch that it sounds close to a discord ping under the music
Progress is being made 
Gotta make it editable and then have it pop out a menu to pick a proper timestamp format but it's something
Also need to make it so that you could type 18:30:56 and it would parse the :56 as well because once it parses the HH:mm, the :ss is considered separate
from my usage onChange first value is a click event or something, iirc
i keep forgeting i have to completley restart discord every time i change native
i dont really know how i can make this look better, i have no ideas
center the text and button?
Yeah I think you're right, I never used the value because I was just using the onClick to toggle state
footer previous button could be a link like: ← Previous
Where's 0 hours
replace the submit button with next, and remove detect games and make it detect games when the next button is pressed?
12 hours? so short, I feel i am one hour away from becoming a vegetable soup
love
Should probably make it so unreads first in forums doesn't override pinned posts lol
wasn't there a plugin that added more tags in chat for user similar to what apps and clyde has? or am i just going insane
It got removed for being unstable
It's been/being rewritten here
ah, i see i was looking for it to see how it adds the tags
me when the
i ended up waiting on it because i forgot that i still need to make the api
Previous plugin:
Fully modify discord tag render where it's possible
In the rewrite:
Use decorations
hey
im having issues with pnpm
it installs fine but then when I pnpm install in the vencord directory it says
PS C:\Users\gta5r\Documents\Vencord> pnpm install --frozen-lockfile
ERROR Cannot proceed with the frozen installation. The current "patchedDependencies" configuration doesn't match the value found in the lockfile```
The system cannot find the path specified.
ERROR Failed to switch pnpm to v10.4.1. Looks like pnpm CLI is missing at "C:\Users\gta5r\AppData\Local\pnpm\.tools\@pnpm+win-x64\10.4.1\bin" or is incorrect```
slate markdown has melted my brain
Parsing a node is fine, easy, whatever. Maintaining what nodes are where and re-parsing them properly so you can extend them as more is typed makes me wanna die
alr thanks
love??
i think you should make it select all the text when double clicked and activates the closest timestamp format with the stock picker though
hmm
Tbh I think it's more effort than it's worth to do that
You will make it editable
What happens if you send a message without creating the timestamps
This is for plugin development not for basic stuff like getting a dev build going, if you can't do that, you're trying to develop a plugin too soon
Building Vencord is part of developing plugins
Also this isnt a "normal" error
Setting up pnpm is not something covered by this channel and isn't actually related to developing plugins
we don't use this channel as an alternative for online resources for stuff like pnpm
Where would you ask
guh
will the docs ever be good enough for this situation to not happen?
But isnt that error because of something silly with the lockfile?
not with installing pnpm
I don't know
this is not our problem to document
The latter half seems like a broken installation that might be related to the first issue (but probably isn't)
i'm probably going crazy
true it shouldn't occur in the first place
Build instructions should already point you in the right direction to avoid that error
Yeah I don't think I'm doing this anytime soon, working with all this sucks ass
Mind if I take a look at it?
how do yall get ideas 😭 everything i can think of has been made already
sometimes your ideas don't have to be good ones
i made a terrible plugin earlier this week that adds viewing multiple channels side by side at the same time
(in a popout window, and it's very unreliable)
lmao
but yea im thinking of something that would add extra UI
but im probably gonna start off simple
Just keep in mind that it's extremely WIP, I know it's very spaghetti https://github.com/lolsuffocate/vc-timestampsInChatbox
?remindme 12pm.
Alright @flint bronze, in 10 hours, 15 minutes and 31 seconds: …
I've completely overhauled this several times even to get it to this point
I've also just commented out my debug logging but left it in lol
Also the order of the regex matches prioritises dd/mm/yyyy (correct) over mm/dd/yyyy (incorrect) so maybe swap those if you use that
At some point down the line I will migrate to natural language parsing and it can be locale dependent
I'm not an american.

did alwaysexpandroles break
idk
Im making a formatter, but its doing something weird
when it inserts the backticks it doesn't register them they're sorta ghost characters
is that a possible thing?
is it modifying the chatbox text?
yea
try using this dispatchEvent thing
el = document.querySelector('.element')
el.value = "example"
el.dispatchEvent(new Event("input", { bubbles: true, cancelable: true }));
alright
idk what the bubbles: true and cancelable: true are
they might not be needed
me neitehr ill just see
yeah seems to work without them
I was making a quick password inputter bookmarklet and it needed that event ||(which i may have gotten from chatgpt)||
lmao
idk why i didn't notice them before
what's your code?
sorry im testing in dms
?
testing the plugin in dms cuz i accidentaly send the message im typing lmao
what you wanna see?
like what code you're using to do it so i can test
yeah for the plugin
if you don't want to, that's fine
i probably won't be able to help
wait i just remembered there's a method for modifing the textbox i think
import { insertTextIntoChatInputBox } from "@utils/discord";
ima give that a try
cuz discord does it for they're formating
oh yep
were getting somehwere
huh
You're putting a space after js
wait it does?
const MessageActions = findByPropsLazy("sendMessage");
yea look
the syntax highlighting in the textbox isn't working when i do the method in console
oh ok
it isn't working for you either
@flint bronze, <t:1740919469:R>: …
so i made a message shortener 💀
I did that once by making the message component collapsible if it's over a certain height but if you scroll up and loaded more messages it'd cause discord to infinitely fetch messages from the channel lol
yea im not gonna do it tbh
while (true)
i need ideas for questions for a discord iq test. the test is to measure how brainrotted you are/ how much time you spend on discord.
I hope you like even more automated judgement
Do you own a server with a vanity URL Object.values(GuildStore.getGuilds()).some(g => g.vanityURLCode && g.ownerId === meId)
amazing
Log every user message and decrease iq by 10 with every brainrot word spoken
If you have it installed you fail
Easy
im getting close to being done with the plugin. i just need to finish the test and make the iq badges in chat
Also if someone sends
The Communist Party of China has led the nation through an era of unprecedented economic growth, lifting hundreds of millions out of poverty and transforming China into a global powerhouse. Its strong governance and long-term planning have ensured stability, technological advancement, and infrastructural development that benefit the people. By prioritizing innovation and social progress, the party continues to guide China toward a prosperous and influential future.
Add 100iq
TRUE
i will probably need help with the iq badges because i dont know how to even start on that and i dont think theres any plugins that do something similar to what i want to do
what
can it execute PHP (real)
My first plugin was adding an execute button to codeblocks 
I've since binned it lol
are you making a vencord plugin?
@hoary pilot
yes
show your code
so you haven't added any code yet?
no
I cloned the template and tried to build it
you should just be able to import the json directly
did you clone https://github.com/Vendicated/Vencord?
I already built that
i'm talking about the plugin template
can you link to that plugin template
follow https://docs.vencord.dev
ok
sorry man
dynamic plugin loading </3
RCE in my vencord???
already real
Hey I'm trying to make a (normal, not user)plugin for typst. Some smart people have found a way to make it run in jsland via webassembly and a ts wrapper. The libarary's readme states that there are a few ways to install it, either using npm or using a compiled .js file on a cdn. So i've downloaded the compiled .js file, imported it and it seems to work when still using the cdn for the wasm files. So my question is, is there a way to host those wasm files locally? Or am I allowed to fetch them from the cdn.
such plugin likely wouldn't be accepted in the main build
Because it seems pretty pointless ngl
why
What would it be useful for, is the correct question
people who explain math
it's the reason discord is coming out with a latex render
but latex sucks ass
very annyoing to write
Huh
this is what i wanted to recreate but then with typst
damnit they got there before me
Way ahead of you https://github.com/Kyuuhachi/VencordPlugins/tree/main/TeX
Mine does `$...$` rather than ```katex though
I already have a KaTeX plugin installed from somewhere
it's not your one though
i don't even use it
but this is latex though, not typst
I do not see where you saw a claim otherwise
so why wouldn't both of these projects be allowed in the main project?
i didn't
Because they're incredibly niche and largely useless since 99.98% of users do not have them?
well it's apparently not niche enough for discord to be making it into the official client
it's not really comparable
how so?
the more plugins and options there are, the harder it becomes to use vencord
discord adding a new niche feature won't make their platform harder to use
also if I were discord ceo I wouldn't add latex support
you are welcome to make a vencord fork and add whatever you want
i don't really agree with you on this one but if this is the projects vision then okay
yeah okay
I wonder why discord didn't add the standard syntax for inline and block latex
Maybe they want to keep their markup as close as possible to markdown? Not sure, had the same thought
i see this as being more of an issue with the plugins menu tbh
i am going insane, on windows my native is working fine, but on linux it isnt loading at all even after i fully restart the app
can I add a tooltip to buttons?
Why wouldn't you be able to?
Yes
thx, I just remembered how
can anybody check out my pull request? i wanted to know if this could be added into the permissions viewer plugin
it was because i moved the native.ts file into a folder.




Hmm, I have an idea for a plugin. I can make a Vencord plugin that allows sending webhooks directly from the Discord client. If you like this idea, I can try to start working on it.
ew mobile messes this up
looks fine to me
weird
someone already done it, it's called WebhookManager by byeoon and it's not really necessary plugin, can be done by user apps
How can i make the badge look better? I have no ideas and im shit at css.
I know I have to make it a little smaller so it doesn't get cut off at the bottom and and probably a different background color
looks fine to me tbh
I honestly just copy the css they use for the clan badge or the remix tag
HUSK
is there a way to pop a custom menu or do I have to manipulate the webpage
wdym by menu
those menus
yea, check out pindms for an example
ohh I see, ty once again
this looks alot better
it uses discords color vars too so it works with themes

I think the only thing I’d personally do is apply a filter… Yk saturate it (so it’s not so bright). But other than that, It looks nice.
my iq so high 
How can I disable these texts that appears in every profile in my discord bot client?
I have this
open devtools with ctrl+shift+i
press inspect element in the top left (or pres ctrl+shift+c)
select that element
if it has a unique/good class name, you can just do .className { display: none; }, if not send a screenshot of discord including the html of the element
It changes peoples bio also.
So it basically overrides
I can't see anyones bio
send a screenshot
can you copy the entire html of the parent of this element
I hope this works
With html beautier
Also it overrides the pronouns
And puts nitro and booster badge
Idk why
what's overriding things?
the plugin or css you just made
And "originally known as"
I didn't make anything
I'm using DiscordBotClient
A patched version of discord, with bot login & Vencord support - aiko-chan-ai/DiscordBotClient
i've never heard of that plugin and have no idea what it does
what is "it"
it overrides the pronouns of all people's profiles?
Because you don't have this plugin in vencord normally
Pronouns, badges, bio's
of all people's profiles
Yes all
ok well there's nothing that can be done with css then>?
Nope
so that person doesn't actually have those badges?
None of them
you'll have to talk with the developer of the plugin
Oh no :D
that's why i was talking about css
I guess I have to find where this plugin is located
you installed a custom plugin and you don't know where it is located?
hmm is the 3 minutes alone in a DM vc thing client-side?
yeah

There's a plugin that disables it
oh fr? i couldn't find it
It's DisableCallIdle
my bad
How does this work?
pretty sure that's quite against TOS
Why
All third party clients are against tos
yeah but using bot accounts as a personal account is way more bannable
Isn't this against #rules 11? It's a selfbot

Regarding making plugins, is there an (easy) way of doing something with an incoming message/all loaded messages?
MESSAGE_CREATE flux
export default definePlugin({
...
flux: {
MESSAGE_CREATE({ message, guildId, optimistic }: { message: Message, guildId?: number, optimistic: boolean; }) {
...
}
}
});
```is what i have in my plugin

Lovely
in my code i return when it's true so
discord's docs don't mention it so it must be something else https://discord.com/developers/docs/events/gateway-events#message-create
apparently we can predict the future :O #👾-core-development message
It's the faded message that appears while your message is sending I believe
🤔
Would it be true if it's that?
Does it trigger the event again when it arrives?
i need to come up with a way to reduce api requests
i am storing the values i get but it is still sending requests for every user that hasnt gotten one yet
yes
you should just ignore optimistic message events
1.2k requests from a single user in an hour is insane.
is that the iq plugin?
yeah
doesn’t reviewdb make a cache when discord starts up and loads everything at once and then saves it there
Or something like that
It’s not actually fetching everything when you go to see someone’s reviews it’s just viewing it from something that’s preloaded
i have a persistent store for the iqs when they are obtained, but it still makes a request for every one that isnt stores which includes people who dont have one
i could probably just have the plugin fetch all of the data and store it, i didnt do that because i was worried about potentially storing too much data
Can see why pronoundb blacklisted vencord
ngl, i am genuinely surprised i actually am this close to finishing it. It wasn't even my idea originally, a friend came up with it and i offered to make it. I will probably have it done in a few days, i just need to fix the insane amount of requests it makes and probably tweak the test
Is pronoundb even relevant anymore since discord has its own pronoun field?
nah since is one of the main reasons it was dropped
in message: Message Message should be MessageObject right?
just Message worked fine for me
you got any imports?
not too familliar with typescript and its automatic importing but afaik that doesn't exist
also, if i do message.content = "a" and nothing else, is that fine? or do i need to return something
imported Message from discord-types/general
import Message from "discord-types/general";
auto import worked for me tho so idk
erm ok
and this?
no, its just that its not doing anything
hold on i havent actually tried what i asked there oops
ok yeah so it is updating message.content but not whats displayed, im guessing i need to force rerender the message somehow?
wait can I see your entire MESSAGE_CREATE?
it fetches on demand everytime, for badges everything is loaded at once
that or do something like this
start() {
// @ts-ignore
FluxDispatcher.addInterceptor(e => {
if (e.type === "MESSAGE_CREATE") {
e.message.content = "new content"
}
});
}
found an example, ill follow this later https://github.com/Masterjoona/vc-triggerwarning/blob/main/index.ts
reloaded discord too often, got rate limited (or at least the discord servers prevented me from connecting)
Ok I now have the message and can edit it, but how do I actually replace whats on screen?
react probably needs an update
got it, MESSAGE_UPDATE
I believe there is an api to force rerender a message, check the APIs
i have made it so now instead of trying to get the iq for every decorator, it fetches all of the iqs every 10 minutes or when you restart discord
I sent off a flux thing with MESSAGE_UPDATE, idr exactly what I did but it's something like that
i think my change worked
Oh fun, Discord removed the getMaxEmojiSlots function from GuildStore
(This breaks EmoteCloner 🤑)
TypeError: o.getMaxEmojiSlots is not a function
I think it's only on dev atm, it hasn't been merged into main yet
Gotcha, cheers for telling me abt this however
😭
lc.g normal model
-# <:i:1263593669215256597> You are using the new page system • Leave feedback or report bugs in our Support Server!
Their importance is partly due to the central limit theorem. It states that, under some conditions, the average of many samples (observations) of a random ...
something like that
.
I realized right after sending that
hello, I made a userplugin that works well. But here's the problem with another userplugin I created: it doesn't show up in plugins. No errors in devtools and I build restart reinject, pnpm install. Nothing works. The first plugin works but not the second.
code?
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import definePlugin from "@utils/types";
export default definePlugin({
name: "Test",
description:
"Test plugin",
authors: [{ name: "Mime4X", id: 754038841001640099n }],
start() {
console.log("test");
},
});
just a simple plugin
make sure you rebuild vencord
Yes, I did
Okay, I'm just a little dumb. The name needs to be in pascal case. Thanks!
Sorry for the inconvenience.
which name?
it shouldn't have to be
something like: TestAPI
hi, i was experimenting creating my own plugin and searching i get with "before" import, but vendetta its not defined idk if its changed to other one bc the other one that i use: findbyprops is on webpack
?
@normal wagon have you considered writing in normal english instead of lookalike chars 
yeah sorry it was one of my plugins
im trying to import a button here.
this is vencord
- find where is this rendered using react devtools
- patch to add button
ik i am making a vencord plugin but just for testing
import { findByProps } from "@webpack";
import { sendBotMessage } from "@api/Commands";
import definePlugin from "@utils/types";
export default definePlugin({
name: "Jhon Plugin",
description: "Mine :3",
authors: [{ name: "Jhon", id: 882645620861575219n }],
start() {
console.log("Plugin started");
// Aquí puedes inicializar las cosas que quieras cuando el plugin inicie
const messages = findByProps("sendMessage", "receiveMessage");
const originalReceiveMessage = messages.receiveMessage;
messages.receiveMessage = (channelId, message) => {
console.log(`Mensaje recibido: ${message.content}`);
console.log(`Usuario: ${message.author.id}`);
sendBotMessage(channelId, { content: `¡Hola, <@${message.author.id}>!` });
return originalReceiveMessage(channelId, message);
};
},
});
That's not how you make a vencord plugin

how?
did you ask AI for help
yeah bc i dont found docs
does vencord have a way to store data on the user?
(not settings)
elaborate
what data and why
configuration data that the user wouldn't edit directly. but it would be changed as plugin is used.
you can store data with the settings api or DataStore (indexeddb)
youre giving 0 info so i cant tell you which one is better suited
i'm making a custom server organizing plugin.
i need to store some data about the servers & folders.
you can store it in settings
UserSettings or plugin settings?
plugin
as just a String with json?
i guess it would be useful for users to have access, for copying or smth
look at pindms
any plugin file that have a message handler? i want to make: i send a message like: "hi" and clyde answer like: you writed: "hi"
i dont find any handler on the plugins file
Plugins ending in API are hidden from the plugin list unless you specifically search "api"
oooh thats why
solved it
use a presend if you'd like to override a message before sending
see textreplace
return originalSendMessage(channelId, { ...message, content: modifiedMessage }); like this?
:(
alr
like this ? ```ts
onBeforeMessageSend(channelId, msg) {
msg.content = ${msg.content} <-- cool text :moyai:;
},
start() {
console.log("Slash commands plugin started! intercept please work");
},
stop() {
console.log("Slash commands plugin stopped");
}```
yo it now should work <-- cool text :moyai:
yall know more of this functions? or know where is the handler? i wanna experiment more :) :3 <-- cool text :moyai:
if your referencing this channel's pins, i can't find anything that pertains.
look inside the source code of the plugin pindms
ooh. that makes more sense
where is this? addGlobalContextMenuPatch(patchContextMenu);
I've been trying to figure out how to find the regexs and such, because i want to make a simple test button. but using the react components viewer & source. I am never able to find any of those i18n identifiers. I bet that this is a common problem.
Check pins in #👾-core-development
i assume your referencing the massive list of ids.
would that be classnames > i18n?
They're not class names, but yeah.
discord recently started hashing all of their names
That is a list of the plain text names before they started hashing.
mapped to their hashed counterparts
is it all of them
so am i now looking for the hash in the source of the component?
because i can't find any of those either.
no, only from before the switch to hashed names
we dont have the ones after
but some can be guessed
ok, i just want to know how i can add a button in a menu.
because i'm not getting anywere.
index.ts: Line 65
match: /.\?(.{1,10}\.show\({.{1,50}#{intl::UNIGNORE_TO_JUMP_TITLE})/,
send the menu you want to add the button to and where and ill help you tomorrow
but its 1am for me and i eep now
server ctx menu.
below edit per-server profile
Oh there’s a built in api for that
that makes sense.
yo any way to get the channel id? (probably a crazy text):sob:
look at other plugins instead of asking for help with every minor thing
what's so important in that stop function so it must be triggered?
technically yes but this seems like big X/Y problem
you shouldn't have to do any cleanup before a restart
what do you want to do
what are you trying to make the plugin do
wtf
but like still, i very much feel like there are a LOT of better ways to do what you want to do
then explain to us what you want to do
why do you need a Webserver and why does the plugin have to close it
show your code
that does the server stuff
ctrl r only reloads the browser, not the native process
so your server won't close
you're trying to open it while it's already open
your start function should check if a server is already open
you can do httpServer?.close()
but that's async
and only accepts callback
if (httpServer)
await new Promise(resolve => httpServer.close(resolve)))
cursed
either that or
if (httpServer?.listening) return;
both would work
why did they delete everything 😭
webserver in a discord plugin is 
recap: they are making a plugin for other applications to set their status
Sounds like selfbot 
In reality, I can think of like one niche case for that
And what I’m thinking of a botted account
we got a genius over here guys!
cors is making me go insane
i am so confused, it was working fine a few days ago
it was working fine a few hours ago
and now its working again after changing literally nothing, wtf
i think its trying to gaslight me now, because it gave me a cors error but the request also worked
2 things
- CORS is a cruel mistress.
- What. .cat is a valid TLD. Since when???
I wanted to ask.
Does anyone have a good snippet to add a button to the chat input box that opens a popup. Similar behavior to the native stickers/gifs menu
.cat has been around for awhile, you can only buy it from Spanish registrars though as far as i know
I guess would make sense why I've never seen it before
tsx is simply ts with React (UI)
jsx my beloved
I keep getting Minified React error #321
when using useState() in my plugin.
I've tried to figure out why, but cant.
is it a vencord dependency issue?
I haven't found anything about this topic, is there a way to overwrite discord-built in messages like "
You missed a call from user that lasted {time} minutes.", to change the text to something different?
yes, theres a i13n file you can modify
Is that something within vencord or discord?
...discord
What's i13n, incomprehension?
would it be acce
pted a plugin that lets you edit attachments in messages you already sent (the client doesnt let you do this normally)
Somebody PR'd a plugin that lets you add attachments after the fact
I'd probably just add onto that
that seems bannable
i think it would be fine
You can delete individual attachments on messages which I imagine is the same thing from Discord's perspective
Working on a plugin that allows the VC popout to appear over fullscreen windows on Mac, and I have a couple questions:
- I see that there's a way to limit plugins to desktop, web, etc. Is there a way to specify a platform? Right now I'm checking
navigator.platformin the patch predicate, but to my understanding this won't hide it from the list on Windows and Linux, just stop it from actually editing anything? - For the replacement match, how much of a given statement usually changes when Discord pushes updates? That is to say: Right now the string I'm replacing is
window.open(g.Z5c.POPOUT_WINDOW,t,(0,m.Z)(u));. Am I correct in assuming that pretty much any of the minified names could randomize in the future and I should use wildcard capture groups rather than hardcoding them? - Are there specific guidelines for when to submit to #1256395889354997771 and when to submit to the official repo?
- check out the apple music plugin to only show on mac
- assume all minified variables will change randomly, also if you send your patch here you can get feedback
- Ah perfect, thanks!
- Okay cool that was about what I thought. This is the full patch:
{
predicate: () => navigator.platform.startsWith("Mac"),
find: ".POPOUT_WINDOW,",
replacement: {
match: /window\.open\((\w+\.\w+\.POPOUT_WINDOW),(\w+),(.+)\);/, // at time of writing, match is `window.open(g.Z5c.POPOUT_WINDOW,t,(0,m.Z)(u));`
replace: (_, url, target, features) => `window.open(${url},${target},${features}+"type=panel,");`,
},
};
use \i to match identifiers (it converts to (?:[A-Za-z_$][\w$]*))
ah cool nice
also the .+ at the end should be lazy
oops, yep
by chance it seems to work now, but probably not a good idea to rely on that
and also instead of capturing each variable you can use one big capturing group
waitt there's no plugin to view full text files? i hate how short discord cuts off text files, especially logs
tbh if its that big, just download it and open it in your editor of choice
button to automatically open in notepad++ real
thats called the download button 

you can add images to your forum posts too after the fact
me when 24hr necro whatever
but it asked me if i wanted to do that one time i was wtf
oh yeah i've seen that like once
Bypass dnd list of allows
@gusty maple
Uh oh
oh yeah, thanks to @amber mantle it's cleaerer what's a guild channel vs dm now
don't mind me being nitpicky but wouldn't it make sense if it was hatsune Vencord > #plugin-news?
definitely
discord also shows it like that
https://discord.com/channels/1015060230222131221/1333644457739816980
is there any way for it to be made into an API to add your own tags?
not sure if that was the plan, havent been active here much lately
Not in my experience? https://discord.com/channels/613425648685547541/1288842831703576606
No you’re right
wtf why’s it reversed on my desktop?
Should I do < instead, or reverse them?
Having the channel first is better legibly imo
reverse obviously 
ok, so this is what yoiu want?
why even render them urself
because if you have 3 #generals, it could get confusing
you can use discords component
maybe it could be a tooltip?
Parser.parse is your friend
do what
Embed like that
they do
wdym when
when do they look like this in chat?
different server
maybe Parser.parse(https://discord.com/channels/${guild.id}/0) then cut out the #unknown lol
wtf?
maybe that the part where you should handle the rendering yourself
use a users icon and give it the same style as channels/mentions
Should show someone’s pfp if it a dm
Like how it’s showing server icon
discord doesnt do that
Rip
Should it turn red, or the default colour on hover? (you're deleting)
red
alrighty, here's the final UI
why doesn't the channelstore return a guildid for channel categories?!
wdym
it was a parse error
Did you find a way to enable them?
Maybe
Did you?
Maybe
Yeah you didn't lmao
i did got the céatalog
but i'm not working on it rn
Cool
We got Gordon Freeman in Discord before GTA VI
Good job discord, making more tools to scam people. A wave of people using a woman voice filter to scam people in dm's is coming lol
if u fall for the AI voice filter that's just natural selection
Voice changers are nothing new anyway
the filters are so bad, if you fall for it then you have bigger problems
just don't give money to people you don't know
Insane
Okay 👍
Hey, I'm trying to add a custom keybind to the keybind list, but it’s not showing up in keybindActionTypes when I try to logpoint it. Am I using find wrong, or is there documentation on how patches work?
patches: [{
find: 'keybindActionTypes()',
replacement: {
match: /(\i\s*=\s*\[)/,
replace: "$1{ value: A.kg4.NEW_ACTION, label: R.NW.string(R.t.Y5lgTE) },"
}
}]```
Anyone knows how can I add a button to these?
how does quickcss have nesting even though it doesnt use a preprocessor
because css has nesting
oh?
how could i be so unaware of this damn 😭
Thoughts on new settings component ui? (BetterBanReasons)
oh wait they've alraeady made a similar ui
Perfect
nice
i wonder how easy it is to add a language to shiki
locally i mean
oh i see the list of grammars is in an entirely different repo for some reason
@gusty maple's pr crying rn
Lowkey that is never gonna be merged anyway
I stopped caring about it


I don't think I'm gonna make any features for vencord in the future unless I can actually expect for them to be merged
I'll probably limit myself to fixes
Yepp same but I rlly felt like making that pr so I cooked something up in 3 says
you just need for vee/nuckyz to go on adhd fueled merging session
It's a 1.5k lines diff I don't think that's gonna happen anytime soon
The last times I haven't been lucky
why does discord refuse to allow my custom css property
import definePlugin from "@utils/types";
export default definePlugin({
name: "e",
description:
"",
start() {
function setRootCssVariable(propertyName, value) {
document.documentElement.style.setProperty(propertyName, value);
}
const chatBar = document.querySelector("[class^=channelTextArea_]");
if (chatBar) {
const chatBarWidth = window.getComputedStyle(chatBar).width;
setRootCssVariable("--chat-bar-full-width", chatBarWidth);
}
// Observe changes to the chat bar's width
const observer = new MutationObserver(() => {
const chatBar = document.querySelector("[class^=channelTextArea_]");
if (chatBar) {
const chatBarWidth = window.getComputedStyle(chatBar).width;
setRootCssVariable("--chat-bar-full-width", chatBarWidth);
}
});
},
stop() {},
});
@hoary pilot @simple folio any insight?
if i try to print or access the variable it doesnt exist
but getting the element and getting the width both work
so confused
dude i have zero plugin dev experience
guh i thought you did that's my bad Lol
i forgor ur the android one
grok can take wing's job
hold on ill get on pc
to be fair i also get a bunch of webpack errors but they definitely arent from my plugin so it's probably unrelated considering i have no other issues
chatBar doesn't exist when the plugin starts
so it gives up
guh, should i timeout first?
make your observer actually observe
wdym
observer.observe(chatBar as Node, {
attributes: true,
childList: false,
subtree: false,
});
``` ?
like that?
it's nothing?
no issues loading it either
isnt that also a memory leak cuz the observer never stops Lol
@quaint cipher pinging u cuz im pretty sure ur good with plugins iirc
w<
whats the question
:3
i was just gonna see if you can check out mine an nina's code to see what's going wrong
https://bin.nin0.dev/lN0oNd.ts this is nina's 'fix' (doesnt work for me)
this was the original, doesnt work bc it gives up and also the observer isnt actually running Lol
let me try
jsyk the expectation is that the code should make a custom css property and set it to an elements width in px dynamically
i see it gets set for a moment
then something overwrites it i guess? and im guessing the mutation observer only works until the element is rerendered?
maybe discord doesnt allow changing the root default css and only allows adding via external css files?

i think html attributes are often being overwritten not sure though
@turbid loom would you mind using regex patches
if you search useRootElementContext you can see a function thats often ran and overwrites html attributes i think
you could intercept to add the custom style from a variable or smth
also the mutation observer dies when you switch channel and chat bar is rerendered i think
guh i would use patches but i genuinely dont understand how,,
all i know is that it selects discord code and can replace it but i kdont know how to acctually do that
😭
1s
Do you own the slug.cat domain?
Yes
Woah sick!
thank u
My friend owns the slugc.at, so I shared it with them lol
You a rainworld player?
yeah 
Sweet
@turbid loom i think u need a ResizeObserver
instead of mutation not sure
ill try
seems to b working
@turbid loom
can be optimized and stuff maybe but works so
LOOOOOOOOOVEEEEEEE
TYSM
will be thoroughly studying this bc i dont get the regex
message.txt.ts
oh wait that's honestly really shrimple
guh
you understand it?
you messaged at the perfect time lol
i was just about to say i mildly understand it but i would like to ask for an example of how i could target another element to like add another property
{
find: ".channelTextArea]",
replacement: {
match: /ref:(\i)(?=,className:.{0,50}channelTextArea)/,
replace: "ref:($self.getRef($1),$1)",
},
},
this is the part i dont really understand since react stuff is confusing
(i think it's react??)
i understand what it does but i dont understand how to use it to make another
alright 1 second
thank you so much 🙏
I used ctrl + shift + F in devtools
fres will get exactly (3) cookies

