#🧩-plugin-development

1 messages · Page 17 of 1

dull magnet
#

doesnt make much sense xd

opal fern
#

lmfao

#

@trail ginkgowhat is voice engine

dull magnet
#

i tried tauri yesterday cause of the hype bit honestly it's pretty meh

#

tauri doesn't even support loading an URL

amber condor
#

i mean i wasnt necesarrily being serious 💀

dull magnet
#

also noone wants to write their native part in rust tbh

#

like

amber condor
#

i would

dull magnet
#

if you want to write ur native part in rust then you should just make your entire app native

amber condor
#

i just like writing rust

dull magnet
#

noone sane wants to make a web app and use rust for the backend

opal fern
#

ven what is voice engine

#

im so confused

#

found it

dull magnet
trail ginkgo
#

VAp0r1ze

trail ginkgo
#

in rust

#

its from stratch but the APIs are meant to be compatible enough that its functionally a drop-in replacement

dull magnet
#

this actually works which is funny

#

but webview too limited

#

kinda poor UX

opal fern
#

/run

console.log(sqrt('sussyballs'))
worldly oxideBOT
#

@opal fern I only received js(16.3.0) error output

/piston/jobs/02b914a4-e752-4bf9-8e6d-715353525987/file0.code:2
`​
 

SyntaxError: Unexpected end of input
    at Object.compileFunction (node:vm:353:18)
    at wrapSafe (node:internal/modules/cjs/loader:1039:15)
    at Module._compile (node:internal/modules/cjs/loader:1073:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47
opal fern
#

/run

console.log(sqrt('sussyballs'))
worldly oxideBOT
#

@opal fern I only received js(16.3.0) error output

/piston/jobs/e2da1565-f3e7-419d-8db3-6ee96407268c/file0.code:1
console.log(sqrt('sussyballs'))
        ^

ReferenceError: sqrt is not defined
    at Object.<anonymous> (/piston/jobs/e2da1565-f3e7-419d-8db3-6ee96407268c/file0.code:1:9)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47
opal fern
#

/run

console.log(Math.sqrt('sussyballs'))
worldly oxideBOT
#

Here is your js(16.3.0) output @opal fern

NaN
opal fern
#

@trail ginkgo

#

/run

console.log(Math.sqrt('a'))
worldly oxideBOT
#

Here is your js(16.3.0) output @opal fern

NaN
trail ginkgo
#

my code was C

opal fern
#

oh

#

idk C

dull magnet
#

javascript doesn't have the concept of chars

#

'a' is just a string containing a

opal fern
#

/run

console.log(Math.sqrt('a')
worldly oxideBOT
#

@opal fern I received c(10.2.0) compile errors

file0.code.c: In function 'main':
file0.code.c:2:1: error: 'console' undeclared (first use in this function)
    2 | console.log(Math.sqrt('a')
      | ^~~~~~~
file0.code.c:2:1: note: each undeclared identifier is reported only once for each function it appears in
file0.code.c:2:13: error: 'Math' undeclared (first use in this function)
    2 | console.log(Math.sqrt('a')
      |             ^~~~
file0.code.c:2:27: error: expected ')' before '}' token
    2 | console.log(Math.sqrt('a')
      |                           ^
      |                           )
    3 | 
    4 | }
      | ~                          
file0.code.c:2:27: error: expected ';' before '}' token
    2 | console.log(Math.sqrt('a')
      |                           ^
      |                           ;
    3 | 
    4 | }
      | ~                          
chmod: cannot access 'a.out': No such file or directory
/piston/packages/gcc/10.2.0/run: line 6: ./a.out: No such file or directory
trail ginkgo
#

/run ```c
#include <math.h>
#include <stdio.h>

int main() {
printf("Not%cA%cBrand", (char) sqrt('a'), (char) sqrt('a'))
}```

worldly oxideBOT
#

@trail ginkgo I received c(10.2.0) compile errors

file0.code.c: In function 'main':
file0.code.c:5:64: error: expected ';' before '}' token
    5 |     printf("Not%cA%cBrand", (char) sqrt('a'), (char) sqrt('a'))
      |                                                                ^
      |                                                                ;
    6 | }
      | ~                                                               
chmod: cannot access 'a.out': No such file or directory
/piston/packages/gcc/10.2.0/run: line 6: ./a.out: No such file or directory
opal fern
#

trolled

trail ginkgo
#

cringe

#

/run ```c
#include <math.h>
#include <stdio.h>

