#🧩-plugin-development

1 messages Β· Page 29 of 1

dull magnet
#

what's ^$all and ^$doc

dull magnet
drowsy chasm
dull magnet
#

that was quick

drowsy chasm
#

let’s gooo same

lone panther
#

DAMN

#

nice

rocky jackal
#

finally I'm getting somewhere

#

finally, it's working

#

welp, ima sleel now

#

I'll con'tinue this tmr

loud portal
#

ublock origin is the best.

loud portal
proud valley
#

can someone help, here is the code, the issue is when an item is removed from quotes it doesnt update the modal

dull magnet
#

it needs to be a new array

proud valley
#

its working, thanks

vague echo
rocky jackal
#

time to learn how to make a stateful list from a json file, because this totally went ok the last time I tried it

rocky jackal
#

LETSGO

rocky jackal
#

finally getting somewhere

timid hinge
green vessel
#

Hi, I downloaded themes and it is most likely old, can't do anything etc. Is it possible to remove this themes somehow?

shrewd tundraBOT
viral roost
#

oh yeah

rocky jackal
#

can someone help me with react states?

viral roost
rocky jackal
#

I want to dynamically toggle a class without having to resort to event.target.classname = ...

wooden dragon
#

is there a way to intercept POST requests with js on a site itself (the site in this case is discord)?

lone panther
#

could prob monkeypatch fetch

wooden dragon
lone panther
#

install ublock origin?

wooden dragon
#

not an option for my custom client :/

lone panther
#

ah

#

yeah most likely just patch fetch then

cedar olive
#

find out how ublock origin does it

lone panther
#

it uses an extension api

wooden dragon
#

ublock has access to browser level apis which I cant access, gonna try patching fetch

lone panther
#

so not useful here

wooden dragon
#

thanks you two

lone panther
#

btw @wooden dragon did you intentionally use https://revolt.chat 's name or

Find your community, connect with the world. The chat platform that puts you first.

wooden dragon
#

nah coincidence

#

I'm gonna rename it at some point

wooden dragon
#

I'm open for suggestions

#

hmm it somehow doesn't work, I guess discord is not using fetch for that

lone panther
#

husk discord good

#

idk look through the bundles and see what they do use

wooden dragon
#

I feel so stupid haven't done anything with js in ages UmaruSmug

#

anyone has a link to the findBy injection script?

#

oh it uses plain old xhr

lone panther
#

THEY GOT AHEAD OF THE MONKEYPATCHING FETCH ALLEGATIONS

wooden dragon
proud cargo
lone panther
#

(not electron)

wooden dragon
#

webview

proud cargo
#

ogey

wooden dragon
#

sadly the webview lib currently has no functions to intercept certain requests non blocking

#

so overriding the https protocol just blocks rendering during each request

proud cargo
#

lole

#

why tf do channels have a theme color

wooden dragon
#

Holy shit it works

#

const disallowedURLs = [
  "https://discord.com/api/v9/science",
];

const originalOpen = XMLHttpRequest.prototype.open;

Object.defineProperty(XMLHttpRequest.prototype, "open", {
  value: function (method, url) {
    if (method === "POST" && disallowedURLs.includes(url)) {
      throw new Error(`XMLHttpRequest to "${url}" with POST method is blocked`);
    }

    return originalOpen.apply(this, arguments);
  },
});
austere mauve
#

why only block post?

wooden dragon
#

yeah thats actually kinda useless to check lmao

#

im stoopid

proud cargo
#

im so good at ui

#

insane

rocky jackal
#

Small steps being done

#

is there a premade component to create these eyebrow tags?

proud cargo
#

wtf vscode

rocky jackal
#

the UI, even as a first iteration, is stable enough that I can ditch the slash commands

#

It still has some bugs though

wooden dragon
proud cargo
proud cargo
#

im so good its fucking insane

timid hinge
#

been working on a funny: java -> c++

timid hinge
#

translates to this abomination

green vessel
#

Hello I'm wondering what programs/tools are available for making a GUI? I liked whatever editor we used back in school when we did visual basic (I know, ew) and I wondered if there's anything like it for creating simple GUIs
I know I can use html and js to use a website as a form of GUI but I wanted to try out other languages

#

I wanted to start small and make a simple click counter program

azure mason
#

wpf has an editor like visual basic

#

its in c#

dull magnet
#

it's like asking what libraries are available for making a web server

#

obviously there are the big ones like gtk qt webui winforms

#

but beyond that there's sooo much

#

just gotta explore a little and see what suits you the best

#

if you're only targeting Windows people usually use winforms in c# like luna said

green vessel
#

that is exactly what i was looking for

#

thank you

#

sorry for the vague question

molten oxide
#

i want to add a new div/component to the "layout div".
I found out that the second div from the M the layout div is, how am i going to add a new div there?

Seems like i would have to patch it but how?

Im new to this kind of patching!

raw dew
#

oops i had auto translate on

#

anyways

#

how do i make my first plugin

#

is there a guide out there

#

ik a bit of js and cpp already

#

*not that cpp matters

raw dew
#

i guess ill start by trying to reverse engineer a plugin

wooden dragon
#

smart

spring bay
#

removes the annoying "update your username" alert in settings

div.pomeloWarning-2_xa4U, /* icon by "edit" */
div.tabBarItemContainer-2HdIlr svg, /* icon by "my account" */
div.accountWarningBodyText-2DEVPu { /* text at top */
    display: none;
}
dull magnet
#

just edit ur username already

spring bay
#

no

lone panther
#

evil

amber mantle
#

troll

#

im not updating my alts username

untold briar
# spring bay no

discord is gonna force the username update anyways, and the change isn't that bad after all, the problem comes if your username is taken

elfin geyser
#

