#🧩-plugin-development

1 messages Β· Page 67 of 1

inner pawn
#

it looks like a discord attachment

#

except idk what downloadUrl is

inner pawn
#

what function is suggested for stickerstore grabbing for a js snippet?

flint bronze
#

have you tried findStore

#

It's the same thing but returns instantly instead of doing a lazy proxy

inner pawn
#

looks a little better

flint bronze
#

alternatively, if you have ConsoleShortcuts enabled there is a global Stores variable you can use

inner pawn
#

Vencord.Webpack.findStore("StickersStore").getRawStickersByGuild()

#

ah I found it thank you

#

this is a little weird though:

#

Vencord.Webpack.findStore("StickersStore").
getStickersByGuildId("1015060230222131221")
found it

inner pawn
inner pawn
#
async function ZipStickerEmojis(serverId) {
  // Fetch fflate library (consider using a bundler for production)
  await fetch("https://unpkg.com/fflate@0.8.0").then(r => r.text()).then(eval);

  const stickers = Vencord.Webpack.findStore("StickersStore").getStickersByGuildId(serverId);

  if (!stickers) {
    console.log("Server not found!");
    return; // Early exit if server not found
  }

  const fetchSticker = async (sticker) => {
    let filenameSuffix;
    switch (sticker.format_type) {
      case 1: // png
        filenameSuffix = ".png";
        break;
      case 2: // apng (treated as png)
        filenameSuffix = ".png";
        break;
      case 3: // lottie
        filenameSuffix = ".json";
        break;
      default:
        console.warn(`Unknown format type: ${sticker.format_type}, using .png ${sticker.id}`);
        filenameSuffix = ".png";
    }

    const filename = sticker.id + filenameSuffix;
    const stickerBlob = await fetch("https://cdn.discordapp.com/stickers/" + filename + "?size=512&quality=lossless").then(res => res.blob());

    return { file: new Uint8Array(await stickerBlob.arrayBuffer()), filename };
  };

  const stickerPromises = stickers.map(fetchSticker);

  try {
    const results = await Promise.all(stickerPromises);
    const stickersZip = fflate.zipSync(Object.fromEntries(results.map(({ file, filename }) => [filename, file])));
    const blob = new Blob([stickersZip], { type: "application/zip" });

    const link = document.createElement("a");
    link.href = URL.createObjectURL(blob);
    link.download = `stickers-${serverId}.zip`;
    link.click();
    link.remove();
  } catch (error) {
    console.error(error);
  }
}

await ZipStickerEmojis("1015060230222131221");

a lot of ccess to fetch at 'https://cdn.discordapp.com/stickers/1278788623243804682.png?size=512&quality=lossless' from origin 'https://discord.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

inner pawn
#

I don't really know what the issue Is rn

#

Is this is a discord site issue?

cedar olive
inner pawn
cedar olive
#

it doesn't

#

findStoreLazy returns a Proxy which is used to make it lazy

#

let me show you

hushed loom
#

how the fuck would i patch function R in module 219797

cedar olive
#

as you can see cached is undefined

vast karma
#

With surgical precision

cedar olive
#

there's the value and all the methods

cedar olive
#

well it has content_type so use it so differ from the other

hushed loom
#

ty

vast karma
#

That's not json

inner pawn
boreal vessel
#

i like never use json codeblocks discords json codeblocks look so ass xd

inner pawn
#

Ah

#
async function ZipStickerEmojis(serverId) {
  // Fetch fflate library (consider using a bundler for production)
  await fetch("https://unpkg.com/fflate@0.8.0").then(r => r.text()).then(eval);

  const stickers = Vencord.Webpack.findStore("StickersStore").getStickersByGuildId(serverId);

  if (!stickers) {
    console.log("Server not found!");
    return; // Early exit if server not found
  }

  const fetchSticker = async (sticker) => {
    let filenameSuffix;
    switch (sticker.format_type) {
      case 1: // png
        filenameSuffix = ".png";
        break;
      case 2: // apng (treated as png)
        filenameSuffix = ".png";
        break;
      case 3: // lottie
        filenameSuffix = ".json";
        break;
      default:
        console.warn(`Unknown format type: ${sticker.format_type}, using .png ${sticker.id}`);
        filenameSuffix = ".png";
    }

    const filename = sticker.id + filenameSuffix;
    const stickerBlob = await fetch("https://cdn.discordapp.com/stickers/" + filename + "?size=512&quality=lossless").then(res => res.blob());

    return { file: new Uint8Array(await stickerBlob.arrayBuffer()), filename };
  };

  const stickerPromises = stickers.map(fetchSticker);

  try {
    const results = await Promise.all(stickerPromises);
    const stickersZip = fflate.zipSync(Object.fromEntries(results.map(({ file, filename }) => [filename, file])));
    const blob = new Blob([stickersZip], { type: "application/zip" });

    const link = document.createElement("a");
    link.href = URL.createObjectURL(blob);
    link.download = `stickers-${serverId}.zip`;
    link.click();
    link.remove();
  } catch (error) {
    console.error(error);
  }
}

await ZipStickerEmojis("1015060230222131221");
#

Fixed

#

I'm not sure why grabbing stickers grabs where

inner pawn
#

I could move onto try to making my suggestion.
The group dm thing.

I need to learn how to override the options and how I'll display it
I could probaly use my java knowledge to help with this
Essentially I need to an option to here:

https://media.discordapp.net/attachments/1281773217102434385/1282355880473526312/image.png?ex=66df0e7a&is=66ddbcfa&hm=381c9d0687fa4c9993b93d7251bf1f44e0d095e99ff0336b8d7d7f93b3e7445a&=&format=webp&quality=lossless&width=383&height=388

then list it like the friend menu

i figure a plugin itself won't just allow me to add a button

inner pawn
#

so how does one inject stuff into the ui element?

empty sundial
#

Patches

inner pawn
#

do you have an example of patches?

vast karma
#

Check literally any plugin

inner pawn
#

I mean a ui patch

vast karma
#

Yes, there's quite a lot of plugins that change the ui

proud parrotBOT
inner pawn
vast karma
#

Regex replace

inner pawn
vast karma
#

You find the code that does what that component does, and you replace it with code that does what you want it to do

inner pawn
#

I am looking to essentially have a copy of friends but with no organization and I plan on grabbing the group chat symbol from the group chat section i.e. the one that closes and reopens the view members section

#

so basically the members show on and off

#

Like that except without the add button

inner pawn
inner pawn
hushed loom
#

guhhhhh does anyone know wny discord cdn 403's

#

link works fine in browser

flint bronze
#

probably browser cache and the signed link expired?

amber basin
#

0 width 0 height?

hushed loom
#

found the answer

#

0w0h

flint bronze
#

husk

amber basin
#

yop

flint bronze
#

oh

#

that totally makes sense

#

wrong error code though

amber basin
#

yeah i dont know why thatd 403

#

stupid

hushed loom
flint bronze
#

shouldnt that return a 400 error or something like it

amber basin
#

???

hushed loom
amber basin
#

try loading it in a browser

#

id assume wrong expiry token

hushed loom
#

it wont load with any of these
&format, &width, &height

#

if i remove them all it loads

amber basin
#

odd

hushed loom
#

in browser

#

i think im giving up on avif rendering

#

*apng not avif

inner pawn
#

So I couldn't zip sticker snippet

inner pawn
# hushed loom in browser

