#🧩-plugin-development

1 messages Β· Page 15 of 1

hollow tree
#

also I have never made a pull request lol

opal fern
#

Ig it's time e to learn

torpid agate
hollow tree
#

dogsmirk ok I will see what we can do

hasty stag
#

can i have help with this

chrome elbow
hasty stag
#

oh lol thanks

amber condor
#

how can i log something to console? console. log didn't seem to work

chrome elbow
#

what, it should work

hasty stag
#

my react element doesnt seem to be updating or is taking a while how can i make it update faster

chrome elbow
#

there is useForceUpdater() from @utils/misc

hasty stag
#

thanks

amber condor
#

i had a filter on in my console

#

by the way, any way to get function name of the function im currently in?

function foo() {
  console.log(...);
}```->

foo

dull magnet
#

what's the use case

amber condor
#

im testing out multiple functions and events, and i'd rather have a global const that tells which functions to work or not instead of commenting out the FluxDispatcher.subscribe lines

#

maybe i should just comment them out tbf

#

tbf i still would like to know the function name, because it'd make it easier to test events quickly

#
function onMessageUpdate(e: any) {
    console.log("onMessageUpdate");
    console.log(e);
}

i'd have to type the name 1 time less

dull magnet
#

no there's no way

amber condor
#

alright πŸ‘Œ

dull magnet
#

technically there's arguments.callee.name

#

but that's longer and won't work in strict mode

amber condor
#

yeah i tried that

dull magnet
#

wtf did you know you can do this??

amber condor
#

named function in place of anonymous function ?

austere gulch
#

I don't see anything weird there

amber condor
#

its weird in other languages but ive seen it before while diggin through js code

austere gulch
#

I do named function args often

dull magnet
#

the fact that you can have named function args and recurse

amber condor
#

in python we have to do this for that ```py
map((f:=lambda x: 1 if x == 0 else x*f(x - 1)),
[1, 2, 3, 4, 5])

#

use some weird ass operator to assign a "anonymous" function to a named variable

dull magnet
#

@cedar olive why is there editPermission but not createPermission

#

even the api doesnt have a create method?

#

does edit just create if not exists?

#

cause jsdoc not helpful

#

from discord docs it does seem to be this

cedar olive
#

I will have to check

#

maybe it's missing

dull magnet
#

editPermission works

#

and it's technically consistent with the discord api

#

it's just a bit confusing coming from other frameworks that for some reason have createPermissionOverwrite too

#

and the jsdoc doesnt mention creating

#

it only says edit

cedar olive
#

yeah definitely an issue with jsdoc

#

it should mention that

#

editPermission creates one too

dull magnet
#

tbf it's consistent with Discord's docs

#

just that discord docs suck harold

mossy marsh
#

vencord codebase is very clean

mossy marsh
#

Im confused on how I get a patch from this?

mossy marsh
#

i think i figured it out

oblique lark
#
private static final List<Pair<Integer,Integer>> canonColors = new ArrayList<>();
static {
  for(int i = 11; i <= 75; i+=16)
    for(int j = 78; j <= 114; j+=12)
      canonColors.add(Pair.of(i, j));
}

least convoluted java array

mossy marsh
#

i got my plugin to work :)

mossy marsh
#

also formats already sent messages

trail ginkgo
#

oh intreesting what does it use

mossy marsh
#

prettier

#

i couldn't find any other option

#

ill work on submitting a PR with it :)

shrewd yacht
hasty stag
#

i made a plugin using the front end of spotify controls but for cider

cedar marsh
#

.

hasty stag
#

how can i delete a message from sendBotMessage

austere gulch
#

use the MessageStore

#

it's like MessageStore.deleteMessage(channelId, messageId)

#

or smth

hasty stag
#

i dont see any delete function

amber condor
#

is it possible to intercept a message_create before it's sent to the server? and be able to cancel it? just curious

cedar olive
#

yep

#

message events api from vencord

#

and even if there wasnt an api for that, anything is possible lol

hasty stag
#

i cant find any delete function in MessageStore

cedar olive
#

check the message store source code and see if you can find the delete function

hasty stag
#

dont see any in the interface

austere gulch
#

in discord console can you run Vencord.Webpack.Common.MessageStore and look at its funcs

maybe it just isn't documented

#

I used it accidentally on my program recently so it definitely exists

hasty stag
#

dont see it in the console either

austere gulch
#

whaa

cedar olive
#

check the prototype

austere gulch
#

lemme check

cedar olive
#

of the thing you logged on the console

austere gulch
#

oh ^

hasty stag
cedar olive
#

not there then

austere gulch
#

whaa

cedar olive
#

give me a sec I will find it for you

hasty stag
#

thanks

hasty stag
#

lol

#

doesnt seem to work for what im doing

austere gulch
#

guh markdown

#

DISCORD WHY

hasty stag
austere gulch
#

hmm

hasty stag
#
const MessageActions = Vencord.Webpack.findByProps("deleteMessage");
                var position: number = findOption<number>(args, "position", 0);

                CiderStore.seek(position);
                var message: Message = sendBotMessage(ctx.channel.id, {
                    embeds: [
                        {
                            type: "rich",
                            title: "Cider",
                            description: `Set the track position to ${position}.`,
                            color: 0xB22841,
                            fields: []
                        }
                    ] as any
                });

                setTimeout(() => {
                    MessageActions.deleteMessage(message.channel_id, message.id);
                }, 1000 * 5);

is it a problem in my code

austere gulch
#

weird

hasty stag
#

formatting bit bad

austere gulch
#

MessageActions does api calls

#

MessageStore is local only

hasty stag
#

oh ok

austere gulch
#

sorry on phone so can't help too much xd

hasty stag
#

its fine im really new to vencord so im not familiar with much

cedar olive
#

try dismissAutomatedMessage

#

it's on message actions too

hasty stag
#

what are the arguments?

cedar olive
#

the same

hasty stag
#

ok

#

doesnt look like it did anything

cedar olive
#

