#🧩-plugin-development

1 messages · Page 38 of 1

dull magnet
#
const avatarUrls = HARDCODED_DATA;

const images = await Promise.all(
    avatarUrls.map(async urlString => {
        const url = new URL(urlString);
        url.searchParams.set("size", "64");
        const res = await fetch(url);
        if (!res.ok) return null;
        return res.arrayBuffer();
    })
).then(images => images.filter(Boolean) as ArrayBuffer[]);

const IMAGE_SIZE = 64;
const IMAGES_PER_ROW = 20;

const imageCount = images.length;
const width = IMAGE_SIZE * IMAGES_PER_ROW;
const height = Math.ceil((imageCount / IMAGES_PER_ROW) * IMAGE_SIZE);

const CanvasKit = await initCanvasKit();
const canvas = CanvasKit.MakeCanvas(width, height);
const ctx = canvas.getContext("2d")!;

let col = 0;
let row = 0;
for (const img of images) {
    const decodedImage = canvas.decodeImage(img);
    ctx.drawImage(
        decodedImage,
        col * IMAGE_SIZE,
        row * IMAGE_SIZE,
        IMAGE_SIZE,
        IMAGE_SIZE
    );

    if (++col === IMAGES_PER_ROW) {
        col = 0;
        row++;
    }
}

return fetch(canvas.toDataURL());
smoky basin
#

cool

trail ginkgo
#

does it just happen to be divisible by 20 rightnow

#

the amount of sponsors u have

dull magnet
#

oh wait

#

my code isnt exactly right

#

it shouldnt be ceil

#

i need to ceil to nearest multiple of IMAGE_SIZE

trail ginkgo
#

oh i see

#

yea

dull magnet
#
const rowCount = (imageCount / IMAGES_PER_ROW) * IMAGE_SIZE;
const height = Math.ceil(rowCount / IMAGE_SIZE) * IMAGE_SIZE;
#

this should do

trail ginkgo
#

REAL

smoky basin
#

github default pfps so silly

dull magnet
#

should i ignore default pfps?

smoky basin
#

yeah i would

dull magnet
#

seems kinda useless to have maybe

smoky basin
#

how would u tell tho

dull magnet
#

this guys pfp is insane

smoky basin
#

ven blobCatCozy

trail ginkgo
#

that pfp so fire

dull magnet
trail ginkgo
#

ok i take it back

dull magnet
#

thanks for recommending skia canvas

#

soo fire

#

now time to test on cloudflare

trail ginkgo
#

i didnt know it existed til today

#

i might use it somewhere

#

cloudflare alternative to next/image soon

dull magnet
#

why is cf dashboard sooo slow

smoky basin
#

whar

#

its fast for me

trail ginkgo
#

basically just fetch the avatars at some size less than 420

dull magnet
smoky basin
dull magnet
#

unusable

smoky basin
#

imagine

trail ginkgo
#

if the returned image size is 420 then

#

its an identicon

smoky basin
trail ginkgo
#

because default pfps ignore ur size parameter

dull magnet
#

ehj it doesnt matter i'll leave them in

trail ginkgo
#

true

smoky basin
trail ginkgo
#

yaa

#

github identicons

gusty maple
#

and for some reason I still opened the page

trail ginkgo
#

yo

#

mine is a heart

#

fire

dull magnet
#

stupit cloudflare failed build

#

FSIOJJFIOEDJIKOJIKOGEFDJIOEGJIOGE

#

oh

trail ginkgo
#

HARDCODED_DATA husk

dull magnet
#

for now

trail ginkgo
#

oh its just

dull magnet
#

how do i make the bundler not bundle the node half

trail ginkgo
#

oh

#

its not getting tree shaken

#

husk

dull magnet
#

its cause the code is like

const isNode = "object" === typeof process && ...;
if (isNode) {
  require()
} else {
  browser
}
#

runtime check

#

if i hardcode isNode t o false it works

trail ginkgo
#

I WAS GOINNA SAY THAt

#

but i didnt know if it would make const false =

stiff cargo
dull magnet
#

deranged

#

i think cf installs with npm

#

yes

trail ginkgo
#

SAD

dull magnet
trail ginkgo
#

honestly

#

fire

trail ginkgo
#

dont the workers not install anything

#

wrangler just upload one big js file

#

amybe not idk

smoky basin
austere mauve
#

nop

dull magnet
#

guhh bundling this for cf is so pain

#

why is this so terribly written

dull magnet
#

im gonna cry

#

why is bundling this so fucking paiiiin

#

i think im gonna have to turn it into a separate thing

#

and not cf worker

#

what if i just turned it into shithub action that runs once an hour

#

?

#

i always call github shithub

#

@trail ginkgo skia canvas is like IMPOSSIBLE to bundle

dull magnet
#

so second best option: make a simple nodejs script and run it with a cronjob

#

hmm thatd actually be better maybe, they actually have webhook

trail ginkgo
#

is it cus the wasm

dull magnet
#

yes

#

and its code is insane

#

it uses XHR

#

not support on cf workers

#

and have to patch its code to even bundle cause of node requires

proud parrotBOT
remote kestrel
#

wtf happens to the fn_ctx

#

it's not even used

dull magnet
#

?

#

then you can just pass null

remote kestrel
#

so it's just not needed

#

?

austere mauve
#

maybe it used to be

#

oh

#