could you give me example how the vencord patches work?
Like how does one grab what to replace or copy?

hushed loom
inner pawn
#

I mean I know what I want to patch just not how to generate the thing necessary for it

hushed loom
#

please, for the love fo god, try to do things on your own

#

its a tab in settings

tropic ice
#

use build --dev i believe

hushed loom
#

@tropic ice off topic but you can get contrib role if you do vgh

tropic ice
#

vgh?

hushed loom
#

venbot command

#

just type vgh

tropic ice
#

oh

#

wow im so epic

inner pawn
#

I have a general idea what the html looks like too

tropic ice
#

what are you trying to make?

inner pawn
tropic ice
#

turn on react devtools, and click there and find the code that adds those buttons

#

maybe look at PinDMs

#

I think that's patching where you want probably?

#

not positive though
i'm not very good at finding the place to patch, and i need to do some stuff

inner pawn
#
<li class="channel_c91bad container_d91ad9" role="listitem" aria-posinset="1" aria-setsize="278"><div class="interactive_f5eb4b interactive_c91bad linkButton_c91bad interactiveSelected_c91bad selected_f5eb4b"><a class="link_c91bad" data-list-item-id="private-channels-uid_18___friends" tabindex="-1" href="/channels/@me"><div class="avatarWithText_c91bad layout_ec8679"><div class="avatar_ec8679"><svg class="linkButtonIcon_c91bad" aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="currentColor" d="M13 10a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z" class=""></path><path fill="currentColor" d="M3 5v-.75C3 3.56 3.56 3 4.25 3s1.24.56 1.33 1.25C6.12 8.65 9.46 12 13 12h1a8 8 0 0 1 8 8 2 2 0 0 1-2 2 .21.21 0 0 1-.2-.15 7.65 7.65 0 0 0-1.32-2.3c-.15-.2-.42-.06-.39.17l.25 2c.02.15-.1.28-.25.28H9a2 2 0 0 1-2-2v-2.22c0-1.57-.67-3.05-1.53-4.37A15.85 15.85 0 0 1 3 5Z" class=""></path></svg></div><div class="content_ec8679"><div class="nameAndDecorators_ec8679"><div class="name_ec8679">Friends</div></div></div></div></a></div></li>

This the html to that

inner pawn
cedar olive
#

you first need a basic knowledge of how the core of Vencord works, because it has nothing to do with the actual html

inner pawn
proud parrotBOT
rose fiber
inner pawn
#

I have read that a few vencord guide times

muted terrace
#

wait wtf

#

is MessageActions.getSendMessageOptionsForReply(reply) broken nvm i broke a thing

vast karma
#

For some reason pnpm lint just prints > eslint and quits

#

Why is it doing that

empty sundial
#

eslint shouldnt have output except on errors..?

vast karma
#

Yeah but it doesn't show anything even if I have blatant syntax errors

#

In another clone of the repo it prints > eslint . --ext .js,.jsx,.ts,.tsx --ignore-pattern src/userplugins and actually does something

#

Oh, just needed to pnpm install to update shit

empty sundial
#

😭

vast karma
#

I'm also getting this annoying box when running in injected discord-desktop

#

Pretty sure I've solved that before, but I don't remember how

empty sundial
#

_breadcrumbs is not iterable = install openasar

vast karma
#

That worked, thanks

#

(Hope I don't get vns'ed for this)

shrewd tundraBOT
mental haven
#

looks like I made it. to hide the Activity Feed on member list

#

using the interceptor concept I brought up before and haven't worked on for a month,

#

tbh I don't know how to modularize the plugin/index.ts into several files to handle their own things, but one thing I did to test is by putting interceptor somewhere outside the plugin/index.ts so I can read the plugin flow properly and make interceptor to actually works to stop an event from triggering, this includes CONTENT_INVENTORY_SET_FEED

rose fiber
safe glade
#

leaves the header but that can be hidden with shrimple css

iron epoch
#

how can you tell the server is public with information like this?

{
    "state": "RESOLVED",
    "code": "VHdRKhAt",
    "guild": {
        "id": "1015060230222131221",
        "name": "Vencord Vendor Venniecord",
        "splash": "cde86c118094beb5fa378d4b07584195",
        "banner": "a_a42646da37160e4053f1823649177f0a",
        "description": "Vencord is an extremely cute mod for the Discord desktop & web apps, offering support for plugins and themes",
        "icon": "6f998a9581a74ef1bbadae0e904e5958",
        "features": [
            "GUILD_ONBOARDING",
            "COMMUNITY",
            "PRIVATE_THREADS",
            "MEMBER_PROFILES",
            "CHANNEL_ICON_EMOJIS_GENERATED",
            "PREVIEW_ENABLED",
            "WELCOME_SCREEN_ENABLED",
            "GUILD_ONBOARDING_EVER_ENABLED",
            "ENABLED_DISCOVERABLE_BEFORE",
            "THREE_DAY_THREAD_ARCHIVE",
            "BANNER",
            "GUILD_SERVER_GUIDE",
            "GUILD_WEB_PAGE_VANITY_URL",
            "SOUNDBOARD",
            "ANIMATED_ICON",
            "SEVEN_DAY_THREAD_ARCHIVE",
            "AUTO_MODERATION",
            "ANIMATED_BANNER",
            "INVITE_SPLASH",
            "ROLE_ICONS",
            "DISCOVERABLE",
            "VANITY_URL",
            "NEWS",
            "CREATOR_ACCEPTED_NEW_TERMS",
            "GUILD_ONBOARDING_HAS_PROMPTS"
        ],
        "verification_level": 3,
        "vanity_url_code": "vencord",
        "nsfw_level": 0,
        "nsfw": false,
        "premium_subscription_count": 48
    },
    "channel": {
        "id": "1039585467584229479",
        "type": 0,
        "name": "moderator-only"
    },
    "inviter": {},
    "approximate_member_count": 73647,
    "approximate_presence_count": 19846,
    "expires_at": "2024-09-18T08:48:40+00:00",
    "type": 0,
    "flags": 2
}
iron epoch
iron epoch
#

discord is weird. the top one is discord web and the second one is desktop like why? misjudged

#

wait, does the embed change based on the inviter?

#

oh it does. it displays the channel if you are the inviter or the member count if you are the receiver

unkempt kindle
#

can I somehow find out the max length of a message the user can send? (a value that will always be right no matter when discord changes it or if the user suddenly gets nitro)

dull magnet
#

UserStore.getCurrentUser().premiumType ? 4000 : 2000

vast karma
#

There's a module that looks like ```js
function (e, t, n) {
"use strict";
n.d(t, { Z: function() { return o; }, });
var r = n(442837),
i = n(594174),
a = n(74538),
s = n(981631);
function o() {
return (0, r.e7)([i.default], () => a.ZP.canUseIncreasedMessageLength(i.default.getCurrentUser())) ? s.en1 : s.J6R;
}
};

#

But I don't know how you'd find that module programmatically, there's very little distinctive code to target

#

I guess it might not be too bad if you can use regex finds

dull magnet
#

i would just hardcode

vast karma
#

Yeah, it's not likely to change particularly often

dull magnet
#

it's way more likely for discord to change that function than to change the message size limit

#

it has never changed

hushed loom
pale heart
#

how can i get the list of all experiment (local) overrides

#

nevermind

rocky falcon
pale heart
#

yes

normal wagon
#

