#πŸͺ…-progaming

1 messages Β· Page 8 of 1

dusty moth
#

or to update .obj1.obj2.obj3|=.*. (. refers to The Value)

wanton osprey
#

@dusty moth any way to get it working on windows?

#

i've tried it without the > temp.json as well

#

same error

wanton osprey
#

i'm following what you said

dusty moth
#

try cmd

wanton osprey
#

damn okay

dusty moth
#

oh wai

#

t

dusty moth
# wanton osprey

that kinda works, so change ' to " and yell at the powershell devs

wanton osprey
dusty moth
#

also jq won't modify in-place

wanton osprey
#

this simply printed out the entire json

wanton osprey
dusty moth
#

and DO NOT redirect to the original file for legal reasons

wanton osprey
#

what

dusty moth
wanton osprey
#

can it be done in one line

dusty moth
#

there might be sponge

still jolt
#

| tee

wanton osprey
#

man why is this shit so difficult, why can't vscode have a thing similar to emmet but for json

dusty moth
#

depends on if Windows ships it by default

dusty moth
still jolt
#

hold on what

dusty moth
#

hold on checking source

still jolt
#

checking source husk

dusty moth
#

try with more than 4096 bytes

still jolt
#

uhh sure

#

?

mellow phoenix
#

yall, wanna see a one line sneak game in esoteric python :))

Warning: the following content contains material that may be harmful for bare eyes users or traumatizing to some users, view it on your own risk, the owner of this code or the distributor is not responsible for any damages

||py (pg:=__import__("pygame"),__import__("pygame.locals"),ri:=__import__("random").randint,sc:=pg.display.set_mode((600, 600)),cl:=pg.time.Clock(),sp:=pg.Vector2(10,10),sb:=[],di:=pg.Vector2(10,0),nf:=lambda:globals().update(fo=pg.Vector2(ri(0,59)*10,ri(0,59)*10)),nf(),[(sb.append(pg.Vector2(sp)),sb.pop(0),sp.__iadd__(di),(sb.clear(),sp.update(10,10))if(sp in sb or not(0<=sp.x<=600and 0<=sp.y<=600))else None,(sb.insert(0,pg.Vector2(-10,-10)),nf())if sp==fo else None,sc.fill((0,0,0)),pg.draw.rect(sc,(255,0,0),(fo.x,fo.y,10,10)),pg.draw.rect(sc,(255,255,255),(sp.x,sp.y,10,10)),[pg.draw.rect(sc,(255,255,255),(p.x,p.y,10,10))for p in sb],[((1/0)if ev.type==pg.locals.QUIT else di.update({pg.locals.K_w:(0,-10),pg.locals.K_s:(0,10),pg.locals.K_a:(-10,0),pg.locals.K_d:(10,0)}.get(ev.key,di))if ev.type==pg.locals.KEYDOWN else None)for ev in pg.event.get()],pg.display.update(),cl.tick(10),)for _ in iter(int,1)]) ||

still jolt
#

snek :3

naive condor
#

what are good projects to do

final night
#

Using regex in javascript, how do I get all the URLs from this string?

sources:[{file:"https://....m3u8/?...%22},{file:%22https://....m3u8?...%22}]

/file:"([^"]*)"/g works on regex101, but

/file:"([^"]*)"/g.exec('sources:[{file:"https://....m3u8/?...%22},{file:%22https://....m3u8?...%22}]')

only gives the first url

#

I would do something with eval to just turn it into an array, but I can't trust the source of the string

royal nymph
#

JSON.parse

#

oh it's not proper json

#

where you are getting this data from why is it in this format

final night
solid tide
#

you could do a little regex substitution on it first if the keys are fixed

#

even if they aren't you probably can just more pain

final night
final night
final night
#

is there a way to extend the lifespan of an interaction token?

#

I want my user installed app to delete it's messages after an hour, but the token expires after 15 minutes

winged mantle
#

you can probably delete them the standard way (with the bot token) since it's owned by the bot?

#

ofc that won't work if it's not in the guild i guess

finite isle
#

chat help me

#

im getting a hidpi display which means i have to move off X

#

which wayland WM doesnt suck?

#

or well i currently run xmonad. whats the closest i can get to that?

atomic brook
finite isle
atomic brook
finite isle
blazing haven
jade stone
finite isle
atomic brook
royal nymph
finite isle
upper glen
wicked stump
#

late but adding another vote for sway

finite isle
#

i said WM

#

i dont want a DE

finite isle
void berry
#

+1

wanton osprey
lime sorrel
#

is sway better than hyprland or vice versa? i just used hyprland, it seemed cool to me

torn seal
lime sorrel
#

hmm i will try

upper glen
whole cove
#

this should be added to vencord

lofty maple
tight fern
royal nymph
#

what a silly issue, it's not even trademarked...

rocky veldt
#

that's weird

#

the internet is fun

marsh spear
#

oh god i hope they revert it, that icon looks like some ass. im lucky i forgot to update Hehehe

formal belfry
#

How do i print the word penis

wheat kernel
#

i hate open source devs immediately getting terrified whenever someone mentions anything vaguely legal related

#

they didnt even bother to check if it's actually trademarked 😭

median root
#

yo does the sendMessage vencord function allow for images and attachments to be sent?

#

if not is there another built in thing for that?

royal nymph
#

findByProps("uploadFiles")

#

or promptToUpload

#

or UploadManager.addFiles

median root
#

thanks

median root
median root
#

this is what im passing it:

        ```ts

const uploadedAttachments = await UploadManager.addFiles(channelID, files, null, {});

finite isle
#

LMAO

#

AWS CHARGES FOR 4XX REQUESTS

buoyant trellis
#

What is the purpose of (0,x) instead of just x in webpack outputs?

cerulean plover
#

idk tbh

mellow phoenix
royal nymph
#

/run ```js
global.me = "we are global";
const obj = {
me: "we are local",
method() {
console.log(this.me)
}
}

const { method } = obj;

obj.method(); // call via object reference

method(); // direct call to function stored in variable (value)

(0, obj.method)(); // call as value

rugged berryBOT
#

Here is your js(18.15.0) output @royal nymph

we are local
we are global
we are global
royal nymph
#

input code:

import { method } from "foo";
import bar from "bar";

