#🧩-plugin-development

1 messages · Page 20 of 1

waxen siren
#

after i get the event i want

cedar olive
#

your code should automatically update when you receive the member

waxen siren
#

oh

cedar olive
#

^^

waxen siren
#

I was going to await for it

#

and if no load then just display "failed to load"

#

instead

#

hmm

ionic breach
#

New question i thought of. So in the og code it says
onClick: ce;
Which makes me think ce doesn't take in any arguments to begin w. So why did you add the part with $2(... arguments) where it now takes in arguments it didn't before

cedar olive
#
    useStateFromStores(
        [GuildMemberStore],
        () => GuildMemberStore.getMemberIds(guildId),
        null,
        (old, current) => old.length === current.length
    );
cedar olive
#

but it may in the future

#

the old code directly references it

#

that's why you dont see it being ce()

ionic breach
waxen siren
#

use a react state ?

#

to update members inside the ui

cedar olive
#

(you would receive a member when you fetch the owner)

waxen siren
#

yh

#

What I did was like

#

subscribe to the event before

#

and just unsubscribe if what i received matched my request

#

(notFound and members)

ionic breach
waxen siren
#

but your solution seems better

#

this way it wouldn't wait for the owner to actually display

ionic breach
cedar olive
#

I actually already did some of your plugin before

waxen siren
#

oh

#

I talked with megu about the plugin i wanted

#

they said they also were going to do something like that

cedar olive
#

ye

#

they took over my code

waxen siren
#

FluxDispatcher.dispatch({ type: "USER_PROFILE_MODAL_OPEN", userId: friendId })}

#

OMG

#

this is what I NEEDED

#

I didn't know you can force load it with that

#

my friend and I were looking to like

#

grab function from webpack

#

and stuff

cedar olive
#
    const friendIds = useStateFromStores(
        [RelationshipStore],
        () => RelationshipStore.getFriendIDs(),
        null,
        (old, current) => JSON.stringify(old) === JSON.stringify(current)
    );

    useStateFromStores(
        [GuildMemberStore],
        () => GuildMemberStore.getMemberIds(guildId),
        null,
        (old, current) => old.length === current.length
    );

    const friendsToRequest = friendIds.filter(friendId => !GuildMemberStore.isMember(guildId, friendId));

    React.useEffect(() => {
        FluxDispatcher.dispatch({
            type: "GUILD_MEMBERS_REQUEST",
            guildIds: [guildId],
            userIds: friendsToRequest
        });
    }, []);

    const friendsInGuild = friendIds.filter(friendId => GuildMemberStore.isMember(guildId, friendId));
waxen siren
#

and we tried and failed hard

cedar olive
#

this is the important part

waxen siren
#

yh

#

so

#

hmm

#

okay

#

yeah maybe it is about time I switch my UI code to be more react style

#

lmao

cedar olive
#

the reason theres a React.useEffect there is to only run that once after the component is rendered

#

and not on every re render

waxen siren
#

yeah

#

I did use them on legos

#

but like

cedar olive
#

lol

waxen siren
#

its a bit different because I was building on top of already structured code

#

like this is how it looks like

#

oh wtf

#

OH

#

OK

#

Thank you so much @cedar olive

#

I owe you a drink

hasty stag
#

is there a way to detect middle click on a channel

waxen siren
#

is start not running once intended behaviour? @dull magnet

dull magnet
#

no

waxen siren
#

oh ok

#

what to do in this situation

dull magnet
#

provide more info :3

waxen siren
#

ur right

#

one sec

dull magnet
#

that doesn't even have the console.log

waxen siren
#

yeah

#

i was doing it now

#

lmao

#

