#πͺ -progaming
1 messages Β· Page 9 of 1
avoid abbreviations
i guess this would be kinda neat. one of my professors would want FriendBtn in this scenario or a similar one
your prof is a dumbass don't listen to what he says
vee will be your professor now
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)
i think it's only he prefers that for windows forms though. in the regular programming class i had with him, he would prefer FriendButton. but for my oop class, he would have wanted FriendBtn
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
what's even the greater picture
why can't you use https://www.electronjs.org/docs/latest/api/web-contents-view
A View that displays a WebContents.
i'll be honest my app is kinda shitty and does everything on the html side xwx
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.
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
wait im a bit confused sorry, so would it be the url before the equals and then the constant website in brackets? like this?
no
this really shouldnt be that hard im just retarded sorry
<Component propName={propValue} />
OH OK
yes
thx veestie
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.
if it's a constant string, you can omit the {}
wtf that's really unsafe lmao
try using this
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
that blob is from the WebPreferences api
which seems to apply to all three options
https://www.electronjs.org/docs/latest/api/structures/web-preferences#:~:text=preload string (optional,example%20here.
i don't really understand
anyway you can always just inject your own minimal webpack searcher, instead of vencord
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'?
it's just reverse engineering
there is a lot of example code you can work with
like my script i linked or vencord / bd
is there a reason why this happens when i try and put more than one of them inline?
try adding text-decoration: none; to the a
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
nothin sadly
:(
if this helps
idk if it will
read properly
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
sorry to hijack, thoughts on above?
nope!
oh lmao
idfk why vsc reccomends style properties in html sections

anyways put in my styletag, fixed it
ty
i actually do have a loose grasp on it, its just like 00:44 and my ass cannot think
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
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
- it's
cloudnotCloud
holy shit no wonder
are you the use firefox
the what
the
thanks LuSaffi, that explains so much!
:D
meow();
meow++;
++meow;
for (const meow of meows as Meow[]) meow.meow();
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)
async iterator
this looks like complete horror if not broken into lines
and I thought I was crazy for writing 40 lines of js to verify if I can view a channel
maybe use more variables & it would be less confusing
Make a variable for permissions and null check it before the loop
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
Why Record & string[] lol
basically i wanted to say that it must be indexable by CaseType
by doing & string[] isnt it able to be indexable by any number?