welp

#

if you cant figure it out i'll help tomorrow

#

gotta go

hasty stag
#

ok thanks

hasty stag
#

MessageActions.deleteMessage(message.channel_id, message.id, true);
works

#

i found it in the source for dismissAutomatedMessage

cedar olive
#

its literally what dismissblabla does lol

opal fern
#

lol

hasty stag
hasty stag
#

why does the components list do this

opal fern
#

What?

hasty stag
#

the whole list just shows itself as that

opal fern
#

Take a screenshot of entire screen?? Idk what the fuck to do with that

hasty stag
#

i havent got it again i had to quit discord then start it again

#

it appeared a few times

#

but i dont know how to trigger it

#

right now the list is empty though

opal fern
#

Oh that components list

#

Someone posted a fix but can't remember

hasty stag
#

my vencord is updated

torpid agate
#

does anyone know a decent code editing app for ios?

opal fern
#

Yeah, none

#

Best you can do is have a VPS with code server on it

steel oriole
#

best you can do is use github

#

and actions to compile

green vessel
#

that's a terrible workflow

amber condor
#

like gitlab or some shit?

torpid agate
amber condor
#

github.dev

amber condor
#

when rust compability with Vencord mods? πŸ‘€

dull magnet
#

never

amber condor
#

(trust me im not a Rust elitist πŸ‘€)

dull magnet
#

you can already run wasm fine

amber condor
#

hmm

#

might look into making a example rust wasm for vencord mods

#

idk what usecase it wouldnt really have, maybe a little bit of speed in some cases, more librarys and support of other languages?

#

using python in rust and compiling it to wasm πŸ₯΄

dull magnet
#

horrid

#

wasm is slow cause you gotta use ipc for everything

#

So 99% of the time wasm will be slower than js

amber condor
#

hehe

#

it would probably be faster to compile python to wasm

faint siren
#

how do i patch a discord react element? To be specific i want to patch the user popout and add something at the bottom of it.

dull magnet
#

you just patch it

#

there's no one truth, it's different for each component

#

So that's not a question that we can give a good answer to

#

gotta be more specific :P

faint siren
#

hm oka

#

to be specific specific, i'm trying to replicate the UserVoiceShow plugin from BD

#

i think i got the patch working though

dull magnet
grim hare
#

deprecated js features were all so good

dull magnet
# dull magnet wtf

wait does this let u go back in the callstack with caller.caller.caller

grim hare
#

yeah

#

it's a really neat feature but if you try to access arguments.callee in strict mode you will explode TypeErrors

dull magnet
#

😭

#

why did they remove this wtf

#

its so useful

trail ginkgo
#

prob optimization

dull magnet
#

well

#

they can never actually remove it

#

well ig strict mode

trail ginkgo
#

yea lmfao

dull magnet
trail ginkgo
#

but im sure strict mode does it yea

dull magnet
#

but this is actually incredibly useful

grim hare
#

it was added initially to allow recursion in named function expressions

#

err

#

it was added to allow recursion because named function expressions didn't exist

#

(ignore my deleted message, named function expressions are just named functions in general and I got confused)

mossy marsh
#

params *

dull magnet
#

no

civic stone
#

Does anyone here know any good and easy to install administration panels for Ubuntu 22.x? I already use pm2 but it's only for my node projects so. I say easy to install because it seems all of them are hard as fuck to install

grim hare
#

vendy did you see my ping about richerCider

dull magnet
# grim hare vendy did you see my ping about richerCider

I removed it because it doesn't comply with our code of conduct, this is not something I want our project to be associated with
https://www.reddit.com/r/AppleMusic/comments/vydyj8/i_know_everyone_likes_cider_but_the_devs_are/

the commit removing it just gave me a good opportunity to remove it because it didn't comply with the structure required by that feature anyway. I didn't mention it further because I was hoping it would just fly under the radar, since I don't really want to start silly drama over this

grim hare
#

understandable

#

it being included in the commit with no context kinda looked like a possible mistake which is why I asked more about it

trail ginkgo
#

@dull magnet run Object.prototype['0'] = 0 in discord

dull magnet
#

wtf

#

what does that even do

#

does that make discord think random stuff is an array

#

amazinbg

#

notice

opal fern
trail ginkgo
#

i think

dull magnet
#

ye

trail ginkgo
#

but length still 0

dull magnet
#

ig its like regex match and stuff

#

silly

trail ginkgo
#

yea true that would do it

dull magnet
#
const aa = banana.match(...)?.[0]
#

will randomly return 0

#

haram

trail ginkgo
#

MLFAO

dull magnet
#

πŸ₯Ή

trail ginkgo
#

dz made her tiny toml parser use null prototype objects to prevent proto pollution but i wanted to find an insane bug in the normal object version

dull magnet
#

lmao

#

i love

trail ginkgo
dull magnet
#

ohhh

trail ginkgo
#

her parser heavily uses sparse arrays

dull magnet
#

im stupid

#

it still returns null

dull magnet
trail ginkgo
#

so i was seeing if i could trick it into parsing the same token over and over

dull magnet
#

need to be safe from prototype pollution

trail ginkgo
#

fake

dull magnet
#

is there even a way to reimplement arrays while being safe from prototype pollution

#

u can definitely reimplement arrays but idk if prototype pollution free

trail ginkgo
#

i mean it already kinda is safe

#

its just number keys being set

dull magnet
#

πŸ₯Ή

green vessel
#

before my last commit u could potentially assign to [].prototype

#

now you cant trolley

trail ginkgo
#

how

#

wait how did that last commit make the bundle smaller

#

thats insane

green vessel
# trail ginkgo how
[[a]]
[[a.b]]
__proto__.__proto__.constructor.0 = "meow"

would try to assign __proto__ to [[a]], which is an array

#

this is valid toml though and it should instead assign to the last element of [[a]]

#

which is an empty table in that case

trail ginkgo
#

this hurts my head

green vessel
#

same

trail ginkgo
#