method();
bar.method();```
output code:
```js
var a = webpack_require("foo"),
    b = webpack_require("bar");

(0, a.method)();
b.method();
#

(a, b) just returns b as a value instead of a reference

#

which makes it so that it has no object receiver and thus this will be the global

buoyant trellis
#

thanks

wheat kernel
#

terrifying

golden narwhal
royal nymph
#

AHSHSJSJSNSJEJS

#

be nice lmaoo

golden narwhal
#

catroll oookayyyyyyy

visual moat
royal nymph
#

what the hell just happened

wheat kernel
#

most usable github alternative

still jolt
whole cove
#

@royal nymph how mature do you rate oceanicjs

#

compared to djs

blazing haven
still jolt
#

imho defo more barebones than d.js

#

but very much usable

#

(unfortunately can't share the repo rn)

vernal granite
still jolt
#

where else would it be located

vernal granite
#

Idk

#

Your home directory

royal nymph
#

but they're struggling with scaling and seem to be getting a bunch of malicious traffic lately

grand garnet
#

is it better than gitlab?

royal nymph
#

depends how you define better

#

codeberg is about freedom, privacy and the community

#

github and gitlab are corporate / commercial

#

that's part of why codeberg is struggling cause they're a non profit

grand garnet
#

gotcha, had it in my mind that gitlab was also nonprofit but I think I confused it with being open source

royal nymph
#

gitlab is not open source either

#

there is gitlab community which is open source

but gitlab.com is gitlab enterprise

#

which is also very corporate

grand garnet
#

oh lol

royal nymph
#

it's kinda like vscode / chrome / intellij

the core is free software but the official branded version is proprietary

wheat kernel
#

that's more or less the only sustainable open source model xd

still jolt
whole cove
#

i do biannual home directory purges

grand garnet
#

just buy more hard drives

still jolt
#

It's mostly steam and backups and, honestly, who knows what

#

I'm too lazy to go through it

mellow phoenix
still jolt
mellow phoenix
#

1Tb SSD is good enough for me

still jolt
crystal cedarBOT
#

Not enough messages saved for channel

crystal cedarBOT
#

Not enough messages saved for channel

buoyant trellis
#

hmmmmmm

fluid temple
#

continuing here

worthy sun
#

ye

fluid temple
#

i have no idea why it's failing

#

it fails at the linker which is even weirder

worthy sun
#

what if u remove the vars.h include in ball.h

#

actually

fluid temple
#

errors about undeclared variables

worthy sun
#

yeah u would have to include vars.h as well cus ball.h doesnt do it for u

#

dont think that would change anything

#

ugh havent programmed in a while my brains rotting lol

#

ill look at my other projects

#

im p sure i do the same thing and its normal

#

this is so simple but so confusing im sure ive done the same thing and it worked fine :p

#

does gcc like not have pragma once or something? surely it does

#

yeah

#

am i stupid

fluid temple
#

i can't figure it out still

worthy sun
#

@fluid temple i didnt think this was necessary but i guess it is, its what i had in mind earlier but i said it wrong```c
// vars.h
extern int var1; // only declarations, not setting any value
extern int var2; // extern basically means that its using the variables from another source file

// vars.c (new file, dont include btw, same with any other non header file)
int var1 = 123; // u can set default values here
int var2 = 101010;

#

i think this should work

#

my bad, i dont usually initialize global variables like that so i wasnt sure :p

#

i had a feeling extern should be used tho

#

in c++ u can use the inline keyword instead

fluid temple
#

that appears to work

worthy sun
#

:D

#

it should be fine

#

it only initializes once in the one c file

#

and the header only decalres the variables

#

dont remove the pragma once ofc

#

remember to have that always

#

if u can have ur ide automatically add #pragma once to new header files htat would be useful

#

normal visual studio does that for u and its really nice

#

id prob be forgetting otherwise :P

fluid temple
#

idk if vscode can

#

i'm on linux so no vs

worthy sun
#

and just

#

add inline in front of the definition

#

so like

#

inline int var1 = 123;

#

and it should work

fluid temple
#

yeah i dont use cpp and idk if the libs im using even work with cpp

worthy sun
#

but i thought it was specific to namespaces for some reason

#

bc i have all my global variables in namespaces

#

using extern like that is the same thing but works in c

#

glad i could help btw i have too much free time u can @ me if u need more help

#

im not doing anything

fluid temple
#

after further testing, all now works and the ball moves using trigonometry now

native spruce
#

@woven mesa

#

is this robust enough

#
let source = basePath?.managers[indexPath.row]
cell.textLabel?.text = source?.name```


seems to be
ionic lake
woven mesa
woven mesa
native spruce
#

awesome

woven mesa
native spruce
#

I have to fixup my previous code cos its so messy I dont even know what I was doing back then

median root
#

yo ok ik i asked a question similar to this earlier but i really dont get it. I want to be able to find an image in a message and send it using the sendMessage or some other kind of function that allows me to spesify channel ID

#

prolly a dumb question but i do need help

final night
#
.ytp-caption-window-container > * {
  background-color: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(32px) !important;
  width: fit-content !important;
  padding: 0.25rem;
  border-radius: 0.5rem;
}
.ytp-caption-segment { background: transparent !important; }

youtube glass subtitle css

rough moth
#

hey yall,
i'm trying to create a plugin, that makes a new text label near the username (pic attached)

#

everything i've got so far is this (with react components)

            return (0,
            a.jsx)(s.default, {
                guildId: n.guild_id,
                message: t,
                channel: n,
                repliedMessage: E,
                author: p,
                compact: i,
                subscribeToGroupId: r,
                showTimestampOnHover: !o && i && t.type !== c.MessageTypes.REPLY,
                renderPopout: u.default,
                showAvatarPopout: h,
                showUsernamePopout: f,
                onClickAvatar: _,
                onClickUsername: S,
                onContextMenu: g,
                onPopoutRequestClose: T,
                roleIcon: C
            })

any ideas on how to determine that exact item inside the UI and create a new text label to the right?

royal nymph
#

look at how PlatformIndicators adds icons

rough moth
#

i love you

rough moth
#

took me awhile to add it to plugin list

magic shale
rough moth
magic shale
#

I don’t understand what your adding to the plugin list

magic shale
#

Then why are you messing with the plugin list

rough moth
#

..because i had to run pnpm build and pnpm inject after i made the code?

magic shale
#

How is that related

#

I’m asking why your plugin has to mess with the plugin list

rough moth
#

it doesn't have to mess with it?

rough moth
#

before i wanted to see the actual changes to the plugin

#

any ideas how to disable adding 2 icons at once in the platform indicator plugin?

#

i assume it has to do something with this

rough moth
rough moth
# rough moth i assume it has to do something with this

figured it out myself, this line was responsible for adding >2 icons to the user's badge list, if the user is using >2 devices at the same time:

const icons = Object.entries(status).map(([platform, status]) => (
    <PlatformIcon
        key={platform}
        platform={platform as Platform}
        status={status}
        small={small}
    />
));
#

changed it to const [platform, platformStatus] = Object.entries(status)[0];

rough moth
magic shale
#

you have to patch it

rough moth
#

exactly

rough moth
rough moth
serene elk
#

what do you understand about it

#

and what do you not

rough moth
serene elk
#

correct

rough moth
serene elk
#

you are trying to patch a component

rough moth
#

yes

serene elk
#

somewhere in the discord minified code it's creating that

#

you have to find where

rough moth
#

exactly

#

even though with pausing the debugger i can't find it

serene elk
#

use the react devtools, select it, and click the source button to jump to where that component is located

#

you might have to look for components above the one you are selecting

#

try a little bit more

rough moth
#

found it

serene elk
#

nono

#

that is the normal inspect element

#

you need to use the react devtools

rough moth
#

pardon

#

that will take some time

#

this was selected btw

rough moth
#

or this one

serene elk
#

the bigger one

rough moth
ocean hatch
rough moth
ocean hatch
#

real time update, for ui changes prob u should ctrl+r in discord

rough moth
ember hound
mellow phoenix
ember hound
#

just injected vencord

still jolt
#

okay?

winged mantle
#

how do you decompile javascript

still jolt
#

discord app has native parts

royal nymph
#

you cannot decompile that lol

winged mantle
#

if you can decompile super mario 64

#

Β―_(ツ)_/Β―

frosty obsidian
#

i don't think you can

#

you can reverse engineer

finite isle
winged mantle
#

explain

#

the term people generally use is "decompile"

still jolt
finite isle
#

i mean "thats not how it works" in the sense that bc they did that doesnt mean you can decompile native parts of the discord app like that

normal totem
#

but you'd have to p much hate urself cuz reversing native node modules sucks so much...

surreal condor
normal totem
#

might've seen my mom more than x64dbg tho

surreal condor
finite isle
#

i love when u can tell code was written out of anger

#
    private boolean isMojangStupid(GrimPlayer player, WrapperPlayClientPlayerFlying flying) {
        double threshold = player.getMovementThreshold();
        // Don't check duplicate 1.17 packets (Why would you do this mojang?)
        // Don't check rotation since it changes between these packets, with the second being irrelevant.
        //
        // removed a large rant, but I'm keeping this out of context insult below
        // EVEN A BUNCH OF MONKEYS ON A TYPEWRITER COULDNT WRITE WORSE NETCODE THAN MOJANG
still jolt
#

it's true though

solid gazelle
#

found how to get sorted guild list so leaving it here in case someone searches for it in the future

Vencord.Webpack.findByProps("getGuildFolders").getGuildFolders().map(e=>e.guildIds).flat().map(id=>Vencord.Webpack.Common.GuildStore.getGuild(id).name)
normal totem
# surreal condor i was joking but actually since you have exp why does reversing native node modu...

tons of atomic operations for thread safety that add a ton of noise for re, lots of subs that consist of 5 jmps until it gets to the actual sub, and a bunch of other stuff
i haven't written any napi modules yet but looking at it in ida it seems like a ton of macro abuse, it's not impossible to re or anything, and it helps that it's open source (not only can u guide urself with the source but also make TIL/FLIRT files), but its just not fun i guess, specially when it hits you with something like this

ocean vine
#

oh i love inline vector assembly in my pseudocode

long badger
#

Hey! Can someone tell me which code of Vencord handles patching for browsers?

royal nymph
#

browser/

long sparrow
#

is there a profile picture cycle plugin thing

#

that like cycles through a pfp folder with an intervall or something

final night
long sparrow
#

selfbotting?

#

ig thats something against tos

glass dirge
#

Very

median root
#

quick question whats a personal connection id?

royal nymph
#

staff thing

#

ignore

median root
#

k...

royal nymph
median root
#

why dont i wanna click on that url

#

also thanks btw

#

oooh is that a thing that just links a discord staff acc to a discord personal acc?

whole cove
royal nymph
#

may i introduce you to .flatMap(...)

solid gazelle
final night
jade stone
#

i might be stupid but why could d[e.folderNode.id] be undefined if i am checking for it in the if statement
is the linter just being stupid

grand garnet
grand garnet
#

danke

stoic helm
#

d[e.folderNode.id]!.type

jade stone
stoic helm
#

ofc

slender axle
#

was wondering, what provides the quick css editor? is it a custom thing? I noticed it looks and behaves similar to vscode

grand garnet
slender axle
#

oh it's a microsoft thing that explains why it's so similar lol, thanks

royal nymph
#

The Monaco Editor is the fully featured code editor from VS Code. Check out the VS Code docs to see some of the supported features.

slender axle
#

wait, it just straight up is

#

that's wild

mellow phoenix
royal nymph
#

is your dns server blocking stuff with sex in the name lmaoo

mellow phoenix
#

I can enter it with a vpn tho

grand garnet
#

no sex allowed

blazing haven
#

which basically includes every non "normie" tld lol

#

nvm i looked into it and .sex is one of the few gtlds NOT on that filterlist

still jolt
#

is .xyz there

#

or .futbol

finite isle
still jolt
#

wtf

blazing haven
#

doesnt seem to be on that one (which is the one i referenced)

#

but as with everything there are a million "most abused tlds" filter lists

#

or lists that accomplish something similar with a different name

blazing haven
#

IS_MOSTLY_FEMALE

#

LOL

#

latest version released: 2015-02-03

#

was guessing 1995

#

php turns 30 in exactly 1 year

winged mantle
#

😭

still jolt
#

Penistone

#

Scunthorpe

mellow phoenix
buoyant trellis
#

also why are countries there

tight fern
spring pilot
#

Ah yes, Germany, my favorite gender

austere heath
still jolt
#

I HATE GIT

grand garnet
#

I like gitkraken for this purpose to see the tree structure before pull

long stream
finite isle
still jolt
torn seal
#

anyone tried NuxtJS? Is it any good?

magic shale
#

tbf im not a fan of vue

#

i use nextjs the most

torn seal
#

i kinda dislike react

final night
#

I have made so many projects with nuxt and it's stupid easy

#

Vue >>> React imo

torn seal
#

I don't know whether I should use Nuxt.js or Next.js for a bigger project to increase my portfolio

#

I don't know what companies usually go for, zzz

royal nymph
#

i mean react is "king"

ionic lake
final night
winged mantle
#

it's good to go with something with a good community and ecosystem.

#

why do you think people still use windows? xD

spring pilot
calm ruin
warped thistle
#

do you guys know what the css identifier would be for any labels that show up when you hover over something?

#

like this, but not for just servers, i would like to capture any similar labels if it's possible

drifting cloak
#

[class*=tooltipPrimary_]

warped thistle
cerulean plover
#

yeah gimp sucks but adobe propietary nightmare

buoyant trellis
#

with latest adobe tos change not supporting it is also an advantage

long stream
#

Honestly prob one of the worst decision to use it

cerulean plover
#

sorry for your loss

blazing haven
#

linux has 🐧

#

cute mascot > no mascot

long stream
#

Windows had windows_loading

winged mantle
#

oh ogd

#

there was something i hated about that gif

#

animation i mean

buoyant trellis
torn seal
#

nvm

#

it doesnt anymore

#

it uses vanguard now

finite isle
finite isle
buoyant trellis
#

Currently i have contact with my friends only on weekends because on the rest of a week they play lol 24/7 and yell too much for me to be able to sit on vc

#

Idk if i should be happy or sad about vanguard

upper pelican
median root
#

Yo can you get third party plugins to work on the weba pp?

#

I wanna try getting some to work on vendroid

still jolt
#

I think you could try? not entirely sure

#

it had to build somehow

nimble bone
median root
#

god that seems so easy yet why do i know its not

still jolt
#

because it is

median root
#

also theres no browser.js file theres just a folder named browser with eerything in there

quick crow
#
wikiHow

Our eyes are two of our most precious possessions β€” yet, all too easily, we take good eyesight for granted. If you want to have better vision or to keep what you already have, you have to make the effort. Some things you can do include...

median root
#

Yeah I just started to use my eyes

#

Figured it out

#

I'm a dumah

#

Fr shouldn't have the dev build

median root
#

the code for browser.js looks like its made by a young me

royal nymph
#

what

#

you don't edit the minified & bundled output

#

edit source code then build

median root
#

yeah after this im never developing for mobile if i can

median root
#

huh

#

alr lemme go se ehow im being stupid this time

sharp minnow
#

I'm using the IndexedDB API to store metrics, according to the (Mozilla) docs the store can be evicted at any time, can I sync this to disk, backup, or something? Or should I just offload the data-storage to an external service entirely instead?

magic shale
#

its perfectly fine, the data will stay unless the user gets rid of it

winged mantle
#

with the DOM api i think IndexedDB is the closest you are going to get to storing stuff on disk unless you also use electron ipc?

royal nymph
#

it's not gonna be deleted

#

only if the user hasn't used your site in ages or if they delete it

#

you should not store mission critical data there, but you shouldn't store that anywhere where the user can delete it xd

torn seal
ionic lake
#

looks good

blazing haven
#

interesting

frosty obsidian
median root
royal nymph
#

what

median root
#

still tryna figure out how to build the browser.js 😭 πŸ’€

#

i feel like dumb

royal nymph
#

run pnpm run, or look at scripts inside package.json to see the available scripts you can run

median root
#

Auugh fine I'll stop lazing around on tiktok lol thanks for the info

#

so ive basically gotta run the buildbrowser

#

well that looked like it worked

#

omg yes thank you so much

golden narwhal
magic shale
#

it would look way better imo

torn seal
#

Not a huge deal to me

rotund falcon
#

What's the most robust way to grab onChunksLoaded for patching in WebpackGrabber? WEBPACK_GRABBER.require.O does interactively exist on the page I'm testing; should I hook that while defining WEBPACK_GRABBER?

#

hooking via Object.defineProperty(this, "O", {configurable: true, set(onChunksLoaded) { … }) after defining unsafeWindow.WEBPACK_GRABBER seems to work.

rotund falcon
serene elk
#

what are you trying to do?

rotund falcon
#

set up module patching for arbitrary sites using Webpack using a userscript

pearl stagBOT
rotund falcon
#

(this is meant for Firefox with FireMonkey. you should be able to run this in Chrome or with other userscript loaders by defining your own const cloneInto = (value, scope, options) => value; and maybe unsafeWindow = window;.)

#

if you have access, the exact thing i'm testing on is Datto RMM.

#

but the problems i'm having should be pretty generic to Webpack 5

#

i'm also noticing that WEBPACK_GRABBER.entryPoint is undefined; haven't properly debugged that yet

#

ooh, just tested under Discord and "Patched initialize app callback invoked, initializing our internal references to WebpackRequire and running beforeInitListeners" does get hit there under discord_app, where it doesn't under rmm_fe.

#

WEBPACK_GRABBER.entryPoint is still undefined under Discord though.

serene elk
#

the most you can do with onChunksLoaded is grab this, which is the webpack require

#

and monkey patch the init function to run what you want before initing

#

I have something which can help you understand some of the properties there

#

however I need to say it is quite hard (if not impossible to know which name webpackChunkdiscord_app will have

#

it's possible to know, but probably not as early as you need to

#

I could be wrong but I don't think Datto RMM webpack contains onChunksLoaded

serene elk
#

discord has onChunksLoaded, and not entryPoint

#

a generic module patching is very complicated, maybe doable, but likely not using .push

#

but instead proxying __webpack_require__.m

#

however it's still mainly tied to discord, so a more generic version would be even harder

rotund falcon
# serene elk I could be wrong but I don't think Datto RMM webpack contains onChunksLoaded

i'm pretty sure it does. from the debugger source map, only place that mentions webpackChunkrmm_fe,

        installedChunks[chunkId] = 0;
    }
    return __webpack_require__.O(result);
}

var chunkLoadingGlobal = self["webpackChunkrmm_fe"] = self["webpackChunkrmm_fe"] || [];
chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));

