#๐พ-core-development
1 messages ยท Page 151 of 1
there's a plugin that injects js into the spotify iframes
it's very easy with electron apis
oh wow
will you ever release it?
i reckon alot of people would use it if you did (me included)
it runs a server on localhost because i didnt want to send my voice messages to an external api but maybe
probably wouldnt be built in
it dont work tho
i made it stream the responses for long voice messages
its not finished but if someone wants to make something cool with it feel free
i was going to add a timing thing when you play it and it highlights which line you're on because it supports that idk i'll figure that out later
segment.start and segment.end
feel free to send a voice message i'll send a ss
you should add an accessory to the message instead of modifying content imo
also since it allows for a custom component you can do fancy shit with it like the aforementioned highlight
im gonna test it rn, gonna try actually get an understanding of the code since it seems like a good example to learn from for plugin dev
yeah ideally i'd show it below the voice message but i want it to be by default (but thats just personal preference i could make it an option)
you can force it to be the first accessory so it shows up above the voice message
wdym by an accessory
like the buttons in the top right when you hover over a message?
content below the message content like embeds or interaction buttons
theres an api for it
ohhhhhhh
i may not have hardcoded the paths to the libraries
if you let vscode import for you it figures it out
oh in your python lol
you need cudnn and cublas
cublas is only cuda 11 but you can just rename the files from 11 to 12 and it works on cuda 12 ๐
if you want an api im pretty sure this uses the same thing and you can probably make it work but no streaming https://docs.runpod.io/reference/faster-whisper
wtf ๐
i dont even know dude
whenever i try install the whisper dependency it just freaks tf out

