#🧩-plugin-development

1 messages · Page 16 of 1

amber condor
#

interesting

#

i'll take a look into it later

#

because i will also be adding a character counter

#

instead of displaying how many characters are left, it would display how many characters have been used

hushed smelt
#

hmm what is the name for when you click an image?

trail ginkgo
#

some tips: we have a built-in escape for matching minified variable names \i, they can change between builds and even have symbols/be more than one char, so it makes patches more reliable

#

same with the find

#

also small nitpick but the space after var will always be there so the ? isnt necessary ^^

hasty stag
#
{
    find: ".CHARACTER_COUNT_OVER_LIMIT",
    replacement: {
        match: /var \i,\i=\i\.type,\i=\i\.textValue,\i=\i\.maxCharacterCount,\i=\i\.className/,
        replace: "return null;$&"
    }
},

made it a bit better

trail ginkgo
#

still should prob replace the es with \is but yee

#

also, u dont need to put the whole match in a capture group, you can just use $& to output the whole match

cedar olive
#

also avoid unecessary spaces

#

best would be "return null;$&"

green vessel
#

human tersing

hasty stag
#

edited now

hasty stag
#

@amber condor do you intend on allowing large message edits too?

cedar olive
#

not doable

lavish sable
hasty stag
#

by that i mean the edit will be the first 2k chars in the message then send a message with the remaining

lavish sable
#

Yea that should work

cedar olive
#

you are gonna end up sending a message with others in the way

#

so like

#

first part of message

hasty stag
#

if edits will not be supported they need to have the blocking modal on them still

#

i tried it with his plugin and it will just ignore the edit

#

with no feedback

hasty stag
cedar olive
next stone
#

oh boy I sure am the only one in the Devs list with a full name

#

either way, lgtm

opal fern
#

Lmfao

amber condor
dull magnet
#

I was gonna do that but I realised that doesn't really help us in any way, it's much better to just have the types directly in our mod

#

makes it easier to maintain

snow jetty
#

Sounds reasonable

next stone
#

that's what I plan to do with my mod

dull magnet
#

we just have them in src/webpack/common/types

next stone
#

monorepo it and autopublish to npm

dull magnet
#

my favourite method

amber mantle
#

me when the static method returns a trans

pure temple
#

that should be in rust

chrome folio
#

q, does someone have a dash-to-space plugin or theme, too lazy to do myself

chrome folio
#

thanks

hushed smelt
#

hey is there any tutorial to do a basic plugin for someone who is starting?

dull magnet
#

not yet

#

look at other plugins for how to

hushed smelt
#

oh okey thanks

viral roost
#

yeah probably best to look at other plugins

hushed smelt
amber condor
#

i found a fix for the edit thing

#

of SplitLargeMessages

#

are function arguments e by default?

viral roost
#

there are some exceptions

amber condor
#

is it safe to assume so?

viral roost
#

its not safe to assume its e

#

well 99% of the time it is

#

but not always

hasty stag
#

if you need to use it in replacement and you know for certain where it will be you could add a word capture group and use $1 to get it maybe theres better ways though

amber condor
#

i need to read from it

hasty stag
#

you could try what i said

amber condor
#

i will

#

i recently saw someone post something about lookbacks

#

is it possible to search for the most recent function \w+\((\w+)\) after the original match ?