which matches withOnChunkLoad ? `return ${RuntimeGlobals.onChunksLoaded}(result);` : "" in JsonpChunkLoadingRuntimeModule.js. onChunksLoaded should be WEBPACK_GRABBER.O.

serene elk
#

right

#

that script wasn't loaded for me

#

maybe because I wasn't logged in

rotund falcon
#

yeah, sorry for the inconvenience there

serene elk
#

but yeah the other things I mentioned still apply

#

you could easily hardcode webpackChunkrmm_fe and patch .push

#

but making it generic for any website isn't doable that way

blazing haven
#

is there a way to find out which guild (or even channel) a webhook belongs to if all i have is the webhook url?

#

(NVM)

median root
#

yo is there any way yalls recomend for testing mobile apps? as in is it easier to start an android studio emulator or to just download it on my phone?

dusty moth
#

you can put ADB in persistent-wireless mode to avoid disconnection

median root
#

also how the hell do i right click. on discord web mobile 😭

#

i cant open message ctx whch makes hlf my plugins useless lol

buoyant trellis
#

Long press

median root
#

nah its discord web mobile

#

so all that does is highligt text

royal nymph
nimble bone
#

nice

median root
#

the second one with quote and save etc is from right clicking the message

#

the one with less stuff is from using the 3 dots