no its bc mpv passes something to it

proud parrotBOT
remote kestrel
#

oh

#

so I can't remove it?

austere mauve
#

yea

remote kestrel
#

fungus

dull magnet
#

nah

#

i'll just run it once an hour

smoky basin
#

sad

dull magnet
#

people might change their pfp

#

and its easier to just run it once an hour

smoky basin
#

fair

#

add oneko to empty space

remote kestrel
#

I need to figure out what sdl get proc address calls

dull magnet
#

why is this random persons pfp not resized

#

oh

#

not square

smoky basin
dull magnet
#

added a ignore default pfp option

#

whats a good nodejs cli lib

austere mauve
#

the one i made for cobu

dull magnet
#

horror

#

shoudl i use commander

austere mauve
#

virusso

#

virsu

dull magnet
#

commander so good

remote kestrel
#

rini can't spell

austere mauve
#

IMFUKBIC

remote kestrel
#

what

austere mauve
#

DRUGDEd

remote kestrel
#

@austere mauve

zenith drift
#

this is how you solve the problem of error popups chikasmug

#

you just push them off the screen

austere mauve
#

horror[

zenith drift
#

i get too many now

dull magnet
#

what is it cooking

zenith drift
#

i cant click on "open with" bc it crashes file explorer. probably a power toy plugin pranking me kek

remote kestrel
#

@dull magnet help

#

error: lvalue required as unary ‘&’ operand
42 | {MPV_RENDER_PARAM_ADVANCED_CONTROL, &(int){1}},

#

idk how to do this in C++

#

they do this in C

#

same thing in C++ doesnt work

#

the second field is a void ptr

glass oracle
remote kestrel
#

what that

glass oracle
#

cast as char pointer

remote kestrel
#

has to be a void pointer though

glass oracle
#

tbh it's from a random repo i found

remote kestrel
#

is that c++

glass oracle
#

yes

remote kestrel
#

oh

glass oracle
#

oh yeah instead of char * do int *

remote kestrel
#

where

glass oracle
glass oracle
remote kestrel
#

Const_cast from 'int' to 'int *' is not allowed

glass oracle
#

horror

#

maybe just &(int *){1}

remote kestrel
#

a

#

Cannot initialize a compound literal initializer of type 'int *' with an rvalue of type 'int'

glass oracle
#

no errors

remote kestrel
#

guhh

#

segfaults

glass oracle
#

someone help

austere mauve
#

wtf are you doing

#

but you need to box dyn

#

the compiler literally tells you

glass oracle
#

oh i completely forgot about box

#

im so dumb

glass oracle
#

experimenting with it rather

austere mauve
#

dyn Any is horror

glass oracle
#

i am just experimenting right now

austere mauve
#

whatever struct implements Component already could have the state in it

glass oracle
#

this is the flow of components and the component trait
it works well for components with a single level of Drawables but for anything function i'd need containers to provide nesting so i'm experimenting with it

#

i might just do type erasure

glass oracle
austere mauve
#

ideally container would be generic

glass oracle
proud cargo
#

sorry this is rust you can only make homogenous containers

#

(get it)

glass oracle
#

(yes)

proud cargo
#

fuck your website is laggy on mobile

glass oracle
proud cargo
#

guheg

glass oracle
#

the blob in the background is a complete 3d render

proud cargo
#

i guessed as much

ashen axle
#

Is it Astro

glass oracle
#

yes

ashen axle
#

ugh im behind

#

i need to get with astro

#

all the kewl kids use it now

quaint cipher
#

hey uh how come the Erase All Data button is this large.. i cant find whats they using to make it large uh

#

sorry i am very dumb,

glass oracle
#

last time i touched my website was 6 months ago blobcatcozy

amber mantle
#

my websiye is still pure html lol

glass oracle
ashen axle
quaint cipher
#

confuse

#

why it larg

ashen axle
#

i think because its just a single button as an option

#

it has its own line

#

and makes it larg

quaint cipher
#

o ok

ashen axle
#

buttons just take up the space theyre given generally

rocky jackal
#

github is giving me a headache

glass oracle
ashen axle
#

Good thought tho

glass oracle
#

cool

glass oracle
#

you are already filtering by isValidUserId in parseWhitelist so wouldn't this statement always return true

#

i mean false

ashen axle
#

Thanks

glass oracle
glass oracle
glass oracle
#

@ashen axle double toasts

ashen axle
#

yeaaa dw that was an accidental sync

rocky jackal
#

mmm such clin

glass oracle
#

do

onChange: newValue => {
    const parsed = parseWhitelist(newValue);
    if (cachedWhitelist.some(id => !isValidUserId())) {
        showToast("Invalid User ID: One or more User IDs in the whitelist are invalid. Please check your input.");
    } else {
        showToast("Whitelist Updated: Reply ping whitelist has been successfully updated.");
    }
    cachedWhitelist = parsed.filter(isValidUserId)
}

// -- other stuff --

function parseWhitelist(value: string) {
    return value.split(",")
        .map(id => id.trim())
        .filter(id => id !== "");
}
ashen axle
# glass oracle do ```js onChange: newValue => { const parsed = parseWhitelist(newValue); ...
/*
 * Vencord, a Discord client mod
 * Copyright (c) 2023 Vendicated, MrDiamond, ant0n, and contributors
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { MessageStore, showToast, UserStore } from "@webpack/common";
import { MessageJSON } from "discord-types/general";

let cachedWhitelist: string[] = [];

export const settings = definePluginSettings({
    alwaysPingOnReply: {
        type: OptionType.BOOLEAN,
        description: "Always get pinged when someone replies to your messages",
        default: false,
    },
    replyPingWhitelist: {
        type: OptionType.STRING,
        description: "Comma-separated list of User IDs to always receive reply pings from",
        default: "",
        disabled: () => settings.store.alwaysPingOnReply,
        onChange: newValue => {
            const newWhitelist = parseWhitelist(newValue);

            if (newWhitelist.length === 0 && newValue.trim() !== "") {
                showToast("Invalid User ID: One or more User IDs in the whitelist are invalid. Please check your input.");
            } else {
                cachedWhitelist = newWhitelist;
                showToast("Whitelist Updated: Reply ping whitelist has been successfully updated.");
            }
        }
    }
});

export default definePlugin({
    name: "ReplyPingControl",
    description: "Control whether to always or never get pinged on message replies, with a whitelist feature",
    authors: [Devs.ant0n, Devs.MrDiamond],
    settings,

    patches: [{
        find: "_channelMessages",
        replacement: {
            match: /receiveMessage\((\i)\)\{/,
            replace: "$&$self.modifyMentions($1);"
        }
    }],

    modifyMentions(message: MessageJSON) {
        const user = UserStore.getCurrentUser();
        if (message.author.id === user.id)
            return;

        const repliedMessage = this.getRepliedMessage(message);
        if (!repliedMessage || repliedMessage.author.id !== user.id)
            return;

        const isWhitelisted = cachedWhitelist.includes(message.author.id);

        if (isWhitelisted || settings.store.alwaysPingOnReply) {
            if (!message.mentions.some(mention => mention.id === user.id))
                message.mentions.push(user as any);
        } else {
            message.mentions = message.mentions.filter(mention => mention.id !== user.id);
        }
    },

    getRepliedMessage(message: MessageJSON) {
        const ref = message.message_reference;
        return ref && MessageStore.getMessage(ref.channel_id, ref.message_id);
    },
});

function parseWhitelist(value: string) {
    return value.split(",")
        .map(id => id.trim())
        .filter(id => id !== "" && isValidUserId(id));
}

function isValidUserId(id: string) {
    return /^\d+$/.test(id);
}
#

whole thng is diff now

#

i got rid of parseWhiteList

#

wait no other one

#

MAN im so tire

#

d

#

@glass oracle could you reply to me with pings off

ashen axle
#

swwwweeeeet

#

taht wokrs

#

alr the PR is up to date with what i have now

glass oracle
ashen axle
# glass oracle the validation fails if there's atleast 1 valid id
replyPingWhitelist: {
    type: OptionType.STRING,
    description: "Comma-separated list of User IDs to always receive reply pings from",
    default: "",
    disabled: () => settings.store.alwaysPingOnReply,
    onChange: newValue => {
        const originalIDs = newValue.split(",").map(id => id.trim()).filter(id => id !== "");
        const validatedIDs = originalIDs.filter(isValidUserId);

        if (originalIDs.length !== validatedIDs.length) {
            showToast("Invalid User ID: One or more User IDs in the whitelist are invalid. Please check your input.");
        } else {
            cachedWhitelist = validatedIDs;
            showToast("Whitelist Updated: Reply ping whitelist has been successfully updated.");
        }
    }
}
#

try that for the setting

glass oracle
#

yop that works

#

you can avoid creating 2 arrays by

const originalIDs = newValue.split(",").map(id => id.trim()).filter(id => id !== "");
const isInvalid = originalIDs.some(id => !isValidUserId(id));

if (isInvalid) {
    showToast("Invalid User ID: One or more User IDs in the whitelist are invalid. Please check your input.");
} else {
    cachedWhitelist = originalIDs;
    showToast("Whitelist Updated: Reply ping whitelist has been successfully updated.");
}
green vessel
#

W plugin @ashen axle

#

i hate when people have reply pings off

#

like what’s the point in replying if i can’t see it

ashen axle
glass oracle
trim cedar
#

What the fuck is this macro hell

glass oracle
#

just gonna do type erasure

wooden dragon
#

rust turple annoying

wooden dragon
#

no one knows how to write them

glass oracle
#

i sure do

#

rust macros are such a great feature

#

i love writing proc macros blobcatcozy

#

(not sarcasm)

austere mauve
#

procmacros insane

wooden dragon
#

me adding 4 crates just to write one proc macro that calls a single function to transform smth during compile time

proud cargo
#

this counts as proc macro right!!

glass oracle
wooden dragon
#

is

#

this is cursed

glass oracle
#

idk, swc types were in rust and i cba to convert each and everything to ts individually

wooden dragon
#

javascript C abi when

glass oracle
#

ffi?

#

oh you mean other way around

#

please no

proud cargo
wooden dragon
proud cargo
#

i mean you have native node modules, isnt that basically it

wooden dragon
#

i was joking

glass oracle
wooden dragon
#

it would allow to access everything that supports c abi

austere mauve
#

wasm bindgen already generates defs for you..

#

whar

wooden dragon
glass oracle
austere mauve
#

horrifying

glass oracle
#

yes but it works and it gets pretty much fully yeeted after compile

glass oracle
#

@austere mauve i have committed war crimes

austere mauve
#

that is better actually

#

i think iced does something similar w widgets -> elements

glass oracle
#

had to dig through erased-serde to figure out rust type erasure

#

overall i'm pretty happy with this but i still feel like it could be made better

versed lark
#

Guys

#

Vue or React

#

which one sould I learn?

amber basin
#

svelte

viral roost
#

jquery

#

(jokes aside vue if you want to not bang your head on the table over stupid errors)

keen summit
austere mauve
#

all of them are the same shit learn whatever u can figure out the others later

proud cargo
#

they r not the same shit

#

ok idk enough about vue to talk shit about react comparing it to vue

versed lark
#

Tbf my main goal is to land a junior job as fast as I can and gain some experience

#

Sadly I looked around and I didn't really find any for uni students only a few webdev jobs

keen summit
wooden dragon
#

my reaction to that information

proud cargo
#

quite sad innit

misty basin
#

Is there anyway to just intercept and block certain URLs?

amber basin
#

devtools

misty basin
#

Discord devtools or browser devtools

cedar marsh
#
type Tag = 'job' | 'education' | 'projects' | 'web dev' | 'mods'
const tags: Tag[] = ['job', 'education', 'projects', 'web dev', 'mods']

is there a less dumb way to do this? I don't like how this has every tag twice

wooden dragon
#

yeah

cedar marsh
#

thanks

wooden dragon
#

as const does the magic

amber basin
#

what does as const really do?

wooden dragon
#

it stricts the type signature of const tags

#

from string[] to 'job' | 'education' | 'projects' | 'web dev' | 'mods'

amber basin
#

ahhhh

keen summit
#

So that's just like a union type from an array then

#

cool

wooden dragon
#

yeah

#

it a union

lofty crypt
#

how long does setting up a vencord dev env take, say until getting to hello world?

glass oracle
#

like 5 minutes
git clone
pnpm install
pnpm watch
add plugin in userplugins

and you have hello world

stiff cargo
#

And maybe node aswell?

glass oracle
#

yes

stiff cargo
#

So like 10 minutes

glass oracle
#

or 30 if building node from scratch

keen yoke
#

or one hour if formatting your hard drive and reinstalling your os

steady knot
#

13.7 billion years if you first invent the universe

glass oracle
#

well that escalated quickly

lofty crypt
#

a8 thank yous

#

that’s really not that much hmm

green vessel
#

is there a way to move user profile in settings to left or right?

proud cargo
#

still dont understand what im doing wrong

#

i have bindings as a non-dev dependency

#

doesnt bundle its dependencies

#

so dum

#

manually adding it as a dep fixed trolley

#

oh my god pnpm issue

rocky jackal
#

I have lost 90% of my braincells trying to remake react-like hooks for pure html

#

and it works

#

help

#

also yes this is fleet

rocky jackal
#

trying to make things simple for myself

proud cargo
#

are react hooks considered simple now

rocky jackal
#

no

#

never

#

I just don't want to deal with event targets and query selectors too much

rocky jackal
#

I now have a function to render a settings page (wtf am I doing with my life)

keen summit
oblique lark
#

🔥

tender finch
glass oracle
lofty crypt
#

and yeah that’s possible and surely not hard

tender finch
lofty crypt
#

first light theme joke on discord

proud cargo
trail ginkgo
#

lol u just made me look at the scrollbar

proud cargo
trail ginkgo
#

this blog post is longgg

#

this is cool

proud cargo
trail ginkgo
#

well

#

its interesting to know that

#

nullable keys might be more cache-friendly than optional keys

proud cargo
#

hm

#

wonder if its the same for undefined keys

trail ginkgo
#

i'd imagine it is

#

because the key is still defined

proud cargo
#

what the fuck

#

wait

#

https://perf.link/#eyJpZCI6Imd1d21jdG1nb2ZlIiwidGl0bGUiOiJGaW5kaW5nIG51bWJlcnMgaW4gYW4gYXJyYXkgb2YgMTAwMCIsImJlZm9yZSI6ImNvbnN0IG1lZ2EgPSBbLi4uQXJyYXkoMTAwMCkua2V5cygpXS5tYXAoZSA9PiB7XG4gIHZhciByZXQgPSB7XG4gICAgeDogZVxuICB9O1xuICByZXRbZSAlI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MDAwXSwib3BzIjoyNzQyMH1dLCJ1cGRhdGVkIjoiMjAyMy0xMS0xNVQxNDo0Njo1OS40NzFaIn0%3D

#

jesus fucking chrsit what is that link

#

ok well unconclusive

#

im gonn rewrite that lmfao that code is horrible

lofty crypt
#

longest ass link

#

that string would compress so well

proud cargo
#

sadness now it doesnt show results at all

lofty crypt
#

where’s the fun in that

trail ginkgo
#

@proud cargo this is more what i was wondering

#

but still seems like its not a huge difference

#

atleast for just [[Get]]

proud cargo
#

IC has space for multiple

#

it might just be polymorphic

trail ginkgo
#

oh u mean i should test megamorphic

proud cargo
#

ya

trail ginkgo
#

lol thats so much worse

#

mega vs poly degree 1 vs mono

#

that makes sense i see

proud cargo
#

because youre straight up leaving out the properties on the others

#

no?

trail ginkgo
#

?

proud cargo
#

hhh

trail ginkgo
#

megamorphic array is just an array where every item is a different shape

proud cargo
#

yea but

#

wouldnt you have to fill every possible key for id with null/undefined for that to be fair?

trail ginkgo
#

i dont see how but i can try that

#

this is cursed

#
const monomorphicManyKeys = Array.from({ length: N }, (_, i) => Object.assign({
  id: "a",
  data: Math.random() > 0.5 ? { balance: Math.random() } : null,
}, Object.fromEntries(Array.from({ length: N }, (_, i) => [megaIds[i], true]))))
#

LOL i think i hit the shape size limit

proud cargo
#

h

JavaScript performance benchmarks you can share via URL.

trail ginkgo
#

monomorphic all mega's keys VS megamorphic VS poly VS mono

proud cargo
#

i cant program apparently

#

lmao

trail ginkgo
#

yea i think its cus ur using find

#

so its not really measuring the performance of the lookup

#

or maybe not because the find is matching the last items

#

ur megamorphic is assuming that v8's cache limit is before degree 10

#

8

proud cargo
#

oh look at this tho

#

why is false filled so much worse

proud cargo
trail ginkgo
#

im confused cus all ur objects have the same degree

#

are u testing same degree with many shapes vs one shape

proud cargo
#

what

#

h idk

#

why we even doing this xd not like were gonna beat v8

trail ginkgo
#

[e % shapeSize]: true, this is making all ur arrays polymorphic

proud cargo
#

it shouldnt be

#

the filledWith always have all of the possibilities where it could be set

trail ginkgo
#

oh true

trail ginkgo
proud cargo
#

its half as fast just because the object is large?

#

i mean the others are literally the same aside from propertyvalues

#

the test you made is actually good though

#

eh ok i reran it and no difference

#

shig

trail ginkgo
#

if ur talking about the one from my test

#

im guessing i hit the max shape size so it doesnt cache as monomorphic

proud cargo
#

nah i mean my tests

#

filling the object with false was half as fast as filling with nulls

cedar olive
#
<ref *1> WriteStream {
  connection: false,
}
#

heh

dull magnet
#

<ref *1> WriteStream {
connection: false,
}

cedar olive
#

idk how to test ansi highlighting

#

it's not highlighted on plain discord either

#

#🤖-bot-commands message

#

oh

#

it's working nvm

rocky jackal
#

huh????

#

wat is this role?

#

writestride trolle

amber basin
#

documentation writing

dull magnet
#

horrible

proud cargo
vapid latch
#

is there any events in electron that run similar to preload

dull magnet
#

wdym

keen summit
#

Can we not do this?

#

It works if I use normal selectors like '.messageListItem__6a4fb'

chrome elbow
#

class=^

keen summit
chrome elbow
#

^= not =^

keen summit
#

wow couldn't see that at all

#

thanks

lofty crypt
#

does ansi work on mobile by now?

glass oracle
#

nop

lofty crypt
#

frickin Discord man

weary saffron
#

even the pc ansi is very limited, it's sad cus ansi is so powerful

#

it is what it is ig

lofty crypt
#

yeh -_-

cedar marsh
proud cargo
#

meh

#

i dont need readable code, i need correct code

tender finch
#

working code

austere mauve
#

dynamically typed languages were a mistake

weary saffron
#

Don't insult my dear python like that

#

It's perfect being dynamic

austere mauve
#

hell nahhh

weary saffron
#

Imagine enjoying writing so much boilerplate for a project only you will use

austere mauve
#

what is bro saying

weary saffron
#

Dynamic > static

#

That's a fact not an opinion

austere mauve
#

you suck thats a fact

weary saffron
#

Well... Hm, your mother?

jovial crest
#

Dynamic what

#

Typed?

#

Statically typed languages are better DX

proud cargo
#

no thats just a skill issue

#

you can make asm have good dx

jovial crest
#

What is asm

proud cargo
jovial crest
#

Assembly?

stiff cargo
#

In assembly everything is an integer and it’s up to you to treat it as something different

austere mauve
glass oracle
stiff cargo
glass oracle
#

i do not have a counter argument, you win

stiff cargo
#

Very unnecessary to go there though lol

dull magnet
#

i think you should go back to school where you learn what those words mean

trail ginkgo
#

So kinda true and based

weary saffron
#

If it wasn't a fact then why is it correct, checkmate

#

Jokes aside idt neither is better cus it's a preference

weary saffron
#

Huh?

astral peak
#

overcomplicating "projects" i will only use twice in my whole life

weary saffron
#

Lmao

proud cargo
covert nimbus
#

and i say that as a primarily python dev

weary saffron
#

Typing is a double edged sword. It's neat but can slow you down so yes that statement is wrong but it doesn't mean the opposite is right

covert nimbus
#

static is to the right in your message so it clearly is right

weary saffron
#

🗿

lofty crypt
#

i don’t understand ||how this was not invented earlier it is so useful|| ||/j||

ashen axle
#

is webstorm good with Svelte or should I stick to vscode

#

i have the jetbrains stuff so if its good ill use that

proud cargo
proud cargo
#

might switch to ws since vsc ts lsp has slowed to a crawl

lofty crypt
#

yeah looks cool. Feels kinda NekoCat_Fear being replaced by ai but would be kinda silly not to ig, ai is just better at most things already

lofty crypt
#

owo true

stiff cargo
potent fox
#

ITS FORBIDDEN TABOO

stiff cargo
#

Sounds like you should use webstorm

potent fox
#

wrong

#

nobody uses webstorm

#

not even dumb people

cedar marsh
#

Webstorm is dumb

stuck epoch
#

what does this mean and how do i fix it yo

ashen axle
stuck epoch
ashen axle
#

This is the wrong channel

stuck epoch
#

should i just download it

#

with the installer thing

#

is it safe?

keen creek
#

also, a byte is just bits n nibbles which in turn are also just 0 and 1's which are booleans more than anything

#

or as i like to call em

#

minecraft levers for ur cpu

versed osprey
#

also

#

vns

shrewd tundraBOT
green vessel
#

I need to know, what's better:

for(let i = 0; ...; ...){...; }

or

for(var i = 0; ...; ...){...; }
jagged briar
#

let

#

var will put it in the function scope and then it'll be stupid

green vessel
jagged briar
#

use let

#

let is always best practice

green vessel
#

Ok thank :3

cedar marsh
#

Never use var unless you want to die

green vessel
#

hmm in that case i think im gonna use var every day

oblique lark
#

use const :3

jagged briar
#

const in a for loop is so genious

green vessel
cedar marsh
#

Let

#

Because you modify it in the third condition of the for

green vessel
#

Wow it work now !

for(const e = 0; e < 1; e){
    console.log(e, ":3")
}

thank !

jagged briar
#

0 :3

green vessel
jovial crest
#

what the fuck are you on about

green vessel
#

What mobile modified client should I use except aliucord

dull magnet
#

vban @green vessel spamming same message in 5 different channels

glass oracle
#

please use 3 ` thanjks

#

```
[code here]
```

keen yoke
#

```js
[code here]
```

#

for syntax highlighting

#

what line

#

and position in the line

#

what are you using?

#

it should show

#
client.login('bot_token_not_telling>;3);
#

is no ending quote intentional?

#

why the 3

#

and no end quote

#

just show the full error

#

idk what ur running that in

#

but it should show the line number and column number

viral roost
#

any decent code editor should show a red line below where the error is

keen yoke
#

yeah

viral roost
#

what editor are you using

keen yoke
#

program

median flare
#

what program are you using to edit the file

keen yoke
#

what text editor

median flare
#

for example, notepad

keen yoke
#

wdym u forgot

#

just look at ur screen

#

??

viral roost
#

vim user \j

median flare
#

you use like, vim or something

#

?

keen yoke
#

ok what os

viral roost
#

ubuntu

keen yoke
#

get something like vscodium

#

no i do not mean vim

#

why are u so strange

#

a lot of these terms arent exclusive to that

#

like "text editor"

median flare
#

i recommend going to a website called "codecademy"

keen yoke
#

also whats with the extra pluses infront of (parseFloat

#

get vscodium

#

ok but like

#

the error should show the row

#

a number

#

there should be a number in the error

#

or somewhere on the screen

#

just screenshot the whole window

#

just screenshot the whole window with the error

#

there has to be something

#

show the error

#

the whole window that has it

#

how did u get this?

#

run it and show the window with the error

#

yes that

verbal schooner
dull magnet
#

wtf is that text editor

rocky jackal
#

either gedit or it's big brother, gnome text editor

#

no, they are not the same

potent fox
#

it looks like gnome text editor

#

I thought gedit was short version of gnome editor h

rocky jackal
#

it is, I want to believe

#

the only difference between the 2 is libadwaita and some settings

rocky jackal
#

uh huh

hybrid dune
#

Nice emoji

rocky jackal
oblique lark
#

👑
Ce
rifi∊
ed D
⊃um

keen yoke
#

what r u trying to do

#

show the error

keen yoke
#

did u write all the files listed there?

#

internal/modules/cjs/loader.js?

#

what files did u make tho

#

are u using the latest version of node?

#

node -v

#

broo

#

when did u install node???

austere mauve
#

💀

#

we're at v20

#

mf

keen yoke
#

thats wild

austere mauve
#

do you ever update your system

#

thats a no

#

skull

jagged briar
#
keen yoke
#

cuz ur on some old lts version

jagged briar
#

prob because you used the apt package

austere mauve
#

update your system

keen yoke
#

how did u even manage to install ubuntu

austere mauve
#

how many years since u updated

keen yoke
#

you gotta be on some early 2021 version

keen yoke
#

wait that is real 💀

austere mauve
#

yes

jagged briar
#

explod

trim cedar
#

The

#

Actual

#

Fuck

#

Is

#

This

#

An

#

Actual Domain huskfluent

proud cargo
gusty maple
green vessel
#

Yes, I noticed that too

#

what's a smol pepehands btw ?

gusty maple
green vessel
#

oh thx

proud cargo
proud cargo
#

what

#

stupit

#

update???

#

?????????

#

you said ubuntu no?

#

fucking learn apt

#

man

keen yoke
#

u able to update it?

slim totem
#

You can update node pretty easily:

Install nvm by running curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash on a terminal
restart the terminal
type nvm install 20.5
then type nvm use 20.5

#

node too old

#

do what i posted

keen yoke
#

also ur npm is old

slim totem
#

nvm should update npm for him i think

slim totem
#

.

proud cargo
#

ask your dad

slim totem
#

installing nvm shouldnt need sudo

#

try reopening the terminal

trim shore
#

nothing needs sudo. just login as root

#

hack it

#

what's your dad's birthday. that' sprobably the password

#

if not try your own birthday

keen yoke
#

cant u just boot into an installation usb and use the terminal there to change password

trim shore
#

if my kid touched my computer i'd murder them. (note: i do not, nor will i ever, have kids)

trim cedar
#

Depending on the Ubuntu Revision he has that might not update to >=20

#

Type this into a terminal: cat /etc/os-release
What is the output?

proud cargo
#

ask him to install node lts rq trolley

#

lts rolling release on top

median flare
#

remind me to not open coding channel ever again as long as mushroom is here

proud cargo
#

@median flare

#

reminder

median flare
#

thank you

#

it didnt work

proud cargo
#
  • {display: none;}
slim totem
#

plugin that has a 2% chance of replacing your message with your own token before sending

stuck falcon
#

@median flare

#

Reminder

dusky reef
green vessel
lofty crypt
#

anytime brotherfam

crisp basin
#

have anyone figured out if it's possible to set custom rpc with something like Playing on Xbox, or you need some ids that are created on microsoft servers? i've been trying to find what's needed because my activity works fine as long as i keep "platform": "xbox" commented out

azure gate
dry patio
#

if i wanted to find the code where this thing is rendered

#

in order to add more to it

#

how would if ind that

#

searching the strings gives me nothing at all

trim shore
#

grats?

dry patio
#

goated

keen yoke
dry patio
#

i seem to did it without react dev tools

keen yoke
#

makes it way easier tho

dry patio
#

i did not know react dev tools existed until now

#

will probably use in the future

keen yoke
#

wghaer

#

u did it wrong

#

u have to use the command api

#

try google

dry patio
#

ok im about to give up on this shit

#

i wanna make my custom thingy actually do something

#

but i cannot for the life of me find the code that actually checks which item has been selected

#

there is one single function that sets some variable "currentTab" to a number, and i know setting a bp and changing the number right there has the exact desired effect of setting the tab

#

but trying to search "currentTab" through all the sources gives me absolutely 0 hint of anything happening

#

does anyone have a clue on something i could do to help me find it

jagged briar
#

use a breakpoint and you can see the call stack

dry patio
#

tried that too

jagged briar
#

welp then idk

dry patio
#

well maybe im not breakpointing in the right location

#

trying to set breakpoint on whatever thing constructs this

#

bc it only appears in the "unreads" tab

#

and im just getting a bunch of nonsense

dry patio
#

ok it has to do something with the USER_SETTINGS_PROTO_UPDATE event

#

but there r so many things handling that event idk how to narrow anything down

cedar olive
#

it's right there

#

@dry patio

dry patio
#

u may be right

cedar olive
#

not gonna lie to you it's extremely sucky it uses the value of the settings proto to know the selected tab

dry patio
#

yeah its a little weird

cedar olive
#

trying to save a non existent tab value will likely not work

dry patio
#

i can make the nonexistent tab value "work"

#

it just does nothing rn

cedar olive
#

wdym?

dry patio
#

i can make it store the nonexistent tab in the settings

#

it just kinda bugs out the menu

cedar olive
dry patio
#

that is what i do

#

oh maybe thats a different section though

cedar olive
#

yeah this seems like a different place

dry patio
#

what the hell is InboxTab.TODOS

#

setting my thing to the todos id makes it bug out even more

cedar olive
#

it's an enum for the numbers

dry patio
#

yeah but like there is no "Todos" in the menu

cedar olive
#

use it to find the code lol

dry patio
#

its like an unused thing

cedar olive
#

prob

#

discord does that

glass oracle
cedar olive
#

I know

glass oracle
#

and yes changing the proto with unintended data will likely cause a crash in other client logged into the same account

glass oracle
#

message reminders

#

it used to be public back when the experiment released, now it's employee only

cedar olive
#

🤨 how do you have it

glass oracle
#

experiments, ofc it doesnt ectually work

cedar olive
#

oh lol

dry patio
#

ok i think i figured it out

#

is there value in creating an api for the inbox tabs

#

for everyone to use

#

cuz i might do that too just for funsies

dry patio
#

ok this isnt exactly what i wanted but its close enough

dull magnet
#

what u making

#

why not use vencord toolbox for this

dry patio
#

idk what that is

dry patio
#

so im trying to make that now

jagged briar
#

oh you have to enable it

#

in settings

dry patio
#

what does it actually do

jagged briar
#

just a place where plugins can put menus

#

its a toolbox

dry patio
#

how would that be useful

jagged briar
#

idk you tell me

dry patio
#

but i want it in the inbox tab cuz it would be nicer

dry patio
#

ok i need help w something again

#

say theres this module that i need

#

and the only way the module seems to be accessible is with one of these thingies

#

how do i access this thing in my plugin

glass oracle
#

findByPropsLazy

dry patio
#

i didnt find any props

#

so i just did this

austere mauve
#

thats an import

#

search for 64318:

glass oracle
#

is there not a lazy variant of findByCode :thonk:

#

and do not do byCode N

dry patio
#

oh yeah i forgot about that

#

rn im just testing anyway

glass oracle
#

that'll break as soon as some modules get moved and the manged name changes

dry patio
#

i alr knew where it was

austere mauve
#

you write a find for that module

glass oracle
#

just do const headerItem = findByCodeLazy("useInDesktopNotificationCenterExperiment)(")

austere mauve
#

yeah that

dry patio
#

that gave me the function for the entire module

#

but the import thing

#

i think it caches something

glass oracle
#

:thonk:

#

findByCode(Lazy) searches exported functions as opposed to the module function

#

in this case default

dry patio
#

oh wait u might be right

#

yay

#

works

dry patio
#

what have i done

#

wait how do i actually use the function

#

this is how its used in the source

#

so i assume its like a jsx thing ofc

glass oracle
#

same as <g.default tab={i.InboxTab.MENTIONS} />

dry patio
#

so i tried that

#

and it didnt show anything

#

but if i call it manually like this, at least some things start showing

#

so now im confused

austere mauve
#

<> <React.Fragment> ???

dry patio
#

idk

#

idk what <>even means

#

i just saw it in another plugin

austere mauve
#

<> is a fragment

dry patio
#

oh my b

#

either way even without the extra fragment it still didnt show anything

#

and the function call did

austere mauve
#

@dull magnet what did you cook

dry patio
#

so im just straight confused

dry patio
austere mauve
#

in jsx only capitalised names are treated as components

dry patio
#

ohh

austere mauve
#

try that maybe

dull magnet
glass oracle
# austere mauve whar

text replace and spotifyControls have valid reasons for using React.Fragment over <>, thay have props

austere mauve
#

yea i was reading docs and they're the same except you can specify keying

#

but the others idk what they're cooking

glass oracle
dull magnet
#

like i said megu wrote it

#

they prefer it over <>

#

idk why

stuck falcon
#

horror

dry patio
#

we are getting closer

wooden dragon
#

:3

austere mauve
#

why does the space feel bigger than the other buttons

dry patio
#

it shouldnt be

#

but idk maybe it is

#

ok the webpack thing is not finding the module

#

i know it exists

#

and yet

glass oracle
dry patio
#

how do i know whats exported

glass oracle
#

every module has this at the top
[3rd param].d([2nd param], { /* mappings of exported property to getter function */ })
[2nd param] corresponds exports prop of a module
[3rd param] is the mangled __webpack_require__ function

