#πŸͺ…-progaming

1 messages Β· Page 9 of 1

thorny ingot
royal nymph
#

avoid abbreviations

royal nymph
#

why do you do this to me

#

Button

cinder egret
#

i guess this would be kinda neat. one of my professors would want FriendBtn in this scenario or a similar one

thorny ingot
royal nymph
thorny ingot
#

vee will be your professor now

royal nymph
#

you should never abbreviate words in var names it's just bad (with a few exceptions)

the one main exception is that one letter is okay for lambda parameter names, like users.filter(u => u.cute)

cinder egret
frozen pendant
#

hm. my concerns with iframe are the inability to webContents.fromId and i can't see any way to use partition="persist:..." like i would have with a webview. Even worse is that the iframe doesnt' have a preload attribute or functionality at all from what i can see

royal nymph
#

what's even the greater picture

frozen pendant
#

multiple concurrent discord accounts

#

(in one app)

royal nymph
frozen pendant
#

i'll be honest my app is kinda shitty and does everything on the html side xwx

royal nymph
#
Electron's webview tag is based on Chromium's webview, which is undergoing dramatic architectural changes. This impacts the stability of webviews, including rendering, navigation, and event routing. We currently recommend to not use the webview tag and to consider alternatives, like iframe, a WebContentsView, or an architecture that avoids embedded content altogether.
frozen pendant
#

yeah.

#

though it has stayed functional since upgrading from electron 10 to 27 so, idk how unstable it is compared to what they make it out to be

thorny ingot
#

wait im a bit confused sorry, so would it be the url before the equals and then the constant website in brackets? like this?

royal nymph
#

no

thorny ingot
#

this really shouldnt be that hard im just retarded sorry

royal nymph
#

<Component propName={propValue} />

thorny ingot
#

OH OK

thorny ingot
#

i got it

royal nymph
#

yes

thorny ingot
#

thx veestie

frozen pendant
#

preload string (optional) - Specifies a script that will be loaded before other scripts run in the page. This script will always have access to node APIs no matter whether node integration is turned on or off. The value should be the absolute file path to the script. When node integration is turned off, the preload script can reintroduce Node global symbols back to the global scope. See example here.
This seems to imply that it wouldn't get vencord working either, though.

royal nymph
#

if it's a constant string, you can omit the {}

frozen pendant
#

i think this is why it's restricted to file://

#

(or paths)

royal nymph
#

you'll need a bit of ipc

#

actually you can enable node integration in your main window, assuming you load it from file url and don't run any external code

frozen pendant
#

that blob is from the WebPreferences api

#

which seems to apply to all three options

royal nymph
#

i don't really understand

#

anyway you can always just inject your own minimal webpack searcher, instead of vencord

frozen pendant
#

fair

#

webcontentsview is interesting but seems a bit more complex to control compared to dom elements

#

are there any unofficial docs for stuff like these or is it mostly 'try it and see'?

royal nymph
#

it's just reverse engineering

#

there is a lot of example code you can work with

#

like my script i linked or vencord / bd

thorny ingot
#

is there a reason why this happens when i try and put more than one of them inline?

royal nymph
#

try adding text-decoration: none; to the a

frozen pendant
#

Oh woah, i actually managed to get it to properly preload:

#

Still seems broken however

#

(discord loads endlessly)

#

actually nvm, i just had contextIsolation turned off this time

thorny ingot
#