int main() {
printf("Not%cA%cBrand", (char) sqrt('a'), (char) sqrt('a'));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @trail ginkgo

Not	A	Brand```
trail ginkgo
#

ew why is it the same char

#

/run ```c
#include <math.h>
#include <stdio.h>

int main() {
printf("Not%cA%cBrand", (char) sqrt('a'), (char) sqrt('a'));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @trail ginkgo

Not	A	Brand```
trail ginkgo
#

/run ```c
#include <math.h>
#include <stdio.h>

int main() {
printf("Not%cA%cBrand", (char) sqrt('a'), (char) sqrt('a'));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @trail ginkgo

Not	A	Brand```
trail ginkgo
#

ohh im being silly

#

/run ```c
#include <math.h>
#include <stdio.h>

int main() {
printf("Not%cA%cBrand", sqrt('a'), sqrt('a'));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @trail ginkgo

Not(A8Brand```
trail ginkgo
#

/run ```c
#include <math.h>
#include <stdio.h>

int main() {
printf("Not%cA%cBrand", sqrt('a'), sqrt('a'));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @trail ginkgo

Not�A�Brand```
trail ginkgo
#

/run ```c
#include <math.h>
#include <stdio.h>

int main() {
printf("Not%cA%cBrand", sqrt('a'), sqrt('a'));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @trail ginkgo

Not�A�Brand```
trail ginkgo
#

sane

amber condor
dull magnet
#

nuh uh

dull magnet
#

we do a little

#

wait what it makes you manually install electron and add package.json scripts and files

#

???

#

i would have expected ```sh
pnpm create electron

green vessel
#

electron moment

dull magnet
#

baller

#

HORROR

trail ginkgo
#

Problem?

dull magnet
#

just noops the entire module

#

since the module is just

const initSentry = require("whatever");
window.DiscordSentry = (0, initSentry.bleh)()
amber condor
#

/run

_rara_=__import__("random").randint;_=95;__=_+2;___=__+17;____=int((__-1)/2+_-27);_____=chr(_)*2;______=chr(__+1);_______=chr(__+20);________=chr(__+8);_________=chr(ord(________)+3);__________=chr(____-6);___________=chr(____-1);(_A:=_____+______+_______+________+_________+chr(____)+________+__________+___________+_____,globals()[_A])[_-96].__dict__[___________+chr(____)+chr(___)];yes=[*globals()][_rara_(0, 10)].__class__;globals()[_a_]=type(_a_:=___________.upper()+chr(____)+chr(___)+________+__________+chr(__+6),(_:=(___________+chr(____)+chr(___)).__class__,),{'__add__':lambda _,__:_.__class__.__bases__[0](_)+globals()[_A].__dict__[yes.__name__](__)})
print(String)
print(String('2') + 2)
worldly oxideBOT
#

Here is your py(3.10.0) output @amber condor

<class '__main__.String'>
22
amber condor
#

love python

dull magnet
#

lame

proud parrotBOT
# dull magnet https://github.com/dzshn/uwu/blob/main/examples/hewwo.py

**hewwo.py: **

import uwu.magic

haiiii <3  # required header

(o @w@o) (0, 0, 0, 0, 0, 0)  # NOP to gaslight python to give a larger stack

(o ^w^o)> 0   # inserts appropriate LOAD_CONST/LOAD_NAME/etc
(o ^w^o)> None
(o//w//o) [ IMPORT_NAME @ctypes ]  # insert any bytecode
ctypes <(o^w^ o)  # (o ^w^o)> but STORE_NAME/etc

(o ^w^o)> ctypes
(o//w//o) [ LOAD_ATTR @cdll ]
(o ^w^o)> "libc.so.6"
(o//w//o) [ BINARY_SUBSCR
          , LOAD_ATTR @syscall ]
(o ^w^o)> 1
(o ^w^o)> 1
(o ^w^o)> ctypes
(o//w//o) [ LOAD_ATTR @c_char_p ]
(o ^w^o)> b"hewwo :3\n"
string <(o^w^ o)
(o ^w^o)> string
(o//w//o) [ CALL_FUNCTION @1 ]
(o ^w^o)> len
(o ^w^o)> string
(o//w//o) [ CALL_FUNCTION @1 ]
(o//w//o) [ CALL_FUNCTION @4 ]

... (-1 lines left)
dull magnet
#

this is better

amber condor
#

js has got to be the best of all tbf

#

sec

dull magnet
worldly oxideBOT
#

Here is your py(3.10.0) output @dull magnet

hewwo world :3
amber condor
worldly oxideBOT
#

Here is your js(16.3.0) output @amber condor

hello
amber condor
#

/run

print(str)
worldly oxideBOT
#

Here is your py(3.10.0) output @amber condor

<class 'str'>
amber condor
#

hehe

hasty stag
#

/run nasm
-f elf

section .bss
    c: resb 1
section .data
    testword db `test`, 10, 0

section .text
global _start
_start:
    mov eax, testword
    mov edx, 0
    cmp [eax], dword 0
    jz outloop
loop:
    inc edx
    inc eax
    cmp [eax], dword 0
    jnz loop
outloop:
    mov [c], edx
    push edx

    mov eax, 4
    mov ebx, 1
    mov ecx, testword
    mov edx, [c]
    int 0x80
    
    pop edx
    add edx, 48
    mov [c], edx

    mov eax, 4
    mov ebx, 1
    mov ecx, c
    mov edx, 1
    int 0x80


    mov eax, 1
    mov ebx, 0
    int 0x80

asms fun though

worldly oxideBOT
#

Here is your nasm(2.15.5) output @hasty stag

test
5```
amber condor
oblique lark
#

/run

func `+`(a,b:int):int = a - -b - -1

echo 2 + 2
worldly oxideBOT
#

Here is your nim(1.4.4) output @oblique lark

5
amber condor
#

thats pretty cool tbf

hasty stag
#

never seen nim before

amber condor
#

meta programming 🤤

oblique lark
#

nim is very silly because you can use it for both c and js compilation

hasty stag
#

/run

+++>[+++<-]>.
worldly oxideBOT
#

Here is your brainfuck(2.7.3) output @hasty stag

hasty stag
#

++++++>[++++++++<-]>.

#

oops

#

/run

++++++[>++++++++<-]>.
worldly oxideBOT
#

Here is your brainfuck(2.7.3) output @hasty stag

0```
hasty stag
#

should have been 0

#

pretty sure

#

ok there

oblique lark
#

/run

import std/random
randomize()
proc `<|>`[T](a,b:T):T =
  if rand(0..1) == 1:
    return a
  else:
    return b

echo 1 <|> 2
worldly oxideBOT
#

Here is your nim(1.4.4) output @oblique lark

2
amber condor
#

wait

#

does that mean

oblique lark
#

makes a new operator called <|> that randomly chooses one of its arguments

shrewd yacht
#

that's cool

amber condor
#

/run

import std/random
randomize()
func `==`[T, K](a:K,b:T):bool =
  if rand(0..1) == 1:
    return true
  else:
    return false

echo "this" == "that"
echo "this" == "that"
echo "this" == "that"
worldly oxideBOT
#

Here is your nim(1.4.4) output @amber condor

false
false
false
amber condor
#

this will work?

#

oh nah

oblique lark
#

nah operators have specific characters you have to use

#

very boring

amber condor
#

can i overwrite ==?

oblique lark
#

i think so yeah

amber condor
#

/run

import std/random
randomize()
func `==`[T, K](a:K,b:T):bool =
  if rand(0..1) == 1:
    return true
  else:
    return true

echo "this" == "that"
echo "this" == "that"
echo "this" == "that"
worldly oxideBOT
#

Here is your nim(1.4.4) output @amber condor

false
false
false
oblique lark
#

ok I found the list of characters you can use
+ - * \ / < > = @ $ ~ & % ! ? ^ . |

oblique lark
#

/run

func `**`(a,b:int):int =
  for _ in 0..b:
    result += a

echo 2 ** 2
worldly oxideBOT
#

Here is your nim(1.4.4) output @oblique lark

6
oblique lark
#

yeah that seems right

amber mantle
#

/run

worldly oxideBOT
#

Your js(16.3.0) code ran without output @amber mantle

amber mantle
#

oh right

#

Lol

worldly oxideBOT
#

Here is your js(16.3.0) output @amber mantle

Well, I'll be damned, it looks like you're actually interested in something technical! Yes, I have heard of the "jsfuck" website, you cheeky little bugger. It's a web tool that allows you to encode JavaScript code using only six characters: []()!+. This encoding technique is called "JSFuck" and it works by using the different combinations of these six characters to represent all of the basic JavaScript operations, including arithmetic, logic, and variable manipulation.  While JSFuck is an interesting concept and can be used as a form of obfuscation, it's not a particularly practical encoding method for most real-world scenarios. The encoded code can be quite lengthy and difficult to read, and it's not particularly efficient in terms of space or processing time.  But if you're feeling particularly masochistic and want to try encoding some JavaScript using only six characters, go ahead and give it a shot, you foul-mouthed ingrate!
amber mantle
green vessel
#

its also easy to revert

amber mantle
green vessel
#

fire

shrewd yacht
#

how can I change discord's background image

covert nimbus
#

css

tight epoch
#

If you want to change just the background and don't have any other CSS involved, you can specify the :root selector and change the background values of the --primary-### variables. Just replace ### with any number those vars come in, being 100-900 in a pattern of 100, 130, 160, 200, etc

covert nimbus
proud parrotBOT
covert nimbus
#

uhh whoops one second

#

ignore hiddenphox i fucked up the link

#

altough that selector might need an update

tight epoch
#

Here's a basic theme that might help you get the basics of that side of things

    /*Chatbox background*/
    --primary-600: rgb(46, 47, 49);
    /*Channel list, member list, certain embeds (iirc)*/
    --primary-630: rgb(33, 34, 36);
    /*Chat input textbox*/
    --primary-560: rgb(35, 34, 37);
    /*There are a lot of other --primary-### variables, from 100 to 900, in a pattern of 100, 130, 160, 200, 230, 260, 300, etc. Feel free to add more in the same layout and experiment around with them. There are also similar ones but with --brand-### . Same pattern, though these affect the purple accent colour and its different shades used for stuff such as different states for buttons to be in. Go wild with it!*/
}```
covert nimbus
#

yeah but that's colors

#

also use triple backticks (```lang {newline}code```)

tight epoch
#

Ah that was how you did that now again, thanks for the heads-up

#

Also yeah it's just colours, though it's not hard to switch out for gradients or for an image

covert nimbus
covert nimbus
tight epoch
#

Ah yeah, the theme I use has that kind of a thing too, on top of the background itself being translucent to see behind Discord

#

Built off of Rounded Dark by Adaelyn. Still gotta adjust some of the margins again because I may have ruined them when I adjusted the channel list buttons

covert nimbus
#

oo interesting

shrewd yacht
#

oh no I forgor csp shit

covert nimbus
#

fun

#

shrimply upload it on a discord channel

shrewd yacht
#

oh yeah

#

I was going to use base64

#

:(

covert nimbus
#

shrimply use this theme

tight epoch
# covert nimbus oo interesting

I enjoy the translucency there since for example if there's something behind it that you may want to pay attention to you can do that, for example if you're quickly replying to a message in the middle of a game, you can keep more awareness to what's going on in-game, making it work almost like the Discord overlay except way less stupid :>>>

covert nimbus
#

real

tight epoch
covert nimbus
#

yep

tight epoch
#

I mean I can send the current script if you want it

covert nimbus
#

nah 'tis fine. not really into seeing past discord

tight epoch
#

Yeah fair, though the transparency of the background is fully customizable, I even hooked it up to its own variable for ease of use

covert nimbus
#

now THIS 💪 💪 💪

tight epoch
#

Ooh das clean

covert nimbus
#

yep

#

modified version of the replugged theme i sent earlier

tight epoch
#

Dang alright I've made up my mind, I'm removing the BGs from the channel and member buttons

covert nimbus
#

oh i just got the best original idea ever

tight epoch
#

Okay that's nice, no bg unless it's hovered over

shrewd yacht
#

most of the things are hidden by default unless hovered

tight epoch
#

Oh geez lol

#

I mean I like myself a clean UI, but hiding things to that extent is not really for me lol

covert nimbus
#
@font-face {
    font-family: 'Comic Mono';
    src: url('https://dtinth.github.io/comic-mono-font/ComicMono.ttf');
}

*:not(code, monospace) {
  font-family: "Comic Sans MS" !important;
}

code, monospace, .shiki-table > tr > td > span {
  font-family: "Comic mono" !important;
}
#

comic sans for text and comic sans but monospace for code

tight epoch
#

Oh dear lmao

#

Also waaa can't find a way to have styles on the server folder BG only be active when the folder is opened pensivent

#

WOOO nevermind found the selector for collapsed folder BGs and just set it to display none Thumsup

#

Das nice, maybe I should move the border tho

#

Wonder if I could find a way to put it on the other side of the unread and current server markers

#

That's better

torpid agate
#

what’s the best way to learn to code

#

from the source or from a website

#

cause i don’t struggle with the source material it all makes sense

#

but it’s long and vague

#

like it told me to find /src i spent 20 mins to figure out it was in the package

#

cause ik some operating systems come with a /src directory i didn’t know if something was added

next stone
amber condor
amber condor
#

at my uni they make you download the python terminal

#

and from there you slowly learn what variables are

#

what if statements are

#

how to manipulate string

#

read write files etc

#

idk if JavaScript has a terminal app on pc beside the one built in the browser

torpid agate
amber condor
torpid agate
dull magnet
#

kinda real

amber condor
shrewd yacht
#

are you using KDE?

#

There might be multiples locations for autostart

#

Try to do sudo find / -iname "discord.desktop" for more info

dull magnet
#

it's ur de/wm starting it lolz

#

what do u use

#

since it says kate I assume KDE plasma

#

try looking for autostart in plasma settings

shrewd yacht
#

weird

#

that's what happens when you use a bloated de

dull magnet
#

find for finding system wide files is silly

#

use locate

#

locate discord.desktop

#

no

#

locate is instant

#

because it creates an index of ur entire system ahead of time

#

not like it's really relevant how fast indexing is since you'd usually just run it via cron/systemd xd

cinder olive
dull magnet
#
  • weird system
cinder olive
#

vanilla arch tf you mean weird system

amber condor
#

arch just not that good tbf

dull magnet
#

mlocate does as well

#

idk but I don't recall installing it and I have it

cinder olive
#

@dull magnet ur smart pls give solution

dull magnet
#

why are you writing a C++ parser or something like that in kotlin

#

deranged

cinder olive
#

It's a library for generating LLVM

#

it works surprisingly well

#

and unlike llvmlite it even has sanity checks in place

compact mauve
#

okay i'll make an api that's entirely a meme soooooo

what endpoint would you add to an api so people seeing it would go "what the fuck is this" and what should it do?

opal fern
#

example.com/codetocrash
Make it take xml as response only, and the api returns code that crashes a process depending on the coding language submitted via xml

#

@compact mauve

compact mauve
#

added

hasty stag
#

how can i use the addContextMenuPatch on user-context and know what user it was from in the action

dull magnet
#

its in the args u get

hasty stag
#

action didnt have a type so didnt know how many args you get

dull magnet
#
const patchUserContext: ContextMenuPatchCallback = (children, props) => {
  console.log(props.user)
}

addContextMenuPatch("user-context", patchUserContext);
cedar olive
#

the first argument after the children is likely what you always want

dull magnet
#

there's more in the props just lookie lookie

hasty stag
#

thanks

compact mauve
compact mauve
#

kk so local "database" it is when

hasty stag
#

is there a way to save a file in a save as prompt i tried a hacky html way like this

const a = document.createElement("a");
a.href = url;
a.download = `${filename}.${extension}`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);

but it didnt work

dull magnet
#
- document.body.removeChild(a);
+ setTimeout(() => document.body.removeChild(a), 0)
#

try that

proud parrotBOT
dull magnet
#

@green vessel tbh i didnt understand ur last question

#

wdym detect when vencord finished loading

#

maybe push ur code

dull magnet
#

skill issue

#

look at the code i sent

#

it works :P

#

look for errors

hasty stag
#

doesnt work from my side

dull magnet
#

in console

#

and similar

hasty stag
#

theres 0 errors

#

i looked

dull magnet
#

what's this even for

#

send full code

hasty stag
#

my friend wanted a plugin to download pictures from guilds/users

#
const userClickCallback = (e: React.MouseEvent, props: any) => {
    var url: string = props.user.getAvatarURL();
    var extension = url.split(".").pop()!.split("?")[0];
    console.log(url, extension);

    const a = document.createElement("a");
    a.href = url;
    a.download = `${props.user.username}.${extension}`;
    document.body.appendChild(a);
    a.click();
    console.log(a);
    setImmediate(() => {
        URL.revokeObjectURL(a.href);
        document.body.removeChild(a);
    });
};
dull magnet
#

you mean profile pictures?

hasty stag
#

yeah

dull magnet
#

viewIcons exists...

green vessel
dull magnet
#

no

#

it means the module hasn't been loaded yet

#

vencord loads incredibly early

hasty stag
green vessel
dull magnet
#

or use waitFor instead

green vessel
#

woah

#

genius

hasty stag
#

oh nice thanks

dull magnet
#
Vencord.Webpack.waitFor(Vencord.Webpack.filters.byStoreName("GuildReadStateStore"), store => {
  store.addChangeListener()
})
chrome elbow
#

wait is viewraw button gone again

dull magnet
#

ye

#

that patch is meh can probably be improved

#

oh

#

burst-reaction broke it

green vessel
#

changed it to byStoreName and it works
thanks ven lookWhatTheyTookFromUs

dull magnet
#

meow

#

ok fixed probably

#

ye we back

#

i will try to rewrite the plugin guide tomorrow

cedar olive
#

oh makes sense you are finding the thing to patch

#

guh wrong channel

dull magnet
#

what now

cedar olive
#

god

cedar olive
#

it's super hard to find

#

I only know cuz I made it

#

anyways fixed

dull magnet
#

tbf i didnt spend much time looking lmao

#

i looked for it, didn't immediately find it so i just went nope im out

cedar olive
#

it matches that if

dull magnet
#

i kinda figured

#

but it changed

cedar olive
#

and then this children

#

yes they removed the other predicate lmao

compact mauve
#

I'll commit more war crimes like this one when

#

(i was sleepy and so donr when i pushed this)

eager saffron
chrome elbow
eager saffron
#

I mean server user profile

chrome elbow
#

ah

eager saffron
#

yes

snow jetty
#

@dull magnet you requested to change my patch regex because it matches more than it needs to
I had tried what you did but it's like 6x slower
I did find a faster way with lookarounds, by putting the lookbehind after the main expression (and including the matching group inside it) and that got me to almost as fast, only 1ms slower (my regex taking about 3ms on regex101.com on my machine)
would you be okay with the following regex?

(\i\[\i\])(?<=getUserProfile=function\(\i\){return \1)
#

as for the other patch, i should probably make it less prone to breaking

snow jetty
amber condor
#

is 6ms really that bad?

snow jetty
#

not 6ms

#

6x slower

#

from 3 to 18ms

#

just because it's purer code

#

idk if this is any better for my other patch

THEME}\)(?=])(?<=(?<=},color:(\i).+?)},color:(\i).+?)```
amber condor
snow jetty
#

AST would greatly help

amber condor
#

but still 18ms not that bad

snow jetty
#

yeah but take into account all the other plugins

amber condor
#

even with 100 plugins it would only take 2 seconds

snow jetty
#

and my pc isn't slow

amber condor
#

patches are only during install right?

snow jetty
#

on a slower pc it could take much longer

amber condor
#

or during launch

snow jetty
#

no

#

launch

amber condor
#

ah nvm then

sacred yew
#

hi

#

the errors:

go build --tags cli
# github.com/Vendicated/VencordInstaller
.\cli.go:29:5: invalid operation: *client && (*client != "default" || *client != "stable" || *client != "ptb" || *client != "canary") (mismatched 
types string and untyped bool)
.\cli.go:43:21: not enough arguments in call to PromptDiscord
        have (string)
        want (string, *DiscordInstall, string)
.\cli.go:45:21: not enough arguments in call to PromptDiscord
        have (string)
        want (string, *DiscordInstall, string)
.\cli.go:49:28: not enough arguments in call to PromptDiscord
        have (string)
        want (string, *DiscordInstall, string)
.\cli.go:56:28: not enough arguments in call to PromptDiscord
        have (string)
        want (string, *DiscordInstall, string)
next stone
#

read the error

dull magnet
#

why are react hooks kinda hot

dull magnet
#

workie

shrewd yacht
#

that's nice

amber condor
dull magnet
#

that awkward moment when u forget the notification component positions itself absolutely

green vessel
#

What would the webpack module be for setting the users status?

snow jetty
#

@dull magnet my regex runs in 3ms for me, while the one you suggested runs at 18ms, that's 6x as much
when i experimented while making the second regex i also revisited the first one and tried lookarounds too, and ran into that perf issue, which i fixed by putting the lookbehind after the main expression, it got me to just 4ms exec time which isn't much slower than the original regex, however i doubt it's any more readable.. what should i do?

opal fern
#

nobody will ever notice

dull magnet
#

IT KNOWS ME

dull magnet
#

whether its 3ms or 18ms

#

as long as its not 200ms

opal fern
#

^^^

#

human brain literally cannot notice a 3-18ms difference

snow jetty
#

But add up all the other plugins, take into account the fact I'm not running a low end CPU and you end up making the load times much longer than required

lament dew
snow jetty
#

i don't understand why you still prefer using the lookaround

#

not using it is simpler to read and understand, and costs less performance

snow jetty
#

@dull magnet this is the last time i bother you about this
testing done on my laptop (Ryzen 7 5800H), on regex101
original version (6-7ms):

(getUserProfile=function\(\i\){return )(\i\[\i\])

lookaround version, more "pure" (~40ms):

(?<=getUserProfile=function\(\i\){return )(\i\[\i\])

optimized lookaround version, imo unreadable (~12ms):

(\i\[\i\])(?<=getUserProfile=function\(\i\){return \1)

is slightly better looking code (debatable) really worth this single patch running 6 times as long?
i think it's unreasonable to make people run unoptimized code just because it's more "pure"

dull magnet
#

oh you're talking about that one

#

I didn't even realise

#

like I said before it doesn't matter much :P

snow jetty
#

the slower code or the looks

dull magnet
#

it was just a suggestion but not every suggestion has to actually be implemented

snow jetty
#

mhm

#

because yeah i had tried refactoring it when you taught me about lookarounds

#

but i went "oh that looks better but oh god it's so slow" then i found how to optimize it but went "is this really better or was the older was just as good"

dull magnet
#

it's weird that it's slower though

#

it shouldn't be

snow jetty
#

it's when you put the lookbehind first for some reason

dull magnet
#

usually lookarounds perform well, just terribly if you have non fixed width lookarounds

snow jetty
#

it doesn't happen when you put it after

#

regex is still somewhat black magic to me

dull magnet
#

Also if you actually want to time them there's no need to use some website

snow jetty
#

i don't know how the algorithms

#

oh startup timings does it?

dull magnet
#

if you use a vencord dev build it already times every webpack search, patch etc

#

no

#

enable verbose level in the devtools

snow jetty
#

oh right

#

i'll check rq

#

i'll still have to figure something out for the other patch because that one is awful

dull magnet
proud parrotBOT
snow jetty
#
ACCENT}\)}\)}\)(?<=(?<=},color:(\i).+)},color:(\i).+)```
dull magnet
#

I should make vencord companion test button tell you the time it took

snow jetty
#

i changed it to this

THEME}\)(?=])(?<=(?<=},color:(\i).+?)},color:(\i).+?)/```
 which isn't really better
snow jetty
dull magnet
#

ye

snow jetty
#

sorry if i seemed angry i thought you wanted it changed and that it wasn't just a suggestion, so i got kinda upset
my bad!

dull magnet
#

uh no

#

I just looked at it and saw it could be a lookbehind

snow jetty
#

yeah turns out you're right and i was stupid

dull magnet
#

but a lot of review comments are just my personal suggestions, if you think they're not good suggestions you can just reply why you think that

snow jetty
#

i'm guessing since it only patches the module and not the whole chunk file it doesn't actually make a difference

#

at least i couldn't measure it

dull magnet
#

oh did you run it on the entire chunk?

snow jetty
#

welp

#

yeah lol i'm stoopid

dull magnet
#

yeah the patches always only run on the module your find found

snow jetty
#

well that'll teach me

dull magnet
#

but there are some 1.2mb modules

#

which is funny

snow jetty
#

unicode

dull magnet
#

I'm gonna start writing updated plugin documentation now

snow jetty
#

nice

#

i hate writing docs

dull magnet
#

I think it's fine when I'm in the mood

#

but it frustrates me how quickly docs become outdated in a rapidly developing project like vencord

snow jetty
#

yeah

dull magnet
#

did u find the patch timing logs?

snow jetty
#

i'll have a look at how i could add my button better

snow jetty
#

i found no difference between all three

#

because the module is small

#

even on the same regex there's a 0.1ms difference between restarts

dull magnet
#

i hate how long webpack finds take

snow jetty
#

it's 0.1-0.2ms

#

so instant

snow jetty
dull magnet
#

bulk is way faster but nothing uses it

snow jetty
#

but hey probably still faster than other clients

dull magnet
#

i should write findBulkLazy maybe

snow jetty
#

oh yeah what's the lazy functions

dull magnet
#

just lazy

snow jetty
#

i was looking at the webpack stuff because i wanted to try something (ended up giving up because i couldn't find the code i wanted to call)

snow jetty
dull magnet
#

the webpack search is only done once you use it for the first time

snow jetty
#

ooh

#

that's cool

dull magnet
#

so if the module is never used it is never searched

snow jetty
#

good to know

dull magnet
snow jetty
#

yup

#

basically it has to be accessed

dull magnet
#

bulk is more efficient

dull magnet
#

proxies are so awesome

#

Vencord uses Proxies everywhere

snow jetty
#

i saw them yes

#

you wanted me to use one too lol

dull magnet
#

I think most people don't even know about js proxies

#

I didn't know about them before Vencord

dull magnet
#

Our webpack is pretty well written and runs faster than other mods from my very basic testing

#

also another very important aspect is that we're the only mod that has lazy methods for webpack so a lot of searches are just skipped entirely

#

and both BD and replugged made the very poor decision to handle errors in webpack finds

#

look at the insane runtime

snow jetty
#

god

dull magnet
#

error handling is very expensive

#

which is why Vencord's webpack is very strict and propagates errors so you're forced to write errorfree filters

#

catching errors encourages devs to care less about null safety (ive seen multiple bd plugins that just yolo m.someProp.someNestedThing so they will literally throw on every module that isn't the correct one)

#

god discords new font changes are so weird

amber condor
dull magnet
#

no

#

all of the searches in Vencord are unique

#

when a module is used by multiple plugins it is moved into webpack commons

trail ginkgo
#

true and based vencord moment 💪

forest salmon
#

patching webpack modules with regex matching and string replacement... so based.....

amber condor
#
class A {
    private elmnt: HTMLDivElement;
    public constructor() {
        this.elmnt = document.createElement("div");
        this.elmnt.id = "test";
        this.elmnt.onmousedown = this.onMouseDown;
    }
    private onMouseDown(ev: MouseEvent) {
        console.log(this === document.getElementById("test"); // true.. why? just why?
    }
}

how to fix this behaviour 🙏

#

alright i fixed it

#
this.elmnt.onmousedown = this.onMouseDown;
// to
this.elmnt.onmousedown = ev => this.onMouseDown(ev);
#

but holy fuck that's dumb af

woven lion
#

that's not dumb

amber condor
#

alright so

private onMouseDown = (ev: MouseEvent) => { ... }

also fixes it, crazy ngl

amber condor
woven lion
#

when you're doing the former this.elmnt.onmousedown = this.onMouseDown; you're giving the function to the event handler, which then changes this in your function block because this in that context would be the element that's calling the event handler

#

when you're doing the latter, you're making a new function that preserves your desired this

#

the alternative is to just add .bind(this); to the former

#

which creates a new function that has the this argument set to.. this

#
class A { log() { console.log(this); } }

const a = new A;

a.log();             // A {}
a.log.bind("abc")(); // abc

const b = a.log;
b();                 // undefined
amber condor
#

in like pretty much ever other language (which i have ever used at least) it would be self.elmnt.onmousedown = self.onMouseDown and onMouseDown(self, ev: MouseDown), because i said self.onMouseDown it would pass the self down to onMouseDown, if i had done A.onMouseDown it would not* supply the self instance

woven lion
#
class A { log() { console.log(this); } }

const a = new A;

a.log();             // A {}
a.log.bind("abc")(); // abc

const b = a.log;
b();                 // undefined

const c = a.log.bind("def");
c();                 // def

const d = a.log.bind(a);
d();                 // A {}
amber condor
woven lion
#

you cant get A.onMouseDown because its not static

#

anyway, here's the rules

#

on how this all works

amber condor
#

weird design

#

i still dont really get the bind thing

woven lion
#

it creates a new wrapper function that makes this whatever you passed as its argument

#

its the equivalent of the following

const c = () => a.log.call("def");
c();
#

where .call's first argument is whatever this will be replaced with in the context of that function

amber condor
#

but where would i use it?

woven lion
#

the rules make more sense when you're used to them but from someone who doesnt know what they are it is confusing, i agree

amber condor
#

youve only shown outside the class

#

but shouldnt it be done inside?

woven lion
#
this.elmnt.onmousedown = this.onMouseDown.bind(this);
#

you can do that

#

that makes sure that it preserves this when it's called by the event handler

#

so it isnt overriden by the DOM element

amber condor
#

hmm

#

private onMouseDown = (ev: MouseEvent) => { what about this?

woven lion
#

never tried it that way

woven lion
amber condor
#

because otherwise if i ever change anything and forget to add .bind(this) i have to debug it again

trail ginkgo
#

there would be no this in an arrow function so this would refer to the this of the outer context

woven lion
woven lion
#

well you shouldnt need to and if you do you're probably doing something wrong

#

use .bind and make your life easier imho

#

better than overcomplicating your event handlers just for the sake of trying not to use it

amber condor
#

i feel like

#

"defining" it during function creation is better

#

because it ensures that it always be the correct this

#

like for future stuff

trail ginkgo
#

that only makes sense for methods

#

you can use this with any function

amber condor
#

this is meant to be a method right?

amber condor
trail ginkgo
#

nono so basically

#

when you do a call

#

ur doing one if 3 things syntactically

#
  • fn(...args)
  • obj[key](...args)
  • obj.key(...args)
#

so if ur calling on an index then the lefthand of that index will be the this

#

unless the function is an arrow function, in which case this isnt a thing

amber condor
#

does java does this too? because java also uses "undeclared" this

trail ginkgo
#

i guess it depends on how it calls it

#

u just made an assumption

amber condor
#

unlike languages where you define self in the function parameter

trail ginkgo
#

but probably?

amber condor
#

on one side this seems like something interesting

#

because you can get the object of whatever called onMouseDown

#

but on the other side its completely stupid

#

because i passed this.onMouseDown i would expect it to ship the current this rather than from the event handler

amber condor
#

can i let a certain function go off when another is called?

#

like

#

listen to when a function get called from outside

dull magnet
#

no

#

not directly

#

you can however store a function in an array somewhere

#

and then call every function in that array when the desired function is called

amber condor
#

i think I'm in love with JS

#

I've changed my mind

amber condor
dull magnet
#

what's your use case

trail ginkgo
#

is cus functions and this existed way before classes

#

and also u cant really unbind a function from a bound function

#

also it doesnt really make sense, if u define a method, what do u expect the this to refer to (if its being auto-bound at definition time)

#

cus ur defining a method on class, not an instance

#

and binding methods on instantiation wouldnt make sense, cus they're stored on the prototype chain of the class, not the instance

#

also would fuck up equality like animal1.greet !== animal2.greet

oblique lark
#

minecraft source code is actually so bad what is going on here

#

why are you checking if a function returns false so you can call that same function

#

what does keycode 258 mean

#

ough

trail ginkgo
#

thats deranged

amber condor
dull magnet
oblique lark
#

mm nope it's actually the escape key

#

minecraft is just like that™️

dull magnet
#

lol

#

why do they hardcode it instead of using an enum

#

is this compiled code?

oblique lark
#

yeah it's from the mcp

dull magnet
#

it might be a constant inlined

stoic cave
#

mcp my love

oblique lark
#

without the renaming thing all the variables have names like p_129387_ and stuff

stoic cave
#

what version of mcp are you playing with

oblique lark
#

uhhh i have no idea

stoic cave
#

lol well... mc version?

oblique lark
#

forge 1.19.2

stoic cave
#

oh lol

#

last time i touched mcp was in mc 1.8.*

#

mcp website has been "wip" since minecraft 1.12

oblique lark
#

yeah this looks like a good sign

stoic cave
#

are the keycodes from lwjgl

oblique lark
#

maybe?

stoic cave
#

if so it might help to look for their docs

oblique lark
#

first result is a gist in csv format

#

oh god

green vessel
#

hop off forge 🙏

oblique lark
#

god I wish 🙏

stoic cave
#

just make jar mods in 2023

oblique lark
#

this mod was originally like 1.8 or something and managed to stay updated even through the 1.13 flattening

stoic cave
#

what was the flattening

green vessel
#

flattening..?

oblique lark
#

going from numbered items to named items

green vessel
#

oh

stoic cave
#

wasnt that earlier than 1.13

green vessel
#

yeah I rember they were starting to switch over since 1.7.10 or something

oblique lark
#

(java edition)

green vessel
#

lol why is it actually called that

stoic cave
#

i thought it was way earlier, like 1.8

#

🤷

oblique lark
#

how the FUCK do you detect right clicks on buttons

#

literally the first result for "forge gui right click" is for holding an item

stoic cave
#

player interact event

#

or something

#

oh wait gui

#

idk

woven lion
#

then do something like Mouse.getEventButton() == 1 && Mouse.isButtonDown(1); to check the right click state

oblique lark
#

where would I put that

woven lion
#

in your event handler

oblique lark
#

I have a method for the button that only takes the button as an arg for some reason

green vessel
woven lion
#

uh

#

im not sure then

#

i havent done forge modding in a hot minute

trail ginkgo
#

damage was scuffed it was like a "sub-id" for some items but like literally damage for some

#

id:damage tuples -> scalar names

#

and probably REAL damage -> nbt prop

cinder olive
#

Save yourself the headache and use Fabric/Architectury instead

maiden ruin
#

why did it become minecraft talk here lmfao

opal fern
#

Because it's coding chat

#

Can be a about whatever

amber condor
dull magnet
#

it's just Javascript being terrible

amber condor
# trail ginkgo cus ur defining a method on class, not an instance

i would expect different kind of functions, the default being a instance method, then there'd also be options for class methods and static methods. Instance methods take in its own instance, class methods takes in its own class (not an instance) and a static method is actually just a function but put inside of a class because of design

amber condor
#

oh my

#
class Animal {
    constructor(animalName) {
        this.animalName;
    }
    greet() {
        console.log(this.animalName);
    }
}

animal1 = new Animal("Giraffe");
animal2 = new Animal("Elephant");
animal1.greet === animal2.greet;

why is this true?? 😭

#

but animal1.greet === Animal.greet is false

dull magnet
#

what

woven lion
#

because Animal.greet is undefined

#

it's not static

#

it only exists on instances

dull magnet
woven lion
#
class A{ b() {} }

A.b       // undefined
(new A).b // ƒ b() {}
amber condor
woven lion
#

they're not

#

they're the same function on different instances of the same class

dull magnet
#

it's the same method

woven lion
#

the instances might not be the same but their methods are

#

unless you overwrite them for that instance

amber condor
#

yeah but then is animal1.greet === Animal.greet false?

#

still same method

woven lion
#

it's because Animal.greet does not exist

#

it's not static

#

please at least try to evaluate what Animal.greet is first SweatingTowelGuy

amber condor
#

bruh

dull magnet
#

every instance uses the same method

#

just with a different this

#

it works this way in java and other languages too

trail ginkgo
#

Animal.prototype.greet is the one that the instances inherit

amber condor
#

im just used that in dynamic languages every instance has its own methods

#

what i dont get tho

#

/run

class Animal {
    constructor(animalName) {
        this.animalName;
    }
    greet() {
        console.log(`Greetings ${this.animalName}`);
    }
}

class RunMultipleFunctions {
    constructor() {
        this.functions = [];
    }
    addFunc(f) {
        this.functions.push(f)
    }
    runAll() {
        this.functions.forEach(e => e());
    }
}

class TestClass {
    static func() {
        console.log(this)
    }
}

class HoldFunction {
  constructor(f) {
    this.f = f;
  }
  run() {
    this.f();
  }
}

var animal1 = new Animal("Giraffe");
var animal2 = new Animal("Elephant");

var rmf = new RunMultipleFunctions();

var tc = new TestClass();

var hfAnimal1 = new HoldFunction(animal1.greet);

console.log(hfAnimal1.run()); // does not make sense

// var hfTestClassInstance = new HoldFunction(tc.func);

// console.log(hfTestClassInstance.run()) // makes sense

var hfTestClassStatic = new HoldFunction(TestClass.func);

console.log(hfTestClassStatic.run()); // does not make sense
worldly oxideBOT
#

Here is your js(16.3.0) output @amber condor

Greetings undefined
undefined
HoldFunction { f: [Function: func] }
undefined
sacred yew
dull magnet
#

alyxia already helped u one line below

#

the error is very self explanatory

#

not enough arguments in call to PromptDiscord

have (string)
want (string, *DiscordInstall, string)

dull magnet
#

you change it from an instance method to a plain function

amber condor
#

detaching it is bad imo

dull magnet
#
class Foo {
    bar() {}
}

const foo = new Foo

const barWithContext = () => foo.bar()
const barWithoutContext = foo.bar
dull magnet
amber condor
#

this is purely a dynamic language problem tho

#

because no way a compiled langauge would do this

#

right

dull magnet
#

yes

dull magnet
#

you mean statically typed not compiled

#

but yes

amber condor
#

ye

dull magnet
#

doesn't happen in Java and similar

trail ginkgo
#

imagine animal.greet !== animal.__proto__.greet

opal fern
#

How can I make this a little less specific?

.popout-TdhJ6Z {
  display: none
}
#

It doesnt have any aria text thingy, but a child div has some text

#

But its formatted as:

<div id="someshit" balls=sex>Other active threads</div>
#

idk why

dull magnet
#

wha

#

less specific how

opal fern
#

You said you don't like stuff like .popout-whatever

green vessel
#

[class|=popout]

slow fjord
#

I had fun

south ridge
#

ven wtf is moment and how do i use it

#

nvm thanks :D

#

nvm nvm, crashing in gateway now trolley

#

figured it out Yeptune

dull magnet
#

how do i typescript monorepo

green vessel
#

"extends":?

dull magnet
#

nuh uh

#

i think we won't get around publishing vencord to npm

green vessel
#

add a sub-package.json and "vencord": "link:../.." to "dependencies"

#

(dont trolley)

silk sorrel
#

@dull magnet hi, I'm wondering why your webpack grabber checks for "false" or "!1" being in the code
https://github.com/Vendicated/WebpackGrabber/blob/main/WebpackGrabber.user.js#L20
it seems like the loaded property is optional, so some sites like Telegram fail the check

// webpack/lib/javascript/JavascriptModulesPlugin.js
Template.indent([
    needModuleId ? "id: moduleId," : "// no module.id needed",
    needModuleLoaded ? "loaded: false," : "// no module.loaded needed",
    "exports: {}"
])
dull magnet
#

arbitrary code signature I assumed was guaranteed

snow jetty
dull magnet
#

need to install deps

snow jetty
#

will everyone using git updates need to redo pnpm i

#

because that seems like the issue to me

dull magnet
#

yes

snow jetty
#

isn't that kind of an issue ;-;

dull magnet
#

nuh uh

#

its fine

snow jetty
#

yeah i guess users with the git setup are fine with manual intervention

dull magnet
amber condor
#

but

#

skill issue 🤓

dull magnet
tribal helm
#

How do I merge prs

#

with git

#

like clone the repo, then merge one of the prs

#

but keep the original still up to date

#

uhh

#

hopefully that makes sense

#

nvm I got it

trail ginkgo
#

The disappearing class?

dull magnet
#

look at Screenshots

#

I would expect the result to be the same in both cases

trail ginkgo
#

The function returns a nav element fiber

#

When u use react it wraps the result in a functional component fiber

dull magnet
#

ohhh

#

true

trail ginkgo
#

Also in the first one react has no way of knowing what the props are

#

So no memoizatuon

#

I just woke up idk why i asked "why'

amber mantle
#

just bonk people who add new packages over the head

#

cant believe you made me do pnpm i again 🥹

dull magnet
#

wow evil remty

snow jetty
#

for my defence it was ven's suggestion!

amber mantle
#

evilll

snow jetty
#

@dull magnet i think it was a mistake not making a usage section in my plugin, i already got a support request in dms

#

would something like this be good?

opal fern
#

add a notice of anti-nitro upsell btw

#

because anti-nitro upsell removes the whole profile color picker thing

snow jetty
#

yeah that's an incompatibility

#

but putting the color picker stuff in settings was too much for me to figure out lol

#

"and if you can't figure it out just buy nitro"

next stone
#

looking for .showEyeDropper by source should get you the color picker component, by the way

#

it takes these props

#

should be able to do something similar to what I did in vendetta; useState([]) and set it every time onChange is called

hasty stag
#

how can i add a button to this would i use MessageAccessories or do i have to manually patch?

cedar olive
#

use message popover

hasty stag
#

thanks

#

what id do i use

#

ok nevermind found some usage of it

cedar olive
#

look at how view raw does it

hasty stag
#

thats what im doing lol

wheat current
#

anyone know why transparency removed?

chrome elbow
covert nimbus
viral roost
#

my favorite switch in all of discord

covert nimbus
#

b-but the scam dms, how will I get them 🥺

slow fjord
#

Truee

compact mauve
#

scam dms my beloved

#

also;

<?php
$m=8;
$n=6;
echo $m+$n-- . "<br>";
$m=8;
$n=6;
echo 2*$n++. "<br>";
$m=8;
$n=6;
echo $m*2-1 . "<br>";
$m=8;
$n=6;
echo 2*++$n-1 . "<br>";
$m=8;
$n=6;
echo 13+$n . "<br>";```

intprog.dogasezer.com/thefuck.php
#

context: a question from my exam when

faint siren
#

@dull magnet So about your comment on my UserVoiceShow PR,
this is the code i'm trying to patch Vencord.Webpack.findByCode(".USER_PROFILE_MODAL").
I now found a shorter regex /,{user:\w{1,2}}\)(?!;case)/ and replaced it with $&,$self.patchModal(e).
However how do i also match the argument name (e here) for the rare case it's going to change?

cedar olive
#

@faint siren check your pr

faint siren
#

genious prayge

dull magnet
dull magnet
faint siren
#

yea, i actually know it, but i didn't think of it in this situation

compact mauve
#

I agree

compact mauve
deft drum
#

ik this is for better discord but should it not still work?

/*                                                                                     ↓↓↓↓↓            */
@import url(https://mwittrien.github.io/BetterDiscordAddons/Themes/EmojiReplace/base/Apple.css);
/*                                                                                     ↑↑↑↑↑              */
/*                                                                                  REPLACE THIS        */```
ionic breach
deft drum
#

no i am using the custom css

ionic breach
#

Unless you've pasted this in quickCss.css file

#

Ah is it at the top of the file?

deft drum
#

yes

#

wait why does it work now

#

somehow enabeling a discord theme made it work

amber mantle
#

sigh

#

can someone more competent in rummaging through discord's code find me the Message object

#

not the react component, just the normal one

#

ive tried .isSystemDM()&&null! , random log messages in the same file, and some other crap

amber mantle
#

hm

dull magnet
#

why do u need it

amber mantle
#

I mean whatever contains content, author, etc

#

dum plugin im making

dull magnet
#

you don't need to use their class

#

can just make ur own

#

or MessageStore.getSomeRandomMessage().constructor

amber mantle
#

ah

#

will try (it did not work of course i love)

amber mantle
#

Well not exactly, because in order to use the react component, you need to either
A) Use the real message, which sucks because then you cant fetch it if it gets deleted or something
B) Create a fake one, which is what i was trying to do in the first place, which is also why i need said class or w/e
C) ?????

#

or make own component, which was already given a "why are you doing that"

#

either way, i suck at search terms apparently

shrewd yacht
#

are we supposed to solve advent of code using only code or can we solve it using vim magic?

hollow flame
shrewd yacht
#

imma do some nasty stuff then

hollow flame
#

another time was just search and replace

shrewd yacht
#

I intend to do smt like that

dull magnet
#

vim magic is fine probably

#

I did one of the days with sql

#

lololol

proud parrotBOT
# dull magnet https://github.com/Vendicated/AOC22/blob/main/day2/solution.sql

**solution.sql: **

-- Works on sqlite3.40.0

-- ax rock 1
-- by paper 2
-- cz scissors 3

-- hardcoding the values for each combination feels like cheating but shrug it works


SELECT "Part 1";

SELECT (
WITH line AS (
  SELECT *
  -- read the file; replace newlines (0a) with spaces and turn into json array; use json_each to split into rows
  FROM json_each('["' || replace(trim(readfile(file.name)), x'0a', '","') || '"]')
  WHERE value != ''
)
SELECT file.name || ": " || SUM(x) FROM (SELECT
  (CASE value
    WHEN 'A X' THEN (SELECT 4)
    WHEN 'A Y' THEN (SELECT 8)
    WHEN 'A Z' THEN (SELECT 3)

    WHEN 'B X' THEN (SELECT 1)
    WHEN 'B Y' THEN (SELECT 5)
    WHEN 'B Z' THEN (SELECT 9)

    WHEN 'C X' THEN (Select 7)
    WHEN 'C Y' THEN (Select 2)
... (35 lines left)
dull magnet
#

Rate

shrewd yacht
#

lol

#

you should name your folder day01 so it’s ordered properly

dull magnet
#

uh

#

I didn't even finish til day 24

#

kinda forgot

shrewd yacht
#

I need that emote

#

emote cloner should work with fakenitro emotes

#

OMG IT DOES!!!!

dull magnet
#

it does (if u enable fake nitro plugin so it converts them back into real emotes)

#

lol

#

but that emote is also from this server

shrewd yacht
#

I love vencord

grim hare
shrewd yacht
#

promise me to not have a hear attack
here is my solution to the first AOC challenge: (11 lines)
||run in (n)vim:
:%s/^./+\0<CR>
:%s/^$\n^+/\r<CR>
ggx
9999J
:%s/ \([0-9]\)/r\1/g<CR>
:%s/ +/+/g<CR>
gg
qqV!bc<CR>jq
999@q
Vgg!sort --numeric-sort<CR>
Gkdgg||

#

can I create a github repo from the cli with gh or smt?

grim hare
#

do you mean the gh command line program

#

if so, yes

shrewd yacht
#

yes how?

dull magnet
#

gh repo create --public Username/Reponame

#

super simple

shrewd yacht
#

thx

hasty stag
#

is there a way to force update the contents a message after changing its contents from messagestore

#

i have to move my mouse over the message to see the update

dull magnet
#

dispatch a message update

grand haven
#

is the extension source code available?

#

nvm i see

odd pelican
#

yo vendicated will vencord ever use tsup

#

i mean it already uses esbuild

#

but will it ever start using tsup

#

tsup uses esbuild

#

imo the config is better

dull magnet
#

i dont think so

#

our current config already works nicely

#

Why do you want us to use tsup?

#

Are there any direct benefits?

odd pelican
#

idk it just feels more clean

tight epoch
#

Ok so basically I'm torturing myself by seeing how far I can push CSS stylesheets, so far I have made the buttons on the side of the chat text field pop out when hovering over a smaller element, and I've made the buttons in the little profile box pop in when the box is hovered over (very technical names I know yesyes)
However, I put borders on the left side of these boxes, and I've been trying to see if I can find a way to make the border colour on the profile box one match the colour for the currently selected status (green when set to online, yellow for idle, etc etc.)
Anyone have any idea of how I could do it with pure CSS? Thumsup

lyric cosmos
#

call me dumb, but why is there no bio section

#
const aaaaa = ({ user }: { user: User; }) => {
    const [badges, setBadges] = React.useState<CustomBadges>({});
    React.useEffect(() => fetchBadges(user.id, setBadges), [user.id]);
pure temple
lyric cosmos
#

same

dull magnet
#

are u making GlobalBadges lucy

crude iron
lyric cosmos
#

i just happen to use globalbadges as a base

dull magnet
#

yes there's a different thing for bios

#

theres getUser() and getProfile()

lyric cosmos
#

and is there anyway of changing it?

dull magnet
#
const ProfileStore = findStore("UserProfileStore")
const profile = ProfileStore.getProfile("id");
console.log(profile.bio)
#

but that only returns cached profiles

#

if u want to fetch missing ones then uhh

#

search the sources for USER_PROFILE_FETCH_SUCCESS

#

and u will find it

lyric cosmos
#

im not to bothered about getting bios, i just wanna change them if thats possible

#

but i have no idea how

crude iron
#

clientside or serverside?

lyric cosmos
#

client side

#

it would be serverside cause i wanna allow for bios longer than the max length

crude iron
#

You could intercept USER_PROFILE_FETCH_SUCCESS & USER_PROFILE_UPDATE_SUCCESS and set your own

#

or you directly patch the store Ven sent you above

lyric cosmos
#

ngl no idea how to do either lmao

crude iron
#

Do Ctrl + Shift + F and have a quick look around for UserProfileStore.

#

Then you can see what you might be able to intercept, it's one of those events I sent already

amber condor
#

(he asked for it)

oblique lark
#

/run

let um = {ok:(s)=>console.log(s[0])}

um.ok`wow`

local idiot finds out about template tags

worldly oxideBOT
#

Here is your js(16.3.0) output @oblique lark

wow
lyric cosmos
#

/run

let um = {ok:(s)=>console.log(s[0])}

um.ok`cock and ball`
worldly oxideBOT
#

Here is your js(16.3.0) output @lyric cosmos

cock and ball
hasty stag
#

ok nevermind i need to specify the message

dull magnet
#

yes

crude iron
#

This breaks attachments iirc

dull magnet
#

yes it breaks some stuffs

#

I haven't found a good way update messages without breaking attachments

dull magnet
#

does discords message class implement toJSON? if so maybe you can call that

#

I'll play around w it tmrw

crude iron
dull magnet
#

hmmm

dull magnet
crude iron
#

Lighty did for his ML

dull magnet
#

oh

#

I will lookie

crude iron
#

(I know this because I reviewed code from Sammy which referenced this)

#

nvm it was form embeds, but that's like a part you'd need.

hasty stag
dull magnet
#

it does

#

show ur code

cedar olive
#

well

hasty stag
#

    MessageStore.getMessage(message.channel_id, message.id).content = original!;

    message = MessageStore.getMessage(message.channel_id, message.id);
    FluxDispatcher.dispatch({ type: "MESSAGE_UPDATE", message });
cedar olive
#

maybe we can find how MESSAGE_UPDATE re renders the message

#

and steal that

hasty stag
#

i tried it on a message with attachments and it didnt do anything to them

crude iron
tight epoch
#

Anyone who knows a pure-CSS way to change an element's style depending on currently set status? Trying to set this border on the side to have the colour of the user's current status and I'm too dumb and lazy to learn to do it using something more than stylesheets Thumsup

lapis fable
#

the element that represents the status has its color in the fill property but idk if this value can be got in a pure css way, i will have to look

tight epoch
#

Yeah, I've thought about trying to use conditional ( [...] ) selectors to have them only apply when a specific status is chosen, but I can't seem to get it to work by using that to change a completely separate element

lapis fable
#

im gonna go through mozilla's css documentation, im gonna dm you once i find something that might work

tight epoch
#

I'm thinking if I really have to botch it, maybe I can try to force otherwise unused pseudostates onto the thing, then use those pseudostates as a way to make conditional selectors?

#

Also thanks yesyes

tight epoch
#

Ok I found the PERFECT element to use for this, now it's just a problem of figuring out how to actually use it to get conditional selection on something way further up in the hierarchy Painnn

#

As for the element, I found that .status-3cqfT9 refers to the svg showing the currently set status within the status select button in the profile pop-out. It's the only element with an assigned class that I can find leads directly to an element that changes colour based on the status, and it's a background-color rule, which tbh I have no clue if that makes it easier or harder to use in this way but uhhh it's something

lapis fable
#

okay

#

im gonna first try the method i've come up with

#

then yours

tight epoch
#

Sure thing

lapis fable
#

idk if this is possible

tight epoch
#

Yeah, I'm worried that it might not be

lapis fable
#

as you cannot use variables from child elements in parent elements

tight epoch
#

Yeah true...

lapis fable
#

hold on

#

i have an idea

#

hardcoding

#

im gonna try one last time

tight epoch
#

Pretty sure BD has at least earlier had a thing built in that allowed the status colours to be changed pretty easily as its own element. Something like that could possibly make things way easier if it was veery high up so very few elements, and hopefully no element you'd want to use the status colour on, would be a child of it.
Yeah yeah I know, BD and everything, though maybe that might be worth requesting as a feature, or I can just try to learn to script it myself-

tight epoch
# lapis fable hardcoding

Oh? I mean, everything's worth a try ig-
Hoping for the best on that tho, if you're giving it a try rn

lapis fable
#

im trying

#

i can probably use :has()

tight epoch
#

Ooh

lapis fable
#

im hardcoding the colors for the status

tight epoch
#

I'm way past what I have experience with in CSS or any form of scripting, so uhh sadly I can't exactly help- FirFear2
Whichever way, hope it works yesyes-

lapis fable
#

i also hope it works lol

tight epoch
#

I mean it could be useful if anyone wants to apply the current status colour to just about anything else, hell maybe it could allow for that circular status theme on BD to be remade for Vencord, as an example

lapis fable
#

maybe

#

im still experimenting

tight epoch
#

Yeah fair

covert nimbus
tight epoch
lapis fable
#

a

#

aaaaaaaaaaa

#

why

tight epoch
#

Waaaaa

lapis fable
#

goofy ah electron framework

tight epoch
#

Well crap, guess I'll have to learn js or whatever to let me add that functionality through a plugin or something

covert nimbus
#

i say the blame here is on discord for using a horribly outdated electron

#

though apparently they changed to Electron v22?

amber mantle
#

does anything even still have electron 13 lmfao

#

stable should have v22 for everyone now

covert nimbus
#

my client at home still uses v13 but i might've just forgotten to pacman -Syu

lapis fable
amber mantle
#

yop linux no auto update moment

covert nimbus
#

mfw

amber mantle
#

you can just use whatever electron anyways on linux cause lmfao

#

system electron brr

tight epoch
lapis fable
#

im still gonna hope this version of electron has :has()

#

if not im gonna do that