nope
somehow not
nvm i think it just makes all CaseTypes required
and it's | undefined by default with my config so
programming crimes
needs more ../
good
I have worse lol
private files!
import app from "../../../../../../../../../../../../../../../../../etc/shadow";
(it won't actually import but Β―_(γ)_/Β―)
not for long
actual production code
not sure if right channel but has anyone reversed/documented the discord video protocol?
OMG powercord users really all went here lmao
https://docs.discord.sex/topics/voice-connections idk if this is what you are looking for
Voice connections operate in a similar fashion to the Gateway connection. However, they use a different set of payloads and a separate UDP-based connection for voice data transmission. Because UDP is...
that should help a ton thx
np :3 gl on your project
we attempting to make screenshare work on linux for the 3rd time
(discord broke my last effort)
but screenshare works on linux βββββββββββββββββββββββββ
so idk whwat you mean
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
kde xwayland video bridge:
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
agreed
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
all discord would need to do to fix this is to update the webrtc version used in the discord_voice lib
lift the windows part and inject/polyfill into linux
/hj
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
printf("no %s? become the %s", nativeDev, nativeDev)
ive heard working at discord isnt the greatest experience :')
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
maybe this is why discord horribly messes up everything
tbf
the vocal people are always going to be the angry ones
would this be a channel where i can ask where the plugin folder for vencord is? bc im confused!
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
i love elctron, electron is awesome!
True
fair
its the googling reviews for $x product problem
or why apps annoy you to review them on the app store
I hate discord new 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
use vesktop :D
people keep arguing about trailing comma or not in js, but no one ever talks about leading comma 
const User = {
id: 1
, username: "kitty cat"
, age: 21
}
cruel
HORROR
just dont code like that
bad
const User = {
id: 1
, username: "meow"
, age: 22
}
with 2 spaces it's weird
with 4 spaces it's less weird
with tabs....
i mean thats terrible to write but if i can just format into that sure why not
i only saw people use this for old c++ standards which didn't support trailing
how can fix this theme
vns
Can we make js subset that just removes commas in json and no semicolons
And no comma operator cause what is that π
wouldn't that make it impossible to write an object in one line
stop making every language into python
NO
FUCK NO
better idea: swap the meaning of : with ; and . with ,
const User = { id;1. username;"kitty cat". age;21 }
why not use yaml or toml in js
horror βββββββββββββββββββββββββββββββββββββββββββββββββ
because JSON exists
JavaScript Object Notation :3
json bad
no
how would you write toml in js anyways
idk
doesnt it need to be a whole file
lmao
const User = <User><id value="1"/><username value="kitty cat"/><age value="21"/></User>

NO βββββββββββββββββββββββββββββββββββββββββββββββββββββ
GOD
PLEASE NO
literally took me an hour to debug this
yaml can fuck off to hell forever
you know what guys fuck all your standard file formats
lmao
450001000068656c6c6f206b69747479000000000000000000000
here is some raw binary
for user

feel free to check if you dont believe me
insane
/run
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
./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;
}
Here is your c++(10.2.0) output @ocean vine
450001000068656c6c6f206b69747479000000000000000000000```

typescript
how? ts should immediately notify you of type error
no
it doesnt
lol
its not an error having a string dangling around
(see "use strict" or similar)
does it not warn it can return undefined
nuh uh
ts infers return types if none are specified
in this case string | undefined
add : string to the function definition
imagine having @typescript-eslint recommended rules set up
imaging wasting an hour looking for a bug 
I mostly copied the vencord eslint and build uppon it, don't blame me
Β―_(γ)_/Β― βββββββββββββββββββββββββββββββββββββββββββββββββ
I copied some old eslint of mine
and threw in ts-eslint
that's mine Β―_(γ)_/Β―
eh with like 300 rules
and I used vercel style guides
which still doesnt use the flat config
so I cant use it
i dont like the vencord esling autoremoving unused imports :c i format a lot bc i cba writing good looking code and its so annoying when theyre just gone
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
I automatically import but manually remove and eslint screams at me if I don't remove them lmao
and then it automatically imports the variable
saving auto removes (for me)
:w
yes but it's an error using undefined in a place that expects a string
your return type will be "string" | undefined
i never define return types
tip: shrimply do not ever import manually
but in the place it's used, it should error
if you have ur types set up properly
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
const getCommandEventName = (i: Interaction) =>
i.isChatInputCommand() && "CommandInteraction"
|| i.isContextMenuCommand() && "ContextInteraction"
|| i.isButton() && "ButtonInteraction"
|| i.isAnySelectMenu() && "SelectInteraction"
|| "FakeInteraction"
peak
lmao fake interaction
or better yet
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();
}
}

I had such a cursed switch statement before
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
I was switching by interaction type and then inside of that used the type guards
aka the same with just 6 extra lines
make a function which just returns the type guard function and then another function which returns the strings
or something
aya
explode nya
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",
})
weiner
i love force pushes
i think ive fixed it
I donβt want to press how truly awful this looks on mobile
wait why lmaoo

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
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)
guess i didnt look hard enough
where are keybinds locally stored? tryna port them over to PTB
what do you mean github has a "your shit is so fucked bruh" message
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
love firefox
why do we need that
how
huh
is this the white page
I love my old code
isn't there a fluxdispatcher event for this though? or am i wrong
is there like a wiki with all of them
wdym the end of the set π
oh god that's just a glorified .map.join
set; // apple, banana
set.add("car");
set; // apple, banana, car
but sets don't technically have order do they
tbh idk
tbf sets are probably just glorified arrays but Β―_(γ)_/Β―
because I coped it from my discord message
no I use double quotes
my old projects do
I prefer single-quotes for some reason βββββββββββββββββ
and I have it in eslint
I used to too but now I like double quotes
yop thats the point
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 ?
What is this ?
What is it and where i can download it ;-;
I will take a look thanks :D
nvim is for advanced users, and idk if it even exists for windows
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
So its more for linux user ?
What plug-in do you use for the terminal pop out?
I've been using neo vim for a bit but I've never managed to find one
I use nvchad
[space] + [v]ertical
[space] + [h]orizontal
they sometimes have some really shit behaviour though
i'd still like an answer to this
is there like a "user is speaking" event i can subscribe to
maybe they are using IDLE?
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
it does
well i don't think it does if you just type python in vscode terminal
they're using ipython
I just try vs code and it seem to work as i wanted to its enought
it's the standard, but I personally don't like it anymore
Why ?
I feel more productive with nvim since its all based on keyboard controls, and I vs code lacks some customization
Yeah i can understand
oh were they looking for an ide lmao
i don't think saying something sucks is usually helpful...
it's rare that there's a language that's literally good for nothing
brainfuck
well, it does have a use
yeah and that is implied by the name. confusing you
It does but there are more limitations with plugins and things like that
Why it happend ?
did you save the file
Yeah
are you out of your mind with that theme
are you sure
it's just high contrast default theme
it's good if you have visual impairment i think
Let me check again
oh maybe
pinnapeals
Ok i checked but now it do this ;-;
anyway you seem to be an absolutely rookie when it comes to programming
i recommend joining servers like https://discord.gg/programming instead
i like pinaepls
Okay :)
Wait its not pinnapeals ? (sorry im not english)
you're pushing to keywords twice
pineapple
its pineapple(s)
Oh
pineapple pizza
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?
might have to do some ratelimiting
this is normal, the os usually dispatches multiple events. if you print the eventType you'll see
you'll want to debounce it
use chokidar while you're at it instead of fs.watch

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)
it isn't bloated, it's much better than node's lackluster watcher
66kb is pretty bloated for what it does :p
No, readme of chokidar explains why
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
maybe i should use a query builder...
π
28 line long queries :p
i could probably get what i want by passing an array
What are you querying?
all my homies write sql queries by themselves
real
nice βββββββββββββββββββββββββββββββββββββββββββββββββββ
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)
try it on a voice channel?
might just be a utility getter that returns the permissions necessary for accessing that channel type
1049600n
there u go
yeah that one would be view_channels and connect
the joys of having no documentation
any tips on figuring out what all the arguments are?
currently trying to figure out if a user has permissions to send to a channel
guys can i back to old discord ?
last update
Vns
And you canβt
idk what getBasicChannel does, i'd just use normal getChannel
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*
that usually is usually implemented in bots where the client sends a request to discord for every input to the command, and to allow anything the bot responds the query itself in the list...
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.
ctrl+r or switch servers and switch back
This does work but it is not the solution I am looking for. I am trying to do it through code.
window.location.reload()
if you're tryna force the username to update on everyone's screen - you can't
Doesn't this perform the same this as Ctrl + R
yes
Not others just locally
I don't want it to refresh the entire screen just the member list
most likely switching to a different server and switching back would refresh it
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
I'm not sure how to access this function
why are you tryna refresh names thru code tho ββββββββββ
I am making a plugin to rename users
Switching servers just to refresh the member list doesn't seem like a good solution
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
disable experiment
which experiment is it? i can't find it
you would think its this one but no luck
this
i really need to get better with sql
somehow i managed to write this with 0 problems
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
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
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
fire
this is confusing. are there any orms you can use with raw sql queries or ig that's just pointless
confusing how
its like java
chaining functions is like java...?
vns
meow βββββββββββββββββββββββββββββββββββββββββββββββββββ
is there a place I can find documentation on discord experiments?
Not really, they come and go
reverse engineering
Almost all major ORMs allow you to drop down to raw sql queries
https://orm.drizzle.team/docs/sql I like drizzle's magic sql right now
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
what is the name for !. and ?. in typescript
non-null assertions and optional chaining i think
thanks
if you could have a vscode plugin which highlighted it and gave syntax errors that would be cool
Extension for Visual Studio Code - Syntax highlighting, validation and type checking for PostgreSQL in template literals tagged with sql function
I was gonna say it probably exists and it sure does
this one looks more featured
https://marketplace.visualstudio.com/items?itemName=bierner.comment-tagged-templates
Extension for Visual Studio Code - Syntax highlighting for tagged template strings using comments to specify language
pretty sure js language server already highlights some tags properly
sql`
SELECT * FROM balls;
`
Experiments are a form of A/B testing used by Discord in the client- and server-side of their applications to serve different experiences or behaviours to different users randomly and/or based on loca...
i don't like using tagged templates
unless it does use prepared statements under the hood
i think some things manually escape

i guess you could make a no op tag
Template literals are OK for some things like styled components but I've seen the most horrific code written with them for complex things
actually imagine doing name = ${string} AND ${string} IS NOT NULL
would that even work
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
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)
}))
}
a problem i was having with node-postgres was booleans mapping to number
i always see people complain about the latter
me personally i've never had issues with prisma but i've heard good things about drizzle
personally my best experience has been with not touching orm from 1m away

what do people say that doesn't really work
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
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
i don't think upsert works properly in prisma
yes it would work wonderfully
tagged templates are amazing for sanitizing user inputs that will be embedded into string
this is pretty fire
function searchByUserName(search) {
return await sql`
SELECT * FROM users WHERE username = ${search}
`;
}
then if username is null it will return nothing

so if the name is null it returns everything
SQL injection horror
no?
tagged template does make things a littel confusing
people will try sql inejction because it looks like it works 
It looks like it would work yeah
i thought it would be super cool to make translation with this like ```
trHello ${username}
but how would the translations even work
probably best to give them an id
tr("greeting")`hello`
π
crused why didn't they just add r""
why add new syntax when stdlib can do it
imagien if you made javascritp into c++ with std namespace const std = { String };
HORROR
π
/run
#include <iostream>
std::cout << R"(\
)";
Here is your c++(10.2.0) output @winged mantle
\
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();
}
so good
/run
#include <stdio.h>
#define join(a, b) a##b
#define entrypoint join(m, ain)
int entrypoint() {
puts("hello world");
}
Your c(10.2.0) code ran without output @winged mantle
/run
#include <stdio.h>
#define join(a, b) a##b
#define entrypoint join(m, ain)
int entrypoint() {
puts("hello world"); // main
}
Here is your c(10.2.0) output @winged mantle
hello world
discuss
kinda real
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
you could just make a plugin that does http requests to openai compatible endpoints or ollama api or llamafile api
actually I mean, many libraries are using normal fetch anyway so bundling them shouldn't be a issue
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)
if the module is supported in the browser you can probably just import it
idk about CSP and CORS though 
if not, vencord has a native module system
native being "node" native
yeah ive seen it im just incredibly confused on how to set it up as theres only one plugin ive found that works with it
honestly the documentation for it is very lacking
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
no way chrome is going the microsoft route
i saw theo's video about this
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
its prob gunna take the shape of a support helper or something along the lines of that
can you not give it a prompt before it runs telling it what it needs to do?
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
interesting
the generic part is that gemini being shit but that's just google for you /shrug
because I can't think of any real-world case where a compact model could help a variety of embedded support agents
yarn is a package manager, it doesn't matter
currently it's summarization, acting as some form of search engine, explaining but I can see it being more integrated
surprised people are catching on now when it has existed for 3 months atleast lmao
Why i haven't seen this one
Ah, nightly
lmao i can't even enable it
probably makes sense ( 6gb of ram ) but nano should be still okay?
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
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
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
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
Perhaps i'm misunderstanding but this? http://npmjs.com/package/@bit-js/valify
creates an assertion function
i think i will it's less verbose

