#π§©-plugin-development
1 messages Β· Page 73 of 1
can i use dzikstar's discrapper repository for this
idfk what that is
devtools
is it possible through devtools
ctrl+shift+i
then components?
enabling react devtools is vencord settings will help a lot
yes
you can view the source for a component in the top right
this is really cool, lets say like i want to uhh open ur profile with ur id
do i select ur profile element to find the component for it?
think about it this way
what do you click to open a users profile
find that component
that look at the code for its on-click function
damn, nice ty. btw does discord use chrome's devtools or ms edge's?
hmm
chromium based
but they have their own devtools
chrome, as it is electron
HELLO I wrote a cursed line of code husk immediately
if ((MessageStore.getMessages(channelId)._array as Message[]).filter(m => m.author.id === meId && !(m as any)?.deleted).some(m => +m.timestamp > threshold)) return true;
what does this check
too eepy to think
is message...
sent by current user
not marked as deleted in messagelogger
posted after threshold (defined on another line)
found onClick but can't expand it
tried id: "..." which is it's prop but struggling to make a code out if it
i think i should use Vencord.Webpack for this, instead of Util
right click it
coming to a #1256395889354997771 near you soon
@hoary pilot i host my plugins on your neveronline forgejo for fun
very secure

i will make it more configurable later
oh yea one more thing, so there are props like getCurrentUser, and how do I see all the other able props?
a
you have to expand the prototypes
if you just wanted the props for userstore
ohhh i see i see, so I find a store from .findStore and collapse it's prototypes where i can find the props inside them
right?
you shouldn't have to go via children
Yea, thatβs what I thought
But I couldnβt find any other way
ErrorBoundary.tsx: Line 83
return <this.props.fallback
this should spread ...this.props.wrappedProps
Well then why does line 108 omit wrapped props
because you don't pass it
Oh Iβm stupid