i was about to go crazy
lmaooo
this is the full cmd output when i try install the dependencies
alr im trying with your python verison now
oh wtf it works fine now 
fml
0900aef README: remove outdated section - Vendicated
im a bit slow how do u make a modal?
same?
None
None
None
None
None
None
None
None
what does the --watch do on pnpm build, because I assume it rebuilds on changes and somehow hot reloads vencord into your client but I am just speculating and I dont find a "DevCompanion" plugin in vencord
rebuilds on changes and hot reloads css
okay
for most things to reapply though, because the way vencord is made, you have to ctrl R
oh quick question is there a possibility I will break my current stable vencord install/config by using the dev version and messing with plugins
very unlikely
I develop vencord and plugins in the same config/install I use daily
as long as don't touch other plugin settings, or in case you do, not forget to change the code to work with the new settings you are fine
as a test I tried changing a plugin's name but its not injected into my client after reloading with ctrl+r
in any case your settings file in prob just include settings for the plugin you are developing, if it's a new one
that's irrelevant though because extra settings don't matter
well, if you change a plugin name you have to migrate its settings
No I meant just to see if it would appear different in the plugins list
I assume at least that all plugins are built into vencord
since they're in the repo
it should
since I joined this discord server
it needed sudo rights :p
not sure cuz I use windows
hmm, is it safe like?
if you know what i mean.
lol
i Succeeded in blocking input yay
maybe vim keybind wont be that hard
the modes work at least
handleKeyDown(k) {
console.log(k);
console.log(`Current mode ${mode}`);
if (mode === VimMode.Nav) {
if (k.keyCode === KEY_I) {
mode = VimMode.Insert;
} else if (k.keyCode === KEY_J) {
// scroll up
const shifted = k.shiftKey;
if (shifted)
console.info("Big scroll up");
} else if (k.keyCode === KEY_K) {
// scroll down
}
k.preventDefault();
k.stopPropagation();
} else if (mode === VimMode.Insert) {
if (k.keyCode === KEY_ESCAPE) {
mode = VimMode.Nav;
}
}
}```
very happy that this wasnt too hard
my hand often hurts because of scrolling discord so I need this ๐ญ
will you guys add a plugin that lets us force see audit logs
that's not possible
rule 9
ur mom is rule 9
no, ur mom is rule 9
image not user
ah so it is broken
guys, gals, and nonbinary pals
i have figured out message accessories
was easier than i expected
@cunning canyon use a negative draft type to prevent collision with discord IF in future they add another draft type
what is negative draft type
i meant using -1 or something
but it turns out 5 is a draft type discord uses and you're not adding a new draft type
so you can ignore what i said
holy shit thats so cool
I'll send the updated code in a bit
ur so based
Is this really a good idea? After some discussion on [Discord](#๐จ-theme-development message) I am convinced it's not, and it'd be better to just update the plugin when it breaks. I reverted the change, though if the maintainers will want this I will re-introduce it.
partial matching is faster and more compatible. I don't understand why you wouldn't use it.
...unless i'm misremembering... maybe it depends on browser too ๐คทโโ๏ธ ...
which is better
1 nanosecond slower vs not functional for weeks when classes changed 
if you think about it startsWith("reaction_") is faster than contains("\breaction_fef95b\b")
however there's probably some magic optimisation stuff
class matching is definitely not implemented in any major browser as a string search
magic optimisation
you have an obvious optimization here which is to not use strings
aka HashSet probably 
still, i think someone random in css-development tested it once and partial match was faster lmao
(most reliable source)
I can't think of any obvious optimizations for matching by attribute, as it is quite literally string search
that said, it could have non-obvious ones
I don't really think about it in terms of performance here though
more in terms of correctness
wait what?
do you want to update it every time the class changes?
slash petpet image explod
i don't really understand, could u explain?
do you mean specifically the custom m image option
yes
Updates electron, which now uses chrome 120
- ^119 is now required for colonist due to document.hasStorageAccess()
how is this a fix?
what's colonist?
My bad for not explaining. Colonist was recently added as a discord activity. (https://colonist.io/)
On the current version of Vesktop, launching Colonist will result in Error 1003, Third party cookies must be enabled to play this activity.
Colonist is trying to call hasStorageAccess() (https://developer.mozilla.org/en-US/docs/Web/API/Document/hasStorageAccess), which was added in chromium v119.
Updating electron allows the activity to launch as intended.
, not entirely sure how its working on the vanilla client. it does not look like hasStorageAccess is a valid func, so its not been backported.
maybe the vanilla client is being served a different file ...
plugin has bees siting around for about a month now just want to see if anyone has anything to add/change
there's an experiment that does the same btw
ik but this also allows cloning of sounds and a few more things
also we made it before the experiment 
what do you think about it vee?
does setting.onChange fire whenever its changed at all or only when its changed from the settings ui
i want to clear a store when the setting is changed thru console for a hidden setting
just look at the code or test
Allows the user to set a custom decor server via a hidden setting, fetching the client id and cdn url from the server, allowing easier development on a seperate server
thank you, copilot
copilot is just ai powered Ctrl+C Ctrl+V
whether it's yoinking a stackoverflow answer or duplicating your own code with minor changes; both of them often being bad practice
(satirical)
plugin + whisper server
ideally we don't want to upgrade the electron version if it works on the vanilla client's older version - can we please investigate this further rather than doing a major upgrade, since it has the potential to break other things? for context, canary seems to currently be on Electron 22.3.26 so if it works fine on there then we need to work out why.
i mean worst comes to worst, write a polyfill of document.hasStorageAccess = () => true and it'll fix the game from what i'm hearing, which...
also discord's electron is cherrypicked and has patches
it's not vanilla 22.3.26
e.g. it has a few security patches backported
setting it up rn
would it potentially be possible to run the py server hidden automatically?
probably but i dont want to auto download the dependencies
oh true
Could not locate cublasLt64_12.dll. Please make sure it is in your library path!
any ideas? i probably just fucked something up in the setup knowing me 
where can i download cublas from?
oh yay
theres another one
i forgot where i got it from
cudnn is much easier
can you spawn a child process from a plugin?
doesnt seem like i can import spawn
you ahve to use ipc i believe
and compile it to wasm
actually wasm is not that fast
surely itd be easier to just run the whisper process within the plugin code rather than just hosting it from python
if someone has experience with GLFW / C++, i'm stuck on this https://github.com/AllenDang/giu/issues/686#issuecomment-1868619300
None
None
None
None
None
None
None
None
dont use go ๐
but scrolling works already :>
why are those classes ๐ญ
looks nice
once i release this we can remove the linux gui entirely
and make linux users use the cli
they will love it
merlijn@arch ~ % cat .bin/update-cord.sh
sudo XDG_CONFIG_HOME="$XDG_CONFIG_HOME" ./vencord-installer --uninstall --location /opt/discord
sudo XDG_CONFIG_HOME="$XDG_CONFIG_HOME" ./vencord-installer --uninstall-openasar --location /opt/discord
paru -S discord
sudo XDG_CONFIG_HOME="$XDG_CONFIG_HOME" ./vencord-installer --install --location /opt/discord
sudo XDG_CONFIG_HOME="$XDG_CONFIG_HOME" ./vencord-installer --install-openasar --location /opt/discord```
I already made this tbh
but it breaks when discord decides it hasnt fully updated yet via paru
then openasar cant launch it
i will remove the need for you to uninstall to update discord
๐
but a real answer would be that I'd like to add state in the future and this looked like an okay way to do it
e.g. 20j would jump 20 messages or something
GUH THERE IS NO ASAR LIBRARY IN GO
write one
its just a derivative of tar
if you dont want to then i might, i need more shit to write in go
i tried looking for a C/C++ one
cause then i could just use cgo
but there isnt one either
how has noone created a C++ asar library yet wtf
i only found one in Crystal and C#
yeah i think the only version is @electron/asar because its only used by electron
wtf
c# understandable but fucking crystal????
btw there actually is https://github.com/layeh/asar
but its broken
i tried it and the asar it writes is corrupt
fork time
7y old
horror
Crycord developer made it
oh
anyways i came here to say that apparently css nesting is in chromium 120 and thats what electron 28 is on
so if and when discord finally updates to 28 we can have css nesting in themes
vesktop has had nesting for ages
you can in vesktop :PPPP
sadly my hh hijack for vesktop is broken and i have no idea why
https://github.com/Maks-s/asar-cpp bitch why did u only make a decoder
well aside from not loading vencord
its specifically the vencord loading that breaks for no reason
something weird with webpack where nothing loads properly and so it crashes cause Common.React is undefined
and i spent like 2 hours on it the other night to no avail
actually
can i cheese it by hardcoding asar bytes and using string.replace
๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ{"files":{"index.js":{"size":16,"offset":"0","integrity":{"algorithm":"SHA256","hash":"406770e1746833a5ab9dd1fc17b65abc914058212a93e91564eccbeca0194fdc","blockSize":4194304,"blocks":["406770e1746833a5ab9dd1fc17b65abc914058212a93e91564eccbeca0194fdc"]}},"package.json":{"size":44,"offset":"16","integrity":{"algorithm":"SHA256","hash":"d599f28018b12a54ee3e9a9433f95c33e104685e3e21bde4f28ea3fbcd8af455","blockSize":4194304,"blocks":["d599f28018b12a54ee3e9a9433f95c33e104685e3e21bde4f28ea3fbcd8af455"]}}}}๏ฟฝ๏ฟฝrequire("PATH")
{
"name": "discord",
"main": "index.js"
}
i'd need to recalculate the hashes and size/offset
ughh whats blockSize
according to wikipedia sha256 block size is 512
why is asar saying its 4194304
is integrity optional?
actually yeah this format seems easy i might just write an encoder
I kid you not Jeff, he turns himself into a pickle, he's called https://chromium.googlesource.com/chromium/src/+/main/base/pickle.h
i just read the conversations here and humanity is saved 
AYYY
i did it maybe
var PackageJson = `{
"name": "discord",
"main": "index.js"
}`
type asarEntry struct {
Size int32 `json:"size"`
Offset string `json:"offset"`
}
func WriteAppAsar(outFile string, patcherPath string) error {
header := make(map[string]map[string]asarEntry)
files := make(map[string]asarEntry)
header["files"] = files
fileContents := ""
patcherPathB, _ := json.Marshal(patcherPath)
indexJsContents := "require(" + string(patcherPathB) + ")"
indexJsBytes := len([]byte(indexJsContents))
fileContents += indexJsContents
files["index.js"] = asarEntry{
Size: int32(indexJsBytes),
Offset: "0",
}
fileContents += PackageJson
files["package.json"] = asarEntry{
Size: int32(len([]byte(PackageJson))),
Offset: strconv.Itoa(indexJsBytes),
}
headerBytes, _ := json.Marshal(header)
headerString := string(headerBytes)
headerStringSize := uint32(len(headerString))
dataSize := uint32(4)
alignedSize := (headerStringSize + dataSize - 1) & ^(dataSize - 1)
headerSize := alignedSize + 8
headerObjectSize := alignedSize + dataSize
diff := alignedSize - headerStringSize
if diff > 0 {
headerString += strings.Repeat("0", int(diff))
}
f, err := os.Create(outFile)
if err != nil {
panic("oh god")
}
defer f.Close()
for _, n := range []uint32{dataSize, headerSize, headerObjectSize, headerStringSize} {
_ = binary.Write(f, binary.LittleEndian, int32(n))
}
_, _ = f.WriteString(headerString)
_, _ = f.WriteString(fileContents)
return nil
}
0ced96b jsajhsjhaasjhashjahjsadbnasbnddasbn - Vendicated
curious why you're making a new asar
to replace discords app.asar with ours
what was the problem with the folder method
well theres your first problem 
maybe others
i am the anti installing anything you're going to mod through a package manager
the majority of people will
i know, it still annoys me
its why i wrote this
mkdir -p ~/.local/share/
cd ~/.local/share/
wget "https://discordapp.com/api/download/canary?platform=linux&format=tar.gz" -O DiscordCanary.tar.gz
tar -xf DiscordCanary.tar.gz
rm DiscordCanary.tar.gz
# optional if you use desktop files
mkdir -p applications
sed -i "s|/usr/share/discord-canary|$(echo $HOME)/.local/share/DiscordCanary|" DiscordCanary/discord-canary.desktop
mv DiscordCanary/discord-canary.desktop applications
mkdir -p "${HOME}/.local/share/icons/hicolor/256x256"
cp -f "DiscordCanary/discord.png" "${HOME}/.local/share/icons/hicolor/256x256/discord-canary.png"
sed -i "s|Icon=discord-canary|Icon=${HOME}/.local/share/icons/hicolor/256x256/discord-canary.png|" "${HOME}/.local/share/icons/hicolor/256x256/discord-canary.png"
@austere talon please please please tell me cli installer is real
I LOVE YOU MWAHH
idr other than its deprecated
maybe i should make my own dvm for shits and giggles
Since documenting ~120 plugins is a pretty big task, we would likely have to make this a community effort, which means that we ask users to each document one plugin and then combine all these. Would have to think about this more and organise it properly
If it comes to writing README.md for each one of those plugins, I could write them myself, writing is fun after all!
Also, would you have a layout for each README.md or? since without a layout things would probably get quite messy.
because of this i wrote pacman hooks to move the folder around so it doesn't conflict during upgrade ๐ญ
Is there any easy way to get an array of all text content in a channel?
what for
I'm trying to make a custom search thingy, there's probably an easier way to do it than just grabbing every message and filtering through tho 
you can only do that in chunks
so it's not viable for search
no, its not loaded
I'm curious what you think is missing the default search
you can't
Nothing in particular I just thought it'd be a decent simple idea to get used to making plugins
are there any plugins i can use as an example to learn how to make plugin configs? or documentation of some time
configs?
i mean in the plugins menu, where you can configure the settings of a plugin
ive figured out how to define a setting but im not sure how to actually grab the value of it
ahhh alr got it
settings.store
can client-side profile customizations like profile effects and animated avatars be added (server side if possible)
not serverside
vns
None
None
None
None
None
None
None
None
I need some people to test the new installer changes please. Make sure
- all operations work
- it can successfully force close and patch your Discord if it's open
the gui you can just double click and it'll open
for the cli, open a terminal and drag it into the terminal then press enter
if on linux, you need to
cd /tmp
wget https://cdn.discordapp.com/attachments/1015063227299811479/1189004827842322442/VencordInstaller-CLI-linux
chmod +x VencordInstaller-CLI-linux
sudo ./VencordInstaller-CLI-linux
the gui hasn't changed one bit but there are a lot of under the hood improvements and fixes
and the cli has got a full remake, now it's an interactive prompt
you should make it reopen it, the gui version worked fine for me
reopen it = automatically start discord again after patch?
yes
what happened to the web version of the installer
is the code you just sent available on the github?
the binaries i just sent are just the latest code on the main branch on github
yes
the cli version works fine too
but there have been tons of changes since the last release (what u get when downloading from releases)
https://github.com/Vencord/Installer/compare/ca03a38b8976edafd14684afba698247feabcc92...HEAD
oh god its in go
nice you fixed killing the process on window
cool thanks!
wait wdym
my hatred for windows api is unreal https://github.com/Vencord/Installer/blob/main/find_discord_windows.go#L135-L151
**find_discord_windows.go: **Lines 135-151
func findProcessIdByName(name string) uint32 {
snapshot, err := windows.CreateToolhelp32Snapshot(windows.TH32CS_SNAPPROCESS, 0)
if err != nil {
return 0
}
procEntry := windows.ProcessEntry32{Size: uint32(unsafe.Sizeof(windows.ProcessEntry32{}))}
for {
err = windows.Process32Next(snapshot, &procEntry)
if err != nil {
return 0
}
if windows.UTF16ToString(procEntry.ExeFile[:]) == name {
return procEntry.ProcessID
}
}
}
go is cute
the old powershell method failed cuz it tried to kill but the code continued to run before it fully killed
worked on my machine xd
you literally cant understand this if you dont know how it works
i dont understand how it works i just copy pasted from stackoverflow xd
wtf is a CreateToolhelp32Snapshot
cause its just raw winapi bindings
creates a snapshot of the current process list, as well as the memory, loaded modules, and threads of the aforementioned processes
thats insane why can any program request allat
๐ญ
YEAH ITS ORRIBLE
the fucking fact that there are A/W suffixes for ascii and unicode
the HORRIBLE naming
and OH MY GOD THE FUCKING HUNGARIAN NOTATION
AND HORRIBLE CONTRACTIONS OF ALL WORDS
i mean everything runs in userland, anything can read anything, writing is a different manner though xd
and yeah
I figured lol
winapi is awfully inconsistent and just really shit
this is very similar to linux btw
cause all process memory is accessible via /proc/mem
and you can write to it too through there! it's really neat
isnt that protected
depends
only the process that owns it can read it i think=
welp
i know a rust program that killed itself by overwriting its own stack
internet died so now my message is out of context
but i have seen tools read /proc/mem before
lemme double check
might be a root thing
i implemented asar encoding from scratch so i'm worried it can be corrupt in some edge cases
you said yesterday there is asar encoding and decoding in c# and crystal
according to kernel 2.6's permission check, it has to be ptraced but yes you can read it
rust too ๐
yes but how am i gonna use that in go