i'm trying to create something to automatically start a stream. every time i join a vc the issue is im unable to locate the function to even intiate that event i've come across fucntions like self_stream and whenever i call it it's prompting an error message

#

almost as if i'm missing paramaters am i missing something or is this just not possible on desktop client?

#

in short: what's the function used for starting streams on discord?

tropic ice
#

try following this pinned video

#

make sure react dev tools are enabled

normal wagon
#

its only for the back button idk if i'm doing something wrong

iron epoch
#

how could I jump to a channel?

balmy sky
#

Navigationrouter

#

Iirc

mental haven
#

the toggle still shows ACTIVITY group above topmost members

#

I think as side-effect of my plugin no more activity to show up on friends list πŸ€” (like I would see those anyway)

quaint cipher
flat plover
#

@hushed loom hi im trying to implement your suggestion but the arguments doesnt seem to have what i need (checked prop of each Item of Menu)

#

arguments

#

and function im patching

#

I logged Object.keys of arguments[0] and got
["closePopout"]

hushed loom
flat plover
#

sure, thank you

iron epoch
#

!remind 2hr stabilize guild lurk snippet

fathom pivotBOT
#

Alright @iron epoch, in 2 hours: stabilize guild lurk snippet

iron epoch
#

almost done, give me your opinions

swift delta
normal wagon
#

i think you should definitely do something about that join button because it’s spaced out quite alot idk

#

maybe increase the width it might make it look ugly though so probably just tamper around with it until it looks appealing i guess

normal wagon
#

sorry, creating a stream d_cat_hi

flint bronze
iron epoch
flint bronze
#

@iron epoch Can you share a link to your code?

swift delta
flint bronze
iron epoch
#

give me a sec

#

@flint bronze ^

flint bronze
#

ok

#

quick code review: so much hardcoded stuff

#

change the find and the obvious first line of css

#

wait

#

@iron epoch can you DM me an invite you made?

#

just stock?

#

i might have DMs off hold on

vast karma
#

replace: "$1:$2 || GuildStore.getGuild(arguments... will only work if you have ConsoleShortcuts

flint bronze
#

ok time to clean this code up

iron epoch
flint bronze
#

im gonna fix your find that will break if blindly fixed or left too long

iron epoch
#

alr. keep me updated

iron epoch
#

!reminder 1hr continue

fathom pivotBOT
#

Alright @iron epoch, in 1 hour: continue

fathom pivotBOT
#

@iron epoch, <t:1726131160:R>: continue

azure fossil
#

i have an idea for a plugin, but idk how hard it is
basically validchannels
validreply seem simple and i would guess it's similar to it ?
but valid user seem more complicated and still similar...

flat plover
#

i thought, an unknown channel = you actually can't access it
except for archived threads sometimes

vast karma
#

If someone links to a channel in a public guild you're not a member of, it'll show up as #unknown until you click it

dull magnet
#

not really useful cause u can just click the mention

#

if you can access it will load it

flat plover
balmy sky
#

How do i make a container scroll vertically when it overflows? (with discord styles) i tried putting my elements as a child of a ScrollerThin but there's no visual difference

#

Maybe i need to pass extra props or something i'm not sure

#

Nvm i'm just stupid blobcatcozy

flat plover
unkempt kindle
flat plover
#

but I think the ShowHiddenThings plugin already does that

bronze dove
flat plover
#

oh wait

dim isle
#

ty AppleMusicRichPresence πŸ™ time to fix this

dull magnet
dim isle
#

lets see if it works

#

doesn't fix my problem but ig it's kinda better

flat plover
iron epoch
#

!reminder 1hr format ISO8601 timestamps for BetterInvites

fathom pivotBOT
#

Alright @iron epoch, in 1 hour: format ISO8601 timestamps for BetterInvites

normal wagon
#

can somebody help me find the function to start a stream on discord?

#

i’ve tried using react dev tools still unable to find it and i think it requires certain parameters can someone help me please

azure fossil
azure fossil
fathom pivotBOT
#

@iron epoch, <t:1726183525:R>: format ISO8601 timestamps for BetterInvites

normal wagon
#

in the original one it showed who created the invite idk if you removed that

warm wolf
#

somehow the official docs seem to not be linked anywhere from the vencord/vesktop githubs nor websites

dull magnet
#

because it's not done

warm wolf
#

icic

#

been reading through it and its actually really really good docs so πŸ‘ keep pogging, etc etc

iron epoch
flint bronze
#

the avatar is too big?

#

make it... 16px?

#

unless that is 16px already

iron epoch
#

what about this size?

flint bronze
#

it's... perfect

#

i want to see the code

normal wagon
#

add option to add banner in invite when sending

#

like optional on whether you want that enabled or not

flint bronze
#

not possible*

iron epoch
flint bronze
#

*unless you want to add ugly query parameters

flint bronze
#

because banners are a server boosting thing that are always shown if sent

such an option would only work for people using the plugin

iron epoch
#

only if like client side

iron epoch
flint bronze
#

screenshitting

craggy phoenix
#

Is there an api for patching the butttons on a file attachment as well? There looks like there is one for the MessagePopover, but not the ones for the attachments, maybe I'm missing something though

dull magnet
#

there isn't no

craggy phoenix
#

K so custom patch it is then I guess

dull magnet
craggy phoenix
#

The way vencord does its patches is so foreign to me lol... definitely not used to that replacement/match object thing

dull magnet
#

it's literally just regex replace on the code xD

#

if you know regex you're halfway there

craggy phoenix
#

Yeah no I get the concept, its just not how I'm used to doing it

#

The patch helper looks useful though

dull magnet
#

i like it way better than monkeypatching

craggy phoenix
#

Fair enough

dull magnet
#

no more monkeypatching, digging through react trees, having to do cursed workarounds when stuff isn't exported, etc

#

and perf πŸ“ˆ

#

and access to local variables blobcatcozy

flint bronze
flint bronze
#

wait what

#

does this mean the shitty spotify hardcoded code is GONE

#

FOR GOOD

dull magnet
#

the fact that advaith who's literally just an intern is fixign all these things that have been bugging people for ages in such short amount of time

#

wtf do the other devs do

flint bronze
#

make shitty things like content inventory email service

#

that users will complain on r/discordapp about

#

yes, discord will email your friends when you start playing games now

#

what a horrible update

dull magnet
#

wow I've been at Discord for a week! It's been really fun!

here's some stuff I've done:

  • added gif favoriting to mobile!
  • added copy id buttons to desktop emoji & sticker pickers
  • added the convert emoticons setting to mobile
  • many bug fixes, including mobile padding issues
#

one fucking week

hoary pilot
#

took him one week to make discord better

shrewd tundraBOT
hoary pilot
swift delta
hoary pilot
swift delta
hoary pilot
fallen sandal
#

HOLY SHIT WE ARE BARRACK

tropic ice
fallen sandal
fallen sandal
fallen sandal
iron epoch
#

@hoary pilot #1266479667561369740 can't Constants.Endpoints.GUILD_ROLE_MEMBER_IDS be used instead of checking the cache? or you just keeping it safe?

frigid knot
hoary pilot
dull magnet
#

can u play apple music with time bar

#

oh u did thanks

#

nope gone again

#

huh it doesnt show two for me

#

we could maybe add time bar to lastfm rich presence too then

dull magnet
#

so bad

#

so bad, it only returns extra info about the artist

#

okay kill yourself lastfm

#

nvm it does work on more popular song

#

guh i discarded my work already