if youre using zod why not use straight zod
i guess i could add zod to the frontend too and create a plugin or whatever for automcompletion based on the zod object
it's not really seralisable
ohhh sorry
doesn't vscode natively support schemas
but i am using json5 anyway
which still doesn't support multiline strings
:|
quick thing, is there an alternative for adding reactions using vencord? the old findByProps method doesent seem to work
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
i don't think anyone is gonna help you with developing malware
im trying to log back in to all the websites im on
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
@pastel mauve if you can uhhhhhh get a mesh of vennie plush i can make it an asset in my game
i dont have a mesh of her
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
why is that iife..
i was running it in an about:blank tab
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"])
woww!!!!
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
flop
?
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)
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]())
only issue is it doesnt force you to do it in a complicated way
hmm
i wonder
afljadsdjas
this would go hard as an obfuscator
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
thats kind of why i was messing with proxies personally
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
just compile all your logic into wasm at that point
meh
not very fun
i could easily compile it to wasm if i wanted but obfuscation is more fun
so good
hmmm i have a bad idea
too bad wasm has no access to the DOM directly π’
avoiding js entirely would be based
@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
xor with what
prop^someKey
xor with what
well ideally you'd have a preprocessor that generated a key i think
Β―_(γ)_/Β―
fun
actually i think i have seen someone use this in obfuscated code
i think i remember watching a video about it
this is nitpicky ash but cant you omit the argument to codePointAt if the index is 0
Β―_(γ)_/Β―
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
yk i didnt know you could iterate like a string that way before
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
more complicated with one
that gave me a recursion error when running in firefox console
how
i edited it again
now it works
function e(state="", ...restArgs) {
if(state.length!=1)throw "COMPLEXITY IS REQUIRED"
return (...args) => {
if (args.length) return e(state + atob(args.join("")))
return (0, eval(state));
}
}
e("console.log('tes")(e("t')"))
btw with this u can also do this
e("c", "o", "n", "s", "o", "l")("e", ".", "l", "o", "g")("(", "'", "hi", "'", ")")()
ok now you should make it use the xor thing
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
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")
does @types/package go into devDependencies or dependencies?
devdeps
thanks
anything you only need during development is dev deps
anything you need at runtime is normal dep
gotcha, didn't know if you need types during runtime
in plugin creation, what does a message being optimistic mean?
when you send message, it is gray first then turn white, the gray one is optimistic
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
yeah I'm making a thing too
I've written obfuscation shite for Wasm
Oh?
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
What are they wanting it for?
i dont personally like obfuscation
what's the (0, eval(β¦)) for
did you mean (0, eval)(β¦)?
ye i typod
maybe it would be cool to support regex as native type in config file format?
gay_regex: /ga(y/i)/g
yes but
it's JSON under the hood
so
that means some hackiness with settingsstore
actually nah it's a bad idea
why
makes it less portable
????
in order to implement config you need whole regex lib
oh yes
what will your config be used for
config.help
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
does it support trailing comma in objects
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
π
i just thought if i allowed ["hi",,"world"] that would be confusing
why allow both
in JS this would be a ["hi", empty, "world"]
semicolons in objects feels like trauma from typescript types
which would be funny but still not a great idea
is this true @winged mantle
the idea is to make it like yaml but more c like
in typescript you can use both semicolons and commas

the reason for semicolons is...
yaml sucks because of why python sucks
that doesn't look very good
this looks cursed but is readable and parseable
only breaks if you add unquoted strings
horror
age??
NO
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
use iso8601 like a normal dev
but iso allows spaces doesn't it
i would disallow spaces but then it wouldn;'t be compliant
No
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...
the best format for user input is loose
just allow anything that looks like it could be a date
wtf

excel logic?
this format is something I have never seen
it's used in filenames; the / makes a directory
unix only software then
because of the :
fuck windows
so true
ntfs is a fucking mistake
windows filesystem api is a mistake
I read this as ntts is a fucking mistake
nix
our variables are standard identifiers, plus -s and non-adjacent 's
spacing
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
breaking news: significant whitespace is good sometimes actually
and 1-1 is 0 since 1 isn't an identifier
the fuck
/run
#include<stdio.h>inti=5;printf("%d\n",i);
@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

oh, preprocessor
and you need a space between int and i
yeah how else do you split tokens
js has destructuring
semicolons
would you rather have sigils
trol
You need a newline after stdio include too
NO
/run
#include<stdio.h>
int i=5;printf("%d\n",i);
Here is your c(10.2.0) output @glacial mirage
5