Are you sure props should be spread
Couldnβt that collide with error and message
possibly
you could name them wrappedProps too if you want
that way you can also note that they're undefined if you use the errorboundary manually
ill understand this language once i deep learn discord code and vencord's magic 
what are the typings for getPremiumSubscription and getPremiumTypeSubscription from SubscriptionStore?
wdym
just look at what it returns
OH
lmao
hold on
getPremiumSubscription
{
"id": "1103761269724561418",
"type": 1,
"items": [
{
"id": "1103761269124763658",
"planId": "511651880837840896",
"quantity": 1
}
],
"createdAt": "2023-05-04T19:13:13.558Z",
"canceledAt": null,
"currentPeriodStart": "2024-12-04T19:13:13.558Z",
"currentPeriodEnd": "2025-01-04T19:13:13.558Z",
"status": 1,
"paymentSourceId": "1103761156742582353",
"paymentGateway": null,
"paymentGatewayPlanId": null,
"paymentGatewaySubscriptionId": null,
"renewalMutations": null,
"streakStartedAt": "2021-06-30T20:14:34.919Z",
"currency": "try",
"pauseEndsAt": null,
"planId": "511651880837840896",
"additionalPlans": [],
"useStorekitResubscribe": false,
"price": null,
"userId": "343383572805058560"
}
getPremiumTypeSubscription
{
"id": "1103761269724561418",
"type": 1,
"items": [
{
"id": "1103761269124763658",
"planId": "511651880837840896",
"quantity": 1
}
],
"createdAt": "2023-05-04T19:13:13.558Z",
"canceledAt": null,
"currentPeriodStart": "2024-12-04T19:13:13.558Z",
"currentPeriodEnd": "2025-01-04T19:13:13.558Z",
"status": 1,
"paymentSourceId": "1103761156742582353",
"paymentGateway": null,
"paymentGatewayPlanId": null,
"paymentGatewaySubscriptionId": null,
"renewalMutations": null,
"streakStartedAt": "2021-06-30T20:14:34.919Z",
"currency": "try",
"pauseEndsAt": null,
"planId": "511651880837840896",
"additionalPlans": [],
"useStorekitResubscribe": false,
"price": null,
"userId": "343383572805058560"
}
seems to be the same
i was so confused cause of the way u asked xD
but yeah makes sense lmao
my bad
yop ty
Or people who don't want to support discord monetarily
@simple coveuse this channel if you need help developing for vencord
nw if youre busy, but did you ever get around to pr #3084, quickSnip?
not yet
i asked a couple days ago so tell me to f off if im being annoying lol
?remind 24 hours
Alright @hushed loom, in 1 day: β¦
nah its fine
Okie dokie
is there any reason that a DataStore get/set call would hang (i.e. the promise would never resolve)
holy shit
you might have the issue i had
that i couldnt figure out
how did you fix it then ββββββββββββββββββββββββββββββββ
yea you got the same bug as me
idkf how
to fix (warning: will delete all your settings)
(well not me, @golden bloom did but he's shy) ββ
proxy support 
I will post unicode of your address ββββββββββββββββββββ
@golden bloom warning: this will delete all of your data
well sorry for trying to help someone
rm -rf /*
tried
run for free money
go to VencordData and press delete database
roz can confirm
nain actually ran that accidentally 
utter hatred for the french
I want to make a plugin that injects client-side text into embeds sent by another user but I can't seem to find the API event for received messages. MessageEvents seems to only apply to messages sent by the current user.
The moyai plugin seems to provide a good starting point actually, I'll try with that and MessageUpdater to edit the content
@hushed loom, <t:1735429545:R>: β¦
I've got something now, but I've got a type error. The Message class from "discord-types/general" contains an embeds: Embed[] field which contains a field called rawDescription (and this is what I get when using MessageStore.getMessage), however the MESSAGE_CREATE flux event gives me a message object in which embeds have rawDescription undefined and the data in description (there's probably other discrepancies I haven't noticed). Is there a class definition for Message that works with flux events?
discord-types is out of datee
there is no up to date type
use devtools and inspect objects
I'm trying to use updateMessage to change a message's embeds but it just crashes discord. I've commented out all the code that actually does something and it still crashes. Right now the code looks like this:
// imports
export default definePlugin({
// name, authors, and description boilerplate
flux: {
async MESSAGE_CREATE({ optimistic, type, message, channelId }: IMessageCreate) {
// various checks to early return
if (!message.embeds.length) return;
updateMessage(message.channel_id, message.id, { embeds: message.embeds });
}
}
});
I've found a workaround, but it'd a little jankier than I'd hoped. From what I understand, since MESSAGE_CREATE is called before the first render of the message, updating it immediately gets overridden with the initial values during the normal (now second) render. Adding an arbitrary ~300ms sleep at the beginning of the function seems to mostly work. As for the crashing, fetching the message from the MessageStore (rather than the event) and updating that object works.
Ideally I'd use a MESSAGE_LOADED flux but I didn't find that in fluxEvents.d.ts
LOAD_MESSAGES doesn't work (called with no data when batch loading older messages). MESSAGE_CREATE is okay, but it'd be much more useful to have an event called when any message is rendered on screen so it'd work with older messages
making a plugin that adds search for every DM using a mobile endpoint surely it's alright to use it from the desktop client right
also since custom routes are hacky i plan on making it on a modal although not as pretty
maybe steal the quick switcher component
yeah lol thats pretty much what i planned to do
still cant match how pretty and seamless was to use a custom route and add the button that navigates you here
which made it just like all the other buttons in there
Just replace the nitro route
that's sooo interesting

so useful
Do I need to use createStore to use the DataStore>
hello
no
the datastore is simply a key value store
Alright
How fast is it to access / use? Should I try limiting and batching updates?
very fast but use async/await
I'm planning on keeping a Map with over 100k keys in the datastore that might be updated on every message, I'm now not sure if I should have one key in the DataStore with a Map object or 100k keys in the Datastore with the individual data in order to avoid re-writing the entire object for a change to only one key
what do you even want to make
I've never used indexedDB before so I'm not sure how to approach storing a very large amount of objects each containing very little data, but that can be frequently updated
fres you know there is a fake search box that just opens quick switcher just above these
yes
mod view uses search tabs endpoint already
lol
i actually like the search tabs UI from the mobile client except for the fact you cant swipe to access it
fresssssssss where mobile sidebar code 
I see the funny reactions but I'd like some advice too
sorry π’
this seems like an xy issue
what is your end goal for a plugin
It's basically a reference table for rankings of all characters in Mudae, that I use to calculate the value of rolls in servers where it's not shown. As for updating the data, I want to use the messages in servers where the data IS shown to keep the store up-to-date
Hides everyones badges
display: none !important;
}
[class*="profileBadge"] {
display: none !important;
}
[class*="activityBadge"] {
display: none !important;
}
[class*="messageBadge"] {
display: none !important;
}
π #π¨-css-snippets
(Auto-response invoked by @hushed loom)
sorry my bad guys
#π¨-theme-development
you're just trying to hide the icon in clan tags?
oh also these?
idk what profileBadge, activityBadge, or messageBadge are
I can't find them
also you should just use commas instead of repeating display: none !important; a bunch of times
and better to use ^= (starts with) instead of *= (contains) when possible, and to include the _ (e.g. [class^=badge_])
For now I'm using Map objects and using DataStore.get each time I use it but I've extracted the data accessing logic to another file to be easily changeable later on
that's fine
i would've added tab search if i knew how to ui xd
what would i pass to sendMessage to instantly send and not wait for the channel to load
make the third arg false
ty!
Hello, I just had a quick question. I'm setting up a plugin that I want to hide certain words/names. kinda like a blacklist, but only when my activity status is "streaming". This would be with PresenceStore correct? In addition, if I were to update a .json to have more dropdown options in the plugin, can I have vencord plugins dynamically update the menu or do I need to predefine them?
if you need dynamic settings for some reason, you can use a custom component as a setting
ty
I tried poking around for a while to figure this out, but I wasn't able to find it
how would I get the color that a user's name should appear as, given the user's ID, as well as the server I want to check that user's color in
Check what RCE does
hopefully nothing...
RCE in your vencord? it's more likely than you think......
I now have the role colors all figured out :3
thanks
When making a Vencord plugin, is there some sort of test environment I should use?
build with --dev
Ty!
Any chance you ever got to reviewing it? It is new years ish so i bet you were busy 
#π₯-vencord-support-π₯ message
yeah also, I got the map to load for the activity by just intercepting the js and adding the map comment on the bottom using fiddler, but not really sure how to use it with this stuff
the userscript sponsorblock stuff seems to execute when its injected into the youtube embed frame but it actually fails since it can't get the video id, didn't see it visible in the locals either, so not sure on that one
is there any way to do regex find/replace on activity javascript? I saw in the plugins that you can do regex patches but that seemed to be discord's stuff
you cant
activities run in a separate iframe
you can only inject js into them
look at YoutubeAdblock, FixSpotifyEmbeds for examples
the youtube adblock one is the one I'm modifying as a base
is the workflow for something like this just building the dev version, injecting, and then rerunning? or is there a better way
You only need to inject the first time, after that you can just build and reload
first time
pnpm build
pnpm inject
all other times
pnpm build --dev --watch
# OR
pnpm build --dev
oh ok nice, I've just been reinjecting and then relogging in every time lol
||i know pnpm watch is a thing, but ive had issues with IS_DEV when using it||

if you are editing things in the YouTube embed side you made need to fully reload everytime
you might*
I don't quite remember if that requires a simple reload or a full reload (as in quit and open discord)
I don't remember it working when I tried earlier, I'm going to try again
yeah seems to actually require me to inject every time, otherwise it'll keep the old version
I just edited a logging comment in the 'injected' javascript to test
no.
you just need to fully restart discord
not ctrl r
ah ok, thanks, that works
where do the props for context menus come from
(looking to add props that i need via a patch)
look what the context menu api patches
it's just the props discord passes to the menu
yea, but i cant find where discord calls the context menu
trying to pass props to image-context
search for the context menu id lol
it's basically the props passed to the function where Menu is rendered
yea, i couldnt find a function where it got rendered from
did you find?

but it's easy to find
open the context menu once, then search in devtools for image-context
should be low in results and one will be the one you want
trying to find where the props for the context menu for this image come from
and if its possible to pass any extra
yea, i found that part, then tried to figure out how discord used it then gave up
was there really no better way to do it?
the best thing you did was causing an error?
do you really want that to represent you
damn

π
either too complicated or didn't make sure nothing was running

what about that
just the webpack logo on webpack.ts
oh lmaooo
mainly cuz it stops the console hook
which changes the location of the logs
horror
i hate things that hook console
(the vscode neovim extension does it in the shittest way imaginable)
has anyone ever managed to change the avatar from Clyde?
It breaks when using an ordinary image link cuz discord adds that wrapper around.
https://cdn.discordapp.com/avatars/1/ [author.avatar] .webp?size=80
or is https://cdn.discordapp.com/avatars/1/ not accessible and clyde only?
for the clyde bot?
i thought you were talking about
oh yeah mb, shouldve clarified the function before
not that easy no
what does the /1/ stand for? bot avatars?
thats the id
@waxen oriole try looking into this function
you should be able to patch it here
function J(e) {
var n, r;
let {props: i, guildId: a, handleRenderPopout: s, showCommunicationDisabledStyles: u=!1, className: c} = e
, {message: m, author: g, compact: E=!1, subscribeToGroupId: v, animate: I=!0, onContextMenu: T, onClickAvatar: b, onPopoutRequestClose: y, showAvatarPopout: S} = i
, [A,C] = l.useState(!1)
, {analyticsLocations: D} = (0,
p.ZP)(h.Z.AVATAR)
, L = (0,
f.e7)([O.ZP], () => {
var e;
in module 464819
I.. will take a look, thanks 
time to make a new userplugin

i am a victim of discord's absolutely terrible shit route controller
so I am trying to make a second udp connection to an existing voice server, i've succesfully connected to it, instantiate an rtp header and encrypt my opus data but my question is do sequence and timestamp need to be properly synced between the 2 connections or can I just start at 0 and increment them on my own connection? or does discord not accept data sent over a different port?
lmfao i got it to work finally but for some reason the audio is really crappy
also apparently the voice servers dont do anything until another person has joined the vc
cuz it only worked when i joined the vc on my alt aswell
i turned the happy wheels victory sound into a sneeze
man does anyone know the chunk size of streaming opus files to the voice server
i keep messing around with the number i would guess itd be 960 but it just makes a fart
https://discord.sex might have some info
Youβve found the Unofficial Discord User API Documentation! These pages are dedicated to showing you all the ways that you can use Discord to make cool stuff. It is not an official source of informati...
thanks ill look into it
coudlnt find anything π
its sounding like a 3.5mm jack thats only halfway connected
im giving up for today atleast i got the syncing working now so i can play audio files and talk at the same time the only problem is all audio files sound like utter dogshit
and right now idk how to fix that
is there no way to test my plugin in real time instead of rebuilding Vencord every time I make a change?
pnpm watch, to rebuild automatically
oh it's the yellow box in the docs, didn't see it. thanks
this does automatically rebuild Vencord, but I have to keep restarting Discord to see the actual changes implemented. is there a way to automate that?
ctrl + r
aside from that
alright fixed that by just using a raw pcm file and manually encoding it frame by frame, only problem is the source audio is in ogg format and I obviously dont want to first encode to pcm and then extract opus frames from there if the original file is already in opus format
only problem is i have no idea how to extract opus frames from an ogg file. probably too tired for this but if anyone can help me thatd be great
bro what
?
this seems like an xy problem
but yes the connections absolutely do need to be kept in sync
as they are not actually different sessions
that's not how a udp socket works
it's not a permanent connection
and no you can't choose a random port
you have to use the one they give you
its not that was the only issue i was running into but i fixed that
but thanks anyway
all i had to do was just make sure the sequence and timestamp are always synced
otherwise either speaking stops working or sending custom audio stops working
funnily
something like this could probably be used to make the fabled free soundboard


@near root if you want, I'm also interested in making a fake soundboard plugin if you want/need help
π
well if you want i really have no experience with how vencord patches work so if you could make something that disables greyed out soundboard sounds and be able to fetch ogg sounds
send your branch
ill take a look and make some patches
alr 1 sec
gotta move it from userplugins and me as dev
oops wrong account
right now ive only included fetching the socket connection data in the plugin as the rest is done in an external application but ill move that over once i figure out how to use sockets in typescript
I really like your progress but firstly we have to refactor how you hijack the socket
instead of overwriting the Websocket class, we can very likely steal it with a patch, where it's created
sadan can help you with it as they know patches
I would help a bit too but I'm not home
yeah i was guessing so but yeah idk how one finds patches, i read thered be an option in the client somewhere to easily find patches but i couldnt find it
build vencord with --dev
settings>patch helper
@near root why are you hooking websocket (need to know why to make a patch)
to get voice connection ip, port, ssrc and secret key
nicee
meanwhile im still struggling to decode an ogg file to raw opus packets π
its working with waveform audio now but soundboard audio is already encoded in opus so obviously i dont want to reencode
ill also get an onClick patch for the soundboard itself
that should be easy
awesome
finally got ogg sounds to play
gotta handle making the circle green when playing the sound too
unless that's automatically
its handled automatically
well atleast
for my alt in the vc it is but for myself it isnt
but thatd be easy fix
anyways im now fixing so it reads directly from a url stream so it doesnt download the file
then the last thing to do would be proper syncing between voice and soundboard
and then obviously translate everything into typescript because right now the entire socket is in python
but were getting somewhere
committted the python application aswell now, were now able to play sounds directly from a discord soundboard url, only problem now is that there is no syncing so once you start talking in the vc the soundboard no longer works
to fix this we need to intercept the socket messages and make sure the sequence and timestamp are properly incremented on both sides
I am trying to add an item to the context menu, but the Menu import is fucking me over. I have a very minimal function to add it. When building, I get the following error:
β [ERROR] Expected ">" but found "id"
src/userplugins/blurAuthor/context.ts:8:12:
8 β id="ba-blurlist"
β ~~
β΅ >
β [ERROR] Expected ">" but found "id"
src/userplugins/blurAuthor/context.ts:8:12:
8 β id="ba-blurlist"
β ~~
β΅ >
1 error
Build failed
Build failed with 1 error:
src/userplugins/blurAuthor/context.ts:8:12: ERROR: Expected ">" but found "id"```
Here is the small sample that I'm working with:
```ts
import { NavContextMenuPatchCallback } from "@api/ContextMenu";
import { Menu } from "@webpack/common";
export const patchMessageContextMenu: NavContextMenuPatchCallback = (children, props) => {
children.push(
<Menu.MenuItem
id="ba-blurlist"
label="Add to Blurlist"
action={() => {}}
icon={}
/>
);
};
Any ideas?
I wanted to at least say hi before posting that π
Aw man that page covers that exact case
you are using a ts fine instead of a tsx file
ahhh fuck
rename your file to index.tsx
Is it possible to get vencord settings (see what plugins are enabled) at StartAt.init
Surely you must be able to otherwise it wouldn't know what plugins to start
lmao I was gonna say the same
@hushed loom do you think you'd be able to make a patch for the udp connection aswell? I need to get the sequence and timestamp from the rtp header thats being sent to discord
you wanna intercept every data being sent?
that part might be controlled by the native sound of the Discord module
sooo perhaps gotta monkey patch it
yeah right now ive just used a packet sniffer which works for now but idk how difficult thatd be to implement in typescript
rn got 1-way syncing to work by just sniffing rtp packets that start with 0x90 0x78 or 0x80 0x78 (seems to be always 0x90 anyways) and extracting the sequence and timestamp from the header
well I only need to read and modify outgoing voice packets (rtp packets starting with 0x90 0x78)
a packet sniffer in Vencord won't happen lol
I think it's pretty likely we can regex patch or monkey patch to intercept outgoing packets
yeah seems fair lol
i wouldnt know where to start
oops i think i got ratelimited
what is the name of the contextMenu of the selected text in an user profile? ive managed to add a Menu to user-context and message but couldnt find the name of that specific menu. i want to add an menu below the "Copy" option
use react devtools to find the navId of context menus
@thorn plover
ahh alright thanks, i tried searching in there but didnt know where to find it.
@hushed loom Hi, saw your comment about importing custom css instead of directly manipulating the dom.
Ofc I can just use ``var(--...)` within the css itself, but what is the recommended way of setting the vars? Using a patch?
nah, ignore it i was wrong
there is prob a way to do it, but thats fine
ohh okay :Sob:
i was wondering why the comment disappeared, thought maybe it was something to do with me force pushing to change the crappy description formatting
nah also #πΎ-core-development has git logs
#πΎ-core-development message
I hate JS I had to do something like that πΌ
though I can do !Boolean(id) if you'd like
#πΎ-core-development message
π I'd even asked for some help to do with the context. I'd be embarrased if it'd taken me this long using GPT
just went looking for relevant flux events for streams
STREAM_CREATE
VOICE_STATE_UPDATES (selfStream)
MEDIA_ENGINE_VIDEO_SOURCE_QUALITY_CHANGED
RTC_CONNECTION_VIDEO
SPEAKING (context: "stream")
STREAM_PREVIEW_FETCH_SUCCESS
here's some, and a few relevant props
some of these will fire multiple times
i don't know what it looks like when someone else starts streaming yet
Is there a way to get the current window title when streaming? Or knowing if Discord is streaming itself?
i remember messaging vee when making my plugin
here's an old patch from a plugin idea it wont be found useful
iirc this data gets resent everytime stream/voice data is updated
guildID:channelID:userID
@hushed loom would you be willing to help me make a plugin
or @indigo ferry would you be willing to help
whats it about
get in vc and start streaming something (content not important)
ughhhhhhhhhhhhhhhh
discord sends a new stream_create event for every viewer
video stream stays the same tho
@indigo ferry do you mind also coming and helping? I need to test an "allowMultiple" option
okay
i need you to also stream so I can click the watch multiple streams button
done
thank you so much for your help
just wanted to make sure nothing too weird is going on with the logic in this function
hawk
i was just looking at this function btw
might need to look into streamType here though
notes:
h.Z is ApplicationStreamingStore
streamType can also be set to call
time to figure out where streamType even comes from
wym
it comes from the ws
i need to capture it from a flux event or something like that
oh im fucking blind it's part of the streamkey
bro
π
nopo
automatically watch new streams plugin
what if theres 50
if you use the plugin and that happens to you then good luck
do you mean like focusing the entire stream?
discord will make this code instead of emitting events for these scenarios and listening to those events to play sounds
see this function?
if allowMultiple or noFocus is passed in the 2nd argument, it will NOT focus the stream
@hushed loom is this horror?
huh
new discord fact
too eepy to think
discord doesn't play join/leave channel sound effect if there's more than 25 people in the channel
someone probably knows this already
@indigo ferry how did i not notice until now that you made streamermodeonstream
little old but easier to dispatch a GUILD_SOUNDBOARD_SOUND_PLAY_LOCALLY
wont that only do the green circle client side?
or is that what they need to do?
the green circle for others is just set when the udp socket receives voice data
client-side is the issue
ah
also ppl are gonna be really confused when their soundboard volume isnt respected lol
true
tfw i have a unique plugin idea but i need to patch the friends bar (i am never doing that again)
what do you mean friends bar
whats the friends bar
like you did in implicit relationships?
yea
the friends tabs?

i wanna add a button but my react skills are not up to par
(they don't exist outside of vencord patching)
what is the idea
i think i tried to make a page there at one point and gave up because too cursed
i reverse engineered an unfinished discord feature that allows you to create a profile url that lets people view your profile and add you as a friend without any mutual
isnt that just friend codes?
that doesnt let you view profile directly
doesn't let u view profile
oh
and expire
neat
this doesn't expire
whats the endpoint?
and has no max uses
i want to know more
POST /users/@me/friend-token then use it like https://discord.com/users/:id?friend_token=xxx
weird
because i've been past the redirect paths part of discord code in the past week
and totally glanced past it
how did you find this?
@clear parcel 
and how is it already documented in Vencord?
am i stupid
are you sure its a post
@clear parcel is there any way to revoke
also how many can you have at once
and if you can have more than one, is there a way to list them
huskkkk
doesn't matter, they're not limited
doesnt matter since you cant revoke
whats the problem with giving out friend token
doesnt seem to be auto accept
dont really like the fact that its unlimited and non-revokable
it's just for when you dont share mutual servers?
just doesnt sit well with me
ya just lets u send frs even with settings off
not that high risk
thought it was more like a friend code
i need some advice for what i'm doing
i am making a plugin that listens for stream started events
this event isn't a real flux event, it's decoded by doing what looks like a custom implementation of useStateFromStores for Discord sound effects
is there any way to do useStateFromStores without a react module or should i just steal even more code
alternatively, i could patch this code, though it might break due to notification settings
@hushed loom i dumped my thoughts
this is the wrapper code
all in webpack module 512847 btw
@hushed loom do you think these emitted changes would be coming from ApplicationStreamingStore?
ughhhh
time to write a thing
i took a break and fixed my mindset
Is there an easy way to close the "click on a message avatar" mini profile popout from a patch deeply nested inside it?
Do you think this bar could be used for anything actually interesting?
I was playing with it a while ago but never really went anywhere because I had no ideas
Add more options to it?
Well yeah but I mean like what lol
I know there are markdown options that aren't on it
So that could be one but it's pretty boring
Add them? but as you said yes thats boring
of anything I want there, make CTRL+K create a masked link
That was my only idea too lol
I was messing with a handful of things at the time so it kinda fell to the wayside
you've got someone who has the same idea
yeah
i'm just playing around with the nitro purchase wow moment animation for fun
there's nothing particularly useful to do with it
Make the timestamp plugin add a button there instead of magically converting syntax
I need to look at how that plugin works
I have it off because too many chatbar items
Not a fan of this part https://github.com/Vendicated/Vencord/blob/main/src/plugins/sendTimestamps/index.tsx#L171
(How do I get bot to embed things without github's own giant box?)
probably doesnt have permissions to send messages here
native picker SO UGLY
can we refactor this to use components from events
I'm usually a fan of using native widgets when possible... But yeah that's ugly
the problem with events is the time dropdown is in 15 minute intervals
make multiple components?
date takes up half of the width, rest of the right side is 3 dropdowns for hour, minute, second?
You are aware that dropdowns for numbers is the devil, right?
No
(yes)
@vast karma Do you need to take a trip to the design systems page and see how it's awful there too
there isnt even a date picker there lol
i admit defeat
I like android's time picker
This fucking thing
Though I don't know how well it works on mkb
I remember seeing a post somewhere that said the underlying value is animated when you tap
so you could tap, and press OK immediately and it would return with some random value in between
Okay that sounds retarded I have to try
Not sure if it still holds up
Can't reproduce
Though I have to say, setting animation duration to 10x makes this phone physically painful to use
idk if that still happens though
Is there any documentation for patches?
There's a proper guide out there somewhere
Well, that and \i and $self
I understand regexes but I mean like which props are passed in and things like calling native functions
I had to find out the props yesterday by replacing the class with the stringified props πΏ
Whatβs \i?
Input or something?
What do you mean "which props are passed in"
A macro to match variable names
It's strings
this.props.<β¦>
They're probably reading a plugin where replace is a function like (fullMatch, ...captureGroups) => replace
what?
a patch match is a regex match of code inside a webpack module, without additional formatting
Oh I see, I thought it was vencord handling the function calls and stuff
I dunno how to make the slate disappear when you click the button, probably something simple but I'm supposed to be working atm
This is around the wrong way from what I was expecting, or well... it should be automatically detected, and I wasn't expecting it to paste automatically
Make it delete the masked link instead
If you need to inject your own functions, export the function through the plugin object, and reference the plugin object using $self in your patch replacement
Ya thatβs what I mean. I didnβt know this was possible until looking at other plugins, which is why I wanted to know if there was any documentation
Oh I thought you just wanted to it insert a masked link if you had a link copied
What was your idea then?
I really don't think there should be one set behaviour
Seems confusing for a single button to have multiple behaviours
No?
Detect if the text in the chatbox is a link, make that the link and move the caret to the label, and vice versa
Pasting should just be done with the now stock behaviour
Yeah
Disclaimer: I use the plugin to turn this off
Also I forget pasting masked links is default now, I changed it with https://github.com/lolsuffocate/maskedPasteOptions forever ago
ctrl+shift+v pastes masked links for me
why ctrl+k?
also that already opens the search thing
Common shortcut in most other "word processor" apps
oh
and yes I know that it opens quick switcher already
is there a keyboard shortcut for quote/code/spoiler (just found ctrl+shift+s does strikethrough)
Not that I'm aware of
Are you trying to make people close their discord clients?
what doesnt
ctrl+shift+q on vesktop
it would just sometimes be nice to be able to highlight stuff and then do a shortcut instead of typing the ` ` or || ||
yop
Writing ` is kind of a pain on mobile, but on desktop it's no big deal
is there a way to force refresh a patch or something? as in rely on some state within the replaced part of the patch, and update it when that changes?
The way you are saying it is very confusing
Explain what you're trying to do
Are you patching a react component?
Patches are applied when the module is loaded
You can't rewrite the code of a function after it has been called, that's just nonsensical
ic
Self-modifying code be like : hellu
im asking because vendicated said about using patches for blurnsfw instead of the current implementation
but that would mean that the app would need to be reloaded each time the blur amount gets changed no?
unless using a css var but then i dont see how you would change that dynamically either without restart?
the blur would be applied in a react component, which you can use states to re-render
it's a question more about react and states, than it is about patches
Are there any plugins which do something like this already that I can take a look at?
I understand React and state management but I'm confused as to what would actually be patched
The default image component to a custom one?
You might want to look at ThemeAttributes
I would add a CSS selector that sets a variable from an attribute, and you can use that CSS variable in other more precise selectors later
/**
This one is altered to change the dedicated blur amount for all
elements containing `.vc-blur-nsfw` in the classlist
**/
[data-nsfw-blur$="px"] {
--vc-blur-nsfw-amount: attr(data-nsfw-blur);
}
/**
This one is added onto elements classlists
**/
.vc-blur-nsfw {
filter: blur(var(--vc-blur-nsfw-amount, "0px"));
}```
I don't really understand what you mean. Something like this?
yes, something like that
it's not the only way you could do it
you could probably do it more directly (through the style attribute), but you'd need to patch more places
and what're the advantages to doing it using patches rather than just injecting a stylesheet? less chance of messing up other plugins or something?
honestly I think you should talk to Vee directly about what would make it better
or @cedar olive
isnt the concern also regarding the user list?
Yup I would also have to worry about that but I don't even know where to get started with the original functionality of BlurNSFW so wanna get that out of the way πΏ
The issue with BlurNSFW is the selectors being horrible
What's so bad about them?
They don't select everything
I remember there being an issue with images in embeds at one point
mm
i dont have the exact same selectors as blurnsfw at least πΏ
And do know the embedded images aren't broken
Iirc some weird thing with using methods on window as references
Could be wrong
it's a fucking getter that errors
you have to be kidding me
I cant' even jump to it's function definition
Assume that there is an object and one of its properties is an object with DOMTokenList as its prototype. In Chrome and FireFox, this will cause different errors when copying the object. In both ca...
who thought this was a good idea
almost 10 year old issue
it's a weird ass property that throws an error
Isn't it native, so you can't?
yeah probably
oh no
that issue has been plagueging other mods for ages
not vencord cause of the property length check
did you remove it? or did it get mangled?
yeah I just removed it
lol dont remove it xD
trying to future removing findByProps usages
but then one function can't be found by code
because of the length check
wdym
futureproof*
they reverted the mangled change
I was changing the finds that depend on non mangled stuff
to work with mangled
so findByProps -> findByCode
yeah most stuff
ah ic
i didnt pay attention to it much cause i figured they would revert
I didn't either, just looked at what changed real quick
thing is that the length check is performance relevant
i wouldnt remove it for future proofing tbh
maybe we could just introduce fallback filters
findWithFallback(filters.byProps("FormSection"), filters.byCode("whatever"));
smth like that idk
though is it really necessary
if they make such a major change we could just take the L and have it break for a bit
not a big deal with the CrashHandler updater
most stuff was working fine changing to findByCode
but then I had to find useMessageMenu
which is in a module with two exports, non mangled
yeah you cant find that with findByCode
and things like that DOMTokenList will screw you over anyway xD
i mean if it actually becomes an issue it wouldnt be a big deal to just blacklist that module
(make it non enumerable similar to what we do to windows)
I'll see what I will do another time
is there an accepted way to grab the handle/path/whatever to a file the user is attempting to attach to a message? (preferably as soon as its selected in the upload menu, before discord can ignore it due to size or something else) or should i just keep fucking around until i find something that works
prob patch the upload funciton
okioki!!! i just didn't know if there was anything that was blatantly obvious that would end with me making stupid decisions in my code π tyy
why
seems xy problemy
Ehhhh not really
what are you trying to do
uhhhh I tried to be as specific as possible
I'm trying to grab a handle to the file so that if discord fails to upload for whatever reason, the upload can be redirected to a different endpoint(eg. nextcloud) and handled by the plugin
a friend of mine wants the plugin and I decided it's useful enough to make anyways lol
I'd maybe point them towards https://ptb.discord.com/channels/1015060230222131221/1272186590214619281 before you do too much work
But I don't think they've solved discord denying a dropped file if it's too big if I remember right
- wow how did I miss that
- wdym? isn't the entire point of the plugin that it handles large files

I haven't used it myself but just from reading the thread as it was being developed it seems like it doesn't work for dragged and dropped files, I guess just from the upload button
#1272186590214619281 message
ahhh
I mean I already have discord running a custom function when the file requested for attachment to the message is >50mb
but that's good to know about
i honestly might just redirect my efforts to helping them :3
ty
regarding custom titlebar (from my ancient channeltabs fork) revival project, i am trying to move a lot out of the user area (and other places) and into the titlebar
so far I have these ideas of plugins and features to reimplement there
- ServerListIndicator
- CallTimer
- the entire standard user area
- GameActivityToggle
this isn't a serious thing, more just something personal
First off, I wanna admit I have no idea what channeltabs used to be, I have been only using vencord for 8 months i think. How do these "tabs" work under the hood? Like are these sandboxed BroswerViews or are these simulated tabs (not sandboxed)?
Like are these sandboxed BroswerViews or are these simulated tabs (not sandboxed)?
no that would be too logical
it was just switching channels
so it would rerender the whole channel
and lockup the client for half a second (on some devices)
due to it being "tabs" you'd expect it to be instant
but it's not
do you have a link to your fork?
It's 7 months old
doesn't matter, just curious about the impl
most of the code is not mine, there's a lot of working around the existing code
it mostly just changes where it injects and makes it into a proper titlebar
my version: https://github.com/Sqaaakoi/Vencord/tree/betterChannelTabs/src/plugins/channelTabs
original version, slightly more updated but without my changes
https://github.com/sunnniee/Vencord/tree/channeltabs/src/plugins/channelTabs
thanks 
i don't think it's realistically possible to do channeltabs properly without a wrapper around multiple instances of the client
discord's route controller system is absolutely terrible
and there's probably a bunch of calls to check the current channel in components too
it's so bad that I wouldn't recommend trying to make a plugin to add your own route.
what a class name
is this a joke or an actual question?
neither? I suppose it didnt come across well over text "Wow, what a class name!"
ohhhh
It turns out that CallTimer's hooks break in the way I'm using them
wait
can't i use that calltimer for multiple people PR
π it was abandoned
stil up to date enough for my needs probably
Ah. I see the issue why it was abandoned and closed
you will useStateFromStores with selected voice channel or voice state and then render the CallTimer component if a call exists
will still break
because the entire titlebar goes poof in fullscreen
i will make my own hooks with useSyncExternalStore and I will NOT like it
I genuinely don't know what's that
hacky workaround for turning anything into a hook
my react knowledge comes entirely from vencord plugins π
might be useful
i don't actually use useEffect for that in my horrible port of code from forever ago actually
i am done hu
debug code got committed 
sadan and nin0 will scream at how Not React Looking all of this is
i hate react
tired of react? make regular looking single use event system that listens to flux stores and wrap it in react 
https://github.com/Sqaaakoi/Vencord/blob/modernTitlebar/src/plugins/modernTitlebar/utils/callTimer.tsx it's horror
insnaeeeeeeeeeeeeeeeeee
why does vee husk
is it
- reimplementing plugin in a new way
- husk thumbnail
- horrible code
- all of the above
4
i will clean it up eventually
you will addReactChangeListener instead
They always say that
it's the same but more appropriate
whats the difference

Alright @flint bronze, in 8 hours: refactor to be less cursed
@flint bronze, <t:1736691969:R>: refactor to be less cursed
later
I've installed vesktop on ubuntu via flatpak and I'm trying to make my own vencord plugin but I can't find the "src/plugins" directory. I checked the vesktop settings but it just says "files are loaded from default location"
have you followed https://docs.vencord.dev
Well yeah flatpak doesn't include the source code
do I need a different install for the dev build?
Dev build means build from source
yeah seems I missed that part on the docs
thanks guys
it is time for me to rest
i lied for now
anyone know the patch to modify how names are rendered in the side bar
@flint bronze, <t:1736720783:R>: refactor to be less cursed
hey there! what would be the best way to open a floating modal, like when reacting to emotes, or even the emote/sticker/gif selector
is it something that the api includes?
Best thing to do if you have something you want to imitate is to look how that thing does it
If there's an existing plugin that does something similar that's nice of course, but otherwise you'll have to dig
okay welp got something to work
pretty nice
yep, added debounce and fixed the image size, this is probably my best private plugin so far
(and my first one too
)
so no got it ty because I'm looking at https://docs.vencord.dev/plugins/ where I can't search features of plugins and other stuff if i was unclear
I don't think there is any other documentation so far
unfortunate
there is some old documentation that i don't think ever made it onto the docs, but it doesn't contain a lot more
there is some stuff in the pins though
Most things can be found by looking at the code of other plugins
love a good egg hunt
I'm trying to make a plugin where I can search the messages in all the guild a user is in to find content that it contains this is an investigation tool I'm building I just can't seem a way to search
you can use the search endpoint. it returns 25 messages per page π₯³
tldr: you are not getting all messages without API abusing
Is there an way to make an select menu component
you can use the Select element from "@webpack/common"
lol I should add something similar for this #π§©-plugin-development message
Mine are client side only though, like the twitch extensions
this is awesome
i would suggest considering adding it to the tabbed expression picker though
yeah was going to, but after trying to figure out what function was opening the picker with the correct tab and seeing it was based on callbacks and refs decided to go the easy way, may move it to the expression picker in the future
my autism just hit the day before an exam and had to develop my first vencord plugin, I didn't want to waste a lot of time
Can't you do that with the text replace plugin?
They're done via markdown, so the actual message content does just show "emojiName" or whatever, people on the other side just see text
It's not image links like fakenitro
How can I find this function?
Whats the module id, also XY problem
How can I find the module id? I'm trying to use something like const applicationsPublic = findByCode("APPLICATIONS_PUBLIC"); then call applicationsPublic(appId) to get an app info
But obviously findByCode can't find that string
that module doesnt look to be exported
i want the module id to see if it could be wrapped and exported for example
this is the module id
728345
find(m=>m.fetchApplications&&m.transferApplication)
I don't think so
Its a prop of ZP
It works
Thanks a lot
fetchApplications does trigger the request that I want but does not return the response. Any clue what can I do? Is there a way to manually trigger a fetch request that contain the cookies/auth headers instead?
You can use RestAPI
Iirc the code broadcasts a flux event when it's done
Yes it does
is this good
get rid of the preview button
stock notifications menu has an inline preview sound button
other than that it's fine
Its the one they showed
lol i don't think going back to the notifications menu to preview it is good ux
that's understandable
i just don't like the placement of it being in its own row like that
it feels like an afterthought
search up ExpressionPickerApi or something in vencord prs, you will find how I patched the expression picker
that if the patches still work..
what do you mean by that?
the value of the volume slider has an effect on the preview
if you put it in the sound file section then you'd think that the volume did not affect it
along side the toggle then
I would still relate the volume slider to the preview if it were near the sound name
also I think you should use this kind of slider
to be consistent with the rest of Discord
plugins are more nerdy therefore need more labels
me too but it is a point

it feels off tho
fair i guess volume sliders don't normally look like that
oh dang
wait
patch matching the wrong identifier
is this duplicate functionality with customsounds
because in custom sounds you can achieve the same by turning every sound down
of course that is worse ux
oh actually maybe not
but maybe the slider should just be merged into customsounds?
nahh it's fine
lol actually i copied the slider from here
the purposes are a bit different
vencord has so many different volume sliders none of which are the same
561779 seems to be the slider
for you to webpack find
not sure
I dont think so
okay maybe
I didnt realize lol
i mean it functions the same lol
I think putting the preview button at the bottom makes most sense
it makes it seem like all of the previous settings affect it
the slider with no marks and this wide feels weird
is it ok to just put width: 320px

to make it the same as the input volume slider
maybe max-width
i guess an ideal width would be 300
but yeah
i mean a multiple of 100
but then it being on its own row feels weird
i don't think so
is it not gonna have huge empty space in the right
should i just add another button that does nothing
yes
then place it next to the slider
well that's also confusing
π
only other logical place would be to put it next to the name notification page style
but it's kind of annoying to press as it's so small
why tho