is there any documentation for making plugins?
I understand how to add them but not really how to do anything with them.

austere mauve
#

look at other plugins

ionic breach
#

did sunnie make a guide

elfin geyser
spring bay
#

I purposefully make my username super common

#

my user is zxcv ffs

untold briar
#

idk if thats super common, you can add like a . or something but its kinda limited

spring bay
#

if you have a system where you need to start adding random shit to a username for you to get a user thats almost what you want, there's something wrong

#

nobody wants to be john777.30203

ionic breach
#

was it because of the password strength checker

#

or because of the qwerty keyboard

spring bay
#

qwerty keyboard lols

proud cargo
#

become a real person

dull magnet
spring bay
spring bay
#

why πŸ‘Ž @proud cargo

dull magnet
#

it's the same as before

#

πŸ™‚

worthy frost
#

and ive git pulled about 600 times
all to tell me its up to date πŸ€·β€β™‚οΈ

azure mason
#

pnpm inject > repair

worthy frost
#

alr tyty

viral roost
#

dont just make blank files

worthy frost
#

1 sec

viral roost
#

if you dont know what youre doing stick to a normal install

worthy frost
#

imma just regrab the files from the github

worthy frost
worthy frost
#

im quickly throwing together an install script.
is there anything im forgetting?

title Vencord Installer
@echo off


title Vencord Installer
echo This script is assuming you have both pnpm and git installed.
echo.
echo For pnpm installation see: bit.ly/getpnpm/
echo For git installation see: bit.ly/get-git/
echo.

echo To remove the "Press any key to continue" simply open the batch file,
echo and remove the "pause" right below this.
pause

SET /P ADD_GIT=Would you like to install the local git repo? (Y/[N])?

git clone https://github.com/Vendicated/Vencord
cd Vencord

IF /I "%ADD_GIT%" == "Y" GOTO INJECT

del /f /s /q .git 1>nul
rmdir /s /q .git
rmdir /s /q .github

:INJECT
pnpm install --frozen-lockfile
pnpm build
pnpm inject
dull magnet
#

why are you doing that

#

the installer has a cli Version

austere mauve
#

lost it at bitly

worthy frost
#

making it easier to install it πŸ€·β€β™‚οΈ

worthy frost
worthy frost
dull magnet
#

why are you deleting the git folder

worthy frost
dull magnet
#

you're breaking the updater by doing that

worthy frost
#

okay πŸ€·β€β™‚οΈ

dull magnet
#

it's like a few mb at most

worthy frost
austere mauve
#

this guy has an ancient vencord with the old injector probably

#

cuz broken updater

dull magnet
worthy frost
dull magnet
#

how does having the Vencord folder being a git repo clog your pc in any way

worthy frost
#

it doesnt clog my pc

#

and its not just vencord being a git repo, its most small things idc abt being git repos

#

if everything that ive git cloned was kept as a, id have 100s of local repos

dull magnet
#

and what's the issue with that?

worthy frost
dull magnet
#

how

#

how does it clog them

#

define clog

worthy frost
#

by creating an entire page for something that doesnt need it, so until i impl a system to whitelist certain things (which would be extremely easy, i just dont have time/motivation for it), its easier to just remove the .git folder

austere mauve
#

what is bro cooking

worthy frost
#

on the git explorer i have, which again, idc enough to update it to use a whitelist

dull magnet
#

so get a better git explorer

#

or make it only pick from specific directories

worthy frost
dull magnet
#

you're deleting vencord's git folder which is the stupidest thing you could do

#

Also deleting .github for some reason which will cause merge conflicts in the future

worthy frost
#

i have no reason to try to merge anything

dull magnet
#

lol

#

when you git pull, it automatically merges

#

anyway do what u want it's ur system bleh

#

but don't tell people to build vencord from source and delete the .git repo that's horrid

worthy frost
dull magnet
#

you said somewhere that you wanted to make the script public

worthy frost
#

which i did by sending it here

dull magnet
#

i see

worthy frost
#

not that i advised anyone use it,
or that i didn't add the option to install the git repo πŸ€·β€β™‚οΈ

dull magnet
#

do you even have any reason to build from source? you don't seem to be changing anything about the repo so you could just use the Installer cli to install for you, that'd be easier and require no git or pnpm

worthy frost
#

Vencord\src\userplugins

