#🧩-plugin-development

1 messages · Page 79 of 1

iron epoch
#

you would have to use extractAndLoadChunksLazy

normal wagon
iron epoch
#

also can I see your patch?

normal wagon
# iron epoch also can I see your patch?
patches: [
  {
    find: "DefaultCustomizationSections",
    replacement: {
      match: /(\s*return\s*\(0,\s*i\.jsxs\)\("div",\s*\{)/,
      replace: `const clans = er;\nconsole.log("clans:", clans);$1`
    }
  },
]
#

should print out table when you open up the profile section

iron epoch
normal wagon
#

it's all the servers

iron epoch
#

clan tags or servers?

#

because you should be able to get them both either by the GuildStore or UserStore

normal wagon
#

well it's clan tags, but it provides the servers that have it enabled from this section

#

im wanting to grab all of the current ones i have

normal wagon
#

cause server-tags are relatively new

iron epoch
#

assuming you are in those servers

normal wagon
#

i'm in those servers yeah im just wanting to grab that table so i can get all the ids, of the ones im currently in

#

rather than manually inserting each one of them into a table

iron epoch
#

@normal wagon wait are you animating your clan tags...

iron epoch
#

I can't help than you are abusing discord api

normal wagon
iron epoch
#

selfbotting or api abuse isn't allowed

#

that means you would have to stop that

normal wagon
humble tulip
cosmic wigeon
#

What is responsible for creating the plugin settings?

hoary pilot
cosmic wigeon
twilit rivet
#

what part of discord handles clearing the chatbar after you've sent a message

twilit rivet
cosmic wigeon
#

Is it possible to add in the plugin settings "Color Picker"

humble tulip
cosmic wigeon
#

But do you perhaps know how to make a label?

hushed loom
cosmic wigeon
#

thanks

cosmic wigeon
vast karma
#

What does that sentence mean

hushed loom
azure fossil
#

i have an idea for a plugin, but i don't really know where to start
basically i want discord not to change what URL it display because when you have an URL with http basic auth, it doesn't show the username and password
ex : https://username:password@julienraptor01.ddns.net/folder/derailious.png
raw: https://username:password@julienraptor01.ddns.net/folder/derailious.png

#

also discord seems to not embed pictures if i have basic auth even if i have the stuff in the URL
(but if i allow the Discord UA to bypass it, i can clearly see it embed, so it's not a problem with file format or anything, it's just discord doesn't handle basic auth)
but it's not really smth i wanna fix since it woud mean the client fetch stuff directly instead of having discord's CDN inbetween
https://julienraptor01.ddns.net/folder/derailious.png

empty sundial
#

we cannot modify their servers

#

and if you fetch embed information yourself that would lead to ip leak i guess

azure fossil
#

but what i want to fix is the client lying to the user by not showing that the URL has auth info in it

empty sundial
#

you will have to find where in the code it gets stripped off

azure fossil
#

cause the info is clearly there and if you click on the link, it's used
but i searched for what's used to render it, but i can't find it
i'm not that great at using react devtools

hushed loom
azure fossil
azure fossil
#

like not strip the username:password@ part

empty sundial
azure fossil
#

would you have to leak the IP

hushed loom
#

i thought you wanted it to embed

azure fossil
#

yeah no

hushed loom
#

just having it display is easy

azure fossil
#

that's smth discord should fix, not me

dull magnet
empty sundial
#

they are basically the same thing anyway smh

azure fossil
#

making the URL display correctly should be doable client side, but i'm bad at react

dull magnet
#

no 😭

hushed loom
azure fossil
#

good enough at CSS, but it doesn't really help

hushed loom
#

sending the username / pw to the media proxy would be incorrect

empty sundial
azure fossil
hushed loom
#

if you're just changing how the URL text displays on the client that is 100% possible

if you want to change how the it interacts with the media proxy, that's a whole other can of worms

azure fossil
#

ig i could do smth bad being putting them in arg and then internally resolving them, but it start becoming annoying
if discord could just follow stuff it would be nice
like i wanted to add oembed support to my stuff
so i read the spec
i can use link headers
so i try to do that
it works on embed testing website
i try on discord own embed tester
it's broken
why ? because discord only half follow the spec 🤦‍♂️

azure fossil
swift seal
proud parrotBOT
#

discord.tsx: Lines 106-111

export function insertTextIntoChatInputBox(text: string) {
    ComponentDispatch.dispatchToLastSubscribed("INSERT_TEXT", {
        rawText: text,
        plainText: text
    });
}
swift seal
#

like maybe CLEAR_TEXT instead of INSERT_TEXT or something

hushed loom
hushed loom
#

and no args

swift seal
#

i’ve got a crazy plugin idea - enabling/disabling plugins with a slash command fr

#

/vencord-disable petpet

cosmic wigeon
humble tulip
cosmic wigeon
humble tulip
#

Which part?

civic elk
#

gang how do i add a little divider for the copy and open link thing

normal wagon
#

@civic elkit would be done via css i copied same style from the seperator role

vast karma
#

What would the point be?

hushed loom
past patio
#

i'm sort of stuck in a bit of a ditch rn, and i'm trying to make my first plugin, but no matter what i do or try it just won't appear in the plugins list
i've followed the instructions on the dev website about how to create your plugin. i have vencord companion and hte necessary extensions installed on vsc, and i'm using a dev build and everything... but it just won't show up in my plugins

turbid glen
past patio
turbid glen
#

Ok and after saving the plugin, you are rebuilding vencord?

#

pnpm build
pnpm inject

past patio
#

yeah, i run "pnpm build" and "pnpm inject", however now when i tried it again i got an error in vsc
'Find bad: Error: No Discord Clients Connected!'

i didn't get that before though, so i'm just going to try and restart discord rq

#

apparently something had happened with my discord (or something along those lines), and now it shows up in the plugin list
ty so much for the help :)

turbid glen
#

Question? Before I was using the DOM so it got rejected so how can I get the name of the command currently typed in the message?

vast karma
#

Find where it's stored and read it

#

Same as how you get literally any other data

empty sundial
#

is there any update on editlocaluser

#

(not to bitch, looking for something to contribute)

twin moat
#

does the react components editor not work on the discord invite (/invite/vencord) page?

hushed loom
twin moat
#

is there an easy way to get the server id given a channel id
(that isn't my very janky way of parsing document.body.innerHTML for a css background image)

silk sorrel
#
ChannelStore.getChannel("1015074670963335219").guild_id
vital atlas
#

is there a way to do this that avoids using the butotn as a wrapper

#

i probably spent an hour doing random stuff in the console that lead absolutely nowhere

humble tulip
#

I'd use React dev tools to find the onclick of the settings button and invoke it directly instead

vast karma
#

Same, except I'd grep the code instead of react tools

humble tulip
#

Although I wouldn't be surprised if there's a flux event or something to do it tbh

vital atlas
humble tulip
#

Most recent pin in this channel is about using react dev tools if that's any help

vast karma
#

Yes, all of discord is random obfuscated code

vital atlas
#

ykim

humble tulip
#

Found it

FluxDispatcher.dispatch({ type: "USER_SETTINGS_MODAL_OPEN", section: "My Account", subsection: null });
FluxDispatcher.dispatch({ type: "LAYER_PUSH", component: "USER_SETTINGS" });```
#

First one loads it, second one opens it

vital atlas
#

oh fire

silk sorrel
#

You can also search for code that dispatches these events, you might find wrapper apis

vital atlas
#

damn did i get lost or something the stuff i was looking at had completely different props

silk sorrel
#

you were probably looking at component code

#

I think this is the same settings module

vital atlas
#

yeah tahts what i was looking at

#

i was trying to figure out how to get to it

#

like call it

#

i blame javascript its obviously not my fault /j

humble tulip
#

That's what I found first but I don't think there's a reference to the class available so you have to create a new instance of it which felt wrong

#

AccountPanelServerProfile patches a ref into it so I assume there's no way to get it without a patch

vital atlas
#

😔

#

oh well

#

at least i got my vscode settings keybind now 🤑

tropic ice
#

whoa not a cow spotted

vital atlas
#

woah obsidianhydar11 spotted

#

pass lazzi when

tropic ice
tropic ice
vital atlas
#

better luck next time

tawny yarrow
empty sundial
humble tulip
#

I mean, it's still kinda obfuscated as a side effect

cosmic wigeon
#

Which is to say, what exactly does it mean?

normal wagon
#

you just have to revert those changes

#

but they don’t help with dev build here sorry

cosmic wigeon
normal wagon
#

and undo those changes

normal wagon
#

is there a way to detect whether the client was force closed or restarted?

cosmic wigeon
twin moat
#

I tried removing and reinstalling node_modules, but it doesn't help

dull magnet
#

it's just for types

#

you can't import anything from there

twin moat
#

where do I import from then

dull magnet
#

vencord

twin moat
dull magnet
#

because you don't have access to that channel....

twin moat
#

it's this channel though?

#

I'm trying to run something on the accept invite (/invite/vencord) page

quick zephyr
#

how does ViewRaw get the message data it displays? The code seems to just spawn it out of nowhere in renderMessagePopoverButton.

#

ok I see it gets it from MessagePopoverAPI now but where does that get it cause it's giving wrong info 🤔

prisma imp
#

hey everyone, currently writing a client mod that will allow users to pipe an HLS stream into a channel as a go live, and I am trying to decode some of discord's streaming internals so I can bypass patching media picker the way vesktop does it.

to get started, I need to see some of discord's internals (obfuscated is fine; i have experience reading it), is there any tooling that allows me to download all of discord's webpack modules recursively, or do I just need to do it manually/make my own tool?

vast karma
#

I have a plugin for it in my repo

#

Dunno if it still works, but it did a few months ago

humble tulip
#

Isn't streaming done via a native module?

prisma imp
#

that is definitely done in javascript because that same functionality is in the web app

#

difference is it uses the web api for getting a media stream rather than x11/win32, etc.

vast karma
#

Or wasm, wouldn't surprise me

prisma imp
normal wagon
#

probably a stupid question but how would i check whether another plugin is enabled

oak sundial
#

Vencord.Plugins.isPluginEnabled("PluginName")

stiff dragon
#

ok you know what

#

instead of asking for reviews in my plugin

#

i'll ask for feedback here first

#

so

#

there's this function

#

that builds the right click menu

#

and getting the stickers info with the right click menu works differently than through chat

proud parrotBOT
stiff dragon
#

i have to make 2 separate functions because of one variable

#

which i know there's an easier way of going about but i couldn't get it to work

proud parrotBOT
stiff dragon
#

wait wrong lines

#

😭

prisma imp
proud parrotBOT
stiff dragon
#

there

#

the difference is the data and data[0]

#

i have to build 2 different menus that do the same thing becuase of this, is there a way to simplify it?

bronze dove
stiff dragon
bronze dove
#

oh you copied the emote cloner implementation, but i dont think you need to do all that

bronze dove
#

just pass the sticker id and use the sticker store to get it

stiff dragon
#

i tried doing it manually but nothing i did would make it appear

normal wagon
#

how would i add text into this bar here?

hushed loom
normal wagon
#

for example i want to add hello into the chat-bar

#

to show it as a preview

hushed loom
# normal wagon preview text i think

I should have phrased myself better.

Do you want to change the message plugin development thing or do you want to simulate typing from the user?

normal wagon
#

i’m just wanting to put text within that box not alter plugin development text or alter pre existing text

#

and i’m not wanting to change text as it’s being sent

hushed loom
normal wagon
normal wagon
tidal zenith
#

is there any way for vencord plugins to make calls to windows api like SetDisplayAffinity?

hushed loom
regal parcel
#

any way to make TextInput allow newlines? or any other way to input text with newlines?

dull magnet
#

TextArea

tidal zenith
hushed loom
#

tbh i have very little experience with the windows api

i think the most i've done is fail to make a filesystem watcher

tidal zenith
#

It seemed like a pain in the ass to go with SetWindowDisplayAffinity so i just used setcontentprotection and said fuck it

#

hey they cant see my discord. it works as expected

regal parcel
#

is it possible to get the channel.id of the message youre about to send?

humble tulip
#

SelectedChannelStore.getChannelId() is the channel currently open, probably easiest

#

If you're using the pre-send listener the channel should be on the message object I think

regal parcel
bronze dove
regal parcel
#

oh fr?

humble tulip
#

Yeah I was just gonna say lol

regal parcel
#

i didnt realize

#

lol thanks

tidal zenith
#

any idea why disable doesnt actually disable the protection but enable does enable it?

import { BrowserWindow } from "electron";

function getWindow(): BrowserWindow | null {
    const windows = BrowserWindow.getAllWindows();
    return windows.length > 0 ? windows[0] : null;
}



export function enable() {
    const win = getWindow();
    if (win) {
        win.setContentProtection(true);
    }
}

export function disable() {
    const win = getWindow();
    if (win) {
        win.setContentProtection(false);
    }
}
hoary pilot
#

what are you trying to do

tidal zenith
#

setContentProtection is electrons way of doing basic drm protection

tidal zenith
#

ok so after alot of checking and thinking vencord was just buggy as fuck. I figured out a discord fun fact, discord can have more than 1 window in alot of cases, and they're invisible as well. Now aint that fun.

Title: Discord Popout
URL: https://discord.com/popout
Visible: false
Focused: false
Bounds: {"x":0,"y":0,"width":1280,"height":720}

dull magnet
#

you can query all windows with electron apis

#

there are also events for window created

#

I think

#

you should be able to use that to detect new videos and set it for those too

#

but vencord doesn't patch popouts

fallen sandal
tidal zenith
dry reef
#

im tryna change the colour of message authors to discord's new gradient role colors. anyone got any clue?

#

im tryna do it on a normal server, not a guild (with tags)

glacial osprey
#

is a plugin that hooks the spotify rich presense for use with last.fm possible? i like the spotify rich presense progress bar and stuff

#

havent looked into it at all so i dont know anything about it aside from it uses spotify websocket and the progress bar is "estimated" based on play and pause actions

dull magnet
#

you don't need to hook into anything, you can just set the timestamps and discord should show a progressbar

#

but there is no way of knowing the current time in your track via lastfm

glacial osprey
#

oh i thought that was a spotify rich presense specific feature, interesting

#

yeah i guess timestamps with lastfm can be an issue though

#

thank you

dull magnet
glacial osprey
#

ah

#

seems like lastfm api can return the track length so i guess i can try and make it keep estimating the playback but with the length added

dull magnet
#

you'd be better off making a proper activity for whatever player you're using

glacial osprey
#

oh ur right

#

hmm

#

unfortunately i am using the stock music app on an iphone 6s for its headphone jack

#

so i'd have to write a jailbreak tweak or something

dull magnet
#

discord already shows a duration, that's why we haven't bothered adding anything else

#

accurate enough

glacial osprey
#

i know i just kinda wanted the progress bar but yeah ur right it wouldnt be accurate

#

i guess thats whats good about the real spotify integration lmfao

#

now im tempted to make a jailbreak tweak for it just for the hell of it

#

sounds fun

humble tulip
#

They support gradients in that

#

thumb np

weak flint
#

Does anyone know a reliable way to get channel names and guild/server names?

  • findByPropsLazy("getGuilds") doesn't return names
  • findByPropsLazy("getChannel") doesn't work at all it seems
  • MessageStore.MESSAGE_CREATE.message doesn't have any info other than the IDs

-# Also how do you get guild/server id from a channel id (or just how do you get the guild id from a message that the client (yourself) sends. it's almost always not there in MessageStore.MESSAGE_CREATE.message.guild_id)

dull magnet
#

ChannelStore, GuildStore, SelectedGuildStore

empty sundial
#

in your plugin code you import the stores from common

#

just type ChannelStore and let autoimport do its shit

#

(import from @webpack/common)

empty sundial
weak flint
empty sundial
#

are you not on vscode

weak flint
#

i am and i have the plugin i thought but i dont have autocomplete, just "Test Find" above certain things

empty sundial
#

autocomplete as in the editor will suggest you imports when you type

weak flint
#

hmmm, i got GuildStore to work but

(() => { const ChannelStore = Vencord.Webpack.findStoreLazy("ChannelStore"); console.log(ChannelStore.getChannel(1032770730703716362)); })();

is undefined (it's this channel's id)

humble tulip
#

It might not be the issue here but you should use string ids rather than numbers

empty sundial
#

Import channelstore from @webpack/common

empty sundial
#

ids are strings

weak flint
#

oh ty but it's still coming up undefined and saying it cant read it

btw how'd you get it to work in console with just "findStore("ChannelStore").getChannel("1032770730703716362")"

empty sundial
#

You need the consoleshortcuts plugin

#

Its probably coming up as undefined because the client doesn’t fetch channel information and stores it in the store until it’s needed, so if you haven’t opened the server/channel it might not be in channelstore

weak flint
#

oh ty so much

#

oh is there no way to get all channels info like GuildStore.getGuilds?

#

jk i think i can just grab them all manually. ty again very much for the help

weak flint
#

which is the correct companion? the second one seems to be it but it links to the first

chrome elbow
#

first is the og, second is sadan fork

weak flint
#

ah ty, i can only get autocomplete working with the second

honest stump
#

sadans fork is generally better in my opinion blobcatcozy

tropic ice
#

oh that's cool

#

i can't get it to work though

#

am I doing something wrong

humble tulip
#

You need his version of the plugin as well

tropic ice
#

ah

#

I don't see that in the extension description

regal parcel
#

how do you like listen for incoming messages lol the closest thing i found were flux events but im legit lost on how to use that

dull magnet
#

MESSAGE_CREATE event

regal parcel
# dull magnet MESSAGE_CREATE event

ye figured that out but im kinda stupid and i have no idea what to do further and i cant seem to find any plugin that takes use of that so i can look at it

#

💔

humble tulip
dull magnet
#

there are multiple plugins using that event

regal parcel
hushed loom
#

I should add something to make it prompt you to do that soon.

normal wagon
#

s there a patch for adding a button to this?

#

actually idk can someone help

vast karma
#

When else would it be triggered, if not when a message is created

hoary pilot
white lichen
#

Why does MESSAGE_CREATE not trigger on all messages, and seem to favor certain ones when they all have the same level of activity

dull magnet
#

it triggers on all messages

#

but after a certain size, you won't get events from servers unless you're subscribed to them (by opening a channel there for example)

#

so you won't get events for big servers you never opened

white lichen
#

wdym after a certian size

dull magnet
#

you need to open the channel in the same session

#

you can also subscribe to channels with code

white lichen
white lichen
white lichen
#

for example, how would i subscribe to a channel that i have the id for?

bronze dove
#

if statement in your function

white lichen
#

like filtering out ones? im trying to capture more

bronze dove
#

i cant read, but yeah open a channel to send a gateway event

#

turn on gateway logging and see what happens when you open a channel

silk sorrel
# white lichen for example, how would i subscribe to a channel that i have the id for?

You receive message events for all channels in the same guild, so you just need to subscribe to that guild

import { findStoreLazy } from "@webpack";
import { ChannelStore } from "@webpack/common";

const GatewayConnectionStore = findStoreLazy("GatewayConnectionStore");

const subscribeToChannel = (channelId) => {
  const channel = ChannelStore.getChannel(channelId);
  
  if (channel)
    GatewayConnectionStore.getSocket().updateGuildSubscriptions({
      [channel.getGuildId()]: { typing: true },
    });
};
spiral mesa
spiral mesa
#

does something like GatewayConnectionStore.getSocket().updatePresenceSubscriptions exist?

jade orchid
#

I'm trying to detect when a file is dragged and dropped into discord. I've tried adding event listeners for dragenter, drop, etc. and simply logging these events to the console to no avail. I've also tried using MutationObservers to detect changes Discord makes itself when this is happening and still nothing, including using an example where a user did the same thing in #📜-js-snippets, has anyone encountered this and/or has advice?

silk sorrel
# spiral mesa does something like GatewayConnectionStore.getSocket().updatePresenceSubscriptio...

I'm not sure, but you can experiment with it in the devtools console by running Vencord.Webpack.findStore("GatewayConnectionStore").getSocket()

updateGuildSubscriptions also takes other parameters, idk which ones are for presences specifically

{
  "100000000000000000": { // guild
    "typing": true, // typing and messages
    "threads": true, // thread events? like creating/deleting ig
    "activities": true, // app activities maybe?
    "members": ["111111111111111111", "222222222222222222", "333333333333333333"], // specific member profiles
    "member_updates": true, // no idea
    "channels": { // member list updates
      "101010101010101010": [
        [0, 99], [100, 199], [200, 299]
      ], // allows multiple ranges, representing visible sections of the member list
      "202020202020202020": [[0, 300]] // up to 301 members per visible section
    },
    "thread_member_lists": ["444444444444444444"] // member list updates, but inside threads
  }
  // ... other guilds u want to subscribe to
}
#

However keep in mind that overriding specific properties like channels could break internal state. It's fine to set boolean properties to true, since you only get extra events, but you can accidentally break the member list by overriding the channels/thread_member_lists property. Also don't go over the member range limit (301) - it could disconnect you from the gateway.

There is a class that keeps track of existing channel subscriptions, which is used by the GuildSubscriptionsStore. This store only listens for events and you can't modify it, so you would have to patch the code to get the class instance

#

this is where the subscription manager instance is created, with a callback that dispatches the GUILD_SUBSCRIPTIONS_FLUSH event with the internal subscription state. You could also dispatch this event manually or intercept it, but idk if this is even needed

dull magnet
#

why do u even need to sub to all guilds

#

are u making a nitrosniper or smth wires

#

there's a good reason this subscription stuff exists, performance will suffer

silk sorrel
#

actually is there even a rate limit to the gw?
I feel like it would just break past a certain point

#

idk what dogwalker is cooking, could be a XY problem

jade orchid
#

I think discord is blocking it somehow

jade orchid
#

ok figured it out. seems the listener was being added at the wrong time and I needed to do (event) => { event.preventDefault(); event.stopPropagation();... when adding it

spiral mesa
spiral mesa
#

is there anyway to lookup the oldest message from a channel?

#

particularly it's id

spiral mesa
#

that helps but i mean with a plugin

#

automatically

vast karma
#

The search function is made of code

#

Code can be copied

spiral mesa
#

wdym

#

how do i copy it

vast karma
#

You do know how code works, right?

spiral mesa
#

i dont think i know what you mean by the search function is made of code

vast karma
#

When you click the search button, code is executed

#

That code finds the oldest messages

#

Thus, there does exist code that finds the oldest messages, which you can find and steal for your own purposes

spiral mesa
#

and how do people usually find code

vast karma
#

Devtools

humble tulip
#

You can use the rest api messages endpoint

#

Pass limit 1 and after 0

spiral mesa
#

how do i use devtools? i tried asking chatgpt for help but it told me nonsense

#

i have the devcompanion already installed

hoary pilot
#

aaanyway you should learn the basics of web dev, how to use devtools, how to search for documentation/instructions without AI, then you should be ready

fallen sandal
#

help @hoary pilot how do I put a message in the text log

light vapor
#

is there a way to see discords source in vs code?

vast karma
#

Maybe if you get hired

#

They're not gonna let anyone see the source code without that

#

The compiled code is a different matter

light vapor
#

how do you create patches then

#

i mean the source that the patcher also uses

#

is it this

fallen sandal
light vapor
#

thx

silk sorrel
#

You can also check out Vencord/.vscode/launch.json for instructions on how to connect the debugger to vscode

light vapor
#

just tried viewing an patch

silk sorrel
light vapor
humble tulip
#

You need sadan's userplugin version of devcompanion along with it

vast karma
humble tulip
light vapor
#

i see

light vapor
#

?

humble tulip
#

You need sadan's userplugin version of devcompanion along with it

light vapor
#

then the shipped one

humble tulip
#

Yeah, it handles the extract and diff commands

light vapor
#

ok thx

light vapor
#

webpack file

humble tulip
#

There's a command to extract by module ID but I don't know what it is, there's probably a help readme on the extension or plugin

#

I haven't used it myself

light vapor
#

how would i find where messages are created if i found the message component

empty sundial
light vapor
#

to include seconds

empty sundial
#

then patch the timestamp inside the message component, you do not need to know where messages are created for that

light vapor
empty sundial
#

have you used react before?

light vapor
#

kinda

empty sundial
#

familiarize yourself with react, everything is a component, edit the component and every use of the component changes

hushed loom
fathom pivotBOT
#

Alright @hushed loom, in 2 hours, 31 minutes and 17 seconds: add warnings/info to dev companionn fork for new users (i never thought people would actually use it blobcatcozy )

hushed loom
#

you can also extract with search

fallen sandal
hushed loom
fallen sandal
#

yop but when it works 😻

hushed loom
proud parrotBOT
fallen sandal
#

not that I remember

fathom pivotBOT
#

@hushed loom, <t:1747434523:R>: add warnings/info to dev companionn fork for new users (i never thought people would actually use it blobcatcozy )

fathom pivotBOT
#

@hushed loom, <t:1747443698:R>: add warnings/info to dev companionn fork for new users (i never thought people would actually use it blobcatcozy )

hushed loom
#

guhhh too busy fixing bug in MIEnginne

hoary pilot
#

saladeath

tropic ice
#

Does anyone know why opening the profile popout doesn't work when clicking the pfp on whoReacted anymore?

fathom pivotBOT
#

@hushed loom, <t:1747451070:R>: add warnings/info to dev companionn fork for new users (i never thought people would actually use it blobcatcozy )

silk sorrel
jade island
#

Does FindByProps have autocompletion?

proud parrotBOT
honest stump
#

somehow the click isnt registered even though it should work

#

insane

versed osprey
#

heya is there a new replacement for ButtonLooks from @webpack/common?

tropic ice
#

that stops the click from making you react

oak sundial
#

its useful

honest stump
# tropic ice ?

i thought that it may prevent the click for the other component as well

#

but apparently its another issue

#

please ignore what I said blobcatcozy

silk sorrel
hushed loom
silk sorrel
#

😭

dry reef
#

tryna click on the channel mention via devtools but shows this in console

dull magnet
#

and fully restart the app

normal fulcrum
#

Would anyone happen to know a convenient place to patch for changing what URL an image embed is actually fetched from?

hushed loom
normal fulcrum
hushed loom
normal fulcrum
#

Mmmmm the groupableVisualMediaItems stuff seems to still exist for attachments, but embeds from a URL aren't handled that way.

versed osprey
#

im reworking on some of my old projects and im treying to fix sound board logger and i wanted to know if there is a new way to do this cus it dosent work anymore (been a few good months since it "kinda" worked)

let getAmplitudinalSoundboardVolume: () => number = () => 100;
try {
    getAmplitudinalSoundboardVolume = findByProps("getAmplitudinalSoundboardVolume")?.getAmplitudinalSoundboardVolume ?? (() => 100);
} catch { }

export const getSoundboardVolume = (): number => {
    try {
        return amplitudeToPerceptual(getAmplitudinalSoundboardVolume());
    } catch {
        return 100;
    }
};
cedar olive
#

findByCode the new method

versed osprey
#

i havent done this shit in over half a year 😭

#

at least i fixed and finished my KeywordHighligher pr

#

now just wait for review

cedar olive
#

take a look here

#

it has amplitudeToPerceptual

#

but you need to figure getAmplitudinalSoundboardVolume

versed osprey
#

ya ill take a look

#

ty tho

tropic ice
tropic ice
#

i kinda thought it was lazer eyes or something

#

and never noticed the text

hushed loom
tropic ice
#

it's avatar decoration's fault!

acoustic flax
#

Hello, I found a way to automate pressing the jump button, but when I try to automate typing in the search bar and pressing Enter by simulating paste and key events, it leaves invisible “ghost” text in the input that doesn’t clear properly. Does anyone know why this happens or what the best method is to programmatically enter text and submit the search so it fully registers and clears?

tropic ice
#

you shouldn't do that

acoustic flax
#

what should i do?

acoustic flax
humble tulip
#

Check MessageActions.jumpToMessage

vast karma
#

Faking dom interaction is a bad idea, better to just do what said interaction would do directly

acoustic flax
humble tulip
#

It's exported in webpack commons

#

let {channelId: t, messageId: n, flash: r=!1, offset: i, context: a, extraProperties: o=null, isPreload: s, returnMessageId: l, skipLocalFetch: c, jumpType: u} = e; for props

dull magnet
jade orchid
#

when creating forks of plugins under GPL-v3.0, what is required to keep in compliance with the license? is changing the date in the comment at the top allowed? manifest information?

oak sundial
#

just add a new line with a new date in the header

#

or leave the header alone idk don't really need to touch it

prisma yew
#

trying to get the TextArea to show the markdown's but some of them dont seem to work, i cant figure out why. these are the only ones i was able to get working

#

bold works but italic doesnt?? weird

humble tulip
#

I don't know if it's the issue for the italic but your codeblock needs the markdown class added to it to fix that copy button being in the wrong place

#

Sorry no actually it's the parent of it needs the markup class

prisma yew
#
        return (
            <ScrollerAuto className={cl("rendered-note-area", MarkupClasses?.markup)}>
                {noteTags.length > 0 && (
                    <div className={cl("tags-view-area")}>
                        {noteTags.map(tag => <TagComponent key={tag} tag={tag} readOnly className={cl("view-mode-tag")} />)}
                    </div>
                )}
                {parsedTextContent || (noteTags.length > 0 ? null : <div className={cl("empty-text-placeholder")}>No text content.</div>)}
            </ScrollerAuto>
        );

it has markup actually already

#

i tried with markdown class as well, nothing changed

humble tulip
#

It's definitely what places the button in the right place

#

Maybe the codeActions one is missing?

#

Wouldn't really make sense but I don't know why else it wouldn't be applying

prisma yew
#

hmm

prisma yew
#

after making some changes on parser, i have managed to get the rest of the markdowns recognized, but they dont get the style down lol and the codeblock copy button is still on the wrong spot KEKW

humble tulip
#

markup and markdown aren't in the same module

prisma yew
#

ok ok I'll try that

humble tulip
#

Yeah, it's an and filter

#

There's two markdown classes as well so you'll need to narrow that one down a bit more

prisma yew
prisma yew
#

adding the 2nd markdown fixed it

humble tulip
#

np

humble tulip
cedar olive
#

what do you need the authentication for?

dull magnet
#

full length previews

tropic ice
humble tulip
#

True but Spotify previews are much louder than the full song player

dull magnet
#

vp FixSpo

shrewd tundraBOT
humble tulip
#

I like the loudness suffoSitJam

#

Tbh the only reason I made this is because every now and then a friend will be like "3:10 is sick" and it's a spotify link that I don't wanna open to play the whole thing

humble tulip
#

FixSpotifyEmbeds doesn't work on the full version since it uses web audio api or something

tropic ice
#

vp whoswatching

shrewd tundraBOT
tropic ice
#

@cosmic wigeon what's the name of the plugin?

#

is it a built in one?

#

I thought it was but maybe it's a userplugin

cosmic wigeon
#

I create it myself

tropic ice
#

oh
what about the old version that worked

#

wasn't that from a plugin

cosmic wigeon
tropic ice
#

?

#

what was the name of the old plugin

cosmic wigeon
cosmic wigeon
#

but now no one sees it that way

swift delta
cosmic wigeon
swift delta
#

Just adapt from there

cosmic wigeon
hushed loom
#

just try it and see lol

acoustic flax
#

hi, does load_messages_success fire when you use the search history?
i only ask because i thought it was before, but discord may have updated

dull magnet
#

stop deleting your messages bruh

fallen sandal
#

he is insane and talks to himself

#

@hushed loom get back on your meds

hushed loom
acoustic flax
#

you must be a pretty bad dev support

#

to say something like that after no reading that i have

#

lmao

acoustic flax
#

is there something missing

#

or do you just troll people lmao

dull magnet
#

"try it and see" is the only correct answer to your question

you can get help but no one is gonna do your own work for you. anyone wanting to help would have to waste their time trying it themselves when you could just try it yourself instead

if you want help, ask a better question with the relevant details and try being less of a prick

#

you know the event name you have in mind so just subscribe to it and see if it fires

acoustic flax
#

i did try load_message_success and search_message_success

#

how do i "try them"

#

other than by trying them first

#

and asking for help second

tropic ice
#

what happened when you tried them?

acoustic flax
#

not the same thing as last week where all the searched messages started coming in as load_message_success

#

nothing happened

white lichen
solemn spire
#

How do I fetch messages from a channel

vast karma
#

Check MessageLinkEmbed

spare fern
dull magnet
#

you can port it but it won't be accepted into the main repo :P

#

integrating that into discord is not very useful

#

just install an OS wide tool to do it

#

A compose key (sometimes called multi key) is a key on a computer keyboard that indicates that the following (usually 2 or more) keystrokes trigger the insertion of an alternate character, typically a precomposed character or a symbol.
For instance, typing Compose followed by ~ and then n will insert ñ.
Compose keys are most popular on Linux an...

GitHub

🔣 Compose Key for Windows. Contribute to samhocevar/wincompose development by creating an account on GitHub.

#

Compose + 1 + 2 = ½

humble tulip
#

Called quick accent but contains a lot of unicode chars not on physical keyboards

tropic ice
#

I don't like how that gets activated with space or arrow keys

#

I use a third party plugin in power toys run

tropic ice
#

Does implicitrelationships break pending friends tab for anyone else?

weak flint
#

how does one change channels without dom interaction? i tried dispatching CHANNEL_SELECT but it doesnt update the ui with it

bronze dove
dry reef
#

Anyone know why my React Devtools isn't showing? There's no error in console regarding it

#

It's definetly enabled in Settings.

#

I've tried deleting ExtensionCache, turning it off, reloading then turning it back on and reloading

#

It appeared once and then disappeared again after I reloaded

#

Nevermind, I found how to fix it but I'm not sure why I have to do this

#

I have to click Ctrl + R and it shows after

cosmic wigeon
#

Is there perhaps a non-official plugin that allows you to pin the dm to the very top?

tropic ice
#

vp pindms

shrewd tundraBOT
# tropic ice vp pindms

Allows you to pin private channels to the top of your DM list. To pin/unpin or re-order pins, right click DMs

Authors

Vee, Syncxv

stiff dragon
#

@civic elk compltely random but is it aight if i use the menuitem logic from your PR for sticker links

#

(its very clean compared to my iteration 😭 )

civic elk
#

yeah for sure

#

did you make the other stick link pr or is this for something else

civic elk
#

2027 it will be merged🙏 🙏 🙏

stiff dragon
#

oh btw do u wanna be added in the devs for the plugin

civic elk
#

sure it's not necessary but would be cool

subtle glen
#

Heya, is there a guide of some sort about how to start developing a plugin? (How is one structured, how to compile vencord so I can test my own, that sort of stuff)
I've been looking around the pinned messages and the github readmes and stuff but I couldn't find one

tropic ice
clear parcel
stiff dragon
#

if i were to implo imply you did it

#

OMG my fucking computer has been freezing for no reasson lately

#

anyways

#

if i were to implement it the way you did it it would basically become the PR you made word for word 😭

#

i just wish there was a simpler way to where i wont need 2 different menu creations


function buildMenuItem(Sticker, fetchData: () => Promisable<Omit<Sticker, "t">>) {
    return (
        <>
            <Menu.MenuSeparator></Menu.MenuSeparator>

            <Menu.MenuItem
                id="copystickerurl"
                key="copystickerurl"
                label={"Copy URL"}
                action={async () => {
                    const res = await fetchData();
                    const data = { t: Sticker, ...res } as Sticker;
                    const url = getUrl(data[0]);
                    copyWithToast(url, "Link copied!");
                }
                }
            />

            <Menu.MenuItem
                id="openstickerlink"
                key="openstickerlink"
                label={"Open URL"}
                action={async () => {
                    const res = await fetchData();
                    const data = { t: Sticker, ...res } as Sticker;
                    const url = getUrl(data[0]);
                    VencordNative.native.openExternal(url);
                }
                }
            />
        </>
    );
}

function buildMenuExpression(Sticker, fetchData: () => Promisable<Omit<Sticker, "t">>) {
    return (
        <>
            <Menu.MenuSeparator></Menu.MenuSeparator>
            <Menu.MenuItem
                id="copystickerurl"
                key="copystickerurl"
                label={"Copy URL"}
                action={async () => {
                    const res = await fetchData();
                    const data = { t: Sticker, ...res } as Sticker;
                    const url = getUrl(data);
                    copyWithToast(url, "Link copied!");
                }
                }
            />
            <Menu.MenuItem
                id="openstickerlink"
                key="openstickerlink"
                label={"Open URL"}
                action={async () => {
                    const res = await fetchData();
                    const data = { t: Sticker, ...res } as Sticker;
                    const url = getUrl(data);
                    VencordNative.native.openExternal(url);
                }
                }
            />
        </>
    );
}

const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => {
    const { favoriteableId, favoriteableType } = props ?? {};
    if (!favoriteableId) return;

    const menuItem = (() => {
        const sticker = props.message.stickerItems.find(s => s.id === favoriteableId);
        if (sticker?.format_type === 3) return;
        switch (favoriteableType) {
            case "sticker":
                return buildMenuItem("Sticker", () => props.message.stickerItems);
        }
    })();

    if (menuItem)
        findGroupChildrenByChildId("devmode-copy-id", children, true)?.push(menuItem);
};

const expressionPickerPatch: NavContextMenuPatchCallback = (children, props: { target: HTMLElement; }) => {
    const { id } = props?.target?.dataset ?? {};
    if (!id) return;

    if (!props.target.className?.includes("lottieCanvas")) {
        const stickerCache = StickersStore.getStickerById(id);
        if (stickerCache) {
            children.push(buildMenuExpression("Sticker", () => stickerCache));
        }
    }
};
tropic ice
#

probably because it's still early summer right now

civic elk
#

im on my phone

stiff dragon
#

const url = getUrl(data[0]);
and
const url = getUrl(data);

stiff dragon
humble tulip
#

Just check if data is an array and assign data or data[0] to a variable based on that

civic elk
#

yeah and you do not need to be doing all

#

check my pr it does this with one function and no spreads

bronze dove
hollow yarrow
#

How can I get useful intellisense for modules?

cedar olive
#

any intellisense you might get on any discord module needs to be manually typed

#

for UserStore you should be importing it from @webpack/common, the export from there has typings

hollow yarrow
#

Is it possible to add a npm package to your plugin?

hollow yarrow
#

I suppose since it's in the electron renderer, that's a no no

humble tulip
#

You can run native code too but I don't think a pr with a new dependency would be accepted unless it's particularly necessary

hollow yarrow
#

I see

humble tulip
#

For running in the native process have a look at any plugin with a native.ts file to see how it works

dull magnet
hollow yarrow
#

and I was thinking how it would be a bit hard to implement that in the browser

dull magnet
#

what dependency

#

link it

hollow yarrow
#

I haven't done that research yet

vast karma
#

Seems my Classify plugin is causing bugs in certain cases, for reasons I have yet to discern. Specifically:

  • TypingTweaks looks broken
  • Writing a code block in chatbox makes discord set style=height:0px, apparently something about the .slateTextArea being recreated
    Anyone know why this happens?
#

This is what it looks like with TypingTweaks

twin moat
#

is there a way to make a select option in a plugin's settings allow you to click more than one thing

#

or should I just use a ton of booleans

humble tulip
#

I'm not at my PC but if I remember correctly you need to pass an array of values to the select component and maybe(?) set the many prop to true which the current setting typing doesn't allow you to do, so I'd either modify the types to allow it or use the custom component option

#

It's been a while so I might be slightly talking out my ass

#

Actually yeah custom component would be needed because you need to store an array instead of a string

twin moat
humble tulip
#

You can use the same select component that the select option type does, you'd just have to manage the state yourself

twin moat
#

alright

azure fossil
#

i wonder

#

is there a plugin that could uwuify all of discord

#

or arbitrarily replace any text based on rules

#

not in messages you send

#

but in EVERY single text

humble tulip
#

I did that once via the i18n function, it was a mess

#

I think I just had it run the replace on the json with all the strings in it

twin moat
#

is there a way to patch html (not react)

#

and by that I mean the html sent in the initial request

dull magnet
twin moat
empty sundial
#

react is the html

humble tulip
#

You still have the initial html page the react app mounts to

tropic ice
empty sundial
tropic ice
#

probably related to the pr

empty sundial
#

Must have some ulterior motives

humble tulip
#

Probably a more direct version of this

#

Either way probably not a great move

hollow yarrow
#

Say I wish to find the module discord uses to receive new messages, how would I go about doing that?

#

I already tried doing this through the network tab of devtools, but with no luck since it's probably websocket based

#

Ohh i could look at the message logger source

#

Ah, the flux dispatcher!

empty sundial
#

yes, discord is built on the flux software architecture

#

everything sends an recieves events which do stuff/updates the ui

#

including sending and recieving messages those also go through the flux event system

pearl stag
#

Is there a way to subscribe to the settings store?

#

settings.store.property or settings.use(["property"]} don't seem to be reactive

humble tulip
#

I'm pretty sure settings.use should be

pearl stag
#

I can't seem to get reactivity (~or the variable at all~) to work. I'm probably missing something, since I'm not that familiar with React

    notificationAttribute: {
        type: OptionType.BOOLEAN,
        description: "Enables attribute text (Windows only, Anniversary Update required)"
    },
    notificationAttributeText: {
        type: OptionType.COMPONENT,
        component: props => {
            const { notificationAttribute } = settings.use(["notificationAttribute"]);

            return (
                <>
                    <Forms.FormText>Attribute status: {String(notificationAttribute)}</Forms.FormText>
                </>
            );
        },
        default: "{groupName}",
    },
bronze dove
#

make it a string

pearl stag
#

yup, just realized that

#

Reactivity still seems to not be working

#

oh the reactivity only seems to trigger when settings are applied

humble tulip
#

Yeah the store isn't updated until you hit save

#

For your use case you're better off just using one custom component for both

normal wagon
#

for ContextMenuApi.openContextMenuis there a way to move the context menu more upwards from the button itself

#

like the entire context menu because its not positioned to my liking based off of where the button location is

normal wagon
#

nvm

dull magnet
#

magic

#

use devtools to get the svg source and copy paste it into your code

#

you can webpack find it but it's not really worth it

quick zephyr
#

Is there a way to direct the client to a specific built-in page? I want to make a shortcut to getting to the quests menu. Scrolling past my 100 servers, clicking discover, then clicking quests is annoying.

hoary pilot
#

IconViewer plugin in #1256395889354997771 it has all icons and u can copy the findByCode to get the react component

#

@left plank kys

quick zephyr
quick zephyr
#

I'm trying but no clue how

#

ok got a button added to the toolbar. rn it just opens the link in my browser lol

#

gotta figure out navigation router now

dull magnet
#

isn't it literally

NavigationRouter.navigateTo("/discovery/quests")

quick zephyr
#

looks like transitionTo

#

omg it works

#

based

#

onClick={() => NavigationRouter.transitionTo("/discovery/quests")}

dull magnet
#

ye

quick zephyr
#

now to find somewhere else to put the button cause toolbar is not the place for it

#

can we add to the title bar in plugins?

#

seeing as debugger button is there id assume so

#

oh is that a discord thing not a vencord thing

dull magnet
#

vp VencordToolbox

shrewd tundraBOT
dull magnet
#

you can add to this menu

#

look how other plugins do it

#

(not many do)

quick zephyr
#

will do. thats what I did for toolbar. stole from merssage logger lol

#

uh

#

is that plugin out of date

#

cause it added the button to the right of the search box

#

not the title bar where the inbox is now

#

would be great if over half the components im looking at dont show a "Uncaught Error" message

dull magnet
#

what components

quick zephyr
#

idk im clicking around the title bar button components and the direct messages area components

#

those would be the two ideal spots for a new button imo

#

ah I can copy how read all messages handles that spot

dull magnet
#

the titlebar kinda sucks and not every vencord user has it

#

Also no one really complained about the location afaik

quick zephyr
#

NODDERS below DM button was my first choice

dull magnet
#

don't fix what ain't broken

quick zephyr
dull magnet
#

yes

#

you can add any component anywhere in the app (except discord overlay and iframes like Spotify or YouTube embeds (you can patch the frames too but it works differently))

quick zephyr
proud parrotBOT
# hoary pilot https://git.nin0.dev/userplugins/spotifyAddToQueue.desktop/src/commit/a57453a0dc...

native.ts: Lines 17-36

frame.executeJavaScript(`
    const interval = setInterval(() => {
        const actions = document.querySelector("[class^='PlayerControlsShort_playerControlsWrapper__']");
        if(actions) {
            const addToQueueButton = document.createElement("button");
            Object.assign(addToQueueButton.style, {
                position: "relative",
                top: "11px",
                left: "0px"
            });
            addToQueueButton.classList.add('gIjhme');
            addToQueueButton.title = "Add to queue";
            addToQueueButton.addEventListener("click", () => {
                window.top.postMessage("vc-spotifyaddtoqueue__" + location.href.match(/https:\\/\\/open\\.spotify.com\\/embed\\/track\\/([a-zA-Z0-9]{0,200})\\?/ )[1], "*");
            });
            addToQueueButton.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="32px" fill="#e3e3e3"><path d="M642.94-160q-47.94 0-81.44-33.56t-33.5-81.5q0-47.94 32.67-81.44Q593.33-390 640-390q15.97 0 30.48 3Q685-384 698-377v-343h182v71H758v375q0 47.5-33.56 80.75T642.94-160ZM120-320v-60h306v60H120Zm0-170v-60h473v60H120Zm0-170v-60h473v60H120Z"/></svg>';
            actions.insertBefore(addToQueueButton, actions.firstChild);
            clearInterval(interval);
        }
    }, 100);
dull magnet
#

why did u write it as a string instead of separate js file 😭

hoary pilot
#

idk lazy

quick zephyr
#

you know of any plugins other than read all that append to the server list

hoary pilot
#

can you even import js as text with EsBuild

quick zephyr
#

id like to append a full sized button, not one the size of the read all button

hoary pilot
#

i used to have userplugininstaller approve modal in a variable 😭

#

now it's in a txt file

dull magnet
#

(not esbuild feature, it's a plugin I wrote)

hoary pilot
#

oh i forgot that

#

?remind 6am do

fathom pivotBOT
#

Alright @hoary pilot, in 7 hours, 36 minutes and 36 seconds: do

dull magnet
#

it can import any file as text with the option to bundle and minify js & html or encode as base64

just... maybe don't try to import the entirety of vencord as a string please

quick zephyr
#

any way to ensure my button is placed above the read all button 🤔

dull magnet
#

rename your plugin to come earlier in the alphabet

quick zephyr
dull magnet
#

or make it start earlier via the startAt property

quick zephyr
#

oh yeah StartAt.Init worked

#

now to just figure out how to render an icon there instead of a blank void and it's done woot

dull magnet
#

but that will make your start() function run way earlier

#

not a problem if you don't have one

quick zephyr
#

I do

#

I copied readall's start and stop lol

#

they just call addServerListElement and removeServerListElement

dull magnet
#

oh right

#

well that's okay

#

just anything coming from discord won't be ready that early

#

like trying to use stuff from webpack commons

quick zephyr
#

luckily this is just a quick nav so shouldnt have any problems

dull magnet
#

it's related to a recent vencord change. use 127.0.0.1 instead of localhost

#

add native.ts file to your plugin

import the CspPolicies object

CspPolicies["example.com"] = [ "connect-src"]

build

restart discord fully to apply changes

#

why do you think you're rate limited

#

are you actually getting rate limit errors

#

127.0.0.1 is literally the same as localhost

#

can't really help you without knowing more

#

wdym not receiving?

#

log requests and response on both the client and the server and see where it's not working

#

are you only trying to fetch from local host or are you also using it to load images, etc?

dull magnet
#

why are you doing this with http have you never heard of a websocket 😭

#

you need to list every directive you want

#

googol

dull magnet
#

do you have the in app updater enabled

#

it will update your git repo

#

run git log

#

show what it says

#

wtf is that code

dull magnet
#

run git log and show

#

why are u asking for help then not doing what you're asked

#

can't help u then

#

so you did update yeah

#

okay now remove that code because it's plain wrong and then show any red errors in your devtools

#

then it has nothing to do with csp

#

your code is just broken then

#

there is no difference.

dull magnet
#

you can't

#

it will break eventually

#

it's such secret knowledge I literally told you how to

honest stump
#

vee GATEKEEPING csp rules..

swift delta
#

Its not that hard to white list a domain on a plugin

#

Make a native.ts file, Import the rule, and add your domain

hoary pilot
#

step 1: make native.ts file in ur plugin
step 2: import the CspPolicies in native.ts (vscode should suggest from where to import)
step 3: add this
CspPolicies["example.com"] = [ "connect-src"]
step 4: rebuild

#

oh and restart ur client

swift delta
hoary pilot
swift delta
hoary pilot
#

restart your client implies that

#

if i wanted you to refresh i'd say refresh discord

swift delta
#

It can also apply just press ctrl+r

hoary pilot
#

@swift delta i think you're insane

swift delta
dull magnet
#

do you know how to import a file in Javascript

#

import { CspPolicies } from "somewhere"

#

figure out what somewhere is

your ide will assist you

dull magnet
#

why did he delete all his messages lmao

normal wagon
quick zephyr
#

is there a way to listen to the router so I can detect when I navigate away from the quests page?

quick zephyr
#

hours of yelling at AI later... it finally got the html and css right

bronze dove
quick zephyr
#

I don't know enough about all of this. All I know is I had the HTML from dev tools for the DMs button and it is like 30 layers deep.

bronze dove
# quick zephyr ?

It's just not a good practice to mix and match react and html (unless absolutely required)

quick zephyr
#

the ? was less of a yeah why and more of a uuuh?? idk how I would do anything else??

hushed loom
#

oh god, send your plugin code

quick zephyr
#

the html for that button is 260 lines tho

#

has a ton of inline css

hushed loom
#

upload a gist

quick zephyr
#

:') im going to get crucified arent I

hushed loom
#

along with all their other components

quick zephyr
#

I did but it didnt look right

#

the text would never be bold and the height was always too short

#

no css would change how it looked

#

it didnt match the dms tooltip

hushed loom
#

that's something to ask here blobcatcozy

bronze dove
quick zephyr
#

lol

hushed loom
quick zephyr
#

I know enough to get the template made by yoinking other plugins and then telling the ai to convert the dms button html into a new button html lol

#

hardest part was getting the css

hushed loom
#

vibecoded vencord plugins are bad, more at 11

quick zephyr
#

idk it's doing exactly what I want it to do and looks 1:1 to the dms button

quick zephyr
#

making it stay highlighted while on the quests page

quick zephyr
hushed loom
#

you can just get them from their own code

quick zephyr
#

so the component for the dms button then?

#

where do I go about finding that

hushed loom
#

components tab

quick zephyr
#

no offense this is why I chose converting the dms button html into a new button cause the components tab is gibberish

hushed loom
#

theres a picker button

quick zephyr
#

ik

#

does not help

#

it's like a foreign language whatever is going on there

hushed loom
#

i made some plugins to demangle the names in the component tab (only works on some thing)

#

but its 4 am so i eep now

quick zephyr
#

no clue how I go from selecting the dms button to yoinking the entire thing, duplicating it, then changing the svg and its location

hushed loom
#

findComponentByCode

quick zephyr
#

ok I got the gist of it just can't figure out how to get any of this code to match smh

#

looking through other plugins and they all have super obvious code snippets but this thing im looking at os obfuscated to hell

#

added break point to try to inspect. no filters working. pain

vast karma
bronze dove
quick zephyr
#

that doesnt have a pill

#

I guess if I dont implement staying highlighted while on quests page it would be fine but I kinda want to try that

quick zephyr
bronze dove
bronze dove
quick zephyr
#

why does yours display correctly when you click on anonymous smh

#

mine shows a giant uncaught error screen

bronze dove
#

uh, try reloading or deleting the extension in the vencord settings dir

quick zephyr
#

which extension is it

bronze dove
#

the only one

quick zephyr
#

there's like 20 files in there

bronze dove
#

what

#

what directory are you in

quick zephyr
#

vencordsettings

bronze dove
#

vencord settings dir

#

the one were your settings are saved

quick zephyr
#

so pluginsettings

bronze dove
quick zephyr
#

reinstalled vencord still uncaught error. agony

bronze dove
#

reload

quick zephyr
#

ive reloaded a dozen times.

bronze dove
#

you can find the function from my screenshot

quick zephyr
#

thats for the add server button isnt it

bronze dove
#

and now that i look at, so does home button

quick zephyr
#

I always feel like im being talked to in riddles when asking questions on this server 😭

bronze dove
#

wait no thats a similar component my bad

bronze dove
#

works fine

quick zephyr
#

no pill sadge

#

can you show me the code for that cause no matter what I do I dont get that

bronze dove
#
const QuestIcon = findComponentByCodeLazy("10.47a.76.76");
const ServerListButton = findComponentByCodeLazy('ButtonListItem")');

function QuestButton() {
    return (
        <ErrorBoundary>
            <ServerListButton
                selected={true}
                icon={QuestIcon}
                onClick={() => {
                    console.log("clicked");
                }} />
        </ErrorBoundary>
    );
}
quick zephyr
#

ok im noticing now my biggest issue is I keep inspecting the ListItem

#

when I should be inspecting the child

#

ugh but then I need to get the pill and the icon separately

#

and the pill gives me an uncaught error imma just punch my monitor

#

since reinstalling my userplugins dont show up in plugins omg why is everything going wrong??

bronze dove
#

how did you reinstall

quick zephyr
#

finally I just reinjected again and they're there

quick zephyr
bronze dove
#

like that?

quick zephyr
#

yeah but also not 24/7 blurple only when highlighted

bronze dove
#

i just hardcoded for testing

quick zephyr
#

and it should only be that big if you "enter" that area

#

highlighting is height of 20 while active its 40

quick zephyr
#

you said vencord settings but then what

bronze dove
#

what about the extension cache

#

i think it was updated a couple weeks back i think it had problems?

quick zephyr
#

1 folder in there

fathom pivotBOT
#

@hoary pilot, <t:1749263004:R>: do

quick zephyr
#

delete the whole cache or the folder in there

bronze dove
#

doesnt matter

humble tulip
#

What's the uncaught error?

bronze dove
#

sometimes the error happens to me too but reloading works

quick zephyr
#

ok automod thanks

#

sorry for spamming I guess smh

#
The error was thrown at exports.inspectHooksOfFiber (chrome-extension://aogahicjhfggocdollfpcdpjfhlhbjfh/build/react_devtools_backend.js:14260:33)
    at inspectElementRaw (chrome-extension://aogahicjhfggocdollfpcdpjfhlhbjfh/build/react_devtools_backend.js:8954:65)
    at Object.inspectElement (chrome-extension://aogahicjhfggocdollfpcdpjfhlhbjfh/build/react_devtools_backend.js:9237:38)
    at chrome-extension://aogahicjhfggocdollfpcdpjfhlhbjfh/build/react_devtools_backend.js:11584:56
    at Bridge.emit (chrome-extension://aogahicjhfggocdollfpcdpjfhlhbjfh/build/react_devtools_backend.js:4192:18)
    at chrome-extension://aogahicjhfggocdollfpcdpjfhlhbjfh/build/react_devtools_backend.js:4838:14
    at listener (chrome-extension://aogahicjhfggocdollfpcdpjfhlhbjfh/build/react_devtools_backend.js:13163:9)
#

then another larger block below this one

#

ok deleting extension cache removed the components tab

#

fun

#

where do I enable that again

bronze dove
#

itll get redownloaded when you restart

humble tulip
#

Yeah and then you probably have to refresh after the restart as well for it to load

quick zephyr
#

I already rebuilt and restarted

humble tulip
#

Bit annoying

quick zephyr
#

ok reinjecting fixed it

#

no more uncaught error blessed be

#

it's perfect

#

damn it really is impossible to get the dms button isnt it

#

lame

bronze dove
# bronze dove like that?

right the code for that was, if you want it to be smaller when hovered, set hovered to true on the pill but you need to make the hovering logic yourself with onMouseEnter etc

const ListItemContainer = findComponentByCodeLazy("listItem,ref");
const Pill = findComponentByCodeLazy('animate-always":"', "wrapper");

function QuestButton() {
    return (
        <ErrorBoundary>
            <ListItemContainer>
                <Pill selected={true} />
                <ListItem
                    selected={true}
                    icon={QuestIcon}
                    onClick={() => {
                        console.log("clicked");
                    }} />
            </ListItemContainer>
        </ErrorBoundary>
    );
}
quick zephyr
#

where'd you get ListItem from

bronze dove
#

its renamed serverlistbutton

quick zephyr
#

hm it's still stuck perma selected and has a left margin but not bad

bronze dove
#

ok so change it?

#

it selected because i set it to be selected always

quick zephyr
#

figured that out ye. im looking at the random extra margin it has rn

bronze dove
#

oh right

quick zephyr
#

it's the styling on the pill I think

#

tries setting style on it but it didnt do anything hm

bronze dove
#

oh hmm its the containers fault but without it the pill doesnt show

#

maybe youll figure it out

quick zephyr
#

I think your nesting is a bit off. w/e it's nearly 4am ill figure it out tomorrow. thanks for the help

bronze dove
#

might be idk

silk sorrel
#

What's the correct way to import components that might not yet be loaded when used?
I saw waitForComponent being used internally by Vencord but idk what the name parameter should be

empty sundial
#

wait i misunderstood the question

silk sorrel
#

That's what I use right now, but it occasionally throws when the module isn't loaded

bronze dove
#

You'll need to load the module then

#

Search for extractandload

quick zephyr
# bronze dove oh hmm its the containers fault but without it the pill doesnt show
const QuestIcon = findComponentByCodeLazy("10.47a.76.76");
const ListItemContainer = findComponentByCodeLazy("listItem,ref");
const ServerListButton = findComponentByCodeLazy('ButtonListItem")');

function QuestButton() {
    const [isHovered, setIsHovered] = React.useState(false);
    const containerRef = React.useRef<HTMLDivElement>(null);
    let pillFixed = false;

    React.useEffect(() => {
        if (!pillFixed && containerRef.current) {
            const pill = containerRef.current.querySelector('[class*="pill"]');
            const wrapper = pill?.querySelector('[class*="wrapper"]');
            pill?.classList.add(wrapper ? wrapper.className : "pillWrapper");
            pillFixed = true;
        }
    }, []);

    return (
        <ErrorBoundary>
            <div ref={containerRef}>
                <ListItemContainer
                    onMouseEnter={() => setIsHovered(true)}
                    onMouseLeave={() => setIsHovered(false)}
                >
                    <ServerListButton
                        onClick={() => { console.log("Quick Quests button clicked!"); }}
                        icon={QuestIcon}
                    >
                    </ServerListButton>
                </ListItemContainer>
            </div>
        </ErrorBoundary>
    );
}

Got it workingish™️. Ideally the hierarchy of the DMs button .pill__1f388 .wrapper__58105 > (new pill created dynamically on hover) would be used so if anyone can figure out how to get the DMs button component that'd be neat.

But until then, I used the Discover component which weirdly has a pill hierarchy of .pill__5bc7e > .wrapper__58105 (child instead of same element) so I had to dynamically load the child's wrapper class onto the parent. That makes it work. Deleting the child wrapper breaks it, so just not gonna do that lol.

Not ideal but Shrug Now to just figure out the tooltip. But that's tomorrow me's problem.

humble tulip
#

Tooltip's nice and easy, you just wrap your component with the Tooltip component and pass it a text prop

quick zephyr
#

yeah but when I did it earlier it didnt look the same as the dm tool tip agony

humble tulip
#

Tomorrow you's problem thumb

#

I'd try TooltipContainer as well, I don't remember what the difference is but maybe it'll work better

quick zephyr
#

which part do I wrap in tooltip cause it keeps yelling at me

bronze dove
#
<ListItem
  icon={QuestIcon}
  tooltip="banana" />
quick zephyr
#

oh so I dont wrap it in a tooltip thing

bronze dove
#

no need

humble tulip
#

Convenient

quick zephyr
#

oh yeah that looks perfect now

#

svg maybe a tad small

#

any way I can up its scale 🤔

bronze dove
#

look at the icons props

quick zephyr
#

if I was using the raw svg sure but I have the component from lazy finding it

dull magnet
#

make sure it's always loaded when you try to use it

#

what component is it

silk sorrel
dull magnet
#

oh