#🪅-progaming
1 messages · Page 14 of 1
Object.hasOwn(count, stat.name)
stat.name in count
what
function statsSort(stats) {
const counts = stats.reduce((counts, stat) => {
counts[stat.name] ??= 0;
counts[stat.name]++;
return counts;
}, {});
return Object.entries(counts)
.sort(([, a], [, b]) => b - a);
}
you will do this
they were talking to me
It’s okay I will teach you rust and we will be rustaceans together :3
who wants to see how i format spaces
function spaces(text, total) {
const segmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
const segments = [...segmenter.segment(text)].map(seg => seg.segment);
const textLength = segments.length;
if (textLength > total) {
return segments.slice(0, total - 3).join("") + "...";
} else {
const sides = (total - textLength) / 2;
return " ".repeat(Math.floor(sides)) + segments.join("") + " ".repeat(Math.ceil(sides));
}
}
// example usage:
spaces("Hi", 6);
// would return: " Hi "
why use php when you can use perl
Because Perl fucking sucks
In every way shape or form
It’s even worse than php
Because php is actually making a redemption arc
Even if it’s years too late
making unreadable code is fun tho
*!=*@; is a perfectly sane statement
It's the cheat code for instantly failing code review
Probably *! and *@ are special variables for something
LMFAOOO
*! is the IO error variable variable
*@ is the default error variable variable
if you set the variable variables equal to each other, $! and $@ refer to the same variable
since die prints $@ by default it'll print the io error
meaning you can open out or die
Do programs behave better if you threaten to execute them
Rule 11: Do not [...] talk about [...] Animated Status
the bypass UMG plugin not working? or it Sony wasnt taken into account?
(Auto-response invoked by @lone gust)
i dont care if you say commas as long as you dont make actual spelling mistakes
v+ needy
W
this guy next
??
😭
i wanna make a node/ts backend for something (anything really not nessecarily a website)
any ideas what it should be? :3
a node/ts backend
explode
what happens if you try to patch code that another plugin already patched, does it just not work?
As long as it matches the patched code it's fine
If the other plugin changes it so it doesn't match you're gonna have a good time
are you being sarcastic with this, or are you saying that usually it doesn't matter.
I'm never sarcastic at all, no sir
what level of difficulty we talkin
is it like obscure fabric mixin error level
or undertale sans battle blindfolded with input lag level
no i just want to edit a message before it's displayed
but not the current user's message
If your regexes don't match, your patches can't patch
oh ok
Doesn't matter if the mismatch is because discord changes something upstream or if it's another plugin that changes it
you either write a patch that won't break when another plugin touches the same code or an api when lots of plugins target the same place
is there an api for bulk editing messages on the client side?
no
that seems like API spam
but what do you need
oh
just edit a message or edit and make it re-render with the edited version
ah ok
edit messages that are currently displayed
ok so for now i will experiment with patches
hopefully i will find a non intrusive one
okay then use updateMessage, it's from one of vencord apis
if you need bulk then just do a for loop lol
yup
but yeah it will update the message in the cache and also make it update visually when it's displayed
however keep in mind future edits to it will undo the changes
Unless you have actual reason to do otherwise I'd recommend patching the rendering, not changing the data
i'm trying to add an image only block feature
can you elaborate
the idea is that: since some people spam attachments too much, you can add someone into a list and that user will have their attachments removed whenever they send a message. i'm also going to include a keyword blocker that will completely block a message from appearing if it contains keywords (or maybe a regex expression too).
hideattachments plugin already does something kinda similar although it's manual and awful shitcode
yeah and i don't think it hides future attachments from a user
I'd probably go with making attachments from some users much smaller, rather than hiding them entirely
hm... i guess i could add that as an option
you can actually do this with css btw
enable ThemeAttributes plugin which will add author id to every message
then you can do like ```css
message[data-author-id="1234567890"] .someSelector {
display: none;
}
does updateMessage work with updating reply previews?
do i need to restart vesktop every time i make a change to my plugin?
i am using pnpm build --watch
is there a reason why an empty array is truthy
The truthiness rules are fairly arbitrary
The real fun stuff is that document.all is falsy
are any of these api things documented anywwhere?
there's barely anything there about plugins
i just don't understand how the people writing the plugin knew about these things
vee taught them
lots of trial and error
could a pwugin like this be in vencord :3
probbably too simiwar too texxtreplace nya~
i forgot i have it enabled 💀
what are the settings and #📩-modmail
to release it
im not actually going to publish this
u should!
im just wondering if this kind of thing fits into vencord
it doesnt but u should publish it
as a third party plugin
this uses code from silent typing and text replace
and one function that i made
im not really sure how optimized this is
whats the diffewence to uwuifiew (✿oωo)
it is tho #1032200195582197831 message
oh damn :3
it isn't xd
either remote the const stuff or you need to first do the variable declaration and then export default in a separate statement
export default takes an expression…
hosting_controller.dart: Lines 37-70
_storage = appWithNoStorage ? null : GetStorage(storageName);
uuid = _storage?.read("uuid") ?? const Uuid().v4();
_storage?.write("uuid", uuid);
name = TextEditingController(text: _storage?.read("name"));
name.addListener(() => _storage?.write("name", name.text));
description = TextEditingController(text: _storage?.read("description"));
description.addListener(() => _storage?.write("description", description.text));
password = TextEditingController(text: _storage?.read("password") ?? "");
password.addListener(() => _storage?.write("password", password.text));
nameFocusNode = FocusNode();
descriptionFocusNode = FocusNode();
passwordFocusNode = FocusNode();
discoverable = RxBool(_storage?.read("discoverable") ?? false);
discoverable.listen((value) => _storage?.write("discoverable", value));
type = Rx(GameServerType.values.elementAt(_storage?.read("type") ?? GameServerType.headless.index));
type.listen((value) => _storage?.write("type", value.index));
autoRestart = RxBool(_storage?.read("auto_restart") ?? true);
autoRestart.listen((value) => _storage?.write("auto_restart", value));
started = RxBool(false);
published = RxBool(false);
showPassword = RxBool(false);
instance = Rxn();
final supabase = Supabase.instance.client;
servers = Rxn();
supabase.from("hosting_v2")
.stream(primaryKey: ['id'])
.map((event) => event.map((element) => FortniteServer.fromJson(element)).where((element) => element.ip.isNotEmpty).toSet())
.listen((event) {
servers.value = event;
published.value = event.any((element) => element.id == uuid);
});
customLaunchArgs = TextEditingController(text: _storage?.read("custom_launch_args") ?? "");
customLaunchArgs.addListener(() => _storage?.write("custom_launch_args", customLaunchArgs.text));
_semaphore = Semaphore();
i hate dart
I have very little opinion about dart, just like other dead languages like perl abd ruby
There is really no good place to ask this but does anyone know of some good guides on how to make TextReplaces stuff
Ima fuckin moron
Isn't that just regex?
it is kinda is… damn i’m going to bed I’m on like 27 hours of no sleep
someone already did it always
#1172962335070093332 message
what does the regex \i do?
Matches a javascript identifier
why doesn't intellisense show up
nvm im dumb
i finally managed to do something on my own without copying code from somewhere else
(i just imported the badge component and stuffed it in here as a test)
The more i look at this image, the more I get triggered by <script lang="ts" setup>
it should be <script setup lang="ts"> 
nuh uh
i dont touch that one
in vscode i just do new component and thats what is generated
husk
actually I don't know if that's in the vue style-guide for both options and composition API or idk
idk either
i couldnt care less either 😭
i just make my stupid websites thats kinda it
my website is in vitepress with a entirely custom theme
it gives me markdown, vue and vite and that is exactly pretty much what I need
nice!
docus you mean?
docus?
@royal nymph this is basically astro but with vue components
lmao
that is MDC
well now I see it, I misread what you said but docus is also a ssg like vitepress but in nuxt
why would one use this over MDX
Idk if you are more familiar with vue I guess
u can use mdx in astro with vue components 
hii im not sure it's the best place to ask this type of question but i got really curious the way these discord scripts work that you're supposed to enter in devconsole (specifically the quests one). the part that confuses is this. does anybody know what exactly it does and like how'd i do the same thing but with a different store (ig that's what these are called properly, basically wanna access a specific function)? also why do you need to Math.random() at the beginning wth does it do 
i don't have much experience with js/ts/webdev and like discord-related development so apologizes if it's a nooby question!
webpack is a web bundler, you can just Google to learn more
webpackChunk.push is how you register a chunk
thanks and sorry 🙏
the first argument is the module id, math.random() makes it random id (but using Math.random for this is very bad style, one should use Symbol() instead)
the third argument is immediately invoked when the chunk is registered and gets the webpack require instance (like nodejs require but provided by webpack)
pushing a module is the easiest way to get hold of the require instance
that's why it's used here
appreciate it
webpackRequire.c is the module cache, aka an object that contains the exports of all modules that have already been loaded (via require call). equivalent to require.cache in nodejs
so Object.values(require.c).find(m => m.exports?.fooBar) will search all exports and find the one that exports fooBar
Z, ZP, tn are minified names auto generated by the bundler
hardcoding them is bad practice but it's easier
these one- or two-symbol names is basically what confused me the most I believe
just auto generated names
yea it makes sense now ig
whenever discord does like
export const fooExport = 42;
the bundler changes that to a random name
Z & ZP are default export
any other names are randomised and might change in the future. so I would never hardcode them, instead you can use nested loop
thanks for the explanation, though I think my lack of JS knowledge is too bad to fully understand what you said
appreciate it anyways!
perhaps there're some articles or other resources for that kinda js-development
if you're new to the language you're better off learning it via a normal project first
because there is no documentation for things like these, you just need to reverse engineer and figure it out yourself and read a lot of minified code
it's much easier to learn via more common means which are well documented
yea fair I'm just not so interested in web development but like messing with other sites and other sources (not sure what the better wording would be) as it kinda seems similar to reverse engineering which is pretty fun to me
well thank you so much once again I guess I'll just uhhh do a better research on the stuff you mentioned earlier to just have a better understanding it at a basic level
I wrote this ages ago but it's unfinished and im not happy with it https://gist.github.com/Vendicated/dec16d3fd86f761558ce170d016ebc53
I'm never fixing that title typo
lmao
it's still relevant tho?
like what mentioned there would work anyways regardless of like the issues the guide has if any
nevermind
well worst thing i've found so far is this link redirects to a not found page
ignore
first argument is chunk id 
but doesn't matter
is this enough to stop scraping or
wdym
I use btoa and atob
for my email shit
so the email is rendered on the client
scrapers can also run js
especially because like half of all websites run SPA
so having it displayed inside the dom in plaintext at all is dangerous
just make it a phrase, easiest solution
me at my domain
they detect phrases? news to me
"something at something dot com" is one of the absolute easiest things to detect why wouldnt they 😭
it's such a flakey thing to try to detect to me personally but w/e
if you really care then you should just use cloudflare email protection and forget about it

if u use cloudflare then it's already enabled by default
Copied
how does that work without having the email in ur code afterall 
maybe
but that would also require bots to also parse source code
which is rarer than just the dom
The world would be a better place if those email scraper bots would go to hell
Shrimply b64 encode it
and then it blocks on a fedi handle
flashback to late night debugging someone else's website
true vencorders will know what event i mean
don't write out the full fedi handle then smh
i guess
or do the svg thing
for the fedi handle
or pre rasterize the text
question, how/can i send a file (like .txt or somthing), from a cmd on a plugin
a plugin?
what are you trying to do exactly
save some type of string to a text file, and like upload it/send it as a file (.txt)
for what tho
wdym
?
im making a fortnite tools thingy for my friends
im making a command to search every asset in the files (like 85000) for a string and i cant send that as a msg cuz most of the time its 2 long, so i want to make it a txt file
Would probably be better as a bot
^
ik
im do for fun
but can i upload a file? or na
@royal nymph can I get your opinion on this?
I don't do patches often and I'm not sure if it makes sense to patch this as a fix https://github.com/ArmCord/ArmCord/commit/2cfa65d265425a7d8f9c1b725cefdce445197e06
oh
that only works against one of however many cdn domains they have
if someone has a list of domains discord uses for serving images, pls let me know with a ping
how do i disable vencord
(Auto-response invoked by @supple vault)
index.ts: Lines 49-69
const MEDIA_PROXY_URL = "https://media.discordapp.net";
const CDN_URL = "cdn.discordapp.com";
function fixImageUrl(urlString: string) {
const url = new URL(urlString);
if (url.host === CDN_URL) return urlString;
url.searchParams.delete("width");
url.searchParams.delete("height");
if (url.origin === MEDIA_PROXY_URL) {
url.host = CDN_URL;
url.searchParams.delete("size");
url.searchParams.delete("quality");
url.searchParams.delete("format");
} else {
url.searchParams.set("quality", "lossless");
}
return url.toString();
}
you can just use that plugin on armcord
I can make it enabled by default on armcord
so anyone who uses vencord will get discord context menu
we already force shelter
so like
horror
petpet got removed as it is possible with a user app
you'd have to go back to an older version to look at the code for that
it... didn't?
/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 ```js
function negate() => "h"
@deep mulch I only received js(18.15.0) error output
/piston/jobs/3cfe42d9-6d0d-49e0-8a74-00e0ba06f1e2/file0.code:1
function negate() => "h"
^^
SyntaxError: Unexpected token '=>'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1176:20)
at Module._compile (node:internal/modules/cjs/loader:1218:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Node.js v18.15.0
ok so thats not valid
const explode = () => "h"
/run ```js
const negate = (func) => (() => !func.apply(this, args));
Your js(18.15.0) code ran without output @deep mulch
@royal nymph 
not correct
die
/run ```js
const negate = (func) => (() => !func.apply(this, args));
negate(() => false)
Your js(18.15.0) code ran without output @deep mulch
/run ```js
const negate = (func) => (() => !func.apply(this, args));
console.log(negate(() => false))
Here is your js(18.15.0) output @deep mulch
[Function (anonymous)]
Anonymous...
/run ```js
const negate = (func) => (() => !func.apply(this, args));
console.log(negate(() => false)())
@deep mulch I only received js(18.15.0) error output
/piston/jobs/c799e58b-05b9-4a27-9d51-3122157c0f8a/file0.code:1
const negate = (func) => (() => !func.apply(this, args));
^
ReferenceError: args is not defined
at /piston/jobs/c799e58b-05b9-4a27-9d51-3122157c0f8a/file0.code:1:51
at Object.<anonymous> (/piston/jobs/c799e58b-05b9-4a27-9d51-3122157c0f8a/file0.code:3:32)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Node.js v18.15.0
whyyy
args isn't a thing
arguments is
/run
const negate = (func) => (() => !func.apply(this, arguments));
console.log(negate(() => false)())
Here is your js(18.15.0) output @ornate quiver
true
@deep mulch
https://www.youtube.com/api/stats/playback figure out how to use
no
😭
there's literally so many params and headers
and the thing doesn't even return an error status code
it's always 204
zeet just ask ashley for source
just void her nda
okay
I found some C# thing that uses that URL
@frosty obsidian https://github.com/Rehike/Rehike/
seems neat
yes
rusher
scary
Wild
wait this is
wrong
you guys are insane
can't arguments in arrow function; use rest arg
arrow functions preserve this and arguments; make the inner function a non-arrow function
it literally works

/run
const now = new Date();
const start = new Date(now.getFullYear(), 0, 0);
const diff = (now - start) + ((start.getTimezoneOffset() - now.getTimezoneOffset()) * 60000);
console.log(Math.floor(diff / 86400000));
Here is your js(18.15.0) output @lone gust
236
wild
how can i make a tab like the nitro one with a plugin?
i've done it many months ago though the code broke for sure. I've recently created something for a server specific special page though
w
hii
This is the best thing sho has ever made other than my oc
@royal nymph can I ask you about the async here?
it appears its not supposed to return a promise - why does this work in vesktop?
stop using goofy ass eslint rules
so it just... can accept promises?
anything can accept promises
it doesn't matter what u return
oh hm
yeah i know that one
yeah theres no error here eslint is gay sometimes
bleh confusing
it looks like its supposed to return a function
or somethin idk
im probably misunderstandiung
Sounds more like handle takes two arguments
But it's unclear
Are there no actual types?
?
it's saying that handler is a Function which gets passed the arguments request and callback
oh I see
but wouldn't electron want to specify in types that it can accept an async function?
It already states that it ignores the return value entirely
Which means it can be a promise if you want, it doesn't care
return value void = i do not give a flying shit what the fuck you return
wanna return a number? go for it
a promise? sure
generally it's very common practice to use async callbacks if a void is expected
which makes that rule overly pedantic / bogus
I've had situations where it sometimes doesn't work for things
the intent is not bad "floating promise = bad" but if you just write good code it's not a problem
which is why I try to stick to the rule
if it expects a synchronous return then yes
but typescript will already type error for that
like u can't do array.filter(async item => ...)
However I've run into issues passing an async to useEffect, because if that one returns non-undefined (including a promise) it's used as the unmount callback
hm
:p
I supose there isnt a way to tell typescript this on my end using as or something and I just have to disable the rule

^
{
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": false
}
]
}
vee disables every lint
and a few more*
this is what I've been using for the most part
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import prettier from "eslint-plugin-prettier/recommended";
import n from "eslint-plugin-n";
export default tseslint.config(
eslint.configs.recommended,
{ignores: ["ts-out", "src/discord/content/js", "*.config.js", "src/shelter/", "scripts/"]},
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
n.configs["flat/recommended"],
prettier,
{
settings: {
n: {
allowModules: ["electron"],
tryExtensions: [".tsx", ".ts", ".jsx", ".js", ".json", ".node", ".d.ts"]
}
},
plugins: {
n
},
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
"no-constant-binary-expression": 0,
"n/no-unpublished-import": 0,
"n/no-unsupported-features/node-builtins": 1,
"@typescript-eslint/no-unused-vars": [
2,
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_"
}
]
}
}
);
or well, on personal projects I used strict type checked
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
export default tseslint.config(
eslint.configs.recommended,
{ ignores: ["dist/"] },
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
},
},
);
``` this is my personal eslint config
RestrictedExtension.kt: Lines 344-400 - :warning: Zero width spaces present
command("eval", "Evaluate code") { input ->
val code = input.removeSurrounding(prefix = "```kt", suffix = "```").trim()
val res: ResultWithDiagnostics<EvaluationResult>
val duration = measureTime {
res = scriptingHost.eval(
script = code.toScriptSource(),
compilationConfiguration = ScriptCompilationConfiguration {
defaultImports(
"dev.kord.core.behavior.*",
"dev.kord.core.entity.*",
"dev.kord.core.event.*",
"kotlinx.coroutines.*",
"zt.minkinator.util.*"
)
implicitReceivers(ChatCommandContext::class)
providedProperties(
"kord" to Kord::class
)
jvm {
dependenciesFromCurrentContext(wholeClasspath = true)
}
},
evaluationConfiguration =
ScriptEvaluationConfiguration {
implicitReceivers(this@command)
providedProperties("kord" to kord)
}
)
}
val returnValue = res.valueOrNull()?.returnValue
message.reply {
embed {
description = if (returnValue != null) {
buildString {
appendLine("```")
appendLine(returnValue.toString())
if (length > 4093) {
removeRange(4093, length)
footer("Output truncated")
}
appendLine("```")
}
} else {
res
.reports
.filter { it.severity > ScriptDiagnostic.Severity.WARNING }
.joinToString("\n", transform = ScriptDiagnostic::render)
}
}
}
}
i messed up the selection