faint siren
#
// $1: argument name (currently "e")
// $2: the rest inbetween the argument name and my actual match
// $3: my actual match
match: /(?<=function \w+\()(\w)(.*)(\(0,\w\.jsx\))(?=(.(?!\3))+?canDM)/,
// paste my fancy custom button above the message field
replace: "$1$2$self.patchPopout($1),$3",
#

@amber condor

viral roost
#

also you can use \i instead of \w to match minified vars

faint siren
#

some custom feature for vencord?

viral roost
#

yes

faint siren
#

ah bruh

amber condor
#

.*\Kfunction\s\w+\((\w+)\)(?=.*;if\((\w+\.length>\w+)\)({\w+&&null)) i somehow came up with this but its very inneficient

faint siren
#

yea, didn't know there's \i till now

dull magnet
#

it will match the first function in the entire module then match up to the thing

faint siren
#

the whole module is this function

tame nexus
#

Does someone know how to create a store with react states? I know how to create a store and do it like this.

const store = new Promise<IDBObjectStore>(res => DataStore.createStore(PluginInfo.PLUGIN_NAME, STORE_NAME)("readwrite", res));

But what's the best way to manage the states with that? Sorry if I'm missing something obvious but I only have experience with https://github.com/pmndrs/zustand and know that Discord uses flux store. Or do I need to create a context and manage all my states manually?

amber condor
#

like lets say we have stringcookies1 cookies2 banana cookies3
and we first want to search for banana, then how do we get the most recently occured cookies\d before banana?

faint siren
#

well the thing i sent basically is the solution to your problem, but i'm too dumb to explain it

#

try matching cookie first, then use negative lookahead and then match banana

woven lion
#

i assume the former

woven lion
#

if so, then this is what you want cookies\d(?= banana) for that specific example

dull magnet
amber condor
tame nexus
# dull magnet what are u trying to do?

I'm trying to store my plugin settings. But I don't use definePluginSettings because I need to display them somewhere else and differently. And I never used definePluginSettings so I don't even know how it really works.

woven lion
#

looking for cookies with banana after it

amber condor
#

in reality it would be cookies1 {var t;} cookies2 {somethingsomething = ()} banana cookies3

amber condor
woven lion
#

then you can swap it out for whatever you want

#

im doing it based on your example lol

#

regex is an awfully annoying system

dull magnet
#

im in a game rn

amber mantle
#

balls gaming

shrewd yacht
#

remenber guys, pee is stored in the balls

amber condor
#

.*\K(cookies\d)(?=.*banana) this worksgreat but i assume it would be hella slow

dull magnet
#

first group will be 2

dull magnet
dull magnet
#

switch to ecmascript

#

youre on php

amber condor
#

bruh why is there a diff in regex between languages 😭

woven lion
#

because implementation detail

#

@hushed bloom uses regex but uses a rust implementation which doesnt have these lookaheads for example

tame nexus
snow jetty
#

you can access and set settings from your plugin i believe

#

but i don't know if you can have custom settings that don't show in the plugin settings, if that's what you're trying to do

dull magnet
#

you can just manually use settings

#

or use datastore

#

u dont need to make a store

#

just DataStore.get() and DataStore.set()

tame nexus
#

Hm I'm not sure if that's what I meant. But if I would set and get my settings like this and lets say I'm displaying them somewhere in a react component would they be rerendered if a setting changes?

dull magnet
#

no youd be responsible urself of keeping track

snow jetty
#

also ven when could i expect to know if the plugin i ported might get merged?

dull magnet
#

you can make a simple react hook to do it

#

i can help in a bit

amber condor
#

/;if\(\w+\.length>\w+\){\w+&&null(?<=function\s\w+\((\w+)\).+?;if\((\w+\.length>\w+)\)({\w+&&null))/

woven lion
#

dont use \w+ for identifiers btw

#

use \i

amber condor
#

im doing that right now

#

match: /;if\(\i\.length>\i\){\i&&null(?<=function\s\i\((\i)\).+?;if\((\i\.length>\i)\)({\i&&null))/, :)

snow jetty
#

omg this regex looks awful

#

i hate regex

amber condor
#

// match: /;if\((\i\.length>\i)\)({\i&&null)/, this was my original one

snow jetty
woven lion
#

faster than monkeypatches though

#

so

snow jetty
#

i remember trying to mod krunker.io by patching similar to how vencord does it

#

turns out it was possible a few months before i tried and it was how some hacks worked

#

but they improved their anticheat and i have no clue how they validate the game source

amber condor
#

now i just gotta patch this out

snow jetty
#

can't be that hard

#

surely

amber condor
#

yeah

#

wel maybe some proplem thos

tame nexus
dull magnet
#
function useDataStore<T>(key: string): [T | undefined, (newValue: T) => Promise<void>, boolean];
function useDataStore<T>(key: string, defaultValue: T): [T, (newValue: T) => Promise<void>, boolean];
function useDataStore(key: string, defaultValue?: unknown) {
    const [state, setState] = useState({
        value: defaultValue,
        loading: true
    });

    useEffect(() => {
        let alive = true;
        DataStore.get(key).then(v => alive && setState({
            value: v ?? defaultValue,
            loading: false
        }));

        return () => void (alive = false);
    }, [key, defaultValue]);

    return [
        state.value,
        async (newValue: unknown) => {
            await DataStore.set(key, newValue);
            setState({
                value: newValue,
                loading: false
            });
        },
        state.loading
    ];
}
soft onyx
#

i hate keywordAlterts

dull magnet
tame nexus
#

Wow that's great and exactly what I needed! Thank you that helped a lot 🙂

dull magnet
#

i havent tested it btw

tame nexus
#

Looks good to me I'm gonna test it now

eternal lion
amber condor
#

so it can show how many characters are inside the message

eternal lion
#

Oh I see

amber condor
#

now just gotta find a reliable regex to reference the variable holding the count

eternal lion
# amber condor

For the color you probs dont want that to be red, you can maybe use CSS with !important

amber condor
#

i actually wanted to keep it red tbh

#

it shows you when you if the message is gonna be split

woven lion
#

id recommend a different color like blue or something

#

red implies its not going to send

dull magnet
#

i think the red is from discord

woven lion
#

it is ye

#

cause that'd be the overcount

amber condor
#

hmmm

#

well i'll see what i can do

#

because it still has to be red when its and edit message

dull magnet
#
[style*="color:red"] {
  color: brown !important;
}
#

so easy

shrewd yacht
#

can I change the flex-flow of the child of a column flex-flow?

amber condor
#

i guess it works

amber condor
#

what do you guys think?

#

the green line is what i've changed during patching

#

originally it was just children:I

woven lion
#

e is reused but n and o still refer to the variables at the top

#

if you really want to check, you could throw the entire function body into vscode, reformat it, and rename the variables using F2

#

then you can see which variables map to what

#

@amber condor

amber condor
#

but theres a chance the characters will collide right?

#

because function(...) arent always function(e)

woven lion
amber condor
#

so in some case it might be function(n)

woven lion
#

that's why you use capture groups in your regex

#

then you can capture the identifier and use it later

amber condor
#

yeah i know

woven lion
#

rolecoloreverywhere makes extensive use of this

amber condor
#

thats what i currently use

#

but what if the two highlighted names are the same?

woven lion
#

they never will be

#

the build tool guarantees that

amber condor
#

you sure?

woven lion
#

yes

#

because if that second e was an n you've just broken the functionality of the app

#

they're two distinctly different values

#

so the build tool guarantees that it wont overwrite variable names if they have meaning

amber condor
#

not if the e is replaced everywhere with n (which might happen when discord "smallifies" their code right?)

woven lion
#

wha?

#

the minification step is done by the build tool

#

so its guaranteed that the variable names wont clash like that

#

the only reason why its reusing e here is beacuse e is not used anywhere else in that function

#

and you shouldnt need to either, its props are extracted already at the top to separate variables

amber condor
woven lion
#

well we have no idea

#

swc could do anything it wants

#

but most likely no

amber condor
woven lion
#

okay, odds are your patch will remain working

amber condor
woven lion
#

i severely doubt swc will decide to start using n or o

#

but even then

#

as long as your patch is written correctly

#

it should be resilient against it

amber condor
#
match: /;if\(\i\.length>\i\){\i&&null(?<=function\s\i\((\i)\).+?;if\((\i\.length>\i)\)({\i&&null))/,
replace: ";if(($2)&&($1.type.analyticsName!=\"normal\"))$3"
#

wait wrong one

#
match: /,{children:\w+}\)\)}}\)]}\)(?<=function\s\w+\((\w+)\){var \w+,(\w+)=\w+\.type,(\w+)=\w+.textValue[.\s\S]+?,{children:(\w+)}\)\)}}\)]}\))/,
replace: ",{children:$2.analyticsName===\"normal\"?$3.length:$4}))}})]})"
#

$1 should equal to e, but that's overwritten so thats why im not using it (even tho its still being captured

woven lion
#

you shouldnt use it regardless

#

because as i mentioned before they're already being extracted

#

you should use the extracted props directly when possible

dull magnet
#

that patch is strange

#

seems overly complex

woven lion
#

i dont quite understand it myself

#

i was thinking it was going to be something like this

proud parrotBOT
woven lion
#

actually thats a good point

woven lion
amber condor
#

it had to be specific because there are alot of ,{children:\i}, even with the almost random looking curly, normal and square brackets behind them

#

,{children:(\w+)}\)\)}}\)] this is the shortest i can make it for the to-be-replaced part, because otherwise it will match to multiple things

dull magnet
#

what are u trying to replace

#

show screenshot and say what u wanna add

amber condor
#

so basically

#

when you type close to 2000 characters it will show how many characters you got left, if you go above 2000 characters it will show a negative number

#

but i want to replace that with just the amount of characters in the textbox

#

which is pretty easy

#

the I on the green line is the amount of characters thats left to use

#

which is pretty easy to accomplish

#

but it should only do this when its a normal text box (not text box when editing a message)

#

so i came up with this:

cedar olive
#

I'm almost sure vencord streaming quality bypass actually causes crashes

#

still testing with it disabled

amber condor
hasty stag
#

@amber condor i got this showing

covert nimbus
#

4

hasty stag
#

its the message length

covert nimbus
#

4

hasty stag
#

4