dull magnet
#
.\VencordInstallerCli.exe -install -branch auto```
stoic laurel
trail ginkgo
hoary thicket
#

Hello! I've been using context menus for menus, however, I'd like something more like a dropdown which I can choose if it opens above or below the button, has any plugin done this?

dull magnet
#

context menu can do that

hoary thicket
#

Oh

#

I'm gonna have to check tomorrow when I wake up

#

I'm in bed already

kind falcon
#

so i am trying (keyword trying) to make a plugn that replaces emojis with the native system version

dull magnet
#

u can just use a theme for that

kind falcon
#

ik but that conflicts with my theme

#

and you have to do every emoji individually

viral roost
kind falcon
#

i was told that doing it with a plugin would be better

#

and the only diff between the normal emojis, and the custom server ones is the source of the image, one is from a assets folder and the other is from a discord.gg url

#

is what is was trying to say earlier

dull magnet
#

yes

dull magnet
#

if you really want to do it with a plugin i suggest you use react devtools to inspect an emoji node and see what component it is

kind falcon
azure mason
#

edit your theme, remove the <@&1118512943106101309>mport for emojireplace

dull magnet
#
  • how do you load the emoji replace theme
kind falcon
#

ok so i load it with quickcss bc i edited the theme, also the emojireplace theme doesnt support the emojis i use on my system

#

my theme is comfy

#

holdon

dull magnet
#

send ur quickcss

#

or rather

#

imports need to be at the top or they don't work

#

put the import at the top

kind falcon
kind falcon
#

of trying to the other thing

tropic raft
#

no clue if this is the best place for this but if someone needs some plugin inspiration i bring to you the idea of the on-leave soundboard
anytime you try to disconnect a call it plays a soundboard, lets it play out and after it finishes it actually disconnects

silk sorrel
jovial haven
#

import tkinter as tk
from PIL import Image, ImageTk
import requests
from io import BytesIO

def uwu(imagey_url):
    response = requests.get(imagey_url)
    menjuice = response.content
    owies = Image.open(BytesIO(menjuice))
    owies = owies.resize((300, 300))
    owies = ImageTk.PhotoImage(owies)  
    uwus = tk.Label(owo, image=owies)
    uwus.image = owies
    uwus.pack()
owo = tk.Tk()
owo.title("Shiggy Viewer")
imagey_url = "https://media.discordapp.net/stickers/1039992459209490513.png?size=240"
uwu(imagey_url)
owo.mainloop()
#

Not discord but funny ~^_^~

median flare
#

but no one cares about nitro

trail ginkgo
#

here i'll make it real quick

kind falcon
#

yeah, im just not sure how to do it, also doing it with css is possible, but SO tedious

kind falcon
#

ty!

trail ginkgo
#

yea its insane how insane that css solution is

#

oh wait

#

the emoji IS in the alt i was just silly before and looking at a server emote

#

damn img tags cant have text psuedo elements

#

this is so sad

#

ok time to actually plugin

trail ginkgo
kind falcon
#

sorry but where do i put those files?

trail ginkgo
#

its a third party plugin so u clone it into the src/userplugins folder and then rebuild vencord

kind falcon
#

oh, i knew that, sorry i meant do i put the .css file in my quickcss or also in src

trail ginkgo
#

no u clone the whole repo

#

in the userplugins folder

kind falcon
#

ok thanks!

trail ginkgo
#

like with git clone

kind falcon
#

would that work with vesktop

#

or is it different for vesktop

trail ginkgo
#

you'd have to configure vesktop to use ur vencord git repo

#

by default it just grabs vencord from the latest release on github

#

i dont remember where that setting is and rn im watching smth

kind falcon
#

kay! Ill figure it out

drowsy chasm
#

it’s at the bottom of vesktop settings

trail ginkgo
#

oh yea i just remembered the reason i couldnt find it is cus my preload is broken

#

i have to update vesktop

kind falcon
#

but vesktop wont accept it bc theres no

#

dist directory

kind falcon
#

sorry to bother, but once the plugin is there, do i have to do something specific to activate it?

#

@trail ginkgo ?

trail ginkgo
#

yea u turn it on

kind falcon
#

yeah it wont show up in the list

trail ginkgo
#

did u rebuild vencord

kind falcon
#

i changed the directory in settings

#

is that it?

#

or did i miss something

trail ginkgo
#

did u read anything in the link flag sent

kind falcon
#

yes

trail ginkgo
#

did u do this part after cloning the plugin into src/userplugins

kind falcon
#

ah

#

that i missed

#

thank you

#

i cloned after

#

ah

#

i found the issue

#

i was searching for vc

#

as in vc-system-emoji

#

not realising that the name was different from the folder name

#

@trail ginkgo it doesnt seem to work for me

trail ginkgo
#

πŸ˜‚

#

this emoji is twemoji for u

kind falcon
#

πŸ˜ƒ

trail ginkgo
#

after refreshing?

kind falcon
#

to be specific

#

it doesnt change the emoji in the picker

trail ginkgo
#

true thanks for the specificity

kind falcon
#

and theyre cutoff wierdly

trail ginkgo
#

yea system emoji fonts are all dumbly different

#

i'll have to figure that out but i dont really want to so

#

maybe another time

kind falcon
#

fair enough

cedar olive
#

you may be able to just patch the "rules" (I forgot what they are called) to render the emojis like this always \πŸ˜„

#

like when using \

trail ginkgo
#

mm prob not

#

that would still only affect sent messages

cedar olive
#

nono

kind falcon
trail ginkgo
#

but u gotta replace the ones in the picker and the ones in message preview

cedar olive
#

ohh

#

I see

trail ginkgo
#

i assumed u meant the markdown rules

cedar olive
#

yeah

trail ginkgo
#

ye

cedar olive
#

it would replace the ones in the message preview

#

but not picker yeah

trail ginkgo
#

does the slate use the markdown rules

#

kinda real

cedar olive
#

ya

trail ginkgo
#

i made them use jumboable

cedar olive
#

I initially made fake nitro render emojis using the markdown rules

trail ginkgo
#

so that single sent emojis use system but are still big

cedar olive
#

but it ended up creating issues cuz the message preview was now turning links into the actual emojis

trail ginkgo
#

loool

kind falcon
#

it does override themes btw vap

dull magnet
#

u cant really replace the one in the picker that easily probably

#

it uses like a spritesheet its cursed

hybrid dune
#

time to make ms paint edition of emojis

hoary thicket
trail ginkgo
#

mayb

polar wyvern
#

how do i make a custom plugin?

marble marsh
#

hey, I'm wondering if it's possible to make a simple plug-in to write sentences uppercase, BetterDiscord has one

austere mauve
#

my eyes

#

you can with just addPreSendListener

oblique lark
#

you can just make a textreplace rule also

austere mauve
#

thas annoying asf tho i will not arse in making it

oblique lark
#

yeah

#

because you need to select every letter one by one and then uppercase them

#

since regex doesn't have any uppercasing function or whatever

#

so you basically need one rule per letter

austere mauve
#

@dull magnet implement sed in textreplace when

oblique lark
#

holy shit that would be insane

austere mauve
#

s/\b\w/\u&/g

#

fire

oblique lark
#

what does \u do

lone panther
#

what if compile the original gnu sed to

#

wasm

#

and used it

#

πŸ”₯

kind falcon
native pewter
#

I thought of a feature, can you do it?

#

will automatically respond to certain words

azure mason
#

that would be automating discord api / selfbotting

trail ginkgo
#

i messed up the normal font size variable name llol

remote sundial
tropic raft
gray wolf
#

Hello people ! I'm looking for some help is it possible to change this

#

I edited in paint to show you what i want because i'm giga bad at coding, but if anyone can explain me how to do it i'll be very gratefull

dull magnet
#

very easy with css yes

#

oh wait do you mean you want to change the date format?

#

or just add a background

#

adding background is easy, changing the format is impossible

gray wolf
#

euh no changing the format

#

i want it to be only numerical

dull magnet
#

need a plugin for that

gray wolf
#

Ah...

#

I presume their is no one that already exist and i could just easily use it ? πŸ™‚

dull magnet
#

nope

gray wolf
#

Thanks for the answer ❀️

dire fern
#

Replace every month with its number, if you wanna change the order, change the order or positions

chrome elbow
#

how will you replace month with number?

dull magnet
#

not possible with css

#

css cannot transform text

crude iron
#

You could make it's own new text for each and every month + day + year and select it using arial-labels which they probably have

chrome elbow
#

it doesnt have aria label trolley

crude iron
#

Rip then

#

Js it is

dull magnet
chrome elbow
#

xd
probably not work in all language because i just new Date() the string trolley

dire fern
dull magnet
#

are you serious?

#

devilbro writes the worst most unreadable code i have ever seen and is at this point infamous for writing plugins that use a shit ton of ram

gray wolf
chrome elbow
dire fern
# dull magnet are you serious?

Do you think I was smart enough to understand ram usage when using betterdiscord? As the creator of vencord you should know that betterdiscord users πŸ“‰ and vencord users πŸ“ˆ

dire fern
trail ginkgo
#

make a font with really epic ligatures

dull magnet
#

wait real

trail ginkgo
#

pelase dont

#

pleasedont

dull magnet
#

i think you could unironically do that

trail ginkgo
#

its just too cursed

crude iron
green vessel
serene cape
#

i have a file containing a list of filenames in the format filename.ext">filename.ext i need to figure out how to make it just filename.ext
is there something simple in python that can do that

#

i would do it myself but there's over 2K of them

dull magnet
#

what?

#

show the file

steady plover
#
with open(<yourfile>, "r") as f:
  for line in f.readlines():
    print(line.split(">")[-1])

Something like this?

lofty crypt
lofty crypt
lofty crypt
#

region and language settings or such

#

i’ll test it for you

gray wolf
#

that's really kind thanks

haughty frost
#

Hey there, would it be possible / does it exist already a custom css that stops gifs from auto playing in the picker until u hover over them?

green vessel
steady plover
#

Anyways, I wanted to make myself my own plugin but I am still bit confused from the PLUGINS readme. sorry in advance if these will be stupid questions D:
First and foremost, how exactly do I find the code that I want to patch?
Secondly, are there some detailed docs? The readme doesnt mention much about the patches (I have found predicate for example which I have no clue what it does)

green vessel
#

people said there's a memory leak that discord just hasn't fixed but not sure

lofty crypt
gray wolf
#

Thanks for trying anyway mate

serene cape
#

i got it sorted

rigid glacier
#

TIL Thailand lives in the future!

#

and has only two numbers in their dates – far out!
ah no, the characters in the middle seem to be the closest the Thais have to a month, and just happened to be the same there for my alt

dull magnet
dull magnet
gray wolf
#

Lot of people have consider helping, still we don't find a solution. Maybe if i explain why i would that there will be some ideas.
In my discord i have roles that i give for 1, 2, 3, 4, 5 years of joining the server. For now i found no solution to autorole that..
So i'm checking one by one every-member ( 700 ) to check and give the rΓ΄le ... it's really inconvinient ...
Sorry for my bad english also

dull magnet
#

use a bot

rigid glacier
#

sounds like a job for a bot

#

jinx

gray wolf
#

If someone can advice me a bot that can do that would be great

rigid glacier
#

i would guess there are quite a few that can do that, but idk. You could look into ones that specialize on autoroles. Or Carl-bot, the prime general purpose bot.
Or use search on bot listing sites or ask on the Discord Bots server

lofty crypt
green vessel
lofty crypt
#

not that i noticed

#

but i assume it would

green vessel
#

can you send me that via DMs, please?

lofty crypt
#

we didn’t do tests

#

unfortunately i don’t remember its name, so your googling is as good as mine

#

do share if you find it

green vessel
#

the amount of times my client crashes because of memory is insane

lofty crypt
#

i feel ya

green vessel
#

Climbs and climbs and climbs up to 2.5 GBs

#

and then shoots itself in the head

lofty crypt
#

damn

green vessel
#

discord out here perfectly simulating depression

lofty crypt
#

yeah burnout

lofty crypt
tight mist
#

Maybe the code is running from a different directory?

dawn lantern
#

it says this

tight mist
#

try cding into the directory with that file maybe

dawn lantern
wide parrot
#

maybe try cd into \school3 and run python3 main.py

#

or python3 8.py or whatever

dawn lantern
dawn lantern
#

so i am in the working directory of the python file and the csv

#

so should i proceed to run python3 main.py

tight mist
#

yes

wide parrot
#

just run the file you want

dawn lantern
#

OH

wide parrot
dawn lantern
#

the file name

wide parrot
#

so its 8.py or whatever one you want

dawn lantern
#

jeepers

#

i think its a vscode problem, i tried restarting vs code but still πŸ˜”

wide parrot
#

maybe just python 8.py

dawn lantern
#

:O

#

nope

wide parrot
#

wait no

dawn lantern
#

same thing

wide parrot
#

yeah thats

#

intended

#

its done what is coded

dawn lantern
#

the csv file has all these

dawn lantern
#

but it is not so i dont think it is intended 🀨
i think i should just restart my pc

rain ibex
dawn lantern
dawn lantern
#

OH

wide parrot
#

something you can run a for loop against simply

dawn lantern
#

the location eh

#

so how do i get the content from the file then

wide parrot
#

instead of print(csv_reader)

dawn lantern
wide parrot
#

nop

dawn lantern
#

:O

#

alright go ahead

wide parrot
#
    print(x)```
