#πͺ -progaming
1 messages Β· Page 8 of 1
@dusty moth any way to get it working on windows?
i've tried it without the > temp.json as well
same error
what the fuck
i'm following what you said
try cmd
that kinda works, so change ' to " and yell at the powershell devs
also jq won't modify in-place
this simply printed out the entire json
damn, why not?
and DO NOT redirect to the original file for legal reasons
what
save that in a different file, then rename over
can it be done in one line
a > redirection clears the entire file before jq gets around to reading it
there might be sponge
| tee
man why is this shit so difficult, why can't vscode have a thing similar to emmet but for json
depends on if Windows ships it by default
that also truncates the output file iirc
hold on what
hold on checking source
try with more than 4096 bytes
yall, wanna see a one line sneak game in esoteric python :))
Warning: the following content contains material that may be harmful for bare eyes users or traumatizing to some users, view it on your own risk, the owner of this code or the distributor is not responsible for any damages
||py (pg:=__import__("pygame"),__import__("pygame.locals"),ri:=__import__("random").randint,sc:=pg.display.set_mode((600, 600)),cl:=pg.time.Clock(),sp:=pg.Vector2(10,10),sb:=[],di:=pg.Vector2(10,0),nf:=lambda:globals().update(fo=pg.Vector2(ri(0,59)*10,ri(0,59)*10)),nf(),[(sb.append(pg.Vector2(sp)),sb.pop(0),sp.__iadd__(di),(sb.clear(),sp.update(10,10))if(sp in sb or not(0<=sp.x<=600and 0<=sp.y<=600))else None,(sb.insert(0,pg.Vector2(-10,-10)),nf())if sp==fo else None,sc.fill((0,0,0)),pg.draw.rect(sc,(255,0,0),(fo.x,fo.y,10,10)),pg.draw.rect(sc,(255,255,255),(sp.x,sp.y,10,10)),[pg.draw.rect(sc,(255,255,255),(p.x,p.y,10,10))for p in sb],[((1/0)if ev.type==pg.locals.QUIT else di.update({pg.locals.K_w:(0,-10),pg.locals.K_s:(0,10),pg.locals.K_a:(-10,0),pg.locals.K_d:(10,0)}.get(ev.key,di))if ev.type==pg.locals.KEYDOWN else None)for ev in pg.event.get()],pg.display.update(),cl.tick(10),)for _ in iter(int,1)]) ||
snek :3
this is beautiful
what are good projects to do
Using regex in javascript, how do I get all the URLs from this string?
sources:[{file:"https://....m3u8/?...%22},{file:%22https://....m3u8?...%22}]
/file:"([^"]*)"/g works on regex101, but
/file:"([^"]*)"/g.exec('sources:[{file:"https://....m3u8/?...%22},{file:%22https://....m3u8?...%22}]')
only gives the first url
I would do something with eval to just turn it into an array, but I can't trust the source of the string
JSON.parse
oh it's not proper json
where you are getting this data from why is it in this format
JSON.parse doesn't like JS objects that are missing "" around keys
you could do a little regex substitution on it first if the keys are fixed
even if they aren't you probably can just more pain
A video site's jwplayer config
try matchAll
That works, thank you so much
is there a way to extend the lifespan of an interaction token?
I want my user installed app to delete it's messages after an hour, but the token expires after 15 minutes
you can probably delete them the standard way (with the bot token) since it's owned by the bot?
ofc that won't work if it's not in the guild i guess
chat help me
im getting a hidpi display which means i have to move off X
which wayland WM doesnt suck?
or well i currently run xmonad. whats the closest i can get to that?
Hyprland
blocked