smoky basin
#

the ones where they need to set fragment props

#

others... ehh

dry patio
#

is it impossible

glass oracle
#

no but yes
you can export it by patching the module

smoky basin
dry patio
#

so i basically just make a dummy patch

smoky basin
dry patio
#

solely for export purposes

smoky basin
#

u STEAL it

#

one moment camila

glass oracle
#

nah you call it exporting, you dont want them to know you're stealing their components :^)

smoky basin
#

both of these patches obtain unexported funcs

dry patio
#

oh i see...

glass oracle
#

vencord has such great DX tools 🥰

smoky basin
dry patio
#

😭

smoky basin
#

show patch

dry patio
#

like the diff?

smoky basin
#

na the object of the patch

dry patio
smoky basin
#

ok why is it so complex

#

u don't need that many capture groups no??

dry patio
#

variable, parameter, and body

smoky basin
#

1 moment

dry patio
#

i konw why its erroring now

#

i just dont know what ima do to fix it

#

ok i think i fixed it

smoky basin
#
find: ".default.guildFilter:null",
replacement: {
match: /function (\i)\(\i\){let{message:\i,gotoMessage/,
replace: "let $1 = $self.renderMsg = $&"
}
dry patio
smoky basin
#

smt like that

austere mauve
#

btw $self.renderMsg=x;function x(){...} works

dry patio
#

woah

#

ok that makes things way easier thanks

austere mauve
#

js is a lil sily

smoky basin
austere mauve
#

yes

smoky basin
#

but you're assigning to renderMsg before x is a thing

#

wtf

austere mauve
#

it gets hoisted

dry patio
#

lets go

smoky basin
#

nice

dry patio
weary saffron
#

that is pretty awesome, goodjob!

dry patio
#

why is it giving undefined in the plugin but not in the console

#

for reference

smoky basin
#

are u sure ur passing the right args

dry patio
#

you can check for yourself

#

i copy paste the exact same thing

smoky basin
#

i mean like

#

are the args the right type

dry patio
#

yeah thats why i do the + "" to force it to a string

smoky basin
#

and why would i check it's your plugin Fear

dry patio
#

no i mean like

#

check the screenshots

#

ok so apparently messagestore is just bad

#

it just pretends the message doesnt exist if you haven't loaded the server it was in

glass oracle
dry patio
#

i want the thing to auto-update when theres a new message

#

and im trying to use the react state thing or wtv

#

and its just like

#

not updating??

#

maybe im doing it completely wrong

#

idk hwo else i would do it

dry patio
#

figured it out

#

had to assign new variable

rancid cargo
#

ive been creating a theme and this feels so illegal to do. opinions?

woven lion
#

the imports?

#

that seems normal

rancid cargo
steady knot
#

that's a lot of css

rancid cargo
#

around 190 kb :p

steady knot
#

yikes

junior cove
#

If it's just for maintenance purposes, it's probably better to just use something like Sass or postcss for bundling instead. Imports kind of suck

dry patio
#

ive made something

#

pretty cool

#

what are our thoughts

#

was an absolute pain in the ass to make that menu bc theres like zero docs on how to mess w the inbox thing

#

but i did it in js one night 💪

#

wdym badges

glass oracle
dry patio
#

oh yeah it does that too

#

that was the original feature