the [[a]] syntax is so hard to intuit

green vessel
#
[[gayming]]
bleh = true

[[gayming]]
meow = true

in json, is ```json
{
"gayming": [
{ "bleh": true },
{ "meow": true },
]
}

#

[[]] is cool

#

nested [[]] is fake

dull magnet
green vessel
#

I already did

#

silly

trail ginkgo
#

INSANE

orchid scaffold
#

How can I delete/hide the gift element using CSS?

hasty stag
#

i did this

button[aria-label="Send a gift"] {
  display: none;
}
dull magnet
#

they put extra effort to make it configurable

#

LGTM

#

if u want changes lookie now or i will merge

green vessel
#

lgtm but I haven't tested that code

small widget
#

where suggestion channel

dull magnet
#

dleeted

dull magnet
#

@gaunt sluice hardcoding classnames like that is a bad idea for snippets cause they'll break in the future

#
- .assetsLargeImageSpotify-17ME3M
+ [class^=assetsLargeImageSpotify-]
gaunt sluice
#

isn't doing that method bad for performance?

#

or does it make no difference these days

#

i made those snippets so long ago, i just reposted them from bd

gaunt sluice
#

i c

dull magnet
#

I mean they probably do slightly

#

but not noticeably

#

I've seen complex themes exclusively use them and didn't notice a difference in performance

#

I just don't like broken snippets so I try to avoid the mangled classnames

gaunt sluice
#

this one

#

oh ok!

dull magnet
#

is that the background

#

that would do it, that's a horrible idea lmao

shrewd yacht
shrewd yacht
#

What I would need to know is the equivalent in today discords css of:

  • div.markup
  • span.timestamp
  • span.username-wrapper
  • span.message-content
  • strong.user-name
maiden ruin
#

What if you implement a Test Notification feature in the Dev Companion plugin

#

So you can test notifs and how they look like

#

add notices with it too :)

amber condor
maiden ruin
#

I mean like when you are making a plugin

#

with notifs

#

you just click test notif like test patch and it shows the notif

#

instead of pasting code into devtools

amber condor
#

using an alt

#

unless you mean a diff kind of notification

maiden ruin
maiden ruin
amber condor
#

is there any way to have popup windows inside of the active discord window or even a whole window for itself

hasty stag
#

how wanted would this plugin for spotify commands be? is it enough to make a pull request to vencord

dull magnet
#

I think it's kinda pointless, why would someone use this over just using the Spotify controls

#

but maybe that's just me

hasty stag
#

most of my workflow is without my mouse

chrome elbow
#

i can imagine type /play and a lot music bot commands show up

hasty stag
#

yeah that could be a problem

#

i dont really use servers so i didnt think of that

amber condor
#

how do i / what is the reccomended way of storing data? both temporary and permanently (during session and between sessions)

dull magnet
#

DataStore api

amber condor
#

thanks :)

#

i'll start digging through already made code

snow jetty
#

i'm looking into how plugins work and i keep seeing \i in the patch regexes to get variables but i don't know what that means, couldn't find any info online, am i just dumb?

grim hare
#

\i is a custom regex escape we've added that matches identifiers

snow jetty
#

that's awesome

#

the docs probably need a little updating

grim hare
#

very much so

dull magnet
#

ye

#

\i becomes [A-Za-z_$][\w$]*

dull magnet
#

@trail ginkgo you will merge ur docs stuff with the website CocoGun

trail ginkgo
#

bet

viral roost
dull magnet
torpid agate
#

lol

dull magnet
#

the site still needs a bunch of work but I wanna release it very soon

viral roost
#

plugin request

dull magnet
#

ah

#

ye that's gonna be in those docs too

torpid agate
opal fern
#

how do i turn on darkmode on the website?

dull magnet
#

you can't

#

it's determined by your system settings

opal fern
#

horror

#

make the cat enable and disable darkmode

dull magnet
mossy marsh
#

does anyone know any way to get I can get the language of the codeblock? I have this patch but the first arg is just the actual code inside the block

trail ginkgo
#
{
    match: /\{lang:[^,]+,content:[^,]+,inQuote:[^,]+\}/,
    replace: "$self.format($&)",
}```
#

the insanity that i wrote before sending that was fucked up

mossy marsh
#

what does the $& do again?

trail ginkgo
#

the whole match

mossy marsh
#

ohhh

#

so then i'd return the object instead

trail ginkgo
#

yea so ur format would be like

#
format(code: { lang: string, content: string, inQuote: string }) {
    if (code.inQuote) return code;
    if (isFormattable(code.lang)) code.content = realFormat(code.lang, code.content);
    return code
}```
#

or something

mossy marsh
#

alright ill try that out

#

wouldn't i need to return the same object though?

trail ginkgo
#

ur just modifying it

mossy marsh
#

oh i see

#

i thought it was getting destructured at first but i see that's its the type lmao

trail ginkgo
#

but im p sure it doesnt even need to be the same object

#

cus the obj is created in the return statement, not much significance there

snow jetty
dull magnet
snow jetty
#

might've been because my regex had a typo

#

my bad

dull magnet
#

ye

#

that's more likely

#

Also patch helper is obsolete now

snow jetty
#

i only saw it now

dull magnet
#

could add that to vencord companion

snow jetty
#

companion?

dull magnet
#

you don't know?

snow jetty
#

i have a hard time keeping up with changes lol

#

i'm a newbie at plugins

dull magnet
snow jetty
#

WHAT

dull magnet
#

patch helper built into vscode

dull magnet
snow jetty
#

bad practices

dull magnet
#

that took ages to break somehow

#

I must have merged that on accident

snow jetty
dull magnet
#

what's the patch?

snow jetty
#

oh i have comments might cause problems

#

nope

#

heh wanted to send as dm but whatever

{
    find: ".USER_SETTINGS_PROFILE_THEME_ACCENT",
    replacement: {
        match: /(\i)=(\i)\[0\],(\i)=\2\[1\].{0,700}className:(\i).{0,700}ACCENT}\)}\)}\)/,
        replace: "$&,$self.addButton($1,$3)"
    }
}```
#