doesn't work in guilds or dmds
is qtile any decent?
sway
I like and use hyprlanf
3 votes for sway
If you don't really want to use hypr for some reason, sway might also be a good option, so 4
GNOME
No
Plasma 6
late but adding another vote for sway
5 votes for sway
+1
niri is pretty good
is sway better than hyprland or vice versa? i just used hyprland, it seemed cool to me
Sway
sway is more stable
hmm i will try
Kwin
Based
true
OH MY GOD now i know why ungoogled chromium now uses this ugly icon
https://github.com/ungoogled-software/ungoogled-chromium-flatpak/issues/3
what a silly issue, it's not even trademarked...
oh god i hope they revert it, that icon looks like some ass. im lucky i forgot to update 
How do i print the word penis
i hate open source devs immediately getting terrified whenever someone mentions anything vaguely legal related
they didnt even bother to check if it's actually trademarked π
yo does the sendMessage vencord function allow for images and attachments to be sent?
if not is there another built in thing for that?
thanks
does this send the message with the attachment or does it "add" it to something?
ok ive been trying to use this for a while now but its always returning undefined?
this is what im passing it:
```ts
const uploadedAttachments = await UploadManager.addFiles(channelID, files, null, {});
What is the purpose of (0,x) instead of just x in webpack outputs?
idk tbh
just some js weird behaviour
to keep same this binding
Here is your js(18.15.0) output @royal nymph
we are local
we are global
we are global
input code:
import { method } from "foo";
import bar from "bar";
method();
bar.method();```
output code:
```js
var a = webpack_require("foo"),
b = webpack_require("bar");
(0, a.method)();
b.method();
(a, b) just returns b as a value instead of a reference
which makes it so that it has no object receiver and thus this will be the global
thanks
I love js
makes sense
terrifying
bros fucking profile looks like it was drawn by a child and theyre being pissy over an icon π
oookayyyyyyy
cat rolling
what the hell just happened
most usable github alternative
honestly that happens every time I try to push something to codeberg
it usually works tbf xd
I tried it, it's very much usable
imho defo more barebones than d.js
but very much usable
(unfortunately can't share the repo rn)
Why is your discord bot located in /opt/
because why not?
where else would it be located
it usually works well and when it's in good condition even is faster than github
but they're struggling with scaling and seem to be getting a bunch of malicious traffic lately
is it better than gitlab?
depends how you define better
codeberg is about freedom, privacy and the community
github and gitlab are corporate / commercial
that's part of why codeberg is struggling cause they're a non profit
gotcha, had it in my mind that gitlab was also nonprofit but I think I confused it with being open source
gitlab is not open source either
there is gitlab community which is open source
but gitlab.com is gitlab enterprise
which is also very corporate
oh lol
it's kinda like vscode / chrome / intellij
the core is free software but the official branded version is proprietary
that's more or less the only sustainable open source model xd
my home directory is already like 350 gb of random garbage, so, no
purge it
i do biannual home directory purges
just buy more hard drives
purge thyself
It's mostly steam and backups and, honestly, who knows what
I'm too lazy to go through it
I have 3 AIs modules of the size 300gb, and never used them lmao
Yeah, and I have a 500 GB SSD
you "a" or is that your drive
1Tb SSD is good enough for me
yeah that is my drive
I'm not kidding btw
Not enough messages saved for channel
Not enough messages saved for channel
hmmmmmm
continuing here
ye
errors about undeclared variables
yeah u would have to include vars.h as well cus ball.h doesnt do it for u
dont think that would change anything
ugh havent programmed in a while my brains rotting lol
ill look at my other projects
im p sure i do the same thing and its normal
this is so simple but so confusing im sure ive done the same thing and it worked fine :p
does gcc like not have pragma once or something? surely it does
yeah
am i stupid
i can't figure it out still
@fluid temple i didnt think this was necessary but i guess it is, its what i had in mind earlier but i said it wrong```c
// vars.h
extern int var1; // only declarations, not setting any value
extern int var2; // extern basically means that its using the variables from another source file
// vars.c (new file, dont include btw, same with any other non header file)
int var1 = 123; // u can set default values here
int var2 = 101010;
i think this should work
my bad, i dont usually initialize global variables like that so i wasnt sure :p
i had a feeling extern should be used tho
in c++ u can use the inline keyword instead
that appears to work
:D
it should be fine
it only initializes once in the one c file
and the header only decalres the variables
dont remove the pragma once ofc
remember to have that always
if u can have ur ide automatically add #pragma once to new header files htat would be useful
normal visual studio does that for u and its really nice
id prob be forgetting otherwise :P
if u use c++ (doesnt seem like it but good to know anyway i think), u can avoid having a c file
and just
add inline in front of the definition
so like
inline int var1 = 123;
and it should work
yeah i dont use cpp and idk if the libs im using even work with cpp
i actually do this in my projects
but i thought it was specific to namespaces for some reason
bc i have all my global variables in namespaces
using extern like that is the same thing but works in c
glad i could help btw i have too much free time u can @ me if u need more help
im not doing anything
after further testing, all now works and the ball moves using trigonometry now
@woven mesa
is this robust enough
let source = basePath?.managers[indexPath.row]
cell.textLabel?.text = source?.name```
seems to be
what is your theme
Xcode default
yop

I have to fixup my previous code cos its so messy I dont even know what I was doing back then
yo ok ik i asked a question similar to this earlier but i really dont get it. I want to be able to find an image in a message and send it using the sendMessage or some other kind of function that allows me to spesify channel ID
prolly a dumb question but i do need help
.ytp-caption-window-container > * {
background-color: rgba(0, 0, 0, 0.5) !important;
backdrop-filter: blur(32px) !important;
width: fit-content !important;
padding: 0.25rem;
border-radius: 0.5rem;
}
.ytp-caption-segment { background: transparent !important; }
youtube glass subtitle css
hey yall,
i'm trying to create a plugin, that makes a new text label near the username (pic attached)
everything i've got so far is this (with react components)
return (0,
a.jsx)(s.default, {
guildId: n.guild_id,
message: t,
channel: n,
repliedMessage: E,
author: p,
compact: i,
subscribeToGroupId: r,
showTimestampOnHover: !o && i && t.type !== c.MessageTypes.REPLY,
renderPopout: u.default,
showAvatarPopout: h,
showUsernamePopout: f,
onClickAvatar: _,
onClickUsername: S,
onContextMenu: g,
onPopoutRequestClose: T,
roleIcon: C
})
any ideas on how to determine that exact item inside the UI and create a new text label to the right?
there's an api
look at how PlatformIndicators adds icons
took me awhile to add it to plugin list
What?
what?
I donβt understand what your adding to the plugin list
^
Then why are you messing with the plugin list
..because i had to run pnpm build and pnpm inject after i made the code?
it doesn't have to mess with it?
i'm saying that it took me some time to realize that i should run that^
before i wanted to see the actual changes to the plugin
any ideas how to disable adding 2 icons at once in the platform indicator plugin?
i assume it has to do something with this
no, it doesnt
figured it out myself, this line was responsible for adding >2 icons to the user's badge list, if the user is using >2 devices at the same time:
const icons = Object.entries(status).map(([platform, status]) => (
<PlatformIcon
key={platform}
platform={platform as Platform}
status={status}
small={small}
/>
));
changed it to const [platform, platformStatus] = Object.entries(status)[0];
i gave up
literally no idea on how to add this w/out making a new patch #π§©-plugin-development message
you have to patch it
i'm still trying and thinking
atp i'm so desperate i would pay in 10$ discord nitro/eth to anyone who can do that
i need to clone that icon to the timestamp position
i understand that i must use this
correct
i don't understand what should i be looking for, even w/ react devtools
you are trying to patch a component
yes
use the react devtools, select it, and click the source button to jump to where that component is located
you might have to look for components above the one you are selecting
try a little bit more
found it
the bigger one
moved into #1247799286914093088 to not flood things up
use pnpm watch, so u dont need to reinject
thank you
real time update, for ui changes prob u should ctrl+r in discord
ye ik, thanks anyways
uh, congrats?
okay?
discord app has native parts
you cannot decompile that lol
thats not how that works
no im aware of the sm64 decompilation
i mean "thats not how it works" in the sense that bc they did that doesnt mean you can decompile native parts of the discord app like that
you can do pretty much the same thing though (not implying that the person above did tho)
but you'd have to p much hate urself cuz reversing native node modules sucks so much...
average non binary (not in that way) re trying to do first binary re
no, i've seen ida more than i've seen my family lol
might've seen my mom more than x64dbg tho
i was joking but actually since you have exp why does reversing native node modules suck? is it the native to js interface fuckery?
i love when u can tell code was written out of anger
private boolean isMojangStupid(GrimPlayer player, WrapperPlayClientPlayerFlying flying) {
double threshold = player.getMovementThreshold();
// Don't check duplicate 1.17 packets (Why would you do this mojang?)
// Don't check rotation since it changes between these packets, with the second being irrelevant.
//
// removed a large rant, but I'm keeping this out of context insult below
// EVEN A BUNCH OF MONKEYS ON A TYPEWRITER COULDNT WRITE WORSE NETCODE THAN MOJANG
it's true though
found how to get sorted guild list so leaving it here in case someone searches for it in the future
Vencord.Webpack.findByProps("getGuildFolders").getGuildFolders().map(e=>e.guildIds).flat().map(id=>Vencord.Webpack.Common.GuildStore.getGuild(id).name)
in the world of hell java
tons of atomic operations for thread safety that add a ton of noise for re, lots of subs that consist of 5 jmps until it gets to the actual sub, and a bunch of other stuff
i haven't written any napi modules yet but looking at it in ida it seems like a ton of macro abuse, it's not impossible to re or anything, and it helps that it's open source (not only can u guide urself with the source but also make TIL/FLIRT files), but its just not fun i guess, specially when it hits you with something like this
oh i love inline vector assembly in my pseudocode
WTF LMAO insanyity
Hey! Can someone tell me which code of Vencord handles patching for browsers?
browser/
is there a profile picture cycle plugin thing
that like cycles through a pfp folder with an intervall or something
No and there never will because that's selfbotting
oh k
selfbotting?
ig thats something against tos
Very
quick question whats a personal connection id?
k...
Users in Discord are generally considered the base entity. Users can spawn across the entire platform, be members of guilds, participate in text and voice chat, and much more. Users are separated by a...
why dont i wanna click on that url
also thanks btw
oooh is that a thing that just links a discord staff acc to a discord personal acc?
i would like to see the original rant lmao
.map(...).flat() is criminal
may i introduce you to .flatMap(...)
forgot that's a thing
Youβve found the Unofficial Discord User API Documentation! These pages are dedicated to showing you all the ways that you can use Discord to make cool stuff. It is not an official source of informati...
i might be stupid but why could d[e.folderNode.id] be undefined if i am checking for it in the if statement
is the linter just being stupid
not an answer but what is your font? looks like comic sans but monospace
yea
i love it
danke
yeah just use a non null assertion
d[e.folderNode.id]!.type
ty
ofc
was wondering, what provides the quick css editor? is it a custom thing? I noticed it looks and behaves similar to vscode
oh it's a microsoft thing that explains why it's so similar lol, thanks
it literally is vscode
The Monaco Editor is the fully featured code editor from VS Code. Check out the VS Code docs to see some of the supported features.
huh this thing got blocked on my country? 
show
is your dns server blocking stuff with sex in the name lmaoo
I believe so
I can enter it with a vpn tho
no sex allowed
u might be using the "most abused TLDs" filter list
which basically includes every non "normie" tld lol
nvm i looked into it and .sex is one of the few gtlds NOT on that filterlist
wtf
doesnt seem to be on that one (which is the one i referenced)
but as with everything there are a million "most abused tlds" filter lists
or lists that accomplish something similar with a different name
tf
IS_MOSTLY_FEMALE
LOL
latest version released: 2015-02-03
was guessing 1995
php turns 30 in exactly 1 year
sussex
π
I think they use their own, because before months I was able to access it now its just connection reset
ah yes, my favourite gender Gender\Gender::IS_UNISEX_NAME
also why are countries there
my fav gender is italyπ₯
Ah yes, Germany, my favorite gender
aw man
I HATE GIT
I like gitkraken for this purpose to see the tree structure before pull
What are you trying to do
i like lazygit
i hate merge conflicts sm
git pull
anyone tried NuxtJS? Is it any good?
i kinda dislike react
Very based
I have made so many projects with nuxt and it's stupid easy
Vue >>> React imo
I don't know whether I should use Nuxt.js or Next.js for a bigger project to increase my portfolio
I don't know what companies usually go for, zzz
i mean react is "king"
yes
That is a horrible mindset Ngl
Find something you're comfortable with and make a bunch of functional things with a tool you enjoy using
it's good to go with something with a good community and ecosystem.
why do you think people still use windows? xD
Better Gaming support and Adobe too :3
ah yes
some x library > worlds worst library
do you guys know what the css identifier would be for any labels that show up when you hover over something?
like this, but not for just servers, i would like to capture any similar labels if it's possible
[class*=tooltipPrimary_]
thank you!
adobe software support is a horrible excuse 
yeah gimp sucks but adobe propietary nightmare
Yes I have
Honestly prob one of the worst decision to use it
Windows had 
noooooooo
also league
nvm
it doesnt anymore
it uses vanguard now
linux can run league
oh
Currently i have contact with my friends only on weekends because on the rest of a week they play lol 24/7 and yell too much for me to be able to sit on vc
Idk if i should be happy or sad about vanguard
no, vanguard
Yo can you get third party plugins to work on the weba pp?
I wanna try getting some to work on vendroid
you have to:
- build vencord
- upload
browser.jssomewhere - clone the actual vendroid app
- change
JS_BUNDLE_URLin Constants.java to your browser.js url - build app
- enjoy
god that seems so easy yet why do i know its not
because it is
also theres no browser.js file theres just a folder named browser with eerything in there
Yeah I just started to use my eyes
Figured it out
I'm a dumah
Fr shouldn't have the dev build
oh god how am i supposed to add the plugins?
the code for browser.js looks like its made by a young me
yeah after this im never developing for mobile if i can
wait i can build the browser folder?
huh
alr lemme go se ehow im being stupid this time
I'm using the IndexedDB API to store metrics, according to the (Mozilla) docs the store can be evicted at any time, can I sync this to disk, backup, or something? Or should I just offload the data-storage to an external service entirely instead?
its perfectly fine, the data will stay unless the user gets rid of it
with the DOM api i think IndexedDB is the closest you are going to get to storing stuff on disk unless you also use electron ipc?
it's not gonna be deleted
only if the user hasn't used your site in ages or if they delete it
you should not store mission critical data there, but you shouldn't store that anywhere where the user can delete it xd
Any thoughts on this? https://eta.js.org/
Lighweight, powerful, pluggable embedded JS template engine
looks good
interesting
@ornate quiver https://github.com/khushpanchal/Ketch
ok is there a webpack config i can use to build with npx?
what
run pnpm run, or look at scripts inside package.json to see the available scripts you can run
Auugh fine I'll stop lazing around on tiktok lol thanks for the info
so ive basically gotta run the buildbrowser
well that looked like it worked
omg yes thank you so much
wtf why is everything just <<%<<<%<%<%<%%%<<%<<<%<%<%%<%<%<%<%<%%<%<%<%<%<%<%%%%<%<%<%<%<%<%<%<%<%<%<%<%<%<<%<<%<%
why not like << 2 +2 >> or smth
it would look way better imo
Not a huge deal to me
What's the most robust way to grab onChunksLoaded for patching in WebpackGrabber? WEBPACK_GRABBER.require.O does interactively exist on the page I'm testing; should I hook that while defining WEBPACK_GRABBER?
i'm also referencing https://github.com/moonlight-mod/webpackTools/blob/main/src/Patcher.js but they set up differently, using a known chunk object property name
hooking via Object.defineProperty(this, "O", {configurable: true, set(onChunksLoaded) { β¦ }) after defining unsafeWindow.WEBPACK_GRABBER seems to work.
i'm now realizing that i don't think i need this to patch chunk push
what are you trying to do?
set up module patching for arbitrary sites using Webpack using a userscript
looking at https://github.com/webpack/webpack/blob/34e2561addb0f65a7a6fb0ce7ae1aea4cd1d599f/lib/web/JsonpChunkLoadingRuntimeModule.js#L464 , i think i would still want to hook onChunksLoaded because that gets me a hook into push for free
JsonpChunkLoadingRuntimeModule.js: Line 464
"chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"
here's my current code. I don't understand how to interpret the logs I'm currently seeing.
(this is meant for Firefox with FireMonkey. you should be able to run this in Chrome or with other userscript loaders by defining your own const cloneInto = (value, scope, options) => value; and maybe unsafeWindow = window;.)
if you have access, the exact thing i'm testing on is Datto RMM.
but the problems i'm having should be pretty generic to Webpack 5
i'm also noticing that WEBPACK_GRABBER.entryPoint is undefined; haven't properly debugged that yet
ooh, just tested under Discord and "Patched initialize app callback invoked, initializing our internal references to WebpackRequire and running beforeInitListeners" does get hit there under discord_app, where it doesn't under rmm_fe.
WEBPACK_GRABBER.entryPoint is still undefined under Discord though.
not really it can't
the most you can do with onChunksLoaded is grab this, which is the webpack require
and monkey patch the init function to run what you want before initing
I have something which can help you understand some of the properties there
however I need to say it is quite hard (if not impossible to know which name webpackChunkdiscord_app will have
it's possible to know, but probably not as early as you need to
I could be wrong but I don't think Datto RMM webpack contains onChunksLoaded
and yes, entryPoint is used when onChunksLoaded does not exist
discord has onChunksLoaded, and not entryPoint
a generic module patching is very complicated, maybe doable, but likely not using .push
but instead proxying __webpack_require__.m
I have this working here, https://github.com/Vendicated/Vencord/blob/immediate-finds-modules-proxy/src/webpack/patchWebpack.ts, but it's very complicated as I made it as bullet proof as possible
however it's still mainly tied to discord, so a more generic version would be even harder
i'm pretty sure it does. from the debugger source map, only place that mentions webpackChunkrmm_fe,
installedChunks[chunkId] = 0;
}
return __webpack_require__.O(result);
}
var chunkLoadingGlobal = self["webpackChunkrmm_fe"] = self["webpackChunkrmm_fe"] || [];
chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
which matches withOnChunkLoad ? `return ${RuntimeGlobals.onChunksLoaded}(result);` : "" in JsonpChunkLoadingRuntimeModule.js. onChunksLoaded should be WEBPACK_GRABBER.O.
yeah, sorry for the inconvenience there
but yeah the other things I mentioned still apply
you could easily hardcode webpackChunkrmm_fe and patch .push
but making it generic for any website isn't doable that way
is there a way to find out which guild (or even channel) a webhook belongs to if all i have is the webhook url?
(NVM)
yo is there any way yalls recomend for testing mobile apps? as in is it easier to start an android studio emulator or to just download it on my phone?
downloading to phone easier, starting emulator safer
you can put ADB in persistent-wireless mode to avoid disconnection
oh allr thanks!
also how the hell do i right click. on discord web mobile π
i cant open message ctx whch makes hlf my plugins useless lol
Long press
that doesent do the same thing i dont think
the second one with quote and save etc is from right clicking the message
the one with less stuff is from using the 3 dots
idk whats happening all ik is that those 2 arent the same
Seems like the things from vencord plugins don't get added to the ... one
yeah but there must be some kind of patch for whatever that menu is called
cuz i dont see a diffrence in the menus
or why they would be diffrent
fairly late but I feel like you probably want this plugin enabled @median root
i dont think thats it cuz it just removes the 3 dots icon, i dont think it changes the right click function?
wait what how did that fix it
well thank you
In programming people often site "performance" when arguing against early returns
But I don't see how using early returns hurts preformance.
If anything, needing to store an out value
function letterGrade(score) {
let grade = 'F'
if (score >= 90) grade = 'A'
else if (score >= 80) grade = 'B'
else if (score >= 70) grade = 'C'
else if (score >= 60) grade = 'D'
return grade
}
Costs more memory and cycles than returning as soon as possible?
function letterGrade(score) {
if (score >= 90) return 'A'
if (score >= 80) return 'B'
if (score >= 70) return 'C'
if (score >= 60) return 'D'
return 'F'
}
Also early returns are just way cleaner?
I was talking in general, not javascript
I'm just most comfortable writing js with my phone
oh ok
it might have less impact on compiled languages where the compiler is allowed to take 7200 years to optimize you
but yes i think early returns good :3
Mrw my js bundler takes more than 20 nanoseconds for a hot reload
Mreow
this girl
there are probably more things that are unoptimized in your code that requires change ratehr than nitpicking those small thingies that dont really make a change
and if you were to really hyperoptimize things you would probably end up branchless
hyper optimise
const grades = ["F", "F", "F", "F", "F", "F", "D", "C", "B", "A", "A"];
function letterGrade(score) {
return grades[score / 10 | 0];
}
unless you're writing something that needs to be incredibly performant, you don't need to worry about the little things
you're not writing a 3d graphics engine
well in a shader thats where you would probably try to be as branchless as possible
tho even there it is somewhat acceptable "sometimes"
ultra optimise
const grades = [
"F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
"F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
"F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
"F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
"F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
"F", "F", "F", "F", "F", "F", "F", "F", "F", "F",
"D", "D", "D", "D", "D", "D", "D", "D", "D", "D",
"C", "C", "C", "C", "C", "C", "C", "C", "C", "C",
"B", "B", "B", "B", "B", "B", "B", "B", "B", "B",
"A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A"
];
function letterGrade(score) {
return grades[score];
}
const grades = "FFFFFFDCBAA";
function letterGrade(score) {
return grades[score / 10 | 0];
}```
u dont need the array
just get at string index
really?
boo your 30 cycles down the drain
or whatever a division is
probably optimised eitehr way
guh off by one well whatever
oh now