craggy phoenix
#

To submit a plugin I just open up a PR right? Or is there an extra step involved?

normal wagon
#

to my knowledge i thought that was temporarily closed recently

#

because of all the useless requests

craggy phoenix
#

No I mean genuinely submit the code of a functioning plugin, not just a request lol

vast karma
#

Plugin requests were closed because they sucked

normal wagon
vast karma
#

Contributing plugins is fine I'm pretty sure (but obviously not everything is accepted)

normal wagon
#

it’s something i intend on working on

#

i just don’t know whether i’ll be able to do it

kind pike
normal wagon
kind pike
vast karma
#

Big fan of ctrl-v

craggy phoenix
#

Yeah I just made a pr lets see what happens

dull magnet
#

also wow looks really good based on a very quick skim

#

you definitely know your stuff steamhappy

frigid knot
#

sibling im unsure

#

but parent I think you just use the parent selector

craggy phoenix
#

So I just got feedback on my Pr that I can use agruments[0] to get variables or something?

So I tried

{
  find: "Messages.IMG_ALT_ATTACHMENT_FILE_TYPE.format",
  replacement: {
   match: /(newMosaicStyle,\i\),children:\[)(.+?\])/,
   replace: "$1$self.renderPreviewButton(arguments[0]),$2"
  }
}

But then the printed argument is something pretty useless, I think its like the entire module?
I would need the actual attachment/message object... I'm not really sure how that arguments thing is supposed to work, maybe my regex is matching something in the wrong scope i dont really know

#

Can someone help me out as to what I'm doing wrong?

hushed loom
bronze dove
#

It should work there where they are patching

craggy phoenix
#

Like the entire thing

bronze dove
#

Screenshot of where that renderPreviewButton is

craggy phoenix
#

The arguments I need are above that

#

That's why I had a weird group matching at first to get these variables

bronze dove
bronze dove
#

They are for webpack/module stuff we dont care about

craggy phoenix
#

Then I guess my previous match didn't do what I wanted anyway

bronze dove
craggy phoenix
bronze dove
#

πŸ€” i dont think it should

craggy phoenix
#

So this prints the {id:..., loaded:true etc.} thing

#

Here you may be able to see it better in debug

bronze dove
#

huh

bronze dove
#

then it is my fault

craggy phoenix
#

Ok so then I try to match the arrow function to get the varible from there? Or maybe when the parameter gets destructured?

iron epoch
#

is it really worth it to add a patch to modify an element style when I can do

h3[class^="h5"]:has([class="vc-bi-header-inner"]) {
    display: flex;
    margin: 0 !important;
}
bronze dove
craggy phoenix
#

Ah cool thanks... thats like a positivie lookbehind or something right? Wouldn't have thought of that...

bronze dove
#

Yeah

#

Very useful

warm wolf
#

having trouble trying to get devtools working for vesktop, react is enabled in settings

#

ill just use website for now but does anyone have any tips?

#

ah i remember why i didnt use website. i dont have vencord set up

frigid knot
# warm wolf

yeah silly it's because discord uses 100% svelt now (NOT TRUE)

quaint cipher
#

would it be OK to make a PR that adds role color to these for RoleColorEverywhere

hushed loom
#

how would you get the image out of a command

#

the args parameter just has 0 as the value

#

also why is the command sending in chat

#
        {
            name: "testcommand",
            description: "testint123",
            options: [{
                type: ApplicationCommandOptionType.ATTACHMENT,
                name: "testimgarg",
                description: "guh",
                required: true
            }],
            execute(args, ctx) {
                console.log(args, ctx);
            },
        }
dull magnet
#

look at petpet

#

u have to get it from the store

warm wolf
warm wolf
#

idk, might just leave it to time and others; i should be doing hmwk instead πŸ’€

hushed loom
hushed loom
balmy sky
#

How do i get a callback whenever the user tabs into a channel? i thought it might be a flux event but i don't feel like looking through the 111 channel events

bronze dove
empty sundial
#

also you can just subscribe the event "EVENT" to a console log and then do the action you want the event for

#

iirc anyway

#

if not just add an interceptor with a console log

flint bronze
flint bronze
#

@dull magnet sorry i accidentally fell asleep in the middle of the day, do you think adding the timeout details popout to the members page is a good idea

#

how about oversimplifying the regular timeout tooltip to look like the one in the members page

cedar olive
#

that and maybe right click to show the reason

#

then u just replace the entire tooltip with the reason

#

or left click

flint bronze
#

clicking that does the same thing as clicking anywhere else on the row

vapid oar
#

yippee

vapid oar
muted thunder
#

i was wondering how i can make images not expire

alpine grove
#

iirc there is an endpoint to refresh the links tho

muted thunder
#

i think i might need that endpoint

alpine grove
muted thunder
flat plover
#

how do you get value of a field? not rawValue (if i understand correct theyre both diff things)
or a way to convert these strings into unicode enojis?

flat plover
normal wagon
muted thunder
normal wagon
#

because there's tabs also

muted thunder
#

I wasn't the original creator but ywah

normal wagon
#

my way of saving images was uploading it to my own server, using my discord-bot and then grabbing the URL from uploading and putting that within the embed

#

that was for avatars / banners since when the user changed their pfp it would make it load indefinitely and not display an image anymore

#

idk its been months and the image is still there i don't know when a image expires though

hushed loom
#

is there a store for user statuses

#

cant manage to find one

unkempt dove
#

how could i open a DM with a user ID using vencord's apis?

hushed loom
#

i forget how off the top of my head

muted thunder
hoary pilot
iron epoch
iron epoch
#

the dislikes SKULL_SKELETON

twin moat
#

is this an error in my code or is it something else?

dull magnet
#

error in ur code

#

you're using react at the top level

hushed loom
dull magnet
#

dont spoonfeed too hard

#

just use react devtools on the private message button in context menu / profile

#

and you will find the handler and what it does

#

and figure it out from there

#

idk why i highlighted onClose

#

you need action

unkempt dove
hushed loom
#

is it possible to add a custom menu item to vencord-toolbox instead of just a string via toolboxActions in plugindef

dull magnet
#

nop

hushed loom
# dull magnet nop

might have phrased that incorrectly
is it possible at all
doesnt have to be via plugin def

iron epoch
tropic ice
#

I (well the person that told me how to do this) was able to do it with toolboxActions

tropic ice
iron epoch
#

what should be the name of plugin that allows you to save your status?

gloomy terrace
#

StatusPresets (?)

iron epoch
gloomy terrace
iron epoch
#

what's stopping me from patching? SKULL_SKELETON

vast karma
#

Your guilty conscience

cedar olive
#

that works πŸ˜‚

hushed loom
cedar olive
normal wagon
#

or SaveStatus

#

or BetterStatus

hushed loom
#

If I can get it to work I'll post it

cedar olive
#

is it js magic tricks

humble tulip
hushed loom
#

horror

rocky falcon
#

how would one patch the function to check if a message should notify you?

#

I don't even know what to be looking for

hushed loom
#

flux events, maybe

#

also maybe XSoverlay has something

#

you also have the inbox tab

flint bronze
rocky falcon
flint bronze
#

latter

#

it's not properly typed to my knowledge

#

effectively you can use FluxDispatcher.addInterceptor((event: FluxEvent) => void) to add a function that intercepts flux events before they are dispatched and can edit them

dull magnet
#

don't do that

flint bronze
#