i know it's awful

#

please don't judge my code lmao

#

oh no

#

\w

#

i missed that one

#

doesn't fix lol

dull magnet
#

and that patch works in patch helper?

snow jetty
#

lemme test again

#

yup

#

copy pasted from patch helper into vscode and it the extension still says it fails

dull magnet
#

huh

woven lion
#

yeah ive had that happen with a couple of patches

#

some of the RCE patches are flagged as not working when they do

#

i thought its because it was trying to work on already-patched code

#

i havent investigated it yet

snow jetty
#

well whatever doesn't impact me

#

my other patch returns OK tho

amber condor
#

how do i check if the user has nitro?

dull magnet
#

oh yes actually @woven lion

#

you're right

#

I will fix

woven lion
#

sounds good

snow jetty
#

oh and ven, yes my regex is too complex for the output i know i haven't simplified it yet, there's stuff i don't need anymore

dull magnet
#

what r u making?

snow jetty
#

trying to port a plugin

#

from vendetta

woven lion
#

i just realised none of our plugins have spaces in their names

snow jetty
#

which i believe is a port from that one desktop client mod i forgot the name of

woven lion
#

i guess thats sort of client mod tradition though isnt it lol

woven lion
#

yeah i know

dull magnet
proud parrotBOT
woven lion
#

we facilitate spaces

dull magnet
#

this should be js String(candidates[keys[0]].original)

#

Super easy fix

woven lion
#

ahh

#

gotcha

dull magnet
#

I will fix along with some other fixes

dull magnet
#

we account for it in some places but not others

#

it also looks very silly in objects

woven lion
#

yeah

#

but i suppose the main reason against it is tradition

#

i cant really think of a time where plugins ever had spaces in any mod besides BD

#

lol

dull magnet
#

btw are u gonna put the installer on win store or

#

cause I made the release with nsis installer

#

do u need anything else from me?

woven lion
#

when the website is done and on a permanent domain

dull magnet
#

ah I see

woven lion
#

cause i need a place for the builds to be hosted that isnt github (cause of the redirect issue)

dull magnet
#

does vercel even let u serve arbitrary files

woven lion
#

then ill handle doing versioning and publishes from there on

#

no clue

#

probably not

#

so we'll just run it on vendymachine

opal fern
#

put the installer on apt trolley

#

even better, on snap trolley

woven lion
#

die

rigid zodiac
#

flatpak installer

snow jetty
#

okay my dumb port works but looks ass

#

i'm bad at UI

grim hare
#

Is there a better way that I can control the layout of settings, this is super not ideal and will only get more unwieldy as more options are added

dull magnet
#

what do you have in mind?

#

@grim hare

grim hare
#

I'm not entirely sure, something like collapsible config sections

#

on PC I had things grouped together, and a collapsed by default section that had advanced settings in it

onyx yoke
#

Discord UX itself for settings is lots of scrolling. The only thing I'd suggest is if the settings are toggles, to use a toggle instead of a dropdown, but it'll still take the same amount of vertical space with padding between options, anyway.

grim hare
#

even discord's settings have sectioning and information text within them, it's not just a wall of controls

dull magnet
#

though we don't exactly have a component for that so you'd have to make it yourself

grim hare
#

the accessibility page, or most any of the other settings pages

snow jetty
#

this is a good example

dull magnet
#

this is still terrible because it's overwhelming

#

too many options

dull magnet
#
Choose what to notify you for
[ ] Silent messages
[ ] Group Removals
[ ] Spammers
#

like checkboxes

grim hare
#

that makes sense yeah, I've just been using the things that I found quick examples for

dull magnet
#

I also think notifications for group removals should be part of friend notifications (?) (unless I'm misunderstanding what that does)

dull magnet
grim hare
dull magnet
#

ohhh that's what you mean okay

#

doesn't discord have a multiple choice dropdown

onyx yoke
#

accessibility page is a wall of controls too

dull magnet
#

where it shows drop down options and you can choose multiple

#

I feel like that would also be great for your settings

grim hare
dull magnet
#

I don't have an example right now but I'm fairly certain they do

grim hare
#

there's a few different discord control elements that I need to figure out how to yoink anyways, yeah

#

like the tag input box

onyx yoke
#

nowhere in the stock Discord UI have I seen checkboxes - only toggles

grim hare
onyx yoke
#

radio buttons, yes

#

oh if you want to add section headers, yeah that would be an easy feature request

grim hare
#

there is a checkbox in my screenshot xd

grim hare
#

sure, if you want to figure out how to get the tag input text box that'd be good

onyx yoke
#

where is it?

grim hare
#

The only place I know of that it's in use (there's probably more) is the dev portal to specify your bot's tags but it's still bundled in the client because discordℒ️

onyx yoke
#

oh, it's not actually in use in the client? hm

grim hare
#

it's probably in the client for server discovery tags or smth too but I've never seen those settings pages

onyx yoke
#

yeah, having an in-client example to inspect would make it a whole lot easier, lol

grim hare
#

simply window.location = "/developers"

dull magnet
grim hare
#

I know, yeah

#

you'd think they'd do some sort of better optimization of things that 99% of users don't need though

onyx yoke
#

it's a fairly complex control

#
<div class="inputWrapper-x">
  <span class="tag-x">tagname<div class="closeWrapper-x" role="button" tabindex="0"><svg>...</svg></div></span>
  <input class="inputDefault-x input-x size16-x inputInner-x" type="text">
</div>
grim hare
#

I am aware it's complex, there's a reason I don't want to implement it myself xd

onyx yoke
#

yeah, the juice probably isn't worth the squeeze tbh

dull magnet
#

could u retest and let me know if it's fixed please? :3

snow jetty
#

i'm trying to but running into another issue

#

where did the plugin go

dull magnet
#

u need to build with --watch to have the plugin

snow jetty
#

right

#

;-;

