#๐พ-core-development
1 messages ยท Page 9 of 1
so i think you need to change smth for the var names
lol
Hm
cool site
isnt evanw the esbuild dev
sure is
Evan W
how do u safely join base path with filename without directory traversal
const dir = __dirname;
const filename = "../../unsafeuserinput.txt";
huh
i only want to allow access to files inside dir
browser sucks then 
join/resolve
no lmao
thats exactly what i dont want
Or nodejs actually exports import { sep as pathSeperator } from "path"
this should be fine
but cant they do ./../../
that's what normalize is for
ah
Normalize evaluates those
mb
So they are gone
yea
And then you join them
looks good 
ven is so cool
frr
out of curiosity what's the attack vector for this since for a malicious party to have a bad sourcemap url they already need to get the person to put a file into vencord source
well
even if they run malicious code they only have renderer
if file schema allowed arbitrary reads they could read files
this is really funny why did electron just error
It tried to load package.json as a source map
And couldn't find the right properties
Because it's not one
Why didn't what work
Can you access vencord scheme from fetch()
oky works
nop
why do you think im using weird eval to test it
meow
you can access custom schemas from html elements and source map url and maybe more
not fetch tho
now its good i think
electron.protocol.registerFileProtocol("vencord", ({ url: unsafeUrl }, cb) => {
let url = normalize(unsafeUrl.slice("vencord://".length));
if (url.endsWith("/")) url = url.slice(0, -1);
if (url.startsWith("..")) // no directory traversal today...
cb({ statusCode: 403 });
else
cb(join(__dirname, url));
});
for some reason it always appends / to urls
and that breaks reading file, so i remove it
file/ != file
i could just uh make it only allow whitelisted files
maybe thats better
just to be safe
yeah lemme do that