Ultimate optimise
function letterGrade(score) {
return `you got ${score}, figure it out yourself`
}
nop slower
have to stringify number
Fine
function letterGrade(score) {
return "guess";
}
i'm assuming that for chromium based browsers headless is the only way that you can debug a browser and execute arbitrary javascript code
which does not allow you to set your user data directory for obvious reasons.
Somehow, is it possible to use some sort of sorcery / workaround to do the same yet allowing users to keep their user data while having arbitrary javascript
browsers are sandboxed so I'm assuming this is impossible or near impossible to do but uh
idk
?
execute aribitray javascript to get data from site w/ keeping user data
in short
how to
define keeping user data
do you want it to be unchanged? or do you want your automation to use the user's data
yeah I guess that's what they meant, using the user's profile
i dont do java script
but the uppercase ASCII characters happen to be close to one another
And I would assume that one less-than check branch for the F
and an addition and cast into a char is faster
than an array lookup
Since this array will also have bounds checking
you can't specify user-data-dir along with headless
Headless chrome i believe is essentially like a kind of guest window that can be manipulated.
I want it to be more convenient for users and those less knowledgeable to keep say for example being logged in on a specific site, having their extensions kept, bookmarks, etc
you can tho
whatr
await puppeteer.launch({
userDataDir: './myUserDataDir',
})
for example with puppeteer
chromium takes a cli argument for user data dir
gotta love tryna push something to codeburger
debug1: kex_exchange_identification: banner line 0: Exceeded MaxStartups
kex_exchange_identification: Connection closed by remote host
Connection closed by 217.197.91.145 port 22
in fact
$ nc 217.197.91.145 22
Exceeded MaxStartups
apparently its built in to not allow the two flags to run together
ill test tho
oh nvm
uh
uh
uh
do not
i shall
you....shall not βββββββββββββββββββββββββββββββββββββββ
idk shit about webdev but how the fuck do i fix this
button script: ```---
import Button from "../components/navbutton.svelte"
<section id="Friends">
<h2>Friends Sites!</h2>
<div>
<form action="https://google.com">
<Button class="buttonimg">
<img class="buttonimg" title="test" src="/public/vee.png">
</Button>
</form>
</a>
</div>
</section>```
button css } .buttonimg { width: 50%; border-radius: 50%; }
i dont understand why the button size/radius is not matching the image size/radius
im really dum
your Button is half the width of its parent container, and then your img is half the width of Button
i think i got it
idk why its not centered
is it because i put it in a body
Who should I contact to pester about https://github.com/Vendicated/Vencord/commits/main/src/plugins/spotifyControls ?
Would it cause any issues for the Spotify Album IMG CSS declaration to be placed in ::root or whatever? I really would like to be able to replace certain elements with the cover image. Let's say the BG. I was able to do it, but I REALLY don't like the way I did it. Because the declaration is in the Spotify Control element, you can't use the declaration for anything before it. I got around this by using ::AFTER and setting a z-index for every single element, which kinda gives me the heebie jeebies.
????
wht
this looks cool https://www.npmjs.com/package/kysely
hmmm i wanted to use a database to also store bot state. but i basically just need one single object, not an entire table
is there any good way to do that or should i just use a json file
i kinda hate the idea of writing a manual json file
do not the json value
storing state in a json files is a good way to corrupt your state when reading or writing it if you have any sort of parallel process and don't write concurrency safe code
nvm you're vee you're smart enough
new pfp I didn't recognize i thought you were someone who didn't know better
carry on I don't care about your json file 
any actual good extensions on vscode for making a discord bot with discord.py, i feel stupid that i can't find anything that is good
something that shows module's attributes properly
do note i could just be stupit
this intrigues me because i'm storing shit with a json and feels wrong lol
or at least, trying to
starboard bot that stores guild information that it's gonna use
install the python extension
I use prisma for my bot currently but drizzle-orm works well too and without any build steps
if you just want to store single kvs, use unstorage
if yall want to talk just contribute to vencord during lockdown
alternatively this can happen if your bot crashes (e.g. pulled out foxtail during firmware programming)
noted, thankers
i don't know what else you said means but i will learn!!!!