#
{
    find: "getUserProfile=",
    replacement: {
        match: /(getUserProfile=function\(\i\){return )(\i\[\i\])/,
        replace: "$1$self.colorDecodeHook($2)"
    }
}, {
    find: ".USER_SETTINGS_PROFILE_THEME_ACCENT",
    replacement: {
        match: /},color:(\i).{0,400}},color:(\i).{0,400}ACCENT}\)}\)}\)/,
        replace: "$&,$self.addCopy3y3Button($1,$2)"
    }
}```
#

first works

#

second nope

amber condor
#

bro what πŸ’€

snow jetty
#

also my port is done, if you're interested in reviewing the quality

snow jetty
dull magnet
#

I pushed it 10 minutes ago

snow jetty
#

i ran the updater

dull magnet
#

god these emojis are ugly i need to undo the renames

snow jetty
#

i'm on latest commit yeah

#

it says no effect, is it because i have the plugin enabled?

dull magnet
#

oh wait u have \i

snow jetty
#

yeah

#

\w works

dull magnet
#

it just doesnt work

#

issue with ur patch

#

not the plugin :P

amber condor
snow jetty
#

but i swear my button is here

amber condor
#

im having like the hardest time implementing the split message into chunks of 2000 or 4000 characters πŸ’€

#

thought it was gonna be easy

snow jetty
#

like

#

it's here

#

how could my patch not work

snow jetty
amber condor
# dull magnet why

i cant just use presendlisteners because something before that stops me from hitting ENTER or clicking the Send Message button

#

im trying to search for it in devtools but damn

dull magnet
#

ohh

#

okay

#

i thought u were stuck on the splitting into chunks part

amber condor
#

nah thats way too easy

#

i set up the plugin settings already as well

#

just gotta patch discord somehow to stop this popup:

#

i tried searching if somethings listening to the button.onclick but nah

dull magnet
#

use react devtools to get to the component code, put a breakpoint, then follow the callstack

#

pretty simple :P

amber condor
#

how do i get react devtools

dull magnet
#

its a toggle in settings

amber condor
#

alright thanks im gonna check it out

snow jetty
#

@dull magnet does the patch engine remove all newlines

dull magnet
#

yes

snow jetty
#

that's the reason then

snow jetty
#

this patches ok

#

i replaced the dots

dull magnet
#

ohhh

#

ur saying the plugin doesnt remove newlines

#

yeah

#

that would do it

snow jetty
#

is it therefore bad practice to use the dot

#

or can i keep it

dull magnet
#

newlines are always removed you can rely on that

snow jetty
#

okay thanks

#

so um are you interested in the plugin i ported

dull magnet
#

idk what u ported

next stone
snow jetty
#

i was typing ;-;

next stone
#

stop using noTyping

snow jetty
#

a picture is worth a thousand words anyway

#

i guess it would be a candidate for fakenitro but since it requires user intervention maybe not

#

if integrated into fakenitro it would allow more people to see custom colors

cedar olive
#

it kinda fits fake nitro well

snow jetty
#

but right now i have it standalone

#

the problem with having it in fakenitro is that it requires the use to edit their bio

dull magnet
next stone
#

:)

dull magnet
#

i feel like it should be a separate plugin

cedar olive
#

just leave the button there

dull magnet
#

FakeProfileThemes

snow jetty
#

lol

next stone
#

it is my vendooter plugin

snow jetty
#

where do you want me to send the code

next stone
#

le PR

snow jetty
#

since if it ends up being part of fakenitro maybe i shouldn't PR rn

cedar olive
#

no

next stone
cedar olive
#

pr it as a different plugin

cedar olive
snow jetty
#

then you'll choose to integrate or not?

cedar olive
#

it wont be integrated

#

it's gonna become it's own plugin

opal fern
#

honestly having it as its own plugin will have less people using it, which kind of sucks

snow jetty
#

having it part of fakenitro could allow more people to see others' custom colors

cedar olive
#

yeah I thought of that too

next stone
#

good point

snow jetty
#

but putting only the decoding part in fakenitro wouldn't make much sense

#

well you can always choose to integrate it later

#

i'll rename it to fakeprofilethemes like you said so that it ends up next to fakenitro

#

but again the problem is that other people need compatible plugins to see the effects

#

unlike screensharing and other fakenitro features

amber condor
#

alright no

#

im so fing done

#

apperently its almost 3:30 am

opal fern
#

yeah somehow

amber condor
#

ive spent atleast 8 hours just searching and trying to figure it out

#

im done

snow jetty
#

i have the code responsible for it

#

i'm looking where would make most sense to patch

green vessel
#

how do i get themes working

amber condor
snow jetty
#

made it show the old popout

#

doubt that's what you want

snow jetty
#

@amber condor this is a terrible patch and will break probably next discord update but it works and you can figure out how to make it better

{
    find: ".MESSAGE_TOO_LONG",
    replacement: {
        match: /T&&null.{0,500}I\({/,
        replace: "I({"
    }
}```
dull magnet
#

just match this function

#

and make it return Promise.resolve()

#

btw @snow jetty a tip for matching variable names in way earlier code

#

instead of doing stuff like

/(\i)\.someUniqueMethodOrSmth{0,1000}actualMatchStuff/
#

you can use lookbehinds