quick crow
#

How does that even

median root
viscid grove
#

Seems like the things from vencord plugins don't get added to the ... one

median root
#

cuz i dont see a diffrence in the menus

#

or why they would be diffrent

wicked stump
#

fairly late but I feel like you probably want this plugin enabled @median root

median root
#

i dont think thats it cuz it just removes the 3 dots icon, i dont think it changes the right click function?

#

wait what how did that fix it

#

well thank you

final night
#

In programming people often site "performance" when arguing against early returns

But I don't see how using early returns hurts preformance.

If anything, needing to store an out value

function letterGrade(score) {
  let grade = 'F' 
  if (score >= 90) grade = 'A' 
  else if (score >= 80) grade = 'B' 
  else if (score >= 70) grade = 'C' 
  else if (score >= 60) grade = 'D' 
  return grade
}

Costs more memory and cycles than returning as soon as possible?

function letterGrade(score) {
  if (score >= 90) return 'A' 
  if (score >= 80) return 'B' 
  if (score >= 70) return 'C' 
  if (score >= 60) return 'D' 
  return 'F' 
}
#

Also early returns are just way cleaner?

royal nymph
#

don't micro optimise

#

write code to be as clean and maintainable as possible

surreal condor
#

expect the compiler to rewrite your code anyway lol