yeah i know
well it shouldn't be a problem because i just use fs.writeFileSync, but it still feels wrong
but making a table in my DB would also feel wrong
sql was really not made for storing one off values
i really wonder what's a good way to store state like that
KYSELY MY BELOVED
well its not used yet
but its ready to be used
xd
index.ts: Lines 9-16
const sqlite = new Sqlite(join(DATA_DIR, "db.sqlite3"));
sqlite.pragma("journal_mode = WAL");
const dialect = new SqliteDialect({
database: sqlite
});
export const db = new Kysely<Database>({ dialect });
nom
yeah kysley is good if you wanna write sql safely
drizzleorm is best if you want to work with objects, genuinely the dev experience blows everything else out of the water for me
cuz drizzle is written like a query builder but is a proper orm, and has an opt-in query api that makes it a bit easier to write certain repetitive things
drizzle looks very cool too
maybe i'll switch

tbh i didnt know what to choose
i looked at a few and chose what seemed the best
i mainly didnt want shit like typeorm
used it in the past and didnt like it that mcuh
i have also used typeorm and it was quite mediocre
what abt sequelize
now that venbot has persistence i can finally do this
yay
just dont set it to 0ms
or explosion occurs

ve Commands.sticky.execute.toString()
execute(msg2, operation, value, ...extra) {
let response;
switch (operation?.toLowerCase()) {
case "on":
BotState.sticky.enabled = true;
response = "Sticky message enabled!";
createStickyMessage();
break;
case "off":
BotState.sticky.enabled = false;
response = "Sticky message disabled!";
deleteStickyMessage();
break;
case "delay":
const delay = Number(value) * 1e3;
if (isNaN(delay)) {
response = "Invalid delay value!";
} else {
BotState.sticky.delayMs = delay;
BotState.sticky.enabled = true;
response = `βSticky message delay set to ${delay}ms`β;
initStickyDebouncer();
}
break;
case "set":
BotState.sticky.message = [value, ...extra].join(" ");
BotState.sticky.enabled = true;
response = "Sticky message set!";
break;
default:
return silently(msg2.createReaction(Emoji.QuestionMark));
}
return reply(msg2, response);
}```
sequelize is horrible please do not use sequelize
β οΈ I'm a trained professional please do not use sequelize β οΈ
it's so bad
wasn't for you sorry
LMFAO
i was just throwing yet another one in the mix
what's making it so horrible
horrible typescript support, lackluster performance, weird/bad joins api and can be said for everything if you do anything complex
do i have to define constants for astro in the import function, or can i do something like this?
that should work
I whant to learn how to program, where i need to start (javascript)
youtube is a good spot, there are also plenty of free courses available online
ππ» learn ππ» by ππ» doing ππ»
the odin project
just do the thing you wanna do step by step lookup google
I just know a bit of phython so... I like know nothing :/
Learn
if you know ABSOLUTELY nothing, start by learning some syntax of any language basically and how things work how to interpret 1 + 1 = 2 and then proceed by implementing your own super ideas!
in said language
youve mentioned javascript
lookup it on google rq how to start or whatever and there you go
Ok i will try, thanks for your time :)
Ik some stuff, but i dont rly focus that much on python
well they arent lying. that vencord is broken
vencord broke?
no way
oh that's 1 day old https://cdn.discordapp.com/emojis/1232505467972878396.gif?v=1
is there any documentation changes due to the vencord apocalypse
look into main commits or at the doomsday branch
doomsday branch got deleted i think
but lemme check
AHAHAHAHHA im reverse engineering the deepl private API rn and they have such weird security by obscurity
actually the iCount doesnt seem necessary
but the fucking spaces
hmm the rate limit is too strict
whats the new avatar class? tried to extract it myself with ctrl + shift + c, but using it seems to not work (.avatar__ec86aa.clickable__ec86aa)
π
learning ruby and rails
what abt ruby on rails
im learning ruby and ruby on rails
thats what i meant
Based
yeah im trying to learn ruby, rails and get better at react
react good
can i somehow import custom plugins, instead only of already built in ones?
(ping me when responding because i will forget)
you have to build vencord from source
if you know programming, no - if you can't follow instructions, yes
ik :3
svelte the best
omg state management for slash commands is hard
i want a message context menu commands that then sends a select menu and once you choose in the select, it does something new
you have to somehow pass the state around
i had stupid issues deleting slash commands with message tags
since itβs somehow cached until you restart
i think i suggested this to big nutty for labscore sometime but he meh'd at it
i wish some bot actually used that idea
well venbot will now
for support stuff
i just wish i could use a modal instead of a follow up message
https://www.youtube.com/watch?v=9kaIXkImCAM @ivory heath
Merch: https://posix.store
You can reuse this video freely. Don't contact to ask for permission. It's free to use for your demo reel, music video, tax credit application etc. Reuse allowed free of credit.
FFMPEG Interview with an FFMPEG enthusiast in 2022 with Fred Murpheg - aired on Β© 2022 The FFMPEG.
converting videos easily
computer graphics...
ive posted this already
π«
what if I can follow instructions but am very mediocre at programming?
@trail night wait why do people define schemas via code in kysely? it seems way comfier to write a sql file and then use the codegen module
very cool
I have never written a SQL query by hand
Immensely horrified of SQL despite my work being technically based on it
im obsessed with prisma so i dont have to touch sql queries usually
sql is weird
i took a class on it once
it probably would've been better if the professor didn't have us using ancient programs for it
i was in some coding club as a child that advertised as making minecraft mods and it was just java
and we used eclipse
child as in what age?
like 10 or 11 prob
wow
everyone else had no clue what they were doing and i made a calculator faster than all of them
what kind of calculator?
num 1:
operator:
num 2:
like you made a mod that had a command to use a calculator thing?
yep
ah
hmmmm...
i want to store modmail channel ids in my database and have only one modmail per user, but i have two options that both suck:
selectfor existing modmail, if nothing returned, create channel andinsert. has potential for race conditioninsertimmediately with empty channel id and onConflict handler, then create channel on demand andupdateto add the channel id
i wish there was a cleaner option than these two
so cursed
@trail night is there a better way π₯Ί
oh god turns out returning doesnt work with do nothing
if you want to be slightly insane lock the table during the select check and insert
(bad idea on code that needs to be performant/frequent write but fine for low traffic stuff like single server modmail)
i found a really cursed solution
updating an unrelated row to itself

there's basically no better way
other than...
??????????????
updating random row to itself is cleaner than whatever tf that is
and def better than two queries
i take it back transaction locking doesn't look so insane anymore
i guess if it works
smh you aren't using a transaction at all
why would i
my comments are mostly in jest, in case that didn't come across
but you'd use a transaction between the row insert and row update with the thread ID in case creation of the thread failed for some reason
yeah it's not huge for something this small
it just has potential for a few wasted bytes
but it'd be something that'd have to be manually fixed if discord ever has a partial outage (very likely)
nah
users would also be locked from making modmail threads at all wouldn't they
but it's the user id that has the uniquye constraint
yes
modmail.ts: Lines 71-99
const { channelId, id } = await db.insertInto("modMail")
.values({
channelId: "0",
userId: interaction.user.id
})
.onConflict(oc => oc
.column("userId")
.doUpdateSet({ id: eb => eb.ref("excluded.id") })
)
.returning(["channelId", "id"])
.executeTakeFirstOrThrow();
if (channelId !== "0") {
return interaction.createFollowup({
content: `You already have a modmail ticket open: <#${channelId}>`,
flags: MessageFlags.EPHEMERAL
});
}
const thread = await getThreadParent().startThreadWithoutMessage({
type: ChannelTypes.PRIVATE_THREAD,
name: `${id}`,
invitable: false
});
await db.updateTable("modMail")
.set("channelId", thread.id)
.where("id", "=", id)
.execute();
that's the conflict i tried to return the old value from
oh god `${id}` my hatred
i had it as modmail-${id} but decided that looks worse than just having the number
doesn't that open up a possible race condition
user clicks button > row inserted successfully > start to send API request to create thread
user clicks button again > row conflict but channel id still = 0 > send API request to create thread
first API request resolves and updates row
second API request resolves and updates row again
(it entirely wasn't my intention to analyze this so much it kinda just nerd sniped me, don't take it like I think your code is bad or anything ;w;)
yeah kinda
but it's not really that important
it won't happen unless you're deliberately causing it by sending manual request
and even if you do that, it has very little significance
like... you have two modmail channels now, congrats