#
/actualMatchStuff(?<=(\i)\.someUniqueMethodOrSmth)/```
#

this will first match actualMatchStuff then walk back until it finds the stuff in the lookbehind

snow jetty
#

Oh right

dull magnet
#

nookies discovered this, i didnt even know u could use lookbehinds like this

snow jetty
#

They create groups?

dull magnet
snow jetty
#

I'll improve my regex tomorrow

dull magnet
#
/MESSAGE_TOO_LONG_BODY_TEXT(?<=function (.).{0,50}openWarningPopout.+?)/
snow jetty
#

Oh that

#

Yeah that was no effort

dull magnet
#

first matches the MESSAGE_TOO_LONG_BODY_TEXT deep inside the function, then walks back to find function R

#

and you can now just replace MESSAGE_TOO_LONG_BODY_TEXT

#

way cleaner, more performant and you don't have to specify length so it's less likely to break

snow jetty
#

Yeah

dull magnet
#

gonna put a section on this in docs too

snow jetty
#

I was just lazy

#

Not for me so I didn't care

cedar olive
#

it's very epic

snow jetty
#

@cedar olive yes

cedar olive
#

but confusing to understand if you don't know how it works

snow jetty
#

That's why I'll look into it tomorrow lol

#

I tried using lookbehinds and my regex ran 100x slower so I didn't try again, I must've been using it wrong

cedar olive
#

I've had my moments where using lookbehinds made the code way worse lol

dull magnet
#

when u told me i first was like

cedar olive
#

I didn't either

dull magnet
#

what the fuck is this idiot saying

#

then i realised

cedar olive
#

😭

dull magnet
#

and then i was like holy shit this is revolutionary

cedar olive
#

ikrr

dull magnet
#

really easy to fuck up

#

if u put like a dynamic length thing in ur lookarounds they can become mega slow

#

but if used directly you can match way less of the string which leads to better performance

cedar olive
#

lookaheads are super epic too

#

like when matching an object prop value

/channel:\i(?=,)/
dull magnet
#

ye

#

but tbf u can just use our \i for that now

snow jetty
#

I've done the slowing down part, will try the speeding up tomorrow lol

cedar olive
#

you can always ask for help here

#

I've done a lotttttt of patches, so if you need anything

snow jetty
#

Yeah it's just time to sleep here so no more today

#

But thanks ^^

trail ginkgo
#

does it reverse the tokens or somethging

#

thats interesting

cedar olive
#

ye

#

wait no

#

it just goes backwards

trail ginkgo
#

oh until it finds the start

#

and then goes forward again

nocturne dawn
#

I'm trying to get the reply ping @ON to only change color when the property of .actions-1mkm4H switch[aria-checked="true"], but I have no idea how to do that in CSS. Here's what I have so far, apologize for the noobness (checked stackoverflow but I couldn't find anything, probably due to poorly phrased questions 😭)

.actions-1mkm4H switch[aria-checked="true"] .text-sm-bold-2BCfqW {
  color: var(--dracula-color12) !important;
}```
It works without the switch bit, but I kind of need that in order to keep it gray when it's ``@OFF``. I know I could change the link color overall, but I want to avoid that if possible
trail ginkgo
#

its a div but the role attribute is switch

#

[role="switch"][aria-checked="true"]

nocturne dawn
#

OHHHH

trail ginkgo
#

epic moment

nocturne dawn
trail ginkgo
#

lovee that

#

:))

nocturne dawn
#

I am now a Certified Front End Programmer 😎

oblique lark
#

can I just steal this now

nocturne dawn
#

theme is the dracula replugged theme

dull magnet
#

is replugged server that little help that u ask here

oblique lark
#

ok cool now my reply button is correctly tinted πŸ‘

nocturne dawn
#

lmao

#

i don't use replugged anymore

#

but since the themes are pretty much the same, y'know

dull magnet
#

ohh I see

#

okay

ionic breach
#

Question...
I made some tweaks to a theme i like, but some of the css can't just tacked on to the end as it conflicts. But someone has asked me if i could change it so it would override the original underlying css without them needing to comment anything out
If I made them !important that would give them priority but I've always heard using !important is bad practice. Would it be fine in this case? Are there other ways to do this?

grim hare
#

using !important is bad practice in most cases because if you have control over all styles on your application, there should never be a reason to use it

#

it is somewhat more common to need to use it to overwrite other people's styles though

#

if you use it sparingly and only where you absolutely need to use it, it'll be okay, but be mindful of what all it will impact

dreamy forge
#

how do u get the channel id here sendBotMessage(channel id here idk, { content: "hi" });?

viral roost
#

SelectedChannelStore.getChannelId()

#

or if you need the entire channel object there's a getCurrentChannel util

dreamy forge
#

just need the id for sendBotMessage but idk i am a noob

#

do i need to import anything for that?

viral roost
#

import { SelectedChannelStore } from "@webpack/common"
however your editor should suggest automatically adding the import when you type in the store name

dreamy forge
#

i am only using notepad++, probably should use something else for this

#

ty, works

dreamy forge
#

is there a function or something in vencord to have a pop-up or something similar with buttons?

viral roost
dreamy forge
#

ye i just switched to it for this

dreamy forge
#

there's probably a better way to make a prompt than that, but i don't even really know typescript and this is my first time messing around with plugins

dreamy forge
amber condor
#

unless youre actually using a bot ig?

dreamy forge
#

i did get that working but i used something different

amber condor
snow jetty
#

Devtools

amber condor
#

but thanks I'll look into it when i have time

snow jetty
#

Breakpoints

#

Stack trace

#

Etc

#

I found the string of the modal, found where it's referenced, put a breakpoint and went up the stack trace

amber condor
# snow jetty Breakpoints

where did you put your breakpoints? because whenever i put them my discord paused when i focussed back into discord

amber condor
#

the modal being THE_UPPERCASE_VARIABLES thingies?

#

i really dont know much πŸ’€

snow jetty
#

yea

amber condor
snow jetty
#

the one where you send a message that's too long

#

what am i supposed to do

snow jetty
#

just edited a plugin from #1032200195582197831 (the opera gx keyboard sounds one) and i added mx blue sounds, with different sounds for spacebar and enter
and to capture the enter key i had to patch discord's event handler

snow jetty
#

lookarounds are very much a double-edged sword

shrewd yacht
#

how can I style the landing messages?

snow jetty
#

landing messages?

shrewd yacht
#

"Hope you brought pizza" and stuff

snow jetty
#

well they seem to have the systemmessage class

#

while normal messages do not

shrewd yacht
#

how can I style the popup that appears while overlining text you are typing?

tame nexus
#