dawn lantern
#

woah alright let me try

#

my faking god

#

AGAIN ok i think this is a lost case

rain ibex
#

the file doesnt exist

dawn lantern
#
import csv

with open('names.csv', 'r') as f:
    csv_reader = csv.reader(f)


for x in csv_reader:
    print(x)
wide parrot
#

use an absolute path or smth

dawn lantern
dawn lantern
#

ok u can stop i dont want to trouble u no more

#

thanks tho

dull magnet
#

stop running it with the ide

#

run it from the terminal

#
python 1.py
dawn lantern
wide parrot
#

i literally told you that

dawn lantern
#

uuh shi

#

my bad

wide parrot
#

😭 ** **

dawn lantern
#

:D no error

#

cool thank both of u (ill correct this error)

wide parrot
#

vsc has a built in terminal too which can be easier

lone panther
dawn lantern
#

:O i used that this entire time and all the errors came

wide parrot
#

not the run button

dawn lantern
wide parrot
dawn lantern
dawn lantern
#

how is it not possible to access a variable which has the data out side the file close thingo

wide parrot
#

try and indent it into the open()

idle compass
#

I was curious if there was a way to install vencord fully automatic? I know there is a script. But I don't know enough of the language to make the edit's needed.

dawn mauve
#

how much different is the code for vencord plugins from betterdiscord plugins

