#š§©-plugin-development
1 messages Ā· Page 32 of 1
LOL the vector field example is funny https://mafs.dev/guides/display/plots
me too
Efficient linked list implementation in Rust is so... cursed
I still love Rust, though

linked lists are not efficient 
they say it here https://doc.rust-lang.org/std/collections/struct.LinkedList.html
A doubly-linked list with owned nodes.
trol
idg how it'd be faster since you'd need to reallocate memory each time your backing array overflows
i thought it were really expensive
But arrays are cheaper since you need to allocate less memory
allocations are cheap nowadays
So it shouldn't be a big of a deal
makes sense
Thanks
I'm just implementing a Linked List because it's fun anyway xdd
true it is
LinkedList is kinda useless in the majority of cases
its only better in niche scenarios
the best rust list type is VecDeque because it's fun to say š
follow for more amazing rust dev tips
@pure temple the plugin im making is basically just
if message has certain string
react to it with a funny emoji
that's selfbotting..? lmao
the certain string is a little inside joke my friend group has
oh
my bad then
it was the easier option out of the 2 he wanted me to do one of them
couldn't you just create a bot?
the other was making emoji confetti rain
oh no sorry
i meant
its basically the moyai extension
but with reactions instead of playing a sound
huh? you could just create a bot that listens for keywords and reacts
but i want it to be in the current channel the user is in
and for like 2 specific servers
or channels
just so its not abusing discord api requests
which is why i didnt mean for it to be a selfbot at all š i understand the concern but its not my intention at all
seems pretty suspicious
i cant make a bot because i want it to be in gcs
i think that should clear things up
im not sure what the point of selfbotting reactions is
whar
the 2 specific servers would be my friends server and our gc
that seems to be what you are doing
no i mean in the manner you are suggesting
well, we're not going to help with this
it would only be active when the user is in that channel
ok
to be honest, I'm not as sure about these things as other people here (who know too much)
but this really does seem like a selfbot to me soo 
i understand if that could be considered as self botting, in that case he did give me another idea which would just be purely visual
do you know how i can add images to the window via dom insertion

oh sorry it wasnt meant only for you if you dont know its fine LOL
maybe a bit of an advanced feature
oh hm i could create a bunch of elements and insert them in an array
and update each one by one every frame
horrible
idk wtf youre doing š«
if you just wanna know when something gets sent in a dm you can make a desktop notification
wait my bad he said he meant client side š
how do you make it show up client side my bad
oh shit my bad i forgot to say what i was trying to do
ok so i want to make it rain emojis
but not an actual emoji just an image
im not really asking for someone to code 90% of it for me š just trying to see how i should work it out
you are tho
na

@void topaz you could do that with the message decorations api
an okay example plugin to look at that uses that is uhh
the message preview one
oh thats a thing?? tysm i was gonna literally insert elements manually š
lmaoo thats horror
fear
rain with message decorations?
look at the message preview plugin i told u about
oh i thought they wanted a clientside reaction esque thing
anything like that will do
i think message decorations would be pretty baller actually
you could render the confetti there tho its not like ur prevented from overflowing
heres a snow plugin if you want it https://github.com/Inve1951/BetterDiscordStuff/blob/master/plugins/Snowfall.plugin.js
for bd tho trolley, not that it really matters
discord has code for confetti somewhere doesnt it
yea
oh thanks a ton i think this is exactly what i need
rate @austere mauve
A generic Stack data structure based upon linked lists. - linked.rs
writing an immutable version soon
made a simple vesktop plugin to recreate the discord titlebar on linux
ayo that's cool
yea
name?
i can't find it in search, perhaps i'm using the wrong words xdd
already found it
nvm
thanks anyway
did __getLocalVars() get removed 
it was reason enough to realize a store access throwing an exception is enough to make my shitty plugin completely inoperable 
so when can we expect the fix ?
oh i just realized it's a discord thing
wait then
why did it break for me just now ?
u just updated?
vencord ?
or discord
im using web discord and injecting vencord userscript
and it literally broke like max an hour ago
anyway i don't really care too much about __getLocalVars per se
but i was using Vencord.Webpack.findStore("SelectedChannelStore").__getLocalVars().mostRecentSelectedTextChannelIds
to get the recent channel id's
there doesn't seem to be any other method on this store that returns this
getLastSelectedChannels just returns undefined
oh wait is the local vars what's stored in localStorage
i guess that can work
well that probably can't work because there is no localStorage on window
oh Vencord.Util.localStorage
<cursed>
<function name="plusfour" n >
<return value="n+4"/>
</function>
</cursed>
this is peak html coding
function cws {
python3 -c "import json; print(json.dumps({\"folders\": [{\"path\": \". \", \"name\": \"Root\"}, *[{\"path\": p} for p in \"$*\".split(\" \")]]}, indent=4))"
}
$ cws * > cms.code-workspace
$ cat cms.code-workspace
{
"folders": [
{
"path": ".",
"name": "Root"
},
{
"path": "cms"
},
{
"path": "cms-sc"
},
{
"path": "cms-sp"
},
{
"path": "cms-yt"
}
]
}
echo $@ | jq -sR '{folders:[{path:".",name:"Root"},split(" ")[]|{path:.}]}'
i started adding my own tags :3
<cursed>
<function>
<assign name="n">
<input/>
</assign>
<assign name="square">
<mul lhs="n" rhs="n"/>
</assign>
<return>
<variable name="square"/>
</return>
</function>
</cursed>
what would be the worst way to call a function
i thinking something like
<call func="console.log", args=""Hello World!""/>
or maybe even
<call func=console.log><str value="Hello, World!"/></call>