mhm
well i should just use a transaction
i mainly didn't cause i was unsure how sqlite handles transactions
like if my transaction takes 1 second, will it lock the DB for that long?
it depends how you have your locks set up, but it'll only lock writes and other lock transactions on that table for that long if you lock only the table
selects will still work fine
also here's another ugly https://codeberg.org/vee/bot/src/branch/main/src/modules/modmail.ts#L221-L235
modmail.ts: Lines 221-235
const res = await db.selectFrom("modMail")
.where("channelId", "=", interaction.channel.id)
.select(["userId", "id"])
.executeTakeFirst();
if (!res) return;
if (!interaction.member.permissions.has("MANAGE_CHANNELS") && res.userId !== interaction.user.id)
return;
await interaction.defer(MessageFlags.EPHEMERAL);
await interaction.channel.edit({ archived: true });
await db.deleteFrom("modMail")
.where("id", "=", res.id)
.execute();
It might be worth noting that the locks in sqlite apply to the whole database and not just individual tables, unlike the LOCK TABLE statement in other sql databases.
wow I dislike sqlite even more now 
but if modmail is the only table in the db then eh i guess
i don't think a transaction necessarily locks?
it doesn't no
I had interpreted your question as planning to use locks since you asked about them though
i don't think this needs a transaction tho since i'm deleting by unique id
mhm that one is fine
reading on it more, locking how I wanted to with sqlite seems not possible anyways
I'm too used to postgres and the database i work on at work
wait does my id row update cause id skips
lmaooo
AHAHAHA it does
omg
This *feels" wrong
https://github.com/sadan4/Vencord/blob/unitConverter/src/plugins/unitConverter/converter.ts
either or tbh
depends on which side of the fence youre on
if youre an ORM person you would define it in code and generate sql migrations
otherwise you can do it manually like you are doing
insert doing nothing on conflict is honestly your best route, it kinda sucks
oh nice, a plugin to convert units, won't it be cool if it converted units from messages?
you can do ON CONFLICT UPDATE can't you
That's what it does
I need to check my life choices
what you're doing is introspecting a db which is sometimes useful for migrating from raw sql/other orms to your orm quickly
you pass the state via customIDs i.e something like actions.report.${id} then you extract the id
yeah
thats what i did
but it's ugly asf
and what if u need to pass more state than just an id
you'd have to store it in some map by id and then risk memory leaks
what's the custom id limit
can you just put json in it

