#🧩-plugin-development

1 messages Β· Page 73 of 1

hushed loom
#

eg if you want to find functions for emojis, look at the code for the emoji picker

winter tartan
#

can i use dzikstar's discrapper repository for this

hushed loom
#

idfk what that is

winter tartan
#

or tiemen's

#

how do i like access discord code

hushed loom
#

devtools

winter tartan
#

is it possible through devtools

hushed loom
#

ctrl+shift+i

winter tartan
hushed loom
#

enabling react devtools is vencord settings will help a lot

hushed loom
#

you can view the source for a component in the top right

winter tartan
#

do i select ur profile element to find the component for it?

hushed loom
#

what do you click to open a users profile

#

find that component

#

that look at the code for its on-click function

winter tartan
vast karma
#

Chrome's, since it is chrome

#

Though, isn't edge chrome too?

winter tartan
hushed loom
#

but they have their own devtools

hushed loom
flint bronze
#

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;
hushed loom
#

too eepy to think

flint bronze
winter tartan
#

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

hushed loom
flint bronze
#

@hoary pilot i host my plugins on your neveronline forgejo for fun

hushed loom
#

very secure

winter tartan
flint bronze
#

i will make it more configurable later

winter tartan
#

oh yea one more thing, so there are props like getCurrentUser, and how do I see all the other able props?

flint bronze
#

type it into browser console and run it, click the returned object

#

nvm

winter tartan
#

a

flint bronze
#

why it gotta trolley like that

#

use the autocomplete instead

winter tartan
hushed loom
#

if you just wanted the props for userstore

winter tartan
#

right?

dull magnet
#

you shouldn't have to go via children

hushed loom
#

But I couldn’t find any other way

dull magnet
hushed loom
#

Iirc no

#

I’ll check tomorrow, but I remember looking at via devtools

dull magnet
#

oh yeah you're right

proud parrotBOT
dull magnet
#

this should spread ...this.props.wrappedProps

hushed loom
dull magnet
#

because you don't pass it

hushed loom
flint bronze
hushed loom
#

Couldn’t that collide with error and message

dull magnet
#

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

winter tartan
#

ill understand this language once i deep learn discord code and vencord's magic wires

vapid oar
#

what are the typings for getPremiumSubscription and getPremiumTypeSubscription from SubscriptionStore?

dull magnet
#

just look at what it returns

vapid oar
#

ven forgot poor people exist

dull magnet
#

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

dull magnet
#

but yeah makes sense lmao

#

my bad

vapid oar
vast karma
hushed loom
#

@simple coveuse this channel if you need help developing for vencord

burnt ermine
burnt ermine
#

i asked a couple days ago so tell me to f off if im being annoying lol

hushed loom
#

?remind 24 hours

fathom pivotBOT
#

Alright @hushed loom, in 1 day: …

burnt ermine
#

Okie dokie

safe glade
#

is there any reason that a DataStore get/set call would hang (i.e. the promise would never resolve)

hushed loom
#

you might have the issue i had

#

that i couldnt figure out

safe glade
#

how did you fix it then ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

hushed loom
#

@safe glade can you screenshot this page in devtools

safe glade
hushed loom
#

to fix (warning: will delete all your settings)

safe glade
#

(well not me, @golden bloom did but he's shy) ​​

golden bloom
hushed loom
#

@golden bloom warning: this will delete all of your data

safe glade
golden bloom
hoary pilot
#

run for free money

hushed loom
#

go to VencordData and press delete database

golden bloom
#

roz can confirm

safe glade
hushed loom
green cypress
#

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.

vast karma
#

Use a patch then

#

Like in 99.98% of cases

green cypress
#

The moyai plugin seems to provide a good starting point actually, I'll try with that and MessageUpdater to edit the content

fathom pivotBOT
#

@hushed loom, <t:1735429545:R>: …

green cypress
#

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?

hushed loom
#

there is no up to date type

#

use devtools and inspect objects

green cypress
#

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 });
        }
    }
});
green cypress
#

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

green cypress
#

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

quaint cipher
#

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

hushed loom
quaint cipher
#

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

vast karma
#

Just replace the nitro route