indigo meadow
#

very, they use different methods of patching

dawn mauve
#

damn that sucks

#

wanted to port an extension but nevermind then

indigo meadow
thorn bramble
#

you can use the ndk's adb wrapper to write a script that will automatically install vencord for you

#

its in python

idle compass
#

thanks

green vessel
#

Ayoo, vencord devs! How soon can we get a plugin so that there are tabs like in a browser so that you can switch between them.
Tabs between chats on different servers

meager snow
#

as soon as someone wants to do it aka maybe one day but don't get your hopes up

lofty crypt
#

there are also experiments related to tabs, but they don’t seem to do anything

lofty crypt
gentle jay
#

does any1 know how to make it work, because I need to have '/' in link instead of '%2F'?

meager snow
#

can you show more of your code

gentle jay
#

changing the rest of it probably wont make any difference

#

its just this part

dull magnet
#

use english names

#

code should always be in english

gentle jay
#

I know but I need to make it in Polish

#

All I need to know is how to put / as a usable character in a link so I could pass the Id to controller

thorn bramble
#

yeah i was gonna say to do that

#

gg

kind falcon
meager snow
#

console.log("\n")

#

you can't really print just a new like i think

#

not possible

green vessel
lofty crypt
#

what is?

dull magnet
#

what?

#

to print a newline you just console.log()

green vessel
#

hello, on a scale of you can steal 90% of what you need from stackoverflow, to, you actually need a good deal of knowledge in the required language
how easy would it be to write an android app in kotlin that allows you to search/filter through items in a premade database
below is a (very) basic mockup of how i would structure the interface
any help or even redirects to appropriate google searches would be appreciated
thanks πŸ‘

green vessel
jagged briar
potent fox
#

If you use xml a simple custom view with recyclerview should be easy to make

trim igloo
#

process.stdout.write("\n");

#

only works on node

worldly oxideBOT
#

Here is your deno(1.32.3) output @gray ocean