#

oh this is js nvm

final night
surreal condor
#

oh ok

#

it might have less impact on compiled languages where the compiler is allowed to take 7200 years to optimize you

#

but yes i think early returns good :3

final night
surreal condor
#

Mrw = mreow?

#

/j

final night
#

Mreow

ocean vine
#

there are probably more things that are unoptimized in your code that requires change ratehr than nitpicking those small thingies that dont really make a change

#

and if you were to really hyperoptimize things you would probably end up branchless

royal nymph
#

hyper optimise

const grades = ["F", "F", "F", "F", "F", "F", "D", "C", "B", "A", "A"];
function letterGrade(score) {
  return grades[score / 10 | 0];
}
crimson sparrow
#

| 0 is my favourite thing from JS

#

I want it in every language

frosty obsidian
#

unless you're writing something that needs to be incredibly performant, you don't need to worry about the little things

#

you're not writing a 3d graphics engine

ocean vine
#

well in a shader thats where you would probably try to be as branchless as possible

#

tho even there it is somewhat acceptable "sometimes"

royal nymph
# royal nymph hyper optimise ```js const grades = ["F", "F", "F", "F", "F", "F", "D", "C", "B"...

ultra optimise

const grades = [
  "F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
  "F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
  "F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
  "F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
  "F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
  "F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
  "D", "D", "D", "D", "D", "D", "D", "D", "D", "D",
  "C", "C", "C", "C", "C", "C", "C", "C", "C", "C",
  "B", "B", "B", "B", "B", "B", "B", "B", "B", "B",
  "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A"
];
function letterGrade(score) {
  return grades[score];
}
stoic helm
#

u dont need the array

#

just get at string index

royal nymph
#

slower

#

probably

stoic helm
#

really?

ocean vine
#

or whatever a division is

#

probably optimised eitehr way

royal nymph
#

oh now

stoic helm
quick crow
ocean vine
#

you had to copy the whole string

#

thats too much,,,

royal nymph
#

have to stringify number

quick crow
#

Fine

function letterGrade(score) {
  return "guess";
}
jaunty crane
#

i'm assuming that for chromium based browsers headless is the only way that you can debug a browser and execute arbitrary javascript code
which does not allow you to set your user data directory for obvious reasons.
Somehow, is it possible to use some sort of sorcery / workaround to do the same yet allowing users to keep their user data while having arbitrary javascript
browsers are sandboxed so I'm assuming this is impossible or near impossible to do but uh

#

idk

finite isle
#

?

jaunty crane
#

execute aribitray javascript to get data from site w/ keeping user data

#

in short

#

how to

royal nymph
#

define keeping user data

#

do you want it to be unchanged? or do you want your automation to use the user's data

ionic lake
#

yeah I guess that's what they meant, using the user's profile

runic sundial
#

i dont do java script

#

but the uppercase ASCII characters happen to be close to one another

#

And I would assume that one less-than check branch for the F

#

and an addition and cast into a char is faster

#

than an array lookup

#

Since this array will also have bounds checking

jaunty crane
# royal nymph define keeping user data

you can't specify user-data-dir along with headless
Headless chrome i believe is essentially like a kind of guest window that can be manipulated.
I want it to be more convenient for users and those less knowledgeable to keep say for example being logged in on a specific site, having their extensions kept, bookmarks, etc

jaunty crane
#

whatr

royal nymph
#
await puppeteer.launch({
  userDataDir: './myUserDataDir',
})
#

for example with puppeteer