im gonna make it upload the output as a file when its too big
BADFDDD
um caddy is in go..
ermm caddy is my bot
I've never heard of such a program in go
must have stolen the name..
@royal nymph@royal nymph
meanwhile in js
command("eval", "Evaluate Code", (message, input) => {
const result = eval(input)
input.reply({ embeds: [...} })
})
u love
nop
async execute(msg, code) {
if (msg.author.id !== OwnerId) {
if (!/^ve\b/.test(msg.content)) {
silently(sendVoiceMessage(msg));
}
return;
}
const console = {
_lines: [],
_log(...things) {
this._lines.push(
...things.map((x) => inspect(x, { getters: true })).join(" ").split("\n")
);
}
};
console.log = console.error = console.warn = console.info = console._log.bind(console);
const { client, channel, author, content, guild, member } = msg;
let script = code.replace(/(^`{3}(js|javascript)?|`{3}$)/g, "");
if (script.includes("await"))
script = `(async () => { ${script} })()`;
try {
var result = await eval(script);
} catch (e) {
var result = e;
}
let res = inspect(result, { getters: true });
res = res.slice(0, 2e3 - 10 - countOccurrences(res, "`"));
let output = codeblock(res, "js");
const consoleOutput = console._lines.join("\n").slice(0, Math.max(0, 1990 - output.length));
if (consoleOutput)
output += `
${codeblock(consoleOutput)}`;
return reply(msg, {
content: output
});
}```
fix
has been a thing for months iirc
at least with the copilot extension
(or its because i use preview release)
@calm ruin what is this server my bot isi n
turkish armed forces
ve balls
@dusty moth yo so
how can I check if an element doesnt have a specific style on discord
has an applied style? no
you can't read other css
oh
check for attributes or recreate selector
i want it to flag
<span></span>
but not
<span style="a: b"></span>
wdym recreate selector
like take the selector discord uses and copy it
(plus !important for specificity)
nope
pretend you are talking to an idiot (but remember you dont need to pretend)
what do you want to select
lc.g css for dummies
Oct 10, 2021 ... Here is a short tutorial on CSS for beginners.
span.headerText_f9f2ca that has a specific color or that doesnt have color set in the css
@dusty moth
you can't detect that
brb
are you trying to match white usernames
yes
idk how well this works
[class*="desaturateUserColors"]:not([style^="color"]) {
/* ur css here */
}
it doesnt since i needa match the entire message :(
here u go
[id*="chat-messages"]:has([class*="desaturateUserColors"]:not([style^="color"])) {
/** ur css */
}
think theres a faster selector than *= for prepended str but idk which
lmao
ty
u should post that in #🎨-css-snippets and especially give it to @thorny ingot
@solid gazelle
bad
nah @thorny ingot would want it
wtf @lone gust its you
shocking twist of events
^=
hi
hi
made a 88x31 for rust
@lavish frigate
why would you make it only talk about memory safety
funni
Why would you ever talk about something that is not memory safe
accurate
do rust users ever talk about anything else


lemme check
bevy bevy bevy bevy!!!
cargo package manager!
multi platform!
free father figure!!!
rust users when they are told that memory issues are only a small subset of software dev woes
A significant portion of exploitable security issues, and often very hard to debug, though
true
nah memory safety is good
I agree about less golang though
no code to debug when your development velocity is 0
rust just does it excessively
you can have healthier memory safety without paranoid schizophrenia
like go or java do
both have their ups and downs
but memory safety as a concept is gooood
screw C!
Memory safety in native langs is nice
Rust isn't for everything, true
but also; it's only a fraction of what leads to 'correct' code
But I would never dream to start a new project in c or c++ in this decade
FUCK NO
altho
Zig > C > Rust > C++
You don't fucking NEED half the shit Rust has
yes but normal bugs are usually less severe
Traits and enums are really fuckin nice
bug that doesn't involve memory usually ends at annoyances like crashes
bug involving memory almost always results in something terrible like code execution or privilege escalation
the majority of security relevant bugs are caused by memory issues
Bugs that crash the program or logic errors are easier to detect and diagnose than bugs that give russian spies full control over your hardware
For software that runs entirely locally and on trusted data, security isn't such a huge deal
amazing ecosystem, performance, security, whatever you can look it up online 😭
im not talking about its actual benefits
just that rust shills will never shut up about memory safety
^
In particular, that it fixes everything wrong with software.
I can write shitcode in ANY lang.
i think there are reasons even GOVERNMENTS are starting to switch off c and governments are notorious for sticking with old shit
like if you really think c is still a good language in this day and age not sure what to tell you
we are 40 years into the future
when the government does anything i like: wow these guys really know their stuff
when the govermnet does anything else: crush the elites!!!! question all authority
You act like you have ANY trust in them.

i never said i have any trust in the government
not sure why you are twisting my words
i said that the government is notorious for sticking with old shit (which is true) and that even they are switching
i was just joking dont take it too serious
maybe but this other person is FUMING that i said anything against c
I'm half joking but at the end of the day I don't care
My only fuming here is the bringing up govs doing anything as an endorsement
c is still a good language, just get good ^^
Also true
meh using C for new programs is foolish
But at the end of the day, use whatever language doesn't get in your way.
No issue with it if you're good at it.
Like the end result will be the same.
but i think it's also beneficial to not give into delusions like "switch to rust for immediate safety" cause at the end of the day all the system libraries and so on are still in C
on the long term it's a good idea to migrate as much as possible to safer languages tho
Incl. decompiling existing C projects with lost source code
to then RECOMPILE them with Rust
ofc, c++ is also still a very valid option just not C
though OS's and other systems are slowly starting to get in on rust
Yeah, for sensitive internal systems where it's worthwhile to spend 10x the time doing it in Rust
Or it's small enough to where it just needs to be correct
because they aren't people they're llms
C is a joke language at this point, all serious programmers are using rust
This is true
I am VERY silly so I program using typescript using the maximum number of npm packages

For some reason people pay me to be as silly as possible
(I haven't worked in a week)
ur capping
sillymaxxing
that was a nocap statement
C is good
I don't have the ability to talk in any of the development channels, so just gonna slap this here
why do we need virtual merge?
The point of the library is to have object merges reflected back onto the merged objects, but the only context it's being used in is an immediate return ;-;
I'm like 90% sure this could just be return { ...user, premiumType: 2, themeColors: colors } instead of needing virtual merge
I could be being silly here, but I don't see why this into needs to be reflected back onto the user object
It would in theory shave ~1.1kb off the bundle (before min+gzip), which is minor but it's something
also for the userscript distribution, you should probably be using GM.xmlHttpRequest and blobbing the response
or you could encode the image as a base64 blob in the bundle, but eeeeh
Yeah this works, am I good to open a PR?
v+ dev 1101215020798443732
wait wrong one
v- dev 1101215020798443732
v+ programming 1101215020798443732
i hate this
why not use discord's role thing
ty ty
vee confusing
actually why not use /commands ?
Boring
XD
less convenient
v+ cshark
v- cshark
its way quicker to do that
- /commands can overcomplicate simple tasks like that, + no aliases
I mean yeah
Autocomplete names work as an alternative, but your workflow is reply, so make sense
vh +
Role-add (+, ra)
Add a role to one or more users
Usage
vrole-add <role> <user> [user...]
No way to make a list with /commands ?
Weird
Ig you could parse a text field, but yeah would worsen it
its easier if u reply to the message i dont think u needa user id
it just takes the person who owns the message
\🍂
could use a context menu app
context menu slow and awkward
and then you have to prompt a modal to complete the action
and still doesnt work with multiple users
- there is a limit of 5 menu items
interactions are clunky and slow
annoying to set up
anyone has an idea why this userplugin I am trying to make ain't showing up?
it's located in the correct directory and isn't detected by both vesktop and desktop applications
I did attempt to install a different userplugin, which loads just fine. guess I messed up somewhere, as I am new to both typescript and vencord plugin dev
vesktop wouldnt work anyway since it runs discord web and cant do native modules iirc
your code seems fine though
you sure its in src/userplugins and have you rebuilt AND reinjected it?
yes
hmm. as I specifically try to target vesktop as well here, if that's the case, any other way of opening an http server locally without resorting to native modules?
i dont think so
you can use native on vesktop
oh?
i was told you cant
and since i dont use vesktop i havent looked into it at all
I use vesktop as it has the best linux support compared to the normal desktop app
nope
vesktop is an electron wrapper
and loads native modules just fine
so does discord desktop
it's the same thing
fr
got that plugin to finally load
now I am wondering, is there a way to run code in the index.tsx from within native code?
Why would that even be possible
What are you trying to do
Treat native basically like an api
trying to control things like user settings
or, for example, join a voice, send a message, etc
stuff like that
and apparently stuff like UserSettings fail to call Vencord when in native
is passing functions to a native function legal
no
would be too easy ngl
Error: An object could not be cloned.
I have been trying around with IPC for a while, can't find a way to do it properly tho, as I can't use native modules like "http" or "net" in the non-native code
also I can't open a WebSocketServer on the non-native side
you send events
or use eval
// index.ts
export default definePlugin({
name: "MyPlugin",
handleEvent(event) {
console.log(event);
return "hi";
},
start() {
Native.doStuff();
}
})
// native.ts
export async function doStuff() {
const event = getSomehow();
const result = await webframe.executeJavascript(
`Vencord.Plugins.plugins.MyPlugin.handleEvent(${JSON.stringify(event)});`
);
console.log(result); // "hi"
}
ah thanks
Just make sure to only use indirect eval (0, eval)(...); direct eval eval(...) kills all optimizations
wtf
same level of cursed-ness
okay
why the fuck are lists callable
fuck off php
strings are callable too
php devs have passed 0 drug tests
comma operator just returns right hand side
so bad..
at least that's somewhat sane
and taken from C so not JS's fault
is php case insensitive......
oh wtf
yeah iirc
PHP constructs, function names, class names are case-insensitive, whereas variables are case-sensitive.
noooooo
php should add perl typeglobs
all languages should just become rust
?
@foo = (1, 2, 3);
$length = @foo;
print @foo; # 123
print $length; # 3```
how do i find the place where stuff is rendered in discord (when making a vencord plugin)
at my first plugin attempt i tried finding where channels were rendered in order to change the name of the channel but i could not find that in dev tools
now im trying to find where usernames are rendered (in chat)
devtools then click the >> symbol then click Components
that's what i did
i selected the thing and clicked on source, but that just brought me to some confusing function that had a 1 letter name
yeah idrk either past that point 😭
Discord code is minified
so most of it will be a,b,c,d and so on
i've read in multiple places that when writing a patch, you shouldn't rely on the one letter functions
Extension to regex syntax that matches a variable name
^
ah
also, when selecting that element
i could either select the channel or a parent element of that
their props were pretty much the same
so i found this thing i want to edit
so i went to the source, and i want to test this by replacing B with the string "test" (which im hoping should change every username to be test)
{
find: "(E.Z.USERNAME),{nick:B",
replacement: [
{
match: "B",
replace: "\"test\""
}
]
}```
so i wrote this
Now replace the variable names with \i for a proper patch
and the patch fails because i have "invalid destructuring assignment target"
so it'll just be (\i.\i.USERNAME),{nick:\i?
why wouldn't this work though
It works today, sure (assuming it does), but it won't work next week when the variables are rerolled
it doesn't work though
when I set replace to "test", the vscode companion says the patch is ok but when i set it to "\"test\"" (with only one backslash), i have invalid destructuring
/run ```js
let { nick: "test" } = { nick: "hello" };
@fleet cedar I only received js(18.15.0) error output
/piston/jobs/fa378df4-dcef-4767-a846-eb9b65b950f6/file0.code:1
let { nick: "test" } = { nick: "hello" };
^^^^^^
SyntaxError: Invalid destructuring assignment target
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1176:20)
at Module._compile (node:internal/modules/cjs/loader:1218:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Node.js v18.15.0
You mean that error?
Well don't produce invalid code then
i just tried to replace the variable B with a string
Make a more precise patch that applies in the place you need it and not in the place where you don't
I feel dumb
Electron.webFrame === undefined
same with just webFrame
thus I cannot access the executeJavaScript method.
and running the same in (0, eval)(...) tells me that Vencord is missing
code where
alright after copying out the discord code and beautifying it, i understand my mistake, thanks
what
code
it's the bad code of my plugin I am trying to make
wanna know another way to remote control discord?
its very secrect so dont leak
but you can go to the website discord.com and log in and itll allow you to remotely control discord
why not just... use the api?
do things like switch voice, toggle game activity status on the client
right
kinda replacement to hotkeys on linux with vesktop. trying to attach it with my streamdeck as well, so that's one use case
might be useful to some others as well
doubt its gonna be accepted as an official plugin, way too niche, requires a lot of extra effort to make it work
wasn't my plan anyways. user plugin is enough
alright
how would I be able to find the function for a specific button (for example the mute button) and run it
like where in the components window would it be / how would i activate it
can \i only work in regex or can i also use that in a replace
how do you expect it to work in a replace
What would it replace with? "An identifier" is kinda vague
if you want to replace with a matched identifier use a capture group
if you want to introduce a new identifier just introduce it
stupid fucking windows I can't get git to work with ssh
I have literally done everything
ok i fixed this.
i was doing stuff that i did not need
i just wanted to add a badge (kind of like the bot tag) next to the username
so I tried writing a patch that adds an html element after the username
but after looking at platform-indicators, which does a similar thing, i found you can use message decorations instead
@royal nymph if I finish this PR will it be merged
if she merged my PRs 💀
is !> an operator or a typescript non-null assertion followed by an operator
Cursed
/run
let x = 10
let y = 11
console.log(y > x)
Here is your ts(5.0.3) output @frosty obsidian
true
/run
let x = 10
let y = 11
console.log(y !> x)
Here is your ts(5.0.3) output @frosty obsidian
true
Here is your ts(5.0.3) output @frosty obsidian
file0.code.ts(2,13): error TS2304: Cannot find name 'y'.
/run
let x = 10
let y = undefined
console.log(y !> x)
Here is your ts(5.0.3) output @frosty obsidian
false
/run
let x = 10
let y = undefined
console.log(y > x)
Here is your ts(5.0.3) output @frosty obsidian
false
gn
/run
"wi.ng" == "cool"
Your js(18.15.0) code ran without output @lone gust
/run
console.log("wi.ng" == "cool")
Here is your js(18.15.0) output @lone gust
false
@frosty obsidian gg
/run
let isTrue
function a() {
return true
}
function b() {
return false
}
if (a() == b()) {
isTrue = true
} else if (a() !== b()) {
isTrue = false
}
console.log(isTrue)
Here is your js(18.15.0) output @proud echo
false
let x = 5, y = 7
console.log(x !!== y)```
@visual shell eval ts let x = 5, y = 7 console.log(x !!== y)
/run ```ts
let x = 5, y = 7
console.log(x !!== y)
Here is your ts(5.0.3) output @fleet cedar
true
not not strictly equal to
/run ```ts
let x = 5, y = 7
console.log(x !=== y)
Here is your ts(5.0.3) output @fleet cedar
file0.code.ts(2,18): error TS1109: Expression expected.
Huh, so that one's illegal
gets tokenized as !== followed by =
tokenization can't change during parse
why javascript
why would that be the result of multiplying strings
what else would it result in
string.prototype.concat
:3
Number.prototype.toBottlesOfBeer = function() {
let result = "";
for (let i = this; i > 0; i--) {
result += i + " bottles of beer on the wall. " + i + " bottles of beer. Take one down, pass it around, ";
}
return result;
}
Mathematically speaking, string concatenation is more akin to multiplication than addition
Aren't strings monoids?
Yes
/run
console.log("wi.ng" == "cool")
Here is your js(18.15.0) output @deep mulch
false

ooh we have I Run Code here?
#🪅-progaming message robber
/run
#include <iostream>
int main() {
std::cout << "can you run this";
return 0;
}
Here is your c++(10.2.0) output @lone gust
can you run this```
woah thats cool
/run bf ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Here is your bf(2.7.3) output @umbral mirage
Hello World!
holy shit
/run bf +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> ++++++++++++++++++++++++++++++++.> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> ++++++++++++++++++++++++++++++++.> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.
Here is your bf(2.7.3) output @umbral mirage
i love vencord```
nice
/run
System.out.println("A");
Here is your java(15.0.2) output @lone gust
A
/run
System.out.println("A".repeat(2000));
Your java(15.0.2) code ran without output @lone gust
Your js(18.15.0) code ran without output @lone gust
/run
console.log("A".repeat(200));
Here is your js(18.15.0) output @lone gust
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
/run js "balls";
Your js(18.15.0) code ran without output @umbral mirage
/run js console.log(Array.from(100).fill("I EAT VENCORD USERS"));
Here is your js(18.15.0) output @umbral mirage
[]
i might be dumb
yes i am dumb
lmao
/run ```js
console.log(Array(100).fill("I EAT VENCORD USERS").join(" MUAHAHAH "));``
Your js(18.15.0) code ran without output @umbral mirage
/run ```js
console.log(Array(100).fill("I EAT VENCORD USERS").join(" MUAHAHAH "));
Your js(18.15.0) code ran without output @umbral mirage
uh what
i already tested this
no need to test it more
the bot doesnt print out >2k characters bc it cant
smh
did you get image sending permissions beacuse you boosted
no
omg
ikr
/run ```c++
#include <iostream>
#include <vector>
int main() {
std::vector<int> bigVector;
try {
while (true) {
bigVector.push_back(1); // Keep adding elements until memory runs out
}
} catch (const std::bad_alloc& e) {
std::cerr << "Memory allocation failed: " << e.what() << std::endl;
}
return 0;
}
Your c++(10.2.0) code ran without output @deep mulch
guh
rat run on screen from poll #🧊-off-topic-iceman-only message
i asked chatgpt to help
gen code to see how to do that
function checkArguments(func) {
const requiredArgs = func.length;
const funcStr = func.toString();
const allArgs = funcStr.match(/\(([^)]*)\)/)[1].split(',').map(arg => arg.trim());
const optionalArgs = allArgs.slice(requiredArgs);
return {
requiredArgs,
optionalArgs
};
}
// Example function to test
function exampleFunction(arg1, arg2, arg3 = "default") {
// Some logic
}
console.log(checkArguments(exampleFunction));
this is what it gave me
when ran it gives this output
dont delete
yeah true
i still need the argument names anyway
they dont need names
we do need names
the machine has infinite memory
you can do ```jsx
<div children="hello world" />
thats gay
Very sexy
LMFAO
exampleFunction.toString().match(/(([^)]*))/)[1].split(',').map(arg => arg.trim());
this give names and defaults
but we can cut out the default
@cerulean plover
it may be possible

parentheses in defaults
and to get the function by string name you can run
eval("exampleFunction.toString()");
are you guys trying to make this weird jsx code work
We want to make a fucked up JSX compiler where everything can be a component
how objects
we'd need a special keyword
<example optionalArg=true><Number>3</Number><String>aa</String></example> -> "example": {1: 3, 2: 6, optionalArg: true
@cerulean plover}
what abt this
and then we change example via the eval thing
and run eval(example(3, 6, optionalArg=true))
to run the function
you do know you can do {3} inline in jsx
oh
for a number like that
well yeah that then
strs too?
/run
console.log("@everyone");
Here is your js(18.15.0) output @fathom haven
@everyone
<let name="x">{3}</let>
<console.log>{x}</console.log```
Any JS value
Oh
he thimks hes pro coder
nop
v$ msg.reply("hi", { mentionEveryone: true })
i love and hate this a lot
that would be string "x"
<let x={3} />
how did this not get automodded
I'm thinking about how the JSX compiler will actually make this all work
@jannie* cleanup in aisle 4

Bcs i am pro coder
whats ur favourite language
Ts
what does it stand for