This field is a string of max 100 characters, and can be used flexibly to maintain state or pass through other important data.
why does this happen when i make a branch based off vencord:dev
instead of This branch is up-to-date with Vendicated/Vencord:dev
Because github compares to the default branch, which in this case is main
it did it the other way before π
because the main branch is set default
you can put anything, url params, json, etc
url params would be most character efficient if you only have 100 chars
Γ±
hmmm would it be better to store type or use separate tables for stickers and emojis
Not sure how relevant but would anyone know if there's a way to navigate channels/send messages from the console of the offical webclient?
Vencord.Util.sendMessage(channelId, { content: "hi" })
I mean like, the regular webclient, sorry
Vencord.Webpack.Common.NavigationRouter.transitionTo("/channels/GUILD_ID_OR_@me_FOR_DMS/CHANNEL_ID")
but why..
you can use vencord on web
my 'webclient' is actually just electron with extra steps -w-"
i looked in the past and it seemed infeasible to get vencord to load
why not
is that not what vesktop is
if you're actually using electron, you can eval vencord's main, preload & renderer scripts
that's what vesktop does
ah
but for minimal vencord, you just need to add this css and eval this js from preload (before discord loads)
but it's your responsibility to keep it updated then
just peep the vesktop source
alternatively, eval/adapt to your needs this script
https://github.com/Vendicated/WebpackGrabber/blob/main/WebpackGrabber.user.js
and then you can just
const MessageUtils = WEBPACK_GRABBER.findByProps("editMessage");
MessageUtils.sendMessage("123456", {
content: "hi"
})
yeah i should have expected that shouldnt i
Hm. it's clearly doing something but i don't actually see any changes.
i do see dom entries
seems like you inject it too late
it needs to be injected before even the dom loads
Electron
but they don't have any useable replacements
i need to be able to use the insertCss and executeJavascript functions that a webview has, as well as the partitions attribute
you can do that with iframes
native.ts: Lines 11-21
app.on("browser-window-created", (_, win) => {
win.webContents.on("frame-created", (_, { frame }) => {
frame.once("dom-ready", () => {
if (frame.url.includes("discordsays") && frame.url.includes("youtube.com")) {
if (!RendererSettings.store.plugins?.WatchTogetherAdblock?.enabled) return;
frame.executeJavaScript(adguard);
}
});
});
});
ok dumb question ik, but how do i define/redefine these constants in the first astro component in the second one?
ok fiar
fair
i am very shit at making my code readable
makes sense, but what would be a good name for it? friendButton, FriendButton, and friend_button all seem kinda insane and FButton seems somewhat reasonable
would i put a comma between the different ones or is it just the name
FriendButton
literally the same way you pass it in screenshot 1
if you have to abbreviate then abbreviate the button part
tysm
don't abbreviate at all