#

chromium takes a cli argument for user data dir

still jolt
#

gotta love tryna push something to codeburger

debug1: kex_exchange_identification: banner line 0: Exceeded MaxStartups
kex_exchange_identification: Connection closed by remote host
Connection closed by 217.197.91.145 port 22

in fact

$ nc 217.197.91.145 22
Exceeded MaxStartups
jaunty crane
#

ill test tho

#

oh nvm

green gulch
#

uh

still jolt
#

uh

ember hound
#

discord sucks we should chat using netcat

#

or just paper

finite isle
#

uh

frosty obsidian
#

do not

formal belfry
#

i shall

still jolt
#

you....shall not ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

thorny ingot
#

idk shit about webdev but how the fuck do i fix this

#

button script: ```---
import Button from "../components/navbutton.svelte"

<section id="Friends">
<h2>Friends Sites!</h2>
<div>
<form action="https://google.com">
<Button class="buttonimg">
<img class="buttonimg" title="test" src="/public/vee.png">
</Button>
</form>
</a>
</div>
</section>```

#

button css } .buttonimg { width: 50%; border-radius: 50%; }

#

i dont understand why the button size/radius is not matching the image size/radius

#

im really dum

grand garnet
#

your Button is half the width of its parent container, and then your img is half the width of Button

thorny ingot
#

how would i fix that

#

use pixels instead?

jaunty crane
thorny ingot
#

i think i got it

jaunty crane
#

TAX

#

????

thorny ingot
#

is it because i put it in a body

formal belfry
#

Who should I contact to pester about https://github.com/Vendicated/Vencord/commits/main/src/plugins/spotifyControls ?
Would it cause any issues for the Spotify Album IMG CSS declaration to be placed in ::root or whatever? I really would like to be able to replace certain elements with the cover image. Let's say the BG. I was able to do it, but I REALLY don't like the way I did it. Because the declaration is in the Spotify Control element, you can't use the declaration for anything before it. I got around this by using ::AFTER and setting a z-index for every single element, which kinda gives me the heebie jeebies.

GitHub

The cutest Discord client mod. Contribute to Vendicated/Vencord development by creating an account on GitHub.

jaunty crane
#

????

formal belfry
royal nymph
#
royal nymph
#

hmmm i wanted to use a database to also store bot state. but i basically just need one single object, not an entire table

is there any good way to do that or should i just use a json file

#

i kinda hate the idea of writing a manual json file

wicked stump
#

do not the json value

#

storing state in a json files is a good way to corrupt your state when reading or writing it if you have any sort of parallel process and don't write concurrency safe code

#

nvm you're vee you're smart enough

#

new pfp I didn't recognize i thought you were someone who didn't know better

#

carry on I don't care about your json file venniecozycat

dusty elm
#

any actual good extensions on vscode for making a discord bot with discord.py, i feel stupid that i can't find anything that is good
something that shows module's attributes properly
do note i could just be stupit

dusty elm
#

or at least, trying to

#

starboard bot that stores guild information that it's gonna use

dusty elm
ionic lake
#

I use prisma for my bot currently but drizzle-orm works well too and without any build steps

#

if you just want to store single kvs, use unstorage

ember hound
#

if yall want to talk just contribute to vencord during lockdown

surreal condor
dusty elm
#

i don't know what else you said means but i will learn!!!!

royal nymph
#

but making a table in my DB would also feel wrong

#

sql was really not made for storing one off values

#

i really wonder what's a good way to store state like that

ocean vine
#

regedit /j

#

well /hj

trail night
royal nymph
#

yeah it seems cool

#

i added it tovenbot

trail night
#

i love it

#

kysely or drizzleorm and i will be satisfied

#

both my favourite

royal nymph
#

but its ready to be used

#

xd

pearl stagBOT
trail night
#

nom

#

yeah kysley is good if you wanna write sql safely

#

drizzleorm is best if you want to work with objects, genuinely the dev experience blows everything else out of the water for me

#

cuz drizzle is written like a query builder but is a proper orm, and has an opt-in query api that makes it a bit easier to write certain repetitive things

royal nymph
#

drizzle looks very cool too

#

maybe i'll switch

#

tbh i didnt know what to choose

#

i looked at a few and chose what seemed the best

#

i mainly didnt want shit like typeorm

#

used it in the past and didnt like it that mcuh

trail night
#

i have also used typeorm and it was quite mediocre

blazing haven
#

what abt sequelize

trail night
#

really dont like it in comparison

#

syntax is very terse

royal nymph
#

now that venbot has persistence i can finally do this

trail night
#

yay

royal nymph
#

just dont set it to 0ms

#

or explosion occurs

#

ve Commands.sticky.execute.toString()

elder yarrowBOT
# royal nymph ve Commands.sticky.execute.toString()

