#🧩-plugin-development

1 messages · Page 56 of 1

vast karma
#

More powerful

#

Usually not necessary

#

Often seems to be used just for convenience by naming the matches

cedar olive
#

as Kyuu said it's most used to name the matches, but in some cases it's used to do additional stuff with the match instead of just a simple replace

stable trellis
#

uh next question, how would i get a list of unread mentions? is there smth to get them from the inbox?

stiff dragon
#

uuuuhhhhhh

#

im starting to think this does not check if the emoji is actually animated or not

dull magnet
#

put breakpoints on every line and see what's wrong

#

:p

#

but detection works fine for me from my experience

stiff dragon
#

hmmm

#

how does it calculate how many normal emojis there are

#

if it only does the count for if it isAnimated

dull magnet
#

wdym

#

it checks for both types

dull magnet
#

it counts how many emotes in the current server are the same isAnimation boolean as the emote you're cloning

#

so if you're cloning an animated emote it counts the animated emotes, if you're cloning a static emote it counts the static emotes

stiff dragon
dull magnet
stiff dragon
#

maybe its just my server thats having this bug then

stiff dragon
#

static emotes (there should be 10 slots available)

#

animated slots (correct)

#

wait

#

it has came to my attention

#

i still have no idea why the counter is doing that

#

i was gonna assume it was because of having 10 linked twitch emojis

#

and that was counting towards something

stable trellis
# stable trellis uh next question, how would i get a list of unread mentions? is there smth to ge...

unrelated i have a different idea for how i want to go about this now
how would i have something trigger (similar to preSendMessage?) when you get mentioned? im trying to make a list of message ids with mentions for this #🧩-plugin-development message so i can only highlight the ones in the list and remove the item when you reply to it, im not certain about the best way to do that but that was one of my thoughts

dull magnet
#

if u can't figure it out invite me to ur server and ill check :p

stiff dragon
dull magnet
dull magnet
stiff dragon
#

i dont know why half the emotes there are pepe when most of them look like hanaLoveHanaHoldinghanaNotedhana_YesHanaGibhanaAYAYAhanaAngyhanaAwwhanaBAKAhanaBaldhanaBanhanaBite

dull magnet
#

cause twitch users love pepe ig

stiff dragon
#

also i was right it was because of the twitch emojis

#

because now that i have it toggled off

stable trellis
dull magnet
#

yeah there you go

#

how do twitch emotes even work?

#

are these like emotes of your twitch channel?

stiff dragon
#

if you're subscribed to the person and they have this setting turned on then the person who is subscribed will be able to use these from the server (and they work without nitro)

dull magnet
dull magnet
#

anyway i assume twitch emotes have a special property? like emote.managed perhaps

stable trellis
dull magnet
dull magnet
stable trellis
#

yea

dull magnet
#

you'd still do that the same way, patch the code that does the background and add your own logic for determining whether a message is relevant

stable trellis
#

alr, thank you (this is my first time trying to make a plugin lol)

stable trellis
#

(sorry if this is obvious stuff 😭)

dull magnet
#

probably! idk

iron epoch
#

wh- lol

stiff dragon
iron epoch
#

never said don't touch tho trolley

stable trellis
frosty otter
balmy sky
#

I may be stupid but is there a way to make a command just call a function instead of having to send a message?

dull magnet
#

yes

#

set it to BUILT_IN instead of BUILT_IN_TEXT

#

then you have to handle replying yourself

dull magnet
#

have u looked at it with react devtools to see what's passed?

#

or just the source code

iron epoch
#

I am still not sure how to get components

ik what i am trying to get but how to get it idk

I tried to use findComponentByCode but didn't work

here small snippet of what i am trying to get

V=r.memo(function(e){let{isActive:t,className:n,viewType:r,autoFocus:s=!1,"aria-controls":o,...l}...})

its the navButton.

I want to know what I am doing wrong and how to use it properly

signal goblet
#

@vast karma replytimestamps patch seems to be broken as a heads up

#

now im confused it says invisible chats button is matched to nothing as well

vast karma
signal goblet
#
find: ",renderSingleLineMessage:function(){return ",
#