so for some reason guild-context is now running every time you interact with the context menu for guilds (before it didn't do that for me)

dull magnet
waxen siren
#

why didn't it do it before what the helllll

dull magnet
#

because we changed the way the api works

waxen siren
#

oh

#

do I use hook now?

#

to create modal

dull magnet
#

before it would never call your function twice

#

now you have to manualyl opt into this behaviour by returning a function from your callback

waxen siren
#

ah

woven lion
#

react can call your function multiple times because Ha!

dull magnet
#
addContextMenuPatch("guild-context", () => {
  console.log("runs every time");
  return () => console.log("runs only once");
});
waxen siren
#

well what if I want it to call my function more than once

#

oh

#

ok

#

thanks

dull magnet
#

if you're only adding elements you don't need to run more than once

#

running every time is only important for react hooks and modifying discord's stuff

waxen siren
#

mm yea

#

thanks

lapis fable
#

working on light mode compatability (the very light ones i still have to work on)

#

feedback?

fallow urchin
#

@hasty stag

#

it no longer pushed chat up

#

but it's kinda jank...

#

welp just found a solution 10x better, nevermind

lapis fable
#

wip of replacing discord's default loading screen

lapis fable
#

gimme feedback or smth @tight epoch

tight epoch
#

Wait what exactly do you want feedback on here, the refreshedlime thing? Layout?

lapis fable
#

idk everything

lapis fable
#

can anyone help me why is this here

#

fixd it

ebon pivot
#

anyone know how to divide a list into other lists in intervals of 5 (its fine if new lists are created) if so can you help me out with that since thats my coding homework this is in python btw

ionic breach
ebon pivot
tight epoch
# lapis fable light mode colors mainly

Ah, hmm looks good, though I can't really say much since light mode themes aren't really my cup of tea
As for the custom loading screen thing, seems really cool and I'm interested to see where you end up taking it later down the line

ionic breach
#

you can probably just do a simple for loop and if statements then

#

if n in interval
then append to interval list

ionic breach
#

is it exclusive or inclusive

ebon pivot
ebon pivot
lone panther
ionic breach
#

oh good question

#

well either way you could do .sort()

#

but yeah

ebon pivot
ionic breach
#

you can use modulo then

#

as you loop through the list

hollow flame
ionic breach
hollow flame
#

Anyways, first thing you'll need to do is figure out how you're gonna pass these numbers into a function

ionic breach
#

to better explain myself

ebon pivot
ionic breach
ebon pivot
hollow flame
ionic breach
#

why

#

that was more for abstraction

hollow flame
#

Don't ask me, they brought it up

ionic breach
#

i don't think 4nullxz meant literally an input and output

hollow flame
#

but since we are, it would be helpful to think of this in terms of a function

ionic breach
#

is it?

#

i think it overcomplicates things

hollow flame
#

It's a function lol

ionic breach
#

i say just use a for loop and put the logic in a for loop

#

yeah it is a function but you don't need to code it that way

#

@ebon pivot you dont' need to use this bit of logic later right

hollow flame
#

If you're 2 months in and abstraction to a function is really that difficult, I might be worried

ionic breach
#

your'e only using it once to finish this hw assignment?

#

the only reason you need a function would be if it's a repeated thing

#

used elsewhere

#

in this case if it's just for a hw assignment a function isn't neccessary

ebon pivot
#

but

hollow flame
#

So that you can run tests

ebon pivot
#

if your gonna send me the code

#

ill be better of askin

#

*askin

#

*asking

#

my teacher

ionic breach
#

like in leetcode maybe

#

but if it's for a TA to grade?

#

if they don't sepecify the need for a function why bother

hollow flame
#

¯_(ツ)_/¯

ionic breach
hollow flame
#

I still don't think a function makes anything complex

ionic breach
#

¯_(ツ)_/¯

ionic breach
#

why do something that's unnecessary

lone panther
#

ezpz 🙄🙄🙄🙄

ionic breach
#

nice

lone panther
#
from math import floor # function to always round down values
imp = [1,4,6,20,24,31] # input but named `imp` because see PFP
out = {} # output dictionary
for n in imp: # loop through numbers in input
    try:
        out[floor(n/5)].append(n) # tries to append to a currently existing list at idx `floor(n/5)` (which makes it work)
    except:
        out[floor(n/5)] = [n] # if we fail to access a currently existing array, we write a new array with the number at the same index
print(list(out.values())) # we convert all values in the array to a list and print them
ionic breach
#

oh FLOOR

#

dang it

#

i did entirely forget about the function floor

lone panther
#

i did too tbf

ionic breach
#

i could have sworn i used modulo for this but while trying to figure it out i remembered it was for round robin sorting threads by their id. which is def not the same thing

lone panther
#

yeah i tried modulo but this is notably Not Right

ionic breach
#

yuppppp

dull magnet
#

we love strencher

vivid crest
#
from requests import post as p
from time import sleep as s 
while True:
    p('https://discord.com/api/v9/channels/1094688170156773526/messages', headers = { 'authorization': t }, data = {'content': "**MRBEAST DONATED 300 DOLLAS THROUGH SUPERCHAT**"})
    s(1*60)

RATE MA CODE

amber mantle
#

0

waxen siren
#

0

dull magnet
#

0

viral roost
#

{"NaN":0}[0/0]/10

lapis fable
#

im probably one of the first to make a theme light mode compatible

lapis fable
#

im making icons for the theme selection instead of just the color (the really dark one will have an svg rendered on top of it)

hasty stag
lapis fable
#

i heavily changed the theme menu - thoughts?

eternal lion
#

Nice

shrewd yacht
#

looking good

hasty stag
dull magnet
hasty stag
#

yeah ive tried with that but i need to know the channel id and other info for it

dull magnet
#

plugin

wide parrot
#

how would i go about appending ?.gif to the href of all a [data-role="img"]?

opal fern
#

You need to do that with js

tight epoch
#

I have decided to embark upon another one of my dumb "this should by no means be feasible using pure CSS but that won't stop me from trying" misadventures, this time: can I get an average colour (or what is perceived as such) from an album image in the spotify player to then use it for the background of that spotify player?
I'm thinking I can use a blur filter and upscaling through transform to get an image's average colour as the background, but then the question is how would I extract the image link and get it put somewhere else using pure CSS

dull magnet
tight epoch
#

I mean I found a way to change the profile container's border depending on one's currently set status, so I've already done something I and a fair few others thought wouldn't be possible with pure CSS
Whichever way, I find it fun to challenge myself to do this kind of stuff, and want to see how far I can push CSS, so I'm still gonna try to do it lol

lapis fable
#

i mean

#

i made a lot of stuff that isn't normal for discord themes

#

like custom loading screens and changing almost the entire settings menu

tight epoch
#

This is a stupid idea, but I will do it

lapis fable
#

adhd just made me type something completely different lmao

tight epoch
#

Mood

#

Hmm wait, maybe if I can find a way to use inherit or something similar? So long as it works on a ::before or ::after pseudoclass it might be possible that way?

lapis fable
#

my theme wont be compatible with older discord versions

#

it uses :has() a lot

tight epoch
#

You've got me using a considerable amount of complex selectors like those as well lol

cedar olive
#

does anyone have a list of all markdown discord supports

dull magnet
cedar olive
#

maybe

#

I have no idea how it looks for markdown stuff

dull magnet
#

anyway

  • headers (1 to 3 #)
  • unordered lists (im using them rn lmao)
    • nested too
  1. ordered
  2. lists
  3. links
viral roost
#

wouldve been really funny if markdown images worked

cedar olive
#

wtf

#

ordered lists are just the numbers?

dull magnet
#

ye

cedar olive
#

that's plain text behavior no?

dull magnet
#

nuh uh

#

it uses like a funny font

#
  1. a
  2. b
  3. c
  4. d
  5. e
  6. f
  7. h
  8. i
  9. j
  10. k
  11. l
cedar olive
#

oh

#

you cant select them too

#

they are nestabled too probably

dull magnet
#

but yeah ordered lists are wysiwyg

cedar olive
#
  1. a
  2. asd
  3. 35435
  4. b
  5. c
  6. d
  7. e
  8. f
  9. h
  10. i
  11. j
  12. k
  13. l
dull magnet
#
  1. probably
    2. nestable
cedar olive
#

yop

dull magnet
#

wait

#
  1. a
  2. b
  3. c
  4. d
#

lol view raw

viral roost
#
  • a
    • a
dull magnet
#

it counts for u

cedar olive
#

lmao

viral roost
#

Discord™️'s markdown

dull magnet
#

nah that's how it works in normal markdown as well

#

it's part of the markdown spec

cedar olive
#

tonguecat sad

#

WTF

#

oh

dull magnet
#
  • does
  • discord also support asterisk
  • and what about
  • pluses
#

asterisk yes pluses no

cedar olive
#

you can change the emote size

#

oh my god I cant write

viral roost
#

you can have a spaced emote

dull magnet
#
  1. does it allow
    • nesting ul in ol
      2. deeper?
      - how deep
      - banana
#

it does

cedar olive
#

how deep

dull magnet
#

lmao

dull magnet
#

what now

cedar olive
dull magnet
#

that looks horrid on mobile lmao

cedar olive
#

transforming working perfectly

dull magnet
#

oh wait it makes nested ols use Letters

#

that's awesome

cedar olive
#

well

#

this did not work how I wanted

#

aha

#

just a small flaw

#

completely removes the markdown stuff

dull magnet
#

very likely a dispatch

amber mantle
#

so many things are dispatch jee

dull magnet
#

discord insane

clear parcel
#

there's hundreds of gateway events alone lmao

#

I love cord

amber mantle
#

cord

dull magnet
#

no

#

but there's a function to send messages

cedar olive
#
const MessageActions = findByPropsLazy("sendGreetMessage");

MessageActions._sendMessage(channel.id, msg, options);
hasty stag
#

beat me to it

dull magnet
#

wtf i didnt know u could do this

cedar olive
#

??

#

YOU CAN COMPARE THEM WITHOUT TURNING INTO BIG INT

dull magnet
#

its the same thing as > "u" i showed earlier

#

i just didnt know u could even compare entire strings lmao

cedar olive
#

bro

dull magnet
#

this is actually really nice

hasty stag
#

does it just make the number all of the char numbers then check which ones bigger or something

dull magnet
#

?

#

that didn't make a lot of sense but you can compare characters by their ascii value, so what that does is just compare each character

hasty stag
#

thats what i meant

dull magnet
#

wait why doesnt it complain

#

the func signature doesnt allow undefined

#

oh i think it's because the type implies that every string has a mapping

cedar olive
#

huh?

clear parcel
lone panther
#

you cant straight up impl Ord for String sadly because out-of-crate traits cannot be impled on out-of-crate structs

#

wait

#

wait a minute

#

i didn't even need to implement it myself

#

that's just the default behaviour in rust

#

for strings

hollow flame
#

I smell Rust

dull magnet
#

what other plugin fixes did people want

wide parrot
#

favourite files

ionic breach
#

@cedar olive pardon the ping but wtf
i was gonna start debugging the js just now as i have some time to look at it
and it just.... worked??????

#

i haven't done anything different

cedar olive
#

well that's good lol

ionic breach
#

(referring to the close folders thing)

#

yeah

#

im so confused

#

ive been restarting my discord all day

cedar olive
#

and it wasnt working?

ionic breach
#

yeah

cedar olive
#

🤨

ionic breach
#

but then i started it with

#

one of these

#

and now it works

cedar olive
#

that's for sure not the reason lol

ionic breach
#

right???

#

but that's the only thing i changed

#

i was going through my servers being like ugh it still bothers i have to click once to open the folder, once to open the server, and then again to close the folder

#

and then i was like fine ill look at the js to see if i typed something wrong somehow

#

and then... it worked

cedar olive
#

odd

ionic breach
#

it is a little laggy tho

#

idk why that is

#

like the closing animation is a slightly less smooth than when i open two folders at once

#

even tho it's the same function

#

no idea about that

ionic breach
#

okay final question, should i keep this as just a me customization or make a PR

#

do you think others would find this useful 🤔

cedar olive
#

I guess it doesnt hurt having it an option

ionic breach
#

it's like 8 more lines of code ish

#

ig ven can be like "why would anyone want this ?" and deny it

#

so it can't hurt

ionic breach
#

Then it closes smoothly

#

I feel like I should fix the lag before PR

novel gale
#

why wont the color of this change 😭

#

i put !important after the color code

#

but the color will not change

#

it remains

#

green

hollow flame
#

That's not a good sign

novel gale
#

what 💀

hollow flame
#

I went into inspect element

#

or whatever

#

and I clicked the Discord in the top left

novel gale
#

nooo this is quick css

#

its a css plugin in the actual app

#

no web browser

hollow flame
#

uh...

hollow flame
novel gale
hollow flame
#

Well, I ended up turning it red locally

novel gale
#

tell me HOW

hollow flame
#

changed the style of wordmarkWindows-2dq6rw

novel gale
#

in what way

#

what did u change

#

send me

hollow flame
#

Inspect element lol but like

#

Idk how to QuickCSS

novel gale
#

ah

hollow flame
#

How do you QuickCSS? 🥴

novel gale
#

no idea

#

i see code for smth i like

#

i copy

#

i paste

hollow flame
#

Like if I wrote CSS, where would I put it

novel gale
#

settings > vencord > open quick css

hollow flame
#

lol it works fine for me

#
.wordmarkWindows-2dq6rw {
    color: #00FF00 !important
}
#

this changed it green

#

oh, it doesn't work if I use ::after, though

novel gale
#

hm

#

let me take off that then

#

nvm i do need that

hollow flame
#

Why?

novel gale
#

because when i dont have it

honest stump
#

that font 💀

#

discord 2011

hollow flame
#

oh this is so weird

novel gale
#

that is bro

novel gale
hollow flame
novel gale
#

this is weird cuz i just

#

i just combined the two

#

by using ::before

novel gale
# hollow flame

maybe its because the theme i use changes the text already

#

so theyre liek fighting for it

#

idk

#

its weird

hollow flame
#

I just got logged out again

#

Should I be afraid

dull magnet
#

no

#

you get logged out if you restart with devtools open

honest stump
dull magnet
#

enable the NoConsoleWarn plugin to fix that

hollow flame
#

so then Discord's just crashing?

dull magnet
#

?

#

is it?

hollow flame
#

idk

#

it restarts but sends me to the login screen

#

I'm not restarting on purpose, so it should be crashing

drowsy chasm
#

If you regularly use DevTools it tends to do that

#

At least from my experience

hollow flame
#

Weird

#

ngl I forget it's possible to pop the devtools window out

chrome elbow
# novel gale why wont the color of this change 😭
.wordmarkWindows-2dq6rw {
  display: none;
  color: #bbb !important;
}

.wordmarkWindows-2dq6rw::after {
  content: 'endcord' !important;
  display: block;
  position: relative;
  width: 200px;
  height: 16px;
  line-height: 16px;
  font-family: var(--font-headline);
  font-size: 11px;
  font-weight: 600;
}

idk why the f is it purple instead of gray but eh

hollow flame
#

it just... hides it

#
.wordmarkWindows-2dq6rw {
    display: none;
    color: #FF00FF !important;
}

.wordmarkWindows-2dq6rw::after {
    content: 'meow' !important;
    display: block;
    position: relative;
    width: 200px;
    height: 16px;
    line-height: 16px;
    font-family: var(--font-headline);
    font-size: 11px;
    font-weight: 600;
}
chrome elbow
hollow flame
#

Fascinating

chrome elbow
hollow flame
#

oh well

#

I think I give up lol

#

this is way too strange

chrome elbow
#

fff turn green, ddd turn pink, then bbb turn purple lol

hollow flame
chrome elbow
#

their theme makes it turn like that

hollow flame
#

I didn't know that was something that's possible

wide parrot
#

if i play an animation from a spritemap on :hover
i have a reversed version of it playing when you stop hovering
how do i play that reverse animation from the step it got up to from :hover?

silk sorrel
#

Are you animating the spritemap using an offset?

cedar marsh
#

Thanks

dull magnet
#

the fix was just to downgrade to manifest v2

#

the same code didn't work on v3 but did work on v2

#

idk why

amber mantle
#

mv3 causes so many problems sm my y (do not dink me with fact checks I do not care)

#

sm my h

viral roost
#

SelectedChannelStore.getChannelId()

#

store is in commons

#

theres also an util to get the full channel object

near aurora
#

what is the current best practise for maintainable discord css regarding classes? discord seems to regenerate the hashes like semi-often, im wondering if i should just use class*= selectors...

#

not a huge fan of them but discord is already so bloated it might not even make a difference

woven lion
#

mappings are the most performant but can break for each update

#

|= is probably the best selector

near aurora
#

which mappings?

near aurora
woven lion
near aurora
#

breh

woven lion
#

|= is also slow but less so

near aurora
#

how would you make mappings like this?

#

like externalize them somehow?

#

idk

woven lion
#

there are a couple of projects i think that do them

#

you would have to research, its outside of my expertise

pure temple
#

could there be a plugin to remove the hashes?

#

i'm pretty sure my nitro blocker has stopped working by now lol

grim hare
#

removing hashes isn't really something you'd want to do

#

there are tons of classes that would be duplicates if you removed the hashes, like the container classes

covert nimbus
#

mm conflicting classes my beloved

tight epoch
#

Yeah I've had at least the having to log back in thing as well. Guessing it has to do with me having enabled window transparency, though weirdly enough it hasn't happened again since I turned the setting off, did a full restart, turned it back on, and did another full restart

tight epoch
#

Dumb idea:
Make as many elements as possible hover-to-reveal, including the textfield, sections in the profile popout(as well as the full profile menu), and just about anything and everything else, no matter how useless it would be trolley

fervent flowerBOT
#

just make the whole window hover reveal

tight epoch
#

Yeah I was thinking of doing that too lol

#

Wehh server bar doesn't want to hide again after being hovered over noooooo

fervent flowerBOT
#

terrifying

tight epoch
#

I doubt this'll work very well for everyone considering I used px for this, but if anyone for whatever reason were to wanna use this, whether to mess with it, use it in a theme, or try to make it work for different window dimensions and all that, here it is ig

/* The very reason I should not be given this much power: an abomination of a CSS script by DeadVoxels#3520 */
/* textfield */
.form-3gdLxP {
    margin-top: -36px;
    padding-top: 24px;
    margin-bottom: -58px;
    transition: all 350ms ease-in;
}
.form-3gdLxP:hover {
    margin-top: -24px;
    padding-top: 0px;
    margin-bottom: 0px;
    transition: all 150ms ease-out;
}

/* Member sidebar */
.container-2o3qEW {
    position: absolute;
    transition: all 350ms ease-in;
    right: -245px;
    padding-left: 15px;
}
.container-2o3qEW:hover {
    padding-left: 0px;
    right: 0px;
    transition: all 150ms ease-out;
}

/* Channel top bar thingie */
.title-31SJ6t {
    top: -36px;
    padding-bottom: 5px;
    transition: all 350ms ease-in;
}
.content-1jQy2l {
    margin-top: -36px;
    transition: all 350ms ease-in;
}
.title-31SJ6t:hover {
    top: 0px;
    padding-bottom: 0px;
    transition: all 150ms ease-out;
}
.title-31SJ6t:hover ~ .content-1jQy2l {
    margin-top: 0px;
    transition: all 150ms ease-out;
}

/* Channels sidebar */
.sidebar-1tnWFu {
    margin-left: -233px;
    padding-right: 5px;
    transition: all 350ms ease-in;
}
.sidebar-1tnWFu:hover {
    margin-left: 0px;
    padding-right: 0px;
    transition: all 150ms ease-out;
}

/* Servers sidebar */
.scroller-3X7KbA {
    margin-left: -64px !important;
    padding-right: 8px !important;
    transition: all 350s ease-in;
}
.scroller-3X7KbA:hover {
    margin-left: 0px !important;
    padding-right: 0px !important;
    transition: all 150ms ease-out;
}
#

Just realized I also did something that messes with the textfield scrolling, so uhhh Thumsup

dull magnet
#

nothing we can do to fix this, read the error

#

it's something broken about indexeddb

#

if you're using Firefox private mode that's why

#

did you open multiple instances of discord? that's also a reason

#

yeah that's not supported

#

for some reason electron locks the indexeddb file on your disk so using it from multiple instances doesn't work

#

don't use more than one instance

#

Mac?

#

is this vencord desktop or discord desktop

#

do you have openasar with multi instance enabled (I think that's a thing? )

#

oh I was just asking cause that'd mean our single instance logic is somehow flawed

#

but it seems to be Discord's being flawed

#

try uninstalling openasar

#

and see if it's fixed

#

yup it's fixed or yup gonna try?

#

oh so it's an OA bug

#

odd

ionic breach
#

Wait, separate from discord/Vencord?

#

Like, you said "i know i should switch from latte" so i mean, why?

#

Ah

#

K

#

Is there a good replacement

#

Yeah :/

eternal lion
#

Plank works on KDE iirc

#

thats the best replacement afaik

pure temple
proud parrotBOT
# pure temple https://github.com/Aliucord/Aliucord/blob/308b5d726bcde669e23f8cddc3be36578c82f9...

**MessageEmbedBuilder.java: **

/*
 * This file is part of Aliucord, an Android Discord client mod.
 * Copyright (c) 2021 Juby210 & Vendicated
 * Licensed under the Open Software License version 3.0
 */

package com.aliucord.entities;

import com.aliucord.Main;
import com.aliucord.utils.ReflectUtils;
import com.discord.api.message.embed.*;
import com.discord.api.utcdatetime.UtcDateTime;

import java.lang.reflect.Field;
import java.util.*;

/** {@link com.discord.api.message.embed.MessageEmbed} builder */
@SuppressWarnings({ "unused", "UnusedReturnValue" })
public class MessageEmbedBuilder {
    // reflect moment
    private static Field authorField;
    private static Field colorField;
    private static Field descriptionField;
    private static Field fieldsField;
    private static Field footerField;
    private static Field imageField;
    private static Field providerField;
    private static Field thumbnailField;
    private static Field timestampField;
    private static Field titleField;
... (487 lines left)
pure temple
#

ah, interesting

#

interesting how the class name is visible too

#

i'd expect it to be obfuscated

civic stone
#

You guys also think this code is weird or just me?

dull magnet
#

least boilerplatey java code

civic stone
#

I think it could be cleaner but not sure how since I started studying react now, i only know decently backend atm

dull magnet
#

u definitely dont need that in a react app

wide parrot
#

when the githubssdddsd

untold briar
#

sssdd

fallow urchin
#

I need help making a snippet to automatically go through all possible tags to friend someone don't ask me why

#

This is what I have so far, it's jank and thrown together pretty shoddily because I'm lazy and in a hurry

(() => {
    function range(start , end){
        let numbersArray = [];
        while (start <= end){ 
            numbersArray.push( start );
            start += 1;
        }

        return numbersArray;
    }

    const possibleTagNums = range(0, 9999);
    const possibleTags = possibleTagNums.map(num => num.toString().padStart(4, '0'));

    let tagIndex = 0;
    const interval = setInterval(() => {
        const tag = possibleTags[tagIndex];
        tagIndex++;
        if (tag == null || tag == undefined) return;

        document.querySelector("#uid_15").value = "SomeUser#" + tag;
        document.querySelector("button .lookFilled-1H2Jvj").click();
    }, 2000);
    window.stop = () => clearInterval(interval);
})()
#

It also assumes you're already on the Add Friend page

#

I'd also prefer if there was a way to make it possible to make this not get the user banned while using it (I assume the constant requests at a constant rate will cause an issue)

cinder wigeon
#

Well yeah API spam and selfbotting will always be a nono

#

What do you expect

fallow urchin
civic stone
# dull magnet u definitely dont need that in a react app

the modal loads all the work hours currently configured like: 1st: open modal with all fields to type in the work hours you want, 2nd: fill the fields with the currently used values
I think these are used for step 2.

Could probably be a single loop instead of calling 50 functions?

cinder wigeon
#

Why are you trying to brute force a discriminator anyways

ionic breach
#

sounds sus

civic stone
#

Discrimination not allowed in this channel

amber mantle
#

was there a list of flux dispatcher events

#

and if not does discord have one for retrieving the text in the chatbox

#

probably not L

dull magnet
sly oxide
#

hey, funny seeing you here lmao

#

i remember you from SOG

civic stone
opal fern
cold moth
#

Is there anything that could be helpful to add support for more image formats to Discord via Vencord so that one can send a file in that format and it displays/works just like other supported images?

In fact, there is code for a very cool file format as a chromium addon and it's only a few hundred lines long so I guess I might be able to adjust it but I haven't found any other plugin that adds support for file formats to Discord that I could take as a starting point to make it easier.

hollow flame
cold moth
#

For the displaying like other images part I would only need to get the link out of nonMediaAttachmentsContainer and then replace nonMediaAttachmentsContainer with a mediaAttachmentsContainer which seems to be the same across various image formats.
So the format would likely only need to get into electron and then display.

hollow flame
#

If you can get stuff to render properly in a browser, then you can get it to render properly in Discord

#

it's just a matter of having Discord recognizing the mime types and handling them accordingly

#

Part of me feels like you can do that with CSS only, but I wouldn't know, honestly

cold moth
hollow flame
#

what kind of formats are we talking

#

some stuff isn't going to be so easy

cold moth
hollow flame
#

That is precisely where things get nasty, sadly

#

Browsers don't appear to natively be capable of handling "jxl" files

#

So, you'd basically need to rewrite this extension as a plugin

#

and on top of that, force Discord to make it work

cold moth
#

Yeah

#

I suspect it would work when I can make it display in electron apps

hasty stag
#

the way they do it would probably work for discord

#

they just decode the image and put the contents onto a canvas

#

but it would need a plugin

hollow flame
#

I think you'd probably need to convert to a PNG/JPEG in order for things to work properly on Discord

#

but I wouldn't know, honestly

hasty stag
#

thats pretty much what they do

#
let width = Module.getValue(info + 4, "i32")
        let height = Module.getValue(info + 8, "i32")
        let size = width * height * 4
        
        output = malloc(size)
        
        if (Module._JxlDecoderSetImageOutBuffer(decoder, format, output, size))
            error("could not set output buffer")
        
        if (Module._JxlDecoderProcessInput(decoder) !== 0x1000)
            error("could not finish processing input")
        
        let image = new ImageData(width, height)
        image.data.set(Module.HEAPU8.subarray(output, output + size))
        
        let canvas = new OffscreenCanvas(width, height)
        let context = canvas.getContext("2d")
        context.putImageData(image, 0, 0)
        
        let blob = await canvas.convertToBlob()
        if (!blob) error("could not convert to Blob")
        
        let url = URL.createObjectURL(blob)
``` this is the main code in worker.js
cold moth
#

Ah, lol. That might actually make it easier then.

cold moth
#

Um, I get this when I run pnpm test, no matter if executed in root directory of Vencord or in the folder I created for the plugin.
System:
Arch Linux x86_64
node v18.15.0
electron v22.3.3
pnpm 8.2.0

#

Normal build of Vencord using pnpm build works however.

shrewd yacht
#

how can I make it so all messages are raw by default, so there is no markup at all?

shrewd yacht
#

I want to use discord raw.

lone panther
#

delete discord and install an IRC client?

shrewd yacht
#

yeah I want to make discord more irc like

shrewd yacht
#

true

#

I use arch btw

civic stone
#

I use venOS

ionic breach
#

it's called venOS because it was made by ven

hardy onyx
#

hello would it be possible to make the typing caret glide smoothly as i type instead of it teleporting for each character?

opal fern
#

Oops

tight epoch
hardy onyx
wide parrot
#

probably

pure temple
plain temple
#

is it possible to make a snippet that changes the size of reactions?

dull magnet
#

(they're asking how to do that with css :P)

chrome elbow
hollow flame
#

Part of me does feel like reactions should be a li'l bigger honestly

#

Some of my glorious emoji are ruined since they're so small

#

such as

hollow flame
#

Jesus on a stick

lone panther
#

10/10 no notes

lone panther
ionic breach
#

Y'all, i know you can place a breakpoint for clickable elements like folders opening. If i wanted to style something that doesn't normally change- like the color of your text box- but have it change per server.

How would I breakpoint that?

cedar olive
#

patch the text bar to add the additional color style

#

you will have to figure where to get the guild id too

#

the bar component will probably have the channel obj which you can get the id from

ionic breach
#

So no breakpointing i guess? Just find relevant code and alter it?

cedar olive
#

yeah

ionic breach
#

Oki

cedar olive
#

use the react dev tools

ionic breach
#

What if I've added code and nothing happens

#

And the patch says OK

#

Nvm this is too situation dependent

#

I'll tell u more about it when I get time to think about it again

cedar olive
#

this might be the exact component, but as you can see the channel is a prop

#

the correct component to patch will have the channel too

ionic breach
#

Ooo that's so many levels of letters 😵‍💫

#

Wait before you're tempted to code this for me I'm not actually trying to change the color of the text chat area ;-;
I just used that as an example because i wanna do the thing I'm trying to do by myself without asking too too much help

#

I'll probably cave eventually but i don't want you wasting more time 😅

cedar olive
#

oh

#

found it

#

I think

ionic breach
#

Oop

#

Uh

cedar olive
#

.Messages.FOLLOW_NEWS_CHAT_INPUT_MESSAGE

#

here's a string for you to search and find

cedar olive
cedar olive
#

Idk if it's this lol

ionic breach
#

(I'm too late arnt i)

cedar olive
#

OH LMAO

#

nah you are fine

#

I was just searching for the component

ionic breach
#

Renderlurkermodeupsellpopout

#

🤔

cedar olive
#

yeah idk if it's the right thing

#

cuz of that popout stuff

ionic breach
#

I wonder what that even means

#

"lurkermode" sounds fake

green vessel
#

thinking of trying my hand at a simple theme

hasty stag
dull magnet
#

themeing requires a bunch of hacky stuff because u can't control the layout so if u wanna do something the layout wasn't made for (like reorder elements, change content, etc) u gotta do funnies

#

but yeah it's just those

#

there's not really any secret

plain temple
chrome elbow
plain temple
#

tysm

jagged dune
#

is it possible to know when i added someone to my friends list

frail quest
vernal mortar
#

does anyone how I could get the "unread" messages?

#

I can only find .getUnreadCount

#

I guess I can just get last X messages in the chat?

dull magnet
#

try findStore("ReadStateStore")

vernal mortar
#

no idea how to do that tho

dull magnet
#

random shot in the dark trolley

vernal mortar
#

where in the world can I try that

dull magnet
#

console

vernal mortar
#

right, forgot there is a console haha

#

running that command returns "findStore" is not defined

dull magnet
#

enable console shortcuts

vernal mortar
#

uhm

#

i really dont know what that is

#

where to enable it, I mean.

chrome elbow
#

it is a plugin

vernal mortar
#

right

#

done

#

now what

#

oh

#

i think i found some more

chrome elbow
#

now try that findStore thing

vernal mortar
#

yeah that's done

#

think i found something

#

I think I found what I was looking for

#

now the question is how I'm going to get the messages from that

dull magnet
#

lol I guessed correctly

vernal mortar
#

yup

dull magnet
vernal mortar
#

i can see there is a messegesAPI

#

from some examples

#

is there any documentation for it or naww

dull magnet
#

juts use the methods on that store

#

what r u even trying to do

vernal mortar
#

get the text from the unread messages

#

in the current channel

dull magnet
#

yeah u probably just need that store then

vernal mortar
#

unfortunately, from what I've seen, no

dull magnet
#

getGuildChannelUnreadState seems promising

vernal mortar
#

Yeah but from the info there it's prob just the length

dull magnet
#

have u tested it

vernal mortar
#

some code on those awful obfuscated scripts seem to only use "count"

#

since the only things needed is just a bar and also a number, not really the messages themselves

dull magnet
#

minified not obfuscated bleh

vernal mortar
dull magnet
#

try the method and see what it returns

vernal mortar
#

aight

#

time to figure out how the hell to do that now

#

this is the reference i have and I understand nothing lmao (unindent.ts)

            replacement: {
                match: /,content:([^,]+),inQuote/,
                replace: (_, content) => `,content:Vencord.Plugins.plugins.Unindent.unindent(${content}),inQuote`
            }
#

cannot find how that works on docs

#

only replacing the whole function

#

mind helping meh? :)

#

im gonna try my best

dull magnet
#

it patches the function code

vernal mortar
#

my question was how to use that

#

and do it myself

vernal mortar
dull magnet
#

just call it

vernal mortar
#

where

#

and how

#

console errors

dull magnet
#

findStore("ReadStateStore").getGuildChannelUnreadState(some, args)

vernal mortar
#

ah, like that

#

i now need to figure out what (e, t, n, r, i, o) means

#

i tried with some "dummy" arguments and got this thoi

viral roost
#

you can see where the function is by looking at the primary store

vernal mortar
#

yeah i got that

#

my issue is that i dont know how to use it

viral roost
#

this is the whole function so figure out what He.getValue is with a breakpoint

vernal mortar
#

where'd you find that?

chrome elbow
#

ctrl shift f in devtools

viral roost
#

[[FunctionLocation]]

#

you can see in the ss

viral roost
#

now just a moment because discord decided to freeze

vernal mortar
viral roost
#

yeah you can search for where its declared

#

usually .funcName=function( or funcName:function

vernal mortar
#

Hmmmm, you mean this?

chrome elbow
#

click { }

vernal mortar
#

oh, where its decalred

viral roost
#

yeah

chrome elbow
#

to make it easier to read

vernal mortar
dull magnet
#

then put a breakpoint in the function

#

do smth that will trigger it to be called

vernal mortar
#

alright

dull magnet
#

like switching channel

#

see what arguments discord passes

viral roost
#

He.getValue is

e.getValue = function(t) {
    var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ne.W.CHANNEL, i = arguments.length > 2 ? arguments[2] : void 0, o = arguments.length > 3 ? arguments[3] : void 0, a = null === (n = e._readStates[r]) || void 0 === n ? void 0 : n[t];
    return null == a ? o : i(a)
}
#

which looks like chinese at first

dull magnet
#

that just means that all of the args are optional

viral roost
#

what you probably care about is the arguments you need to pass to getGuildChannelUnreadState though

dull magnet
#

only the first arg is required

viral roost
#

thats actually useful to know

viral roost
#

look at how it's used to figure out where to get it frm

viral roost
#

so finally,

#

...which does not give the actual messages

#

wait can't you just get the unread count, MessageStore.getMessages() and then only show the last n messages?

dull magnet
#

like

#

getValue(channelId, stuff = Foo.CHANNEL)

amber mantle
#

hm

silk sorrel
#

it just increases the size of the compiled code

dull magnet
#

backwards compat

#

their bundler settings are terrible because they have backwards compat for like internet explorer but then ruin it by having some es6 parts

silk sorrel
#

lmao

dull magnet
#

no IE support

silk sorrel
#

are there any tools to unminify discord code to remove stuff like this

dull magnet
#

why

silk sorrel
#

maybe even generate pseudocode, and add the original export or module.exports

silk sorrel
dull magnet
#

just get used to it :P

cedar marsh
#

I am jealous of how vue's scoped css works.

Would make custom css so much easier

dull magnet
#

how would that make it easier

cedar marsh
#

Instead of [class^=] you can just use the actual selector

dull magnet
#

be happy with what u have

#

do u want these instead

cedar marsh
#

Ew

dull magnet
#

or these

viral roost
cedar marsh
viral roost
#

same i was about to ask if thats tailwind

cedar marsh
vernal mortar
#

It's what I was saying actually

#

i said from the beginning that it only returns the number

#

because of how css only needs the number to organise it

#

sorry for delayed answer, i didn't realise I had the channel on favourites and I couldn't find it lol

#

this function gives the count of unread messages, thats why I need it

#

though im just realising that it doesn't return the number

#

just the state

#

uh oh

#

hmmm I'm trying another function but.. i get the same number

#

I suspect I need another argument

dull magnet
#

u pass a channel id usually

vernal mortar
#

just the id

#

alright

#

It works!

#

i had to pass a string with the ID

#

thanks!

#

Would you mind explaining to me how I would now implement this code?

#

I'm very confused with the CONTRIBUTING.md

#

Get the ID of the module you want to patch. To do this, go to it in the sources tab and scroll up until you see something like 447887: (e,t,n)=>{ (Obviously the number will differ).
This part for example, I do not understand. Scroll up in what document?? The only thing I can find is where it is declared, but there is nothing about an ID or any of that

amber mantle
#

you'll see that usually if you scroll up far enough

#

and make sure it is an actual discord file, and not WebpackModule[numbers] because those are vencord patched files

vernal mortar
#

it is not indeed

#

oh

#

i think i found it

#

who would have guessed I needed to go up 20 thousand lines

dull magnet
#

lol

vernal mortar
#

this is probably the most confusing thing ive ever done

#

I need help

#

I think I'm really awful with regex

#

can anyone explain to me if this right? And what the hell do I have to type in the replace? The documentation just list to a wiki from mozilla but it's got so many lines and I cannot learn ALL when I only need 1 thing from there

#

Either I'm dumb or the tutorials are confusing

cedar olive
#

I dont understand why almost every discord modules start with the same code

#

duplicated over and over

#

why dont they re-use

vernal mortar
#

gud ap

dull magnet
cedar olive
#

I will show you when I get home

dull magnet
#

u mean this?

cedar olive
#

thats one

dull magnet
#

polyfills & swc helper stuff

#

idk

cedar olive
#

but why is it duplicated

dull magnet
#

discord moment

cedar olive
#

insane

dull magnet
#

they could just import it yeah

cedar olive
#

thousands of modules have that same code

dull magnet
#

thousands is maybe a bit exaggerated but yeah

#

also the godawful generator runtime

cedar olive
#

The replacement is an object or array of objects that contains the patches that will be applied

#

Match is a regex used to select the code you want to modify, and capture anything you may need (like variable names)

#

replace is the value to replace the match with

#

you can use capture groups, or even in the whole match inside your replace

proud parrotBOT
# cedar olive https://github.com/Vendicated/Vencord/blob/main/docs/2_PLUGINS.md

**2_PLUGINS.md: **

# Plugins Guide

Welcome to Megu's Plugin Guide! In this file, you will learn about how to write your own plugin!

You don't need to run `pnpm build` every time you make a change. Instead, use `pnpm watch` - this will auto-compile Vencord whenever you make a change. If using code patches (recommended), you will need to CTRL+R to load the changes.

## Plugin Entrypoint

> If it doesn't already exist, create a folder called `userplugins` in the `src` directory of this repo.

1. Create a folder in `src/userplugins/` with the name of your plugin. For example, `src/userplugins/epicPlugin/` - All of your plugin files will go here.

2. Create a file in that folder called `index.ts`

3. In `index.ts`, copy-paste the following template code:

```ts
import definePlugin from "@utils/types";

export default definePlugin({
    name: "Epic Plugin",
    description: "This plugin is absolutely epic",
    authors: [
        {
            id: 12345n,
            name: "Your Name",
        },
    ],
    // Delete `patches` if you are not using code patches, as it will make
    // your plugin require restarts, and your stop() method will not be
... (86 lines left)
cedar olive
#

look at this

vernal mortar
cedar olive
#

Two things about your current patch: getUnreadCount exists on multiples modules, your find is likely to break

vernal mortar
cedar olive
#

your match contains formatted code, you need to match the unformatted one

vernal mortar
#

okay wait

#

when I add that to my find

#

regardless if its correct or not

#

Will my code be run whenever that function is triggered in the original code? (discord itself)

#

Or is it just like doing import bar

cedar olive
proud parrotBOT
cedar olive
#

look at that plugin

vernal mortar
#

I will

#

give me one second

#
        {
            find: ",acceptInvite:function",
            replacement: {
                match: /INVITE_ACCEPT_SUCCESS.+?;(\i)=null.+?;/,
                replace: (m, guildId) => `${m}$self.handleMute(${guildId});`
            }
        }
cedar olive
#

do you know regex?

vernal mortar
#

Not really

#

At least not in other languages

#

only odd ones. So I only understand the concept

cedar olive
#

you need to know the basics to make one to work with vencord

#

btw \i is a special vencord thing to match variables names

vernal mortar
#

Hmmmm

#

I'm going to try asking AI to summarise it

cedar olive
#

It gets transformed into something else before matching

#

$self is a reference to the plugin obj

vernal mortar
#

I don't want to ask you everything, don't wanna bother so much

cedar olive
#

you use it to access functions you define inside the plugin obj

vernal mortar
#

What I'm most confused about is this line /INVITE_ACCEPT_SUCCESS.+?;(\i)=null.+?;/,

#

and this (m, guildId). Is this supposed to be the borrowed variables?

cedar olive
#

m is the whole regex match

#

guildId is my first capturing group

#

thats just a function that returns a string

#

now the first line is a regex

vernal mortar
#

right

cedar olive
#

match the text INVITE_ACCEPT_SUCESS literally, keep going forward until you find ;someVarName=null<MORE CODE I DONT CARE ABOUT>;

vernal mortar
#

so I would need m no matter what

cedar olive
#

depends

#

sometimes you dont need the match

cedar olive
#

that's our guildId

vernal mortar
#

oh

#

looks like chinese to me but

cedar olive
#

m would be that whole match, from INVITE_ACCEPT_SUCCESS to the last ; expected

vernal mortar
#

so the match

#

alright

#

so say I want to observe a variable

#

the one that is returned with getUnreadCount

#

actually wait no

#

Sheesh this is very complicated

#

okay i think i know what to ask

#

So then, how can I add an event that will call a function whenever a new channel is oppened

cedar olive
#

it's complicated but extremely powerful

cedar olive
vernal mortar
#

thats what I thought

cedar olive
#

FluxDispatcher has an event called CHANNEL_SELECT that gets fired when you select a channel

vernal mortar
#

Thing is, I only want to read an event and observe a variable

cedar olive
#

sorry I couldn't understand

#

what do you mean observe

vernal mortar
#

let met write some kind of pseudo code

#

really quickly

cedar olive
#

aight

vernal mortar
#
on channel selected:
  - set `unreads_amount` to getUnreadCount()
  - clamp `unreads_amount` to 50
  - get messages
  - get last *unreads_amount* amount of messages from messages

define `organise_messages()`:
  - blah blah blah
  - return x, y

define `add_popup()`, with info `messages`:
  - get `x` and  `y` calling `organise_messages(messages)`
  - create the popup
  - display `x` and `y`

#

pretty much that

cedar olive
#

It's hard for me to help you on mobile but you need no patch for that

#

You can do all that on the FluxDispatcher callback

#

FluxDispatcher.subscribe("CHANNEL_SELECT", (...args) => ...);

#

and to get the unread count use the function from the ReadStateStore (I think that's the name)

vernal mortar
#

I updated the message, I think that is also important to determine what I need

#

I haven't seen any plugins that have a popup

#

or messages from vencord itself asking to update or could changes

#

but not a static popup that can be closed

cedar olive
#

what kinda of popup

#

modals?

#

I think modals are what you want

#

look at the settings of some plugin

vernal mortar
#

if models don't annoy the user and simply provide information then yes

cedar olive
#

is that what you want?

vernal mortar
#

what plugin?

cedar olive
#

any plugin

#

click the settings button

#

on any that have

#

dont think it's what you want though

vernal mortar
#

only thing i can find is plugins that add something to the existing UI

cedar olive
#

nono I mean

#

go to your discord settingsp

#

plugins tab

#

and click on the settings of any plugin

vernal mortar
#

wait shit i dont have gimp installed

vernal mortar
cedar olive
#

hmm

#

closest thing I can think is notifications

#

you can put a custom component on them

#

not sure how big it can be though

vernal mortar
#

i got a VERY SIMPLE concept

vernal mortar
#

on dms

#

wait now that I think about it

#

can I also try making a command to test it?

#

and maybe run that command, or set a setting for it

#

like those custom commands that where Clyde answers

dull plume
fervent flowerBOT
#

Or fluent thme

#

One of those names I think

#

I am a liar

vernal mortar
fervent flowerBOT
#

I was in fact not a liar

dull plume
vernal mortar
fervent flowerBOT
#

I think its this @dull plume

tardy fog
nocturne dawn
#

Would there be any way to have the Close DM context menu button initiate a prompt asking for confirmation in CSS, or would it have to be a plugin?

#

For reference

dull magnet
#

js

#

css cannot add stuff ike that

nocturne dawn
#

ah alright

vernal mortar
pure temple
#

display: none

#

but that's kind of useless

green vessel
nocturne dawn
#

if i close it

civic stone
#

Edge and windows server is the best way to host a node application. ☠️

vernal mortar
#

edge is faster on linux, or so they say.

#

if only it didnt suck

hollow flame
shrewd yacht
vernal mortar
vernal mortar
hollow flame
vernal mortar
hollow flame
#

:T

cinder wigeon
#

edge is just microsoft chromium

vernal mortar
#

:TSInstall

cinder wigeon
#

chrome is just google chromium