does it not work well for this use-case or is it really unreliable

dull magnet
#

you shouldn't use it

flint bronze
#

i'd imagine you could edit the message event but also that does seem quite hacky

dull magnet
#

just patch the handler

flint bronze
#

discord code can get overwhelming fast

#

i have never actually looked at where actual system notifications are created

vast karma
#

I've messed around a bit with that, got a half-baked plugin that for example adds "user1 replying to user2" to the notification title

flint bronze
flint bronze
#

And replace it with something else (not with the Vencord notification API)

dull magnet
flint bronze
vast karma
#

Iirc the native notification api is used in a few other modules too, I haven't bothered to investigate those in detail

flint bronze
#

I want to patch message notifications

#

and make them look like REAL system notifications with RICH CONTENT like IMAGES and REPLY BOX

dull magnet
#

interceptors will run on every single event husk

#

performance πŸ“‰

vast karma
#

Then the module in that plugin might be worth investigating

flint bronze
#

i looked into what interceptors exist trolley

dull magnet
#

blame discord for bad system but yes don't use

#

discord's system just cooked tbh

flint bronze
#

?remindme friday 7pm kill nixos

fathom pivotBOT
#

Alright @flint bronze, in 2 days, 7 hours and 4 minutes: kill nixos

flint bronze
#

this is needed

flint bronze
#

husk

dull magnet
#

they could just make a function dispatchConnectionOpen and use it everywhere and then that function can do the interceptor

#

boom perf alr better

flint bronze
#

true

dull magnet
#

next HOP OFF SERIAL FLUX

flint bronze
dull magnet
#

process events and handlers asynchronously

#

😭

#

they do a serial queue

#

so bad

flint bronze
#

i know blobcatcozy

dull magnet
#

so if you do like FluxDispatcher.subscribe("FUNNY", () => sleep(10_000)

#

it will freeze discord for 10 seconds blobcatcozy

flint bronze
#

have you ever tried to jump through a flux event in debugger

#

i have and i didnt understand wtf was going on

flint bronze
#

do nothing loop trolley

#

why did you edit it to the wrong method

vast karma
#

Isn't xmlhttprequest blocking

dull magnet
flint bronze
#

I don't think so

dull magnet
#

but there is synchronous XHR

flint bronze
#

It doesn't use promises though husk

junior cove
#

I'm a dummy and never bothered looking into what the issue was, but I've had situations where subscribing to the event didn't work as intended, but adding an interceptor did. Modifying the mentions array on a MESSAGE_CREATE from memory

vast karma
#

I think there was some old http api that was sync, but might be misremembering

flint bronze
dull magnet
graceful bobcat
#

is there any way to execute a webhook via vencord web plugin

#

bc u cant access native and cors prevents u

dull magnet
#

why do you need to use webhooks

graceful bobcat
#

i want to make a plugin that forwards certain messages to a webhook

#

that is why i need to use webhooks

dull magnet
#

make a ||self||bot instead of plugin

graceful bobcat
#

not sure where to start with that one

#

please do NOT dm me where i can find resources on that

dull magnet
graceful bobcat
dull magnet
#

it's just connecting and listening to events there's 0 risk

risky is only once you do write actions

graceful bobcat
#

alright, well thank you for the suggestion i'll probably look into that

hushed loom
#

couldnt you just make an app that does one of these things

twin moat
rustic rune
#

I feel like I must have missed something crucial but I followed the instructions in the docs to make a plugin and tried loading it in Vesktop but it does not show up in the plugins list. I made the index.ts file in a subfolder in src/userPlugins, i'm not sure what else needs to be done

#

Never mind I misread the documentation userplugins should be all lowercase

amber basin
#

all lowercase

#

oh you already found that out

#

whoops

graceful bobcat
iron epoch
#

uses native

graceful bobcat
vast karma
#

Of course it is

graceful bobcat
#

ok so how would you execute a webhook on vencord web

iron epoch
#

that's the price you pay

graceful bobcat
#

that was my question

hushed loom
#

If that would work

graceful bobcat
#

nope CORS

#

i tried that

iron epoch
vast karma
#

What do you mean you "tried cors"

#

Cors is a server-side thing

#

Isn't it?

graceful bobcat
#

It was giving me an error when i tried to fire a webhook from discord.com

#

cause that should never rlly happen

#

So it rejects the request

#

On the server yea

dull magnet
#

u cant

muted terrace
#

my setup must be fucked

balmy sky
muted terrace
#

but its essentially a result of me not finishing my settings object

#

on the other hand i crashed my developer tools multiple times now (its not responding)

#

now my vscode too

unkempt dove
#

hi guys take a totally useless plugin that can probably be done fine with css to hide the stupid 2fa required box

#
import definePlugin from "@utils/types";

export default definePlugin({
    name: "1FA",
    description: "never get bothered about 2fa moderation again!",
    authors: [
        {
            id: 1003477997728313405n,
            name: "Death",
        },
    ],
    patches: [
        {
            find: "APPLICATION_SUBSCRIPTION_EXPIRATION:",
            replacement: [{
                match: /GUILD_MFA_WARNING:return/,
                replace: `GUILD_MFA_WARNING:return;return`
            }]
        }
    ]
});
#

possibly the most useless thing i've ever done

unkempt dove
#

so

humble flax
muted terrace
#

ur workaround works though thank u so much

normal wagon
#

only for newer accounts though without a number

#

otherwise you won't really encounter this and most servers are email verified so

dull magnet
#

css can do probably

iron epoch
swift delta
#

@unkempt dove

#

^someone stole your plugin and slapped their name on it

vast karma
#

What's up with that commit message?

#

Seems unrelated

flint bronze
#

thats not how it works husk

#

all their commit messages are fucked up?

swift delta
flint bronze
#

not what i mean

#

the mention

#

definitely the wrong account

iron epoch
#

I don't understand discord anymore , the thinking bubble randomly changed to "set status..."

cedar olive
#

check the code for it then :)

iron epoch
cedar olive
#

just patch your button under the online button

#

and don't care if set custom status exists or not

#

here

#

you will need to render a menuDivider too

warm wolf
#

=

unkempt dove
unkempt dove
unkempt dove
#

@tacit pebble

#

🀑

normal wagon
#

too?

#

apparently it was possible before through better discord to bypass the 10 minute wait when joining a server

#

i wish there was something to skip through the prompt when joining a server idk what it’s called

unkempt dove
#

i write plugins where convenient for me

#

i release very few of them

#

anything i choose to put here is for the one or two people who might find it useful and the plugin devs who go off examples (like me)

flint bronze
swift delta
flint bronze
swift delta
#

I mean, they are crypto bro so can’t be surprised

humble flax
#

*insert Mods. Whack is peepee meme *

flint bronze
swift delta
normal wagon
#

stealing peoples work and profiting off of it

#

that's my giuess

swift delta
#

stealing work and claiming it as their own

normal wagon
#

yeah that's my guess there's no other reasoning behind it

#

unless it's a ego boost or something idk maybe he doesn't like giving credit to people

swift delta
#

prolly an ego thing too

vale spear
#

just dropping by to announce my pr's 7 month and 9 day birthday

#

oh wow it's all the way on page 6 of 8 of all of the PRs

#

maybe someday it'll be elected the PR Pro Tempore

#

if every other pr older than mine were merged or closed it would be pretty funny because mine would then be the oldest pr

#

I just checked to see what the oldest PRs are that are still maintained

#