swift delta
quaint cipher
green cypress
#

Do I need to use createStore to use the DataStore>

exotic saddle
#

hello

swift delta
hoary pilot
#

the datastore is simply a key value store

green cypress
#

Alright

#

How fast is it to access / use? Should I try limiting and batching updates?

hoary pilot
green cypress
#

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

green cypress
#

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

flint bronze
quaint cipher
#

yes

flint bronze
quaint cipher
#

lol

flint bronze
#

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 husk

green cypress
exotic saddle
hushed loom
#

what is your end goal for a plugin

green cypress
# hushed loom 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

exotic saddle
#

Hides everyones badges

    display: none !important;
}

[class*="profileBadge"] {
    display: none !important;
}

[class*="activityBadge"] {
    display: none !important;
}

[class*="messageBadge"] {
    display: none !important;
}

shrewd tundraBOT
exotic saddle
#

sorry my bad guys

tropic ice
#

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_])

green cypress
clear parcel
#

i would've added tab search if i knew how to ui xd

amber basin
#

what would i pass to sendMessage to instantly send and not wait for the channel to load

amber basin
#

ty!

rough scroll
#

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?

hushed loom
opal dock
#

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

vast karma
#

Check what RCE does

opal dock
#

oh good point

#

ok it's simpler than I thought lol

#

thanks

dull magnet
#

RCE in your vencord? it's more likely than you think......

opal dock
#

I now have the role colors all figured out :3
thanks

atomic kite
#

When making a Vencord plugin, is there some sort of test environment I should use?

atomic kite
#

Ty!

burnt ermine
daring karma
#

#πŸ₯-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

daring karma
#

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

dull magnet
#

activities run in a separate iframe

#

you can only inject js into them

#

look at YoutubeAdblock, FixSpotifyEmbeds for examples

daring karma
#

the youtube adblock one is the one I'm modifying as a base

daring karma
#

is the workflow for something like this just building the dev version, injecting, and then rerunning? or is there a better way

humble tulip
#

You only need to inject the first time, after that you can just build and reload

hushed loom
daring karma
#

oh ok nice, I've just been reinjecting and then relogging in every time lol

hushed loom
#

||i know pnpm watch is a thing, but ive had issues with IS_DEV when using it||

dull magnet
cedar olive
#

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)

daring karma
#

I don't remember it working when I tried earlier, I'm going to try again

daring karma
#

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

dull magnet
#

you just need to fully restart discord

#

not ctrl r

daring karma
#

ah ok, thanks, that works

hushed loom
#

where do the props for context menus come from

#

(looking to add props that i need via a patch)

dull magnet
#

look what the context menu api patches

#

it's just the props discord passes to the menu

hushed loom
#

yea, but i cant find where discord calls the context menu

#

trying to pass props to image-context

dull magnet
#

search for the context menu id lol

cedar olive
hushed loom
cedar olive
#

did you find?

hushed loom
#

still havent

#

doing it another way

cedar olive
#

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

hushed loom
#

trying to find where the props for the context menu for this image come from

#

and if its possible to pass any extra

cedar olive
#

seems to b here

hushed loom
# cedar olive

yea, i found that part, then tried to figure out how discord used it then gave up

cedar olive
#

this is unironically the best shit I did

#

so good

hushed loom
#

was there really no better way to do it?

dull magnet
cedar olive
#

LOL

#

I guess so...

dull magnet
#

do you really want that to represent you

cedar olive
#

damn

dull magnet
cedar olive
#

😞

cedar olive
hushed loom
cedar olive
#

what about that

hushed loom
#

just the webpack logo on webpack.ts

cedar olive
#

oh lmaooo

cedar olive
#

which changes the location of the logs

hushed loom
#

i hate things that hook console

#

(the vscode neovim extension does it in the shittest way imaginable)

hushed loom
#

is it possible to do a backreference here

#

nevermind

#

im just stupid

waxen oriole
#

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?

waxen oriole
#

yuh

#

the sendBotMessage func

hushed loom
waxen oriole
#

oh yeah mb, shouldve clarified the function before

dull magnet
#

not that easy no

waxen oriole
#