š
im actually kinda surprised html doesnt kill me when i do stuff like <if !(n % 15)>, which is clearly not how html works
wait
can <style> actually be used as a singular
or is that only because it's at the end of the script
sorry to ping you after months, but I needed some advice and was wondering if I can DM you, is it ok to DM you?
they arent in the server anymore
idk
ok then I just had some stupid questions, like how shitty implemetations can be accepted by the devs
favoritemedia request :(
Gay boy flag is timing you out for being a bad boy golang
bad boy
<function name="guess">
<let name="num"><rand min="1" max="6" inclusive/></let>
<let name="guess"><input/></let>
<if guess %eq% name>
<print><str value="You got it right!"/></print>
</if> <else>
<print><str value="You got it wrong :❲"/></print>
</else>
</function>
making more progress
HES BACK
with more useless support as that is literallt not what he was asking
in english please
git isn't a working solution to that problem. if you're gonna try offer a fix, understand what works first.
you were offering solutions that we already knew didn't work for the scenario.

ok but why are we having this argument in the coding chat
i wanted to show off my cursed html code and now this place has been flooded
oh my god.
what the fuck is this.

go cry somewhere else
html not caring about unknown tags + javascript reading dom and creating functions = silly
most of the people you've been talking to here are not american
im gonna
fucking
guh
i dont think any of us are american
why would you do this
hello
aspy
im not
@dull magnet you live in the US now
literally canadian but ok
north america has america in it
fuck
what are you gonna do with this knowledge
this button exists btw
I NEED to see this in production
im not really sure yet
it kinda sucks since i have to write a definition for every keyword
golang, where are you from
only a smart man would understand what quar means
only a smart man would understand extremely basic grammar
@frosty fractal, where are you from?
you struggle to form coherent sentences
same here

watch your mouth
grammar allows other people to understand you.
me when the employer cant read my resume because grammar is below me
free 10k for using comma
you aren't going to get a job better than starbucks without the ability to form coherent sentences.
like i genuinely thought u were learning the language or smth
others need to be able to understand you for you to get a job. no job, no money.
why would i want others to understand ModernWarfare
oh my god the github button doesnt go to his profile lmao
genuinely, no employer will hire you unless you are able to use proper grammar
you can't write a resume or CV with your tongue
who do you know
mans relying on being a nepo baby
you still need to use proper grammar with that keyboard

you could regurgitate alphabetti spaghetti and have that form a better sentence
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, engineering, mathematical, technological and social aspects. Major computing disciplines include computer...
@frosty fractal rust better
what, fake
how old are you
thank you
15, gotcha
whats ur mental age
(damn it im one year younger! he's legally allowed to call me kid!)
nuhuh
nah he is NOT that old
no wonder you got no support
yall got no because
this dude is like 14 max
ālook these kidsā your 18, barely not a kid yourself acting like youāre some wise old man
i think you do
love it when prettier line length setttings cause it do stuff like this
no way hes 18
mate youāre called golang stfu
.golang. š„
vscode shouted at me because i had a 3k long line
has to include two dots in username
i hope the lord sets you on the right path
where are the mods, can we ban this guy now
there's an archive ???
boutta make you life less
can't believe this guy has degraded to the no gf argument
COUNTER: i am gay
discord momence
itās like a given aināt it
NO BITCHES?????
hes gonna freak out because im gay or smth now
*sighs* yeah
have you noticed no one cares
get off discord and go live your great life or whatever
oh fuck asterix actions look really bad with fira code
me when the font is set up for programming instead of commuincating
@frosty fractal do you prefer coke or pepsi
id need to screenshot like 100 times
nuh uh
<@&1026509424686284924> this guy likes pepsi
bisexual
can we get a ban
real shame is you seem to have sustained brain injuries that have had catastrophic effects on your speech and word comprehension

hammer to the brain donāt do no good
how can u be english and shit at english
even worse from uk

aināt even got the excuse of being american
what
SPEACK
you canāt even speak so clearly no
@oblique lark send your html again
this is funny
well youāve failed several times to string together a cohesive sentence
this dude is 14 max
ive got no lie
wouldnt be surprised if under 13
crying rn
how many āTop 10 Epic Insults for Discord Argumentsā you got pulled up
cant tell if its satire or not
you donāt got to say it twice thatās clear
need more verification
truth
tbh mandatory iq test to speak in the server should be a thing
also can i just remind everyone this is the coding channel wtf happened
no i dont want to be muted
are you still doing this āmy life is so great unlike yours because you no dad and no gf and you discordā shit
golang are you against gay people
codding?
are you sure youāre all there buddy
sure if that helps you sleep at night keep telling yourself that š
please do sleep at night
theyāll get the worm in your brain out one day buddy
so i dont have to deal with you any longer
(it's 1am in golang's timezone)
so am i
still got that āTop 10 Insults for Discordā page up i see
golang go to bed
what do you use
come on buddy itās alright you can say something original that hasnāt been driven into the ground by being said 1000 times over
you do too
i use word
explain your status
customisable syntax highlighting
ok
knew it
hey is that surcord
go.main
idk how youāre even questioning anything at this point
i dont want to pay for intellij
š„
š„
drop your bank details so we can verify you arenāt
š„ (burn this mf)
certified vencorder
why would you pay for an editor that has the less features than an open source editor
meow
so true
horrible
idk man youāre the one with a gaping hole in your head
š§ šØ
can we please hurry up and ban this guy he's getting really annoying
man wants my card*
whereās my screenshot of the hole in your head that makes you act the way you do?
are you alright buddy?
pussies*
you are entertaining him
resorting to clown emoji when out of valid points
i estimate max 14, min 11
likely 13
in and out of jail soon
what 18 year old has been in and out of college you barely just graduated high school
the lord will show you his path
you did not pass your english gcse mf stfu
š„
in the uk, you leave college for uni at 18
is this not embarrassing for you do you have no shame
shut up
iāll take that as a no
he got bored trolling
okay yeah heās fully brain dead
now he just wants the ban
sanest golang developer
ven banned
the world can now heal
right
@oblique lark send your html again
just used the Multi Function Button⢠to clear message logger (it flashbangs me, sorts out memory, and clears messagelogger, all in one!)
oh uk prob has different school tier system
uk u leave education paid by the government when youāre 18
yeah
secondary school ends at 16, then sixth form/college till 18, then uni
and after that you have to pay yourself for whatever else with student loan
this
high school is 16 then 17-18 is 6th form or college then uni after your college courses
that's exactly what i said
ic
unsane
@oblique lark how does the guessing system work
i cant like submit a guess using chrome or firefox
im just asking , theres ppl on reddit that said it
better discord propaganda
me when my isp "removes" the ability to make new emails (the CreateNewEmail() function wasnt removed lmao)
also i created 17 which is over the 15 email limit they used to have
you love violating ISP terms of service
well i deleted the emails anyways
thats why theyre checked
making a userscript in svelte š„
rate my code
<script lang="ts">
import { getContext } from "svelte";
import type { Writable } from "svelte/store";
import { type defaultSettings } from "../settings";
import { type Executor, setupModule } from ".";
const settings = getContext<Writable<typeof defaultSettings>>("settings");
// Module Code
const execute: Executor = {
name: "Template",
supports: ["player"],
loop() {
if (!$settings.yourSetting) return;
// Your code here
},
};
// SETUP CODE
const logs = getContext<Writable<string[]>>("logs");
const loop = getContext<Writable<boolean>>("loop");
const keyEvent = getContext<Writable<KeyboardEvent>>("keyEvent");
setupModule(execute, { logs, loop, keyEvent });
</script>
uses stores as triggers for events
// ==UserScript==
// @name asdasds Dev Loader
// @description Loads a hot-reloading asdasds instance from vite
// @match a
// @match a
// ==/UserScript==
const scripts = ["@vite/client", "src/main.ts"];
console.log("Loading asdasdasdsa dev instance");
scripts.forEach((script) => {
const scriptTag = document.createElement("script");
scriptTag.type = "module";
scriptTag.src = `https://localhost:4000/${script}`;
document.body.appendChild(scriptTag);
});
had to give vite ssl so it can be loaded š„

oh i never showed the setup script
export function setupModule(
execute: Executor,
stores: {
loop: Writable<boolean>;
keyEvent: Writable<KeyboardEvent>;
logs: Writable<string[]>;
},
) {
window.a.modules[execute.name] = execute;
let errorTimeout = false;
let errorCooldown = 0;
function catchError(e: unknown) {
console.error(e);
stores.logs.update((logs) => {
return [`Error running ${execute.name}`, ...logs];
});
errorTimeout = true;
errorCooldown += 1000;
if (errorCooldown > 10000) errorCooldown = 10000;
setTimeout(() => {
errorTimeout = false;
}, errorCooldown);
}
function wrapFunction(fn: loopFunction | keyEventFunction) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return function (args: any) {
if (errorTimeout) return;
try {
fn(args as never);
} catch (e) {
catchError(e);
}
};
}
let isSupported = false;
if (execute.supports.includes("player") && IS_a_PLAYER)
isSupported = true;
if (
execute.supports.includes("manager") &&
IS_a &&
!IS_a_PLAYER
)
isSupported = true;
if (execute.supports.includes("dev") && IS_DEV) isSupported = true;
if (!isSupported) return;
if (execute.loop) stores.loop.subscribe(wrapFunction(execute.loop));
if (execute.keyEvent)
stores.keyEvent.subscribe(wrapFunction(execute.keyEvent));
}
also it helps alot that when setting a target for a component it doesnt remove other children of the target
so i can add shit to preexisting toolbars
react just kills all the children
oh did i mention im using vee's webpackgrabber userscript to get fontawesome react components :3
9165: function(e) {
"use strict";
e.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"
},```
i love random webpack modules that are required almost everywhere
h
variable
h jumpscare

anyway on a seemingly unrelated note
vencord'd discord on my epic plugin doesn't load this enum for some reason and it's making settings not open
ie is undefined

š„
Can somebody help me out? So I have been working on getting vencord to work on my js injector that creats a script element and injects it into a iframe using the proxy ultraviolet and well uppon testing this I get this error:
Uncaught ReferenceError: unsafeWindow is not defined
at vencord.js:12:9405
at vencord.js:3:484
at vencord.js:14:2142
at vencord.js:3:484
at vencord.js:271:8
at vencord.js:272:1440
The version of the script is a slightly modified version of the userscript. If you wish to view it heres the link: https://cdn.z1g-project.repl.co/sodium/plugins/vencord.js
don't use the userscript if you don't use a userscript Manager
you should use browser.js and browser.css instead
ok
where can I find browser.js in the repo?
k thx
Oh good to know lmao, I also just injected the userscript for my thing
I just did window.unsafeWindow = window beforehand
the userscript also uses gm fetch
so all plugins using fetch will break
the browser.js file is a pure browser bundle
but you also need to add browser.css
does it need to be named browser.css specificly?
look at how i did it
Proxy to inject vencord into discord web. Contribute to shigandco/venproxy development by creating an account on GitHub.
inject the script into head
you have to do a little workaround to get the css though
Btw is there any event I can listen to on the flux dispatcher or somewhere else that will let me know when discord has finished loading ?
Like has initialized
i tried that, not really
i just waited for message_load or something
lemme find it
Isn't message_load when you open a channel ?
I want something even more barebones more importantly I want something that fires regardless of whether you're logged in or not
Is there any property that I can count on being set once it's done so I can check for undefined in a loop
uhh idk
I hope this works Iām at lunch rn but when I get back to class Iāll try and add the css
when do you want to receive the event? after the first few files are loaded, after discord connects to the websocket, after the contents of the current channel are loaded?
discord finishing loading isn't a singular point in time
some of these events can happen multiple times, like when a new ws session is established and you see the loading screen again
out of those 3 i guess after the first few files are loaded ? isn't the first thing it does connect to the websocket ? like isn't the gateway connection on the html document before it starts loading all the webpack chunks, or am i remembering wrong
i guess in a practical sense, when it starts showing the spinning discord logo, so after all the webpack stuff has loaded and it's in a position to render something
I got the error:
Vencord Settings An error occurred while loading the settings. Corrupt settings file?
TypeError: Cannot read properties of undefined (reading 'getItem')
at Object.get (VencordWeb:253:1302)
at VencordWeb:19:33467
at VencordWeb:6:484
at VencordWeb:26:7341
at VencordWeb:6:484
at VencordWeb:181:28848
at VencordWeb:6:484
at VencordWeb:181:31652
at VencordWeb:6:484
at VencordWeb:181:32117
at VencordWeb:6:484
at VencordWeb:186:1414
at VencordWeb:6:484
at VencordWeb:253:1438
at VencordWeb:253:1459
(anonymous) @ hvtrs8/-dksaopd,cmm-aqsgtq/:c:559a21d0e39a26942,jq:540
_log @ VencordWeb:6
error @ VencordWeb:6
(anonymous) @ VencordWeb:19
(anonymous) @ VencordWeb:6
(anonymous) @ VencordWeb:26
(anonymous) @ VencordWeb:6
(anonymous) @ VencordWeb:181
(anonymous) @ VencordWeb:6
(anonymous) @ VencordWeb:181
(anonymous) @ VencordWeb:6
(anonymous) @ VencordWeb:181
(anonymous) @ VencordWeb:6
(anonymous) @ VencordWeb:186
(anonymous) @ VencordWeb:6
(anonymous) @ VencordWeb:253
(anonymous) @ VencordWeb:253
VencordWeb:19 Uncaught TypeError: Cannot set properties of undefined (setting 'Vencord_settingsDirty')
at Object.set (VencordWeb:19:32094)
at VencordWeb:21:11468
at Array.forEach (<anonymous>)
at VencordWeb:21:11426
at VencordWeb:6:484
at VencordWeb:186:1419
at VencordWeb:6:484
at VencordWeb:253:1438
at VencordWeb:253:1459
set @ VencordWeb:19
(anonymous) @ VencordWeb:21
(anonymous) @ VencordWeb:21
(anonymous) @ VencordWeb:6
(anonymous) @ VencordWeb:186
(anonymous) @ VencordWeb:6
(anonymous) @ VencordWeb:253
(anonymous) @ VencordWeb:253
VencordWeb:5 GET https://beta.sodium-5h8.pages.dev/uv/service/hvtrs8%2F-cfn%2Cz3g%2Fppoheat%2Crgpn.ao-smdkuo%2Frlwgknq%2Ftelcmrf.asq 500
Also they are being injected correctly:
oops
is it in the top of the head
you need to inject before discord
yes
oh it injects after iframe.load
bad
vencord needs to be run at document start
before discord, before even the body is ready

probably eval the browser.js and put the css in, then fetch discord document externally and innerHTML it and do the replaceChild trick to make the script tags load
is there a succesful login event or something along those lines ?
that can work too for my case
check
or some store that has the logged in status
yea that's what i'm doing right now and getCurrentUser returns undefined if not logged in but it also returns undefined if i run it too early
define finished loading
what do you consider finished loading
.
add a webpack listener for when react is loaded. you might have to then use setImmediate() to run the next tick
vencord used to use that
but we switched to CONNECTION_OPEN iirc
aka logging into gateway
but if you're not logged in then it won't fire right ?
yea
why do u need this anyway
what are u trying to do
seems like XY problem kinda
im sending a ready even to my backend that sets a state that allows the discord tab to open and the quick access UI to render, the lynchpin for when this even will be sent is the existence of a user on the UserStore, which is checked in a simple loop
but if the dude is not logged in and user doesn't exist, it doesn't send the ready event and the dude can't open the tab to log-in. this could be solved by sending a "loaded" event when discord has loaded regardless of login status
and a secondary ready event for user info etc
so you want to render some ui as soon as the ui is ready
just wait for the existence of react then and setImmediate() your callback
should work
to continue the above thing, after the loaded event i can send a ready event with user if logged-in
like im doing rn
does vencord even load when not logged in?
Don't run a loop, subscribe for the "CONNECTION_OPEN" event in the Dispatcher
how do i check for react btw ?
partially
start() methods are only called once you login
so this is logged in and the one below is react loaded ?
no
the one below is when logged in
to detect react being loaded you just waitFor("useState")
assuming you're using vencord
you need to pass a callback function
oh
as second argument
waitFor(Filter, mod => {})
it's callback because promise wouldn't be very useful
the entire point of it is that you just add a listener and then continue the code
waitForStore("DraftStore", s => DraftStore = s);
waitForStore("UserStore", s => UserStore = s);
waitForStore("UserProfileStore", m => UserProfileStore = m);
waitForStore("ChannelStore", m => ChannelStore = m);
waitForStore("SelectedChannelStore", m => SelectedChannelStore = m);
waitForStore("SelectedGuildStore", m => SelectedGuildStore = m);
waitForStore("GuildStore", m => GuildStore = m);
waitForStore("GuildMemberStore", m => GuildMemberStore = m);
waitForStore("RelationshipStore", m => RelationshipStore = m);
waitForStore("PermissionStore", m => PermissionStore = m);
waitForStore("PresenceStore", m => PresenceStore = m);
waitForStore("ReadStateStore", m => ReadStateStore = m);
waitForStore("GuildChannelStore", m => GuildChannelStore = m);
waitForStore("MessageStore", m => MessageStore = m);
waitForStore("WindowStore", m => WindowStore = m);
waitForStore("EmojiStore", m => EmojiStore = m);
if it were a promise you'd have to use Promise.all or smth and then you need to await
and you can't await on the top level
it gets uglier than the callback variant
you can call an async func without awaiting it though
but you need to await to get the value
or you can promise.then it
eh not important anyway
waitFor("stuff", callback) vs waitFor("stuff").then(callback)
to turn a promise into a callback you just .then it but to turn a callback into a promise you have to wrap it in a promise with resolve executor which is uglier :^)
anyway i think i can work with all that
thanks a lot for the help
The what lmao
Uhh Iāll see what I can do
so add the content from here: https://cdn.z1g-project.repl.co/sodium/plugins/vencord.js into this?
<script language="javascript" type="text/javascript">
function doOnLoad() {
addScript('inject',"function foo(){ alert('injected'); }");
}
function addScript(inject,code) {
var _in = document.getElementById('inject');
var scriptNode = document.createElement('script');
scriptNode.innerHTML = code;
_in.appendChild(scriptNode);
}
</script>
I have very little css knowledge... is there a way to load a local font on my pc and use it as a font for Discord?
:root {
--font-primary: 'Inter';
}
tysm! :3
:3
@rocky jackal is your colorways pr usable? i wanna add it as a userplugin
oo it does yay
the suggested approach is basically making a copy of all your pages and editing the text inline
the libraries look decent but dont work properly and dont support cf
how would an i18n library not support cloudflare
couldnt it just check for something in path
cause cf doesnt run in node
and the library depends on node inbuilt modules
btw where can i get the latest stable browser.js automatically ?
nvm found it builds/main/browser.js
i found out today, that vencord is the lifeline of discord running in its little blissful steam simulation
not sure what happens in the background but it will crash unless vencord is injected
discord in my plugin runs in a separate CEF browserview tab, but the neat thing is that steam only gives mic permissions to its own tab (for steam calls), and all other tabs don't have it
at first i thought it was some cef parameter on tab creation
but that came up empty
and then while fiddling i realized that any tab that is navigated to steamloopback.host (steam's internal url for stuff) will automatically have mic permissions
so the amazing idea was to proxy all of discord through steamloopback.host, via a mix of cdp request interception and patching xhr to send to localhost instead of discord.com
aagamer actually wrote that code for that
and for the most part it works, some stuff has a bit of undefined behaviour because some workers and few other stuff fail due to cors and what not
but it was working pretty great
but these last few days, some stuff wasn't working like opening settings and user profiles (some enums seem to be undefined for some reason, no idea how that can happen)
and (while probably not unrelated but not sure how related either), i get some weird webpack corruption later on ? like at first everything works great but later on it will start failing to fetch stores or whatever
at random times
that's what the h thing i posted the other day was
so i thought maybe vencord is doing something, and i tried turning off the injection but now discord will not load at all, like it fetches some modules and then just stops, and says fatalcrash in console
var t, n, o = e.user, f = e.displayProfile, d = e.bannerSrc, _ = e.onClose, A = e.guildId, C = e.profileType, D = void 0 === C ? W.y0.POPOUT : C, L = e.allowEdit, P = void 0 === L || L, x = e.showPremiumBadgeUpsell, V = void 0 === x || x, F = e.isHovering, H = e.animateOnHover, Y = re(i.useState(null == (null == f ? void 0 : f.banner) ? ie.COMPLETE : ie.SHOULD_LOAD), 2), z = Y[0], X = Y[1], Q = (0,
this is the first offending line, if i breakpoint it and manually fill out ie which is pic below, it will fail a bit further down on another enum for billing status or whatever
which is weird because in the network tab, i don't see any js request failing, it's loading all its modules as far as i can see
so how does this enum find itself undefined
and here is the error when it can't fetch a store
check if that module errored
idk, i didn't explicitly call it or anything
it does not error for me
btw, this errored some time after launch
if i get the stores and keep them in variables soon after discord launches i can use them
this starts happening after some time
seems like ur discord is corrupt somehow
and i love how this madness was progressive these few days lmao, first CloudUpload find (taken from the voice message plugin), would throw the h error
now findStore does it
how can it get corrupted 
it's web discord btw
here lemme reload it
yea after load it works
this will start failing after some time, completely randomly
no failed script loads btw
deifne "some time"
completely randomly
back there above when i posted screenshot it had been running for like half an hour
i've had it not fail after hours though
anyway, i just said all this to give you an idea, i don't care about this too much because as i said i can get what i want before it fails and keep using it
this one is more important to me
because i can't open settings or user profiles
send your code
my code for what ?
i'm not sure it will be helpful, here is the repo https://github.com/marios8543/Deckcord
wait lemme post the relevant LOC
https://github.com/marios8543/Deckcord/blob/main/defaults/tab_utils/tab.py here is where the discord tab initialization code is (where vencord is injected too)
and here is where intercepted requests are processed https://github.com/marios8543/Deckcord/blob/main/defaults/proxy.py
https://github.com/marios8543/Deckcord/blob/06c7ff27f97c2ac9feef73ff364dc04dbc0011e0/main.py#L129 and here is where xhr requests go
but i'm not sure how reading any of this code will make people understand why discord gets corrupted
especially because it worked a couple days ago
here are the errors during load
but these were also present before when everythign worked fine
anyway none of these issues happen in vencord
they either mean your discord is corrupt or youre doing smth wrong in ur code
yea i didn't blame vencord lol, just thought maybe you had an idea as to why it might be happening since you have worked on reverse-engineering discord
no, they are very obscure errors
for example this erroring means you corrupted the module somehow
ie being undefined ?
nvm that's like the tip of the iceberg
there is a metric shitton of stuff that's not loaded for whatever reason
i give up
it's over
by changing what do you mean ?
i proxy the requests through something
i don't touch any of the actual js
(besides inject vencord)
i don't get any errors here if that's what you wanted to know, all the requests seem to get through fine
nor do i get any other webpack errors besides what i posted above, which as i said i also used to get back when stuff worked fine
rewrite it in a better language than python and it'll fix itself :3
its hard to help you cause i know nothing about ur project
just a wild idea
does a flux dispatcher inteceptor affect the dispatcher itself
besides just listen for events
like if an exception happens in the callback
will it do harm ?
guh
wreq'ing any of the modules that are undefined here returns them normally
what gives
is it some race condition or whatever where they're required too early or something
LMAO
i love that people use that as a resource
i read it like once
you should probably just read the post i took those screenshots for
oooo
remake it for vencord docs :3
i setup the basics of it (moving over installing and plugins.md from vencord and fixing formatting) but im having trouble doing the style
Very informative. Bookmarked
i dont have a lot of motivation for documentation because it seems kinda pointless
yoo this is really cool that someone documented it, i've kinda just figured it out as i went
wish this was around a few years ago 
if you need documentation to understand vencord which is fairly clean code, unminified, has a bunch of jsdoc and has more than 100 plugins serving as examples
then how will you reverse engineer discord which is minified and has no docs either
especially people who can't even figure out the super basics like defining a new plugin
the only documentation that seems useful to me is documenting how to understand discord modules and how to write patches
since that isn't very self explanatory just from reading code
but how to use vencord apis, how to define plugins, etc, should be obvious just from looking at other plugins and the api source code
tbqh vencord code kinda drives me insane when ive just done driveby glancing around to figure out how its injection works
but i get the feeling if i setup a proper environment that isnt github to look at it id probably be fine
yeah for sure
tbqh i miss cc not for cc itself but for how simple the code behind it was
it was the piss easiest thing to understand ever
what might make vencord a bit weird to read is the fact that i generally use 0 comments and use some language features frowned upon
but for the comments, i try to make my code self documenting which makes comments redundant
and for the things frowned upon - well deal with it 
lol
super real
"self documented code" vs "commented code"
i prefer the third option, "unreadable code"
things frowned upon like
try {
var parsed = JSON.parse(data);
} catch (err) {
console.log(data);
throw new Error("Failed to parse JSON: " + String(err));
}
Like callbacks 
most js devs scream when they see var
but i find using var for this case way cleaner than using let outside of the try catch
thats cursed but i do see where ur coming from
try {
var thing = stuff();
} catch {
return;
}
```vs ```js
let thing: someType;
try {
thing = stuff();
} catch {
return;
}
try catch and exceptions is such a stupid thing
imo the var version is cleaner
for a fair reason, that code makes no sense if you don't know var quirks
yea
but i think most js INFLUENCERS would murder me for using var
i wish we had rust like error handling tbqh
let parsed = JSON.parse(data).expect(`Failed to parse json: ${err}`)
real
i mean
fucked up code but u get what i mean
like i'm unironically tempted to commit go and return [{}, null] instead of using exceptions
The unwrooper
Must unwroop
i personally dont like it but it is acceptable
theres that ts-results library whichd be way cleaner than that imho
huh never heard of it
but thats still better than exception-based control plow
function tryCatch<T, E>(factory: () => T, onCatch: (e: any) => E): T | E {
try {
return factory();
} catch (e) {
return onCatch(e);
}
}
const parsed = tryCatch(
() => JSON.parse(data),
e => `Failed to parse json: ${e}`
);

this is still far better than inline try/catch
holy shit that's fire
love it
Is there any pluggin to automatically add the @silent at the start of a reply?

i think trying to port rust enums to js is kinda cursed
cause it'll always be awkward to use
the only reason rust enums are hot is because of the syntactic sugar rust offers
like ?
and let Some()
(imo)
they are dont get me wrong but tbh i still prefer the slight awkwardness when i can use it over try {} catch {}
something rust does VERY RIGHT is letting you return stuff from blocks, like imagine
const thing = try {
JSON.parse()
} catch (e) {
return e: // returns to parent
}
yeah this is hot
basically try catch is an expression
instead of a block
yea
i think there was a js proposal for that
yeah thatd prob make it a bit better
it wouldnt even be a breaking change so it can definitely be done
the closest you get to that is using an iife
which i do a bunch with switches
const thing = (() => {
switch (stuff) {
case 1: return "banana";
case 2: return "gurke";
default: return "oopsie";
}
})();
but like
const thing = switch (stuff) {
case 1: return "banana";
case 2: return "gurke";
default: return "oopsie";
}
};
``` would be so hot
pls
also im gonna kill whoever made this proposal https://github.com/tc39/proposal-pattern-matching
pattern matching is hot but WTF IS THIS
match (res) {
when ({ status: 200, body, ...rest }): handleData(body, rest)
when ({ status, destination: url }) if (300 <= status && status < 400):
handleRedirect(url)
when ({ status: 500 }) if (!this.hasRetried): do {
retry(req);
this.hasRetried = true;
}
default: throwSomething();
}
I do this a lot
const thing = {
1: "",
2: "",
}[stuff]
that is NOT javascript
yeah thats cool too
WH WHW WHWHRBNAHFNWUFKWIIAPKEPISIS:R:
constant map thing
FUCKING NO?????????????
this on the other hand is epic
https://github.com/tc39/proposal-do-expressions
let x = do {
if (foo()) { f() }
else if (bar()) { g() }
else { h() }
};
their example is horridly formatted but yeah
i really like that
do expressions are fire but i wish objects had diff syntax so you didnt need the keyword
and could just do it like rust
i mean technically you dont even need it
if it can parse as an object then treat it as obj
otherwise try to interpret it as block?
although ig then there would be confusion with labels
aint no way theyd want behavior like that encoded in the language
i would think
"if your parser throws an error do other thing"
- it could prob introduce inconsistency n stuff
lol
maybe
i mean do keyword is def the best middleground there
that syntax is a bit cursed tho
idk why it just
feels cursed
can we just replace JS with a new lang
replace with JITed rust
can I redo the browser.js and make it work after iframe.load is compleated?
is this good @tall kiln

im not too sure but
its a native node module over ipc, thats blocking right
idk if its a good idea to put it into a webworker either bc id have to structuredclone to go back
probably
unsane
guhh any time i try to use native node module in worker it shits itself
i enabled node integration for workers, sandbox is off and the module uses the context aware module registrator
that makes sense
partially at least
now we cooking.
AAAAA
i had to require
so dum
much better main :3
// this works
console.log(buf);
const res = erl.unpack(buf);
postMessage(res);
// this produces error
//console.log(buf);
const res = erl.unpack(buf);
postMessage(res);
horrible
what is the buffer lazy now??
maybe? looks like it? the only thing that failed was the heartbeat, which is only a couple bytes so its not unreasonable to withhold allocating. still stupit
anyone got a css snippet or theme that will get rid of this like just remove it
I mean this would still exist
by going to the groupchat and leaving
i dont join voice chats on servers so i dont need it
.container-1zzFcN{display:none}
holy shit thank you
typescript support on browsers
that would be nice
Completely client global colorways selector, needs unblocked csp tho
still dunno how to fix that
What on earth is a colorway
Looks like classic client theme
pure recolors
kinda
but you can make them yourself
and make them a lot more complicated
Ah
for example:
Vomit inducing, thank you
and yes, this is user-creatable
So basically just a ui for picking colors for every --primary-XXX value
kinda, the main idea behind colorways was for them to be one line imports for simple recolors, with the UI allowing you to easily switch between them and create your own
rq question, which directory (by default) has the plugins stored at
they're all part of vencord
Right but i'd like to modify one of them for personal preferences
you'll need to edit renderer.js then
good luck
(or just edit the source code and build lmao)
alright
just a wild idea regarding my problem, could i somehow "re-initialize" module 76834 and push it to webpackChunkdiscord_app, so all its requires are resolved
since, if i take one of these requires and wreq it in the console it resolves normally
(but inside 76834 it is undefined)
i would try this but im still not fully used to how webpack works, i tried to just copy all the code from the file and run (e, t, n), n i imagine is Vencord.Webpack.wreq
but i'm not sure what the other two arguments would be, according to the guide, the second arg is exports, so it would be an object (?) but it complains that it's not callable, and i'm not sure what the first argument (module) is
what are you sayingā¼ļø
im crazy don't mind me
wait so how do I make my own plugin then, where do i store it at
don't do that lmao

Why can't I make my own plugin
i didn't mean that
renderer.js is just compiled and minified, that's all lol
oh no i was just looking for a message related to our previous conversation to ask a new question
Bruh cloudflare was messing up my website's git repo
@sterile helm ^
i can imagine otherwise updating might not work (as well)
Does anybody know whether there's a good reason the TextReplace plugin doesn't store the rules in the settings.json but in the IndexedDB instead?
Using the settings.json would have a few benefits imo:
- rules could be synced with Vencord Cloud Sync
- users can edit their rules in the settings.json directly using any text editor (which is a blessing if you want to edit a lot of rules or copy/paste them)
- sharing an entire set of rules with other users would be easier, too
What do you guys think?
settings doesnt support arrays
Wdym? It's just a JSON. Arrays work too.
The UI is already there. I'm talking about the existing TextReplace plugin.
I'm only talking about where the data is stored.
The TextReplace plugin has two functions that handle data storage. "OnRemove" and "OnChange". You could simply replace the DataStore calls (for IndexedDB access) with statements that alter the settings.json entry, imo.
I would just like to know if you see any technical drawbacks to this, regardless of the exact implementation.
yep
those objects can contain arrays
exactly
KodeToad, you're one of the contributors of the TextReplace plugin, right? May I ask what's your opinion on my idea?
Was there a particular reason why you didn't implement it?
Just curious, not judging
i didn't get around to it
okay, i see
yeah makes sense and well argued
I actually already implemented my idea in my fork of Vencord. Just wanted to hear some opinions before actually creating a PR.
the ui doesnt
hm?
It doesn't need to?
the ui doesn't support what TextReplace is doing
textreplace uses a component setting
yeah but they can have data
oh cool!
what is ur problem
because that wont work well
vban 7 @mild blaze racist
Done! 
sanest fall guys fan
time to figure out how to patch into a react native for web site
@amber basin should i make patches use svelte
:D
because ven want that 
https://github.com/Vendicated/Vencord/pull/540#issuecomment-1450623262
Oh, thanks for the link. But I gotta admit, I don't get why ven wants that this way. I only see benefits in storing the rules in the settings tbh.
Uhhh lemme find a message to link back to
#š§©-plugin-development message check from here I provide all the context of the problem
old message but i love doing this
i imagine its more confusing for newer devs
since they never had to use var
me
iām so used to recognizing it as a massive code smell, mostly from coding support chat
var Code_Smell;//this is high quality code
lol i "love" it when people use a lot of single letter variable names
if the comment says it, it must be true
it sucks when its not obv what it is
i & j are fine for counters
n too