Beans :(
imo if we have sourcemaps no need for unminified builds
or should we still publish unminified builds?
and let users choose with a clear notice that choosing unmodified builds might result in worse performance
okay that pr is ready for merge now
please someone review to make sure there aren't more stupid bugs like that one i just fixed
vendy loves making stupid mistakes
im a stupid mistake
๐ค
surprised there isnt a rule by default
had to add a plugin
what
typescript there isn't even any code on line 70....
do i seriously have to run tsc and node . every time i have to compile and run a ts file
????
no

go home typescript youre drunk
ITS STILL FAILNG
well now theres actually a button
so makes sense
and this is why you force the merge of main before pr can be merged

lol
add megu min back
install me
and decide where to put vencord files
appdata
just inside vencord config folder?
yea
u will use frenyard <3
frenyard
venny loves go
you will use megu <3
what should the files folder be called
I will use megu
%AppData%/Vencord/data
horror
yea dist works
good?
i love using megu :3
:3
now how to realiably get same dir as electron cross platform
in go

accidently cloned that emote to uni discord
not deleting
see Replugged installer
there's a module that returns dirs based on GOOS
ill give 5 schmeckles for uni invite
protonmail 
thx tho
is that ocnsistent with electron have u verified
appData Per-user application data directory, which by default points to:
%APPDATA% on Windows
$XDG_CONFIG_HOME or ~/.config on Linux
~/Library/Application Support on macOS
cool
also funny
XDG_CONFIG_HOME=/ electron test.js```
causes segfault
yeah that protonmail lib does it
thanks alyxia
<3
MessageAccessoriesAPI is a thing now if you want to try again with the message card stuff without having to deal with embed limitations.
@vestal grove does that ui framework use cgo or pure go
also can you show a screenshot
In any case I found https://github.com/AllenDang/giu which looks promising
cgo. is that a problem? I have no other way to communicate with SDL2 otherwise.
I am asking because compile time is horrid in all frameworks I tried
what times are you experiencing?
well normal go programs compile in seconds
I mean, personally I care little about compile times as it runs on the CI anyways
.
windows
mac
linux
one second
i might just use giu though because i really like it on first glance, unless you have something better to offer
g.SingleWindow().Layout(
g.Label("Hello world from giu"),
g.Row(
g.Button("Click Me").OnClick(onClickMe),
g.Button("I'm so cute").OnClick(onImSoCute),
),
)
also I like how the hello world example called me cute
frenyard is entirely based around flexboxes, giving you a lot of freedom in positioning
why is cross compiling for Windows so pain
msys 
i could also just make a java gui with swing

or is awt the new thing
oh javafx
java bad
not on everyone's pc
Tauri
With preact
And typescript
Best combo
yeah saw that, gonna mess with it later today or tomorrow
What is cgo
ig using c libs in go
How crosscompiling with go is easiest thing ever existed (on bash)
embedding c code in your go program
since all gui libs are in C you gotta use cgo to make gui in go
cgo is really slow to compile because compiling c(++) is sloow
I'd suggest using rust
A nice GUI lib exists for rust
rust horror
Or just use tauri as I mentioned earlier
With tauri you don't really have to write rust code
Everything can be in js/ts
have you checked out fyne
Rule 1 of being good programmer is not using javascript unless you have to
im using fyne rn
^
fyne looked nice
Lmao, sike, go tell that to all the gtk and qt Linux fans out there
Using gjs and shit
(yeah I know python is also used, but that's the minority)
Js is worse
Don't blame js for ur mistakes
Only good thing about js is being embeddable to website
It is a fast language, even tho it is single threaded
And if you don't write bugs, then it is absolutely fine to use it
TL;DR skill issue
I love TS
mantika will use ts soon
whoa
js isn't even what you're making the actual UI out of
HTML and CSS make a great pair for making/laying out UIs and you don't even need JS to have them be functional
if you're not making a desktop app, html forms go a long way (really kinda sad that everything relies on JS for form submissions these days)
that looks neat
whoa no way
I dont just hate the language, I hate its enviromemt(nodejs, npm, stupit unoptamized libs fws) all the apps, freamworks(electron, react(native)... ) made with it is so shit, so bad at memory usage, disk usage, cpu usage
Its the reason electronu exists. Also I hate the language itself
what's your hate with node
I dont just hate the language
ends message with: Also I hate the language itself
basically almost done already
just need to actually implement the logic
i think that's suppose to mean that he hates more than just the language
le grammar interpretation
everything's funky
I dont hate node specifically I hate general, if you are using node and wanna make a big app you have to use shit npm and its shit packages
Yeah then I have to install 300mb chromium instance for app itself to run a basic thing
ok can u guys stop now noone actually cares
why are go devs so cute
the giu example called me cute, go appdir example prints <3
@crude hearth you will love golang
you just put import and it automatically downloads dependency
I alr love golang 
Except error handling
go should go hug megu
yes
You should pay me 5000$ you borrowed yesterday
import "fmt"
func main() {
fmt.Println(If(2 > 3, "a", "b"))
}
func If[T any](condition bool, a, b T) T {
if condition {
return a
} else {
return b
}
}

vendy being productive
xd

its a pain that this lib doesn't use generics
it targets go 18 yet doesn't use them
so you have to pass []any and then cast in ur callback
pain
so smort
owo
segfault
I tried to update Vencord but it didn't work. Then I did the manual steps, after that it killed Discord startup.
Please use Discord for support
lmao
ven spotted
Adds a plugin that removes gift button and nitro button from chat list
Hardcoded variable. this can change in any version & break your code immediately.
Hardcoded variable. this can change in any version & break your code immediately.
Hardcoded variable. this can change in any version & break your code immediately.
Hardcoded variable. this can change in any version & break your code immediately.
lol!
yeah css >
@umbral hedge Hardcoded variable. this can change in any version & break your code immediately.
@MeguMachine Hardcoded variable. this can change in any version & break your code immediately.
@MeguMachine Hardcoded variable. this can change in any version & break your code immediately.
@MeguMachine Hardcoded variable. this can change in any version & break your code immediately.
@MeguMachine Hardcoded variable is great ๐
๐ฟ
you should try injecting inside of me ;)
If you run pnpm lint:fix it should resolve the linting issues
@MeguMachine Hardcoded megu. this can change in any version & break your megu immediately.
does it switch to the channel
switch
does the member list go nutty after a bit
and can u still talk in previous channel
Please do an actual mockup, otherwise nobody will have any idea what you're asking for. Otherwise, I'll probably close this issue.
when you click the wrong button and delete instead of marking as off topic 
nothing of value was lost
think they mean something like the BD ChannelTabs plugin (cant find any ss anywhere and its been dead since swc)
1984
literally
why doesnt this work smh
what is a .GOOS
go os
go(lang) os
oh
c3da99e linting and stuff - MeguminSama
this pr will explode so hard ven will commit it
this is me when Hardcoded variable. this can change in any version & break your code immediately.
hot
@austere talon feel free to copy the discord finders from impregnate/replugged-installer if need be
we already have logic for it in js, mostly adapted from replugged
but ill have a look at cc installer, maybe it'll save me some time
30dd4b9 [ShowHiddenChannels] Add last message info, fix... - D3SOX
Thank you! However I don't really see the point of this because this is easier done with css and that won't break in the future. It also doesn't even cover all cases, there is for example still an obnoxious header on top of people's banners
Please document this a bit better or try to simplify it. For example, for the long patches array, you could add a comment above each line shortly stating what exactly this is replacing. Otherwise this is gonna be hell to maintain!
Please document this a bit better or try to simplify it. For example, for the long patches array, you could add a comment above each line shortly stating what exactly this is replacing. Otherwise this is gonna be hell to maintain!
yes sir
why does that sound so mischievous
Thank you! However I don't really see the point of this because this is easier done with css and that won't break in the future. It also doesn't even cover all cases, there is for example still an obnoxious header on top of people's banners
I feel like being able to easily configure which parts i want turned off is an improvement over CSS, you can't really do that with a CSS theme (without modifying the theme itself manually)
why does that sound so mischievous
:kekw:
Okay im gonna be real I have no idea what's going on but it probably hopefully works
lmao
Someone could make a css toggler that lets you add and toggle css snippets
we could actually move the plugin so it's not a folder
doesnt matter its fine
nah
move it to a file then 
6c38362 Ignore Activities: Fix button not working (#156) - Nuckyz
Someone could make a css toggler that lets you add and toggle css snippets
Pretty good idea, might make it myself
that'd be awesome, I can help you with that if you want
Yeah sure :)
I guess i will close this PR and make a new one later
Sighs, this is a really bad way of doing this...
Just make a GitHub action maybe
Just make a GitHub action maybe
I did not comment about that, the code he wrote to generate the readme is...
@ArjixWasTaken Wasn't really related to your comment. I just wanted to say that this could just be done with an action using a script
@ArjixWasTaken Wasn't really related to your comment. I just wanted to say that this could just be done with an action using a script
Oh, I assumed you replied to me since the author of this PR himself said that he doesn't know how to make workflows.
So saying "just make a workflow" to him doesn't make sense...
Oh sry I didn't see this
i dont know how to make it a workflow
Bru I was working on a new version 
sorry
I don't think running it outside of client is viable
I tried bundling it but because plugins recursively import basically the entire mod its not really possible
actually
using the Web version as a base might work
I mean working on an action
the fact that it's just matching a variable
that's pretty likely to cause issues
you should match a bit more
like match the variable and then some more unique string later on
yeah smth like that is better
8075c68 Implement Patcher & DiscordFinder on Windows an... - Vendicated
8075c68 Implement Patcher & DiscordFinder on Windows an... - Vendicated
I hate how the compiler doesn't tell u errors in files for other platforms
i have to rename file to find_discord_darwina
to get errors
WOOHOOO
vendy being twice as productive
first one is push to main, second one is push to tag
Github doesn't like me force pushing tags I think and that's why it's just showing it as empty
anyway installer works for me
so once I got some Windows & Mac people's feedback we can release it
i also added console logging spam so if it doesn't work for someone i can just tell them to run it via terminal and send me the output

WOHOOOO
Does it work with wine 
uh maybe lmao
but fawn already tried Windows
Nop
i've tried
it's an issue with the gui lib i think lmao
daed48b Add build instructions and install.sh - Vendicated
thanks! I noticed this as well but was too lazy to fix it
d6fe937 fix(vcDoubleClick): exclude text channel mentio... - D3SOX
Fixup for #159
Sorry, I forgot that while refactoring
bruh
3459776 feat(settings): add beforeSave check - MeguminSama
This PR adds support for a beforeSave method that accepts synchronous and asynchronous functions. If beforeSave returns true, then the plugin will save & close the modal. If it returns a string, it will display this string to the user and not save.
what's this Promise.resolve() for?
it accepts a synchronous and asynchronous method & returns the result. Reduces complexity and makes typescript happy with the async vs sync stuff
You can use Promisable<true | string> from type-fest
othr than that looks good so feel free to merge
nya
@fossil otter merged
pog
not sure if there's any better way to do this
what's bad about it?
it's the same module
but one access the Z export
and the other the IgnoreActivities one
yeah
@austere talon @austere talon Vencord org when
never
never
there's 2 repos
soon there will be 4 more
that will be the day of your explosion
c3619bf Linux: Fix Vencord being owned by root - Vendicated
5cac97e Linux: Fix Vencord being owned by root 2: Elect... - Vendicated
I'm stupid
lmao this puts my method to utter shame
huh?
the way you did this is so much less of a hack
let me guess shell out with mkdir and custom umask stuff?
but it works
still relatively proud of my installation code purely because of how much work went into the hacks LMAO
btw
add go build cache
it reduces windows build time from really long to way shorter
notice how Windows still hasn't finished lmao
fucking 10 minutes build ๐
FINALLY
please pr I'm on mobile
to replugged installer?
meow
yeah
I'll be rewriting internals for new installation procedure anyways but just so the build code is there
i did a bunch more improvements to the workflow
horror
like bumping a lot of actions
what does this do?
basically
you can use the linker to replace variables
so I declare a variable named InstallerGitHash and make the linker replace it with the actual git hash
but what's the point of this variable in the code?
sure, give me a second for me to point you where to add them
i'll just add it to the workflow and u can later implement it in code
it doesn't do anything if there isn't actually such a variable (it doesn't error)
ah, sure then
InstallerGitHash is fine
package
then it'd be```sh
-X 'middle.InstallerGitHash=$(git rev-parse --short HEAD)'
gonna add that in my pr
(tmrw, i will sleep now)
oh god
well ig if u have manual version number should i do that instead
replace that variable with the tag
well then ur fetch wouldnt work anymore ig

i'll not add it for now ig, you can do it later
sure
but yeah, i do that for displaying a notice in the app when there's an update
god I keep forgetting how much I love frenyard ngl
I should try it at some point
the library I use rn is also really cozy tho
imgui nice
agree
I'm pretty sure you won't like it but hey
I did my best and I think I did a pretty good job
I like using it and that's what matters to me
why
idk, I feel like it might come off as too raw syntax to people
I was gonna write the installer in C++ initially for the funnies
but realised I don't wanna have to debug segfaults

Also go stdlib is cozy
although basically the only thing that might come off as "too rough" is raw text labels
https://github.com/replugged-org/installer/blob/628de2451ec1ba79c15b834afa64c87ac43de47d/src/preface.go#L79
so in general I hope frenyard isn't too bad
but honestly nobody else has used it before so I can't judge
the reason it's like this is because font rendering is kinda yucky so instead of locking them to a certain type of text label I let the user make these themselves if they need raw text
in the lib I use its just Label("Text")
I feel like I would just make a wrapper around that
you could, the reason I didn't was for freedom
anyway my biggest issue was state management
other things make sense to be components but text was a difficult topic for me
in times like that you learn to appreciate how simple react makes state management
state management is okay in Frenyard, you're recommended to have an app global on which you can store screens
and conditional rendering was also pain since go doesn't have ternary, I had to implement my own ConditionalComponent
which also allows for caching entire screens! e.g. if you're fetching data and don't want to run a request every time, so just run the request in the preface, pass the data to the screen, build it, cache it, and load the cached one from that point on whenever going back to the screen
&CondWidget{bool,
func() *Widget {
}
}```

oh nice
Cached? Load it!
https://github.com/Cumcord/Impregnate/blob/9a0136038c746af7c8c68b9a24aca5dd937e5c88/src/primaryView.go#L15-L18
Not cached? Build the view and cache it:
https://github.com/Cumcord/Impregnate/blob/9a0136038c746af7c8c68b9a24aca5dd937e5c88/src/primaryView.go#L104
The animation state!
So remember that video? How the screens slid left and right?
(and up and down)
That's controlled by GSLeft/Right/Up/Downwards
and can be disabled by using GSInstant for an instant transition
btw why is logging in go so weird
why are there three different modules for logging lmao
fmt, log, and the globals
(here's the internals, short and concise
https://github.com/Cumcord/Impregnate/blob/9a0136038c746af7c8c68b9a24aca5dd937e5c88/src/app.go#L21-L62)
log is cool cause it prints the date as well
oh also log goes to stderr by default
const (
Ldate = 1 << iota // the date in the local time zone: 2009/01/23
Ltime // the time in the local time zone: 01:23:23
Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime.
Llongfile // full file name and line number: /a/b/c/d.go:23
Lshortfile // final file name element and line number: d.go:23. overrides Llongfile
LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone
Lmsgprefix // move the "prefix" from the beginning of the line to before the message
LstdFlags = Ldate | Ltime // initial values for the standard logger
)```
neat u can customise log format
and even print line numbers and stuff
ooo
| | | |
oh also log is threadsafe whereas fmt isn't
LMAO Golang Dojo https://youtu.be/yF7k6PxtRU8
How to Properly Log Things in Go (log package)
Today's video is about using package log to log program information. Logging is essential in any programs, so check out this video so you can stop using fmt.Println() for litterally anything ;)
--
Golang Dojo is all about becoming Golang Ninjas together. You can expect all kinds of Golang tutorials...

tomorrow busy day
need to make basic replugged settings ui
continue web rewrite
write more frenyard docs
and I need to go to work
time for sleep
zzzz gn
dis mah idea!!!
idea for third party loading:
compile ```ts
import Foo from "Vencord/Foo"
Foo.bar()
```js
((Foo) => {
Foo.bar()
})(window.Vencord.Foo)
then just generate typings and plugins will use those
alternatively, i could just define window.require
function require(path) {
if (!path.startsWith("Vencord/")) throw new Error("No such module: " + path);
return path.slice("Vencord/".length).split("/").reduce((prev, curr) => {
if (!prev[curr]) throw new Error("No such module: " + path);
return prev[curr];
}, Vencord);
}```
a separate js file can't be imported?
like one js file with all plugins one after the other
n import it from renderer or sumth
guh tsc
guh guhsc
@austere talon pr instantly


@rigid venturea
as long as you are happy
this is what the new patch does
ee = Object.assign
Object.assign(target, obj1, obj2) merges obj1 and obj2 into target
thats why the onClick gone, it's now in "e"
thankfully Object.assign takes varargs
so i just pass a third argument with our own handlers and it overrides the earlier ones
instead of specifying all the things individually, why not store them as a single json? the default settings ui wouldn't really be suited for this, but you could make a custom component
since you're immediately invoking this in start(), just remove this lazy and do it without it in start()
i dont know what that means
please follow javascript naming conventions. Use camelCase instead of snake_case
thats ok kitten
literally bend over
bbd3633 fix(Ignore Activities): Fixes games manually ad... - Nuckyz
Please fix the linting errors flagged by the GitHub Action. Otherwise, LGTM.
could you give a little more detail like just import it and get over the Promise issue or like the code below. Since i don't really understand what you meant by "do it without it in start()" or maybe i'm just not smort.
let prettier;
export default definePlugin({
...,
async start() { prettier = (await import("x"))?.default; ... }
})
yes
Hey, got a crash after injecting the latest version, which didn't happen around a week ago:
xtrm:~/ $ discord-canary
[Vencord] Starting up...
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
# just hangs here
This doesn't happen without Vencord but I can't figure out what uses libva in the project.
Did you try uninstalling and reinstalling? What were the steps you took to update?
Tried git pull, removing and re-cloning the repo, removing discord-canary and all configuration files, and tried using stable instead of canary.
Not caused by Vencord.
Try running Discord with
discord --enable-features=UseOzonePlatform --ozone-platform=wayland
The ozone fix didn't work last time I checked unless they fixed it
Xwayland should work though so
lmao what
how the heck did changing the name turn IgnoreActivities_reRenderGames into undefined
what
nvm
super cool
hopefully the last
I should have tested one more time
though the other one was just me forgetting to test on manually added games
















3 billion commits
why not pass the option again? more comfy than using this imo
Passing the option is useless though since the only external thing the user would ever need is onChange and setError. I don't believe there is anything in the option object that the developer would need.
The idea was to make the API as simple as possible to use e.g.
{
component: ({ onChange, setError }) => { /* do stuff with onChange and setError */ }
}
yeah but they don't have to destructure the option if they don't need it, so it doesn't make a difference. The reasoning behind passing the option is that the person may want to reuse the same component for multiple options
Someone will make a logo for frenyard NOW
there are no fren in my yard
what is frenyard
(uwu is cumcord people) (yes)
youre blind
how
theyre right here
i don't know everyone's github username
@vestal grove what are you looking for in a logo
log
gay sex
discord has this handy feature called connections

anyways I genuinely have no idea LMAO
Bad
@austere talon https://github.com/ahsand97/upload-assets-to-release-with-go yay or nay ? ๐ฅธ
bro looks like drake
he looks pretty cool
Arab final boss
and uwu was not a connected account
anyways its kinda difficult to make a logo if i don't know whats wanted
try to find something similar online
show
why would I use that over gh cli



actually looks based
i like the duck on top
time to get sued
you gonna get Vanceded
cute
๐ฆ
damn chuck put on some weight
idk but i fwi
hey at least it's not IgnoreActivities this time
i thought it would use pr name as title
simply the initial commit
initial commit
new project
initial d
thank god
I CANT EVEN FIX
I was hating that unread box
HORROR
there fixed the commit title
๐คฎ
the beauty of rebasing instead of merging means commits aren't renamed

trolley
skulley
git pull speedrun any% glitchless
const megu = yield "i love";
const cute = yield "forcepushing";
let log = yield console.log;
log = yield log.bind(yield console);
yield log(yield megu, yield cute);
javascript is a beatiful language
const javascript = yield "javascript";
const iss = yield "is";
const funny = yield "funny";
const log = (yield console)[yield "log"][yield "bind"](yield console);
yield log(yield javascript, yield iss, yield funny);
husk