execute(msg2, operation, value, ...extra) {
    let response;
    switch (operation?.toLowerCase()) {
      case "on":
        BotState.sticky.enabled = true;
        response = "Sticky message enabled!";
        createStickyMessage();
        break;
      case "off":
        BotState.sticky.enabled = false;
        response = "Sticky message disabled!";
        deleteStickyMessage();
        break;
      case "delay":
        const delay = Number(value) * 1e3;
        if (isNaN(delay)) {
          response = "Invalid delay value!";
        } else {
          BotState.sticky.delayMs = delay;
          BotState.sticky.enabled = true;
          response = `​Sticky message delay set to ${delay}ms`​;
          initStickyDebouncer();
        }
        break;
      case "set":
        BotState.sticky.message = [value, ...extra].join(" ");
        BotState.sticky.enabled = true;
        response = "Sticky message set!";
        break;
      default:
        return silently(msg2.createReaction(Emoji.QuestionMark));
    }
    return reply(msg2, response);
  }```
royal nymph
#

also this is kinda cursed

#

but ig cant really make it better

naive condor
#

am i muted

#

weird

ionic lake
#

⚠️ I'm a trained professional please do not use sequelize ⚠️

#

it's so bad

ionic lake
blazing haven
#

i was just throwing yet another one in the mix

#

what's making it so horrible

ionic lake
#

horrible typescript support, lackluster performance, weird/bad joins api and can be said for everything if you do anything complex

thorny ingot
#

do i have to define constants for astro in the import function, or can i do something like this?

royal nymph
#

that should work

terse hollow
#

I whant to learn how to program, where i need to start (javascript)

frail turtle
ocean vine
#

πŸ‘πŸ» learn πŸ‘πŸ» by πŸ‘πŸ» doing πŸ‘πŸ»

ocean vine
#

just do the thing you wanna do step by step lookup google

terse hollow
ocean vine
#

in said language

#

youve mentioned javascript

#

lookup it on google rq how to start or whatever and there you go

terse hollow
#

Ok i will try, thanks for your time :)

gritty ivy
thick latch
#

well they arent lying. that vencord is broken

alpine marten
#

vencord broke?

magic shale
#

no way

alpine marten
worldly pumice
#

is there any documentation changes due to the vencord apocalypse

mellow phoenix
worldly pumice
#

but lemme check

royal nymph
#

AHAHAHAHHA im reverse engineering the deepl private API rn and they have such weird security by obscurity

#

actually the iCount doesnt seem necessary

#

but the fucking spaces

#

hmm the rate limit is too strict

thick latch
#

whats the new avatar class? tried to extract it myself with ctrl + shift + c, but using it seems to not work (.avatar__ec86aa.clickable__ec86aa)

royal nymph
thick latch
#

πŸ‘

calm ruin
#

but doesnt deepl web also has ratelimits

green gulch
#

learning ruby and rails

blazing haven
green gulch
#

thats what i meant

final night
green gulch
#

yeah im trying to learn ruby, rails and get better at react

sharp basin
#

unbased

#

react>

green gulch
#

react good

wicked hearth
#

can i somehow import custom plugins, instead only of already built in ones?

#

(ping me when responding because i will forget)

sharp basin
wicked hearth
#

oh

#

is it hard?

sharp basin
#

if you know programming, no - if you can't follow instructions, yes

blazing haven
finite isle
sharp basin
#

meh

#

learned to love react

royal nymph
#

omg state management for slash commands is hard

#

i want a message context menu commands that then sends a select menu and once you choose in the select, it does something new

#

you have to somehow pass the state around

sharp basin
#

i had stupid issues deleting slash commands with message tags

#

since it’s somehow cached until you restart

languid tide
#

i wish some bot actually used that idea

royal nymph
#

well venbot will now

#

for support stuff

#

i just wish i could use a modal instead of a follow up message

finite isle
ivory heath
final night
#

πŸ«ƒ

finite turtle
royal nymph
#

@trail night wait why do people define schemas via code in kysely? it seems way comfier to write a sql file and then use the codegen module

final night
#

I have never written a SQL query by hand

#

Immensely horrified of SQL despite my work being technically based on it

magic shale
#

im obsessed with prisma so i dont have to touch sql queries usually

viscid grove
#

sql is weird

#

i took a class on it once

#

it probably would've been better if the professor didn't have us using ancient programs for it

magic shale
#

i was in some coding club as a child that advertised as making minecraft mods and it was just java

#

and we used eclipse

viscid grove
#

child as in what age?

magic shale
#

like 10 or 11 prob

viscid grove
#

wow

magic shale
#

everyone else had no clue what they were doing and i made a calculator faster than all of them

viscid grove
#

what kind of calculator?

magic shale
#

num 1:
operator:
num 2:

viscid grove
#

like you made a mod that had a command to use a calculator thing?

magic shale
#

no literally just java

#

we didnt make a single minecraft mod

viscid grove
#

oh

#

so like a calculator in console ig?

magic shale
#

yep

viscid grove
#

ah

royal nymph
#

hmmmm...

i want to store modmail channel ids in my database and have only one modmail per user, but i have two options that both suck:

  • select for existing modmail, if nothing returned, create channel and insert. has potential for race condition
  • insert immediately with empty channel id and onConflict handler, then create channel on demand and update to add the channel id
#

i wish there was a cleaner option than these two

#

so cursed

royal nymph
#

oh god turns out returning doesnt work with do nothing

wicked stump
#

(bad idea on code that needs to be performant/frequent write but fine for low traffic stuff like single server modmail)

royal nymph
#

updating an unrelated row to itself

wicked stump
#

bad

royal nymph
#

there's basically no better way

#

other than...

#

??????????????

#

updating random row to itself is cleaner than whatever tf that is

#

and def better than two queries

wicked stump
#

that is horrific

#

what in the world

wicked stump
#

i guess if it works

royal nymph
wicked stump
#

smh you aren't using a transaction at all

royal nymph
#

why would i

wicked stump
#

my comments are mostly in jest, in case that didn't come across

#

but you'd use a transaction between the row insert and row update with the thread ID in case creation of the thread failed for some reason

royal nymph
#

true

#

i should do that

#

i mean its not that big of a deal

wicked stump
#

yeah it's not huge for something this small

royal nymph
#

it just has potential for a few wasted bytes

wicked stump
#

but it'd be something that'd have to be manually fixed if discord ever has a partial outage (very likely)

royal nymph
#

nah

wicked stump
royal nymph
#

nop

#

since it'll still have channelId 0 in db

wicked stump
#

but it's the user id that has the uniquye constraint

royal nymph
#

yes

wicked stump
#

oh yes

#

I see

pearl stagBOT
# royal nymph https://codeberg.org/vee/bot/src/branch/main/src/modules/modmail.ts#L71-L99

modmail.ts: Lines 71-99

const { channelId, id } = await db.insertInto("modMail")
    .values({
        channelId: "0",
        userId: interaction.user.id
    })
    .onConflict(oc => oc
        .column("userId")
        .doUpdateSet({ id: eb => eb.ref("excluded.id") })
    )
    .returning(["channelId", "id"])
    .executeTakeFirstOrThrow();

if (channelId !== "0") {
    return interaction.createFollowup({
        content: `You already have a modmail ticket open: <#${channelId}>`,
        flags: MessageFlags.EPHEMERAL
    });
}

const thread = await getThreadParent().startThreadWithoutMessage({
    type: ChannelTypes.PRIVATE_THREAD,
    name: `${id}`,
    invitable: false
});

await db.updateTable("modMail")
    .set("channelId", thread.id)
    .where("id", "=", id)
    .execute();
royal nymph
#

that's the conflict i tried to return the old value from

wicked stump
#

mhm

#

I was typing faster than my mind was moving

royal nymph
#