:(

#

if this helps

#

idk if it will

royal nymph
#

and that's a style property, not a html property

#

do you even know how html / css works 😭

#

you should do a basic guide first

frozen pendant
thorny ingot
thorny ingot
#

idfk why vsc reccomends style properties in html sections

#

anyways put in my styletag, fixed it

#

ty

thorny ingot
# thorny ingot nope!

i actually do have a loose grasp on it, its just like 00:44 and my ass cannot think

alpine lily
#

STARE I missed this channel like 6 times checking up and down I'm blind lmaoooo

#
(() => {
    Vencord.Settings.Cloud.authenticated = false
    Vencord.Settings.Cloud.url = 'https://api.placeholder.dev/'
    Vencord.Settings.Cloud.settingsSync = false
console.log(Vencord.Settings.Cloud.settingsSync)
})()

so what I wanna do is just force default values through the comand line to fix auth issues, I just cant seem to set the url weirdly enough Kelly_think_FB with a string should I be doing something different?

#

it feels like it should work out fine, I'm only getting the first setting set weirdly enough

royal nymph
#
  1. it's cloud not Cloud
alpine lily
#

holy shit no wonder

formal belfry
#

guys guys guiys

#

where to find the

formal belfry
still jolt
#

the what

alpine lily
still jolt
alpine lily
#

:D

languid tide
#

meow();

sharp basin
#

meow++;

still jolt
#

++meow;

sharp basin
#

for (const meow of meows as Meow[]) meow.meow();

sharp basin
#
if (interaction.guildId) for await (const who of Object.keys(command.permissions || {}) as ("me" | "user")[]) for (const at of Object.keys(command.permissions?.[who] || {}) as ("guild" | "channel")[]) for (const permission of command.permissions?.[who]?.[at] || []) {

I love (this is actually a single line in my code)

magic shale
#

for await husk

#

Yet another thing I didn’t know js could do

winged mantle
#

async iterator

still jolt
#

and I thought I was crazy for writing 40 lines of js to verify if I can view a channel

sharp basin
#

I just did this now

#

I am not happy with it but eh

winged mantle
#

maybe use more variables & it would be less confusing

magic shale
#

Make a variable for permissions and null check it before the loop

winged mantle
#

wait why are you running callback many times when only the last result it returned

#

also why || {} instead of ?? {}

#

wait have i shown people thius yet

#

horrifying

magic shale
#

Why Record & string[] lol

winged mantle
#

basically i wanted to say that it must be indexable by CaseType

serene elk
#

by doing & string[] isnt it able to be indexable by any number?

final night
stoic helm
winged mantle
#

somehow not

#

nvm i think it just makes all CaseTypes required

#

and it's | undefined by default with my config so

#

programming crimes

frosty obsidian
#

needs more ../

winged mantle
#

it will start loading files outsied of the project

#

evil

frosty obsidian
#

good

sharp basin
winged mantle
still jolt
#

(it won't actually import but Β―_(ツ)_/Β―)

sharp basin
frosty obsidian
sharp basin
#

actual production code

opal cove
#

not sure if right channel but has anyone reversed/documented the discord video protocol?

surreal condor
#

OMG powercord users really all went here lmao

surreal condor
opal cove
#

that should help a ton thx

surreal condor
opal cove
#

we attempting to make screenshare work on linux for the 3rd time

#

(discord broke my last effort)

still jolt
#

but screenshare works on linux ​​​​​​​​​​​​​​​​​​​​​​​​​

#

so idk whwat you mean

opal cove
#

not on wayland + its really buggy

#

and no audio

#

if you're lucky it works, if you're even luckier you get window selection, but that's abt it

surreal condor
opal cove
#

that kinda works but also not optimal

#

if only discord would like, change the total of ~6 characters they need to change in their source for it to work natively

surreal condor
#

agreed

opal cove
#

i made it work natively once but now the libs have diverged so much that even patching them together is a pain

#

so i will now try to just reimplement discord voice and patch that into the client lmfao

surreal condor
#

force discord to hire you and then fox it /j

#

fix*

opal cove
#

all discord would need to do to fix this is to update the webrtc version used in the discord_voice lib

surreal condor
#

/hj

opal cove
#

discord just uses the webrtc capturer

#

which has supported wayland for like maybe over a year now

#

and they have their own lib so it doesnt depend on electron or whatever (in fact i think even the current electron webrtc would work)

#

but discord for some reason reuses to update their lib (i've heard they have near zero native devs nowadays)

#

chromium uses the same exact lib so if it works in your browser it could work on discord

surreal condor
opal cove
#

ive heard working at discord isnt the greatest experience :')

surreal condor
#

yeah no i have no idea

#

i assume you have contacts (i don’t)

opal cove
#

actually the one person i know that worked at discord says it isnt that bad

#

but the general sentiment that reaches the public is it isnt the greatest place

surreal condor
#

maybe this is why discord horribly messes up everything

frozen pendant
#

the vocal people are always going to be the angry ones

tiny harbor
#

would this be a channel where i can ask where the plugin folder for vencord is? bc im confused!

frozen pendant
#

Nobody goes out and broadcasts 'I love my job at (x company) it's so great because of [x,y,z]', if they do they just sound like a paid shill

#

(which, i mean, technically, lol

autumn sigil
#

i love elctron, electron is awesome!

ocean vine
#

you know who else is awesome

#

@worthy sun

worthy sun
#

True

opal cove
#

its the googling reviews for $x product problem

#

or why apps annoy you to review them on the app store

mellow phoenix
#

I hate discord new update

balmy lintel
#

what

#

which update

mellow phoenix
# balmy lintel which update

my tab used to be 3 days old until someone accidentally unplugged my shit laptop (battery problem), now discord randomly turns members to white name or reload when loading messages or loading any content, waiting 2m for no reason. my wifi didn't move an inch nor its speed. its me broke something or its discord cursing on me

ionic lake
#

woah advertising

#

mods ban this person

royal nymph
#

people keep arguing about trailing comma or not in js, but no one ever talks about leading comma blobcatcozy

const User = {
    id: 1
  , username: "kitty cat"
  , age: 21
}
ocean vine
#

cruel

quick crow
#

HORROR

sharp basin
#

I mean.. it works.. I guess..

#

can someone make that an eslint rule

ocean vine
#

just dont code like that

winged mantle
#

const User = {
id: 1
, username: "meow"
, age: 22
}

#

with 2 spaces it's weird

#

with 4 spaces it's less weird

#

with tabs....

autumn sigil
winged mantle
#

i only saw people use this for old c++ standards which didn't support trailing

high pulsar
#

how can fix this theme

alpine lily
#

vns

elder yarrowBOT
magic shale
#

And no comma operator cause what is that 😭

glacial mirage
#

wouldn't that make it impossible to write an object in one line

sharp basin
#

but why would you

#

I mean this is my code

grand garnet
still jolt
glacial mirage
#
const User = { id;1. username;"kitty cat". age;21 }
sharp basin
#

why not use yaml or toml in js

still jolt
still jolt
#

JavaScript Object Notation :3

sharp basin
#

json bad

still jolt
#

no

glacial mirage
#

how would you write toml in js anyways

sharp basin
#

idk

glacial mirage
#

doesnt it need to be a whole file

sharp basin
#

lmao

glacial mirage
#
const User = <User><id value="1"/><username value="kitty cat"/><age value="21"/></User>
still jolt
#

NO ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

#

GOD

#

PLEASE NO

glacial mirage
#
const User = csv`id,username,age\n1,kitty cat,21`
#

who even cares anymore

sharp basin
#

literally took me an hour to debug this

cerulean plover
ocean vine
sharp basin
#

lmao

ocean vine
#

450001000068656c6c6f206b69747479000000000000000000000

#

here is some raw binary

#

for user

#

feel free to check if you dont believe me

ocean vine
#

how do run code here

#

.lc c

#

uhh

cerulean plover
#

/run

rugged berryBOT
#

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

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

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

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

ocean vine
#

./run c++

#include <cstdint>
#include <iostream>
#include <string>
#include <cstring> // as you wish

struct User {
    int id;
    int age;
    char name[32];
};

int main() {
    User* user = new User();
    
    const char* name = "hello kitty\0";
    user->id = 69;
    user->age = 16;
    strcpy(user->name, name);
    
    for (int i = 0; i<sizeof(User); i++) {
        printf("%x", ((std::uint8_t*)user)[i]);    
    }
    delete user;
    return 0;    
}
rugged berryBOT
#

Here is your c++(10.2.0) output @ocean vine

450001000068656c6c6f206b69747479000000000000000000000```
ocean vine
royal nymph
sharp basin
#

no

#

it doesnt

#

lol

#

its not an error having a string dangling around

#

(see "use strict" or similar)

crimson cave
#

does it not warn it can return undefined

sharp basin
#

that would be an eslint rule

#

which I don't have

stoic helm
#

nuh uh

#

ts infers return types if none are specified

#

in this case string | undefined

#

add : string to the function definition

tame marsh
still jolt
#

imagine having @typescript-eslint recommended rules set up

tame marsh
still jolt
sharp basin
#

I mostly copied the vencord eslint and build uppon it, don't blame me

still jolt
#

Β―_(ツ)_/Β― ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

#

I copied some old eslint of mine

#

and threw in ts-eslint

#

that's mine Β―_(ツ)_/Β―

sharp basin
#

yeah mine is a bit longer

#

I hate that the new flat config breaks compatiblity

still jolt
#

I just ported mine manually

#

wasn't too hard

sharp basin
#

eh with like 300 rules

#

and I used vercel style guides

#

which still doesnt use the flat config

#

so I cant use it

autumn sigil
sharp basin
#

I have that too because I never remove imports myself

#

also auto import exists

#

I never type imports myself

#

like I write DataSt and hit enter or tab, depends on your IDE

still jolt
#

I automatically import but manually remove and eslint screams at me if I don't remove them lmao

sharp basin
sharp basin
#

:w

still jolt
#

yeah vscode user probably

#

I'm on sublime text :3

sharp basin
#

I use nvim

#

that’s why :w

royal nymph
#

your return type will be "string" | undefined

sharp basin
#

i never define return types

royal nymph
royal nymph
#

if you have ur types set up properly

sharp basin
#

well I just got the unused expression eslint rule which should prevent such in the future

#

I just am too lazy and hate to define return types

#

well that’s a me issue

royal nymph
#
const getCommandEventName = (i: Interaction) => 
  i.isChatInputCommand() && "CommandInteraction"
  || i.isContextMenuCommand() && "ContextInteraction"
  || i.isButton() && "ButtonInteraction"
  || i.isAnySelectMenu() && "SelectInteraction"
  || "FakeInteraction"
#

peak

sharp basin
#

lmao fake interaction

royal nymph
sharp basin
#

I had such a cursed switch statement before

royal nymph
#

wait i can improve the formatting even more

#
function getCommandEventName(i: Interaction) {
  switch (true) {
    case i.isChatInputCommand   (): return "CommandInteraction";
    case i.isContextMenuCommand (): return "ContextInteraction";
    case i.isButton             (): return "ButtonInteraction";
    case i.isAnySelectMenu      (): return "SelectInteraction";
    default: explode();
  }
}
#

peak

sharp basin
#

I was switching by interaction type and then inside of that used the type guards

#

aka the same with just 6 extra lines

sharp basin
#

or something

trail night
#

aya

trail night
#

asar stuff, i need to work it out

#

i wanna make translations work

royal nymph
#
const match = <T>(cases: Record<boolean, T>) => cases[true];

const getCommandEventName = (i: Interaction) => match({
  [i.isChatInputCommand()]: "CommandInteraction",
  [i.isContextMenuCommand()]: "ContextInteraction",
  [i.isButton()]: "ButtonInteraction",
  [i.isAnySelectMenu()]: "SelectInteraction",
})
trail night
#

weiner

crimson cave
#

i love force pushes

trail night
#

i think ive fixed it

sharp basin
royal nymph
#

wait why lmaoo

trail night
#

i think i merged it wrong

#

oh no i merged it right

#

phew

still jolt
autumn sigil
bitter fable
#

would it theoretically be possible to check whether a VC was silent (no voice activity) for a certain amount of time?

#

got an idea for a thing but i'd need to know whether or not it's even possible

trail night
#

technically

#

you could listen to the stream and see if there's 0db for a while

#

or you can find where discord shows the green rings and base it off of that code

#

(probably the same tbh)

bitter fable
#

guess i didnt look hard enough

gritty sentinel
#

where are keybinds locally stored? tryna port them over to PTB

cerulean plover
trail night
#

it just means that the same two lines have been modified extensively enough that it requires more manual intervention than github is able to offer you through the web editor

#

in this case, its because the indentation was modified in upstream and i had modified the line in my branch

#

git doesnt know how to resolve that because it works on a line-by-line basis, not a character-by-character

#

i dont know what the specific conditions are for a github complex merge but i know it can happen if files are renamed in your branch and in upstream, and you've modified the renamed file

royal nymph
#

love firefox

stoic helm
#

why do we need that

autumn sigil
viscid grove
#

huh

winged mantle
sharp basin
#

I love my old code

bitter fable
#

is there like a wiki with all of them

autumn sigil
#

wdym the end of the set 😭

still jolt
sharp basin
still jolt
#

but sets don't technically have order do they

sharp basin
#

tbh idk

still jolt
#

tbf sets are probably just glorified arrays but Β―_(ツ)_/Β―

sharp basin
#

.eval new Set([a, b, c]).add(d)
[object Set]

#

thanks

still jolt
#

why backticks

#

do you just use backticks for every string literal you have

sharp basin
#

because I coped it from my discord message

sharp basin
still jolt
#

lol

#

I use single-quotes

sharp basin
sharp basin
still jolt
still jolt
# sharp basin my old projects do

I prefer single-quotes for some reason ​​​​​​​​​​​​​​​​​

#

and I have it in eslint

sharp basin
#

I used to too but now I like double quotes

still jolt
#

fair

#

it's more just a stylistic choice Β―_(ツ)_/Β―

autumn sigil
terse hollow
#

Why my python look weird ? Like on internet i see some people having more colorful and with menu. Did i need to install something els ?

sharp basin
#

vs code

#

or nvim in my case

terse hollow
sharp basin
#

if you're new to programming you shouldn't even try using nvim

terse hollow
#

What is it and where i can download it ;-;

sharp basin
#

this is vs code, if you're new, this is for you

terse hollow
#

I will take a look thanks :D

sharp basin
#

it only supports keyboard navigation, no mouse (it's a terminal program)

#

vs code does support mouse navigation, it's just your normal windows pap

terse hollow
sharp basin
#

if at all then for linux users yes

#

I am just learning to use it atm as well

jade stone
#

I've been using neo vim for a bit but I've never managed to find one

sharp basin
#

I use nvchad

#

[space] + [v]ertical

#

[space] + [h]orizontal

#

they sometimes have some really shit behaviour though

bitter fable
#

is there like a "user is speaking" event i can subscribe to

winged mantle
#

vscode also works but it's more complex

#

that's just the python shell where code immediately runs instead of where you actually write a program which you can save and then run

#

it doesn't usually have highlighting i don't think

ionic lake
#

it does

winged mantle
#

well i don't think it does if you just type python in vscode terminal

ionic lake
#

oh I assumed you meant IDLE

#

my bad, sorry

terse hollow
#

I just try vs code and it seem to work as i wanted to its enought

sharp basin
sharp basin
#

I feel more productive with nvim since its all based on keyboard controls, and I vs code lacks some customization

terse hollow
#

Yeah i can understand

royal nymph
#

oh were they looking for an ide lmao

sharp basin
#

yeah

#

lol

#

well

#

python still sucks

#

but that's something else

winged mantle
#

i don't think saying something sucks is usually helpful...

#

it's rare that there's a language that's literally good for nothing

winged mantle
#

ye

broken shore
#

well, it does have a use

winged mantle
#

yeah and that is implied by the name. confusing you

long stream
terse hollow
#

Why it happend ?

royal nymph
#

did you save the file

terse hollow
ocean vine
#

are you out of your mind with that theme

royal nymph
royal nymph
ocean vine
#

ik but its the so disgusting 😭

#

one

royal nymph
#

it's good if you have visual impairment i think

terse hollow
ocean vine
#

oh maybe

royal nymph
#

pinnapeals

terse hollow
#

Ok i checked but now it do this ;-;

royal nymph
ocean vine
#

i like pinaepls

terse hollow
royal nymph
royal nymph
ocean vine
terse hollow
sharp basin
#

pineapple pizza

grand garnet
#

I'm using fs.watch() to rebuild my snippets when a change is detected, however when I save it detects like 3-4 times instead of just once. What am I doing wrong?

magic shale
#

vscode probably

#

it saves files multiple times sometimes

frosty obsidian
#

might have to do some ratelimiting

royal nymph
#

you'll want to debounce it

ionic lake
#

use chokidar while you're at it instead of fs.watch

royal nymph
ionic lake
#

that's way better than what it was in 2019

#

chokidar v3 removed like 15+ dependencies

#

also this is a node app, you aren't shipping chokidar to the browser (or well you can't lmao)

royal nymph
#

still sucks

#

little reason to add such a bloated dependency

#

fs.watch works fine

ionic lake
#

it isn't bloated, it's much better than node's lackluster watcher

royal nymph
#

66kb is pretty bloated for what it does :p

tame marsh
ionic lake
#

it's a node dependency, 100kb package won't make any difference

#

unless of course you're using outdated useless dependencies and warrants nolyfilling them

#

the consistency it provides, especially on osx is justified

torn seal
#

it's pretty

winged mantle
#

maybe i should use a query builder...

#

😭

#

28 line long queries :p

#

i could probably get what i want by passing an array

final night
nimble bone
ocean vine
#

real

winged mantle
#

and also implement sql injection is an advertised feature :)

still jolt
#

nice ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

dusty moth
#

it's fun

frozen pendant
#

What is the accessPermissions property on a channel object?

#

I thought it would've been the computed permissions but every channel i've tried it on so far just returns 1024n/VIEW_CHANNEL

#

(even channels i don't have that permission for)

royal nymph
#

try it on a voice channel?

#

might just be a utility getter that returns the permissions necessary for accessing that channel type

frozen pendant
#

1049600n

royal nymph
#

there u go

frozen pendant
#

yeah that one would be view_channels and connect

frozen pendant
#

the joys of having no documentation

#

any tips on figuring out what all the arguments are?

royal nymph
#

reverse engineer it

#

but also what are you even trying to do

#

seems like xy problem

ocean vine
#

source code is your documentation

frozen pendant
royal nymph
frozen pendant
#

Oh.

#

i guess it was xy

#

xD

timid lily
#

guys can i back to old discord ?
last update

magic shale
#

Vns

elder yarrowBOT
magic shale
#

And you can’t

frozen pendant
#

woohoo!

#

thank you @royal nymph

royal nymph
#

idk what getBasicChannel does, i'd just use normal getChannel

median root
#

is there a way to have choices on commands where the input type is a sting (similar to the ones where its a bool where it shows the true false in options) I am assuming it needs the choices option however I cant find any plugins that use it

#

string*

winged mantle
median root
#

dammit alr

#

ill jst make a seperate command for the list

#

thx for the help

wooden vector
#

Is there a way to refresh the member list (or member from the member list) in discord?

Lets say I changed the name of a user but the text has not changed on screen. I found the class that is responsible for rendering the text but I do not have access to that class.

still jolt
#

ctrl+r or switch servers and switch back

wooden vector
still jolt
#

window.location.reload()

#

if you're tryna force the username to update on everyone's screen - you can't

wooden vector
#

Doesn't this perform the same this as Ctrl + R

still jolt
#

yes

wooden vector
#

I don't want it to refresh the entire screen just the member list

still jolt
#

most likely switching to a different server and switching back would refresh it

wooden vector
#
render() {
    let {colorString: e, colorRoleName: t, isOwner: n, nick: a, user: l, currentUser: s, activities: r, applicationStream: o, status: c, channel: u, guildId: h, isTyping: p, isMobileOnline: _, lastOnlineTimestamp: f, premiumSince: E, ...C} = this.props
      , I = null != E ? new Date(E) : null;
    return (0,
    i.jsx)(m.Popout, {
        preload: ()=> ...,
        renderPopout: this.renderUserPopout,
        position: d.tq ? "window_center" : "left",
        spacing: 16,
        onShiftClick: this.handleShiftClick,
        children: (d,m)=>{
            let {isShown: E} = m;
            return (0,
            i.jsx)(g.Z, {
                className: K.member,
                onContextMenu: this.renderUserContextMenu,
                shouldAnimateStatus: X,
                user: l,
                currentUser: s,
                nick: a,
                status: c,
                activities: r,
                applicationStream: o,
                isOwner: n,
                premiumSince: I,
                colorString: e,
                colorRoleName: t,
                isTyping: p,
                channel: u,
                guildId: h,
                isMobile: _,
                onClickPremiumGuildIcon: this.openGuildSubscriptionModal,
                selected: E,
                itemProps: C,
                lastOnlineTimestamp: f,
                ...d
            })
        }
    })
}
#

This is the code responsible for rendering a member from the member list

wooden vector
still jolt
#

why are you tryna refresh names thru code tho ​​​​​​​​​​

wooden vector
#

I am making a plugin to rename users

#

Switching servers just to refresh the member list doesn't seem like a good solution

grim acorn
#

bro i'm tryna make a plugin to remove this activity shit in the member list

#

but I've never made a plugin before and I have no idea what i'm doing

#

do i need a plugin for this bc I can't seem to get it to work with quickcss

#

i just want this gone, idc how

royal nymph
#

disable experiment

grim acorn
#

you would think its this one but no luck

royal nymph
royal nymph
#

i really need to get better with sql

#

somehow i managed to write this with 0 problems

analog hearth
#

ooo kysely

#

or how ever you spell it

#

it’s awesome

#

I know both sql and kysely but I often have issues converting complex sql queries to kysely

#

which is kinda painful

royal nymph
#

is there a better way to do this?
basically expressionUses has a relation on id to expressions

#

so i first insert the expressiosn and then the uses

#

is there a way to to it in one query

analog hearth
#

there will always be a better way no matter what you do (and i’m not sure, not home atm)

#

I rewrite all my queries once in a while because I learned more sql

royal nymph
winged mantle
winged mantle
#

its like java

stoic helm
#

chaining functions is like java...?

opal portal
#

how do i make it not do that

#

nvm

stoic helm
#

vns

elder yarrowBOT
still jolt
#

meow ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

stoic helm
#

it showed u as a whitename for a sec

#

scary

finite turtle
#

is there a place I can find documentation on discord experiments?

grand garnet
#

Not really, they come and go

royal nymph
ionic lake
jade stone
#

what is the name for !. and ?. in typescript

stoic helm
#

non-null assertions and optional chaining i think

jade stone
#

thanks

winged mantle
ionic lake
#

I was gonna say it probably exists and it sure does

royal nymph
#
sql`
SELECT * FROM balls;
`
ionic lake
winged mantle
#

unless it does use prepared statements under the hood

#

i think some things manually escape

#

i guess you could make a no op tag

ionic lake
#

Template literals are OK for some things like styled components but I've seen the most horrific code written with them for complex things

winged mantle
#

actually imagine doing name = ${string} AND ${string} IS NOT NULL

#

would that even work

ionic lake
#

why would it not work

#

that's exactly what they're for

winged mantle
#

for example $1 IS NOT NULL AND name = $1 does not work

#

i had to reverse it for type inference

#

it was weird

#

i presume that converts name = $1 AND $2 IS NOT NULL

ionic lake
#

yeah I guess

#

my usage goes something like this, at best:

export function selectProbeStatuses(sql: SqlTag) {
	type Row = Pick<
		DB['probe_statuses'],
		| 'id'
		| 'last_result'
		| 'last_success_at'
		| 'last_failure_at'
		| 'same_result_since'
	>
	return sql`SELECT id, last_result, last_success_at, last_failure_at, same_result_since FROM probe_statuses`
		.build<Row>()
		.map((row) => ({
			id: row.id,
			lastResult: row.last_result,
			lastSuccessAt: convertDate(row.last_success_at),
			lastFailureAt: convertDate(row.last_failure_at),
			sameResultSince: convertDate(row.same_result_since)
		}))
}
winged mantle
#

a problem i was having with node-postgres was booleans mapping to number

void berry
#

drizzle or prisma...

#

what to pick

winged mantle
#

i always see people complain about the latter

void berry
#

me personally i've never had issues with prisma but i've heard good things about drizzle

winged mantle
#

personally my best experience has been with not touching orm from 1m away

#

what do people say that doesn't really work

ionic lake
#

You won't have problems with neither, unless you're trying to build the next slack or discord

#

People's problems are people's problems, not yours

median root
#

is there any way i can use npm installed modules and functions from within a vencord plugin? I am trying to work with LM studio however they only have npm and yarn installations

winged mantle
royal nymph
#

tagged templates are amazing for sanitizing user inputs that will be embedded into string

royal nymph
#

this is pretty fire

winged mantle
#

just try it

#

it needs the comparison to column first to work out the type

royal nymph
#
function searchByUserName(search) {
  return await sql`
    SELECT * FROM users WHERE username = ${search}
  `;
}
winged mantle
#

then if username is null it will return nothing

royal nymph
#

?

#

yes

winged mantle
#

oh wait

#

i meant or

#

$1 IS NOT NULL OR name = $1

#

😭

royal nymph
winged mantle
#

so if the name is null it returns everything

royal nymph
#

no?

winged mantle
#

tagged template does make things a littel confusing

#

people will try sql inejction because it looks like it works venniehehe

final night
#

It looks like it would work yeah

royal nymph
#

tagged templates are cool cause you can transform the input

final night
#

Huh

#

I didn't know tagged templates were a thing

winged mantle
#

what if you forget it though

#

then you're screwed

royal nymph
winged mantle
#

i thought it would be super cool to make translation with this like ```
trHello ${username}

royal nymph
#

tagged templates are really powerful

winged mantle
#

but how would the translations even work

#

probably best to give them an id

tr("greeting")`hello`
winged mantle
#

😭

winged mantle
royal nymph
#

why add new syntax when stdlib can do it

winged mantle
#

it can't end with backslash

#

horror

winged mantle
royal nymph
winged mantle
#

HORROR

royal nymph
#

😭

winged mantle
#

/run

#include <iostream>
std::cout << R"(\
)";
rugged berryBOT
#

Here is your c++(10.2.0) output @winged mantle

\
winged mantle
#

c++ best

#

huh

#

oh it's R

pearl stagBOT
# royal nymph https://github.com/Vendicated/Vencord/blob/main/src/utils/text.ts#L135-L143

text.ts: Lines 135-143

export function stripIndent(strings: TemplateStringsArray, ...values: any[]) {
    const string = String.raw({ raw: strings }, ...values);

    const match = string.match(/^[ \t]*(?=\S)/gm);
    if (!match) return string.trim();

    const minIndent = match.reduce((r, a) => Math.min(r, a.length), Infinity);
    return string.replace(new RegExp(`^[ \\t]{${minIndent}}`, "gm"), "").trim();
}
royal nymph
#

so good

winged mantle
#

/run

#include <stdio.h>
#define join(a, b) a##b
#define entrypoint join(m, ain)

int entrypoint() {
    puts("hello world");
}
rugged berryBOT
#

Your c(10.2.0) code ran without output @winged mantle

winged mantle
#

/run

#include <stdio.h>
#define join(a, b) a##b
#define entrypoint join(m, ain)

int entrypoint() {
    puts("hello world"); // main
}
rugged berryBOT
#

Here is your c(10.2.0) output @winged mantle

hello world
winged mantle
#

adding comment fixes this code

full seal
#

discuss

royal nymph
#

kinda real

cerulean plover
#

yeah

#

i agree

#

fucking hate how KDE decided global menus should use D-Bus

#

no actually

#

chromium devs are fucking useless at their job

#

i know I sound like an asshole end user saying this but

#

it should not take 5 years to discuss how to add global menus to wayland and not end up doing it

ionic lake
#

actually I mean, many libraries are using normal fetch anyway so bundling them shouldn't be a issue

median root
#

My issue was that the lib was only on node and yarn so because I ran pnpm i I can't install with node (to my understanding)

cerulean plover
#

if the module is supported in the browser you can probably just import it

#

idk about CSP and CORS though nyabom

#

if not, vencord has a native module system

#

native being "node" native

median root
cerulean plover
#

honestly the documentation for it is very lacking

median root
#

isnt there some other steps since just creating a native.ts doesent do anything new?

#

the one plugin ive seen using it has a function in one of the modules

atomic brook
median root
cerulean plover
#

and all the comments are just

#

no standardisation????

#

also because the model is so generic

#

there is absolutely no use case for it on any site that isnt specifically a frontend for this

median root
cerulean plover
#

yes

#

but

#

as I said it is a generic model, it would be useless for that

median root
cerulean plover
#

yes

#

but

#

it doesnt know about your shitty niche SaaS app so it's useless

ionic lake
#

firefox nightly also already supports it and has support for llamafile (also by justine and moz!) and your favorite local models

#

it's pretty good so not sure why the flak

cerulean plover
#

interesting

ionic lake
#

the generic part is that gemini being shit but that's just google for you /shrug

cerulean plover
ionic lake
ionic lake
#

surprised people are catching on now when it has existed for 3 months atleast lmao

ionic lake
#

it's in nightly

#

same for chrome

atomic brook
#

probably makes sense ( 6gb of ram ) but nano should be still okay?

ionic lake
#

gemma nano are really useless

#

you're better off using something like mistral at best

atomic brook
# ionic lake you're better off using something like mistral at best

I mean... i can't change it

That's why we're developing web platform APIs and browser features designed to integrate AI models, including large language models (LLMs), directly into the browser. This includes Gemini Nano, the most efficient version of the Gemini family of LLMs, designed to run locally on most modern desktop and laptop computers.

well, i can't even enable this shit

#

no components for me somehow

frosty storm
#

not related to vencord but why does sqlite3 only return ", for every command I will see (if) any replys int the moting

#

and when I add [0] because tuple it just returns nothing or a space

#

trying to get a cookie from opera gx

winged mantle
#

i wonder if there's any library that you can give a js object and a json schema and it will remove anything which is invalid

#

basically just for type safety

#

i bet somebody could put a bad type used in somewhere where there isn't a try catch

#

maybe i should switch to zod and generate a json schema from that

#

bgecause i thought it would be cool to use monaco and use the schema for autocomplete and errors

#

wouldn't it be a pain if one thing broke and it broke everything

autumn sigil
#

why do you need the schema as json

#

hm i am somewhat considering putting the websocket unpack into a dedicated webworker

#

actually this is too much effort why am i doing this

ionic lake
winged mantle
#

creates an assertion function

winged mantle
autumn sigil
#

if youre using zod why not use straight zod

winged mantle
#

it's not really seralisable

autumn sigil
#

ohhh sorry

winged mantle
#

doesn't vscode natively support schemas

#

but i am using json5 anyway

#

which still doesn't support multiline strings

#

:|

median root
#

quick thing, is there an alternative for adding reactions using vencord? the old findByProps method doesent seem to work

frosty storm
#

how can you make the cookies file readable with python? i have the cookies file located but when i try using sqlite3 in python it just returns ", or None or something like that. the closest result to the cookie im trying to get is a bunch of random numbers and when I did manage to get it to return its a hex string that doesnt decode

royal nymph
frosty storm
#

trying to make a bot for a website

#

too

#

if i wanted to really make malware i would've just made a rat and do it myself

#

i wouldnt go through all that trouble i would've just used a webhook to control their pc

#

which i dont want to do

autumn sigil
golden narwhal
#

@pastel mauve if you can uhhhhhh get a mesh of vennie plush i can make it an asset in my game

pastel mauve
#

i dont have a mesh of her

north harbor
#

Best way to do addition in js:

(()=>{
    let addition = new Proxy({},  {
        get(target, prop, receiver){
            let arr = prop.split(",").reduce((a,b)=>parseFloat(a)+parseFloat(b))
            return arr
        }
    } )
    
    console.log(addition["1,2,8"])
})()
#

trust me this is how you are supposed to use proxies

autumn sigil
#

why is that iife..

north harbor
north harbor
# autumn sigil why is that iife..

i got rid of the iife and i simplified the getter:

const addition = new Proxy({},  {
    get(target, prop, receiver){
        return prop.split(",").reduce((a,b)=>parseFloat(a)+parseFloat(b))
    }
} )

console.log(addition["1,2,8"])
autumn sigil
#

woww!!!!

north harbor
#

i wonder...

#

now this is peak javascript:

new Proxy({},  {
    get(target, prop, receiver){
        let arr = prop.split(",").reduce((a,b)=>parseFloat(a)+parseFloat(b))
        return arr
    }
} )["1,1"]
//evaulates 1+1=2
#

i must overcomplicate it more

#

added regex to remove the non number stuff

new Proxy({},  {
    get(target, prop, receiver){
        let arr = prop.replace(/[^\d+]/g, "").split("+").reduce((a,b)=>parseFloat(a)+parseFloat(b))
        return arr
    }
} )["1+2+1"]
//should evaluate to 4
#

i made it even better ```js
new Proxy({}, {get(target, prop, receiver){return prop.replace(/[^\d+]/g, "").split("+").reduce((a,b)=>parseFloat(a)+parseFloat(b));}})["1+2+1"]
//should evaluate to 4

#

i should work on my discord mod

#

or i could overcomplicate this more

royal nymph
#

flop

north harbor
#

dont look at my github and look for my discord mod

#

i need to redo the whole thing

#

pretty much all the code is in 1 file

#

and i didnt feel like using typescript that day

#

(doesnt help either i did it in a day)

royal nymph
# north harbor ?
function proxy(state = "") {
    return new Proxy(function() {}, {
        get(_, prop) {
            if (typeof prop === "symbol") return;
            return proxy(state + prop);
        },
        apply() {
            return eval(state)
        }
    })
}

var evaluator = proxy()

evaluator.c.o.n.s.o.l.e["."].l.o.g()(evalutor[1][2]["*"][10]())
north harbor
#

hmm

#

i wonder

#

afljadsdjas

magic shale
royal nymph
#
function proxy(state = "") {
    return new Proxy(function() {}, {
        get(_, prop) {
            if (typeof prop === "symbol") return;
            return proxy(state + prop);
        },
        apply(_target, _this, args) {
            const res = eval(state);
            return typeof res === "function" && args.length
                ? res.apply(_this, args)
                : res;
        }
    })
}

var evaluator = proxy()

evaluator.c.o.n.s.o.l.e["."].l.o.g(evaluator[1][2]["*"][10]())
#

now its better

north harbor
#

i was thinking about making an obfuscator

#

i started making a tokenizer for it so i could change keywords and what not but i didnt feel like working on it much

vapid latch
#

just compile all your logic into wasm at that point

north harbor
#

not very fun

#

i could easily compile it to wasm if i wanted but obfuscation is more fun

royal nymph
#

so good

north harbor
vapid latch
#

too bad wasm has no access to the DOM directly 😒

#

avoiding js entirely would be based

north harbor
#

@royal nymph what if you use an xor on it

#

so for a basic console.log you would need to figure out the xor result for all the characters

royal nymph
#

xor with what

north harbor
royal nymph
#

yes

#

with what

north harbor
#

?

#

hmmm

royal nymph
#

xor with what

north harbor
#

"lorem ipsum"

#

idk

#

quite literally just encrypting the code

vapid latch
#

well ideally you'd have a preprocessor that generated a key i think

north harbor
north harbor
#

i think i remember watching a video about it

vapid latch
#

this is nitpicky ash but cant you omit the argument to codePointAt if the index is 0

royal nymph
#

seems so

#

but passing it is nicer

north harbor
#

ima check if a deobfuscator can simplify this

#

cool

#

im gonna try another

#

this one gave an error

#

thats actually the fist time i have seen this website give an error when deobfuscating

#

cool

north harbor
royal nymph
# north harbor cool

u can also do this without a proxy:

function e(state="", ...restArgs) {
    if (restArgs.length) state += restArgs.join("");
    return (...args) => {
        if (args.length) return e(state + args.join(""))
        return (0, eval)(state);
    }
}

e("c")("o")("n")("sole")(".")("log")()(e('"')("h")("i")('"')()) // hi
north harbor
royal nymph
#

how

north harbor
royal nymph
#

i edited it again

north harbor
#

now it works

north harbor
royal nymph
north harbor
#

o yeah forgot to send it but i made some scuffed code for generating the code:

function generateSillyCode(code){
    let str = "e("
    Array.from(code, (c, i)=>str+="'"+(c=="'"?'"':c)+"',")
    str+=")()"
    return str
}
generateSillyCode("console.log('hello')")
#

very scuffed

#

kind of wonder why obfuscators dont ever do this

#

i mean its kind of slow but still

royal nymph
#
function e(password, _i = 0, _s = "") {
    return (...args) => {
        if (!args.length) return (0, eval)(_s);
        const s = args
            .flatMap(a => Array.from(a, c => 
                String.fromCodePoint(c.codePointAt(0) ^ password.codePointAt(_i++ % password.length))
            ))
            .join("");
        return e(
            password,
            _i,
            _s + s
        );
    }
}

const BananaCode = e("banana");
const LoremCode = e("lorem ipsum");

BananaCode("\x01", "\x0E")("\x00")("\x12", "\x01\r\x07O\x02")("\x0E\t")()("hi")
grand garnet
#

does @types/package go into devDependencies or dependencies?

royal nymph
#

devdeps

grand garnet
#

thanks

royal nymph
#

anything you only need during development is dev deps

#

anything you need at runtime is normal dep

grand garnet
#

gotcha, didn't know if you need types during runtime

brave gyro
#

in plugin creation, what does a message being optimistic mean?

drifting cloak
brave gyro
#

oh ok

#

is there any documentation for flux events that i can look at?

hushed pebble
# vapid latch too bad wasm has no access to the DOM directly 😒

it'd only be done through, say, some sort of "builtin" (it's a concept that's being used in the unfortunate JS string builtins proposal)

essentially builtins are a bunch of imports that are builtin and opt-in
you still need JS though, to actually instantiate the module! I don't know if ESM integration will interface with them lol

hushed pebble
hushed pebble
north harbor
hushed pebble
#

yeah :3

#

It's not that good, but it's slightly annoying to deal with

#

Anyways I plan on making an epic funny (but it'll be private and closed source)

#

also it's a compiler from a custom language (a DSL if you will), so it's not as general purpose as one might desire

#

also there always the chance i'll abandon it

#

i'm making it for @plush temple

north harbor
hushed pebble
#

plus it's funny

vapid latch
#

i dont personally like obfuscation

dusty moth
#

did you mean (0, eval)(…)?

hushed pebble
#

good catch

#

he probably meant to use indirect eval lol

royal nymph
winged mantle
#

maybe it would be cool to support regex as native type in config file format?

#
gay_regex: /ga(y/i)/g
cerulean plover
#

yes but

#

it's JSON under the hood

#

so

#

that means some hackiness with settingsstore

winged mantle
#

noo

#

i am making a config file format

cerulean plover
#

oh?

#

im dum

#

in that case

#

do it

#

make sure to support new regex stuff

winged mantle
#

actually nah it's a bad idea

cerulean plover
#

why

winged mantle
#

makes it less portable

cerulean plover
#

????

winged mantle
#

in order to implement config you need whole regex lib

cerulean plover
#

oh yes

winged mantle
#

i just thught syntax sugar would be nice

#

but i guess you could use raw string

cerulean plover
#

what will your config be used for

winged mantle
#

discord bot

#

lol

#

overengineered discord bot

void berry
#

config.help

winged mantle
#

this is what i have so far and idk if it's too weird

#

i thought i'd do what hjson did with implicit value separators with newlines but change the comma to semicolon because idk

#

this also works

cerulean plover
#

does it support trailing comma in objects

winged mantle
#

there are no commas in objects

#

only semicolons

#

yes trailing works

#

and you can have as many as you want unlike commas

#

is this cursed

#

😭

cerulean plover
#

no

#

if i were you i would allow semicolons and commas

winged mantle
#

i just thought if i allowed ["hi",,"world"] that would be confusing

#

why allow both

cerulean plover
winged mantle
#

oh i guess i did stop it being a subset of json

#

yes

#

that would confuse js devs

cerulean plover
winged mantle
#

which would be funny but still not a great idea

cerulean plover
winged mantle
#

the idea is to make it like yaml but more c like

#

in typescript you can use both semicolons and commas

cerulean plover
#

yaml is a disgusting format

winged mantle
#

the reason for semicolons is...

cerulean plover
#

yaml sucks because of why python sucks

winged mantle
#

that doesn't look very good

cerulean plover
#

only breaks if you add unquoted strings

winged mantle
#

if you introduce dates everythunig breaks

#

unquoted strings are awful

#

lol

cerulean plover
winged mantle
#

age??

cerulean plover
#

NO

winged mantle
#

oh god

#

i brain farted

#

and now i realise it makes it look like i was saying i was 4

#

i meant to write date: 2020-01-01 10:32

cerulean plover
#

use iso8601 like a normal dev

winged mantle
#

but iso allows spaces doesn't it

#

i would disallow spaces but then it wouldn;'t be compliant

cerulean plover
#

Explicitly no even

#

ISO 8601 is an international standard covering the worldwide exchange and communication of date and time-related data. It is maintained by the International Organization for Standardization (ISO) and was first published in 1988, with updates in 1991, 2000, 2004, and 2019, and an amendment in 2022. The standard provides a well-defined, unambiguou...

dusty moth
#

YYYY-MM-DD/HH:MM:SS

winged mantle
#

the best format for user input is loose

#

just allow anything that looks like it could be a date

cerulean plover
winged mantle
cerulean plover
#

this format is something I have never seen

dusty moth
cerulean plover
#

because of the :

dusty moth
winged mantle
#

see you at 12-00

cerulean plover
#

ntfs is a fucking mistake

#

windows filesystem api is a mistake

quick crow
winged mantle
#

weird for a programmer to say that

#

you can't use -s in varibales

dusty moth
#

our variables are standard identifiers, plus -s and non-adjacent 's

winged mantle
#

cursed

#

how is it not ambigious with subtraction

#

πŸ‘€

dusty moth
#

a-b is a variable; a - b is subtractiob

#

same for paths: a/b is /home/nathan/a/b if you're evaluating it in /home/nathan, but a / b is division

glacial mirage
#

breaking news: significant whitespace is good sometimes actually

winged mantle
#

i don't like that

#

c has significant whitespace

dusty moth
#

and 1-1 is 0 since 1 isn't an identifier

dusty moth
winged mantle
#

/run

#include<stdio.h>inti=5;printf("%d\n",i);
rugged berryBOT
#

@winged mantle I received c(10.2.0) compile errors

file0.code.c:1:18: warning: extra tokens at end of #include directive
    1 | #include<stdio.h>inti=5;
      |                  ^~~~
file0.code.c: In function 'main':
file0.code.c:3:15: error: 'i' undeclared (first use in this function)
    3 | printf("%d\n",i);
      |               ^
file0.code.c:3:15: note: each undeclared identifier is reported only once for each function it appears in
chmod: cannot access 'a.out': No such file or directory
/piston/packages/gcc/10.2.0/run: line 6: ./a.out: No such file or directory
winged mantle
#

this does not work

#

lol

cerulean plover
dusty moth
winged mantle
#

and you need a space between int and i

dusty moth
cerulean plover
winged mantle
#

semicolons

dusty moth
#

would you rather have sigils

winged mantle
#

int;i

cerulean plover
#

trol

brave gyro
#

You need a newline after stdio include too

cerulean plover
glacial mirage
#

/run

#include<stdio.h>
int i=5;printf("%d\n",i);
rugged berryBOT
#

Here is your c(10.2.0) output @glacial mirage

5