Is it ok to add a dependency to Vencord that my plugin needs? It has an MIT license, so there shouldn't be any conflicts.

woven lion
#

what is it?

#

@tame nexus

tame nexus
#

It's not completely necessary but it's just extremely helpful.

woven lion
#

hm

#

i guess this would be up to @dull magnet but more likely than not no, even if it is just a dev dependency

dull magnet
#

Use the default event emitter of the events module in node.js

#

plugins have no node access so you also can't use the event emitter

#

what do u want that for?

tame nexus
#

I'm only using it as a dev dependency to add the events with types. It's possible with the default event emitter as well but It gets really repetitive after time. But if you don't want it it's okay like I said it's not necessary πŸ™‚

dull magnet
#

what default event emitter?

#

there is none because plugins don't have node access

#

I'm not really following I think

woven lion
#

didnt even think about that

#

im so nodepilled

tame nexus
#

I mean the emitter from events. I only use it for types. I think discord uses something like this https://www.npmjs.com/package/events for it's events. So most of the types are identical to those in the node events type library or what it's called. Hopefully that was a bit clearer.

dull magnet
#

oh

solemn star
#

I'm pretty sure Discord just uses Flux and doesn't bother with lesser event emitters

dull magnet
#

if it's only for types then sure but you usually shouldn't need to use EventEmitter in any way

tame nexus
#

Why shouldn't I use an EventEmitter?

woven lion
#

why are you using one

dull magnet
#

I cannot imagine a use case where eventemitter would be the correct choice

#

discord already has a very extensive implementation of their own events so if you're using your own events you're likely doing something wrong

#

again, what's your use case?

tame nexus
#

There is a function in the MediaEngineStore called getMediaEngine which returns the MediaEngine. In this MediaEngine object I add an listener for the event connection. This connection event gets fired when there is a new voice connection or video connection (screenshare). The event returns a new object called Connection which stores important functions like the ones to set the stream quality of your own stream. I wasn't able to find a better way than this. Of course I'm removing all the events once the stop function is called.

#

There is a way to get all current connections as well but I need to get the connection as soon as it get's created so I thought an event listener is ideal.

dull magnet
#

yeah

#

but you'd likely use discord flux stores

#

which aren't anything like event emitters

tame nexus
#

You are right but I mean the MediaEngine object which the store returns. I added a screenshot of the __proto__ object which looks like an event listener.

woven lion
#

that's not using any special module

#

i dont believe

#

or it could be

#

hm

#

well regardless, what are you actually doing?

tame nexus
woven lion
#

i thought someone was already trying to port this poi_think

tame nexus
#

I already said it once on this server. Maybe it was me. I don't think someone else would do it because it's relatively new and almost nobody knows about it.

woven lion
#

well anyway, i dont see the reason why you'd need to install a module to type it when you can just type the callback manually

#

seems like a waste of a dependency

tame nexus
#

Do you mean the Event Listener?

woven lion
#

i mean the typed-events package

#

if you're only using one or two events from that listener then there's no point

#

especially since you aren't exposing them anywhere else

tame nexus
#

No I added all events.

woven lion
#
listener.on("someEvent", (someArg: someType) => {

});
dull magnet
#

I mean if it's just types it doesn't matter much

woven lion
tame nexus
#

Even ones I don't use for the future

dull magnet
#

but also I don't think u need to subscribe to events for this?

woven lion
dull magnet
#

I'm fairly certain you can just dispatch flux events with these things

#

you can just add it it doesn't matter much

#

but im not sure whether that plugin is appropriate to be included in vencord itself so it might be better off as a user plugin. It seems massive and fairly niche while possibly being somewhat sus to the api? I haven't looked into it much though , this is just my first impression

tame nexus
tame nexus
dull magnet
#

I mean

tame nexus
#

you mean my plugin?

woven lion
#

im not even sure of the use case of such a plugin think why would you need custom resolutions

tame nexus
#

I thought you mean the module I talked about

dull magnet
#

yeah im talking about the plugin, not the module :P

woven lion
#

i mean the module at runtime is 0 size so xd

tame nexus
dull magnet
#

dev dependencies are whatever you can always add them if necessary as long as they're not like super bloated

tame nexus
#

I added both a capture and encode resolution which was a bit stupid of me but I'm gonna change that

woven lion
#

the bitrate?

#

i dont know if it would genuinely help or not since discord's bitrate is always terrible

tame nexus
dull magnet
#

the only reason I asked was because I thought you were talking about wanting to add some event emitter library to your code

#

which is just terrible because it'd be adding unnecessary bloat

tame nexus
# woven lion i dont know if it would genuinely help or not since discord's bitrate is always ...

It does. I don't have the best upload but setting it to the half of it (10000 kbits) makes the stream way more watchable. Or another use case I found really helpful was setting a custom framerate especially for watching an anime or something because setting the fps to 24 which is about the same as an anime makes the bitrate more efficient because it encodes only the necessary frames. But 144 fps screenshares are great too but you need a good upload for that.

faint siren
#

i'd be happy to see such a plugin, then i can finally stream 1080p with decent bitrate

amber condor
#

whatever is in find should be closely before the match and replace right?

dull magnet
#

no

#

just same module

amber condor
#

module being the same file?

faint siren
#

@dull magnet when u gonna merge my pr? ;-;

covert nimbus
dull magnet
faint siren
#

oka

dull magnet
#

it looks pretty bad and not native

faint siren
#

whyyy okay, i'll make it look pretty

#

how can i disable the ... text overflow on Buttons?

dull magnet
#

just make it look like in that other bd plugin

#

way easier

faint siren
#

The other bd plugin looked too chunky for just a join my friend's vc button imo

snow jetty
#

ven, the user profile object has a themeColors property for the custom profile colors, but the User type in vencord doesn't seem to have it
i'm not blaming anyone because i'm a noob at typing code, can you help me figure out what i have to do?
ps: i said ven because they're active but any help from anyone will be highly appreciated

snow jetty
#

right

#