what does the /1/ stand for? bot avatars?

hushed loom
#

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

waxen oriole
#

I.. will take a look, thanks GirlSweat

flint bronze
#

time to make a new userplugin

hushed loom
flint bronze
#

i am a victim of discord's absolutely terrible shit route controller

near root
#

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?

near root
#

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

near root
#

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

cedar olive
#

https://discord.sex might have some info

Discord Userdoccers

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...

near root
#

thanks ill look into it

#

coudlnt find anything 😭

#

its sounding like a 3.5mm jack thats only halfway connected

near root
#

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

frosty mist
#

is there no way to test my plugin in real time instead of rebuilding Vencord every time I make a change?

cedar olive
#

pnpm watch, to rebuild automatically

frosty mist
#

oh it's the yellow box in the docs, didn't see it. thanks

frosty mist
hushed loom
#

ctrl + r

frosty mist
#

aside from that

hushed loom
#

(unless you're doing native work)

#

nope

frosty mist
#

I'm guessing nothing then

#

thanks

near root
# near root and right now idk how to fix 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

near root
#

?

clear parcel
#

this seems like an xy problem

clear parcel
#

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

near root
#

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

clear parcel
#

funnily

#

something like this could probably be used to make the fabled free soundboard

cedar olive
#

dolfies 😭

#

that's what they are making lmaoo

clear parcel
#

ohhh

#

yk that makes a lot of sense

cedar olive
clear parcel
hushed loom
#

@near root if you want, I'm also interested in making a fake soundboard plugin if you want/need help

near root
hushed loom
#

ill take a look and make some patches

near root
#

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

cedar olive
#

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

near root
hushed loom
#

settings>patch helper

near root
#

ahh thanks

#

that explains

hushed loom
#

@near root why are you hooking websocket (need to know why to make a patch)

near root
#

to get voice connection ip, port, ssrc and secret key

hushed loom
#

@near root think i found where to patch what you want

#

ill make it when i get home

near root
#

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

hushed loom
#

that should be easy

near root
#

awesome

near root
#

finally got ogg sounds to play

cedar olive
#

gotta handle making the circle green when playing the sound too

#

unless that's automatically

near root
#

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

green vessel
#

Danke

#

Hlloooo

oak sundial
green vessel
#

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?

green vessel
#

Aw man that page covers that exact case

hushed loom
green vessel
#

ahhh fuck

hushed loom
#

rename your file to index.tsx

green vessel
#

yep

#

Cheers

hushed loom
#

Is it possible to get vencord settings (see what plugins are enabled) at StartAt.init

humble tulip
#

Surely you must be able to otherwise it wouldn't know what plugins to start

cedar olive
#

yeah

#

just use normally

cedar olive
near root
#

@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

cedar olive
#

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

near root
#

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

near root
cedar olive
#

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

near root
near root
#

oops i think i got ratelimited

thorn plover
#

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

hushed loom
thorn plover
green vessel
#

@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?

hushed loom
#

there is prob a way to do it, but thats fine

green vessel
#

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

green vessel
#

though I can do !Boolean(id) if you'd like

hushed loom
#

!id should be the the same thing

#

as !!!

green vessel
#

Oh

#

Oh of course yes it's casted when doing that

#

Okay well fixed now πŸ—Ώ

flint bronze
#

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

indigo ferry
#

Is there a way to get the current window title when streaming? Or knowing if Discord is streaming itself?

indigo ferry
flint bronze
indigo ferry
#

iirc this data gets resent everytime stream/voice data is updated

indigo ferry
flint bronze
#

@hushed loom would you be willing to help me make a plugin

#

or @indigo ferry would you be willing to help

indigo ferry
flint bronze
#

get in vc and start streaming something (content not important)

#

ughhhhhhhhhhhhhhhh

#

discord sends a new stream_create event for every viewer

indigo ferry
flint bronze
#

@indigo ferry do you mind also coming and helping? I need to test an "allowMultiple" option

flint bronze
#

i need you to also stream so I can click the watch multiple streams button

flint bronze
#

thank you so much for your help

#

just wanted to make sure nothing too weird is going on with the logic in this function

indigo ferry
flint bronze
#

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

indigo ferry
#

it comes from the ws

flint bronze
#

i need to capture it from a flux event or something like that

#

oh im fucking blind it's part of the streamkey

flint bronze
#

i haven't explained what i am making

#

have I

#

😭

indigo ferry
flint bronze
#

automatically watch new streams plugin

indigo ferry
flint bronze
indigo ferry
flint bronze
#

discord will make this code instead of emitting events for these scenarios and listening to those events to play sounds

flint bronze
#

see this function?

#

if allowMultiple or noFocus is passed in the 2nd argument, it will NOT focus the stream

flint bronze
#

huh

#

new discord fact

hushed loom
#

too eepy to think

flint bronze
#

discord doesn't play join/leave channel sound effect if there's more than 25 people in the channel

#

someone probably knows this already

flint bronze
#

@indigo ferry how did i not notice until now that you made streamermodeonstream

clear parcel
hushed loom
#

or is that what they need to do?

clear parcel
#

the green circle for others is just set when the udp socket receives voice data

#

client-side is the issue

hushed loom
#

ah

clear parcel
#

also ppl are gonna be really confused when their soundboard volume isnt respected lol

hushed loom
#

lol

#

tbh not really any different than a software level soundboard

clear parcel
#

true

#

tfw i have a unique plugin idea but i need to patch the friends bar (i am never doing that again)

flint bronze
#

like you did in implicit relationships?

clear parcel
#

yea

flint bronze
#

the friends tabs?

clear parcel
#

this thing

hushed loom
flint bronze
#

i fucking hate the way that renders

#

it's all filtering known relationships

clear parcel
#

i wanna add a button but my react skills are not up to par

#

(they don't exist outside of vencord patching)

flint bronze
#

i think i tried to make a page there at one point and gave up because too cursed

clear parcel
# hushed loom what is the idea

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

flint bronze
#

what

#

thats cool

clear parcel
#

so i wanted to add like a

#

copy url

flint bronze
clear parcel
hushed loom
#

oh

clear parcel
#

and expire

hushed loom
#

neat

clear parcel
#

this doesn't expire

flint bronze
#

whats the endpoint?

clear parcel
#

and has no max uses

flint bronze
#

i want to know more

clear parcel
flint bronze
#

oh

#

okay?

clear parcel
#

ep isn't in the client

#

that part is easy

#

adding the button is hard :((

flint bronze
#

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?

hushed loom
#

@clear parcel wires

flint bronze
#

and how is it already documented in Vencord?

hushed loom
#

am i stupid

flint bronze
#

it's a get request

#

thats why

flint bronze
#

also token mod rule trolley

clear parcel
#

yeah GET

#

xd

#

mb

hushed loom
#

@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

clear parcel
#

only reset pw

hushed loom
#

huskkkk

clear parcel
hushed loom
clear parcel
#

it's just userid.timestamp.hmac

#

like tokens

flint bronze
#

it is literally the same format as a token

#

wtf is the point of this feature?

hushed loom
#

tbh i dont like that you cant revoke

#

i wouldnt want to give it out

flint bronze
#

doesnt seem to be auto accept

hushed loom
flint bronze
#

it's just for when you dont share mutual servers?

hushed loom
#

just doesnt sit well with me

flint bronze
#

it's just because discord profiles aren't exactly public

#

but they're not private

hushed loom
#

weird

#

thought it was

clear parcel
#

ya just lets u send frs even with settings off

hushed loom
#

thats really nice

clear parcel
#

not that high risk

hushed loom
#

thought it was more like a friend code

flint bronze
#

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

flint bronze
#

i took a break and fixed my mindset

flint bronze
#

guh

#

i'm gonna just abuse voice states a lot

fiery berry
#

Is there an easy way to close the "click on a message avatar" mini profile popout from a patch deeply nested inside it?

humble tulip
#

I was playing with it a while ago but never really went anywhere because I had no ideas

flint bronze
humble tulip
#

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

flint bronze
#

Add them? but as you said yes thats boring

#

of anything I want there, make CTRL+K create a masked link

humble tulip
#

That was my only idea too lol

flint bronze
#

make it

humble tulip
#

I was messing with a handful of things at the time so it kinda fell to the wayside

flint bronze
#

you've got someone who has the same idea

flint bronze
#

i'm just playing around with the nitro purchase wow moment animation for fun

#

there's nothing particularly useful to do with it

vast karma
#

Make the timestamp plugin add a button there instead of magically converting syntax

flint bronze
#

I need to look at how that plugin works

#

I have it off because too many chatbar items

flint bronze
#

ugh

#

thats kinda ugly

vast karma
#

(How do I get bot to embed things without github's own giant box?)

flint bronze
#

probably doesnt have permissions to send messages here

#

native picker SO UGLY

#

can we refactor this to use components from events

vast karma
#

I'm usually a fan of using native widgets when possible... But yeah that's ugly

flint bronze
#

the problem with events is the time dropdown is in 15 minute intervals

vast karma
#

Yeah but you can write times manually too

#

But no seconds I think

flint bronze
#

make multiple components?

#

date takes up half of the width, rest of the right side is 3 dropdowns for hour, minute, second?

vast karma
#

You are aware that dropdowns for numbers is the devil, right?

flint bronze
#

fr 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

vast karma
#

I like android's time picker

flint bronze
vast karma
#

Though I don't know how well it works on mkb

flint bronze
#

so you could tap, and press OK immediately and it would return with some random value in between

vast karma
#

Okay that sounds retarded I have to try

flint bronze
#

Not sure if it still holds up

vast karma
#

Can't reproduce

#

Though I have to say, setting animation duration to 10x makes this phone physically painful to use

flint bronze
#

oh

#

i found it again

proud parrotBOT
flint bronze
#

idk if that still happens though

green vessel
#

Is there any documentation for patches?

flint bronze
#

There's a proper guide out there somewhere

vast karma
#

Well, that and \i and $self

green vessel
#

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?

vast karma
#

What do you mean "which props are passed in"

flint bronze
vast karma
#

It's strings

green vessel
#

this.props.<…>

flint bronze
flint bronze
#

a patch match is a regex match of code inside a webpack module, without additional formatting

green vessel
humble tulip
#

I dunno how to make the slate disappear when you click the button, probably something simple but I'm supposed to be working atm

flint bronze
# humble tulip

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

flint bronze
flint bronze
green vessel
humble tulip
#

Oh I thought you just wanted to it insert a masked link if you had a link copied

#

What was your idea then?

flint bronze
#

I really don't think there should be one set behaviour

humble tulip
#

Seems confusing for a single button to have multiple behaviours

flint bronze
#

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

humble tulip
#

Okay I see what you mean now, if there's a link you want it to just do and put you in the [] so you can type the text

flint bronze
#

Yeah

flint bronze
humble tulip
#

ctrl+shift+v pastes masked links for me

tropic ice
flint bronze
tropic ice
#

oh

flint bronze
#

and yes I know that it opens quick switcher already

green vessel
#

Ctrl shift k?

#

Or ctrl L?

flint bronze
tropic ice
#

is there a keyboard shortcut for quote/code/spoiler (just found ctrl+shift+s does strikethrough)

flint bronze
#

Are you trying to make people close their discord clients?

tropic ice
#

huh

#

no?

flint bronze
#

eh

#

doesnt work anyway

#

Β―_(ツ)_/Β―

tropic ice
flint bronze
#

ctrl+shift+q on vesktop

tropic ice
#

it would just sometimes be nice to be able to highlight stuff and then do a shortcut instead of typing the ` ` or || ||

vast karma
#

Writing ` is kind of a pain on mobile, but on desktop it's no big deal

green vessel
#

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?

flint bronze
#

The way you are saying it is very confusing

#

Explain what you're trying to do

#

Are you patching a react component?

vast karma
#

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

azure fossil
green vessel
#

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?

cedar olive
#

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

green vessel
#

Are there any plugins which do something like this already that I can take a look at?

cedar olive
green vessel
#

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?

flint bronze
#

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

green vessel
flint bronze
#

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

green vessel
#

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?

flint bronze
#

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?

green vessel
#

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 πŸ—Ώ

cedar olive
#

excuse me, what?

flint bronze
green vessel
flint bronze
green vessel
#

mm

#

i dont have the exact same selectors as blurnsfw at least πŸ—Ώ

#

And do know the embedded images aren't broken

hushed loom
#

Could be wrong

cedar olive
#

it's a fucking getter that errors

#

you have to be kidding me

#

I cant' even jump to it's function definition

#

who thought this was a good idea

flint bronze
cedar olive
#

it's a weird ass property that throws an error

hushed loom
cedar olive
#

yeah probably

dull magnet
#

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?

cedar olive
#

yeah I just removed it

dull magnet
#

lol dont remove it xD

cedar olive
#

trying to future removing findByProps usages

#

but then one function can't be found by code

#

because of the length check

cedar olive
#

futureproof*

dull magnet
#

idgi

#

so if it gets unmangled it works still or wdym

cedar olive
#

they reverted the mangled change

#

I was changing the finds that depend on non mangled stuff

#

to work with mangled

#

so findByProps -> findByCode

dull magnet
#

oh did they mangle everything with that canary update

#

is that why shit broke

cedar olive
#

yeah most stuff

dull magnet
#

ah ic

cedar olive
#

that huge module with re-exports got mangled

#

and then they reverted

dull magnet
#

i didnt pay attention to it much cause i figured they would revert

cedar olive
#

I didn't either, just looked at what changed real quick

dull magnet
#

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

cedar olive
#

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

dull magnet
#

yeah you cant find that with findByCode

cedar olive
#

and then a findByCode doesn't work because it skips it

#

yeah

dull magnet
#

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)

cedar olive
#

I'll see what I will do another time

scenic stirrup
#

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

scenic stirrup
#

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

hushed loom
dull magnet
#

what are you trying to do

scenic stirrup
# dull magnet seems xy problemy

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

humble tulip
#

But I don't think they've solved discord denying a dropped file if it's too big if I remember right

scenic stirrup
#
  1. wow how did I miss that
  2. wdym? isn't the entire point of the plugin that it handles large files c_e_catsob
humble tulip
#

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

scenic stirrup
#

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

flint bronze
#

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

tender marlin
flint bronze
#

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

tender marlin
flint bronze
#

It's 7 months old

tender marlin
flint bronze
flint bronze
#

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

flint bronze
flint bronze
#

Thinkies how did we get here (... on a string passed to classes(...classNames))

hushed loom
frigid knot
#

neither? I suppose it didnt come across well over text "Wow, what a class name!"

flint bronze
#

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

cedar olive
#

you will useStateFromStores with selected voice channel or voice state and then render the CallTimer component if a call exists

flint bronze
#

because the entire titlebar goes poof in fullscreen

#

i will make my own hooks with useSyncExternalStore and I will NOT like it

cedar olive
#

I genuinely don't know what's that

flint bronze
#

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

flint bronze
#

debug code got committed trolley

#

sadan and nin0 will scream at how Not React Looking all of this is

hoary pilot
#

i hate react

flint bronze
# hoary pilot i hate react

tired of react? make regular looking single use event system that listens to flux stores and wrap it in react trolley

hoary pilot
#

insnaeeeeeeeeeeeeeeeeee

flint bronze
#

why does vee husk

#

is it

  • reimplementing plugin in a new way
  • husk thumbnail
  • horrible code
  • all of the above
dull magnet
#

4

flint bronze
#

i will clean it up eventually

cedar olive
#

you will addReactChangeListener instead

vast karma
#

They always say that

cedar olive
#

it's the same but more appropriate

flint bronze
cedar olive
flint bronze
#

no seriously i am aliening

#

?remindme 8h refactor to be less cursed

fathom pivotBOT
#

Alright @flint bronze, in 8 hours: refactor to be less cursed

fathom pivotBOT
#

@flint bronze, <t:1736691969:R>: refactor to be less cursed

flint bronze
#

later

tame elk
#

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"

hushed loom
vast karma
#

Well yeah flatpak doesn't include the source code

tame elk
vast karma
#

Dev build means build from source

tame elk
#

thanks guys

quick zephyr
#

anyone know the patch to modify how names are rendered in the side bar

fathom pivotBOT
#

@flint bronze, <t:1736720783:R>: refactor to be less cursed

haughty trail
#

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?

vast karma
#

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

haughty trail
#

gotcha will dig then

#

was hoping there was an api for it already

haughty trail
tropic ice
#

pretty nice

haughty trail
#

yep, added debounce and fixed the image size, this is probably my best private plugin so far

#

(and my first one too KEK )

green vessel
tropic ice
green vessel
haughty trail
#

I don't think there is any other documentation so far

green vessel
#

unfortunate

tropic ice
#

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

rocky lynx
#

Most things can be found by looking at the code of other plugins

green vessel
#

love a good egg hunt

rocky lynx
#

Its not too bad

#

You can always ask in here too if you get stuck

green vessel
#

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

hoary pilot
#

tldr: you are not getting all messages without API abusing

green vessel
#

😭 brainrot role really got me screwed

green vessel
#

I'm FREEE!

green vessel
#

Is there an way to make an select menu component

haughty trail
humble tulip
#

Mine are client side only though, like the twitch extensions

flint bronze
haughty trail
#

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

leaden fable
humble tulip
#

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

leaden fable
#

How can I find this function?

hushed loom
leaden fable
#

But obviously findByCode can't find that string

hushed loom
#

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

hushed loom
#

you'll have to mapMangledModule for that

#

(i think)

bronze dove
#

find(m=>m.fetchApplications&&m.transferApplication)

hushed loom
#

Its a prop of ZP

bronze dove
humble tulip
#

It works

hushed loom
#

istg if its re-exported somehwere

leaden fable
leaden fable
#

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?

humble tulip
#

You can use RestAPI

hushed loom
leaden fable
#

Yes it does

pure temple
#

is this good

clear parcel
#

it fetches owned apps

#

just use restapi

flint bronze
#

stock notifications menu has an inline preview sound button

#

other than that it's fine

bronze dove
pure temple
flint bronze
#

that's understandable

#

i just don't like the placement of it being in its own row like that

#

it feels like an afterthought

iron epoch
#

that if the patches still work..

cedar olive
#

place it along side here

pure temple
#

but the volume also applies

#

so it does not make sense

cedar olive
#

what do you mean by that?

pure temple
#

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

cedar olive
#

along side the toggle then

pure temple
#

yeah i was gonna try that

#

maybe just have the same icon as on the notifications tab

humble tulip
#

I would still relate the volume slider to the preview if it were near the sound name

cedar olive
#

also I think you should use this kind of slider

#

to be consistent with the rest of Discord

pure temple
#

plugins are more nerdy therefore need more labels

pure temple
cedar olive
pure temple
#

fair i guess volume sliders don't normally look like that

cedar olive
#

(that slider is ugly too)

pure temple
#

i swear i copied it from another plugin

#

well kind of

cedar olive
#

oh dang

pure temple
#

wait

cedar olive
#

patch matching the wrong identifier

pure temple
#

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

cedar olive
pure temple
#

but maybe the slider should just be merged into customsounds?

cedar olive
#

nahh it's fine

pure temple
#

lol actually i copied the slider from here

cedar olive
#

the purposes are a bit different

pure temple
#

vencord has so many different volume sliders none of which are the same

cedar olive
#

561779 seems to be the slider

pure temple
#

huh

#

isn't it just the same as any other slider just with the marks off

cedar olive
#

for you to webpack find

#

not sure

#

I dont think so

#

okay maybe

#

I didnt realize lol

pure temple
#

i mean it functions the same lol

#

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

cedar olive
#

maybe max-width

pure temple
#

i guess an ideal width would be 300

cedar olive
#

but yeah

pure temple
#

i mean a multiple of 100

cedar olive
#

but then it being on its own row feels weird

pure temple
#

i don't think so

cedar olive
#

is it not gonna have huge empty space in the right

pure temple
#

should i just add another button that does nothing

cedar olive
#

😭

#

does preview get affected with volume

pure temple
#

yes

cedar olive
#

then place it next to the slider

pure temple
#

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

cedar olive