bleh```
pure temple
green vessel
#

@potent fox@jagged briar thank you both for the advice

#

i will get around to this at some point when i have motivation that isn't just the idea of it

green vessel
#

vns

shrewd tundraBOT
rocky jackal
#

is there a way to re-render a react component programmatically?

#

like, whithout states? (I have no idea on how to use states on what I want to do)

azure mason
#

why do u want to rerender

#

it would probably benefit from states

rocky jackal
#

as I said, I don't know how to use states properly

azure mason
#

im asking so i can show u an example to help u learn

rocky jackal
#

So I have an array

#

this array has urls

#

I want to fetch each url

#

and from the json object they return

#

create an array of colorways

#

this is currently stateless

#

you have to close and re-open the modal

azure mason
#

make the array of colorways
const [colorways, setColorways] = useState<colorway[]>([])

#

and instead of using push to add u use setColorways(colorways.push(item))

rocky jackal
#

in that array I would push the colorway objects or the colorway react components themselves?

azure mason
#

depends on how you render

#

i would addume the object

#

all states are is a

  • variable that cannot be changed
  • function that sets the variable and rerenders
#

so it should be an almost dropin replacement

rocky jackal
#

this colorway part is giving me an error, what is it meant to be?

azure mason
#

the type of the colorway object

#

define it with an interface somewhere

dull magnet
#

what error

azure mason
#

colorway wasnt defined is all

rocky jackal
#

that

azure mason
#

@rocky jackal what url does it get the colorways from

#

i can make an interface for u

rocky jackal
#

this seems to be ok?

azure mason
#

ah oki

#

change Array<string> to string[]

rocky jackal
rocky jackal
dull magnet
#

interface names should be PascalCase

#

ColorWay

#

or Colorway

rocky jackal
#

huh, didn't know that, thanks for the heads up

dull magnet
#

same as classes

azure mason
#

the state variable cant be changed

#

push returns the modified array, even if it wasnt actually modified

#

iirc

dull magnet
#
setState(s => [...s, "new item"])
azure mason
#

ah

rocky jackal
azure mason
#

i would just set the array to data.colorways

#

show the whole code

rocky jackal
#

wouldn't this create duplicates?

#

That's one of my main concerns

azure mason
#

dont use .map

rocky jackal
#

yea

#

sort of, yes

azure mason
rocky jackal
#

there are 3 main ways the colorways are fetched

rocky jackal
azure mason
#

youre good

rocky jackal
#

once the menu is opened

#

and manually, using the refresh button

#

yes

#

I also just killed vesktop

#

never works first time

azure mason
#

( i forget tsx syntax, this is psuedocode)
also in the tsx put { colorways.length === 0 ? <div>loading</div> : <actual rendering>}

rocky jackal
#

so the useState line is throwing this:

#

prob imported it from the wrong module I would guess

azure mason
#

do a search for useState and see where its imported from elsewhere

#

we use react weirdly

rocky jackal
azure mason
#

the first one

#

dont import react

rocky jackal
#

if I import anything from react, it won't build

azure mason
#

we use discord's react

rocky jackal
#

I was using the webpack common

azure mason
#

wtf

#

send code, ill look at it in a sec

#

away from laptop

rocky jackal
azure mason
#

dw youre good

rocky jackal
#

and yes, I am using part dom

#

for the style elements

dull magnet
#

no part 2

rocky jackal
azure mason
#

ill fix it

rocky jackal
#

I know, it was only for the css part, and only temporary

azure mason
#

should we wait to fetch until the plugins enabled

rocky jackal
#

I mean, it's meant to be a client theme of sorts

#

so it should load as early as possible, I would think

azure mason
#

also it does settings bad

#

NO

#

BAD

#

BAD COPILOT

rocky jackal
#

why would it do that?

#

oh

#

I think it pulled from the bd plugin

azure mason
#

@rocky jackal can i have style.css

rocky jackal
azure mason
#

ty

rocky jackal
#

OH

#

I THINK I DID IT

#

I made the colorways button (see image) to do the fetching once clicked, then attach the final array as a prop, which is then used as the initial state value

azure mason
#

fixed settings, used state, and more shit im probably forgetting

#

jsyn i changed the devs to me bc im too lazy to locally add u

rocky jackal
#

I already have it

azure mason
#

oh

#

oki

rocky jackal
#

at least for this repo

azure mason
#

ah

#

is it working?

#

because

#

lmao

rocky jackal
#

yea ik it throws a lot of errors

azure mason
#

ah oki

#

do u want me to fix it?

rocky jackal
#

kebab case?

rocky jackal
azure mason
#

idk im looking at it rn

#

oki

rocky jackal
#

ah

azure mason
#

ew it wants this

rocky jackal
#

yes

rocky jackal
azure mason
#

wym

#

works on my machine trolley

rocky jackal
#

ok so I made the active class stateful, thanks to your code

#

also why change the format of the source files?

azure mason
#

?

#

wym

rocky jackal
#

there is a reason I had them as an array

#

while you made them a string

azure mason
#

if you want it in the vencord settings menu it has to be a string

#

there isnt an array option type

#

i made it a string that splits on ,

rocky jackal
#

Wasn't planning on using that, but oke

azure mason
#

ohhh

#

sorry

rocky jackal
#

Custom settings UI

azure mason
#

ohhhhhhhhhh

rocky jackal
#

so even the bad settings format I was using was fine for me, since I didn't want to use that UI either way

azure mason
#

looks like to use arrays as settings u need to use DataStore from <@&1118512699836481547>pi/DataStore

#

idk how vencord would handle saving the way u did

rocky jackal
#

handled it pretty well for me

lone panther
#

i feel like you could do some funky modulo stuff

#

instead of flipping variables like that

rocky jackal
#

that's why it will default to null and be set to null if you disable the colorways

#

since if you just started using the plugin, this wouldn't exist yet

azure mason
#

hm

rocky jackal
#

now im looking for a way to add styles without having to touch dom

#

also, is there a way to stop the onclick event from propagating on the children?

rocky jackal
#

so I did some changes to also make way for the custom colorways

#

now the colorway name is saved as activeColorwayID and its css/import as activeColorway

#

ok so refreshing and everything seems to be working a-ok

#

f*ck you stylelint

azure mason
#

kill kill kill

silk sorrel
#

like this maybe
single for loop where the ith square position decides whether to print a or b
even i % 2 == 0 (same as false, so b)
odd i % 2 == 1 (same as true, so a)

for(int i = 1; i <= num_ask*num_ask; i++) {
    printf("%c", i % 2 ? a : b);
    if (i % num_ask == 0) printf("\n");
}
#

the cond ? iftrue : iffalse thing is just a shorter version of an if statement

#

nevermind it looks weird with even num_ask

lone panther
#

just add another layer of for loop

#

that determines the constants that the inner for loop prints

silk sorrel
#

nested for loops yuck

lone panther
#

evil

#

i think you can def do it cleaner but

#
for i1 in 0..num_ask {
  for i2 in 0..num_ask {
    print!("{}", match (i1 % 2 == 0, i2 % 2 == 0) {
      case (false, false), (true, true): "*",
      case (false, true), (true, false): "#"
    } )
  }
  println!("");
}
silk sorrel
#

lmao rust

lone panther
#

bit psuedocode-y but how i'd do it

lone panther
#

gets the point across

#

alternatively

#

if you can XOR the boolean values

#

of the two modulo comparisons

#

that'd work the same

green vessel
lone panther
#

itd have to

#

it needs to compare against the new i2 value every time

green vessel
#

Oh

#

I don't know how to read rust code so I took a wild guess

#

In this case surprisingly its way more readable

lone panther
#

oh thats definitely not what the rust code is doing lol

green vessel
#

Idk what this match is

#

Is it like a switch statement

lone panther
#

its like a JS switch statement

#

yes

green vessel
#

Macro??

lone panther
#

JS doesnt have tuples so youd have to use something else

green vessel
#

The thing I don't know

rocky jackal
#

finally ported variable color previews

#

(for colorways with less than 4 colors)

serene cape
rocky jackal
#

ah yes, react

#

Oke so 2 things

#

refresh was broken because I was comparing a number to an array, not its length

#

I also didn't make the modal open once the fetching finished

blissful cosmos
#

hi. i am new to making vencord plugins and need some help. I have the basic template script from the basic guide and have it loading on discord using npm watch / restarting discord. how do I use a patch and ctrl r for dev purposes? I am also a little lost as of where to go from here, looking at the preset plugins and they're not making sense as to where they're pulling things from. a little help for a noob would be very appreciated, thanks!

viral roost
blissful cosmos
#

thats all I can find for any type of vencord development

blissful cosmos
viral roost
#

yeah

blissful cosmos
#

ok. is there a better guide to use that will actually explain this a little better

viral roost
tardy grove
#

how would I create a plugin that finds all code blocks and edits their html based on their content

#

i can do the manipulation of the HTML just wondering how I would find all codeblocks in view

azure mason
#

that would be horrible

#

how to rce 101

#
<script>
  alert('haiii')
</script>```
 type beat