that seems to work just removing the first {

vast karma
#

Oh, makes sense

#

I used a slightly more liberal find for the PR'd version, which still works

signal goblet
#

I was going through my reporter and like 20 things errored lol

#

there was a pr 1?

signal goblet
#

thanks

vast karma
#

Anyway I fixed the userplugin one

signal goblet
#

thanks

vast karma
#

Thanks for reporting

signal goblet
#

im switching 2 pr rn

#

yup np

#

(also settingscog is broken but i forgot that got merged to better settings)

vast karma
#

Yeah I removed that one from my repo since it's upstream now

signal goblet
#

yup

signal goblet
#

already fixed most of them

#

aka the channeltextareabuttons use addchatbarbutton now

flint bronze
signal goblet
flint bronze
#

Yop

cedar olive
#

you fixed it yourself?

signal goblet
cedar olive
#

wdym you fixed the reporter

#

it's fixed already by us

signal goblet
#

I meant the patches

cedar olive
#

oh

#

and why are there false reports?

signal goblet
#

3ish of them were from modals not being opened

cedar olive
#

then it's not working properly

signal goblet
#

Noted

cedar olive
#

the reporter force loads everything

signal goblet
#

Wouldn't know all I did was open the modal and it loaded fine on canary and stable

#

So

#

Looks like mutualgroupdms and uservoiceshow were the mad ones

dull magnet
#

wdym fixed

#

did stuff break again

cedar olive
#

no

signal goblet
#

Wouldn't know

cedar olive
#

I'm as much confused as you

signal goblet
#

I'll check canary again brb

dull magnet
#

oh this is his own mod with bunch of third party plugins

#

that makes more sense lol

#

btw i will look at ur webpack changes on sunday nookies

#

im on vacation right now

signal goblet
#

its mad on canary for mutualgroupdms

#

2 of .Messages.USER_PROFILE_MODAL exists

#

same with uservoiceshow

flint bronze
#

testing please ignore this

#

🎉

#

testing please ignore this

#

I have committed multiple crimes against the MessageTags plugin

cedar olive
#

If you want to look and merge my resurrect home pr first it's probably better

#

way more simple changes than the webpack

dull magnet
#

well also sunday lol

#

if you think it's good to go just merge

cedar olive
#

but also needs your reviewing cuz it adds support for find array

dull magnet
#

oh i see

cedar olive
#

I think it's good but eh I can wait till sunday

#

for the first time I actually needed finds to be an array, cuz a single wasn't enough

#

and I'm sure it isn't enough

dull magnet
#

but i can't test it

#

sunday too unless u wanna test & merge

cedar olive
#

yeye

signal goblet
#

hey is there anyway to well skip or replace the a for a.jsx for user_profile_modal?

dull magnet
#

what the hell is 69386d_5

cedar olive
#

it's just an experiment location tracker

#

don't worry about it

dull magnet
#

hmmm

#

is that really the only way to find it lmao

#

it seems unstable but ig the entire experiment is unstable

cedar olive
#

yes because home is deprecated

dull magnet
signal goblet
# dull magnet ?

.default.Messages.USER_PROFILE_MODAL,children:[(0,a.jsx) is the only way I've gotten it to match. it can be trimmed to .USER_PROFILE_MODAL,children:[(0,a.jsx)

cedar olive
#

so it they remove those experiments they are removing home too probably

flint bronze
signal goblet
dull magnet
signal goblet
#

\i\ yells it me for not being a string

cedar olive
#

for real

dull magnet
#

you definitely don't need a find that complex

#

why add find array?

#

maybe regex instead makes more sense

#

as long as u keep the regex simple it shouldn't matter that much

#

but also ig adding regex will encourage "lazy" find values

cedar olive
#

also I have no idea how to fix the problem with checked text area and changing the inner state of it (the thing that you removed to fix cloud sync)

dull magnet
#

oh

signal goblet
#

sad

cedar olive
#

that modules is like a short version of another module

cedar olive
#

anything I try as find will match the wrong

signal goblet
cedar olive
#

oh wait you are talking to him or me about find array?

signal goblet
#

I thought they were talking 2 you

#

how does a find array even work?

dull magnet
#

not your find

signal goblet
#

I know its 2 complex

#

but it finds 2 with .USER_PROFILE_MODAL,children:[(0,a.jsx

#

because of jsxs

cedar olive
#

send the module you are trying to match

signal goblet
#

the file num or the entire thing

#

also I may have gotten it

cedar olive
#

the entire module code

#

not the whole file

signal goblet
#
section: O.AnalyticsSections.PROFILE_MODAL,
                        children: (0,
                        a.jsxs)(r.ModalRoot, {
                            transitionState: V,
                            className: D.root,
                            hideShadow: !0,
                            "aria-label": g.default.Messages.USER_PROFILE_MODAL,
                            children: [(0,
                            a.jsx)("div", {
                                ref: el,
                                children: (0,
                                a.jsxs)(C.default, {
                                    user: Y,
                                    profileType: R.UserProfileTypes.MODAL,
                                    children: [(0,
                                    a.jsx)(P.default, {
                                        className: D.topSection,
                                        displayProfile: z,
                                        user: Y,
                                        friendToken: b,
                                        onClose: H,
                                        isStreaming: (0,
                                        d.default)(Q),
                                        guildId: _,
                                        channelId: h,
                                        hasProfileEffect: null != eo
                                    }), (0,
#

im matching in there

#

.AnalyticsSections.PROFILE_MODAL,children

#

thats for uservoiceshow rn

cedar olive
#

and that find doesn't work?

signal goblet
#

the find before

#

testing that find rn

#

that patch works

#

got the mutual groups working

cedar olive
#

why are you changing the finds

#

if only the match is broken

signal goblet
#

basically the matches were fine the problem was the find was receiving 2 or more which in turn failed the patch

#

userVoiceShow: .AnalyticsSections.PROFILE_MODAL,children
mutualGroupDMs: .tabBarContainer
these could be made better probably

signal goblet
limpid tusk
#

Without searching the literal or the file name which could change, how could I possibly find this function?
The file names aren't present anywhere else so i can't reference the filename from somewhere else. Seems impossible without using the filenames

cedar olive
#

hmm the only way is finding the number of it by matching the module that uses it

#

it's hard but doable

iron epoch
#
                {
                    match: /\((\i),\{id:(\i)\.\i,"aria-controls":\i\.\i,"aria-selected":(\i)===\i\.ExpressionPickerViewType.\i,isActive:(\i)===\i\.ExpressionPickerViewType\.\i,viewType:(\i).ExpressionPickerViewType\.\i,children:"\i"\}\)/,//\]
                    replace: "$&,$self.testButton($1, $2, $5)"
                }
    testButton: (V: TabButtonComponent, U, ei: string, y) => {

is there a better of doing this?

I am passing the component instead of actually getting it using webpack

cedar olive
#

well firstly you are matching way too many things manually

#

others you can find using webpack searching instead

iron epoch
iron epoch
#

can you teach me how to properly use it?

cedar olive
#

also don't start a match with a \i

iron epoch
#

I am was just getting the component

cedar olive
#

start with something constant

limpid tusk
cedar olive
#

let me explain to you

#

in another module it does something like

var r = e("747474")

iron epoch
cedar olive
#

r is the link that is being exported and you want

#

you need add a listener or patch that finds that module, matches the number inside the e() and puts in a variable you can access in your plugin

#

then just require it with the number

limpid tusk
#

Ya I understand you could grab the number from another module. I was just saying once you have that number i thought it wouldn't be possible to use find for it

iron epoch
#

or findModuleId("closeExpressionPicker:") search the module id by code and use wreq to get it with the id

#

did I say something useful? @cedar olive

cedar olive
limpid tusk
#

Ohhhhh

#

You're so right

iron epoch
#

aw

limpid tusk
#

that's exactly what I needed

dull magnet
#

the filename is the hash of the file. they won't change unless discord changes the file. but even then, the file won't be deleted because outdated clients will still use it

limpid tusk
#

And the plugin wouldn't need to be updated, even if it's fairly simple to do so

iron epoch
flint bronze
#

just testing modified version of messagetags i am making

flint bronze
#

messagetags if it was epic

iron epoch
flint bronze
#

shit code

#

thats how

iron epoch
#

something I can relate with in this server lol

flint bronze
#

well it works

#

i put the tags into the attachment menu

cedar olive
#

lmao message tags can be completely replaced by text replace

#

i just thought of that now

gloomy terrace
#

Tags are simply easier to remember thanks to the /tags list command imho

#

Meanwhile for textreplace you either to remember all your rules or you're going to check the plugin settings many times

signal goblet
rigid marlin
#

i wanna make a button that goes to the settings page for the plugin, but i'm not sure how to force discord to navigate to settings > plugins > plugin_name. does anyone know any plugins that have that option / know how? nvm there's examples of it in Vencord.ts but i gotta find out how to make custom sections

ionic breach
ionic breach
balmy sky
#

Or do you just want to open the plugin config modal

rigid marlin
signal goblet
#

@north flame encryptcords patch seems died

north flame
#

Huh

signal goblet
#

I cropped 2 much but my reporter was mad

north flame
#

Probably, I’ll have to make the rates better later

signal goblet
#
{
            find: "executeMessageComponentInteraction:",
            replacement: {
                match: /\i\.HTTP\.post\({url:\i\.Endpoints\.INTERACTIONS,body:\i,timeout:/,
                replace: "await $self.joinGroup(C);$&"
            }
        }
#

thats what I have it set for now

north flame
#

Pretty shit rn (easily outdated)

signal goblet
#

(im not good at reading them lmao)

north flame
#

Idk

#

Can’t remember

signal goblet
#

if so it works

vast karma
#

That patch doesn't look correct, with that await await

north flame
#

I think it’s actually unused and I forgot to remove it

signal goblet
#

its used for joingroup

#

ye its only used there

signal goblet
#

add an await at the start?

vast karma
#

Easiest would be adding the await to the regex, yeah

#

So it's inserted before the await

signal goblet
#

so
match: /await \i\.HTTP\.post\({url:\i\.Endpoints\.INTERACTIONS,body:\i,timeout:/,

#

??

#
{
            find: "executeMessageComponentInteraction:",
            replacement: {
                match: /await \i\.HTTP\.post\({url:\i\.Endpoints\.INTERACTIONS,body:\i,timeout:/,
                replace: "await $self.joinGroup(C);$&"
            }
        }
north flame
#

Ohhh

#

I remember

#

I’m pretty sure it was used so that the join message could have custom buttons

#

But idk who it would be joinGroup, it should be for like “I don’t want to talk to you”

#

Yeah, that’s what it’s for

stable trellis
#

epicsauce

frosty otter
#

looks weird

vast karma
#

Aside from the transparency it should look pretty normal

frosty otter
vast karma
#

Even if you insert something?

frosty otter
#

on my phone rn so I can't test

#

I'll do it later

frosty otter
jagged briar
#

well if you use dummy data it wont work

#

it has to actually find a module

balmy sky
#

Hey, is there a way i can put line breaks in the details field of a custom rpc? doing \n doesn't seem to work

flint bronze
flint bronze
#

Highly doubt it tbh

balmy sky
#

Mb, by custom rpc i meant manually despatching it from a plugin (the way customrpc does it but not the customrpc plugin)

flint bronze
#

oh

balmy sky
#

Probably should have specified

flint bronze
#

Oh

#

Show me what you've got?

#

I am curious to see your code

balmy sky
#

It's so shitty 💀

balmy sky
#

Why what

flint bronze
#

Why do you need a message counter

#

BTW

#

I would like to bring up something

balmy sky
#

Not like i'm doing anything else with my rpc since i have game activity disabled

balmy sky
flint bronze
#

fuck

#

i can't find what i was going to reference

#

but

#

counting messages sent will NOT sync

#

i hope you are aware of this

balmy sky
#

If i restart they persist

flint bronze
#

I said sync not persist

balmy sky
#
  • they don't need to stick long term since they reset daily
flint bronze
#

actually vencloud is very jank for simultaneous multi-client use and needs a massive rewrite for that xd

#

i will not be the one to fix it

flint bronze
#

This happens when I set the applicationId of a "built in" command

#

actually idk if it's that or the id (command id) itself

#

love discord Pain

flint bronze
#

Would anyone want a Message Tags page in the expression picker

flint bronze
#

is this a good patch?

#

i'm gonna need to fix it further husk

vast karma
#

I'm not so sure about .{0,2000}*?\], seems quite fragile

flint bronze
#

I just realised I need to capture some stuff from inside there

#

particularly that ei===

vast karma
#

Do you really need to edit the whole list, or is it enough to insert stuff after some other specific child?

flint bronze
#

I do not, however I would like to achieve something somewhat like ContextMenuAPI

#

Also plugins will probably want to append to the end of that list

#

so i'd need to capture that junk anyway probably

vast karma
#

I wonder why the Sounds one is not localized

flint bronze
#

What the fuck have I done

vast karma
#

Wonderful

flint bronze
#

So you know how you said my 2000 char match was fragile?

#

You were right

#

2000 chars was matched the next ]

#

better

vast karma
#

Oh, you didn't even make it nongreedy?

flint bronze
#

Someone knows a lot more about regex than I do

#

blehhhhh this has better performance

#

i think

#

nah its fine anyway

dull magnet
#

if you make them nongreedy (by appending ?) they will match as little as possible

flint bronze
#

I figured that out

vast karma
#

I think you an even make ? nongreedy, though it's not common

flint bronze
#

i will start making everything non-greedy

#

inb4 "that has a lot of impact on performance"

dull magnet
flint bronze
#

well

#

now i have a hook into the expression picker tabs

#

Now what

flint bronze
full sapphire
#

i made an uwu pwugin to uwu-fy aww my messagesuwu~

#

its vewy uwu~

vast karma
#

Does textreplace not do it well enough?

full sapphire
vast karma
#

Some needs to make a plugin to un-uwuify things

signal goblet
#

Now should I wait or break more stuff

cedar olive
#

huh?

full sapphire
#

dont u dawe uwu

#

i made it mowe uwu uwu

#

shee if u can shpot fe diffewence owo

balmy sky
#

H-how dawe y-you un uwuify things, the uwu cult wiww not awwow y-you (* >ω<)

clear parcel
flint bronze
#

quests husk

balmy sky
#

Is it possible to have my game activity disabled for everything but one game/custom rpc? i don't want my game activity activity enabled, but id like to have my message stats plugin displaying

cedar olive
#

check ignore activities settings

vapid latch
iron epoch
#
function PopupText(props: { event: any, children: string; }) { // https://paste.pythondiscord.com/B2XQ
    const [opacity, setOpacity] = useState(1);
    const { event } = props;

    useEffect(() => {
        const fadeOut = setInterval(() => {
            setOpacity(prevOpacity => {
                if (prevOpacity <= 0) {
                    clearInterval(fadeOut);
                    // Perform any cleanup here, such as removing the component
                    return 0;
                }
                return prevOpacity - 0.1;
            });
        }, 100);

        // Cleanup function to clear the interval when the component unmounts
        return () => clearInterval(fadeOut);
    }, []); // Empty dependency array means this effect runs once on mount

    return (
        <Text
            onClick={(event: any) => event.preventDefault()} // so when the text is pressed it doesn't close popups
            style={{ opacity: opacity, position: "absolute", left: event.clientX + "px", top: event.clientY + "px" }}
            className="text-popup"
        >
            {props.children}
        </Text>
    );
}

is there a way to make every text spawns, fade away and gets deleted after fading away?
I have no idea what i am doing in react

#

I thought of getting the element by id and doing some fade out animation but what if two texts spawned? what would happen?

iron epoch
#

wanted to put small feature but... (work in prograss)

vast karma
iron epoch
vast karma
#

It does animations

#

Easier and more efficiently than setInterval

iron epoch
#

if that so, cya after 2 hours. going to see how this thing work

#

and thanks

vast karma
#

Maybe useSpring rather than useTransition, I don't know the apis particularly well

balmy sky
#

Can i attach an image in a command response?

vast karma
#

Doesn't patpat do that?

balmy sky
#

Not really, it just uses UploadHandler.promptToUpload

#

So i guess the only way would be to use the BUILT_IN command type and manually input all the text then send

vast ferry
#

sorry if this should be obvious :] im trying to find where the dm channels get updated when a new message comes in; it seems like theres a check that doesnt update the channel list if the order hasnt changed and i need to overwrite that. ive been looking and poking around and just cant figure out where exactly its happening. if anyone has help to spare itd be much appreciated venniecozycat

jaunty agate
#

i need plugin ideas

dull magnet
#

anyway it's most likely via a useStateFromStores call

#

which is a hook that takes an array of stores and subscribes to them

#

so for example it subscribes to DMStore and MessageStore

vast ferry
dull magnet
#

this is for PinDms collapse feature?

vast ferry
#

yes

full sapphire
#

hey, anyone know how to send a GET request to a user profile?

jaunty agate
#

thankies!

stone crag
#

can someone send the discord patching guide (it was a github markdown file and i think it was called "reversing discord guide" or something

#

i can't find it anymore

#

i think vee made it

iron epoch
stone crag
#

not that one

#

it was different

#

it mentioned like

#

module numbers

#

like 517100

#

oh wait

#

it was that

#

ty

vast ferry
# vast ferry for un-hiding unread channels. if the channel would be at the top of the channel...

im feeling like thered be a better way, but is this an appropriate fix?

flux: {
    CONNECTION_OPEN: init,
    MESSAGE_CREATE: ({ channelId, optimistic }: { channelId: string, optimistic: boolean; }) => {
        if (optimistic) return;

        const channel = ChannelStore.getBasicChannel(channelId);
        const selectedChannel = ChannelStore.getBasicChannel(SelectedChannelStore.getChannelId());

        if (channel.guild_id || selectedChannel.guild_id || channel === selectedChannel) return;

        forceUpdate();
    }
},```
dull magnet
#

absolutely not no

vast ferry
#

got it venniecozycat

scenic stirrup
#

is there a way to get userid from the logged in user in the renderer process

#

i could use that to fix a pretty wacky bug with vesktop streams

dull magnet
#

what's the bug

#

UserStore.getCurrentUser()

scenic stirrup
# dull magnet what's the bug

you cant start a stream if you're watching another stream because the go live button checks if there's more than one stream
because there is it tries to run some code that modifies a current stream
which of course fails miserably

#

all i have to do is change the if statement to check if any of the current streams have the current userid as their streamUserId

dull magnet
#

are you saying its a bug in our code

scenic stirrup
#

yeah but i think i have an idea of how to fix it
i was just asking here because plugin people probably know more about userid stuff lol

full sapphire
clear parcel
#

why

dull magnet
#

UserUtils.getUser from webpack commons

#

but still seems xyproblemy

full sapphire
flint bronze
#

Do not use ApplicationCommandInputType.BUILT_IN_TEXT

#

Reason: it sends the raw command

dull magnet
flint bronze
#

huh

dull magnet
#

BUILT_IN_**TEXT** is for commands that send text

flint bronze
#

Oh

dull magnet
#

like /echo

flint bronze
dull magnet
#

if u dont return any content, it takes the current content

#

if u want to manually handle sending stuff, use BUILT_IN instead

flint bronze
#

what if I return {content: ""}

dull magnet
#

it will error probably

flint bronze
#

trolley lets try it

#

/ignore-this

#

./ignore-this

dull magnet
#

#🤖-bot-commands

flint bronze
# dull magnet <#1024286218801926184>

i'm actually intentionally testing @worldly oxide
it parses invalid commands and sends a "i don't have permission to send messages" error husk
...you can easily see how I accidentally stumbled upon this
i will not continue the testing as i have confirmed that
i will test my actual messagetags stuff in #🤖-bot-commands now

#

you will husk

#

hm

#

i wonder

dull magnet
#

./

#

./beans

#

ah

flint bronze
#

yes

#

horror

flint bronze
#

ong

#

i got

#

contributor

#

real1!1!!!

scenic stirrup
#

okay one of you nerds should be able to answer this

#

my gf sent me this and if you paste it apparently discord crashes

#

why the hell does it do anything other than just

scenic stirrup
#

paste as plaintext

dull magnet
#

it makes discord use 100% cpu

scenic stirrup
#

what the hell

#

should we add our own patch for that

dull magnet
#

i assume it confuses discord parser cause it's trying to both parse as url and channel mention, which makes it get stuck in an infinite loop

#

so bug in discord's parser

#

but this is just my somewhat educated guess :p

dull magnet
flint bronze
#

i have a question

#

what happens if it is sent in a channel

scenic stirrup
scenic stirrup
#

just cant type it

#

apparently

flint bronze
#

ok then

#

send it

scenic stirrup
#

i assumed it was an issue where it tried to embed

chrome elbow
#

disable preview markdown as you type

noble rose
#

it's over i'm writing an essay on what it does'

#

time to fixy fixy

noble rose
#

I love Windows

flint bronze
# noble rose I love Windows

I think you should be more concerned about using an account named "Admin" and the path of your projects folder

balmy sky
#

Yeah what type of psychopath puts their projects in documents

#

Actually

#

What type of psychopath puts ANYTHING in documents

balmy sky
#

Get away from me rn bruhcat

#

Horror

noble rose
#

i code on linux in all honesty...

#

Vendicated proposed changes and idk if i was supposed to use the "commit changes" button so i did them and made one commit instead 🤷‍♂️

vast karma
#

I put most of mine in ~/stuff

noble rose
#

(there are github projects and non-github projects, makes stuff easier to find)

gusty maple
#

But it's gonna make one commit per proposed change

noble rose
#

Yeah I was told by a friend that 1 commit is better in some situations

#

Anyways now constants.ts is conflicting again :<, gotta fix

#

Wait hold on a minute i can edit files IN GITHUB? Shocked.

balmy sky
noble rose
full sapphire
jaunty agate
#

m thinkin of making aplugin that prevents discord from automatically setting your status to Idle when u re afk, does such plugin exist already?

flint bronze
#

afaik

dull depot
#

what would be the best way to change the keyboard shortcuts used for navigating channels? (the ones that are alt+up etc. by default)

dull magnet
#

change to do what

balmy sky
#

I assume they mean rebind them (?)

vapid latch
dull magnet
#

"Adds a download button to voice messages"

dull depot
frosty otter
dull magnet
#

~/Coding

frosty otter
#

~/Documents/Coding

#

idk why I use Documents as my user folder 😭

dull magnet
#

i have never used any of the dedicated stuff folders like documents, pictures, videos

#

don't like em

worldly adder
#

you have the same issue of "saving a jpg instead of the gif" if you go through the original 'save as' option as well

#

might be better to just patch the whole damn thing to add a property with the proxy url and original url

worldly adder
#

XP era

worldly adder
dull magnet
#

wdym?

#

i don't understand that question

worldly adder
#

so you said this a couple weeks ago
i saw those changes in main, but i wasn't sure if you intended to do more with them
since the NativeSettings object doesn't have the same type signature and it doesn't seem to auto-populate with plugin-specific settings objects
it's fine if i just need to add my plugin to it directly, but i wanted to make sure that's the correct procedure

dull magnet
#

ah i see

#

yes the native settings don't handle defaults currently but it's easy to add

#

perhaps you would like to implement it analogously to renderer?

worldly adder
#

hm, so those defaults are just set with definePluginSettings when the plugin definition is read? i'm not sure how it gets the list of plugins to read in.

either way it looks like that happens in the renderer so i'd need to add IPC events for that too, which doesn't seem right since it exposes the same attack vector
i can just do it properly in the plugin's native module i guess

dull magnet
#

nono

worldly adder
#

😵‍💫 i don't really understand how it gets populated in the first place

#

oh, i found it i think

#

yes, I can do this

dull magnet
#

well you wouldnt need to do any of that stuff

#
const DefaultSettings = {
  ...
}

const settings = loadSettings();
mergeDefaults(settings, DefaultSettings);
export const settings = new SettingsStore(settings);
worldly adder
stiff dragon
#

so u know how when you hold down shift it quick deletes a message?

#

would i use a patch for that or an api request to make it happen on all occasions

cedar olive
#

patch

scenic stirrup
#

hi nerds im learning how to vencord plugins

#

:)

vast karma
#

I also like to nouns

scenic stirrup
#

real

scenic stirrup
#

:) hold this

#

i cant find like

#

any good info

#

so

#

how exactly does the start and stop functions of a plugin work

#

do they just run when the plugin is loaded or something?

viral roost
#

yeah

dull magnet
#

what are u trying to do

#

volumebooster for web isn't that simple

vast karma
#

They run on startup, or when the plugin is toggled on or off

dull magnet
scenic stirrup
stone mirage
#

any ideas how we can get AudioNodes for clients in vc?

#

or at least how to get clients in vc

scenic stirrup
#

i already have the audiocontext and audiodestinationnode

stone mirage
#

is there any your git repo or branch for it?

scenic stirrup
#

not yet

#

im only gonna work on it on my laptop so i wont push it until its ready probably

stone mirage
#

ohh okay

scenic stirrup
#

this seems

#

way easier than i thought it would be but

#

im not sure

stone mirage
#

maybe will be good idea to include this volume booster plugin as default work of Vesktop?

scenic stirrup
#

ohoohohohohoho

#

im getting somewhere

#

userid of each speaking user is here

#

hm

#

by default

#

discord has one audiocontext

#

not one per user

#

phuck

#

hmm

#

i have to find out where it gets the audio stream from and patch it before its handed into the audiocontext

scenic stirrup
#

i wonder if i can use the ssrc

#

nvm nope

#

hmm

#

curious

#

there's only ever one mediastreamtrack for audio

#

but yet it can still change individual user volume?

ripe smelt
#

For a plugin, when enabled, I want to create a new tab under a currently existing section in settings. For example, under "Vencord", add a new tab under "Cloud". How could I implement that? I've only been able to get it to where I can create a separate section or a lone tab, but I haven't been able to figure out how to implement a new tab button under a currently existing section.

vast karma
#

There is a customSections in the _settings plugin, but it doesn't seem to be used anywhere, including startupTimings which adds a section more directly

stone mirage
#

@scenic stirrup did you see "localVolumes" property of conn? Looks like it stores settings per userId with double value of volume from 0 to 200

scenic stirrup
#

yeah

stone mirage
#

we can use it and maybe we need to change volume here when user in plugin changes volume

scenic stirrup
#

yeah but i want to figure out how volume is actually done

#

because the plugin used to be able to go up to 1000%

#

so i want to recreate that

north flame
#

Hmm, something seems off

#

I can’t quite put my finger on it

cinder basin
#

i o s

#

no wonder it feels off

proud parrotBOT
ripe smelt
#

so I'm not exactly sure what I'm supposed to be putting for find in this case

ripe smelt
proud parrotBOT
# ripe smelt How am I supposed to do it for the main Vencord sections since push wouldn't be ...

**settings.tsx: **Lines 68-124

customSections: [] as ((SectionTypes: Record<string, unknown>) => any)[],

makeSettingsCategories(SectionTypes: Record<string, unknown>) {
    return [
        {
            section: SectionTypes.HEADER,
            label: "Vencord",
            className: "vc-settings-header"
        },
        {
            section: "VencordSettings",
            label: "Vencord",
            element: require("@components/VencordSettings/VencordTab").default,
            className: "vc-settings"
        },
        {
            section: "VencordPlugins",
            label: "Plugins",
            element: require("@components/VencordSettings/PluginsTab").default,
            className: "vc-plugins"
        },
        {
            section: "VencordThemes",
            label: "Themes",
            element: require("@components/VencordSettings/ThemesTab").default,
            className: "vc-themes"
        },
        !IS_UPDATER_DISABLED && {
            section: "VencordUpdater",
            label: "Updater",
            element: require("@components/VencordSettings/UpdaterTab").default,
            className: "vc-updater"
        },
        {
            section: "VencordCloud",
            label: "Cloud",
            element: require("@components/VencordSettings/CloudTab").default,
            className: "vc-cloud"
        },
        {
            section: "VencordSettingsSync",
            label: "Backup & Restore",
            element: require("@components/VencordSettings/BackupAndRestoreTab").default,
            className: "vc-backup-restore"
        },
        IS_DEV && {
            section: "VencordPatchHelper",
            label: "Patch Helper",
            element: require("@components/VencordSettings/PatchHelperTab").default,
            className: "vc-patch-helper"
        },
        ...this.customSections.map(func => func(SectionTypes)),
        {
            section: SectionTypes.DIVIDER
        }
    ].filter(Boolean);
},
dull magnet
#

?

pine mountain
#

How would I access React.createContext earlier than the start function for the plugin? I have a React component that depends on a discord component which I have wrapped in a context provider so I can pass state a lot more easily, but the context isn't created early enough and crashes the client because it doesn't exist when the discord component is being created. My code is a bit jank, as well, and could probably do with some of it being turned into a source patch, but it's a rather complex thing to patch with a regex patch.

#

Some code for context: ```tsx
patches: [
{
find: ""ChannelTextAreaBars"",
replacement: {
match: /"ChannelTextAreaBars"}),(\i)=[];/g,
replace: ""ChannelTextAreaBars"}),$1=[];$self.addBars($1);",
},
},
],

async start() {
TranslationContext = createContext({ original: "", translation: "" });
let textArea = findComponentByCode(",renderAttachButton:eb,renderAppLauncherButton:eG,renderApplicationCommandIcon:ew");
let render_original = textArea.type.render;
textArea.type.render = function (e: any) {
let [state, setState] = useState({ original: e.textValue, translation: "" });
if (e.textValue != state.original) {
setState({
original: e.textValue,
translation: translation.process(e.textValue)[1],
});
}
return <TranslationContext.Provider value={state}>
{render_original(...arguments)}
</TranslationContext.Provider>;
};
},

addBars(bars: any[]) {
if (!TranslationContext) {
return;
}
let state = useContext(TranslationContext);
if (state.original == state.translation) {
return;
}
bars.push(
<Flex style={{ padding: "0.45rem 1rem", lineHeight: "16px", color: "white", gap: "1rem", alignItems: "center" }}>
<span>{state.translation}</span>
</Flex>
);
}

dull magnet
#
// on top level
const getContext = makeLazy(() => createContext({ ... }));

useContext(getContext());
pine mountain
#

Thank you, that does seem a lot better.

#

My only other problem now is that I think my function hook is also made a bit late.

dull magnet
#

use a proper patch

pine mountain
#

that patch sounds like a pita, tbh

ripe smelt
#

thank you

pine mountain
# dull magnet thats why u dont use monkey patch

thanks for the help ```js
function filterForChatTextArea(m: any) {
if (typeof m != "object" || typeof m.type?.render != "function") {
return false;
}

let search = /,renderAttachButton:\w{2},renderAppLauncherButton:\w{2},renderApplicationCommandIcon:\w{2}/g;
return search.test(Function.prototype.toString.call(m.type.render));

}
waitFor(filterForChatTextArea, (m) => {
let TranslationContext = getContext();
let render_original = m.type.render;
m.type.render = function (e: any) {
let [state, setState] = useState({ original: e.textValue, translation: "" });
if (e.textValue != state.original) {
setState({
original: e.textValue,
translation: translation.process(e.textValue)[1],
});
}
return <TranslationContext.Provider value={state}>
{render_original(...arguments)}
</TranslationContext.Provider>;
};
});

scenic stirrup
#

:)

#

will do that tomorrow

worldly adder
#

is it a terrible idea to make a patch that inserts an import and calls it...

#

context: trying to make an option that hijacks the download hover button for attachments and redirects it to the configured media downloader plugin instead of opening it in the browser

worldly adder
#

this is because i figured out how to make it appear on images relatively easily, but they just open the image in browser

balmy sky
#

Just make a function in the plugin and reference said function instead of trying to do whatever you're trying to do from entirely within the patch

worldly adder
#

do you not have to import the function to reference it

balmy sky
#

No

worldly adder
#

oh thats relatively easy then

balmy sky
#

Define it in the plugin definition then $self.whateverYouWant

flint bronze
scenic stirrup
#

i was able to create a gain node on a specific user's audio stream

#

so i think ive got it

worldly adder
amber mantle
#

classic

flint bronze
#

i want to know (for future reasons)

scenic stirrup
#

uhm

flint bronze
#

well

#

fuck

scenic stirrup
#

so

flint bronze
#

i am being very x y

#

uh

#

i want to stop connecting everything to one output

#

and give every user their own output

scenic stirrup
#

interesting

#

why

flint bronze
#

i want to do virtual surround sound or hook specific people up to certain speakers

#

if i have more then ~4 people in vc

#

and they are all yapping

#

it is very hard to focus on someone

vale spear
#

@dull magnet, i'm super sorry to bother you again but do you still have plans to review https://github.com/Vendicated/Vencord/pull/2161/ ?
I just remembered that the pr existed because i remembered to update my fork because i wanted to check if there were any vencord updates xd

GitHub

This feature is inspired by https://github.com/Puyodead1/replugged-stafftags
It took me 3 hours to figure out how to do this in Vencord and I'm so glad I did because it looks just so much bette...

north flame
vale spear
vale spear
flint bronze
#

i cant use discord without vencord

kindred kettle
#

hello, i am trying to make a plugin and i made the folder inside userplugins, did pnpm inject and pnpm test but the plugin doesnt start, the json output doesnt mention it and the command i put doesnt work either (i copied it from friend invites to test)
this is the code

import { ApplicationCommandInputType, ApplicationCommandOptionType } from "@api/Commands";
import definePlugin from "@utils/types";

export default definePlugin({
    name: "Auto Join VC",
    description: "This plugin is absolutely epic",
    authors: [
        {
            id: 0n,
            name: "Your Name",
        },
    ],
    patches: [],
    // Delete these two below if you are only using code patches
    start() {
        console.log("asd");
    },
    stop() {},
    commands: [
        {
            name: "create friend invite",
            description: "Generates a friend invite link.",
            inputType: ApplicationCommandInputType.BOT,
            options: [{
                name: "Uses",
                description: "How many uses?",
                choices: [
                    { label: "1", name: "1", value: "1" },
                    { label: "5", name: "5", value: "5" }
                ],
                required: false,
                type: ApplicationCommandOptionType.INTEGER
            }],

            execute: async (_, ctx) => {
            }
        }
    ]
});
dull magnet
#

did you enable it

kindred kettle
#

ye thats the thing i dont know how

#

i asked that in support too

#

where do i enable it?

dull magnet
#

like you enable any other plugins

kindred kettle
#

in the plugin settings? doesn't show up

dull magnet
#

then you didn't do it properly

#

"and pnpm test"

you need to pnpm build

kindred kettle
#

i thought test built too

#

well that fixed it

#

thx

kindred kettle
#

how could i make the current user join a vc?

scenic stirrup
#

hold a gun to their head and tell them to

kindred kettle
#

thats one way i guess

ripe smelt
#

Is there a way for a plugin to download files externally (like from github) after being enabled?

jagged briar
#

yeah

#

just use fetch or something

#

and if you want to save it to the user's system you need a native.ts file

ripe smelt
#

thank you

ripe smelt
#

What am I doing wrong?

import { createWriteStream } from "fs";

export const saveFile = (data: Blob, filename: string) => {
    const filePath = `path/to/save/${filename}`;
    const stream = createWriteStream(filePath);
    const reader = new FileReader();
    reader.onload = function () {
        stream.write(Buffer.from(this.result as ArrayBuffer));
        stream.close();
    };
    reader.readAsArrayBuffer(data);
};

I keep getting this error whenever I try to import from fs or fs/promise here

X [ERROR] Could not resolve "fs"

    src/userplugins/extraPlugins/native.ts:9:29:
      9 │ import { readFileSync } from "fs";
        ╵                              ~~~~

  The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle
  for node? You can use "platform: 'node'" to do that, which will remove this error.

1 error
Build failed
Build failed with 1 error:
src/userplugins/extraPlugins/native.ts:9:29: ERROR: Could not resolve "fs"```
worldly adder
#

works on my machine... what command are you using to build it?

north flame
#

no wait

#

I'm stupid

ripe smelt
steep vapor
#
function getDominantColor(imageUrl: any) {
    if (imageUrl) {
        const ctx = document.createElement("canvas").getContext("2d", { willReadFrequently: true })!;
        const src = imageUrl;
        imageUrl = new Image();
        imageUrl.crossOrigin = "";
        imageUrl.src = src;
        ctx.imageSmoothingEnabled = true;
        ctx.drawImage(imageUrl, 0, 0, 1, 1);
        return ctx.getImageData(0, 0, 1, 1).data.slice(0, 3);
    } else {
        return [0, 0, 0];
    }
}```
im using this method to get the dominant color from the album art, but doesnt always return the dominant color
#
  • it either still returns #000000 or takes long to actually get the color
  • even if it got the color, it changes to #000000 quickly (the spotifycontrols plugin is sending multiple requests?)
dull magnet
steep vapor
ripe smelt
#

I tried reinstalling Vencord from git again and it still didn't work for me

jagged briar
ripe smelt
jagged briar
#

Maybe cause it’s a user plugin

#

Try moving it to normal plugin folder

worldly adder
#

unless theres more context to yours that is missing

balmy sky
#

A theme that procedurally generates using the color of the song you're currently listening to

steep vapor
#

someone was looking for that too

balmy sky
#

ok i just struggled for half an hour

#

I can't even fucking get the album cover data 💀

ripe smelt
wispy night
#

i was wondering if its possible to remove the limit of discord only storing up to -2500 chars in the send message input? if so, how tf would i do that. kinda new to this so im not exactly sure where i should be looking

swift delta
vast karma
#

You can probably remove the client-side max limit, but it won't do you any good

swift delta
#

exactly my point, with the split message plug-in

noble rose
#

After my PR is reviewed and some changes are made, do I need to use the re-request review button or no?

amber mantle
#

you can but it wont do much

#

it is gotten to on their own time

flint bronze
#

basically you can click it and something will happen

steep vapor
ripe smelt
#

I'm stumped with the Native.ts. I keep getting errors regarding node related imports. I'm pretty sure its just a matter of me not being familiar with Native.ts but I cannot figure out what the problem is. Would appreciate any help/guidance.

src/userplugins/extraPlugins/native.ts:8:21: ERROR: Could not resolve "child_process"
src/userplugins/extraPlugins/native.ts:9:20: ERROR: Could not resolve "electron"
src/userplugins/extraPlugins/native.ts:10:15: ERROR: Could not resolve "fs"
src/userplugins/extraPlugins/native.ts:11:30: ERROR: Could not resolve "path"

Native.ts:

/*
 * Vencord, a Discord client mod
 * Copyright (c) 2024 Vendicated and contributors
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

import { exec } from "child_process";
import { app } from "electron";
import fs from "fs";
import { extname, join } from "path";

interface Plugin {
    name: string;
    downloadUrl: string;
    description: string;
    tags: string[];
}

export function installPlugin(plugin: Plugin): void {
    const targetDirectory = join(app.getPath("userData"), "userplugins");

    if (!fs.existsSync(targetDirectory)) {
        fs.mkdirSync(targetDirectory, { recursive: true });
    }

    let command;
    if (plugin.downloadUrl.includes("/blob/")) {
        const rawUrl = plugin.downloadUrl.replace("github.com", "raw.githubusercontent.com").replace("/blob/", "/");
        command = `curl -L "${rawUrl}" -o "${join(targetDirectory, plugin.name + extname(rawUrl))}"`;
    } else {
        command = `git clone "${plugin.downloadUrl}" "${join(targetDirectory, plugin.name)}"`;
    }

    exec(command, error => {
        if (error) {
            console.error(`Error downloading the plugin: ${error.message}`);
            return;
        }
        console.log(`${plugin.name} has been successfully downloaded to ${targetDirectory}`);
    });
}

ExtraPluginsTab.tsx:

dull magnet
#

are you trying to import the file from index

#

that's now how it works

#

look at other plugins using that file for an example

#

you need to access its exports via the VencordNative global

wispy night
swift delta
noble rose
wispy night
#

i mean, yeah its definitely a niche annoyance. but i find it to be very annoying nonetheless

flint bronze
#

there is no 2500 chars limit

wispy night
#

no the limit is 4500

#

or 6500 if you have nitro

#

hence -2500

#

beyond that it wont save

flint bronze
#

stop yapping

#

save?

wispy night
#

switch channels

flint bronze
#

as in, draft saving?

wispy night
#

yes

flint bronze
#

ah

#

I see

#

yeah'

#

4500 limit

#

with nitro

#

AH

#

this is it

#

it is literally just in DraftStore lmfao

flint bronze
#
Error in handlePush TypeError: patch.find.every is not a function
    at patchFactories (patchWebpack.ts:190:42)
    at Array.handlePush (patchWebpack.ts:85:13)
    at shared.eb18f7955c6b0fd48757.js:1:65

What the hell is going on here?

#

update

full sapphire
#

Is there any way to turn off webSecurity?

#

or some other method to send cross-origin requests?

frosty otter
glass oracle
#

the solution is

#

to not send requests disallowed by the csp

jagged briar
glass saffron
#

i'm trying to insert more icons into the top toolbar. i found that vencordtoolbox already does this, i took the patch from there and i don't know how to make my plugin not conflict with vencordtoolbox. is there any way?

proud parrotBOT
glass saffron
#

as I understand it replaces s.Fragment with its own icon, but I don't understand the logic at all, why it replaces exactly that and how to make a more universal patch

frosty otter
#

shouldn't it just work, because the patch uses $self.function ?

vast karma
#

The patches conflict with each other

frosty otter
balmy sky
#

How would i go about checking the users embed permissions in a specific channel id?

worldly adder
#

not sure how in the client code but in the api all that stuff is on the channel object, also note that denied SEND_MESSAGES also implicitly denies EMBED_LINKS

dull magnet
#

in the api all that stuff is on the channel object
nah, its just that your OOP discord library provides those methods :p

worldly adder
balmy sky
#

How can i patch a message components content as a string? i'm probably being stupid but whatever component i look in, the content gets passed as an array of components (usually spans)

vapid latch
#

(i say cluelessly as modifying markdown rules is an entire ordeal without webpack interop)

balmy sky
#

I'm making a version of the message encryption plugin that does it automatically and replaces the original message content

vapid latch
#

find: ".ChatInputTypes.EDIT,content:"
you can probably just directly modify it here and skip a bunch of bullshit

vapid latch
#

idk why toolbox is over-engineering things

flint bronze
#

i have a horrible confession
I drafted up an idea for a plugin for someone in here a few days ago and just forgot about it
@dull magnet thanks for reminding me to open my editor lmao

dull magnet
#

tbh slate is a horrible cursed mess i refuse to do anything with it

flint bronze
#

this is a test
testing

#

i think it works

flint bronze
#

yapping

#

test

#

ah

flint bronze
#

this is fine yes

frosty otter
flint bronze
#

vesktop feature

frosty otter
#

oh

flint bronze
#

it isnt

#

i am loading it from my desktop

#

on my laptop

#

because i need to test with a touch screen

iron epoch
#

how patch helper opens exactly? isn't it by pnpm watch?

stone crag
#

yeah but you can also do pnpm run build --dev if u want

dire sequoia
vapid latch
dull magnet
#

just cursed mess to actually work with

pure temple
frosty otter
#

prob here

flint bronze
#

how about you add plugin to fake move someone's message to another channel

frosty otter
#

but idk

flint bronze
#

does the client even know that stuff

pure temple
#

the client gets sent all commands even those which it doesn't have permission to use

#

so it would need to

#

ohh

#

can see it now snailcat

#

for some reason this thing wasn't showing for a command i'd disabled for everyone on a server i am admin on but i'm not admin in vencord and it shows now .. weird

#

yea thanks applicationcommandstore looks like the place!

#

although you probably need to fire a request if it's not yet loaded

#

fire? idk

#

🔫

flint bronze
#

it has been less than 1 hour since the topic of "explicitly requesting slash command metadata" has been relevant

#

(see that voice channel bot config pr and my idea of use slash commands for it)

pure temple
#

:o

#

i was just trying to work on permissionviewer

flint bronze
#

oh

#

you are adding slash command permissions to permissionviewer?

pure temple
#

yes

#

if i don't give up as always :3

flint bronze
#

i will make a whole plugin then give up (never submit PR to upstream)

pure temple
#

should i add a tab to the guild permissions window

flint bronze
#

you can restrict slash commands per channel

#

dont forget that

pure temple
#

yeah but it doesn't show in channel settings

#

it shows in guild settings

flint bronze
#

i know

pure temple
#

it doesn't really make a lot of sense to display it in the channel menu

#

should i use an ErrorBoundary around the tabs component or for each tab

flint bronze
#

when in doubt, do both'

#

eh

#

just put error boundary around the tab contents and the modal itself

dire sequoia
#

@pure temple if you're around PermissionsViewer, could you review my PR? it's been needing a re-review since last year.

pure temple
#

i don't have write perms

dire sequoia
#

just a review would be nice

#

it refactors some of the rendering logic so that'd affect what you're probably doing

pure temple
#

i'm not that competent with this stuff lol
i just found it weird you were asking me

#

but sure i could give thoughts if any

flint bronze
frosty otter
#

I'm trying to find the navigation id of images in messages

#

but I can't find it

#

nvm

flint bronze
#

what

frosty otter
iron epoch
#
# 1
function playSound(url) {
    var a = new Audio(url);
    a.play();
}

# 2
const audioElement = document.createElement("audio");

audioElement.src = settings.store.quality === "HD"
    ? MOYAI_URL_HD
    : MOYAI_URL;

audioElement.volume = settings.store.volume;
audioElement.play();

which way is better?

#

I want to play a sound without it being delayed

balmy sky
#

Would it be possible to cache loaded gifs in favourites for next time? i'm sick of this shit taking 20 years to load everything 😭

vale spear
#

@dull magnet since discord are now calling bots "app", i'm updating my moreusertags pr to use the new string

#

so that it uses the same text as the vanilla client does

rocky jackal
#

I have a question. If I use a patch from someone else's plugin, what would be the proper way to credit them?

frosty otter
frosty otter
#

making a plugin to access quests easier

dull magnet
#

horror

frosty otter
#

trying to load the quest chunk with this code (this is just the necessary stuff), but it doesn't find it

[...]
const requireQuests = extractAndLoadChunksLazy(["getLevelAndMarkUsed:"]);
[...]
export const openQuestsModal = () =>
    requireQuests().then(() => openModal(props => <QuestsModal {...props} />));
#

the modal and stuff alr works

#

but crashes, if the chunk wasn't loaded alr

dull magnet
#

use openModalLazy

frosty otter
# dull magnet use openModalLazy

still not working

export const openQuestsModal = () =>
    requireQuests().then(() => openModalLazy(() => Promise.resolve(props => <QuestsModal {...props} />)));

(adjustements made by copilot, so....)

#

or

#

the string I use to find the chunk is wrong

#

lemme try a different one

dull magnet
#

not like that

frosty otter
dull magnet
#

and accepted by u :p

#

search for openModalLazy

frosty otter
crisp basin
# frosty otter making a plugin to access quests easier

lol we're doing the same thing 💀 the difference is i want to make it a home tab ( https://github.com/Vendicated/Vencord/pull/2364 )
the problem is i cannot find the way for setting content of home tab (the thing on screenshot)

GitHub

Requested in Vencord/plugin-requests#361 by @TonyE2, betterQuests is a fairly simple plugin which introduces new button on the Home screen of the client - Quests

Said quests button functions as an...

frosty otter
frosty otter
#

saw someone discussing that a while ago

crisp basin
#

hmm okay. i'll check

frosty otter
#

search might be bad..

crisp basin
frosty otter
#

these are the messages

#

@crisp basin

crisp basin
#

okay, thanks. i'll check them out

frosty otter
#

trying this now, which doesn't work

dull magnet
#

no

dull magnet
frosty otter
#

from what I saw in EmoteCloner this is my understanding, on how it works

#

very lost now..

#
export const openQuestsModal = () =>
    requireQuests().then(() => openModalLazy(async () => {

        return modalProps => (
            <QuestsModal {...modalProps} />
        );
    }));
#

this my current code

#

and it is failing

#

because of these errors

dull magnet
#

emoteCloner isn't fetchData().then(data => openModalLazy(())

frosty otter
#

can you maybe help me instead of just saying no?

dull magnet
#

im helping u by telling u to look at examples

#

hoping you can figure your mistake out yourself

#

note how every usage of openModalLazy has its promise call inside the Lazy

#

that's the point of the function

proud parrotBOT
frosty otter
#

thank you

#

for some reason VSCode Search couldn't find that

#

only issue now is, that the find for the quest chunk is not successful

crisp basin
#

ok got it working. i'll put the actual content now lol

balmy sky
#

How do rpc timestamps actually work? i thought they were just unix timecodes but no matter what i do, i can't get the session length to go above 24 hours

dull magnet
#

try to add 000

balmy sky
#

Exactly the same thing

frosty otter
crisp basin
#

i think it's fine like that.. niko83c though i might also add something on top of the page

balmy sky
#

That's so much better

#

Thanks wah

frosty otter
#

does it crash if the module isn't loaded?

crisp basin
#

no

#

it loads the module when clicked the button

#

so it will be fine

frosty otter
#

what code are you using for that

#

so what string

#

to match in the module

#

because I was struggling with that

crisp basin
#
const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}Promise\.all\((\[\i\.\i\(".+?"\).+?\])\).then\(\i\.bind\(\i,"(.+?)"\)\).{0,50}"UserSettings"/);
``` here to require settings menu
```ts
const QuestsComponent = findComponentByCodeLazy(".useQuests)({fetchPolicy:\"cache-and-network\"});(0"); // No nessessary props to include
``` here for quests component (probably can be done better but i'm too silly to find out ![blobcatcozy](https://cdn.discordapp.com/emojis/1026533070955872337.webp?size=128 "blobcatcozy") )
frosty otter
#
const requireQuests = extractAndLoadChunksLazy(["isQuestExpired:"]);
#

used this

#

but the string to find is wrong

crisp basin
#

lol i used the one from above that ven sent

frosty otter
#

he didn't send a string for that

crisp basin
#

but here's requireSettingsMenu

frosty otter
#

ohhhhhhhhhhh

crisp basin
#

ok time to do test and i'm pushing it to the pull request

frosty otter
crisp basin
#

oh niko83c

#

good to know

frosty otter
#

now it's finally working

flint bronze
flint bronze
flint bronze
#

i highly doubt the component is separate from the page content

#

considering how it is actually rendered

frosty otter
#

try to find it with the classname

flint bronze
#

alright

#

will try

#

later

frosty otter
#

but without the __3337a part

flint bronze
#

yeah i know how to find classname references

frosty otter
#

ok

crisp basin
#

oh well. at least i know now niko83c

flint bronze
#

I sure do hope my Homepage plugin concept isn't stuck in the hell that is my desktop trolley

frosty otter
#

what does it do?

flint bronze
#

i was trying to recreate the inbox but as like a full page feed thing

frosty otter
#

hmmmm

#

interesting

#

sounds great

crisp basin
#

hmm in the meanwhile i'll try to create this plugin. https://github.com/Vencord/plugin-requests/issues/350
doesn't seem to be THAT difficult, just patching media modal (rest of the stuff like src, size etc. are already there) and adding some context menus. the first one is already done by me partially niko83c

GitHub

Plugin Description Image utilities style image saving (pre-define a location)> Right click image > Save Image to > {FolderName} Existing Plugin for other mod https://github.com/mwittrien/B...

frosty otter
dusk kernel
#

would making a plugin to bypass automod be not allowed

#

(by inserting invisible unicode characters between letters)

crisp basin
#

why would you want a plugin that bypasses it

swift delta
crisp basin
#

most likely

dusk kernel
#

like they block ”this“