By "still maintained", i mean that have pushes recent enough to resolve all conflicts. If it says "this branch is out of date" or "this branch has conflicts", it's not maintained.

vale spear
#

The oldest still-maintained PR is #1930 (started October 2023) and, surprisingly, mine is second place

vale spear
hushed loom
#

i have quite a few older prs that i havent updates, but i would if someone mentioned it

vale spear
#

If you haven't updated them, they aren't maintained.

#

That's my opinion, anyway

#

feel free to disagree with me and come up with another system of measuring which is the oldest maintained PR at your leisure

#

I think that there's no way to know if a dev will update a PR if they're asked to or if they don't intend to update it anymore without manually asking every single one.

#

Besides, if it's updated frequently enough to be mergeable most of the time, it's available for review to anyone who wants to review it at any time they want to.

#

my opinion, of course

flint bronze
vale spear
flint bronze
#

actually testing the PR to see if it works when merged into main/dev branch

vale spear
#

But you can't merge PRs that have conflicts or are out of date

flint bronze
#

Out of date isn't an issue

vale spear
#

Interesting

flint bronze
#

As long as the dependencies (including patches) haven't changed in an incompatible way it should be fine

#

Obviously random discord updates will break stuff

vale spear
#

Do we still use that weird system where a check can't run unless it's approved by a repo maintainer?

hushed loom
#

iirc thats default on github

flint bronze
#

It's literally only an issue for first time contributors

vale spear
#

Really?

hushed loom
#

just copy the workflow onto your own branch

vale spear
vale spear
#

and earn the certified worksOnMyMachine

hushed loom
vale spear
#

True

hushed loom
#

horror patch

#
{
            find: ",invertBotTagColor:",
            replacement: [
                {
                    match: /,invertBotTagColor:\i/,
                    replace: "$&,moreTags_bgColor:moreTags_bgColor,moreTags_fgColor:moreTags_fgColor"
                }, {
                    match: /verified:\i,useRemSizes:\i/,
                    replace: "$&,moreTags_bgColor,moreTags_fgColor"
                }
            ]
        }```
vale spear
hushed loom
#

id have to understand what you're doing first

#

too late today

#

?remind next week review #2161

fathom pivotBOT
#

Alright @hushed loom, in 1 week: review #2161

vale spear
#

I appreciate the act of maybe giving me some constructive criticism in the future

vale spear
vale spear
# hushed loom id have to understand what you're doing first

After looking at it, I believe it's a random module between the one where user info (and thus role color) is available and where the role colors need to go (the bot tag module). Usually there's only one time where I have to add arguments to send and receive this data so that it is available in the context of the bot tag's generation, but in this case (I believe for displaying the badge on user profilesβ€”a feature I don't think is necessary but, as it's already in the plugin, I have to support), it was necessary to pass it through this module so that the destination module could have the data it needed.
If you have a better way to do this, let me know

flint bronze
#

Something... isn't right here

#

(this is a patch I made)

fathom pivotBOT
#

@flint bronze, <t:1726617340:R>: kill nixos

flint bronze
#

i no wanna right now

#

i will fuck up the laptop later

fathom pivotBOT
#

@flint bronze, <t:1726815639:R>: kill nixos

flint bronze
#

yeah thats right 12pm uh huh

fathom pivotBOT
#

@flint bronze, <t:1726819259:R>: kill nixos

flint bronze
#

no

fathom pivotBOT
#

@flint bronze, <t:1726833634:R>: kill nixos

balmy sky
#

@flint bronze kill nixos

vast karma
#

Is there a way to make a slider setting that restartNeeded when changing from or to zero but not when changing between nonzero values?

green vessel
vast karma
#

That'd make tinkering with the setting a lot more annoying than it needs to be. Why don't I just... ```js
get restartNeeded() { return settings.store.saturation == 0; }

opal dock
#

I'm working on modifying PluralKitIntegration, and I want to try and change how message editing works. As is, the plugin sends a message with the right command syntax within the current channel, but I've confirmed that this message would also work if sent in bot's DMs
however, when trying to use sendMessage() and specifically targetting the DMs for the bot, Discord refuses to send the message. If I don't have waitForChannelReady set to false, it just infinitely waits, and if I set waitForChannelReady to false, Discord complains that the channel ID doesn't exist
Is there some other way I need to send the message? Is it even possible to send a message in DMs without being in DMs? Or does Discord/Vencord not have an easy way to do that

dull magnet
opal dock
#

no

dull magnet
#

show code

opal dock
#

this is the snippet in question

MessageActions.sendMessage(1276796961227276338, {
    content: "pk;e https://discord.com/channels/" + guild_id + "/" + channelId + "/" + messageId + " " + messageObj.content
}, false);
dull magnet
#

quotes

opal dock
#

ah

dull magnet
#

that number is too large for js

#

veval 1276796961227276338

shrewd tundraBOT
dull magnet
#

see how it chops off the last few digits

opal dock
#

that was it

#

thanks

opal dock
dull magnet
#

discord ids (snowflakes) have to always be strings in js

#

(or bigint, but discord uses strings)

turbid spruce
#

is there a way to control in which order the custom buttons are displayed? i looked into the encrypt plugin as it was the first and i dont see any obvious reason as to why its the first?

vast karma
#

I think they're just added in enable order

#

Meaning encrypt comes first because it's alphabetically first

turbid spruce
#

Ah okay

flint bronze
#

uh

turbid spruce
#

Oh?

flint bronze
#

maybe actually

turbid spruce
#

Wait no

#

i just tested it

#

it still comes in last

flint bronze
#

im thinking "tooltip order"

turbid spruce
#

The order is constant no matter what i do

craggy phoenix
dull magnet
#

the latter for the most part

#

hence why they're closed now xD

craggy phoenix
#

Yeah BD struggled with plugin submission requests a lot too

normal wagon
#

i suggested this before not here because i wasn’t able to make a PR request before it closed i’m not sure whether this is considered api abuse

#

This will allow you to select a server or server(s) from a dropdown, menu. Once selected you can select the spaces left through a slider & the user amount too along with the user-limit (participants).

In short: It finds you a random VC easily without navigating through each server a good way of finding another VC

Settings: Auto-Mute, Auto-Camera, Auto-Stream, Auto-Navigate -- will navigate to the VC Channel automatically

dull magnet
#

it's api abuse if it spams the api in a manner that couldn't be done by normal usage

#

what you're describing should be doable fully offline so no

normal wagon
#

oh okay

#

now i understand

flint bronze
#

my Latest PR turns 1 month old tomorrow so

#

i will be updating it

#

with Good Feature

#

MEMBER_SAFETY_COMMUNICATION_DISABLED_TOOLTIP

bronze dove
#

can someone tell me an alternative to wreq(Number(findModuleId('navId:"user-context",')!)).default i just cant seem to find it in a different way myself

vast karma
#

I think the Number() is unnecessary, but that's pretty minor

bronze dove
#

nah wreq takes a number and findmoduleid gives a string

vast karma
#

Last I checked wreq doesn't give a fuck whether it gets a string or a number, it'll just index an object with it anyway

bronze dove
#

nvm

#

but still how do i find that user context menu

iron epoch
bronze dove
#

you think i didnt try that

iron epoch
bronze dove
#

not similarly enough i guess

vast karma
#

I think findByCode returns a function, not the actual module object

flint bronze
#

Yes

bronze dove
#

wait why didnt i think of this sooner