tardy grove
#

Well no I was gonna use it to render LaTeX

azure mason
#

ohh

tardy grove
#

I just need to be able to find the codeblocks and read their contents

#

so i can detect if they are latex and then put a rendered version instead of the code

azure mason
#

shikicodeblocks uses a code element that can easily be queried

tardy grove
#

ohhh

azure mason
#

and u can get content (with a few things u need to filter) from .shiki-table

tardy grove
#

mmm yes now all I gotta do is like escape the shit I need

dull magnet
#

we really need to revamp basic docs

#

don't use dom

#

patch the react component and return ur custom component

#

anyway rethink whether executing arbitrary latex code is safe

#

I doubt it is

austere mauve
#

latex script tag

azure siren
#

i don't know where to ask so is there a way to add simple js snippets to be run by vencord?
(i made one that just changes the notif sound but i still want to use it along with vencord)

azure mason
#

you could make it a plugin

azure siren
#

but that would require me to maintain a full fork of vencord which i don't want to do (i want to keep auto updates)

azure mason
#

src/userplugins:

azure siren
#

is that possible with vencordDesktop?

azure mason
#

yeah

#

im using vesktop with userplugins rn

azure siren
#

how

azure mason
#

build vencord yourself and tell vesktop to use the custom version

#

it still updates

azure siren
#

wait i don't have to manually git pull every time?

azure mason
#

nope

azure siren
#

well it did the job :3

austere mauve
#

monkey patch husk

#

i mean it werks

amber mantle
#

horror

#
await Vencord.Webpack.Common.FluxDispatcher.dispatch({type: "DRAFT_CLEAR", channelId: 812748542748786712, draftType: 0})
``` this should in theory work but guh
#

i will have shitcord ux forever

#

inb4 read only dispatch event

#

Okay it does work, just not on channels you can actually chat in

#

no more unclearable draft, fuck your ux discord
whats odd about this is it only works until you restart
im actually gonna lose it

trail ginkgo
#

the banners on the li st

azure mason
azure mason
steep vapor
dire fern
# azure mason

I hate you so much, you're gonna make me rebuild Vencord again

dire fern
dire fern
#

Another cosmetics shop :)

amber mantle
#

cooking crack probably

rich hawk
rocky jackal
#

found where I will copy a swatch from for colorways

#

It's even using the native discord colorpicker

pulsar harbor
pulsar harbor
#

ty!

#

rebuilding to install plugins...

#

i feel like a gentoo user

azure mason
#

is a backtick (`) ever used in css

grim hare
#

it's not, no

#

(I even went through the css syntax specification to double check for you shiggy)

azure mason
#

tysm :D

dull magnet
#

` can occur inside a css document

#

if thats what youre asking

azure mason
#

yeah but is it valid for any real use?

dull magnet
#
.banana::after {
  content: "`";
}
dull magnet
#

if youre asking whether you need to escape it, yes

#

vencord does this

azure mason
rocky jackal
primal arch
#

how do i make people have to sign up to a website to verify on discord

rocky jackal
#

that's called user flow

#

and basic api checks

#

you need to prompt the user to sign up

#

then give them the option to connect his discord using oauth

opal fern
rocky jackal
#

add checks so that the signup/login process cannot be skipped

rocky jackal
opal fern
#

discordjs.guide has a very good guide on oauth

rocky jackal
#

and can definitely explain it better than I can

rocky jackal
#

It somehow worked???????????

#

so, there is an issue with the swatches

#

they only load if you open the settings

rocky jackal
#

is there any sane way to force load that module?

#

985101 is the id of the module

dull magnet
#

make the colorways creator be in settings

#

;)

rocky jackal
#

I mean, if there is a way to patch it inside the appearance tab

spring bay
#

idk but if you can't fix it just add a button (or link) that opens settings so its easier to do

rocky jackal
#

I use it on the bd version to open the theme previewer sidebar

