#🧩-plugin-development
1 messages · Page 70 of 1
DAWG dont judge me, I needa figure out something Ive never tried figuring out before, if this could be done via python I wouldve just done it like that
I just need to fix like one or two things and this should work
can someone help me understand what dispatch method of FluxDispatcher does
im still learning the Flux Pattern
Ok It doesnt show errors in the vccodes but when I run it on my client its not actually doing what i need it to do
anyone know how I can look for errors concerning the plugin
(I mean the one im creating)
Devtools
do I just filter errors
Or search your plugin name, or just scroll
its just not showing errors at all though
even if I dont search its just showin stuff unrelated
how can i find out what a flux action takes as arguments
for example js FluxDispatcher.dispatch({ type: "GUILD_JOIN", // ????? })
Check how discord uses it
It says "DevCompanion is only for the developer version" and I did ran "C:\Users\user\Documents\Vencord>pnpm build --dev" + my custom plugins arn't working
UHHHHHHHHHHHHH
OMG I FIXED ITTT
Look at the VoiceMessages plugin
I tried to but it's to complicated
do u know how do I insert text into that text box thingi?
tf is that message
it means "DO NOT INSTALL RANDOM STUFF INTO YOUR CLIENT AND BLAME IT ON THE MAINTAINERS"
Real
Is it possible to run a command via some api?
I want to be able to right click a channel click a button then have it run a command.
Is it possible? Yes
Has the idea been thought of before? Yes
Has anyone committed to doing this before? I don't actually know?
Time to spend hours trying to do something that's "dumb" and has no real "reason" 🙏
you might want to consider setting a breakpoint on command xhr/fetch calls and working through the call stack to find a send command function or something like that
👍 💜
if that doesnt end well just use RestAPI and send the API request yourself (look for existing examples in other Vencord plugins that use RestAPI) do note the pending command might not appear if you do click into the channel
Btw someone knows how do I insert text to the textbox?
?
Hello I am new to vencord plugin development and I would like some guideance on how to achieve this:
Problem:
When I block users, they are not muted in voice channels -> If I block a person and he is in another voiceChannel/in no voiceChannel at all, I do not see a "muted" symbol on them / as soon as they join a voiceChannel.
I have had this problem now multiple times on public servers where I hang out a lot and it frustrates me.
Solution:
I want to create a muteBlockedUsers plugin with a toggle, which automatically mutes blocked users for you.
I want the plugin to work like this:
If the toggle is set to "ON", then all blocked and future blocked users get automatically muted.
If the toggle is set to "OFF", then the user can right-click any blocked user in the "Friends > Blocked" tab and mute them manually.
I already followed everything on https://docs.vencord.dev/plugins/ and the last thing I did after adding my name in the Devs object was to save the file to automatically format it.
This is my current index.ts file: https://sourceb.in/vi6Jnux6Yx
const file = await chooseFile("/");
if (file) {
const filePath = file.path || "File path is not available";
// Why filePath is undefine????
}
return null;
Can someone help me with this?
I tried
but this line:
const Native = VencordNative.pluginHelpers.VoiceMessages as PluginNative<typeof import("./native")>;
isn't working on my code to export from the native
u know why?
I FIXED IT
OMG IT FEELS SO GOOD
yo guys can someone please tell me is there anyway to add a custom svg? insted of using "@components/Icons"
Check what dozens of other plugins are doing
Translate, toolbox, preview, and silent typing are a few that come to mind
thanks man
can someone please help me how to make a function that mutes somone on the vc by id?
look at the onclick of the context menu button in react devtools
how?
how what?
enable react devtools in vencord settings (or install it as an extension if on web) and look at it
there's an example in the pins
how tf do I open this tool?
?
toggleLocalMute(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : f.Yn.DEFAULT;
!T() && r.Z.dispatch({
type: "AUDIO_TOGGLE_LOCAL_MUTE",
context: t,
userId: e
})
},
tf am doing with it?
findByProps("toggleLocalMute").toggleLocalMute(userId)
OHHHH
thanks
Well now the final thing.
how do I get all of the people in the call?
is there any way to set it insted of flipping it?
check it's value and toggle when it's not at the value you want
how do I chack for it?
ok so
first of all ctrl shift f and look for the handler for that flux event
this one
now find that module by typing wreq(345953) in your devtools console
then, go to that function
now we have a nicely named function
findByProps("isLocalMute").toggleLocalMute(userId)?
findByProps("isLocalMute").isLocalMute(userId)?
those 2 functions arent in the same module
so how do I refrence it in my script?
const { toggleLocalMute } = findByProps("toggleLocalMute");
const { isLocalMute } = findByProps("isLocalMute");
Thanks
const { toggleLocalMute } = findByProps("toggleLocalMute");
const { isLocalMute } = findByProps("isLocalMute");
if (isLocalMute === false){
toggleLocalMute(userId).toggleLocalMute(userId)
}
right?
like how I typed right?
cuz it's kinda not working
maby it's like
const { toggleLocalMute } = findByProps("toggleLocalMute");
const { isLocalMute } = findByProps("isLocalMute");
if (isLocalMute(userId) === false){
toggleLocalMute(userId).toggleLocalMute(userId)
}
nuh that's just crashing my discord
The {} is destructuring
replace toggleLocalMute.toggleLocalMute with toggleLocalMute
so like toggleLocalMute(userId?)
yup
and the isLocalMute is just fine?
thanks man ur the best
can I add u to my friends please @rose fiber ?
also i've used this line:
patches: [{
find: "renderConnectionStatus(){",
replacement: {
match: /(?<=renderConnectionStatus(){.+.channel,children:)\i/,
replace: "[$&, $self.alertChannelId(this.props.channel.id)]"
}
and it works and all but the only problem is that if ur also using the call timer plugin because the plugins from the plugins folder are starting first it cannot find the function so it's not working
is there anything I can do to prevent it?
you need to use findByPropsLazy
Any why that?
Anyways
How would I find the patch to see when a user gets blocked / unblocked?
This is my code so far: https://sourceb.in/lLDaS56yWP
I cant figure out the issue with my plugin can I just post the full source here or no
ill take this as a yes sigma I can
This is the source of my plugin that I cant figure out what the flip is wrong with it
its suppose to auto local deafen when I am server muted and auto local mute when I am server deafened, to combat admin abuse in voice chats, when debating or conversating
Using a timer like that is one thing that's wrong, at least
And returning a function from start, that's not how you do it (but maybe it should be)
ok thanks you
when I want to diagnose the steps of my code I put console.log("HI this happened") but where do I look to find hi this happened, it wont show in the console (ctrl shift I)
that's interest yes
it should
then that code is not running due to something in your code
```js
const VoiceStateStore = findStoreLazy("VoiceStateStore");
const userStore = UserStore;
no need to re-assign UserStore to userStore, just use UserStore directly
remove these
if (!VoiceStateStore || !userStore) {
console.log("VoiceStateStore or UserStore is not initialized");
return false;
}
they don't work how you would expect because the return of lazy functions (and UserStore) are never nullish
Where do you expect it to react to anything
It checks when the plugin is started, that's it
IM SUCH A GOOF BALL
this
its suppose to automate local deafening when server muted
and local muting when server deafened
and undo those things when the servermute/deafen is undone as well
You'll probably want to subscribe to the VoiceStateStore to find when it changes
how do I do that...
Well, there's an addChangeListener method so maybe use that?
sigma, thank you
ok yeah im lost still bro im adding several credits by the end of this
also not until like 9 am today I wasnt using dev companion 😭
This whole time I manually rebuilt and reinjected LOL
Just pnpm watch
But now that I got dev companion is really useful much love for it
Reinjecting is unnecessary
yeah I know I did that
I didnt know about it earlier though before today
so I tried console.log thingy to see if stuffs being called but it doesnt seem to be should I be usint a print statement instead or
does that even work in typescript
nvm looked it up
print() opens a printer dialog
oh
Which is very funny
So I really don't like to ping people but I really want some help cause its my first plugin and there are no docs on how to do stuff.
So I am sorry in advance for future pings but could any1 help me out by chance?
How do I know when a user blocks / unblocks someone?
This is my code so far: https://sourceb.in/lLDaS56yWP
Hey I think we are trying to make something similiar
your code checks to see if a user is blocked and automutes them locally right?
if I am reading that code correctly
Yes cause blocking a user on discord only restrains them from messaging you etc. but for voicechat nothing happens
xd nice
so like if I am server muted ill auto deafen myself locally and if Im server deafened ill auto mute myself locally
ok
if you use vscode you can ask codeium for a bit of advice /help (it can be off a lot especially for something this specific (I mean it being a vencord plugin))
I asked it how I could check if a user is blocked and it gave this example code block, try this if you want
import { RelationshipStore } from "@webpack/common";
const relationshipStore = RelationshipStore.getStore();
function isBlocked(userId: string) {
const relationship = relationshipStore.getRelationship(userId);
return relationship?.type === "BLOCKED";
}
well that tells me if a user is currently blocked, but how do I know when a new block/unblock happens
cause this checks also for blocked people
Object.entries(RelationshipStore.getRelationships()).filter(([k, v]) => v === 2).map(([k]) => UserStore.getUser(k).id);
ok just use that
I think the code block it gave is trashy uhm give me a min
ok yeah im not sure on that part
Bro theres like no documentation I cant help my bad LOL
If anyone can help me and this dude
haha i also hate the fact no docs are available
how would i do smth like this now ?
i've looked in the update commit but no official plugins seems to have been using getLocale unless i'm F blind and i can't find it
i18n?.getLocale?.() ?? "en-US"
i18n.intl.currentLocale
i18n hasnt been typed yet
go to console and just read the values from there
how can I detect if a user block/unblock happens
flux events
ok thanks finally an aswer <3
so this is what I found out in chrome f12 when clicking on blocking a user:
onConfirm: () => {
null == p || p(),
o.Z.addRelationship({
userId: E,
context: {
location: g
},
type: _.OGo.BLOCKED
})
}
with that how do I block a user in my plugin?
this is my code so far and it works for the mute part https://sourceb.in/dfysF4K2EF
@hushed loom, <t:1730247495:R>: …
by using exactly that code
addRelationship is an exported function, use findByProps to find it
for the other values, put a breakpoint and trigger it to see what they are
@hushed loom, <t:1730249336:R>: …
where can i find the module that contains the main flux dispatcher? before some update it was Vencord.Webpack.findByProps("DispatchBand", "default"), but that doesn't work anymore...
i basically want to run some function whenever a message is received in a specific channel
It's already found for you
You can just import FluxDispatcher
However for what you are trying to do, you might want to use the flux object of event handlers in your plugin object rather than registering manually
oh nice ok thanks
There might be a better place to put this but i'm placing it here.
When using the User type from discord-types/general it's missing a bunch of data. When I console.log user it has soo much more and there is missing stuff that "should" be clear and "should" be added be default.
Stuff like clan, banner, globalName and most likely more.
Is there a way to get the package updated to support new data so I can stop getting errors or should I be importing User from a different package?
I spent some time looking into this. The package we are using is not just out of date but is also abandoned. Would it not be better to use something like discord-api-types from discord.js
Using discord-api-types would mean going to be more up to date and will stay around for "sometime" considering it's made by the same people who made discord.js.
I'm willing to look more into this and maybe make a pr with a swap over but I'm wanting to know if i'm missing something first before putting my time and effort into this.
discord api types is incredibly different from what the data structures you're working with are
Is that because we are parsing it in some way and not just using the raw API data?
Discord-api-types is for the official api that bots use
Vencord is a unofficial client mod
There is a pr somewhere to migrate to our own types for discord, but that has been lost in the weeds for a while
Do we not use the?
When looking at dev tools (network) and clicking on someones profile it sends and API request to discord's api (v9) and the data and it's the same as the data being shown in the docs of discord-api-types
I get that but there shouldn't be no reason why the data we get isn't the same as the data from the API.
Link pr if you know where it is
The data is very much not the same
Does that not seam dumb? What's the point in changing the data?
discord-types describes api responses, which are json. Discord itself, and thus vencord, uses actual data objects, with methods and shit
Plus, api responses are stable, while internal objects can be changed whenever an employee feele sufficiently bored
because working with pure json data that doesn't even follow Javascript naming conventions is not very comfortable
Discord has classes for most data structures and deserialise the json elements into an instance of those classes
these classes have useful helper methods and camelCase names, thus their structure differs vehemently from the api types
I figured it out. I did this instead of just using sendMessage and uploadFiles because I thought it would be easier.
FluxDispatcher.dispatch({
type: "SLOWMODE_SET_COOLDOWN",
channelId,
slowmodeType: 0,
cooldownMs
});
like for knowing when a user is blocked/unblocked, I can add a "addChangeListener()" to the RelationshipStore
How would I do it when I get server muted/deafened?
flux events
And what flux events do exist?
is it like normal discord events?
Define "normal discord events"
^
like for example
MESSAGE_REACTION_ADD
MESSAGE_REACTION_REMOVE
MESSAGE_REACTION_REMOVE_ALL
MESSAGE_REACTION_REMOVE_EMOJI
is there a list of of contextMenus somewhere?
not the same but similar
flux events arent documented anywhere
youll have to look in discord's code for (something).dispatch({ type: fluxEventYoureLookingFor, whatever: "something" })

how did all the plugin creators who use flux then get their flux event?
i literally said it
you have to look at discord's code
Can I implement features to existing plugins? Or is that not allowed and I need to create a new plugin for that?
both are fine
cause idk what to do with my plugin. I get told that it "adds" a feature to an existing plugin but I cannot find an existing plugin which does that.
Its about muting blocked people for voicechat automatically etc.
noblockedusers
yea
that one
what would you do if you were to be me?
Add as new plugin or add as feature and maybe rename to noBlockedUsers the whole plugin
so what now
in the end, it doesnt matter
maintainers will decide if it goes in its own or in an existing plugin
why?
Hey I am trying to make a plugin to hook the file upload function if its above the upload limit upload it to catbox and send that as a link is there any way to hook that function?
Wouldn't it disable the plugin and reset users' settings?
There's only one setting on that plugin but still
You guys ever notice that the forward menu explicitly omits the current channel
You can import settings from other plug-ins just import from what that plug-in used to be named
Ah
for example…
migratePluginSettings("AlwaysExpandRoles", "ShowAllRoles");
And the search function sucks, prioritizing users you've never interacted with
That's cool, didn't know that was a thing. I'd thought in the past it'd be useful for plugins to have an unchanging ID and a separate display name to avoid things like that
Aha thanks
prolly really doesn’t matter, but just thought you’d like to know
wasnt aware of the migratepluginsettings 
daily reminder to update pnpm
You can put just about anything in the toolbox
Wrong
The toolbox does not work like context menu API
You can put buttons
but thats about it
Buttons that can do anything
if you want more menu options then you'll have to edit the code
true
i meant the actions
where is the vencord docs
i gotta figure shit through inspect element console
the docs are mostly just typescript types
Vencord.Plugins.plugins.SigmaLanguage.start
look at how DevCompanion does it
Just add a context menu patch for vencord-toolbox 
i dont have it yet i have a devbuild lmao

They’re talking about the plugin
how am i supposed to see how it works
i have a dev version yet it still says its only for dev versions

Read the code
Go to src/plugins/devcompanion.dev
And read
wait so nobody
can use it
?
just saw
also im slow if u disable the plugin it disappears from toolbox
Yes, disabling a plugin disables all parts of it
I'm unable to find the vencord settings, im on a dev branch because of my custom plugin (it is not causing this)
It was working literally until a few mins ago when I updated discord
Vencord seems to be getting injected (I see the features from other plugins on), it's just the settings are missing
We don't provide support for devinstalls at all, even in this channel
this is a problem with your dev install, not vencord, not dev installs as a whole, not the plugin lib
I did not touch anything tho
Also if i build without --dev does it count as dev install
Buliding from source is not supported, stop asking
Ah okay, sorry
How can I submit my plugin to be added into offical plugins then?
It's just "sortFriendList"
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { definePluginSettings } from "@api/Settings";
import { Flex } from "@components/Flex";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { RelationshipStore } from "@webpack/common";
import { User } from "discord-types/general";
const settings = definePluginSettings({
showDates: {
type: OptionType.BOOLEAN,
description: "Show dates on friend list",
default: true,
restartNeeded: true
}
});
export default definePlugin({
name: "SortFriendList",
authors: [Devs.CallMeGii],
description: "Sorts friends by date of addition",
settings,
patches: [{
find: "getRelationshipCounts(){",
replacement: {
match: /\}\)\.sortBy\((.+?)\)\.value\(\)/,
replace: "}).sortBy(row => $self.wrapSort(($1), row)).value()"
}
}, {
find: "peopleListItemRef",
replacement: {
predicate: () => settings.store.showDates,
match: /(?<=children:.*user:(\i),.*subText:).+?(?=,hovered:\i,showAccountIdentifier)/,
replace: "$self.makeSubtext($1, $&)"
}
}
],
wrapSort(comparator: Function, row: any) {
return row.type === 3 || row.type === 4
? -this.getSince(row.user)
: comparator(row);
},
getSince(user: User) {
return new Date(RelationshipStore.getSince(user.id));
},
makeSubtext(user: User, origSubtext: any) {
const since = this.getSince(user);
if (isNaN(since.getTime())) {
return null;
}
return (
<Flex
flexDirection="column"
style={{ gap: "0px", flexWrap: "wrap", lineHeight: "0.9rem" }}
>
<span>{origSubtext}</span>
<span>
<div className="" style={{ display: "flex", alignItems: "center" }}>
<svg
aria-hidden="true"
role="img"
xmlns="http://www.w3.org/2000/svg"
width="8"
height="8"
fill="none"
viewBox="0 0 24 24"
style={{ marginRight: "4px", display: "inline-block" }}
>
<path
fill="var(--input-placeholder-text)"
fillRule="evenodd"
d="M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm1-18a1 1 0 1 0-2 0v7c0 .27.1.52.3.7l3 3a1 1 0 0 0 1.4-1.4L13 11.58V5Z"
clipRule="evenodd"
></path>
</svg>
<span>Added — {since.toDateString()}</span>
</div>
</span>
</Flex>
);
},
});```
you would open a PR for it
@flint bronze https://github.com/lolsuffocate/vc-incognitoLinks

I'm aware the custom path option is dangerous as-is but that's a later problem
I need to make a plugin that tells me I'm a dumbass when I only ctrl+r reload after changing a native.ts file instead of fully restarting discord
is there an easy way to reference or get a variable using a regex earlier in the module?
for example, one of my patch replacements needs a minified variable earlier in the referenced module, and i'm not sure how to get it
I don't wanna make all my plugins about embeds and links lol
But what if I made a plugin that previews embeds as you type links in the chat box, kinda like how whatsapp or messenger previews them
Would be fire ngl
I am once again hoping someone can take over [this plugin](https://github.com/Vencord/plugin-requests/issues/1#issuecomment-1957949593)
update yesterday broke the patch and I have no idea how to fix it, I can't make any sense of that part
Change the find to "#{intl::MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL}" to fix what the update broke

So are we expecting the existing keys to always correspond to their existing hashes?
And then new keys we just won't know what the original key was to get the hash
hash is calculated at runtime so yes
existing keys will match their hash
and new keys we wont know unless we guess
some have been guessed already
Sorry by always I meant going forward but I guess there's no way we'd know that lol
Got it 
This is cool btw, was a bit confusing at first glance though
yeah a former vencordian made the patch and had hardcoded the formats, I added options to it with some help from chatgpt because I don't know any js/ts but I got most of it
What is very funny is discord is kinda adding that
There is an experiment to make discord use system formatting or system formatting but locked on 24h mode
really?
I forgot the name of the experiment but i think you can find it by searching for time
Yep this
I'm surprised that didn't break the patch tbf
I found it today when looking into discord hashing stuff
I was looking for stuff in the js and randomly found that
oh yeah it adds this under appearance, pretty cool
I wish i just had boxes to specify the format strings :w:
"hh:mm:ss.sss - dd/MM/yyyy" as long form detailed precise time big w
But alr better than nothing to be able to use system api for date time
Specific format strings is exactly what the plugin is
Should include an example timestamp using the confugured formats
anyway to develop plugins faster than rebuilding & injecting and restarting discord?
thanks man
ctrl+r >>
F5 is faster
Hello! Does anyone know an alternative to usedrag and usedrop that used to be in @webpack/common ?
I want to update the channeltab plugin (for I18-n) that was created by sunnniee but im not even sure they'll update it anymore
I mean it has defaults as the example as well as a link to the documentation 
any possible way to use NavigationRouter in native.ts?
just tested and the exact same
Oh alr goog
they seem about right
How to make an button next to your microphone button?
Is there a way to use setValues in a custom settings component without it rerendering the entire thing?
It seems like the only way to actually save values when the user clicks save and close (rather than editing settings immediately as the value changes) but it makes it impossible to type because you lose focus after every letter
Are settings components not like, regular components?
Which you can useState() and the like in
Or do you mean that you want the setting to save instantly, unlike every other setting which only save when you press save?
When you use the setValue function passed in the props of the custom component it sets the values to be saved when you click save & close, but doing so also tells something further up the chain to rerender the whole settings component as far as I can see
So you have to have it save the new value instantly as you type because if you call setValue after every letter typed it keeps rerendering the modal and the input you're typing in loses focus before you can type the next letter
Basically my point is just that trying to use this function
Causes this
But I could very well just be stupid
Considering the regular SettingTextComponent works, you're probably doing something fishy
I'll look into it more, I probably am just being dumb
Oh, and have you considered having a selector where you can choose presets corresponding to each available momentjs locale?
Figured it out, it was because I was defining the Row component inside the custom settings component, thanks for the sanity check
why doesnt that show up in the file? is it some variable that vencord does something special with?
ah cool
where do you get that variable from
old i18n keys
they're hashed now
so you cant get new ones
internationalization keys?
yea
how do you find them?
They're hashes of the old keys so no
do u mean these one letter names
no
the class name modules
these kinda things
i think is what @tropic ice is talking about
they all have the same suffix for each webpack module
this is a randomly generated suffix based on the file
they are also semi constant
yeah you generally just find the webpack module, find a set of unique keys on them and use findByProps
they only change if discord changes their css
yeah
i'm mostly a css person, so that's how ik of them
WARNING WARNING WARNING
These modules are not always loaded, they can be lazy loaded just like any other module
one day you will make an advanced plugger and find this out and feel pain
so just completely (pseudo)random every time discord changes css?
not generated from a hash or something?
Someone could try to make a hash from it idk
It's probably just random
Okay so I have an object defined inside native.ts and I want to add RouteNavigator to a key what can I do I’m confused?
For example
I’m using electron touchbar API
alr, i have no idea what that is, sorry
And im trying to set give a callback to a touchbar object which will use RouteNavigator
It’s ok do you know how I could use RouteNavigator inside native though?
It switches to server with passed server id
you mean navigation router
Yes my bad Lol
its all good
tbh you would prob want to look at electrons docs
dont know much, but these seem to be of note
Kk I’ll take a look thank u
very cool 👍
which patch is better
{
find: "peopleListItemRef",
replacement: {
match: /(?<=subText:).+?\}\)(?<=user:(\i).{0,100})/,
replace: "$self.makeSubtext($1, $&)"
}
}
{
find: "peopleListItemRef",
replacement: {
predicate: () => settings.store.showDates,
match: /(?<=children:.*user:(\i),.*subText:).+?(?=,hovered:\i,showAccountIdentifier)/,
replace: "$self.makeSubtext($1, $&)"
}
}
Probably the first lol, I just threw the second one together without much thought into making it good
@craggy latch fixed the bad logic in your plugin
By rm -rf?
I gotta remember to ping on reply more #👾-core-development message
any possible way to use invoke webpack functions from native.ts?
look at other plugins
So its possible
yes it is possible #🧩-plugin-development message
call a native function in your plugins' start function and save the webContents from the ipcmaininvokeevent
I have a button patch working now, but I am not sure how I would add a modal callback to that
I need advice.
I have a few closely related ideas for plugins.
1: Events calendar in app, in DM sidebar near friends/shop/nitro/library/etc and replacing the events button in servers
2: Automatically exporting all events to a file with a native script
3: Fixing Discord's existing "Download ICS file" button to add more (better) metadata to the file
@hushed loom @hoary pilot can you help me decide
I intend to PR this shit eventually

probaly seperate
I have acknowleged that a "events from every server" option is a shitty idea
Kevin Fortnite Cube (64kbps)
actually this is one with different settings might work
i forgot about being able to import css files and just did an animation with css using dom manipulation 
Wait until you find out about the managed CSS API for cases where you do changes outside of your plugin
So I can use NavigationRouter with my native .ts this way?
yes
Do not rely upon ConsoleShortcuts being enabled
How much do we wanna bet old route API stuff still works

i made a plugin that adds a button to send a random picture of my cat gary. left click sends as an embed right click sends as attachment.
events plugins
4
5
1
All in one plugin
Make a pr
too niche this is suited as a userplugin though 
@remote kestrel give minky pics button plugger
we need
use the Api venbotto uses
vmink
Sighs
We love cats tho 😔
how'd you make the animation?
I see you didn't submit it, mind sending it over so i can use the fixed version?
check github
css
Yeah, i had no plans to make a pr. I might submit it to #1256395889354997771 when i am happy with the code
Need
I have the source at https://github.com/Zach11111/randomGary
Still need to make a readme though
I will add a settng for the image source and more sources
we need better minky api
@granite wharf when will you add endpoints to minky api to get each image, to list all images, etc
@granite wharf you will zip and send all the images of minky to me
i need it as well
i think i have a 3GB archive of minky pics from @safe glade already though
i will scrape all minky channels
uuuuuuh
dunno
should I make 
@granite wharf send me the minkers
pr
Materiiapps/minky-api
i know
yop
i dont have time to do myself
@remote kestrel can you send me the minky pics
how many do you have
i will PR endpoint to list all minky pics then
who ping
3.3gb
i havent updated since may
updatee
ADD MORE 😭
thjeres been at least 300
300 MINKY PICTURES?
yes
I have over 500 of gary
you can iterate that api though
@rocky lynx I am downloading every gary photo right now.
Yeah
they're just very similar photos
I got better about not putting too similar pictures in

I need to clean up some of the older pictures
Can I confirm there's no rate limit on your server?
Yes
(too late anyways)
guhhh cloudflare will kill me
maybe
check your logs if you dare idk
wget is a piece of shit
Several people have done this befor lol
good
I got several thousand requests in a few minutes once
is this good or should i add any more sources
http.cat
cat api doesnt have CORS headers 
use cataas
You should make right clicking the button open a menu that lets you pick the source
i might do shift + click, currently it sends as a link for click and an attachment for right click. i have both so i can use it in servers where i have only embed perms or only image perms.

i made it so the tooltip changes based on the selected source, but it doesnt update until you change channels or click it. i do not know how to fix that
if it is going to be a userplugin… then I went to the possibility of letting someone add their own custom API
Like let’s say hypothetically, I had a goose one or a raccoon one
You probably want to use the settings.use(settingNames[]) react hook for this
yeah, that worked

i spent about an hour trying to figure out why my native wasnt working to realize i misspelt the plugin name
i have updated the code on the github repo
Send link to the repo 🙏
Touch Bar so far any ideas?
really neat
if only other devices had a touchbar
Fr I always liked the Touch Bar don’t know why they discontinued it so early
Thank you
doesn't it get rid of f keys?
The physical keys yea but if you hold fn it comes up with touch bar fn keys which I don’t think is that inconvenient
you can't feel them though
I think the touchbar is a cool enough concept that i wouldn't mind not having f keys
That's quite the plugin
wrong channel 😭
😭
can be done in css
Facts
you can just assign the actions to your f keys
Ye but the touchbar is dynamic
keyboard can be dynamic too
the actions at least
look now i can type different characters øåæ¨
and question mark isnt in the normal place_
i meant the touchbar has things like volume adjusting with a scroller and autocorrection word display etc anything that something without a screen cant do
Yea
Me too it'd be cool if they just added the fn row above or below it
No
its oled though at least
I havent noticed any smudgyness yet ive only had it for a month or so im use to the fn keys but i saw the touchbar and it looked so cool i had to cop it
whoa
maybe that's just my hands
if i touch my screen once, it gets a smudgy fingerprint
Maybe or it might just be noticable when the screen isnt lit
how can i pass plugin settings native? it says its not cloneable
what are you trying to do
the touchbar is created in native so im trying to pass the settings as an argument to a native function so i can create the touchbar based on the settings they set
settings is a proxy
you can access Settings from native too lol
lookat other native.ts scripts multiple use settings
oh shit im dumb i keep forgetting which parts can only be used in index or native
forgot about that 
thanks yall
tbh its not intuitive given you cant import native in index
yea hopefully one day we'll be able to use native and index fully in one file like they were combined or something
maybe that is a bad idea im not sure
how exactly do I get image links from the thread https://github.com/Vendicated/Vencord/issues/1749
into a format like this: https://github.com/Vendicated/Vencord/assets/47677887/75e1f6ba-8921-4188-9c2d-c9c3f9d07101
and not https://private-user-images.githubusercontent.com/47192617/385288091-d730f105-a824-41e1-aa40-ff62d6748000.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzE0MTYyMTQsIm5iZiI6MTczMTQxNTkxNCwicGF0aCI6Ii80NzE5MjYxNy8zODUyODgwOTEtZDczMGYxMDUtYTgyNC00MWUxLWFhNDAtZmY2MmQ2NzQ4MDAwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTEyVDEyNTE1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU5MGY0ZWNiNjM1MGZhZmQxNjI4MmUyNGVjODg5ZGNiMTc1NDg2NDJjYTg4MWY0YWU1MjFiMTI3NmQ5Nzk0ZTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.iaIfcWA6aWc3FLE89bRzGY63BJmsyAFH61fACMvap3I
when you upload
or copy the links in the rich embed in #👾-core-development
thats much easier lol. thanks
maybe if you click to edit the post it shows the links too, I'm not sure
lol I've used that before too
is there a plugin for adding captions to gifs
im asking if it exists not for someone to make it )
might be crazy, but whenever i try to use the datastore, the returned promise never resolves
hsow code
works on my machine
what browser
vesktop
there's a good chance you have multiple vesktop processes
close every single vesktop instance and make sure there's nothing in tray / task manager
this persisted after a full reboot
deleting the VencordData entry in idb
via tray context menu
How do I get the "developer version of vencord"?
I am running from source, yet I still don't see devcompanion
I know that someone was working on something that made devcompanion obsolete but i'm trying to test my patches in vscode
Build with the watch or dev flag
well, what now, i'm not getting much other than
Also you don't need watch and dev, watch includes dev but not vice versa
how do i test if my patches are applying
I see
What do you mean?
If you mean in vscode then you need to enable the devcompanion plugin which you should be able to see in the list now and have the companion vs extension installed
Then above your patches you should see buttons to test
I have the devcompanion extention installed and
when i try to install it on vencord it says that
let me try to inject it again
oh, weird
Sweet
I think I saw jetbrains made webstorm free for personal use recently so I should really get off my ass and finish/polish the intellij port of devcompanion
also, are the vencord docs extremely incomplete?
dont bother
the apis you use are ultimate only
(unless they changed that too)
Aren't they ultimate only because webstorm was paid?
nope
Ah, well still I should pick that back up
could be wrong there, you should double check
this is just what i remember from when i played with it
Yeah that's cool. I think the only thing I really need to do from memory is make the reporter results look pretty, which is probably why I haven't got round to it in ages lol
I remember there was a command you can put in the discord console to force load the lazyloaded stuff
what is that again?
loadLazyChunks()
nevermind
Maybe this?
this first
Ah
I wonder what it's for
looks cool
in some places
it's a debug thing lol
do we know what it is? why are we forceloading it if no one ever uses it
Force load everything means everything
I'm tryinig to fix a plugin I have because an update to discord broke it's finder
but i have no clue where the original string could have been
is there a way for me to roll back my discord?
I'm already on the default branch of discord
whats the find
how to make <a href="osu://edit/00:00:000">text</a> works on discord app, it works fine on vesktop but does nothing when clicked on discord app
edit: done with native.ts
prob related to
vp openinapp
not sure tho
"Messages.ACCOUNT_A11Y_LABEL"
change that to "#{intl::ACCOUNT_A11Y_LABEL}"
run canonicalizeMatch with that as the argument to see what it's actually being transformed to
what do you mean by this?
ah, okay
you might need ConsoleShortcuts
I have
this is the syntax for a vencord macro like which you can use in finds and matches now
because discord now hashes their message keys
also this is a relatively recent change (about a week ago this was implemented)
Yeah, the find works now
dont blame Vencord for this blame Discord for implementing their new library
few matches
what was the point of discord adding this? i dont really understand what benefits it has
huh
no
an app icon that speaks to you
It's a figure of speech
An icon that suits you
I see
It means "special app icons are available for nitro subscribers"
I don't understand why there's just a bunch of variables created to just not be used
I'm trying to see how this is set
and i only have that one part referencing this function
oh wait i'm stupid
that's destructuring e
Yeah, it's used in 830447 under case"groupend"
How did you find that?
In this image function l is exported as k on module 911810, so you're looking for o.k as the usage
Which itself is exported as ZA in 788314 and that's used in 830447
ahh, how did you sort through all the 'o.k's?
You're better off doing what you did here and then just looking at the code to see that particular o's usage
I copy the module into an actual ide to read it better personally
np 
I cant build vencord it return
You can mark the path "@vencord/patcher" as external to exclude it from the
bundle, which will remove this error.
why are you importing that
send full code
import { Plugin } from "vencord";
import { React } from "@vencord/ui";
import { findByProps } from "@vencord/webpack";
import { after } from "@vencord/patcher";
export default new Plugin({
name: "Button",
description: "Adds a button next to the microphone",
version: "1.0.0",
author: {},
async start() {
const ChannelTextAreaButtons = findByProps("ChannelTextAreaButtons");
const unpatch = after("ChannelTextAreaButtons", ChannelTextAreaButtons, (args, res) => {
const button = (
<button
className="button"
onClick={() => {
}}
style={{ marginLeft: "8px", padding: "0" }}
>
<img
src="/click.png"
alt="Click"
style={{ width: "24px", height: "24px" }}
/>
</button>
);
const micButtonIndex = res.findIndex(
(btn: any) => btn.props.id === "mic-button"
);
res.splice(micButtonIndex, 0, button);
});
this.unpatch = () => {
unpatch();
};
},
stop() {
this.unpatch();
},
});
least obvious AI code

@lucid girder if you actually want to make a plugin, please look at what other plugins do and copy them
you will not get any help with AI code and will lose access to these channels if you keep asking for help with it
I didnt ask AI
(yes you did)
that code is just plain wrong, there are no such modules or functions in Vencord
there is also no version field
there is no way you would come up with this code except AI hallucinations
even devilbro wouldn’t come up with this code
imagine devilbro switching to vencord
is there an API for the banner that is here
idk what its called
not sure if any plugins use it
nop
😭
so, the plugin I'm editing has this patch that adds the indicator component to the message.:
patches: [
{
find: "#{intl::MESSAGE_EDITED}",
replacement: {
match: /let\{className:\i,message:\i[^}]*\}=(\i)/,
replace: "try {$1 && $self.INV_REGEX.test($1.message.content) ? $1.content.push($self.indicator()) : null } catch {};$&"
}
},
],
I also created a flux event to try to activate this patch. I had already predicted that it wouldn’t work since it's a FluxDispatcher, but I tried it anyway:
flux: {
async MESSAGE_CREATE({guildId, message }) {
const INV_REGEX = new RegExp(/( \u200c|\u200d |[\u2060-\u2064])[^\u200b]/);
if (INV_REGEX.test(message.content)) {
const msg = message;
const dec = await decrypt(msg.content, 'hardcoded_pass', false);
msg.content = dec;
FluxDispatcher.dispatch({
type: "MESSAGE_UPDATE",
message: msg,
guildId
});
};
}
},
I want to know how to add the component to the message in the context of the flux event
Forget the flux event; pass the message (maybe even just the first capture group?) to your component and decode within the component
hm
maybe that might not work?
I need to see the component itself
flux in my case I think it would be necessary since I need to edit the content of the message and send the dispatch for it to appear edited with the new content for me, unless a patch takes its place, I don't know, I don't know how to work with it yet
I noticed that one has to code the interfaces themselves! Like this one:
interface ChannelSelectEvent {
type: "CHANNEL_SELECT";
channelId: string;
guildId: string;
}
But how do I know which event provides which keys and value types?
You find how they're used in the code, or intercept them and look at the object
Intercept them and look at the object?
console.log is an excellent way to find how objects look at runtime
Or debugger but who has time for that
The problem is that one has to rebuild and inject after every change! Then the Discord client has to be restarted every time...
?
cargo watch rebuilds automatically as soon as you save
You do not need to reinject, it's already injected
You do not need to restart the client, just f5
cargo?
this isnt rust
this is typescript
Sorry, wishful thinking
You mean this?
CHANNEL_CREATE(data) {
console.log(data);
}
For example
Rebuilded, no reinjected!
No reaction
Forgot it! Looked in the wrong console (looked in the terminal instead of the console of the Discord client 🤣)
you can subscribe to an event using the console too
to inspect its data
Vencord.Webpack.Common.FluxDispatcher.subscribe("CHANNEL_CREATE", event => console.log(event))
that looks similar to a discord bot
I don't think you're gonna get flux events in a discord bot
I mean it looks similar to
client.on("channelCreate", event => console.log(event))
You mean, it looks like an event listener
a discord.js event listener to be specific
Makes sense that an event listener would look like an event listener
since CHANNEL_CREATE is snake case for channelCreate
i think you need some chill
very agressive
soon
for a hypothetical adblock plugin e.g. to remove nitro nags, are there any roadblocks to fetching external data (updated blocking rules) at runtime? i was thinking either technical or perhaps vencord policy issues if the plugin were to be an official one.
and what about if the rule updates affect the plugin's settings page... is it ok for that to change without waiting for a full vencord update? i was considering some granular options to let users choose what to block, and new ideas for stuff to block do sometimes happen.
otherwise, users would have to wait for vencord updates to get rule updates, right?
if the question seems dumb, it probably is. consider that i have no familiarity yet with vencord's codebase or plugin dev. i just wanted to try to evaluate the plugin's feasibility before i started on it.
ughhhhhhhh do i really have to reimplement this myself 575175
what is this, reverse engineering some discord minified js?
Click handler for this mute button
i wonder what the significance of those numbers is in the await expression
there are a few roadblocks to this idea
1: the idea upstream that a lot of this stuff can be done with CSS
2: "Patches" directly change the Discord code. It would be against Chrome Web Store guidelines to fetch that at runtime (as in, the no remote eval guideline)
webpack module IDs
that is a request to lazy load something
as a plugin developer: i hate lazy loading
it is already being done as css, but feature creep is setting in, and we are now potentially interested in going beyond the limits of display: none lol
findByCode(".toggleSelfMute({location")
```?
no
but maybe we should just make a plugin for those specific things instead of shoehorning all of that into an adblock plugin. i.e. just have adblock css and try to live with that and then make a simpler plugin for what really needs to be a plugin
2: "Patches" directly change the Discord code. It would be against Chrome Web Store guidelines to fetch that at runtime (as in, the no remote eval guideline)
what are the implications of going against chrome web store guidelines? does that actually matter?
they just wont publish it
is vencord in the chrome web store somehow?
yes
i had no idea
i see. so basically there is just one vencord and not a separate web store version, so such a plugin could never be an official one
thanks
well no, there is not one vencord build
certain plugins use APIs specific to the desktop client for example, or are only useful on web clients
there is one vencord codebase though
would you guess that such a plugin would be officially accepted for vencord desktop (whatever regular vencord is called) and whatever vesktop uses?
authoritative answer obviously not needed
just wondering
knowing the "if it can be done with another plugin/css" response that occurs very often, probably not, except for the Nitro/Shop pages in DMs (because of keyboard shortcut, but that'd be overlooked anyway)
also, is it too late to say that I've already made a plugin like this?
i never posted it in #1256395889354997771 because idk
its on my github if you want to install as userplugin
idk how to bomb quests yet though 
can't you just use @import in css?
i think you can do this as long as you dont ship the import with the extension
but why do you need to fetch external data
huh
why not just use a css extension like stylebot
i haven't published to the chrome web store before, i just read the docs there
you can totally use your own styles
mostly, but for example, it would be nice to let users pick which types of stuff they want to block from a settings page with explanations. that gives the user granular control that persists across rule updates without any maintenance burden on his part.
its more of a "why isnt this in vencord itself yet"
oh
i kind of just skimmed
also #🏥-vencord-support-🏥 users are highly impatient when it comes to CWS review
Chrome web store
oh
Whenever the extension gets updated and it takes a while to get approved
what's your github
heres the userplugin link https://github.com/Sqaaakoi/vc-junkCleanup
idk what quests even are. never noticed them.
this is a good thing
to put it simply
discord realised the vc funding is drying up so they are now doing interactive advertising
it looks like class^=questsIcon_ is already being blocked, but idk if that's enough to explain why i've never seen this crap

maybe? maybe not
i mean quests are highly effective at selling things to people
its usually just stuff like "stream a game to a friend for 15 minutes to earn an avatar decoration for 2 months"
this is their latest quest
it forces you to watch a video
fortunately
you can set the playback speed in devtools to 15x
do you have global discovery (looks like this)
do you see the quests page?
if not, then you must have a decent adblock theme
idk how to even get to that discover thing. although i did accidentally navigate to it when i looked at your profile trying to find your github before. you have some dumb quest badge (so much for hating quests......)
lol
i never completed a single quest legitimately i dont think
oh
does the xcloud fortnite quest count as legit
they had a generic "play game for 15 minutes on console" quest at one point
yes, i am def adding div[aria-label="Completed a Quest"] to the blocking rules

the button down here
if you have the new global discovery it should stay sticky on the screen at all times
idk why they did that its stupid
oh ok thanks. i never even noticed that button in the lower left. never clicked it once. that's why. i'll def add that to the blocking rules as well.
fwiw, i'm using this thing which is just css. maybe you've seen it https://github.com/CroissantDuNord/discord-adblock
ok yeah i see it's supposed to look like a compass. took me 30s of staring at it to understand
ew
And I have another at https://github.com/Kyuuhachi/VencordPlugins/tree/main/Anammox (readme is outdated, it blocks a few more things than that)
yep buhbye to this also div[class^=footer_]:has(div[aria-label=Discover])
may i Invite you to share your css in #🎨-theme-development?
it's not my project but sure
well you can also discuss that and other themes there
Anammox my beloved
?remindme 1h remake these
Alright @flint bronze, in 1 hour: remake these
is there a limit on max number of users muted and blocked?
@flint bronze, <t:1731927712:R>: remake these
@flint bronze, <t:1731931558:R>: remake these
remake these
Hi
LOL it still works
discord's new obfuscated string keys are persistent across builds, right?
Hello guys, is there something to add timezone for specific user name and display also the timestamp of the current utc when sending a msg ?

Like this? #1032200195582197831 message
Exactly, but its a 3rd party plugins
any chance to merge it to prod 
Doesn't look like there's a PR for it so
you'd have to ask the author to submit it
There is a timezone plugin PR'd but it's a different one I haven't tried
i think that one is from the beginning of vencord lol
someone could probably make a new plugin that wouldn't need a billion changes and be fine
timedones must live
Why isn’t it possible to require restart on a plugin that doesnt use patches?
Isn't it?
Thought it was
Though there's usually little reason to require restart other than for patches
what's the use case
a plugin that uses PreSendLitsteners
but the problem is, it doesn’t actually disable unless you restart
I DONT WHY ITS DOING THAT THOUGH 😭
Pet peeve: remove functions (and any other function) that silently ignore errors
GUHHH
you need to pass the same function for remove
you're creating a new function
yop