#

i can add a marker to it

acoustic nest
tropic ice
#

is that even completely rolled out yet?

#

I tried it a couple weeks ago I think and I could upload 25mb

#

seems to work?
it's because of server boost level

#

wait what i can send 89 mb???

#

i'm not actually going to upload the first 30k fibonacci numbers because my internet sucks

#

did discord make an oopsies and set the limit to 100mb?

#

that was a 159 mb file

#

it seems to be 100mb

#

one more character than this and i got the 10mb max popup

#

I don't think this will upload before i go to bed

#

seems like i have this experiment enabled by default

bronze dove
#

i want to open user context menu

cedar olive
#

so you want the menu compnent for the user context?

bronze dove
#

yeah

bronze dove
cedar olive
#
const { UserContext } = mapMangledModuleLazy('navId:"user-context"', {
  UserContext: filters.byCode("children:")
})
#

try that :)

#

you can also manually waitFor if u need

#

well actually maybe not cuz current implementation doesnt have a facotry filter

bronze dove
#

i think i did do something like bycode("navId") but that didnt work

cedar olive
#

try not destructuring if it fails

bronze dove
tropic ice
cedar olive
#

105MB OF NUMBERS?????????????????????????????????

tropic ice
#

fib

#

lots of fib

#

gn

cedar olive
#

we surely love using discord storage for that

#

JFHJDSFGDSFDS

tropic ice
vast karma
#

To upload?

tropic ice
#

yeah

vast karma
#

That's not fast

tropic ice
#

my internet is not great

#

i took this while uploading it

cedar olive
#

at least your internet is stable

#

because 1h and 40 minutes uploading something is A LONG time

tropic ice
tropic ice
tropic ice
#

because it's definitely NOT 10mb for me

#

and i don't have nitro

cedar olive
#

also this is why you can upload 100mb

vast karma
tropic ice
#

oh...

tropic ice
tropic ice
cedar olive
#

why is your internet so bad?

tropic ice
#

because i don't live in a city

cedar olive
#

oh

#

that makes sense

turbid spruce
#

Is it considered api abuse if i make a plugin to react with text?

iron epoch
#

that called self botting tho

turbid spruce
dull magnet
turbid spruce
iron epoch
swift delta
normal wagon
#

i think it’s been made already the it broke though

#

because i guess the function doesn’t exist anymore

#

something like that discord changed some stuff

junior cove
# iron epoch that called self botting tho

This is where I get confused about the self bot thingy. If you have to write the message yourself and click a button to make it send, is it still a self bot? I'd have thought it was only a self bot if it required no user interaction

tropic ice
#

that definitely wouldn't be self botting because it's one user interaction for one action

#

i'm not sure what one user interaction to do multiple reactions would be considered though

kind pike
#

would it be possible to allow replying to blocked messages to show up properly? i have someone blocked but when someone else replies to them trying to click on the message that's being replied to says i need to unblock the user to see it.

#

are there any plugins which do things with blocked users that I can look at?

#

wait i'm stupid theres already a plugin for this 😭

normal wagon
#

yep.

flint bronze
kind pike
#

like when you click on the show all messages next to the blocked user part

flint bronze
#

yeah that is also an issue

remote kestrel
#

@hushed loom help

hushed loom
#

yop

remote kestrel
#

im not sure how to do this

#

i need to get rid of the Anchor

#

wait

#

guh of course i haev idea the moment i ask for help

hushed loom
remote kestrel
#

somehow its loading old version of the code

#

??

#

its rebuilding

#

what

#

its literally loading the older code i dont understand

#

??????/ wtf this is annoying

hushed loom
#

what?

#

what are you trying to patch?

remote kestrel
#

thats not the issue

#

its literally loading code i deleted

hushed loom
#

you might be looking at the wrong module

#

search your find with ctrl+shift+f

#

and you will see an extracted webpack module

#

look at that to see what it loads

#

eg

#

this is what you want

remote kestrel
#

ok my idea doesnt work

hushed loom
#
{
    find: "MEDIA_DOWNLOAD_BUTTON_TAPPED,",
    replacement: {
        match: /(\i=\i\.useCallback\(e=>{).*},\[\i,\i,\i]\);/,
        replace: "$1console.log(\"Hii\")});"
    }
}```
dont know about the rest, but use this as the find
remote kestrel
#

ill need to replace the anchor somehow

hushed loom
#

wouldnt you just want to patch the callbacks?

remote kestrel
#

there isnt one

#

its just using <a href

#

i think

#

onClick just is analytics

hushed loom
#

@remote kestrel just a thought

#

wait

#

thats wrong

#

@remote kestrel ```ts
{
find: "MEDIA_DOWNLOAD_BUTTON_TAPPED,",
replacement: {
match: /\i.Anchor/g,
replace: "$self.myComponent"
}
}

try this
remote kestrel
#

does that replace both Anchor

hushed loom
#

with the /g global flag, yes

remote kestrel
#

okay

#

I'll try

hushed loom
remote kestrel
#

how are you able to see it after patch

#

for me the source remains the same

hushed loom
#

i will show

balmy sky
#

Search the find again

#

The patched version is webpack module iirc

hushed loom
remote kestrel
#

oh

#

there

#

now i can work on the download logic

hushed loom
#

might be stupid, but could cors get in the way of this

remote kestrel
#

should there be a default download dir setting? or would it be better for a plugin that modifies all downloading

#

Guh

#

WebContextMenus has the save as functionality already

#

maybe this would be better as a more generalized plugin improving downloading functionality

cedar olive
#

zeet making a plugin

#

gave up on kotlin

remote kestrel
#

Kotlin plugin soon

cedar olive
#

😭😭😭😭😭

hoary pilot
#

some kotlin thing where it takes in your kotlin plugger and outputs js

vast karma
#

Kotlin outside jvm is so cursed

green vessel
#

Anyone have an example of some code or a prexisting plug in that can toggle on and off a css change, for example a plug in with a setting when toggled on removes all embeds from discord and when toggled off doesn’t apply the css change of removing them

flint bronze
opal dock
#

I'm trying to modify the UserProfile for a webhook, specifically the bio and pronouns, and I want it to be able to update the moment I click on a new webhook. I'm updating the UserProfile from the UserProfileStore every time the user popout is created, but for some reason, it refuses to update the bio and pronouns until I click on another user first, then back onto the webhook
any ideas how I can get the behaviour I'm looking for?

here's a simplified version of the code that demonstrates what I'm trying to do:

onRenderUserGuildPopout(message: Message) => {
  const memberProfile = UserProfileStore.getUserProfile(message.author.id);
  memberProfile.bio = bio;
  memberProfile.pronouns = pronouns
}

this is being patched in with find set to renderUserGuildPopout: channel should never be null, for reference as to exactly when the function gets called

#

to further explain the current behaviour:

let's say I have messages A, B, and C
Message A is sent via a webhook by user A
Message B is sent via that same webhook by user B
Message C is sent by another user

if I click on Message A, it works just fine, I see user A's information
if I click on Message B, I see user B's information
however
if I go back to Message A, it stays on user B's information in the popout
the only way to get user A's information to show up again is by clicking on Message C first

vast karma
green vessel
#

I was able to figure it out

green vessel
#