#
{
    find: ".CHARACTER_COUNT_OVER_LIMIT",
    replacement: {
        match: /(function \i\((\i)\){)(var \i,\i=\i\.type,\i=\i\.textValue,\i=\i\.maxCharacterCount,\i=\i\.className)/,
        replace: "$1return ($self.renderText($2));$3"
    }
},
#

this is the patch i made

#
renderText: e => <TextComponent length={e.textValue?.length} />
``` then i did this
#
function TextComponent({ length }: { length: number; }) {
    return (
        <div className="msg-content-length-text">
            {length}
        </div>
    );
}
``` and this is to show the number
tame nexus
# dull magnet usage ```ts const [value, setValue, isLoading] = useDataStore<Settings>("YourPlu...

Do you know if there is a way to create a global store using the function you sent me? When I use the useDataStore function it only creates a store in the react component where I call it. That means I could have two stores which are independent of each other. I could easily solve this issue by simply creating the store in a react context, but there is no way for me to wrap the app component with a provider. I need to wrap the app component because I need to use the store in components I don't really have access to. I'm just wondering how other people have solved this problem because it's really unlikely I'm the only one using some sort of a store.

hasty stag
dull magnet
#

you could just use normal settings api

#

if ur data is small like this

#

and useSettings() from anywhere

shadow jacinth
#

#suggestions

#

no suggestions wqtf

#

anyways my suggestion add profiles for rich presence then ill uninstall bd

hasty stag
#

is there a way to access the guild icon component

green vessel
shadow jacinth
#

oke

#

ty

amber condor
amber condor
hasty stag
#

oh didnt see that

amber mantle
#

when the trolling

covert nimbus
#

that means it's no longer binding!!!!!!!!! /j

amber condor
#

i made a branch on my forked repo

#

i know how i can patch the character count better

#

but ive spent too much time on Vencord the last week

#

i really gotta start working on school stuff because exams in 2 weeks and have to do a assignment before next week, but i hadnt started yet 💀

covert nimbus
#

procrastination

tame nexus
# dull magnet and useSettings() from anywhere

Is there a way to replace an object in the Settings Proxy object? If I do

getPluginSettings().currentProfile = profile

It just doesn't replace anything. The profile object conains informations about the current profile like (width, height, ...). The only solution iv'e found is

Object.assign(getPluginSettings().currentProfile, profile);

but this isn't really a solution because I need to replace everything and not merge it.

dull magnet
#

idk what getPluginSettings is

tame nexus
#

Oh sorry forgot to add the function. Here it is

export function getPluginSettings(): PluginSettings {
    return Settings.plugins[PluginInfo.PLUGIN_NAME] as PluginSettings;
}

PLUGIN_NAME is the name of my plugin.

dull magnet
#

dont use it like this

dull magnet
#

it doesnt?

tame nexus
#

Wait I will check something

#

Okay no. If I change the code to

getPluginSettings().currentProfile = profile
console.log(getPluginSettings().currentProfile);

it still prints other the old profile. I also checked the profile that it sets and it's a different one so it's something else...

#

The weird thing is if I print out getPluginSettings() it has the changed profile but if I print out getPluginSettings().currentProfile I get the unchanged one. Maybe it has something to do with the Proxy? I don't really have knowledge about the Proxy object but maybe it has something to do with it.

#

Ah and I found out something else. If I set it the way I do it (getPluginSettings().currentProfile = profile) currentProfile becomes a normal javascript object and isn't a proxy object anymore.

amber condor
#

if i make a pr, will my branch still exist?

dull magnet
#

wha

#

not sure what u mean by that!

amber condor
#

like

#

atm i have Vencord forked

#

i made a branch called SplitLargeMessages

dull magnet
#

and

amber condor
#

if i make a pull request

#

and it gets accepted

#

does that mean my branche will get "deleted"

#

(i am github noob)

dull magnet
#

it won't but you should delete it afterwards

#

why do you ask?

#

if you want to push a second feature, make a second branch

amber condor
#

i was just curious because im github noob

#

its only 1 file, i would be able to just copy it back anyway

dull magnet
#

why would you need to add it back

#

if it's merged into main then you don't need the feature branch anymore

amber condor
#

true

#

but if i wanted to make a edit

#

i'd have to recreate the branch right

tame nexus
# dull magnet oh, this should work fine

Okay I found a solution and don't know if it's a bug so it would be really helpful if you could tell me. If I change this

// Wraps the passed settings object in a Proxy to nicely handle change listeners and default values
function makeProxy(settings: any, root = settings, path = ""): Settings {
    return proxyCache[path] ??= new Proxy(settings, {
     ...

to this

// Wraps the passed settings object in a Proxy to nicely handle change listeners and default values
function makeProxy(settings: any, root = settings, path = ""): Settings {
    return proxyCache[path] = new Proxy(settings, {
     ...

it works because I changed the ´??=´ operator to =. Does that mean it's a solution to my problem or is it some sort of bypass of a mistake I made?

dull magnet
#

ah I see

#

hmm that shouldn't happen though

#

ah no I get it

dull magnet
#

and it should work

tame nexus
#

What is a set trap? Do you mean the set function? Something like this?

 set(target, p: string, v) {
            // avoid unnecessary updates to React Components and other listeners
            if (target[p] === v) return true;

            target[p] = v;
            delete proxyCache[path];

            // Call any listeners that are listening to a setting of this path
            const setPath = `${path}${path && "."}${p}`;
            for (const subscription of subscriptions) {
                if (!subscription._path || subscription._path === setPath) {
                    subscription(v, setPath);
                }
            }
            // And don't forget to persist the settings!
            VencordNative.ipc.invoke(IpcEvents.SET_SETTINGS, JSON.stringify(root, null, 4));
            return true;
}
dull magnet
#

yes

tame nexus
#

Okay I tried that it didn't work for some reason

dull magnet
#

ah

#

move it one line down

#

and change path to setPath

tame nexus
#

Ah yes now it works

dull magnet
#

the reason that cache exists is because otherwise it would create and discard hundreds of instances

#

which is just not necessary

#

every time you access a setting it would

settings.     // create proxy
plugins.      // create proxy and discard the first
YourPlugin.   // create proxy and discard the previous one
SomeSetting   // discard proxy
tame nexus
#

Oh that makes sense

dull magnet
#

wait

#

does android not use a momospace font

#

for codeblocks

#

I can't manage to align the //

tame nexus
#

I don't know hahaha

dull magnet
#

ah now

#

I got it pomucool

tame nexus
#

But is this whole thing some sort of oversight or something like that or only a fix for my plugin?

dull magnet
#

oversight

tame nexus
#

should I do a pr?

dull magnet
#

the reason this happens is because every time you get a value, it proxies it if it's an object and caches that proxy (for above mentioned reasons), then reuses that proxy for future use

#

if you overwrite the object later, it still has the cached proxy that still proxies the old object

#

So the settings actually do update correctly but the proxy returns the old value

#

simply deleting the cached proxy fixes it like u saw

dull magnet
tame nexus
#

Okay gonna do 🙂

dull magnet
#

git commit messages should be present tense :P

tame nexus
#

Oh sorry I don't have that much experience with github and even their naming conventions. And my english isn't the best as well hahaha.

dull magnet
#

that's fine

dull magnet
tame nexus
#

That's good to know! Learned something new again thank you 🙂

snow jetty
#

@dull magnet sorry for the ping, i just wanted to check with you if the edits i'm making correspond to the edits you requested, here's a diff https://img.remty.xyz/Rx7L65aW.png

dull magnet
#

ye

#

does it work?

snow jetty
#

yup

dull magnet
#

also u should probably add { noop: true } as 2nd param to the ErrorBoundary

snow jetty
#

compiles and runs just like before

#

dam

dull magnet
#

ever seen one of the red error blocks?

#

when opening settings

snow jetty
#

i think i have

#

yes

dull magnet
#

that's the default fallback of our ErrorBoundary

snow jetty
#

i see

dull magnet
#

passing { noop: true } makes it render nothing instead of the error box

#

it would be quite ugly to have a red error box randomly in settings so noop is probably better :P

snow jetty
#

right, makes more sense here

dull magnet
#

anyway every time you see one of those it means the ErrorBoundary just saved u from a crash

#

thats why u should always use them if possible

snow jetty
#

also what's the policy on trailing commas, cuz i saw i accidentally left some you removed

dull magnet
#

doesnt really matter, should just be consistent

snow jetty
#

okay thanks

#

also sorry for doing a PR from the main branch i forgot when making my commit

#

@dull magnet fuck i broke it

#

don't merge kek

#

wrapping in the errorboundary broke it somehow

dull magnet
#

huh?

snow jetty
#

yeah i need your help here

dull magnet
#

how is it broken?

hasty stag
snow jetty
#

wait

#

hmm

amber condor
#

but it'd be pretty performance heavy i assume

hasty stag
#

i dont really think

amber condor
#

having to calculate how many chunks there are for every keystroke

hasty stag
#

its just math.floor(messagelength / maxcharcount)

amber condor
#

not if you have SplitPlace.NewLine

hasty stag
#

lol i forgot about that

amber condor
#

idk if you read my code

snow jetty
#

i think i'm just stupid don't worry ven

hasty stag
#

i did but i only use the single char one

dull magnet
amber condor
snow jetty
#

okay i'm just stupid

amber condor
dull magnet
proud parrotBOT
# dull magnet https://github.com/Vendicated/Vencord/blob/main/src/utils/debounce.ts#L19-L32

**debounce.ts: **Lines 19-32

/**
 * Returns a new function that will call the wrapped function
 * after the specified delay. If the function is called again
 * within the delay, the timer will be reset.
 * @param func The function to wrap
 * @param delay The delay in milliseconds
 */
export function debounce<T extends Function>(func: T, delay = 300): T {
    let timeout: NodeJS.Timeout;
    return function (...args: any[]) {
        clearTimeout(timeout);
        timeout = setTimeout(() => { func(...args); }, delay);
    } as any;
}
snow jetty
#

i wasn't calling my function with my colors object

dull magnet
#

essentially, every time you call it it will clear previous schedules and schedule the callback in delay milliseconds

snow jetty
#

the only place where typing doesn't happen and i didn't think to check guuuh

dull magnet
#

so if you type 10 characters it will keep cancelling the previous timers

#

then once you stop typing for 300ms, it will run the callback

#

:P

snow jetty
#

okay fix pushed ven

hasty stag
#

actually no wouldnt work because the function only runs on send

amber condor
hasty stag
#

make a global chunks variable to only use the function as little as i can

amber condor
#

that wouldnt really work no

dull magnet
#

trying to do some tauri shenanigans

covert nimbus
dull magnet
hasty stag
#

debouncing wouldnt work since it returns a promise and i need to return a jsx element

dull magnet
#

what

#

just use an effect

next stone
amber condor
#

something ive wanted for a long time

#

@hasty stag do you have your code opensource?

hasty stag
#

i added this to patches


        {
            find: ".CHARACTER_COUNT_OVER_LIMIT",
            replacement: {
                match: /(function \i\((\i)\){)(var \i,\i=\i\.type,\i=\i\.textValue,\i=\i\.maxCharacterCount,\i=\i\.className)/,
                replace: "$1return ($self.renderText($2));$3"
            }
        },
#
    renderText: e => <TextComponent data={e.textValue} />
``` and this
#
export function TextComponent({ data }: { data: string; }) {
    if (data.length <= 0) return null;
    const [chunks, setChunks] = useState<string[]>([]);

    useEffect(() => {
        debounce(() => {
            setChunks(intoChunks(data, getMaxMessageLength(UserStore.getCurrentUser().premiumType ?? PremiumType.None), splitterSettings.store.splitPlace));
        }, 300);

        return () => { };
    }, [data]);

    return (
        <div className="msg-content-length-text">
            {`${data.length}: ${chunks.length} ${chunks.length > 1 ? "Chunks" : "Chunk"}`}
        </div>
    );
}
``` this doesnt work for showing chunks yet i still need to figure out the useeffect
cedar olive
#

like does it work normally or misses functionality electron has

trail ginkgo
#

its probably not much different, just that you'd be writing ur 'preload' logic in rust

#

i wonder how good of an idea that'd be

dull magnet
#

it seems terrible

steel oriole
#

i wonder how do i replicate BANger using js

#

?

unreal mason
#

the active now page seems to hide when the window width is under 1201 pixels, which is annoying since my discord monitor has a width of 1050pixels. does someone know how to lower this number with vencord?

snow jetty
#

If you're comfortable with installing userplugins I'm willing to have a look

unreal mason
#

although ive never done it in vencord, i only switched recently

snow jetty
#

it requires compiling vencord yourself

#

updates are still automatic tho

unreal mason
#

oh. that makes it slightly more complicated, although id give it a try

#

is there a way to keep my current configuration after selfcompiling?

snow jetty
#

yeah it's not too hard

trail ginkgo
#

yea ur config isnt stored in the same place

snow jetty
trail ginkgo
#

ur config isn't stored next to ur installation no

snow jetty
#

it's always in roaming right

trail ginkgo
#

yea

snow jetty
#

but you can have the repo cloned elsewhere?

trail ginkgo
#

although i think the installer might put the installation next to ur config by default

trail ginkgo
snow jetty
#

also am i right about updates still working the same

#

i never actually checked i believe

trail ginkgo
#

idk i dont update

snow jetty
#

lol

trail ginkgo
#

i think the updater still works

#

just uses a different method

chrome elbow
chrome elbow
#

put that to custom css

snow jetty
#

welp i didn't think to check css

unreal mason
#

ahh

#

that was fast

#

thank you

#

thats perfect

#

and without any compiling xd

snow jetty
#

yeah lol

chrome elbow
unreal mason
#

why does dc do the random letters tho?

trail ginkgo
#

so they dont overlap

unreal mason
#

alright

dull magnet
steel oriole
#

is there a way to replicate banger plugin with js?

dull magnet
#

what

dull magnet
#

we have two updater backends, one that shells out to git and node and one that uses the github api

snow jetty
#

sounds like it might've been a pain to make

dull magnet
#

nah fairly simple

#

the git one we already had initially, it was the only way to install when vencord was new

#

then I just wrote an equivalent http updater

proud parrotBOT
# dull magnet https://github.com/Vendicated/Vencord/blob/main/src/ipcMain/updater/index.ts

**index.ts: **

/*
 * Vencord, a modification for Discord's desktop app
 * Copyright (c) 2022 Vendicated and contributors
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

import(IS_STANDALONE ? "./http" : "./git");

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

-10 lines left

snow jetty
trail ginkgo
#

or 10

shrewd yacht
#

how can I make discord use the browser font?

dull magnet
#

css

shrewd yacht
#

what css?

dull magnet
#

just skip the Google fonts part

shrewd yacht
#

my problem is that I don't know what font to set it to so it's the browser font

#

If I say it I'll get banned ||it's fira code||

#

idk if it's serif or not

trail ginkgo
#

--font-primary: sans-serif; or --font-primary: monospace; will probably work

#

i think those are the browser provided font names

shrewd yacht
#

Yeah it worked thx

#

=> ligatures yay!

#

|----|-||----|>---|

shrewd yacht
#

How can I use css to modify "Avoid pronouns, use my name" to "Name" (The first takes too much place)

dull magnet
#

no

shrewd yacht
#

😦

#

no it doesn't take too much space or no it's not possible?

dull magnet
#

not possible with css

#

unless the plugin is edited to add some attribute

#

like data-pronouns

shrewd yacht
#

can I PR this?

#

ig I can hide it until hovering the message

#

with css

shrewd yacht
shrewd yacht
#

there is also .vc-pronoundb-compact for the plugin

dull magnet
#

why would you post a css snippet that doesn't work with Vencord

shrewd yacht
#

That's a way to see it
I see it as working with the web ext
If you want I can delete it

dull magnet
#

yes

shrewd yacht
#

ok

dull magnet
#

make it compatible with Vencord

#

otherwise posting it here is kinda pointless

#

🔫

shrewd yacht
dull magnet
#

yes

#

you could add the data attributes and show on hover

shrewd yacht
#

I think I'll need some help but I'm all for it

#

shall we use the same class as the extension?

#

(.pronoundb-pronouns)

dull magnet
#

no

shrewd yacht
#

I'll use the one you proposed then

dull magnet
#

if you use the same class as the extension then you must also guarantee our component is similar to theirs

#

aka in the same location, same styles, same htlm element

#

otherwise it's worthless

#

no compatibility is better than broken compatibility imo

shrewd yacht
#

do you want it?

#

so @dull magnet ?

shrewd yacht
#

well I gotta go eat I'll do it after (usually takes 1h because of my sister)

amber condor
#

has anyone figured out how to create new windows?

trail ginkgo
amber condor
trail ginkgo
#

that would have to be on the electron side

#

what are u thinking of using it for

amber condor
#

idk yet

#

i just wanted to get it working for fun

dull magnet
amber condor
#

oh yeah ofcourse

dull magnet
#

I wonder if we could fix quick css on Firefox by making it a popup of the extension instead

#

I think that's a thing

torpid agate
#

question difference between scripting and coding which one is better

vague echo
#

scripting is automating something
coding is well, the practice of writing code

torpid agate
#

ik the difference

#

but i meant which one will have more uses

#

i’ve heard a lot bout js so i was gonna start learning it then i realized i would only know scripting so i was seeing if i should learn one before the other

opal fern
#

coding lmfao

torpid agate
vague echo
#

js and python are fine choices

opal fern
#

depends on usecase

torpid agate
#

idk that yet

#

just need one to learn

#

i’ve heard good things about rust

vague echo
#

(do not)

torpid agate
#

why not

vague echo
#

you're gonna have a hard time

torpid agate
#

gonna do it then

amber condor
#

start with python

#

its easiest and doesnt have weird quirks like javascript

dull magnet
#

I think a lot of people call writing js scripting

#

dum

#

python is garbage

#

js is probably the best starting language

amber condor
#

ok but try explaining === vs == to a complete beginner

#

they'll just get confused and use both at random

dull magnet
#

nothing to explain, just use ===

amber condor
#

lets not get started on javascript types

dull magnet
dull magnet
amber condor
#

javascript is just weird

#

if you want to start with javascript you should rather start with typescript

dull magnet
#

no lol

#

@cedar olive epic idea

#

then check for that name query parameter and use it as the emoji name instead of FakeNitroEmoji

amber condor
#

because sometimes they cause errors and sometimes they dont

#

honestly i would only reccomend python or c(++)

trail ginkgo
#

that happens in like every language

#

you just learn the language over time

dull magnet
#

js is bad because making mistakes can cause massive confusion
I recommend C

amber condor
#

a mistake can happen as quickly as taking a inputing and doing math

if user input = "4" and the code did input + 2 you'd get "42"

snow jetty
#

I tried C
I gave up

dull magnet
#

how are u gonna recommend C where forgetting to end a string with \0 or accidently indexing an invalid array index can cause undefined behaviour and memory corruption that's impossible to debug for a newbie

amber condor
#

that kind of automatic type conversion is just bs

dull magnet
#

and at the same time say js is bad because you can make mistakes

snow jetty
#

What about rust then lol

amber condor
#

doing rust good is too hard

#

but tbf they can .copy() everything

#

albeit inneficient

snow jetty
#

I never tried rust

woven lion
#

you shouldnt .clone()* everything

#

that's what taking references is for

amber condor
amber condor
woven lion
#

the beginner programming book gives an example of why you shouldnt use .clone() on everything

#

same with rbe

amber condor
#

C wasnt a good example for safety i gotta admit

amber condor
#

anyway

"2" * 2 -> 4
"2" + 2 -> "22"
grim hare
#

teaching poor practice first thing is never a good idea

amber condor
#

enforcing perferct code from the start is not a good idea either

grim hare
#

there's a difference between enforcing perfect code and teaching something that you shouldn't be doing

dull magnet
#

your argument is really stupid sorry

amber condor
#

so is yours

#

i never get how people like javascript

#

it sucks ass

dull magnet
#

ok

#

that's your own preference

amber condor
#

too hard

dull magnet
#

you're trying to convince beginners of your own opinion instead of trying to be objective

#

Javascript is bad in my opinion so you shouldn't use it

amber condor
#

javascript is bad because of things x, y, z, etc...

#

you said javascript is good for beginners because it has alot of capabilities, but so does python...?

amber condor
#

so in your case it would be "Javascript is good in my opinion so you should use it"

dull magnet
#

no

#

Javascript is objectively one of the best languages if not the best language to pick up as a beginner for a multitude of reasons

high popularity, best odds of getting a job
many great resources online
versatility
absolutely necessary to make web stuff anyway
ease of use
high readability
clike which makes it similar to many other languages (java, C#, etc) and gives you a great base to learn those later
easy step up to typescript later on

#

and that's just the beginning, there's way more good arguments

#

the only real argument for learning python first is that it's easy. But it doesn't offer you a good base for other languages, it has crappy performance, cannot be used for as many things, it's mostly good for scripts

grim hare
#

I always wonder how many people that bash on JS have actually used it seriously before, and if they have used it seriously I wonder how bad of code they must have written to consistently run into the "js bad" issues they always complain about

snow jetty
dull magnet
#

there are many actually good arguments against js, but you can find good arguments against any language

woven lion
#

its like me saying

#

dont use assembly

#

it doesnt have operators

#

and control flow is obfuscated

dull magnet
#

Also I think criticising "2" * 2 = 4 is also really funny coming from a python user, you're trying to unironically tell me "2" * 2 = "22" is any less confusing?

woven lion
#
print(len([0x0for x in {1,2,1}]))
#

valid python

amber condor
# dull magnet Javascript is objectively one of the best languages if not the best language to ...

python is also populair. Depending on the field JS has biggest odds, but so do C# and python in other fields. This shouldnt be reason to learn a specific langauge.
alot of languages have great resources.
python also has huge versatility
not true, you can make a website with python-only (not sure if i'd reccomend that, but if you want to you can)
ease of use? python is the easiest to use
most well-made code is highly readable
going from python to java, the only thing that confused me was using this without this being a function parameter, but that didnt take me long either
your 2nd langauge is always easy, the only thing that's usually the challenge is setting up environments etc, because youre not used to them. learning new syntax is easy, the important thing about your first language is learning programming concepts

amber condor
amber condor
amber condor
grim hare
#

do you know the difference between the two

amber condor
# dull magnet Also I think criticising `"2" * 2 = 4` is also really funny coming from a python...

yes i agree that something like .repeat(n) wouldve been better. But python errors while trying "2" + 2, in javascript it doesnt. my argument is that javascript has a very odd type conversion. Also, that python example doesnt actually do type conversion there. Every type in python has methods that describe how operators function on them, in this case it would be str.__mul__(self, other: int): return "".join(self for _ in range(other), ofcourse written differently because its written in C rather than in python

amber condor
#

iirc

amber condor
woven lion
#

im using your own complaint against you poi_shrug

#

that was not clear to me the first time i saw that example

#

and i have been doing python for years

amber condor
#

there are alot of things that arent clear when you first come across them

trail ginkgo
#

yes in every language

amber condor
#

but in this case you wouldnt come across it very fast luckily

#

you dont just accidently write a hexadecimal while also accidently writing a list comprehension

trail ginkgo
#

assuming we're talking about python __<__3.11

#

how is "2" * 2 = "22" not confusing for a beginner

amber condor
#

how is "2" * 2 = 4 but "2" + 2 = "22" less confusing than "2" * 2 = "22" for a beginner?

woven lion
#

multiplying strings never makes sense

trail ginkgo
#

the first makes sense because people know what multiplication is

woven lion
#

there's a reason why we have things like string.repeat()

trail ginkgo
#

the latter 2 are initially confusing because you have to learn casting / that * specifically means repeat

grim hare
#

list comprehensions are also a pain to read for beginners, and sufficiently complex ones are a pain regardless of skill level

amber condor
#

"2" * 2, i want string "2" two times?

"2" * 2 = 4, alright so math just works on string i see
"2" + 2 = "22", huh math doesnt work?

amber condor
trail ginkgo
#

a beginner isnt going to be thinking about types as rigidly as you are

amber condor
#

but python's "2" * 2 is a one-off, javascript does automatic type conversion everywhere which is way worse

trail ginkgo
#

thats kinda the whole thing they have to learn

amber condor
woven lion
#

* 2 works because in js it implicitly casts the string to a number since thats the only logical solution, but + 2 onto a string is a completely different meaning and that, in fact, works in almost* every language as standard

amber condor
woven lion
#

/run

"2" + 2
amber condor
worldly oxideBOT
#

@woven lion I only received cs(6.12.0) error output

Cannot open assembly 'out': No such file or directory.
trail ginkgo
woven lion
#

oops

#

/run

System.Console.WriteLine("2" + 2);
worldly oxideBOT
#

Here is your cs(6.12.0) output @woven lion

22
woven lion
#

yes

#

i do

amber condor
#

in what languages lol

woven lion
#

that's c#

#

lets see..

amber condor
trail ginkgo
#

you dont have to as a beginner

woven lion
#

/run

pub fn main() {
    println!("2" + 2);
}
worldly oxideBOT
#

@woven lion I received rust(1.65.0) compile errors

error: expected `​,`​, found `​+`​
 --> file0.code:2:18
  |
2 |     println!("2" + 2);
  |                  ^ expected `​,`​

error: aborting due to previous error

chmod: cannot access 'binary': No such file or directory
/piston/packages/rust/1.65.0/run: line 4: ./binary: No such file or directory
woven lion
#

ah right yes that doesnt work in rust

#

rust is too strict for that

trail ginkgo
#

people are a lot more neuroplastic in general than ur implying

amber condor
#

/run

pub fn main() {
  println!("{}", "2"+2);
}```
worldly oxideBOT
#

@amber condor I received rs(1.65.0) compile errors

error[E0369]: cannot add `​{integer}`​ to `​&str`​
 --> file0.code:2:21
  |
2 |   println!("{}", "2"+2);
  |                  ---^- {integer}
  |                  |
  |                  &str

error: aborting due to previous error

For more information about this error, try `​rustc --explain E0369`​.
chmod: cannot access 'binary': No such file or directory
/piston/packages/rust/1.65.0/run: line 4: ./binary: No such file or directory
trail ginkgo
#

the point where a developer is annoyed because they feel like they have to keep track of types

#

is the point where you switch to TS

#

which is not a beginner stance

woven lion
#

/run

public class A {
    public static void main(String[] args) {
        System.out.writeln("2" + 2);
    }
}
#

wait

#

is it println in java

trail ginkgo
#

well u can see it there anyways

#

oh

woven lion
#

/run

public class A {
    public static void main(String[] args) {
        System.out.println("2" + 2);
    }
}
worldly oxideBOT
#

Here is your java(15.0.2) output @woven lion

22
woven lion
#

yes

#

okay

#

/run

fun main() {
    println("2" + 2)
}
worldly oxideBOT
#

Here is your kt(1.4.31) output @woven lion

22
woven lion
#

anyway i could get a massive list of these and just keep going

#

point is yes

#

"2"+2 does work in loads of major languages

#

exactly how js does it

amber condor
#

yea but java and c# arent beginner languages lol

dull magnet
#

??????

#

yes they are lol

woven lion
#

that's a different argument

amber condor
#

they require the user to know what types are from the get go

woven lion
#

and java and c# are taught at a very young age here nowadays

amber condor
#

ffs im just gonna quit it

dull magnet
#

many universities use Java as introduction language

woven lion
#

and

dull magnet
woven lion
#

the argument was

dull magnet
#

mine does lol

woven lion
#

to which i presented a couple of major languages that do it like this

dull magnet
#

anyway adding stuff to strings getting auto casted is nice and useful

#

I use it a lot in many languages

woven lion
#

with the subtext that most major languages do it like this

#

because it just.. makes sense

dull magnet
woven lion
amber condor
#

it doesnt matter anyway, no offense, but every web dev server always fanboys javascript. Most other prgramming servers would disagree.

yes i love TS but damn JS sucks for beginners

dull magnet
#

"https://google.com/search?" + new URLSearchParams({ q: "banana milkshake" })

woven lion
#

i dont like javascript

#

i like typescript because its not completely insane

#

like yes there's still the funnies

amber condor
woven lion
#

but typescript yells at you

dull magnet
#

it doesn't matter much honestly lol

woven lion
dull magnet
woven lion
#

even rust has implicit types

#

in some cases

dull magnet
#
Integer x = 1;
``` vs ```java
Integer x = Integer.valueOf(1);```
amber condor
#

yeah between String and &str

woven lion
#

rust doesnt have implicit casts for primitives

dull magnet
#

rust has a ton of implicit casts with into()

woven lion
#

you have to call into() for that

amber condor
woven lion
#

String != &str

amber condor
#

into() is okay

amber condor
trail ginkgo
#

its that rust does implicit derefs to match a signature

#

sometimes implicit referencing

amber condor
#

its kinda funny because i acctually dont like Java either 💀

dull magnet
#
x = 42
y = 0.2

print(x + y)
#

even python has implicit type conversion

grim hare
dull magnet
#

knowledge of types is also not even such a hard concept to understand

grim hare
#

indeed

trail ginkgo
#

most knowledge is fuzzy as a beginner

dull magnet
#

if anything, it makes it less confusing to the person because you can't accidently pass wrong data to functions

trail ginkgo
#

so even if a beginner is basing their understanding of types from like typeof

#

then thats still fine

grim hare
#

anyways
how about that [object Object] amirite

trail ginkgo
#

i prefer `${new class {}}`

#

wait i forgot what makes it just [object ]

#

`${{ [Symbol.toStringTag]: "" }}` trolley

amber condor
amber condor
dull magnet
#

wait til you find out strings are also just numbers

amber condor
#

oh yes

#

imagine if "a"*2 resulted in 194 💀

trail ginkgo
#

true "2" + 2 simply multiplies "2" by 256 first

amber condor
#

someone should write a language where thats the csse tbh

grim hare
#

(it's called c)

#

(i did it in #🤖-bot-commands but here it is here for channel linear history)

#

/run ```c
#include <stdio.h>
int main () {
printf("%i", 'a' * 2);
}

worldly oxideBOT
#

Here is your c(10.2.0) output @grim hare

194```
shrewd yacht
#

is there a way to make compact mode work a bit like cozy mode where when someone post two messages in a short amount of time instead of saying the username twice it "merges" them?

dull magnet
#

and doing math on chars is really useful

grim hare
#

true

#

if I used a char array I'd segfault probably though

#

you love pointers

dull magnet
amber condor
dull magnet
#

it is peaceful and calm

amber condor
#

i was jus jokin

trail ginkgo
dull magnet
#

'a' * 'a'

#

🔥

amber condor
trail ginkgo
dull magnet
#

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

int main() {
printf("%c", sqrt('a'));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @dull magnet

h```
dull magnet
#

h

trail ginkgo
#

LOL

#

why is h the sqrt of a

#

that doesnt make SENSE

#

i would imagine sqrt('a') < 'a'

viral roost
#

why is the square root bigger than the original

#

exactly

dull magnet
#

Pierre: Js is confusing, use C instead
C: h

#

no idea why it's h LOL

trail ginkgo
dull magnet
#

I didn't know it would be h

#

I just did it for the funny to see what it would be

viral roost
#

c is fine* until you remember pointers exist

trail ginkgo
#

0[0]

#

(does not fail)

dull magnet
#

probably cause the sqrt of 'a' isn't a whole number

dull magnet
trail ginkgo
#

i think it would fail

dull magnet
#

it will just either segfault or work fine on weird systems

trail ginkgo
#

i was trolling about syntax that u have to learn to make sense

grim hare
#

/run ```c
#include <stdio.h>
int main () {
printf("%lu", (unsigned long) "h" * 2);
}

worldly oxideBOT
#

Here is your c(10.2.0) output @grim hare

8405000```
grim hare
#

I love

#

c is so wacky it's great

dull magnet
#

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

int main() {
printf("%c", sqrt('a'));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @dull magnet

(```
dull magnet
#

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

int main() {
printf("%c", sqrt('a'));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @dull magnet

�```
dull magnet
#

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

int main() {
printf("%c", sqrt('a'));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @dull magnet

�```
dull magnet
#

?????

#

random number generator

#

but how

trail ginkgo
#

.LMFAO

#

i think htis is buffer overflow

dull magnet
#

how would it be

trail ginkgo
#

i dont know but it looks like it

dull magnet
#

oh because it returns a double

#

maybe

amber condor
dull magnet
#

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

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

worldly oxideBOT
#

Here is your c(10.2.0) output @dull magnet

	```
dull magnet
#

hmm

#

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

int main() {
printf("%c", (char) (sqrt('a') + 50));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @dull magnet

;```
dull magnet
#

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

int main() {
printf("%c", (char) (sqrt('a') + 50));
}```

worldly oxideBOT
#

Here is your c(10.2.0) output @dull magnet

;```
dull magnet
#

yeah okay it was cause it returns a double

#

but that's so strange lmao

trail ginkgo
#

i need to know why

grim hare
#

/run ```c
#include <stdio.h>
int main () {
char * hi = "hewwo owo";
printf("%s\n", hi + 6);

int numbers[5] = { 0, 1, 2, 3, 4 };
printf("%i", 4[numbers]);
}

worldly oxideBOT
#

Here is your c(10.2.0) output @grim hare

owo
4```
grim hare
#

pointers are amazing

amber condor
trail ginkgo
#

"its joke"

#

@dull magnet

#

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

int main() {
printf("%i", sqrt('a'));
}

worldly oxideBOT
#

Here is your c(10.2.0) output @trail ginkgo

-1103781416```
trail ginkgo
#

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

int main() {
printf("%i", sqrt('a'));
}

worldly oxideBOT
#

Here is your c(10.2.0) output @trail ginkgo

-821694712```
trail ginkgo
#

literally random number generator

dull magnet
#

ye

trail ginkgo
#

WHY

amber condor
dull magnet
#

it might be because the function takes a double but we pass a char, so it just uses our char + 7 random bytes or smth

#

but that'd be weird too

#

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

int main() {
printf("%f", sqrt('a'));
}

worldly oxideBOT
#

Here is your c(10.2.0) output @dull magnet

9.848858```
dull magnet
#

no it works correctly

grim hare
#

if sqrt takes a double that's definitely what's happening

steel oriole
#

/run

#include <math.h>
#include <stdio.h>

int main() {
    printf("%i", sqrt('a'));
}
worldly oxideBOT
dull magnet
#

just giving printf the wrong format specifier

grim hare
#

o that makes sense too

trail ginkgo
#

yea i just wonder what its doing

steel oriole
#

/run

#include <math.h>
#include <stdio.h>

int main() {
    printf("%i", sqrt('a'));
}
worldly oxideBOT
#

Here is your cpp(10.2.0) output @steel oriole

324471560```
amber condor
#

maybe the next bytes in memory?

dull magnet
#

Well you're telling it to print an int and passing a double

#

which doesn't make a lot of sense

trail ginkgo
#

i can only imagine it truncates tho

#

a double is more bits

steel oriole
dull magnet
#

yes so it just ignores presumably the last 4 bytes

oblique lark
#

shouldn't it error if you give it the wrong format specifier

dull magnet
#

then we ban that person

dull magnet
trail ginkgo
dull magnet
#

we don't know errors in C

trail ginkgo
#

i think it does in a later verison or something

dull magnet
#

wrong format specifier is usually a compiler earning

#

but not error

trail ginkgo
#

true

dull magnet
#

how do you pass compiler flags again

#

/run

worldly oxideBOT
#

Update: Discord changed their client to prevent sending messages
that are preceeded by a slash (/)
To run code you can use "./run" or " /run" until further notice

Here are my supported languages:
awk, bash, basic, basic.net, befunge93, bqn, brachylog, brainfuck, c, c++, cjam, clojure, cobol, coffeescript, cow, crystal, csharp, csharp.net, d, dart, dash, dragon, elixir, emacs, emojicode, erlang, file, forte, forth, fortran, freebasic, fsharp.net, fsi, go, golfscript, groovy, haskell, husk, iverilog, japt, java, javascript, jelly, julia, kotlin, lisp, llvm_ir, lolcode, lua, matl, nasm, nasm64, nim, ocaml, octave, osabie, paradoc, pascal, perl, php, ponylang, powershell, prolog, pure, pyth, python, python2, racket, raku, retina, rockstar, rscript, ruby, rust, scala, smalltalk, sqlite3, swift, typescript, vlang, vyxal, yeethon, zig

You can run code like this:
./run <language>
command line parameters (optional) - 1 per line
```
your code
```
standard input (optional)

Provided by the Engineer Man Discord Server - visit:
https://emkc.org/run to get it in your own server
https://discord.gg/engineerman for more info

steel oriole
#

is there a way to replicate BANger using js

trail ginkgo
#

im reading linux docs

dull magnet
#

/run c
-Wall
-Werror

#include <math.h>
#include <stdio.h>

int main() {
    printf("%f", sqrt('a'));
}
worldly oxideBOT
#

Here is your c(10.2.0) output @dull magnet

9.848858```
dull magnet
#

/run c
-Wall
-Werror

#include <math.h>
#include <stdio.h>

int main() {
    printf("%i", sqrt('a'));
}
worldly oxideBOT
#

Here is your c(10.2.0) output @dull magnet

1927604840```
dull magnet
#

huh

#

no error

#

Well anyway any sane ide and compiler will warn you

steel oriole
#

is there a way to replicate the effects of BANger using js

opal fern
#

what the fuck does pnpm want from me

dull magnet
#

remove the import

dull magnet
grim hare
steel oriole
dull magnet
#

/run ```bash
cat > main.c << 'banana'
#include <math.h>
#include <stdio.h>

int main() {
printf("%d", sqrt('a'));
}
banana

gcc -Wall -Werror main.c

worldly oxideBOT
#

@dull magnet I only received bash(5.1.0) error output

main.c: In function 'main':
main.c:5:14: error: format '%d' expects argument of type 'int', but argument 2 has type 'double' [-Werror=format=]
     printf("%d", sqrt('a'));
             ~^   ~~~~~~~~~
             %f
cc1: all warnings being treated as errors
dull magnet
#

there we go

dull magnet
#

replicate the effects how

steel oriole
#

i cant find the code

dull magnet
proud parrotBOT
# dull magnet https://github.com/Vendicated/Vencord/blob/main/src/plugins/banger.ts

**banger.ts: **

/*
 * Vencord, a modification for Discord's desktop app
 * Copyright (c) 2022 Vendicated and contributors
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";

export default definePlugin({
    name: "BANger",
    description: "Replaces the GIF in the ban dialogue with a custom one.",
    authors: [Devs.Xinto, Devs.Glitch],
    patches: [
        {
            find: "BAN_CONFIRM_TITLE.",
            replacement: {
                match: /src:\w\(\d+\)/g,
... (14 lines left)
dull magnet
#

now what's typescript

opal fern
#

glorified javascript

dull magnet
#

a superset of Javascript

opal fern
#

same thing

dull magnet
#

Also nothing in that file uses typescript features so u can literally just rename it to .js and it'll work

steel oriole
#

i just got 13 errors screaming

dull magnet
#

what are you even doing

#

why do you need it in js

steel oriole
#

i plan to use it without client mods

#

jk

#

port it to bd

#

because yes

opal fern
#

Bro

#

Vote ban

steel oriole
#

does vencord have custom plugins support? no

opal fern
#

we dont provide support for betterdiscord

trail ginkgo
#

vote ban

opal fern
#

vote ban

dull magnet
#

what if we make a vencord desktop app

#

with electron shiddohwell

opal fern
#

i mean

#

no

#

not electron

#

something like gluon

dull magnet
#

no

opal fern
#

why not

#

you want to torture vencord users?

#

is that it?

dull magnet
#

realise that maybe there's a good reason electron is so popular

#

nothing offers as good apis as it

opal fern
#

true enough

#

but i dont see the benefit over just patching into discord

dull magnet
#

way lower resource usage

opal fern
#

But i like krisp :(

dull magnet
opal fern
#

But tbf having an app can possibly open doors to stuff like screenshare with audio on linux

dull magnet
#

they all offer pretty limited apis

opal fern
#

true enough

trail ginkgo
#

although u dont really need a new

#

desktop app for that

opal fern
#

what the fuck is voice engine

dull magnet
#

oh yeah we need to work more on voice engine

amber condor
dull magnet
#

tauri is garbage

trail ginkgo
#

👎

opal fern
amber condor
#

idk ive never tried it

opal fern
#

bad performance

#

use neutralinojs instead

dull magnet
dull magnet