#🧩-plugin-development
1 messages · Page 48 of 1
A ok
Fr madeline came in clutch
pong
ping
i was busy doing something
dont worry you're not missing out on anything important
Thanks for the reference i do appreciate it
True
So what do i change it to?
How do i make my own custome dev thing
Did you read the plugin guide at all
go to where all the authors are stored and create your own spot
not that hard
It obviously won't get accepted as a pr anyway
So
Just use your i'd
well yeah, but he asked how to do it
{
name: "stupid",
id: 1199792581408731217n
}```
I love you, thanks
so im just providing an answer
most true name
Thanks
But the answer won't work for other people 


@balmy skylook in dms
Do you actually understand how the plugin you made works at all lmao
I reccomend you actually go read the plugin guide, read the source code, and make some other plugins
Yes id do
if you did you wouldnt be here asking about it
Ye lol
/mewing
Bru
Wut
Ill be back
"True friendship is a plant of slow growth, and must undergo and withstand the shocks of adversity, before it is entitled to the appellation." -George Washington
who?
It very much is
(also, i'm considering making a pr with an option to pin plugins to the top of the list for quick config access. Would anyone be interested/actually use this?)
I added a tag to all my plugins so I can find them with the searchbar
who cares if other people want it
if you want it go make it
Are there any extra steps for installing a package for use with a plugin other than just installing it? as far as i can tell, once i build it just isn't seeing the dependency and says that all of the functions being called "arent a function"
Mb
I'm trying to use jimp to make a quoter plugin that adds a context menu option to create a quote image
I get this error when i try to call jimp.read
Oh word
cursed html moment 2
HAH
imagine hiding your username so cringe
here's my username
well for one my username is my deadname
for two i literally cant change it
have you tried useradd and moving your configs
god my old cursed.js fork is so bad
new Function(Array.from(block.children).map(compileTag).join`\n`)()
too much work on windows probably
lol
i cant be bothered as much as it pains me
i just wish they let you
https://files.catbox.moe/khnlv3.png
hop on linux
but windowsss so convenieenttt
can you shave with windows? yeah i thought so
Am i trippin or is there no user property for display name
trippin
/**
* @param {Element} node
*/
const compileTag = node =>
({
if: `if(${node.getAttribute`cond`}){${compileBlock(node.children)}}`,
return: `return ${node.getAttribute`value`}`,
print: `console.log(${node.getAttribute`value`})`,
}[node.tagName.toLowerCase()])
rate my code 
not in the member obj it seems
WHERE 
real
how would i force my vencord client to join a vc?
sorry, I have most channels muted so didn't follow-up on you that day;
i basically wanted to show mutuals between friends servers
why would you do this
im in a server where i got bullied a lot :( i cant leave because i have really good friends in there and its a good place to hangout but there are some mod abusers the owner doesnt do anything. so my end goal is to prevent them from spam disconnecting me or spam moving me.
im not new to programming or vencord plugins but i never messed with voice before
make a new server and invite the people you care about, just dont bother in those places if you don't like it
I would have wanted the same sort of plugin some time ago
you could spam join vc but it's going to be super flaky especially with rtt connections
then again, they can just block your access from the channel so no point in doing this
theres only a few bad apples, the server is mostly fine, its not a small server but its not big either, about 100+ people and it would be a pain to invite everyone.
they dont time me out, just be really annoying.
also used to be in a server like that lol
get the message across that something needs to change
I would start by confronting them
And then start making your own private space if it doesnt work out
they might get the message with the decreased server usage
but then you either helped the original server, or started a new one anyway
yes, you could make a plugin to rejoin, but its not solving the root problem
sorry for the infodump, this has happened more times than I liked to me
actually popped in to ask someone how difficult it would be to modify the Discord Events section to look more like a traditional calendar style view
I have some node.js knowledge, but this would be my first try at a plugin
Was wondering what the best way to implement a 'Calender Channel' sort of thing that Gilded has
but Discord already has the Events backend, which would save lots of hassle
Honestly just want it to look more like the month view thats typical with Calendars
I also say Plugin because I doubt theres enough info in the html to make it just a theme, although that would be very cool
Quoter plugin progress
Depends on what you actually want to change, it might even be able to be done with just pure css
I would totally use this
:3
Way 34209723484 of laughing at annoying people
Is there a way i can pass parameters to a modal when using openModal? i assume there is and i'm just being an idiot
openModal takes in a function that returns a modal component
You can do whatever with the modal component
That looks sick🔥
Oh i get it now
Thanks :P
Also, is there a way i can await a promise funtion from within a react component? whenever i try to, i just get this error
The relevant code:
<img src={await createQuoteImage(recentmessage.author.getAvatarURL(), recentmessage.author.username, recentmessage.content)} style={{borderRadius: "20px", width: "100%"}}></img>
async function createQuoteImage(avatarUrl: string, name: string, quoteOld: string): Promise<string>
action={async ()=> {
openModal(props => <ModalTest {...props}/>);
}}
No
Rip
Ig you could make a state and use an asynchronous useEffect to set the state when you await whatever you need
But you can’t make a react component itself async
I think theres a bot that does quotes like this
Sajasdhjawdhjwadhjaadjsa
Phat oof
I'm gonna have to rethink like everything then
ok right, next dumbass question, is there a function to attach a file?
This chanel made me realize how dumb I actually amb
It makes us all realize how dumb we actually are
Don't worry
Asking dumbass questions in here is a universal experience for the first, like, year of being in the server

😭
I care.
Very nice plugin

I'll also be able to do the send message feature once i actually figure out how to attatch a blob
(or just send the file)
also, wouldnt this work? https://github.com/D3SOX/vencord-userplugins/tree/master/followUser
Looking at the index, it rejoins if you get moved aswell
Very much selfbotting
That would also be pretty useful
looking something like this, general calendar layout
or something that allows you to get a better gauge on the week/month
more visual
You can prob make a plugin for that with your own menu idk if u can do that with css
Yea I don't think "Tomorrow at xx:xx" would be very usable in a theme
I was just wondering how difficult or big that kinda project would be expected to be
It wouldn’t be a 1 day project I can tell you that
You will have to make your own menu make a patch for placing the button to open it where u want it logging all the events then display them in there how u want to
wait a second, moxxie, we havent spoken in ages 😭
I just realised who you were lmao
Ya I recognized you wanted to see if u recognize me lol
lol
thats crazy
Fr
also :/
You will have fun making it :3
true
and it will probably end up on the pile of unfinished or jank projects 😭
also, do I have to make my open menu? cant I just sabotage the already existing ones
or is that not how it works
That’s what I thought about the plugin I posted in #1032200195582197831 lol
But I finished it with friends at some point
lol
literally just git cloned that lmao
Ty that means a lot
I am a sucker for niche things
which is also why I am worried that nobody else would find a use if I ended up making it
There would probably be be a few ppl that would use it
hmm, yea probably
do you think discord would implement something like it themselves within a recent timespan?
they have acknoledged that its a more general chat app now, so organising events would be a very useful feature
Na discord only adds shit that they can make money on
did they somehow make money off of the mobile update?
everyone hated that for a good while
but I like the ui now
idk
ill think about it again when I'm not juggling other projects
Idk but don’t forget the sound board and all the paid profile decorations
the ultimate setup would be to have a discord bot alongside it all to sync the events to a public Ical which could be added to whatever calendar app you used
but also give announcements when new events are created and edited
oh, and a new forum post for every event, to discuss it
havent found anything that does it all yet
You can do it in the plugin with an api for your calander app
but then I would have to have my client on all the time?
it was more of a server enhancement
so the bot adds on to the functional side of the events
But I would need a bot on 24/7 if not
and the plugin adds on to the ui
oh thats easy
just host it on oracle
Ya but it would make it more complicated for ppl to use
oh, the bot and plugin are seperate things
Oh ok
All good my brain is just liquid at this point
Nope
damn
It’s almost 11 am and I started school today at 8:30 so I woke up at like 7 something

Today I have a bit of a short day I finish at 3:20 pm
😭
Fr
@balmy sky did u get the plugin to send the pic now or did u not find how to yet?
I can try to look through some plugins in chem class I’m failing it anyways
🗣️
;3
Yes king fail your chem class for the greater good
On the last test I got 4/100 lol

I’m shit at chem
Dude even if you didn't know the answers you'd get a 50/50
How the fuck did you manage that
It was all open questions that I had to explain 
Makes sense
Chem also wasn't my cup of tea
It was interesting but damn I was so bad at it lmao
I could luckily drop it later on
I don't have the option to unless I wanna move classes and try to join a different subject instead
And it would be a lot more work trying to get up to speed on a different subject
True
Yeah I'll look into it thanks
Oof, yeah I get it. I'm not as much worried about the bad apples. I won't let them ruin it for me, also I enjoy programming and stuff so I consider it a challenge :3
Should i pr this :3
hell yeah

is there any way to send/receive data from an already active voice connection?
what kind of data
voice?
in a plugin
Ofc :3
yoo how'd u get a moxxie lover badge?
How would that work (I genuinely don't know(
He paid
well
everything is technically just binary
instead of audio data if we can send our own data it would work
.
tho discord probably does some processing and some checks
He basically bought it
@clear parcel is it possible
Ye but how would you convert it to make it go through binary through vc
i sponserd vencord
converting is easy
problem is discord processing/validating
discord also prob has some compression stuff for voice
could someone help me
How would converting it work
as vee asked what are you planing to use the daat for in a plugin/ bot and how would it be used
to record voice calls
just use obs for that
doesnt work for recording one person only
i dont think there is a way to only record 1 person
all the audio comes in at once
i know there is, i've done it with @discordjs/voice lib, but that doesnt work when you have an existing connection
with discord bot?
yes
idk then
just regular serilization, most games just sync several elements like positions, moves etc. you convert all these into binary (like position is vector3 aka 24 byte int) then send, and parse it the same way in other end
I WAS GOING TO ASK SOMETHING and forgot I did a \w replace in text replace im dying it was just a wall of woofs on my end 💔
wall of what
lol

no i just eated it all
anyways I don't know the proper chat to ask this, but I wanted to know if it was possible using the current version of text replace to have a list of possible replacements, rather than very simplistic text replace.
Like, for example you could randomly choose between 4 words the randomly appear in between other words
i'm not good at regex so idk if its a lack of knowledge or a lack of functionality
you would prob need to make a plugin for that like the uwufier plugin
ive heard of work being done on a better textreplace i think
blurgh :(
I just want my homestuck typing quirk functionality 💔
my condolences
yeah its truly a shame

it will be ok
I was thinking of working on a custom version of the plugin so I can like, have "loadouts"
and easy toggle on/off of specific ones rather than deleting them
but if someone else is doing it idk if I'll bother
Are their programs that convert data to bytes? and vice versa. If so then technically you can store large amounts of data on social media platforms insted of using google cloud, that possible?
you write the code to data into bytes its not that hard, also we are talking about audio channels data is deleted after it got passed to other user that doesnt make any slightest sense
wdym "data"
anything can be data
bytes are data
Documents, videos, photos etc
A ok
not considered
or bits, not everything necessarily is stored/transferred as whole bytes but usually they are
ok
its like how words are made of letters
every sentence is made of letters
or characters or whatever
What is the smallest unit?
bit
/run ```sh
echo byte jumpscare | hexdump
@dull magnet I only received sh(5.2.0) error output
file0.code: line 1: hexdump: command not found
could be anything really
husk
its all made of bytes which are made of bits
there isnt really a biggest, in the same sense that there isnt a biggest number
^
since things like kilobyte and gigabyte are just different amounts of bytes
O ok
So the base unit is byte
the base unit is technically a bit
but usually you store things as bytes, aka 8 bits
So wahts 64 bit for an app, as an example
wdym
if an app is 64bit that means its meant to run on a 64bit cpu
if thats what u mean
the entire internet is measured in zetabytes
not any 64bit cpu
So when apps so they run on 64 bit they refer to cpu?
yeah
64/32 bit refers to the size of the addresses
O ok i see
What is addresses?
x64 also has more registers and the registers are bigger as well
Alr got it
but yea its mainly address size
you're asking too many questions
lol
I should google
yes
true
you should read an introduction to bits, bytes & binary numbers
In computing, a memory address is a reference to a specific memory location used at various levels by software and hardware. Memory addresses are fixed-length sequences of digits conventionally displayed and manipulated as unsigned integers. Such numerical semantic bases itself upon features of CPU (such as the instruction pointer and incrementa...
Thanks for the explaintions
np
(that's way too complicated for a beginner)
Thanks
first couple sentences are probably fine
just memory location
did you know that ronna- and quettabytes were invented only two years ago
everything in memory is at a location
basically you have computer memory / ram
you can imagine it as a a long band of boxes. each box can store one piece of information
to later retrieve data you stored, you need to remember which box you put the info in. each bit is one box
let's say you put it into box 100. your address is now 100 and you can efficiently access the data at that location
that's how memory works. you put something at some location and remember the address
32 bit numbers have a fairly low limit of 4 million, which means you cannot have addresses for memory areas beyond 4 million bytes (4gb) . 32 bit systems are limited to 4gb ram
64 bit solves that by making addresses twice as long which means you can store much much larger numbers and use terabytes of ram
old systems like video game consoles had a cool thing where u could use more ram than the cpu allowed u to
bank switching
its more complicated ofc and u shouldnt know about that bc its irrelevant today but
thought it was cool to add
we still use it sometimes in embedded lol
ok understood, thanks. Is it possible to have the capacity of the memory to be beyond 64bit? and if so does it just mean that your pc does the "searching" process for the data faster?
if you have a super cheap mcu and it only supports like insert whatever small value depending on how you define cheap we can use it to have a reasonable amount for whatever the task is
technically i guess but there is no reason to
yes, but the 64 bit address space is massive.
^
O ok
64 bit addresses can address up to 16 million terabytes ram
we are still very very far from using that much memory
^
16 exabytes is absolutely insane
O ok i see
32bit is only like 4gb
and a lot of times only 2 or 3gb because of the memory controller
32 bit limit = 4gb ram
64 bit limit = 16 million tb ram
yeah i was about to say

ok thanks for you all taking the time out of your day for answering my stupid questions
lol
I see
go on youtube and search for introduction to bits & bytes or smth like that
you'll probably find many good videos
physical address extension if your curious https://www.reddit.com/r/windowsxp/comments/101litg/using_more_than_4gb_ram_on_32bit_xp/
Ye ill do that, computers are complex 🤐
Ye ill check that, thank you very much
its basically a miracle that they work at all
hows that work?
kernel patch
but how does the cpu write to those locations
actually
nvm
virtual memory
i forgot
Fr, when you think about it how did the person even think of this bit byte and so on and how was it all combine into a single machine
i doubt it was just one person that came up with the entire concept of computer memory lol
"With PAE, the page table entry of the x86 architecture is enlarged from 32 to 64 bits. This allows more room for the physical page address, or "page frame number" field, in the page table entry. In the initial implementations of PAE the page frame number field was expanded from 20 to 24 bits"
one guy implemented it iirc
but the concept of computers having memory is older than computers
Ye ofc but think as how foreign it mustve been, having the cpu search for data in a pool of bits wich is all a computer does, is mind blowing to me
ye makes sense
it doesnt rly search for anything
no searching going on
💀
and apparently Robert Dennard invented NAND so that's super cool
then accessed
The computer knows exactly where everything is in memory
yeah or more so the software
no it doesn't lmao it has a table
And from this table it seachs for stuff, i think lol, imma go to youtube
there is no searching
It does not need to search, because it knows where things are
So it just picks out the data the computer needs?
if it new where everything was, we wouldn't have memory leaks 
memory leaks are from not deallocating things from the heap
not from "not knowing where everything is"
lets say u have 50 boxes with clothes
each box has different types of clothing
u want underwear
so your telling me, deallocation would not be included in "knowing where everything is"
u dont search in every box for underwear
u know which box has underwear
bc u remember or have it saved
So the computer has a mechanism like catergories?
not really
we can externally write to memory and the system won't be aware of it, that's how some hardware exploits work.
mhm
DMA
so the system is aware of memory that it wrote and stored the address of in the page table
Holy ;(, ill be back after reading and researching a bit
enjoy pretty flow chart https://ece-research.unm.edu/jimp/310/slides/micro_arch3.html
bro we have access latency and bandwidth limitations
shut the fuck up no one cares
^
If you want to visit your friend, you don't search through all houses on the street, because you already know they live at number 98
UHM AXHUALLY
yeah this
if you had to wait 2 minutes to read everything you would care
youre going offtopic
no i hate you 
unpopular takes only
don't expect popular takes
someone curioous about something is asking how memory works then u talk about hardware exploits and memory leaks
yea because its important
yeah and they know Nothing about thos things and werent asking about htem
that's why we explain it
They dont even know how memory is accessed
this is the guy who thinks uis should be written in pascal instead of electron
if you don't initialize the memory first it will have random garbage data in it
LOL
correct
it would be about 10x faster lmao
and 100x uglier and less accessible
me when i only think about performance and ignore everything else
and pascal isn't even that fast of a language
would literally look the same
lamo
im proud of u +1,000,000 social credit

Be honest here — do you honestly believe that if Discord Inc. wrote Discord in pascal instead of js, it would be less of a shitshow than the current js version?
libgcc7 has been trying to compile on my ppc g4 for 9 hours now btw 
no but a 3rd party build of it would be
we already have a 3rd party reimplementation that doesn't use web frameworks and its comically faster
i don't need to, theirs is better
But it's not pascal
c++ supports most of the same compiler targets and its multithreaded
so basically electron < pascal < c++ but writing in c++ is harder
the only compiler I care about is the Glorious Glasscow Haskell Compiler
u can say Glasscow instead of Glasgow and no one will notice
i noticed, i just don't care.
best line in the article btw: "We crafted a fake satirical post lampooning Haskell as an unusable, overly complex turd -- a writing task that was emotionally difficult but conceptually trivial."
emotionally difficult but conceptually trivial describes so many things lol
like me fighting cmake
you didn't set a valid name, probably
just create a spoon instead
Just gotta whip out a plate
they already have lobbies for this
they technically still function
this is already a feature
prob means that n is indexing out of bounds
yeah it is i just thought that the error message was funny
How do select dropdowns work? I thought it'd just take an array but clearly that isn't the case.
interface SelectOption {
disabled?: boolean;
value: any;
label: string;
key?: React.Key;
default?: boolean;
}
oh thank you!
unfortunately only work with one option
there are multi choice selects
i didn't know that, that's cool
I can't figure out how to implement select options? They aren't imported nor part of select so I can't do Select.whatever, and I can't just make a select option in the options field either
How would I go about this? I'm sorry if this is a really stupid question
The outer {} denotes the jsx attribute value
<Select // This adds in a function dropdown! Unfortunately only works with one function at a time :(
placeholder="Choose a function for your replace field (Note, these are advanced)"
options={
[label: "4", value: "4"]
}
select={opt => functionSelected(opt, index)}
/>
this spits out a parse error on label, and makes opt not work properly anymore? I assume because it not an any type anymore
specifically the entire {} after select
options={[
{ label: "4", value: "4" }
]}
I thought I tried that wtf gimme a second
omg i feel like an idiot
apologies i woke up like an hour ago 💔
you good
though now I get this error on the Select class type
Seems to say it's missing isSelected and serialize properties
try this extension to have less brainfuck error messages https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors
idk why the drop down is twice the size of the normal fields 
actually wait i might be stupid
ok that was not it
i was
still need to review it
is there a way to quickly load a custom plugin in vesktop?
it's that simple :3
document.addEventListener('DOMContentLoaded',()=>document.querySelectorAll`deadfish`.forEach(block=>{let n=0;Array.from(block.children).map(node=>node.tagName.toLowerCase()).forEach(instr=>{n={inc:n=>n+1,dec:n=>n-1,sqr:n=>n*n,out:n=>{console.log(n);return n}}[instr](n);if(n==256||n==-1){n=0}})}))
They do not
Lobby managers are dead since may 2023 I think
This does the pnpm process automatically?
no that was completely unrelated to that guy's question
that was my attempt at a deadfish interpreter for html
Ye thats better than waht i linked lol
does anyone have proper docs on the webpack common stuff?
currently wracking my brain trying to figure out why this code:
<Select // This adds in a function dropdown! Unfortunately only works with one function at a time :(
placeholder="Choose a function..."
options={[
{label: "No Function", value:""},
{label: "Uppercase Function", value: "upper"},
{label: "Random Function (input a list like: a, b, c)", value: "rand"},
{label: "Lowercase Function", value: "lower"}
]}
select={opt => functionSelected(opt, index)}
isSelected={val => isSelect(val, index)}
serialize={val => val}
/>
makes it so each dropdown option is enabled at once, and are un disableable
isSelected confuses me :(
noice
He codes good fr
Anyone knows why this wont work lol after i put the command it comes back with /mewing
Dawg how in the everloving fuck do you leak your api key every time you ask for help with this plugin
🥺🥺🥺🥺🥺🥺🥺🥺🥺🥺🥺
I deleted it💀
Just now
Message loggers:
the sdk is
the discord api portion is still there
so can you still use discord lobby hosting stuff
love
Is there a way i can get the react component of the emoji picker to use as an input for something?
it's going to be painfully harder than just writing your own
Oofff
if you're trying to add the emoji picker to a slate component then it'll be a little less harder
I probably won't bother then since it's not that big a deal
Was gonna use it as a shortcut for adding emoji names in a plugin config instead of just typing it but eh
Vendicated/Vencord#2145 can someone review this

I'm kinda confused on how prs work, once a pr gets approved does that mean it gets merged? or does something else need to happen
An approval just means “all good, I approve of this pr” but that doesn’t mean it’ll get merged
Ah ok, i get it :3
A maintainer has to review and merge it
some1 should review my pr frfr :3
https://github.com/Vendicated/Vencord/pull/1967
Moxxie when his pr finally gets reviewed
feels like it lol
💀
funny pr momento
waiting until someone actually wants to merge them to update them
maintainers can make it not out-of-date when they merge
oh idk on my pr i just update when it says out of date 🫠
so you are telling me i dont have to update it every time? just wait for it to get accepted?
As long as there isn't a merge conflict and you have allowed edits by maintainers yis
They can just click the button for you
Not sure how it is when you disable that setting
It's been like thst for a while I think
Idk it's been a few years since I had full access to a report that ppl did prs on lmao
oh okie
i just spent way to much time making sure that the pr was up to date 
As long as there's no conflicts it should be fine
also sam got lucky it took them like an hour for the quots pr to get accepted :3
(Also depends on the devs of the project I guess but also usually ppl just enable auto merge and if they don't make the pr up to date then you can just do it)
remember that person that wanted to pay vee to review their pr
It didn't get accepted
Twas just approved
Hasn't been merged yet
oh

same thing
Both my prs got merged pretty fast too (to be fair it was ±1 line each time and I just fixed matches but hey)
a contribution is a contribution B)
mine is on here since november last year 
me fres and echo worked on it
it was fun
Both of these things got fucked by discord adding a ternary into the thing we matched for lmao
One time it was clips the other time it was the app tag
Which one is it again
soundboard logger
idk
Month name moment
Guh
I'm not merging your pr again.
Whar
nop´.
Rude
what about mine :3
I hope your pillow is warm on both sides.
🤨

deal
How could i make a context menu patch for right clicking emojis in messages? i can't really tell how based on any other patches that do the same thing
Ah i see,
FavouriteableId
i love steelseries gamesense api
and you do ONE thing wrong and it just sends back "Something bad happened"
no explanation
oh
Is the funny client on mobile
vns
Added a context menu option to nodefaultemojis
Now you can right click an emoji to remove or add it to the autofill whitelist
:P
Gonna PR it when i can be bothered to put up with githubs bullshit once again (the site is fine i'm just stupid and refuse to admit it
)
git checkout -b whatev
git add *
git commit -m "added thing"
git push
go to https://github.com/Vendicated/Vencord/pulls
Click the open a pr button on the yellow popup

Not hard
can someone help me make a thing for vrc that sends webhook when someone leaves a server using vrcx
figured it out... turned I used a _ instead of a -
yet the server returns 500
steelseries does not know how http codes work
alright
what do you mean "help me"
what do you need help woth
nvm i got it chat gpt saving my life rn
ok nvm
im using vrcx im trying to get a webhook to send to a server when someone join or leaves
i actually managed to get awrf what I wanted working im woof so happy
im using vrcx im trying to get a webhook to send to a server when someone join or leaves
wtf is vrcx
think it might be this? idk much about vrc tho https://github.com/vrcx-team/VRCX
Just get good man
hi guys how can i make a plugin for vencord 🔥 🗣️
Thanks 👍🤓🤓
hey y'all wanna see something cursed?
I don't know how to code, can you explain why it's cursed?
oh. my god.
complex regex
O
some simple regexes
me
@warped shell she ^
I'd go insane before writing allat
it was quite simple
(not that I'm already insane)
i did replace the last 2 with a proper lexer tho
but this is an abandoned project anyways
i just wanted to see people's reactions to my masterpieces
What were you even trying to do with it
parse stuff in the code for space station 13 so i could make a virology helper for it
Bro tf 💀, can you explain in more simpler terms please
No worries lol. I was just bored
using regex for parsing should be illegal
any way to get rid of the way discord handles shift clicks? shift clicking on a DM opens a browser
dont hold shift i hope that helps
Lollll
If avoiding holding shift is difficult, you can try using a flat object such as a screwdriver to remove the key from your keyboard

yea all i need it to do is read the leave/join logs and log it to a webhook
Easy
- Receive the event from vrcx
- Send message to webhook
- ???
- Profit
im to sped man
have you uh
made anything so far
nah tbh
or are you asking "make this program for me"?
gives you LL(k) equiv strength no ? I see no problem here https://cdn.discordapp.com/emojis/1126125369519513731.gif?size=48&name=HappyBun&quality=lossless
Update: found an internal bug lol
lol
since this is the place for de-factor cursed JS, does any1 know if i can override the scope of a function? TLDR I want to import a module from some remote endpoint like:
const mod = await import('http://github.com/file.js')
but I don't want it to have access to shit like localstorage, window etc, is that even possible?
I don't think js supports sandboxing
its not possible to do this safely
yeah, not possible
if you're just importing a script from github and are scared of malicious updates pin the link to a specific commit
I want something like an extension system
say tachiyomi's extension system
but for a JS app
that's the simplest way I can describe it
but I don't want the extension to have access to everything the app is running
I'm considering loading the extension code inside a web worker
that would pretty much accomplish my goal i think?
weeb
why not ??
again, it's just a comparison so you can quickly understand what I'm doing and what's my end goal
because it has login info/tokens?
so if a 2iq user imports some malicious 3rd party extension
its GG?
yeah thats pretty much every extension system ever
theres no good way to hide stuff like this
I think web workers would do this best tbh?
one can do prototype pollution and completely bypass everything
if some dumbass user installs an extension like that why care
its not your job to be 100% stupid-idiot proof
just dont
well yeah, but he would then only pollute the worker
aka the one extension that's running for that worker
the worker has access to the window
what?
no?
not DOM i guess but its really not a sandbox
it doesnt have window or localstorage
it has indexedDB, but fortunately i dont use it
so I think that's the best solution
welp sorry for the chaos then, I solved my own issue
just use web workers
i thought there'd be some fancy proxy or new Function().bind() hacks
but i guess not
yes web workers work
or iframe with different origin
@grand haven (ping to make sure u see)
that blog post is very good
Iframes wont be secure enough
but than you for the ping
how?
iframes are entirely safe
anyway read the blog post
:p
they use a combo of realms and iframe
I'm sticking to web workers as they are really easily implemented in my build pipeline, and i can use comlink to initiate good IPC between them
i can only run iframes in my own origin
unless i host a new origin online
[electron app]
since its same origin, it has access to localstorage
:/
no
null origin
<iframe srcdoc="<html>" sandbox="allow-scripts"></iframe>
this is safe
when u use srcdoc it autoinherits tho?
iirc?
i remember testing this when using the HTTP header for threaded iframes
Since we published this blog post, we decided to change our sandbox implementation to an alternative approach: compiling a JavaScript VM written in C to WebAssembly. As you'll see in the blog post below, it was one of several ideas we originally weighed.
trolley
did you use sandbox attribute?
if you don't add sandbox it will run it in the same origin
TLDR the idea was to make a polyfill for worker
with iframes
that's actually async
you dont add sandbox at all
Where do the ping sounds actually originate from? gonna try to make a custom sound plugin
<iframe sandbox="allow-scripts" srcdoc="<script>console.log('hi')</script>"></iframe>
<script>
document.querySelector("iframe").contentWindow.document;
</script>
actually thats file:// url but it should be similar when you host it on http
ya
but also have to serialise everything
if you're passing large data worker will perform much worse because of the serialisation overhead
like video data or smth
is this for ur webtorrent thing
Found it!!!

there is already a plugin for that
i made a discord webpack search worker and the serialisation of discords webpack modules took like 2 seconds
not really? I just go with comlink and it does that shit for me
I'm not, but in those cases just use transferables
im not saying you have to manually serialise
im saying it serialises everything under the hood which can lead to horrible quality
how do you plan to use transferables when you have multiple plugins? transfers are irreversible, the data is gone after a transfer
well yeah, but that's like 10GB of data per second
not a real problem
is it though?
it was fairly slow for me with not too large strings
try sending a 1mb string to a worker
maybe i was doing something wrong dunno
yeah you defo were
I have a 3D rendering library which renders in worker
transfers to main thread
and that has a throughput of like 3GB/s
actually i was sending a very large json object
with thousands of nested keys
maybe that's why
well transferring arrays is probably the most efficient thing ever
especially if you use typedarrays
typedarrays are incredibly fast it's insane
btw why did you want to polyfill workers
don't tell me you want to support ancient browsers
pr
yes, but not itself that related to webtorreent, tldr its an extension system to pull torrents from trackers
essentially: query worker with anime id, episode number an id, and expect infohashes in return
because i'm publishing to play store
and not having an extension system for piracy is suicide
TLDR i got nodejs to work on android
so i did webview + nodejs thread [something like a worker]
so you almost got electron on android
WHY WOULD U USE JAVA
vendroid is java + webview
WHAT THE FUCK
bro
you want me
to re-write 8MB of JS libraries
into java?
are you batshit insane?
well you didn't mention those libraries
touche

but yeah
TLDR this allows me to re-use
my electron code
almost 1:1
in android
without much changes
maybe like 20 LOC
people with old phones will cry
nope
its so fast its crazy
i ran it on my smart tv that has like 2gb of ram
you dont realise just how insanely fast my libs are
but if ya wanna know how
then 1 sec
thats pretty much 1 click for capacitor
it uses nodejs android