i just ported the crystal library's pack function to go
ik ik
although if you're root you can read any process it seems
I'm not saying to use
_, err = f.WriteString(headerString)
if err == nil {
_, err = f.WriteString(fileContents)
}
if err != nil {
return fmt.Errorf("Failed to write asar data: %w", err)
}
just saying it exists
yes
dont
the err == nil to continue the operation is weird and not go-like at all
yeah but then i need to copy paste the same if block twice
if _, err = f.WriteString(headerString); err != nil {
return fmt.Errorf("Failed to write asar data: %w", err)
}
if _, err = f.WriteString(fileContents); err != nil {
return fmt.Errorf("Failed to write asar data: %w", err)
}
MY HATRED
if _, err := f.WriteString(headerString); err != nil {
return fmt.Errorf("Failed to write asar data: %w", err)
}
if _, err := f.WriteString(fileContents); err != nil {
return fmt.Errorf("Failed to write asar data: %w", err)
}
yup
go error handling is so goddamn awful
what the hell
i hate that you cant have one single catch block that handles all
go's abyssmal error handling makes me want to abandon it
that is also a valid solution
actually
i was about to recommend something like that
yeah thats what i did above so now it's consistent
who decided "try catch has its flaws, so we should implement a much worse system"
i always wondered why it was like that
**app_asar.go: **Lines 64-74
for _, n := range []uint32{dataSize, headerSize, headerObjectSize, headerStringSize} {
if err = binary.Write(f, binary.LittleEndian, int32(n)); err != nil {
return fmt.Errorf("Failed to write asar bytes: %w", err)
}
}
for _, s := range []string{headerString, fileContents} {
if _, err = f.WriteString(s); err != nil {
return fmt.Errorf("Failed to write asar data: %w", err)
}
}
nice and clean
HAHAHAHA
go ogle moment
returning errors in a language is fine as long as the language has facilities to make it easy to work with said errors
go does not have these facilities
REALLY THOUGH?
how could it be worse?
in classic C
you had a global error code
that was it
in fact, in modern C
this is still the case sometimes
fortunately not really that much
but in windows API programming, GetLastError() is needed to get the last error from the last thing you called
its stupid
// go
result, err := doThing()
if err != nil {
println(err)
}
// c
#include <errno.h>
Type result;
if (doThing(&result) != THING_OKAY) {
puts(strerror(errno));
}
it's fucking unreal how bad C has it
seriously though, that's the only - nonsensical - justification i can come up with ๐ญ
let result = doThing()?;
literally the go devs want you to write insane boilerplate code
they refuse to add better error handling
they refuse to add ternary (the alternative they want you to use is an if else that sets a variable)
they refused to add slices.Map (js array.map port) because they don't consider it go-like (the alternative they want you to use is a for loop that manually writes to a new array)
go has so much potential but it's ruined by the designers of it being boomers
is this a genuine riicr/r/anything else moment
RIICR
rewrite it in crystal
just use rust man
IK
it is time
rust is for the non sane
i tried to like rust, i really did
i gave it so many shots
only reason I would use go is when I don't want to deal with rust borrow checker
but i just dont like it
you have to be insane
i hate rusts borrow checker and rust is unreadable
you can do memory safety without INSANE CBT BORROW CHECKER
i found once i understood rust's syntax a bit more it made sense when i was reading stuff and i found it easy to follow, but writing it was never easy to me
fav language rn is nodejs lol
i constantly fought against the compiler
to do what i thought were relatively basic things
yeah having to deal with the memory safety and no garbage collection is annoying sometimes
and i get why its done like this, its strict by design
but holy shit
let me use a variable twice
vee make it auto reopen discord >:(
I really like rust syntax though
the majority of popular languages have memory safety without such a restrictive system (go, crystal, java, javascript, kotlin, etc) and guess what theyre REALLY USABLE
yes, but they all have garbage collectors
ngl kotlin is good
noone asked for such insane memory safety as rust has it 
i never understood the issue people have with garbage collectors
i havent got an issue with it, they're fine
it does not matter in 99.99% of programs
we need garbage collection version of rust
i like GC
but in systems programming i understand why its a pain
good news!
yeah but hardly anyone does systems programming
i want to add self updating to the installer too
RIIK/N
on Linux & Mac we can make it replace the file in place but how will we do it on windows where you can't override a file that's currently open
separate process

you can?
wait i had that happen actually earlier
it renamed my installer to VencordInstaller.exe~
it just cant be modified or deleted
i was so confused why but guess thats why
yeah i used that trick a lot
wait so i can rename it then write to the old file?
yes
when i ran go build
so go is smart and renames the file
so you'd rename your current binary to like
VencordInstaller.exe.old
and then write to new VencordInstaller.exe
awesomeee
let me check
i can probably just on start up make it check if {argv[0]}.old exists and delete it
no need for special logic
the answer is potentially
in the end, when windows loads an exe, it doesnt keep reference to the name of it
it keeps reference to the actual binary data
inode i guess would be the correct term in terms of filesystems
i hate that windows even does this
so you can do what you want with it as long as it isnt changed or deleted
because windows is meant to be foolproof since some applications read their own binaries later
so it puts a lock on it
im gonna kill whichever devs do that
you could probably just bruteforce the lock
but i dont know what consequence that would have
so i do not recommend it
bruteforce??
you can force a file lock to be destroyed
yes
its even part of microsoft's own tools
file locksmith tells you what has it open but there is another piece of software that allows you to force break locks
its pretty cool
oddly enough renaming it causes file locksmith to not know what's holding it open
presumably because the act of locking a file is based on the name, not the inode
yet it is still locked
however even windows goes like "by some application" rather than discord
anyway windows is a terribly designed system
oh yeah @austere talon another windows top tip
a binary application does not need .exe to be runnable
you shrimply just have to call it with the shell and it'll run it as a binary application
might be useful for certain things
Currently, on Linux, when you pin the Vencord Desktop .desktop entry to your taskbar, and launch Vencord, you get this:
Ideally, it would instead group together with the pinned icon, as intended.
This issue can be fixed by making the .desktop file contain the following:
StartupWMClass=vencorddesktop
Currently, atleast on the AUR package for Vencord (vencord-desktop-git...
this is already the case on our end
https://github.com/Vencord/Vesktop/blob/1429815fd126d802235b1dba041d6509ea6cd312/package.json#L114
the AUR package (which we don't maintain, it is by @zt64) has an outdated desktop file
ah alright, my bad - didn't know where to report the bug
https://aur.archlinux.org/packages/vencord-desktop-git is the correct place for discussion of the aur package
@dapper tiger
^ tbf im quite confused on why it has its own separate one
when you use package:dir for some reason it doesnt generate a desktop file
sucks
strange
clueless
you're not supposed to specify git as makedep because base-devel is a prerequisuite for aur
how do you even install an aur package without git
explode
remove git from makedeps @dapper tiger
this guy doesnt know what hes talking about
the two main ways of doing it are separate updater executable or the move tactic i described earlier, so for cleanliness i'd do the latter
check for `.old` -> wait for old process to die -> delete
check for updates -> rename self to .old -> download in-place update -> launch new -> exit
for the delete part, the old executable can use the windows task scheduler to schedule its deletion (and the deletion of the task) or it can use the windows API to delete on reboot
i think its MoveFileEx(path, NULL, MOVEFILE_DELAY_UNTIL_REBOOT)
although i think DELAY_UNTIL_REBOOT requires admin which sucks
oh i know a reliable way of doing this
hold a common mutex open like VencordInstaller_Update
when the old app dies it'll drop the mutex
or just keep trying to delete the .old until it works
or just dont! leave it there and then when a new update is available it deletes it then
in-place updates on windows are fun
spawnNewInstance()
os.Exit(0)
how
new instance might spawn before old has died
new instance cant do operations on old executable's file

well yeah that's what i recommended here xd
there's many different ways of doing it
or move the old one to %TEMP% and let the system deal with eventually deleting it
Windows never automatically cleans the %TEMP% directory by default. In Windows 10 you have to enable this feature in Settings, and with earlier versions you must delete the files yourself or use programs like Disk Cleanup or cCleaner.
fuck you microsoft
can we stop using windows already??
we have surpassed the need for windows
because they're fucking stupid
???
storage sense fortunately fixes a lot of this and it is on by default
but it can still take a long time
the contract is that temp files are temporarily which means they are only guaranteed to exist until next reboot
why would any app expect anything else
i store all my files in temp
cause they're installers and they want to hold temporary data until after reboot
at which point they'll delete it
i HATE programming docs in german
it's so awkward and horrible
programming docs were not supposed to be localised
horror
Temporary files whose names have been created by this function are not automatically deleted. To delete these files call DeleteFile.
ใญใผใซใซ ใณใณใใฅใผใฟใผไธใฎใใกใคใซใพใใฏใใฃใฌใฏใใชใฎๆฐใใๅๅใ
ใใกใคใซใ็งปๅใใๅ ดๅใใณใใผๅ ใฏๅฅใฎใใกใคใซ ใทในใใ ใพใใฏใใชใฅใผใ ใซ้ ็ฝฎใงใใพใใ ๅฎๅ ใๅฅใฎใใฉใคใใซใใๅ ดๅใฏใdwFlags ใง MOVEFILE_COPY_ALLOWED ใใฉใฐใ่จญๅฎใใๅฟ ่ฆใใใใพใใ
ใใฃใฌใฏใใชใ็งปๅใใๅ ดๅใ็งปๅๅ ใฏๅใใใฉใคใไธใซใใๅฟ ่ฆใใใใพใใ
dwFlags ใMOVEFILE_DELAY_UNTIL_REBOOTใๆๅฎใใlpNewFileName ใ NULL ใฎๅ ดๅใMoveFileEx ใฏใทในใใ ใฎๅ่ตทๅๆใซๅ้คใใ lpExistingFileName ใใกใคใซใ็ป้ฒใใพใใ lpExistingFileName ใใใฃใฌใฏใใชใๅ็ งใใฆใใๅ ดๅใใทในใใ ใฏใใใฃใฌใฏใใชใ็ฉบใฎๅ ดๅใซใฎใฟใๅ่ตทๅๆใซใใฃใฌใฏใใชใๅ้คใใพใใ
i dont think microsoft knows what temporary means
i love reading programming documentation in japanese
because every now and then you'll just get random english
its not even possible to program without knowing english
for the most part yeah
are there any programming languages that dont use english....
also i love the new cli
oo pretty
APL!
APL invented its own symbols!
im really happy with how it turned out
much more user friendly
Perl in Latin
use Lingua::Romana::Perligata;
adnota Illud Cribrum Eratothenis
maximum tum val inquementum tum biguttam tum stadium egresso scribe.
da meo maximo vestibulo perlegementum.
maximum comementum tum novumversum egresso scribe.
meis listis conscribementa II tum maximum da.
dum damentum nexto listis decapitamentum fac
sic
lista sic hoc tum nextum recidementum cis vannementa listis da.
dictum sic deinde cis tum biguttam tum stadium tum cum nextum
comementum tum novumversum scribe egresso.
cis
anyway
weirdness aside
use
CIS
TRANSPHOBIC LANGUAGE
!
okay elon
wqait
wait
was it elon that said cis was a slur
it was wasnt it
im considering removing gui on linux
and only providing the cli
cause the gui is a bit quirky on wayland and i hate the fact that we need separate binaries for x11/wayland
dont see why not
if you installed linux you should be able to handle a terminal
that was it
@austere talon ah ok i have unearthed a very very old thing
it was an in place updater i wrote
so it is literally just
delete an existing .old if one exists
move self to .old
download update in place
run updated executable
die
although for safety reasons
you should download the update first to a temp file
(go should have a facility for generating temp files?)
and then do the entire movement shenanigans
ofc
because if the update fails at least your app still works
and you havent just destroyed accidentally uninstalled it
so lets see
thats also what unpatch does
instead of
rm app.asar
rename _app.asar app.asar
it does
rename app.asar app.asar.tmp
rename _app.asar app.asar
rm app.asar.tmp
and if a step fails it restores the backup
import (
"net/http"
"io"
"os"
"os/exec"
)
func main() {
us, err := os.Executable()
if err != nil {
// wtf? this should never error but apparently we have to handle it...
panic(err)
}
// download the update
f, err := os.CreateTemp("", "vencordinstaller-update-*")
if err != nil {
panic(err)
}
// whilst we do consume the temp file in the end, this cleans it up if we panic elsewhere
defer os.Remove(f.Name())
resp, err := http.Get("...")
if err != nil {
panic(err)
}
defer resp.Body.Close()
if _, err := io.Copy(f, resp.Body); err != nil {
panic(err)
}
if err := f.Close(); err != nil {
panic(err)
}
if err := os.Remove(us + ".old"); !os.IsNotExist(err) {
panic(err)
}
if err := os.Rename(us, us + ".old"); err != nil {
panic(err)
}
if err := os.Rename(f.Name(), us); err != nil {
// try and put us back in place first - we're panicking anyway so no error handling
// (if this fails anyway something's gone horribly wrong!)
os.Remove(us)
os.Rename(us + ".old", us)
panic(err)
}
cmd := exec.Command(us)
if err := cmd.Start(); err != nil {
panic(err)
}
if err := cmd.Process.Release(); err != nil {
panic(err)
}
}
@austere talon
this is what i was cooking
i think this would work?
with edits of course but you get the point
wtf this should never error
why not just check source code
func executable() (string, error) {
var procfn string
switch runtime.GOOS {
default:
return "", errors.New("Executable not implemented for " + runtime.GOOS)
case "linux", "android":
procfn = "/proc/self/exe"
case "netbsd":
procfn = "/proc/curproc/exe"
}
path, err := Readlink(procfn)
// When the executable has been deleted then Readlink returns a
// path appended with " (deleted)".
return stringsTrimSuffix(path, " (deleted)"), err
}
it does silly
yes but it shouldnt
its basically the equivalent of getting os.Args[0] but absolute, so if it errors something is extremely wrong with the environment we're in
oh wait what
// When the executable has been deleted then Readlink returns a
// path appended with " (deleted)".
cant delete
although i dont know what happens if you rename the executable and call os.Executable
though i suppose at that point a lot of apps would get confused
oh okay even delete wont cause an error
its not reading the link itself, it's reading /proc/self/exe
not .. being able to get it
ye
also i hate go
why are there two operators for variable assignment
why not just
one
if it knows the variables dont exist yet
just make them
i hate it so much
especially cause no new variables on left side of assignment and unused variable are FUCKING COMPILER ERRORS
i would rather drag my balls through broken glass than having to mix walrus and standard equals just to do error handling
anyhow
yeah i think this works
i hate this
so fucking much
yop
tbf if you're panicking anyway you can make an unwrap func
oh that was sort of just placeholder
i didnt want to write actual error handling logic here but we probably should
go really just needs some sugar for returning the error to the caller or handling it in a central place
like rusts ?
yeah exactly
a lot of go would be resolved if it just had rust's error handling
that''s the one thing rust did exquisitely right
apparently go 2 might have try/catch
so it would be trivial to even auto return tuple errors
func thing() (Type, error) {
i := strconv.Atoi("not a number")? // returns Default(Type), err
}
or heck even this would be accpetable
func thing() (Type, error) {
i, return := strconv.Atoi("not a number") // returns Default(Type), err
}
or similar keyword
I HJATE WINDOWS
func getModuleFileName(handle syscall.Handle) (string, error) {
n := uint32(1024)
var buf []uint16
for {
buf = make([]uint16, n)
r, err := windows.GetModuleFileName(handle, &buf[0], n)
if err != nil {
return "", err
}
if r < n {
break
}
// r == n means n not big enough
n += 1024
}
return syscall.UTF16ToString(buf), nil
}
func executable() (string, error) {
return getModuleFileName(0)
}
sanest winapi code
linux on top
f := try(os.Open("..."))
but then it seems to randomly set err somehow
i dont get it
kinda based
oh i think it
ahhhh
okay
your function has to return error
and it'll set that
i think
thanks wasm target
windows sucks
also the idea that a path name > 1024 bytes terrifies me
i know its possible but
the ntfs default limit is 260
(reasoning: actual path is 256 bytes max, but it needs to allow room for \\?\ so there's an extra 4 bytes tacked on)
(or something like that, i dont remember)
anyway im going to sleep
my head hurts
Or just live in the basement
@Vendicated yeah, that's unfortunately very true. Do you think is there any way to leverage the VAAPI codecs already present in FlatHub? If you tap into those builds you should be able to have a fast video rendering with HW acceleration no? To give an idea this package has the full support for hardware rendering.
org.freedesktop.Platform.ffmpeg-full
This would be the best way to fix screen sharing using any discord client on Linux until Discord fixes it themselves.
Someone was ...
is there a way to add headers to organise settings in a plugin? say if theres alot of configurable values and you wanna divide them into different categories
This plugin allows users to use profile effects in their profile by storing the ID of profile effect which is an invisible string in their bio.
?
wdym by headers
just add h{1|2|3|4|5|6} tags
oh do you mean in the settings page
yeah
no there isn't
damn alr 
you'd need to use settings type custom and write ur own ui
do you mean with the Component option type?
that would be useful tbh
but also if your plugin has this many settings, chances are you have too many
im converting my theme into a custom plugin to allow configuration, so theres a ton of color options and things like that
i would just wait for usercss to be merged
and define your configuration options as usercss variables
that would be the better choice
usercss is not that far off tbh
i did it again
merge commit jumpscare
yeah for some reason the merges for usercss are completely fucked
you have to manually merge anything that edits the theme tab
i dont know why
69 commits, nice
but even in the vscode conflict editor its like
broken
it says the base commit is completely blank and comes from 4 different branches or something
idk why
but usercss really needs to be like
looked at xd
i am unsure of what else to do with it and the longer it remains open the harder it becomes to work on themes and stuff
since its a huge change to how the system works and people already really want to use it
In my case, it reloads everything upon gaining focus without any loading animations, simply all nicknames in the chat turn white for a brief moment, and I also stop receiving notifications until I pull discord back into focus. This happens only when I launch any game, and the only way to return the normal behavior is to restart Vesktop.
The only workaround I'm testing right now is to disable Game Mode (Win + I > Gaming > Game Mode), it seems to mitigate the issue for now. Try this out.
this sounds like windows is suspending the process in the background, thus when you bring it back to the foreground it will allow the process to resume, at which point it will need to reconnect to discord since it has timed out at this point (discord requires a constant connection to keep itself alive, hence the reloading). there is no fix for this on our end, really.
i figured it out 
i mean, eh, im not really bothered about usercss. Id prefer to have more control anyway
just fyi you wont be able to get it in mainline vencord
we dont allow plugins that are just themes
also idk what extra control you get by making it a plugin instead of a usercss theme xd
yeah if you aren't satisfied by CSS preprocessing then what are you even doing
fyi you can use CSS preprocessors anyways
you just need to get users to build your theme instead of just copy-pasting a link
@turbid hatch I love what you are doing btw
can't wait
yes
aha, hope you enjoy it when it comes out for realsies
yee ik
i dont want to :3
alrighty
i dont think windows ever suspends any process by itself
oh nvm theyre talking about waking windows up from sleep
they're also talking about game mode
which throws things into efficiency mode and the like
which can cause things to go kaboom
it seems like electron going into efficiency mode will cause it to pause websocket connections
so
does anyone even use game mode lmao
i do
it does help a little
but honestly ive never had the issue they're experiencing
so i dont know what it is
yeah its on by default
it prevents windows update from doing shit in the background whilst you're playing a game and lowers system process priority
its actually quite nice
yeah sounds pretty cool actually i mistook it for the game bar i think
huh
(the drivers, for some only known to god reason, require game bar to be enabled if you want it to optimize correctly)
(like moving game processes onto the more efficient dies for the 7950x3d)
Content
Today one of my friends got deleted and in the notification name was something like queued for deletion. I dont know who it is and I am really curious who that person was.
One of the ways to fix this is maybe save the channel id and name so that it will show the last saved info if it cant find it.
Also I checked the logs and RelationshipNotifier source code and in the console log one of the [UserProfileModalActionCreators] functions gave a error 50001 warning after failing to...
spaces in slash cmd
?
cursed
having lmgtfy as an alias might make sense too
oh yeah thats probably a better idea
I would have Google as an alias
that makes a lot of sense yeah lol
by alias, do you mean its possible to actually create multiple terms for a command?
I don't see why not you couldn't
Even if there is no built-in way to do that, just build a helper function that the commands point to
ah true
was just wondering if theres a built in way for it
I haven't looked into making commands with vencord, you would know better than me
i mean ive made 2 plugins and both of them are shit so 
The fastest I learned about plugin dev was when my PR finally got reviewed and they pointed out 9 million ways I could do things better
welp time to upload a purposefully terrible plugin to get free tech support 
hello question is there a way to add custom plugins to vencord?
newleaf try to read pins before messaging challenge
rule 5 @slim marsh
yea don't do this it can get you termed :)


