#🧩-plugin-development

1 messages · Page 33 of 1

pure temple
#

lol

lone panther
#

i flip between i and idx for that

#

depending on what side of the bed we woke up on that day

dull magnet
#

I hate that personally

#

idx is ok

pure temple
#

i was writing a lot of java and i insisted on making everything as verbose as possible

dull magnet
#

i avoid traditional for loops as much as possible anyway

dull magnet
#

that's the true java way

lone panther
#

surprised you didnt wrap it as an EnumerableIndexFactory

pure temple
#

the java development experience: add a load of fields and then press eclipse's generate thingy

lone panther
#

y

#

y

#

you what

pure temple
#

I should find some of my java garbage

#

all of them were in like 10 nested folders with stupid names

#

(I have got slightly better.?)

#

i am struggling to find garbage

#

i can just find stuff that's not great

#

(I tried writing a http server because i didn't like any of the existing libraries which seemed to be super bloated)

#

uh yeah that's bad

#

that is horrible

lone panther
#

what.......................

#

what....................................................................................

pure temple
#

are you ok?

lone panther
#

what............................................................................................................................................................................................................................................................

#

not after seeing that code

pure temple
#

i didn't realise it was that bad

#

just non-optimal

lone panther
#

i dont even know what it does i cant understand it

simple folio
past quiver
#

• clones a project from source, and installs dependencies
• attempts to build with gradle
• catastrophe NotLikeHaachama

#

how on earth do you get into coding NotLikeHaachama

simple folio
#

make sure android sdk is set up correctly

#

oh and make sure JAVA_HOME is set to jdk 17

simple folio
#

*gradle

proud cargo
#

im not going back on my words

simple folio
#

the project they're doing is kotlin

proud cargo
#

kotlin is java

simple folio
#

nop

proud cargo
#

im gonna transpile gloom into java

#

fear me

simple folio
#

in some sense that's what the jvm target does

lone panther
#

there is not a single good jvm language

simple folio
#

kotlin

proud cargo
lone panther
simple folio
#

kotlin does have native target

lone panther
simple folio
#

no jvm required

lone panther
#

in that case kotlin normal bad

simple folio
#

kotlin can also compile to js

lone panther
#

i hate yiu

proud cargo
#

wait so i can

simple folio
#

i haven't really seen anyone use it though

proud cargo
#

transpile kotlin to v8 bytecode

simple folio
#

no it compiles to js

proud cargo
#

ya

#

my electron setup compiles main/preload to bytecode

simple folio
#

kjs does support react

lone panther
#

i did NOT need ti know thrt

simple folio
#

no one uses

lone panther
#

im not sure if that makes it worse or better honestly

simple folio
#

anyone doing web dev with kotlin is likely using the experimental compose for web lib

lone panther
#

i want to punch you for ever telling me avout any of this

#

a fist is coming your way as we speak

simple folio
#

compose is good though

lone panther
#

not on web

simple folio
#

well its extremely experimental so yeah

proud cargo
#

thoughts on new java @simple folio

simple folio
#

i don't use java anymore

proud cargo
#

dont even follow releases?

past quiver
# simple folio make sure android sdk is set up correctly

welp. i think the problem was how i cloned it into the wrong directory. instead of cloning it into my studio projects folder (~/StudioProjects/Gloom), i cloned it into a completely unrelated folder, where most of my personal data is stored (~/Jank2/Projects/Gloom) so gradle had no idea where the sdk folder was.

simple folio
#

why would i

simple folio
proud cargo
#

respectfully

past quiver
#

i also hate the font. i just wanted to try something new with my terminal tho

proud cargo
#

try a different new thing then trolley

past quiver
simple folio
#

out of curiosity what are you planning on contributing to gloom

past quiver
#

i really dont know yet. since java seemed like a useful language to learn, i wanted to use your apps as an entry point into programming.

#

and then i realized java isnt the same as kotlin... i think

simple folio
#

kotlin is a bit easier than java imo

#

but java is more likely to be used in enterprise environments

#

and compose is probably a bad starting place to learning kotlin

past quiver
timid hinge
#

i am not kidding when i say that i fucking DESPISE gradle

quiet prairie
timid hinge
#

in fact i actually enjoy using maven most of the time

waxen mauve
#

Mf when

#

||that css is supposed to make all messages I send lowercased||

rocky jackal
#

no?

#

that just makes all messages appear lowercase

pure temple
#

lmao

#

yes

rocky jackal
primal narwhal
#

can someone pretty please make a plugin that forces avatar decorations, animated profile pics when reduced motion is enabled to play?

#

well I don't want them to always play

#

would just like same behavior as when reduced motion is disabled

dull magnet
#

then disable it 😭

primal narwhal
#

yeah but reduced motion makes switching channels, scrolling and clicking on stuff pretty much instant

pure temple
#

huh

#

switching channels doesn't have an animation

primal narwhal
#

then not switching channels

#

but scrolling is 100% faster

pure temple
#

you mean jumping?

primal narwhal
#

that too

#

but regular scrolling loads messages a bit faster

pure temple
#

i don't think so

viral roost
#

and opening settings
and like anything lmao

primal narwhal
#

yes

#

!

pure temple
#

scorlling seems to be the same speed

#

but i think it might speed up loading

primal narwhal
#

that's what I meant

#

my bad

pure temple
#

the client loading

#

not the message loading

primal narwhal
#

yep

#

I don't think client loading is faster

pure temple
#

it probably doens't wait for the spinning animation to end though

pure temple
#

should be

#

but if the result is on the first page i don't think that'd work well

dull magnet
#

ofc

#

in any case if its just about blocking some low quality sites

pure temple
#

i don't see why not

dull magnet
#
[data-async-context^="query:"] {
    display: flex;
    flex-direction: column;
}

[data-async-context^="query:"] > div:has(a[href^="https://modrinth.com/"]) {
    order: -1;
}
#

hmm it causes some issues with margins sometimes

#

idk how to fix that

#

@prime lodge

oblique lark
#

rust standard library my beloved

austere mauve
#

its safe

#

unsafe {} blocks are safe because it got safe in them

lone panther
#

yop

#

when is unsafe by default and u need to use safe {} blocks

oblique lark
#

someone should make a joke language where you actually have to do that

woven lion
#

reverse c#

austere mauve
#

who thw fuck thinks C# when they see unsafe

woven lion
#

no that's the joke

#

a language that's always unsafe and requires explicit safety

#

c# would be a perfect contender because of its ability to become unsafe

#

although i have done native stuff in c# with pointers and shit xd

austere mauve
#

c# has unsafe blocks

woven lion
#

yes precisely

#

now make the entire language unsafe

#

with safe blocks

#

reverse C#

oblique lark
#
safe funct main[void] => int
|  `print hello world to stdout`
|  safe
|  |  message :: const String
|  |  message <- `Hello, World!`
|  |  standard#io#stdout#print message
|  |  return 0x0

i think we have a winner here

lone panther
#

we were

#

joking about

#

rust

woven lion
#

yes and then

lone panther
#

which has the exact same feature

woven lion
#

"a language"

#

came up

#

not rust

lone panther
#

stolen by c# apparently

woven lion
#

so the joke was

#

that

#

what

#

no

#

c# literally has it for working with natives

oblique lark
#

what do you guys think of my snippet

woven lion
#

make it even more shit by making safe blocks only valid in safe function contexts

#

safe funct main

woven lion
#

i love fixed pointer blocks and ImGui.GetIO()->IniFileName = "";

oblique lark
#

i should stop editing it probably

lone panther
#

you somehow keep making it worse

oblique lark
#

haskell type declaration 👍

#

not for functs though fuck that

woven lion
#
unsafe constdata
| 0 -> `Hello, World!`

mixedsafety funct main[void] => int
|  `print hello world to stdout`
|  safe
|  |  message :: container<String>
|  unsafe
|  |  message <- unsafe:loadconst 0
|  safe
|  |  standard#io#stdout#print! { message }
|  |  return 0x0
oblique lark
#

if you're going to do unsafe code you should get out of the safe block

woven lion
#

oh yeah my mistake

oblique lark
#
using funct standard#math#add

safe funct main[void] => OSint
|  safe
|  |  `add two numbers`
|  |  one :: 1
|  |  const one <- 1
|  |  two :: 2
|  |  const two <- 2
|  |  two :: int
|  |  two <- standard#math#add one, two
|  |  standard#io#stdout#print result
|  |  return 0x0

the + operator is reserved for string concatination, and cannot be used to add numbers. instead, use standard#math#add

waxen mauve
rocky jackal
#

but why ping me?

#

You made it

lofty crypt
# waxen mauve Mf when

your class hash is outdated. Parametrize it to avoid that:css [class*="messageContent-"] { text-transform: lowercase; }

waxen mauve
#

¯_(ツ)_/¯

#

it looked like you thought it works only for my side

waxen mauve
lofty crypt
#

with the TextReplace plugin

waxen mauve
#

wait no way it's that simple

#

wow

lofty crypt
#

^^

waxen mauve
#

i'm typing fullcaps and it works

lofty crypt
#

cheers

waxen mauve
#

at least i think it does

waxen mauve
lofty crypt
#

gladly!! :D

lofty crypt
chrome elbow
#

xd

dull magnet
#

wait how do u do it with text replace

#

you need to add like 26 rules, one for each letter

lofty crypt
#

yeah i suppose. (One could semi-automatically generate such rules if this person’s pr is merged ↑)

amber plover
dull magnet
#

settings.json is a very inefficient storage

#

it's blocking & json is inherently kinda shit

#

it's also stored in localStorage in browsers which is potentially limited to a few kb

#

DataStore/indexeddb is much more efficient, not blocking (async) and has no storage limit

#

settings should only be used for basic booleans and small data. text replace rules can potentially become plenty and large storing them in settings is bad

amber plover
#

Oh okay, wasn't aware of that. These are the arguments I was looking for when I posted here originally.

dull magnet
#

also syncing text replace rules would be kinda an anti feature to me

#

they may potentially contain sensitive info

#

some people wouldn't want us to have access to their text replace rules while still using settings sync

amber plover
#

okay, i understand

dull magnet
#

a better idea would be to refactor the offline import / export to also include DataStore settings from several plugins

pure temple
#

maybe just allow plugins to have their own json files?

amber plover
dull magnet
pure temple
#

json is usually used for things like this though

#

i.e. configuration

dull magnet
#

DataStore supports json and beyond

#

the data format isn't the question

dull magnet
pure temple
#

i did (maybe not properly)

#

why not put the settings.json in IndexedDB..?

dull magnet
#

because async is inconvenient

#

and vencord needs settings synchronously

#

sync settings are okay if used for small data

#

not if used for many MB of data

pure temple
#

if you are storing that much then you definitely have too many TextReplace rules lmao

dull magnet
#

people put insane stuff there

dull magnet
#

discord already stores a shit ton of stuff in localstorage

#

we're potentially working with very little space

amber plover
#

Isn't Vencord only compatible with the desktop versions of Discord? Doesn't this mean it's always the Chromium browser we're talking about?

pure temple
amber plover
#

The limit for local storage seems to be 10MB for Chromium.

pure temple
#

surely the browser asks before using that much

chrome elbow
amber plover
#

oh okay

pure temple
#

yeah

dull magnet
#

vencord runs in every modern browser

lofty crypt
#

(sorry, had a phone call)

#

good to know, thanks for explaining all that v! ❤️

pure temple
#

yeah i understand now

lofty crypt
#

could we have the best of both worlds by (a)syncing° a settings.json in the filesystem with the IndexedDB or another fast data storage like just an object in RAM?

° reading it only on startup (and maybe when the filesystem alerts that it has been changed), otherwise reading from fast RAM/db; effecting fs writes async with low priority in idle time

i think that may be how bd does it

dull magnet
#

that's already how it works

lofty crypt
#

😅👌

dull magnet
#

it reads settings.json once at startup then keeps it as a variable and every time you change anything it writes it back to settings.json

lofty crypt
#

then @amber plover what was your pr supposed to improve on that?

#

ah nvm i think i got it

amber plover
lofty crypt
#

nice summary^^

pure temple
#

i don't think it'd be too much in most cases

#

but yeah i guess you may have a lot of rules

amber plover
pure temple
#

i was more concerned about storing sounds in my CustomSounds plugin though lol

lofty crypt
pure temple
#

lhs = finds?

dull magnet
#

with no data limit

pure temple
#

yeah, i thought of doing that

lofty crypt
dull magnet
#

I once wrote 50gb to DataStore and it worked fine

pure temple
#

but... uh

dull magnet
#

but discord config folder exploded

lofty crypt
#

lol

dull magnet
#

40gb discord folder

pure temple
#

surely browsers need to ask the user?

dull magnet
#

depends

#

you can store a crap ton without consent

pure temple
#

otherwise you could just visit a site and it could fill your disk lol

dull magnet
#

but browsers may randomly delete it if it's too much

#

try it yourself

pure temple
#

but yeah i planned to use IndexedDB

#

/DataStore whatever

#

(is that some kind of wrapper?)

lofty crypt
dull magnet
#

For example, Chrome and Chromium-based browsers allow up to 80% disk space. If you have 100GB, Indexed DB can use up to 80GB of space, and 60GB by a single origin.

pure temple
#

but on desktop i think it'd be better to store it in actual files

amber plover
lofty crypt
pure temple
#

couldn't you add a flag on settings to get it to magicly use DataStore or something

dull magnet
lofty crypt
#

eviction xd

dull magnet
#

indexeddb is a very efficient storage mechanism

#

why would we not use it

#

it's way better and more robust than anything we could manually implement

pure temple
#

hmm

dull magnet
#

not to mention sending large blobs via ipc is slow

pure temple
#

ah

#

yeah...

#

good point

dull magnet
#

also overcomplicates things

#

indexeddb is very very good

#

you can dump random js structures in there

#

Maps, blobs, etc

pure temple
#

i just thought it'd be nicer for the uesr because they can see all of their custom sounds in a folder

dull magnet
#

try storing the same in json

#

you need to serialise

pure temple
#

but i wanted to store the URLs (which should be fairly short) in settings.json

lofty crypt
dull magnet
lofty crypt
#

Google take my data
idc enough lol

pure temple
#

husk wouldn't you just put the link?

lofty crypt
#

but could be encrypted for privacy sensitive folks

#

put where link to what?

pure temple
#

lol but this is definitely very bad

lofty crypt
#

^^

amber basin
pure temple
#

this is small enough that it somehow works lmao

#

but i put something bigger and Discord stopped responding

#

and of course it likely wouldn't work in browser at all

lofty crypt
#

mount discord chats to fs

pure temple
amber basin
#

mlv2 essentially

pure temple
#

even more cursed than my minecraftchestfs idea

amber basin
#

your. WHAT

lofty crypt
#

i like it!

#

mount everything – the movement!

lofty crypt
pure temple
#

lol

#

yeah no

lofty crypt
#

actually i think this would not need to be coded specifically for vc/ plugins. It should be a module you can link to any set of data in IndexedDB; plausibly someone has made that alr

amber basin
#

semi related but i used to be on the web port team for an indie game and apparently emscripten has "idbfs" that literally mounts a folder to indexeddb

#

used to store saves in localstorage before i joined, ppl were running out of space

lofty crypt
#

cool, tx!

amber basin
#

rate my packet system

#

normally have a constructor for a packet but its not in devtools

#

constuctored would be ts const proxiedPacket = new Packet(WsEvent.EVAL, "console.log('a')"); const outPacket = new Packet(WsEvent.PROXY, { id: 1, packet: proxiedPacket, }) outPacket.send(ws);

crude iron
#

what's this for?

amber basin
#

fevered dream i had

#

you put a stack of chromebooks on a website and you can remotely send webassembly payloads

#

currently, the core server is done, working on the managment ui rn and i need to actually make payloads

lone panther
#

literal ACE

#

you are like making a literal botnet

amber basin
#

so is a docker swarm?

#

im gonna use it for rendering shit

stuck rampart
amber basin
#
mod utils;

use wasm_bindgen::prelude::*;

#[wasm_bindgen]
extern "C" {
    fn alert(s: &str);
}

#[wasm_bindgen]
pub fn main() {
    alert("Hello, world!");
}

works though and will alert

quiet prairie
#

the question being, is there any reason why settings wouldn't persist?

amber basin
#

did you add the settings to the plugin definition

quiet prairie
#

yes

#

i'm just bamboozled, it was definitely working earlier today

amber basin
#

that should be saving

#

are you getting any errors in console?

quiet prairie
#

nothing that seems relevant

amber basin
#

weird

quiet prairie
#

maybe i'm looking at it wrong

#

>.>

#

it uhhh

#

it works now it has stopped working

quiet prairie
#

me when it works again

#

maybe some cosmic ray looked upon me with malice and flipped the bits involved in saving my settings

#

resulting in them not saving

#

probable

green vessel
#

Wow

thin acorn
#

anyone have css snippet to change someones profile picture, me and my friend wanna put our faces on ours but we dont want others to see

chrome elbow
thin acorn
#

youre the same person that helped me last time

#

thank you

pure temple
#

guh?

gray vapor
lofty crypt
#

they want an add-on to disable media mosaic

pure temple
#

yeah that'd be a pretty cool plugin ^^

minor jolt
lofty crypt
junior cove
#

Nah can't be done with just css, the image on the page there is after they've done all their wacky stuff to it

gray vapor
#

to quote a theme developer

... videos in a mosaic will always open in a popout and images may end up being blurry

pure temple
#

NoSaic

#

that's a good name

gray vapor
#

AutoUncollage2008

#

named after the so called microsoft research autocollage 2008

pure temple
#

lol

green vessel
#

So I'm trying to make a plugin for Vencord but i dont know where to start.
I think it would be pretty simple (i want to add thumbnails to folders), however i have very little knowledge in JS or CSS

#

right now my serverlist looks hectic because of all the folders and none of them make sense, but i was wondering if it would even be possible to give them thumbnails

pure temple
#

it's possible to code this yes

#

you can also use css (bad ux though)

#

maybe see what part of the code PlainFolderIcons is patching

green vessel
#

ive noticed with plain foldericons, i cant set colors or that would be sufficient

pure temple
#

hmm?

#

you can?

green vessel
#

i might be because im using better folders too then

#

ah no it was my theme

#

discord looks so wierd without a theme after all this time

lofty crypt
#

(i’d lowercase the S tho, like calm down jesus)

green vessel
#

my folders are looking wierd too for some reason

green vessel
#

might use it to try learn more js/css

#

im a python webdev 💀

pure temple
#

a what??

green vessel
#

yes

#

sanic my beloved

#

i like doing things with python that i shouldnt do with python

pure temple
#

lmao

#

Build fast. Run fast.

#

ah

green vessel
#

yeah

green vessel
#

its basically flask but ✨ new ✨

#

and good

#

i enjoy making random apis to do random stuff

#

(using a json db because i was too lazy to learn sql but its now a required module on my course)

austere mauve
green vessel
#

im gonna cry

austere mauve
#

you should be

lofty crypt
#

let it out sibling

green vessel
#

what did i do to you 😭

pure temple
lofty crypt
#

what did you do the world? what did you do to yourself? are the questions you should be asking

lofty crypt
#

yes

green vessel
#

well i just love python

#

i like python in wierd ways.

lofty crypt
#

btw i have no issue with you using py for anything, i’m just hopping aboard the meme train here

solid moss
green vessel
#

python my beloved ❤️

solid moss
#

the thumbnail images themselves are cropped

#

maybe js to remove ?width=x&height=y from the src + css could work

lofty crypt
green vessel
#

i was simply saying i like python in wierd ways

lofty crypt
green vessel
#

as in, i enjoy doing things with python that python shouldnt be used for

green vessel
pure temple
#

hmmmmmm

lofty crypt
green vessel
#

i found something malicious

#

code embedding

#

you can put code in other files which is not smart

lofty crypt
#

hehe

minor jolt
#

Asyncio my beloved

austere mauve
#

rule 9.6 it is not allowed to write python code that isnt mocking the language

green vessel
pure temple
austere mauve
gray vapor
#

i write code in java

#

i love java

#

although c#'s also somewhat nice, only if you don't use that .net framework garbage, especially using vscode and linux

green vessel
#

it was made out of spite

gray vapor
#

it's microsoft java

green vessel
#

yes

gray vapor
#

the whole sun microsystems vs microsoft lawsuit

green vessel
#

because microsoft said "hey can we use java" and got a no

gray vapor
#

all because microsoft tried to do theri eee strategy on java

green vessel
#

so microsoft said " fine were gonna make our own java!"

gray vapor
#

by not being complient with java and also adding their own proprietary stuff

green vessel
#

yea and they made their own java 💀

minor jolt
austere mauve
#

yeah i dont think its greek

minor jolt
#

Can't think of any rini related word or name that means lovely, closest name that exists is irini maybe but that means peace

deft lotus
#

is there any coder who wants to collaborate to a project for a custom profile decors plugin?

(there's already a vendetta version but we need a vencord one)

pure temple
#

i'd guess the plugin is easier than the backend

lofty crypt
#

you could also ask in #👾-core-development and you should prbly contact the vendetta version’s dev – they might be motivated to help out, at least with the interoperability

also instead of a standalone plugin, you might want to add it as a feature to the similar free custom profile bg plugin (i forget the name) (does vencord have it?) or the FakeNitro one

lofty crypt
pure temple
#

somebody wise once said you don't need a backend when you can have a json file hosted on github pages

minor jolt
#

Very real

lofty crypt
#

and wise

#

no actually i don’t get it

#

how would that work?

quiet prairie
#

maybe they mean having a json file in a repo and making commits serve as updates

lofty crypt
#

i think then you’d still need a thin backend to accept hem

unless you write your interface so as to read the PRs hmm

quiet prairie
#

yeah

#

I'm shooting in the dark I'm also curious

lofty crypt
#

i mean it would be a funny way to (mis)use gh

#

PRDB

quiet prairie
#

lmao

lofty crypt
#

xd

quiet prairie
#

kinda intriguing I wonder how well it would work

lofty crypt
#

yeah^^

quiet prairie
#

I could imagine a bot that accepts structured commits

lofty crypt
#

such a lib would prbly be fairly viral too

quiet prairie
#

err, that will only merge structures commits

#

that way no manual review is required

#

oh dear the intrusive thoughts are going to win

lofty crypt
#

i’m thinking you’ll actually want to keep them as PRs so you can use GH’s search function to filter them

#

otherwise it won’t scale

#

or maybe rather issues instead of PRs

quiet prairie
#

like in terms of database size?

lofty crypt
#

yeah

quiet prairie
#

I can see that

lofty crypt
#

would have to be processed by each client if it’s all one blobtastic json

quiet prairie
#

very true

#

yeah separate prs/issues actually makes a lot of sense

gentle cipher
#

How would I make my own custom theme?

lofty crypt
#

there’s a site for that
and/or you learn css

gentle cipher
#

ahh k

minor jolt
#

This magically fixed itself

#

Without me doing anything

rocky jackal
green vessel
#

can we make our own?

#

or is just preset

rocky jackal
#

this shows the 6 most recently created custom colorways

inner pendant
#

so this is my plugin injector

apploader.onload = () => {
        const useProxy = localStorage.getItem('useProxy') === 'true';
        const proxyOption = localStorage.getItem('proxyOption');
        const pluginUrls = JSON.parse(localStorage.getItem('websitePlugins')) || [];
  
        pluginUrls.forEach(pluginUrl => {
          const script = document.createElement('script');
  
          if (useProxy) {
            if (proxyOption && proxyOption.toLowerCase() === "dynamic") {
              script.src = `${window.location.origin}/service/route?url=${pluginUrl}`;
            } else {
              script.src = `${window.location.origin}/uv/service/${Ultraviolet.codec.xor.encode(pluginUrl)}`;
            }
          } else {
            script.src = pluginUrl;
          }
  
          const iframeDocument = apploader.contentWindow.document;
          iframeDocument.head.appendChild(script);
          console.log(`Plugin injected into the iframe: ${pluginUrl}`);
        });
      };

And because vencord needs to be injected first how can I adapt my script to bypass this or do I have to redo my plugin injector...

#

if u want me to send the vencord script I can

lofty crypt
#

the vencord script? Do you mean a custom plugin you made?

#

how do the plugins get into localStorage.getItem('websitePlugins')?

amber basin
#

i fucking hate ci

#

thank you stackoverflow

#

FUCKING FINALLY

#

it better have done the artifact correctly

#

FUCK YES

#

@stray imp i fixed it

stray imp
dull magnet
#

zip is a linux program

amber basin
#

im a bit stupor

inner pendant
#

except I belive earlier last month someone told me it has to be injected before discord starts loading or smth is there a way to bypass that tho

amber basin
#

nope

#

it has to or it wont work

dull magnet
#

why is loading before discord not an option

dull magnet
#

and why are you even making whatever you're making

lofty crypt
#

custom client?

inner pendant
#

I added some logging to it and a CSS injector for the vencord css

pure temple
#

is that just the same as vencord but with console.log at the start

#

lol

inner pendant
lofty crypt
inner pendant
#

someone told me to use browser.js and browser.css

inner pendant
#

in this chanell

pure temple
lofty crypt
inner pendant
#

so thats the js file just with the console.log's in it

#

the only difference rly in the file is this line

console.log('Vencord for Sodium is loading!');const cssLink = document.createElement('link'); cssLink.rel = 'stylesheet'; cssLink.href = 'https://cdn.z1g-project.repl.co/sodium/plugins/vencord.css'; document.head.appendChild(cssLink);
lofty crypt
pure temple
inner pendant
inner pendant
inner pendant
pure temple
#

internet censorship
catstare

austere mauve
#

fps

inner pendant
#

yea it works

lofty crypt
#

are you like running a whole vm there to use for free?

inner pendant
#

my friend hosts a "bare server" so I just route the proxy stuff to there

pure temple
#

i wouldn't trust this with my login details

inner pendant
#

anyways uh

amber basin
#

LMAO

inner pendant
#

Vencord doesn't work on it

#

cus of plugin injector

#

thats basically the problem

lofty crypt
austere mauve
#

takes a bit

#

to load

lofty crypt
#

yeah it loaded for a while, then seemed to settle on this

#

but i’ll wait

lofty crypt
inner pendant
amber basin
#

i made one forever ago in 8th grade that had qr code auth

lofty crypt
#

why? @inner pendant

inner pendant
inner pendant
#

crap uh

#

I think my friend forgot to pay the VPS 💀

lofty crypt
#

maybe you can use a free one from Oracle

pure temple
#

hmmmm

inner pendant
inner pendant
amber basin
#

try that

inner pendant
#

alr

#

so add this to my vencord script correct?

amber basin
#

nop

#

run that on the iframe, and have that script inject vencord

austere mauve
#

is this thing open source

amber basin
#

its on replit, should be

#

send editor link @inner pendant

inner pendant
austere mauve
#

source available is not open source

inner pendant
#

the scripts on replit those u can see via replit view but I dont have a github connected to it

austere mauve
#

you should probably link the source code in the website

inner pendant
#

This button opens the github

lofty crypt
austere mauve
#

oh

#

i thought that was like another app

pure temple
#

can you have open source but no source available?

austere mauve
austere mauve
#

on the contrary, not licensing your software usually means "all rights reserved"

lofty crypt
#

(thought that’s FLOSS then)

inner pendant
#

so like this?

const injectVencord = async () => {
    const {responseText: css } = await ("https://cdn.z1g-project.repl.co/sodium/plugins/vencord.css");
    const {responseText: js } = await ("https://cdn.z1g-project.repl.co/sodium/plugins/vencord.js");

    document.head.appendChild(Object.assign(document.createElement("style"), { innerHTML: css}));
    console.log('Injected');
}
lofty crypt
#

you’re not using the js variable there

lone panther
#

damn i cant believe the children are trying to inject vencord into the proxies they use to bypass school internet filters

#

children reinvent boss keys from ms-dos

dull magnet
#

why not just load it as a normal extension

lone panther
#

school chromebooks prevent you from installing extensions

dull magnet
#

;)

inner pendant
#

in case anyone is wondering what proxy is the defualt its Titanium networks Ultraviolet

#

I might be able to get it to work

inner pendant
#

this is also why im trying to get vencord to work on my plugin injector so then people with locked down chromebooks can use discord with vencord

rocky jackal
#

various bugs trolley

rocky jackal
#

this is so annoying

#

2 files are giving me errors because I am using custom flux event names

#

even though they work

austere mauve
#

....dont?

#

i dont think its a good idea to register custom events

rocky jackal
#

how should I communicate info properly between "files"/components?

#

I have a ws client in my index file and want to send the data it receives to specific files accordingly

austere mauve
#

just call the functions that need to be called?

rocky jackal
#

I want to update specific states in a modal, basically the ws client receives the stringified json, it has a "type" of "SET_COLORWAY", along with the appropriate data to make it a colorway. I want to send that to the selector modal if it's open

#

so that the selection updates

#

I might try something different, but I doubt it'll work

#

and it's gonna be a lot of work

floral plaza
#

or equivalent implementation

rocky jackal
#

it has 2 agony

#

one is from a "stream" module

#

and the other is from an "events" module

#

nvm

#

none of the modules work

#

both give ELIFECYCLE errors

#

ok so I somehow did it, and by somehow I mean made the ws an export

austere mauve
#

elifecycle means nothing

#

it just means a pnpm script failed

junior linden
#

hola

minor jolt
#

Matching pfp pointandlaugh

rocky jackal
#

to say that im an idiot would be an understatement

#

I've been looking for a way to store data using either indexeddb, which was too complicated for me, or a version of DataStore, simmilar to vencord's

#

and what do you know, vencord's datastore uses indexeddb

dull magnet
rocky jackal
#

oh well

rocky jackal
#

are there any simple scripts to disable discord's csp?

dull magnet
#

depends a lot on your environment

#

but just look at vencord codebase

#

it has for both chrome and electron

rocky jackal
#

I was kinda looking for firefox trolley, well not really

#

I made the UI work without official colorways as well so as long as it can render random css, im fine

proud cargo
#

just use electron hypershiggy

rocky jackal
#

Universal = No client mods needed, but they are needed for online colorways

timid hinge
dull magnet
#

not electron issue

timid hinge
#

on the topic of memory, what the fuck

#

steam is closed

#

there is no reason that shit should even be running

#

steam, while doing nothing, uses more memory than idea on full blast

rocky jackal
#

I can't get a wp module because I can't find it by props, yay

#

(I know I can find it by code, I want to try to find it using props, to be able to find it directly from webpackChunkdiscord_app)

rocky jackal
#

the colorpicker

#

Vencord.Webpack.findByCode("showEyeDropper") this returns the module

silk sorrel
rocky jackal
#

open settings, then run again

silk sorrel
#

oh it's lazy loaded

rocky jackal
#

yea

dull magnet
#

how do you think client mods do it..

rocky jackal
#

and that's where I'm stuck

#

I can't for the life of me make a working findByCode function

#

and neither can I find a ready-made one

green vessel
#

anyone know how to create a mute user function?

#

for like vcs

lofty crypt
#

why do you write like that?

green vessel
#

uh

#

formatting plugin I made

lofty crypt
#

lol

green vessel
#

too lazy to turn it off lol

#

opinions?

lofty crypt
#

v annoying, no offense

green vessel
#

tbh I thought about that

lone panther
#

monospace kinda lowtier typing quirk tbh

lofty crypt
#

typing quirk?

lone panther
#

y0u G0tttTa uPpPpP yOr GaYYYYme

#

(i know several people who like typing like this)

green vessel
#

ew

#

thats nasty

lone panther
lofty crypt
#

oic!

lone panther
green vessel
#

ouch

lofty crypt
#

wh2ts 2p

green vessel
#

no clue

lofty crypt
#

no more typing quirk yay

lone panther
#

i need to pull out our typing quirk machine but idk where i put the textreplace rules

green vessel
#

guys im so sad rn

lofty crypt
#

ready the machine

#

ono wai

green vessel
#

I wanna make a function

#

but discord source code is kinda long

#

and like I dont have the time

oblique lark
lone panther
#

😭😭😭😭😭😭😭

oblique lark
#

homestuck^2 updated for the first time in three years

lone panther
oblique lark
#

I Should Really Get My Own Typing Quirk Tbh

lofty crypt
lone panther
lofty crypt
#

prbly vencord also has api docs

green vessel
lofty crypt
green vessel
#

never seen them or heard of them

lofty crypt
#

i may be wrong

#

but somehow plugin devs have to know where to find stuff; maybe they just use intellisense

green vessel
#

maybe tbh

lofty crypt
#

ig intellisense it is

#

possibly not even that, maybe you have to run a function to list the available modules (“webpacks”?) as strings

dull magnet
#

whar

dull magnet
#

there is no intellisense

austere mauve
lone panther
#

yop

#

hate that mf

#

/j

lofty crypt
#

xd

lofty crypt
#

ig that’s about as simple as a dc snippet gets 😭

lofty crypt
minor jolt
#

does displaying the plugins tab on the userscript entail using gm_xmlhttprequest

wooden dragon
#

wha should I code

hexed plank
#

I want to make this always false. Is it right how I do this?

    patches: [{
        find: "showTimestampOnHover:",
        replacement: {
            match: /showTimestampOnHover:.*?\.REPLY,/,
            replace: "showTimestampOnHover: false,",
        }
    }],
chrome elbow
#

"showTimestampOnHover:!" will works

hexed plank
#

What is the meaning of !?

chrome elbow
#

it is just 1 more char in that place

#

your current find matches multiple modules

hexed plank
#

Oh I see.

#

How do I know whether the patch is successfully applied to the place I wanted?

chrome elbow
#

you can test with patch helper tab in vencord
it will appear when you build vencord with pnpm watch

hexed plank
#

Oh that is convenient.

#

Will the code seen in dev tools change when a patch is applied? The patch helper looks fine, but I can see that the codes still remain original in the dev tools after I pnpm build and reload Discord.

chrome elbow
hexed plank
#

I looked at WebpackModulexxxxxx.js, and it is also unchanged.

chrome elbow
#

did u turn on the plugin u made

hexed plank
#

I didn't. I feel stupid.

#

OK, now it works great. Thanks!

hexed plank
#

Spent some hours trying to find where I can change this time format and no luck. How can I find that?

chrome elbow
hexed plank
#

I saw this, but I still cannot find where is the format.

proud cargo
#

ah thats the wrong one

hexed plank
#

That format is for tooltip, but I got the idea. I think maybe I can figure out the rest.

proud cargo
#

for the one in chat its the one with LT format

hexed plank
#

Yeah but Discord seems to have different time format for different locales.

#

It looks strange if there is only LT here.

#

Oh I see, LT itself is locale dependent.

proud cargo
#

yeah moment itself also has global format settings for locale but im not sure where discord hid that

hexed plank
#

Finally! Thank you guys.

rocky jackal
#

started porting presets, this will mark the full transition of the plugin to vencord, and soon to any and all clients

rocky jackal
#

so this works... for some reason

lofty crypt
hexed plank
#

Is there a way to add description like this to settings of my user plugin with type: OptionType.STRING?

#

Currently there is no description, and the description field is shown as the title of this setting.

#

The main problem with showing as the title is that it is all capitalized, but I want to use lower case letters.

dull magnet
#

you can use OptionType.COMPONENT

hexed plank
#

Writing a component seems complicated. Is there a doc?

lofty crypt
lofty crypt
hexed plank
#

OK.
The examples I can find are all somehow simple, but I think they are useful enough.

lofty crypt
#

nice 🙂

dull magnet
hexed plank
#

Do we have Vencord API doc?

chrome elbow
#

no

hexed plank
#

Alright.

#

How to add a message action button that only show when shift key is held?

lofty crypt
#

(i mean it’s literally pending, smh discord!)

#

well i’m glad we get useful names in those webpack stores at all, not just single/double letter minimized variable names!

lofty crypt
#

• an excellent plugin development guide by @viral roost: https://gist.github.com/sunnniee/28bd595f8c07992f6d03289911289ba8 It also links to official guides by @dull magnet & @austere gulch.

https://discord-userdoccers.vercel.app/

• [broken as of ’23-11-02, need to fix] ~~This snippet gives you autocompletion after stores. (see screenshot):

let stores = {};
let webpack = window.webpackChunkdiscord_app.push([[ Symbol() ], {}, ({ c }) => Object.values(c)]);
webpack.find(x => x?.exports?.ZP?.Store).exports.ZP.Store.getAll().forEach(x => stores[x.getName()] = x);```

example of a discord function you can access this way:
```js
stores.GuildStore.getGuildCount();```
~~
serene cape
#

originally posted in #🏥-vencord-support-🏥
is there a way to use js somehow to determine whether someone (i dont have their user ID, only username) is in any mutual servers with me, and if so, which ones

lofty crypt
inner pendant
#

finally got it working by rewriting the proxys config to make it inject before load and its so cool lol it just takes while to load

#

thanks for your help guys

dull magnet
#

that error notification is uh oh tho

#

means localStorage is undefined aka you're likely still loading too late

inner pendant
#

I’m glad it at least works

#

Does Vencord have webRTC?

hexed plank
#

Is there a hook that runs whenever a setting of my plugin changes? I want to run some codes when a setting toggles so that I do not have to Ctrl+R to make it effective.

rocky jackal
#

if it's a setting, it saves automatically, I presume. If you have a custom modal/UI, you have to find a way/place to save your settings, for example inside indexedDB using vencord's datastore api

hexed plank
#

The plugin runs something in start(), and it is dependent on the settings. If the settings change, that function needs rerunning to apply the new settings.

austere mauve
#

add onChange to the setting definition

hexed plank
#

OK. Let me try.

hexed plank
inner pendant
#

I think its injecting on time because when looking at the console they seem to load vencord at the exact same time then again the proxy im using ultraviolet saves Localstorage at __uv$<itemname>

#

do I need to modify the script im using the ones from the repo itself instead of the custom one

#

this is how it stores it

green vessel
#

Can someone explain how findByPropsLazy works?

amber basin
#

iirc it gives you a "component" that when the target hasnt been loaded, errors, but replaces itself with the real thing once discord loads it

#

and it might let you set a placeholder, i dont remember

amber basin
#

oh

#

in that case i guess itd return a proxy that when something tries to get it it looks for the target and either caches it or errors

#

ill check in a bit

woeful thorn
#

is there a vencord plugin example somewere?

#

i want to make a plugin

amber basin
#

look at all the others

green vessel
#

I was playing around with a plugin I made and found this function "disconnect" which disconnects the user from the vc when called : const disconnect = findByPropsLazy("disconnect");
but im tryna find the function that mutes people

dull magnet
#

use react devtools to find the correct function

green vessel
hexed plank
#

Don't know much about TS, but when I need to write a really long regexp, how do I split it into multiple lines of source codes?

dull magnet
#

you cannot

#

don't write a regex this long

#

you can use the regexp constructor with a string but that's ugly as well

hexed plank
#

How to avoid writing long regexps?

dull magnet
#

you could use something like this

function regex(...args) {
    const s = String.raw(...args)
                .trim()
                .split("\n")
                .map(line => {
                    line = line.trimStart();
                    if (line.startsWith("#")) return null;
                    return line;
                })
                .filter(Boolean)
                .join("")
    return new RegExp(s);
}
dull magnet
#

ill call it ebb (even better bre)

austere mauve
#

horror

austere mauve
#

better than bre and doesnt invert escapes 🙄

#

not even true

dull magnet
dull magnet
#

i think it could be decent for patches

austere mauve
#

only if its bre

dull magnet
#

we could make a bre variant

dull magnet
hexed plank
#

Can patch replace function use named regex groups? $1,$2 etc gets cursed when there are many of them.

cedar olive
#

lmao

hexed plank
trail ginkgo
#

i was reading the comments for so long trying to understand what processed meant

trail ginkgo
dull magnet
#

i think that could actually be helpful for vencord

hexed plank
austere mauve
#

i think it encourages writing insane patches i dont really like it

trail ginkgo
#

i think the mid-patch comments are prob good for long patches

dull magnet
#

old:

match: /return ?(.{0,30}\(.{1,3},\{[^}]+?,showTaglessAccountPanel:.+?\}\))/,

new: ```js
match: re`
return ?

React.createElement(

(.{0,30}(

AccountPanel,

.{1,3},

{ ...props,

{[^]+?,

showTaglessAcountPanel:.+?}))
`

#

hmm idk how much more readable that is

#

maybe comments at end of line would be better

#
match: re`
return ?
(.{0,30}\( # React.createElement(
.{1,3}, # AccountPanel,
\{[^\]+?, # { ...props,
showTaglessAcountPanel:.+?\}\))
`
#

IDK

austere mauve
#

horror

dull magnet
#

also wow that patch sucks what was i smoking

#
showTaglessAccountPanel:.+?\}
sharp briar
#