Does anyone know how, or have an example/plug in that does of being able to change a css value from the index such as if I have a file called style.css that contains .markup_f8f345 .anchor_af404b[href^="http://"] { pointer-events: none; color: gray; text-decoration: none; cursor: default; } to be able to make a setting option like this linkColor: { type: OptionType.SELECT, description: "Color for unclickable links", default: "Grey", options: [ { label: "Grey Links", value: "Grey", default: true }, { label: "Blue overlay", value: "Blue"}, { label: "Red overlay", value: "Red"}, { label: "White overlay", value: "White"} ], restartNeeded: false, } That allows me to change the color: value in the css to red or blue or white based on the setting drop down selected, this is prop an easy thing to do that I am forgetting about lol

vast karma
#

Easiest way is to set a class, or a css variable, on the root element

flint bronze
#

Heads up: Those randomly generated class names can and do change occasionally

vast karma
#

Might be better to patch the markdown link component and add a custom class

green vessel
vast karma
#

Or of course using substring selectors, but I hate those

green vessel
vast karma
#

Substring selectors on class are were invented by the devil

green vessel
vast karma
#

Poor performance, imprecise, and just ugly

green vessel
vast karma
#

But with discord doing the bullshit they do, it is about the only way to theme discord

#

I would patch the component, yes

#

Doesn't mean that's the best course of action

green vessel
normal wagon
#

there’s nothing wrong with it as long as u update ur class names when discord updates

#

if discord does change classes again i think majority of the stuff i have will break though

green vessel
vale anchor
#

Hi there, Im gonna need some help.
I was working on my first plugin that can change server width.

So I`ve created a button that let me do that. This part works.
I only have a styling issue. When I reload Discord the button is half out of the screen. (pic1)
When I click it, to open and close it again, then the button works correct and it is centered again. (pic2)

So now is my question if i can get some help to fix this issue.
Below I wil post my start() function that creates the button and fixes the styling

    start() {
        let isFoldersExtended = false;
        const guildsNav = document.querySelector('ul[role="tree"][data-list-id="guildsnav"]');

        const svgButton = document.createElementNS("http://www.w3.org/2000/svg", "svg");
        svgButton.setAttribute("width", "100%");
        svgButton.setAttribute("height", "40");
        svgButton.setAttribute("style", "cursor: pointer; display: block;");

        const rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
        rect.setAttribute("width", "100%");
        rect.setAttribute("height", "40");
        rect.setAttribute("fill", "#313338");
        rect.setAttribute("rx", "5");
        svgButton.appendChild(rect);

        const updateIcon = () => {
            while (svgButton.firstChild) {
                svgButton.removeChild(svgButton.firstChild);
            }
            svgButton.appendChild(rect.cloneNode());

            const icon = document.createElementNS("http://www.w3.org/2000/svg", "svg");
            icon.setAttribute("fill", "#f2f3f5");
            icon.setAttribute("width", "24");
            icon.setAttribute("height", "24");
            icon.setAttribute("viewBox", "0 0 330 330");

            const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
            if (isFoldersExtended) {
                path.setAttribute("d", "M111.213,165.004L250.607,25.607c5.858-5.858,5.858-15.355,0-21.213c-5.858-5.858-15.355-5.858-21.213,0.001 l-150,150.004C76.58,157.211,75,161.026,75,165.004c0,3.979,1.581,7.794,4.394,10.607l150,149.996 C232.322,328.536,236.161,330,240,330s7.678-1.464,10.607-4.394c5.858-5.858,5.858-15.355,0-21.213L111.213,165.004z");
            } else {
                path.setAttribute("d", "M233.252,155.997L120.752,6.001c-4.972-6.628-14.372-7.97-21-3c-6.628,4.971-7.971,14.373-3,21 l105.75,140.997L96.752,306.001c-4.971,6.627-3.627,16.03,3,21c2.698,2.024,5.856,3.001,8.988,3.001 c4.561,0,9.065-2.072,12.012-6.001l112.5-150.004C237.252,168.664,237.252,161.33,233.252,155.997z");
            }
            icon.appendChild(path);

            const buttonHeight = 40;
            const iconHeight = 24;

            const iconX = (svgButton.clientWidth - 24) / 2;
            const iconY = (buttonHeight - iconHeight) / 2;

            icon.setAttribute("x", iconX.toString());
            icon.setAttribute("y", iconY.toString());

            svgButton.appendChild(icon);
        };

        updateIcon();

        svgButton.addEventListener("click", () => {
            console.log("Button clicked. Current state:", isFoldersExtended);
            if (isFoldersExtended) {
                removeCSS();
                svgButton.setAttribute("height", "40");
            } else {
                applyCSS();
                svgButton.setAttribute("height", "40");
            }
            isFoldersExtended = !isFoldersExtended;
            updateIcon();
        });

        if (guildsNav) {
            guildsNav.appendChild(svgButton);
        } else {
            console.error("Guilds navigation tree not found.");
        }
    },
vast karma
#

Dom manip found

dull magnet
#

don't use raw dom / html

#

use react + patches

vale anchor
opal dock
# opal dock I'm trying to modify the UserProfile for a webhook, specifically the bio and pro...

apologies for bumping my previous issue, but I'm still unsure what I can do to proceed
I can see in the logs that the UserProfile is indeed being modified, but the changes just aren't reflected in the user profile popout
I can't figure out where Discord actually pulls in data like the bio to patch it more directly either
perhaps there's something I've overlooked though, or maybe I'm overcomplicating things

naive thicket
#

is it possible to find a component not exported by the webpack module?

cedar olive
#

assign it to your plugin object using a patch

naive thicket
#

ooh, so that's how the patches can be useful

cedar olive
#

what's the component tho?

cedar olive
naive thicket
#

this little draggable row

cedar olive
#

hmm I see

#

try to use by patching then

#

can't you just use the one that renders all the roles?

#

which is exported

naive thicket
#

probably i could, but i wasn't sure which props should i give to them

#

i'mjust gonna render simple <p> while testing lol

cedar olive
#

ur gonna have a worse time by using the draggable component directly

#

since you need to pass onDragStart, onDragReset etc

#

breakpoint and inspect the props u need

#

they are pretty simple, the only tricky ones are setEditRoleId and setSelectedSection I think

#

you can try passing () => {} to those and see what happens πŸ˜‚

naive thicket
#

yeah i won't be needing those, i'm just extending serverInfo to show all roles

#

probably i can keep them noop

dull magnet
#

just mutating an object won't do anything

opal dock
#

gotcha

dull magnet
#

you need to update the state, for example by dispatching a profile update event

opal dock
#

well, it does do something
it's just not responsive

dull magnet
#

or better yet patch the ui in place instead of messing with data

opal dock
#

how would I figure out which event to hook into?

#

I just can't figure out where the events and data are actually stored

cedar olive
#

Stores

cedar olive
opal dock
#

it's just not responsive

opal dock
cedar olive
opal dock
#

the weird thing is that
sometimes the modified data gets used immediately
sometimes it doesn't

#

I can try injecting it earlier, I found a very early spot that I could inject to

cedar olive
#

show something in the ui you wanna change exactly

#

I'll help point you where that data is retrieved from

#

is it this?

#

or this

opal dock
#

I want to modify the bite-size avatar popout's bio and pronouns
I need a reference to the message that was clicked on originally, as I'm querying an API to get that data, and it needs the message ID to get the data

dull magnet
#

you need to update the state of the store and then make the store dispatch an update

#

you can either do it manually or dispatch an event

cedar olive
#

if it's something like this it works

#

but if the object is returned and changed later then no

dull magnet