oh god `${id}` my hatred

#

i had it as modmail-${id} but decided that looks worse than just having the number

wicked stump
#

doesn't that open up a possible race condition
user clicks button > row inserted successfully > start to send API request to create thread
user clicks button again > row conflict but channel id still = 0 > send API request to create thread
first API request resolves and updates row
second API request resolves and updates row again

#

(it entirely wasn't my intention to analyze this so much it kinda just nerd sniped me, don't take it like I think your code is bad or anything ;w;)

royal nymph
#

yeah kinda

#

but it's not really that important

#

it won't happen unless you're deliberately causing it by sending manual request

#

and even if you do that, it has very little significance

like... you have two modmail channels now, congrats

wicked stump
#

mhm

royal nymph
#

well i should just use a transaction

#

i mainly didn't cause i was unsure how sqlite handles transactions

like if my transaction takes 1 second, will it lock the DB for that long?

wicked stump
#

it depends how you have your locks set up, but it'll only lock writes and other lock transactions on that table for that long if you lock only the table

#

selects will still work fine

royal nymph
pearl stagBOT
# royal nymph also here's another ugly https://codeberg.org/vee/bot/src/branch/main/src/module...

modmail.ts: Lines 221-235

const res = await db.selectFrom("modMail")
    .where("channelId", "=", interaction.channel.id)
    .select(["userId", "id"])
    .executeTakeFirst();
if (!res) return;

if (!interaction.member.permissions.has("MANAGE_CHANNELS") && res.userId !== interaction.user.id)
    return;

await interaction.defer(MessageFlags.EPHEMERAL);

await interaction.channel.edit({ archived: true });
await db.deleteFrom("modMail")
    .where("id", "=", res.id)
    .execute();
wicked stump
#

It might be worth noting that the locks in sqlite apply to the whole database and not just individual tables, unlike the LOCK TABLE statement in other sql databases.

#

wow I dislike sqlite even more now content

#

but if modmail is the only table in the db then eh i guess

royal nymph
#

i don't think a transaction necessarily locks?

wicked stump
#

it doesn't no

#

I had interpreted your question as planning to use locks since you asked about them though

royal nymph
#

naah

#

i was just concerned that transactions might be blocking

royal nymph
wicked stump
#

mhm that one is fine

#

reading on it more, locking how I wanted to with sqlite seems not possible anyways

#

I'm too used to postgres and the database i work on at work

royal nymph
#

wait does my id row update cause id skips

#

lmaooo

#

AHAHAHA it does

#

omg

jade stone
trail night
#

depends on which side of the fence youre on

#

if youre an ORM person you would define it in code and generate sql migrations

#

otherwise you can do it manually like you are doing

trail night
mellow phoenix
winged mantle
mellow phoenix
ionic lake
ionic lake
royal nymph
#

yeah

#

thats what i did

#

but it's ugly asf

#

and what if u need to pass more state than just an id

you'd have to store it in some map by id and then risk memory leaks

#

what's the custom id limit

#

can you just put json in it

atomic brook
ionic lake
#

gonna port solid reactivity to discord state brb

magic shale
#

why does this happen when i make a branch based off vencord:dev

#

instead of This branch is up-to-date with Vendicated/Vencord:dev

grand garnet
#

Because github compares to the default branch, which in this case is main

magic shale
#

it did it the other way before 😭

ionic lake
#

because the main branch is set default

ionic lake
magic shale
#

url params would be most character efficient if you only have 100 chars

royal nymph
#

protobuf your data > base64 > huffman encode to compress

#

profit

languid tide
#

πŸͺ…

#

:piΓ±ata

#

french 😭

royal nymph
#

fym french

#

it's a mexican thing

languid tide
#

Γ±

royal nymph
#

hmmm would it be better to store type or use separate tables for stickers and emojis

frozen pendant
#

Not sure how relevant but would anyone know if there's a way to navigate channels/send messages from the console of the offical webclient?

royal nymph
#
Vencord.Util.sendMessage(channelId, { content: "hi" })
frozen pendant
#

I mean like, the regular webclient, sorry

royal nymph
#
Vencord.Webpack.Common.NavigationRouter.transitionTo("/channels/GUILD_ID_OR_@me_FOR_DMS/CHANNEL_ID")
royal nymph
#

you can use vencord on web

frozen pendant
#

my 'webclient' is actually just electron with extra steps -w-"

#

i looked in the past and it seemed infeasible to get vencord to load

royal nymph
#

why not

frosty obsidian
#

is that not what vesktop is

royal nymph
#

you can eval the browser bundle & css

#

works

#

but you'll have a shitty experience

frozen pendant
#

Oh?

#

i thought it needed to be preload

royal nymph
#

if you're actually using electron, you can eval vencord's main, preload & renderer scripts

#

that's what vesktop does

frozen pendant
#

ah

royal nymph
#

but for minimal vencord, you just need to add this css and eval this js from preload (before discord loads)

#

but it's your responsibility to keep it updated then

frozen pendant
#

My setup basically has a bunch of webviews

#

i'll try it out

frosty obsidian
#

just peep the vesktop source

royal nymph
frozen pendant
#

yeah i should have expected that shouldnt i

#

Hm. it's clearly doing something but i don't actually see any changes.

#

i do see dom entries

royal nymph
#

it needs to be injected before even the dom loads

frozen pendant
#

hm.

#

I'm passing it as <webview preload="..."> so perhaps this won't work

royal nymph
#

what are you using webviews in

#

what framework

frozen pendant
#

Electron

royal nymph
#

why are you using webviews in electron

#

they're discouraged

#

idek why they exist

frozen pendant
#

but they don't have any useable replacements

royal nymph
#

iframe?

#

and why can you not load it as the main document anyway

frozen pendant
#

i need to be able to use the insertCss and executeJavascript functions that a webview has, as well as the partitions attribute

pearl stagBOT
thorny ingot
#

ok dumb question ik, but how do i define/redefine these constants in the first astro component in the second one?

royal nymph
#

<FButton website={...} />

#

and please don't use abbreviations like FButton

thorny ingot
#

fair

#

i am very shit at making my code readable

cinder egret
thorny ingot
royal nymph
shell crag
#

if you have to abbreviate then abbreviate the button part

royal nymph
#

don't abbreviate at all