but i couldn't find the themeColors property referenced anywhere

#

in the whole vencord codebase

#

and the User type does have the premiumType property, just not the themeColors one

faint siren
dull magnet
#

that doesn't really look like it should be there either

faint siren
snow jetty
#

hey ven

faint siren
#

i'll just release it as userplugin

dull magnet
snow jetty
#

please help me out i typed my issue above

#

basically type issues

dull magnet
#

the thing is just it should look nice and native

#

πŸ₯Ή

dull magnet
#

have you looked at the object and it's actually there?

snow jetty
#

it definitely is on some users

faint siren
#

okay, imma make a compromise, a setting to choose the design, which is defaulted on your design suggestion, but also has mine as option
sounds good?

snow jetty
#

you have it for example

dull magnet
#

then just update the type in the code or cast it to what you need in ur own plugin

#

a lot of the types (mainly the ones in discord-types dependency) were written ages ago

snow jetty
#

themecolors at the bottom

#

your user btw

dull magnet
# faint siren

my main nit with this is that it's not obvious what that even means

#

maybe add a formtitle above

faint siren
#

i see, yea

snow jetty
dull magnet
snow jetty
#

i think i got it to work

#

i just didn't know how to do it

#
interface UserProfile extends User {
    themeColors: Array<number> | undefined;
}```
#

this right?

dull magnet
#

that works

covert nimbus
#

i think you can add a ? after themeColors

dull magnet
#

themeColors?: number[]

#

this is the same but nicer

snow jetty
#

right

#

thanks

#

adding a toggle in options to let users select whether or not nitro colors take priority

amber condor
#

how do i retrieve information from settings?

snow jetty
#

plugin settings?

amber condor
#

yeah

snow jetty
#
Settings.plugins.[plugin name].[setting name]```
amber condor
#

i saw some stuff about Plugins.plugins but couldnt find user made plugins there

snow jetty
#

oh

#

no seems to be the same

amber condor
#

yep rip

snow jetty
#

it has to be the plugin name from the definePlugin section

#

i have a userplugin with settings and it works

#

it's the same thing

amber condor
#

what is there's a space in the name?

snow jetty
#
Settings.plugins["plugin name"].settingName```
amber condor
#

that finds it

#

great thanks :)

dull magnet
snow jetty
#

welp

#

i tried looking at other plugins

opal portal
#

can someone make a css snippet to remove all role icons with aria-label :heart:?

#

i don't know how to select role icons

dull magnet
#
const settings = defineSettings(optionsObject);

definePlugin({
   ...,
   settings
})

settings.store.foo // get value
settings.store.foo = "banana" // set value```
#

it's very similar but better DX

#

and strongly typed

amber condor
#

what should i name the message splitter plugin?

#

i had Message Cap Splitter

#

πŸ’€

dull magnet
#

SplitLargeMessages

snow jetty
amber condor
#

import { definePluginSettings } from "@api/settings";

ember hatch
#

guys whats the easiest plugin that already exists that someone can check to get started?

snow jetty
#

right

dull magnet
#

docs coming soon

#

under construction

#

🚧

amber condor
#

the only issue i'll have with the plugin is that i cant check if it detects nitro right

snow jetty
#

ven i think an example plugin with all latest methods would be cool

amber condor
#

currently i use UserStore.getCurrentUser().hasPremiumPerks

snow jetty
#

a .dev plugin

snow jetty
#

okay i added a setting to choose priority if both are present

cedar olive
#

it returns a number or undefined

#

if the number is 0 the user doesnt have nitro

#

1 is nitro classic

#

2 is nitro

#

3 is nitro basic

#

only nitro can send large messages

amber condor
hushed smelt
#

is it possible to edit a plugin code locally? I wanted to change the fakenitro size to 56 as I had with bd

snow jetty
#

you can try editing the config file?

#
Vencord.Settings.plugins.FakeNitro.emojiSize=56```
#

in console

amber condor
#

im very glad the splitLargeMessages plugin is almost done :)

#

i'll do a bit of cleanup tmrw and then make it public

#

what should my plugin layout be?

A:

  • imports
  • consts
  • definePlugin & defineSettings
  • functions

or

B:

  • imports
  • consts
  • functions
  • definePlugin & defineSettings
next stone
#

it doesn't exist on it

#

in any way shape or form

snow jetty
#

It's on user profiles

next stone
#

correct

trail ginkgo
#

alyxia is throwing the game vote her off

snow jetty
cedar olive
#

imports

#

consts

#

functions

#

definesettings

snow jetty
cedar olive
#

defineplugin

snow jetty
trail ginkgo
#

nookies is responding to @amber condor

next stone
snow jetty
#

I have to amend my commit anyway to add the devs

cedar olive
#

I should have did it on a single message lol

trail ginkgo
#

xd

amber condor
snow jetty
#

So it represents the profile as well, meaning it should have themeColors

#

It's just not maintained

trail ginkgo
#

why does it have bio thats silly

next stone
#

literally run getCurrentUser and you'll see it's BS

snow jetty
#

You go fix it

#

I'm too lazy

trail ginkgo
#

??????

next stone
#

another time, i would take maintainership of the package but i definitely do not have the time to maintain a package that three people use

trail ginkgo
#

here's a possible solution

#

wait ur trynig to use the profile

#

u could type it userself tho

amber condor
#

ENUMS**

cedar olive
#

before consts

amber condor
#

done πŸ‘

#

i made a pr, ive looked over the whole file multiple times, yet i wouldnt be amazed if my dumb ass 2am brain still missed something.

torpid agate
#

wanna put this here for shits and giggles

snow jetty
#

because i have to add us both in the constants

hasty stag
#

@amber condor heres a patch i made to get rid of the text for max message length (second patch ive made so might be bad)


{
    find: "i=e.maxCharacterCount",
    replacement: {
        match: /(var ?.,.=e\.type,.=e\.textValue,.=e\.maxCharacterCount,y=e\.className)/,
        replace: "return null; $1"
    }
},