dull magnet
#
SettingsRouter.open("Appearance")
#
SettingsRouter.open("void")
rocky jackal
#

is there a way to patch the selector below this?

#

basicThemeSelectors is the class

dull magnet
#

stop using the dom selector and use react devtools

rocky jackal
#

I wasn't planning on using that

#

I want to use the patcher if possible

dull magnet
#

so use react devtools

rapid island
dull magnet
#

for example by searching for \.Gradient\b in the sources tab

#

and boom there it is

rocky jackal
#

and how would that translate to a patch?

dull magnet
#

you just patch the code to do what you want it to do

#

its a really simple concept

rapid island
dull magnet
#

yes

rapid island
#

ok thx

dull magnet
#

$self in patches

cedar marsh
#

Why is reactive state in svelte so lame?

no updates on array.pop() or changes to nested objects

dull magnet
#
array = array
#

:)

#

still miles better than react where u need to make a new array

cedar marsh
dull magnet
#

make your own store for it

cedar marsh
#

NGL, no idea what a store is yet in this context

dull magnet
#

svelte store

cedar marsh
#

thats a bit ahead of me :p

#

I am just learning svelte now

rocky jackal
#

I have a patch here as an example, but it's hard to make sense of what is what

#

no you did not, github

#

no you did not just shove me a copilot ad

#

yep, leads to the thing

azure mason
#

why is esbuild doing different behavior on watch

#

when i watch it builds everything in the current dir

#

when i normally build it does what it should

#
/**
 * @type {esbuild.BuildOptions[]}
 */
const buildConfigurations = [
  {
    ...common,
    entryPoints: ["src/index.ts"],
    outfile: "out/preload.js",
    footer: {
      js: "//# sourceURL=BluskyPatcher\n" + sourceMapFooter("patcher"),
    },
    sourcemap,
  },
];

if (watch) {
  const contexts = buildConfigurations.map((config) => {
    esbuild.context(config);
  });

  await Promise.all(contexts.map((context) => context.watch(watchOptions)));
} else {
  await Promise.all(buildConfigurations.map((config) => esbuild.build(config)));
}
process.exit(0);
#

should i just go back to the version where watch is a build argument

#

no it does the same thing there??????????

dull magnet
#

don't do it like that

#

unconditionally make a context

azure mason
#

i did do that and just called rebuild once if it wasnt watch but it did the same

dull magnet
azure mason
#

oh awa i was using vencord's script as reference but it uses older esbuild

#

i tried this but no workie

#
/**
 * @param {esbuild.BuildOptions} options
 */
async function addContext(options) {
  const context = await esbuild.context(options);
  contexts.push(context);
}
await Promise.all([
  addContext({
    ...common,
    entryPoints: ["src/index.ts"],
    outfile: "out/preload.js",
    footer: {
      js: "//# sourceURL=BluskyPatcher\n" + sourceMapFooter("patcher"),
    },
    sourcemap,
  }),
]);

if (watch) {
  await Promise.any(contexts.map((context) => context.watch()));

  contexts.forEach((context) => {
    context.dispose();
  });
} else {
  await Promise.all(contexts.map((context) => context.rebuild()));
}
process.exit(0);
azure mason
#

does the same thing

#
import { BuildContext, BuildOptions, context } from "esbuild";

import vencordDep from "./vencordDep.mjs";

const CommonOpts = {
  bundle: true,
  sourcemap: "linked",
  logLevel: "info",
};

const NodeCommonOpts = {
  ...CommonOpts,
  format: "cjs",
  platform: "node",
  external: ["electron"],
  target: ["esnext"],
  define: {
    IS_DEV: JSON.stringify(isDev),
  },
};

const contexts = [];
async function createContext(options) {
  contexts.push(await context(options));
}

await Promise.all([
  createContext({
    ...NodeCommonOpts,
    entryPoints: ["src/index.ts"],
    outfile: "dist/preload.js",
    footer: { js: "//# sourceURL=sourceurl" },
  }),
]);

const watch = process.argv.includes("--watch");

if (watch) {
  await Promise.all(contexts.map((ctx) => ctx.watch()));
} else {
  await Promise.all(
    contexts.map(async (ctx) => {
      await ctx.rebuild();
      await ctx.dispose();
    })
  );
}
#

all i did was remove typings

#

wait wtf

#

vscode tasks are running an old version of the script???????

#

the build script works, my task is doing it weird tho

#

what the fuck

#
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build",
      "type": "shell",
      "command": "node ./build.mjs",
      "group": {
        "kind": "build",
        "isDefault": true
      }
    },
    {
      "label": "watch",
      "type": "shell",
      "command": "node ./build.mjs --watch"
    }
  ]
}
rocky jackal
#

cache maybe?

azure mason
#

zero clue

rocky jackal
#

what is the init function meant for?

#

doesn't seem to be initializing anything

azure mason
rocky jackal
#

close is also brokey

rocky jackal
dull magnet
#

just look up what that does

#

DISCORD MOM;ENT

rocky jackal
#

oh, oh no

dull magnet
#

duplicate modules 😭

rocky jackal
#

maybe one is not used

#

and they didn't bother to remove it

dull magnet
#

it isnt used indeed but there is no reason for it to exist

#

this is likely just them being too stupid to use an if else

#

so they have two different modules for a tiny A/B testing change

#

not the first time :)

rocky jackal
#

that's true

#

finally getting my shit together

#

only thing remaining is the template string, replacing the appropriate text, and saving the custom colorways

#

if all goes well, this will be a very much improved version of the bd counterpart

azure mason
#

asking out of curiosity, not bc im gonna do anything with it, would it be possible to load some plugins at runtime without compiling if the modules it patches havent been loaded yet?

dull magnet
#

yes

azure mason
#

ah