is there any possible way i can make a timezone plugin like in BD 🙏

dull magnet
#

actually nvm it doesnt suck

#

i thought it used the showTaglessAccountPanel value, that would be horror. but its just used as anchor

trail ginkgo
#

tbf

#

if it had highlighting

#

it wouldnt be better

dull magnet
#

new: ```js
match: re`
return ?

React.createElement(

(.{0,30}(

AccountPanel,

.{1,3},

{ ...props,

{[^]+?,

showTaglessAcountPanel:.+?}))
`

#

this is kinda more readable ig

#

but also not really

#

i think the idea is cool but idk how to implement it well

viral garnet
austere mauve
#
match: re`return\((0,\i.jsx)(\i,{\[^}\]\.\+\?,showTaglessAccountPanel:\.\+\?})\)`
#

\\\\\\\\\\\\

sharp briar
austere mauve
trail ginkgo
#

isnt timezonedb a thing

median flare
dull magnet
#

why tf does oceanic not have guild.deleteChannel

#

also category.channels is always empty

#

how do i make oceanic cache all guild channels

cedar marsh
austere mauve
#

back end like typescript

cedar marsh
#

I don't speak English I speak typescript

minor jolt
#

Ok I don't think it's "completely random" after all, it definitely has to do something with the device going to sleep and then waking up, like when it shows that split second discord spinning icon. I'm not 100% but I think that's the point that breaks stuff and makes vencord unable to fetch stores and stuff

#

Btw that settings problem with the bazillion undefined webpack modules magically fixed itself, without me doing anything

minor jolt
#

And I notice it especially on file upload, I use the find filter from the voice message plugin, and I prefetch it when discord loads and keep it around (since yk it breaks later) but this prefetched version of uploadFileToCloud, once it breaks is inoperable because some internal enum or whatever is undefined and it throws an error that upload status is undefined

rocky jackal
#

what browser is that?

#

also, finally finished the browser version of the creator

#

only thing remaining to wrap this up is the preview component and a mutation observer to add the colorways button (I don't know how to patch on vanilla, or if it's even possible)

pure temple
#

could always

rocky jackal
#

basically patch on the spot?

#

dunno how to do that either, I will have to basically look both at how vencord and bd do patches

trim cedar
rocky jackal
#

yeah, but not quite

trim cedar
#

The shield and tab style are 100% firefox

#

Firefox has quite extensive user css support so it might look a little different

#

I mean my Firefox looks like this

rocky jackal
#

css

scenic stirrup
trim cedar
#

adw?

dull magnet
#

adwaita

trim cedar
#

ah it's not meant to look like adwaita but I can see the similarities xd

scenic stirrup
#

it reminds me of uhh

scenic stirrup
trim cedar
#

Wow that looks really similar

inner pendant
#

Within the proxy and normal look the same

#

idk why plugins/themes no work

dull magnet
#

there's an error

proven turret
#

Hey guys

#

new here

#

trying to code a custom plugin for vencord, is that possible?

#

better discord has a plugins folder that I could add to, but I cant seem to find that for Vencord

dull magnet
#

docs

proven turret
#

Im not seeing them in there

scenic stirrup
#

peak web design

#

OH THERE WE GO LMAO

#

TOOK LIKE 3 MINUTES

#

HAHSDKJHAHFDJSKLSJDAA

subtle ermine
#

Hey everyone, is it possible to grab a reactive property? I want to do something with the notes of a user but it's not updating correctly after changing channels.

lofty crypt
subtle ermine
lofty crypt
lofty crypt
lofty crypt
sharp briar
lofty crypt
#

then your possible way would be to learn it ig

hexed plank
#

Does Discord use a library to format using these template or they implemented their own formatting library?

#

Looked around on the internet and found FormatJS. Should be it.

lofty crypt
# dull magnet maybe comments at end of line would be better

actually yeah, i found i find aligned comments with distance at end of line look good:

match: re`
return ?
(.{0,30}\(   # React.createElement(
.{1,3},      # AccountPanel,
\{[^\]+?,    # { ...props,
showTaglessAcountPanel:.+?\}\))
`
```(not sure whether i favor ^ or  [#🧩-plugin-development message](/guild/1015060230222131221/channel/1032770730703716362/) )
lofty crypt
dull magnet
#

it does

#

cause AccountPanel is minified

lofty crypt
#

oh so in like the source map it’s AccountPanel but in the actual transferred js it’s like lb

dull magnet
#

there are no sourcemaps 😭

lofty crypt
#

then where do you even get the AccountPanel part from?

dull magnet
#

thats what i called the component

#

idek what the actual name is

lofty crypt
#

oic

lofty crypt
stuck falcon
#

I spent too much time on this

#

does this nav look good?

lofty crypt
#

yeah!

stuck falcon
hexed plank
#
const settings = definePluginSettings({
    includeGuilds: {
        description: "If disabled, server emojis will not be shown in the autocomplete menu at all.",
        type: OptionType.BOOLEAN,
        default: false
    },
    includeExternalGuilds: {
        description: "If disabled, emojis from external servers will not be shown in the autocomplete menu.",
        type: OptionType.BOOLEAN,
        default: false
    }
}, {
    includeExternalGuilds: {
        disabled(this: DefinedSettings): boolean {
            return !this.store.includeGuilds;
        }
    }
});
#

How do I get access to the "current setting" instead of the saved setting in the disabled function?

#

Note that the settings are not written into store until the user hit Save & Close button.

trail ginkgo
#

shouldnt that be a select

#
  • No server emojis
  • Current server emojis
  • All server emojis
#

i dont actually know what the plugin is for but it looks like a select like that would be more natural

hexed plank
#

Sounds good, I would like to switch to that.

#

But is there an answer to my original question?

#

Just curious because I may need this when developing future plugins.

trail ginkgo
#

i dont think theres a good way to do that for the options themselves

#

but if you need to access the temporary settings values for something like a preview

#

u can see how shiki does it

hexed plank
#

I see.

fair spear
lofty crypt
#

nice codes

wooden dragon
hexed plank
#

I need to patch to several places in a file, but they are considered the same module, so I have to let a single regex match 30,000 characters...

#

It becomes very slow due to the length of the matched string.

amber basin
#

change replacement: { ...patch } to replacement: [ { ...patch1}, { ...patch2}]