#🧩-plugin-development
1 messages · Page 63 of 1
@balmy sky will strap a motorbike engine to a wheelchair
lol
who's they
anyone know where a good Blocked icon exists? or will i have to make it myself

<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512"><path fill="#a32e2e" d="M367.2 412.5L99.5 144.8C77.1 176.1 64 214.5 64 256c0 106 86 192 192 192c41.5 0 79.9-13.1 111.2-35.5m45.3-45.3C434.9 335.9 448 297.5 448 256c0-106-86-192-192-192c-41.5 0-79.9 13.1-111.2 35.5zM0 256a256 256 0 1 1 512 0a256 256 0 1 1-512 0"></path></svg>
is it possible to edit the current text in the chat box
havent been able to figure out how
insertTextIntoChatInputBox()
I haven't checked it out but does that not just append the text to whatever is entered
i am looking to delete/modify not append
wait does it append it or not?
It does
I just thought of a solution then realised i am absolutely retarded
alr guys, time to get added to the devs const and get that sweet badge! /s
how do you force the dev companion plugin and/or the vscode plugin to reconnect
i swear i have to reopen both like 300 times to get them to connect sometimes
enable vencord toolbox
it adds a button in the channel button bar
insane
i dont like the toolbox 😭
why not just use the toolbox lmao
why not
cuz it messes with my devtools muscle memory
yeah it's not on the far right lol
tbh i wanted to do much more with the toolbox but the fact that it's a plugin makes it limited cause that makes it hard for other plugins to effectively use since it might not be enabled
soo... pack it into core?
i don't think we should enable the plugin by default
currently it just starts a websocket
the first one you opened wins
could definitely improve it maybe
just a button on the bottom bar that forces it to connect would be enough
idk how to work with vscode plugins though
probably possibly
back when the extension was made, plugins didn't have a way to have native code yet, so other way round would have required changes to vencord core
so i decided to do it this way
also other way round is a bit problematic for security
companion has RCE inbuilt to be able to test function replacements
if it were the other way round (vencord running the websocket server), any website you visit in your browser could connect to the websocket and run code inside your discord
vencord rce!
Hey, any idea where to post an “issue” that's technically not a bug, but rather lack of a feature of a certain plugin? Not really a plugin request either…
Wanted to suggest adding local overrides to PronounDB plugin so that you could save pronouns of people that don't have them anywhere
plugin requests i think
i feel like this fits perfectly for the EditUser PR where you can edit a user's pronouns as well
It makes more sense to put it under pronoun db
yeah probably
Since pronoun db is also managing pronouns from an external source
pronoun db falls back to discord though if the user has no pronouns
What is the user wants to overwrite pronouns pulled from the API
vee said no exceptions, lol
it would also be confusing to have 2 plugins both editing users
anyway pronoundb might be removed / rewritten to remove most of it
i don't think there is any reason to still use the pronoundb api
Why was it made in the first place?
it's older than the pronouns feature silly
i explicitly dont use the plugin because it relies on a 3rd party api that isnt needed
lol
yeah especially cause it tells the api every user you interact with
doesnt it have a stupid ratelimit too?
such an API should be expected to recieve 50+ requests at once from the same user, just very infrequently
Yeah that's kinda what i assumed but didn't want to sound like an idiot

thats a bad reason not to say smth
everyone sounds stupid sometimes, just say whatever lol
Good advice
Leading on from that advice, i am most likely about to unleash the most horrifying shit upon this channe l
I've been working on a plugin called profilepresets that allows you save your profiles to set again later, it's in a semi functional state (you can save a profile, open the modal, load it again) but as soon as you restart the client the modal crashes. I figured out it's because for some reason the user objects in the datastore aren't maintaining the getAvatarUrl function across sessions (or correctly, at least). I can work out the other kinks probably but i have no idea how to correctly store a custom user object with no other references
The code is here (sorta spaghetti rn sorry)
solution: never restart your client and always keep it open no matter what
(this is a joke, i am not liable for any damages that this may cause you)
where would I put a function I want to share between plugins?
depends, what is it?
getStyles and createStyleSheet of clientTheme
you can export it from ur plugin file
and just import it from the other plugin
or if you think it's useful to other plugins in general, you can put it in utils
let [h, s, l] = match.map(Number);
l /= 100;
Since I only reassign l, eslint is mad at me for eslint/prefer-const
Is this is a situation where it is acceptable to add a // eslint-disable-next-line prefer-const?
full context:
const variableRegex = /(--primary-\d{3})-hsl:(\d+).*?(\d+\.?\d*)%.*?(\d+\.?\d*)%/g;
function getColorHexCodes(styles: string) {
const colorVars = Array.from(styles.matchAll(variableRegex), v => v.slice(1));
return colorVars.map(match => {
const variable = match.shift();
// convert HSL to hex https://stackoverflow.com/a/75003992/8133370
// eslint-disable-next-line prefer-const
let [h, s, l] = match.map(Number);
l /= 100;
const a = s * Math.min(l, 1 - l) / 100;
const f = n => {
const k = (n + h / 30) % 12;
const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
return Math.round(255 * color).toString(16).padStart(2, "0");
};
return { variable, hex: `#${f(0)}${f(8)}${f(4)}` };
});
}
oh I should probably just break out hsl to hex conversion into a function
yeah this is prettier
const variableRegex = /(--primary-\d{3})-hsl:(\d+).*?(\d+\.?\d*)%.*?(\d+\.?\d*)%/g;
interface VariableHex { variable: string, hex: string; }
function getVariableHexCodes(styles: string): VariableHex[] {
return Array.from(styles.matchAll(variableRegex), match => {
const variable = match[1];
const [h, s, l] = match.slice(2).map(Number);
return { variable, hex: hsl2hex(h, s, l) };
});
}
function hsl2hex(h: number, s: number, l: number) {
// https://stackoverflow.com/a/75003992/8133370
l /= 100;
const a = s * Math.min(l, 1 - l) / 100;
const f = n => {
const k = (n + h / 30) % 12;
const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
return Math.round(255 * color).toString(16).padStart(2, "0");
};
return `#${f(0)}${f(8)}${f(4)}`;
}
yes
@dull magnet do you think you would merge this plugin or should I stop working on it?
fixHardcodedColors
Discord often hardcodes colors despite having css variables for all it's colors.
For example, --primary-160 is #ebedef, but in the code, they have hardcoded the color hex instead of using the variable
.defaultLightModeCustomGradient_e77fa3 {
background: linear-gradient(rgba(0,0,0,0) 20%, #ebedef 100%);
}
This causes issues for theme devs who want to make stuff by directly modifying color variables as they need to manually fix all these problems.
This is very prevalent when using ClientTheme and looking at "channels and roles"
This plugin addresses this issue by generating css to make the problematic code use color variables instead, for example:
.defaultLightModeCustomGradient_e77fa3 {
background: linear-gradient(rgba(0,0,0,0) 20%, var(--primary-160) 100%);
}
how does it generate?
- get default hex codes of variables <#🧩-plugin-development message>
- get css that hardcodes color
const cssWithHexColorRegex = /(?:^|})[^{}]+?{[^}]*?#[a-f\d]{6}[^}]*?}/g;
// gets array of css strings that we may need to edit since they hardcode color
function getCssWithHexColors(styles: string) {
return Array.from(styles.matchAll(cssWithHexColorRegex), match => match[0]);
}
- logic to generate fix css(what I need to work on, and will take some time)
Similar to lightModeFixes of clientTheme
btw it's funny how ClientTheme tells u it wont look good with nitro theme
i've been using ClientTheme + nitro theme for ages and its really good
Its more just a "here be dragons", this is unsupported thing
even makes channels and roles less bad
is that a yes or no on the proposed plugin
I would say yes, but that's me
ok, thanks
depends a lot on how it's implemented
if it requires a manual map then no
cause that's no better than just the theme doing it manually
there is no hardcoding of variables or stuff to overwrite. Just 2 regex things
hey its me on a new account, and i have to say, yeah the best way for someone to learn is the hard way. I wished I just followed what you said.
damn 😭 and yea I think you might be right, everyone has to learn it themselves at some point
honestly me rn lmao. Like i got off discord or was barely active for months working on myself. while learning in the process. big W for me
i think im officially ai now
man really said 🤖
How did we get here?
Did you do message author manipulation?
basically send slash command, in the execute function you do
get current user
change user id to clyde
send bot message as that
return message to send
um yea and it goofs up discord
imma make a official vencord plugin that gives me certified dumbass tag
yeah I knew it was something like that
it kinda funny, the pfp just says “no.” and discord freaks out then it changes your name to clyde then turns back to normal.

sounds like something @balmy sky would make
I'm having an issue with building Vencord with my plugin.
This is the error I'm getting:
X [ERROR] X Could not resolve "fs"[
../../../node_modules/bindings/bindings.js:6:17:
ERROR 6 │ var fs = require(]'fs')
╵ ~~~~
The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle
for node? You can use "platform: 'node'" to do that, which will remove this error.
Could not resolve "path"
../../../node_modules/bindings/bindings.js:7:19:
7 │ , path = require('path')
╵ ~~~~~~
The package "path" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
X [ERROR] Could not resolve "path"
../../../node_modules/bindings/bindings.js:7:19:
7 │ , path = require('path')
╵ ~~~~~~
The package "path" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
2 errors
2 errors
Build failed
Build failed with 2 errors:
../../../node_modules/bindings/bindings.js:6:17: ERROR: Could not resolve "fs"
../../../node_modules/bindings/bindings.js:7:19: ERROR: Could not resolve "path"
ELIFECYCLE Command failed with exit code 1.
I've attached my plugin as a ZIP as well, I can't figure out what's causing the error. (it was building fine previously and then suddenly stopped)
prob because your plugin imports a library that imports node bindings
im not sure you will be able to get it working unless you install this package from npm
idk how node bindings work tbh
oh oof
well i guess i could always try using an online api instead of running it locally if all else fails
You can probably create native module and use your package from it
ah how would i do that? (sorry for late reply just got back to working on it)
look what plugins are using native.ts
yk what a great birthday present would be…
typescript burning in the firey pits of hell?
cries in java dev
why the hell would you do that to yourself
ok so i moved the speak function and the import to native.ts but im still getting
../../../node_modules/bindings/bindings.js:6:17: ERROR: Could not resolve "fs"
upon trying to build
@dry patio here's ur birthday present
ily
the day i become a java supporter is the day i uninstall all my text editors
can you uninstall notepad?
i’m on a mac
.
because i develop mods for mac/ios primarily
Idk
plus windows kinda sucks
mhmm
when JavaOS
ig this is the closest to JavaOS https://en.wikipedia.org/wiki/SunOS
SunOS is a Unix-branded operating system developed by Sun Microsystems for their workstation and server computer systems. The SunOS name is usually only used to refer to versions 1.0 to 4.1.4, which were based on BSD, while versions 5.0 and later are based on UNIX System V Release 4 and are marketed under the brand name Solaris.
You gonna buy Xiaomi Phone
banner
I ALREADY DID
LOOK AT MY BADGE
how u did that?
💸
why would the user object you save contain the function
webpack search it and use, it should have no issues
this is probably a dumb question but how do i run a function from native in index? just importing it doesnt work (i assume because only native has access to child_process)
look at how any other plugin does it
xs overlay for example
pay attention to the native.ts file and the VencordNative in the plugin index
ok thank you!
omfg i hate discord
there's a GuildMemberStore.getNick() that i patched for EditUsers
but they don't use it in all places 😭
have to individually patch
ok well now ive run into an issue that i actually have 0 clue how to solve
when running the dectalk say executable, it checks the current working directory for the dictionary file
which causes issues because
even with the exe added to path, it still only works if its running in the folder that the .dic file is in
u cant use this in vencord
Hi ! I want to apply regexs on messages coming from other users. I have seen the MessageEventAPI, but is it solely limited to modifying my own messages ?
I have found fetchMessages in discord code, I know where I want to apply a patch, but can't see what my patch should look like (I have looked at the other plugins for reference but don't find the documentation that goes with it)
You need to patch the message component to do that
And directly modify the content value
I want to modify all incoming messages (not necessarily new ones, at least old ones fetched via /api/v9/channels/.../messages?...)
I know where to apply a patch to do that, but just don't know how to apply such patch
Here is what I tried:
export default definePlugin({
name: "test",
description: "Just Regex",
authors: [{ name: "me", id: 1234567890n }],
patches: [
{
find: "fetchMessages",
replacement: {
match: /dispatch\(\{type:"LOAD_MESSAGES_SUCCESS",channelId:t,messages:i,/,
replace: `dispatch({type:\"LOAD_MESSAGES_SUCCESS\",channelId:t,messages:$self.editMessages(i),`,
}
},
],
editMessages: (messages) => {
for (let i = 0; i < messages.length; i++) {
messages[i].content = "aaaaaa";
}
return messages;
}
});
Ok, but can you help me on how to make this patch work ? If I don't understand how to make this one I will have to come back to ask for help doing another one later :)
Usually the user object returned by UserStore.getUser contains it
I probably misunderstood how it works
Patch some high up component of messages, from there you can just arguments[0].message.content = "skibidi" at the start of the function
oh, okay thx. But is my syntax correct ? I see no error when building but I do not see the code patched in devtools
what am I supposed to put in it ? I did not find documentation about it
thanks lol
aaaaaa
aaaaaa
once i finish a plugin, if i want to request making it official, do i just make a pr or is there a process to it?
make a pr
make sure you read CONTRIBUTING.md first
aight
you can't store that in datastore
wait should i still open an idea issue before making the pr? i already have the plugin finished and forgot to make an idea issue beforehand
what's ur plugin first of all
Is docs.vencord.dev still worse than this?
the dectalk thing ive been working on, theres this funny game from forever ago called Moonbase that had a text to speech system in the chat where there were some special features (such as singing using phoneme commands). the plugin makes it so that a codeblock with the language set to dt or dectalk will be read out loud using dectalk (with the option to block specific users from playing text), for example:
```dt
text goes here
```
its also the same tts stephen hawking used i think
I found this function both in /channels/.../WebpackModule534469 and /assets/c6f4d40c4d9da8cf4843.js, but when I set a breakpoint, the Webpack one reacts most of the time. And, when I use a find that should work for both, only /assets/... is detected. Why does it works like that ?
EDIT: forgot to refresh Vencord, sorry for the ping..
that's probably too niche
too niche of a discription or a plugin
I had an idea to cache generated css for ClientTheme so it has less startup impact after first load & loads fast enough to be seen by OpenASAR
- To determine when to invalidate cache, I want to get a hash of the current discord css.
Given a VERY LONG string (all of discord's styles). How can I easily create a unique hash
- Where would the best place be to store this hash and the cached generation?
of a plugin
oh damn :/
Instead of hashing ALL OF THE CSS do you think hashing the filenames would work?
Array.from(document.querySelectorAll('link[rel="stylesheet"]'), l => l.href.split('assets/')[1].slice(0,-4))
Does anyone know if discord css filenames change whenever they update styles
you don't need to hash anything
use the nonce attribute in the link tag
it's the hash
maybe not noncs I don't remember the name
but I'm pretty sure one of the attributes has the hash
show the link tag
data-webpack?
then the filename hashes?
discord css filenames change whenever they update styles
pretty sure they do?
Array.from(document.querySelectorAll('link[rel="stylesheet"]'), l => l.href.split('assets/')[1].slice(0,-4)).join()
// => '12633.bb59c3b8d0e17096489a,eccca30b9f8cecceb373,e94fed16036953a1b895,b7b7e43d0be76323879a,c6103099b3369321403a,ec315abebf510e77a71a,7b7b8e5ab588ef74e40a,04eba1cfc690e2fac514,5036700d0d0029228856,cf7e832361691285fe2c,9ef8c5a89f56faa56a18,c97afa9c2993948ba941,2917679ca8a08c390036,74e75d5f20452e9d7351,286d1627aec0689ba794,0a62d6f7693ecd74dd11,fc74d95ca9874ee58956,b0b773096ae44e83c71a,1bc414bb2603adeb3f28,7e1422710f9496074580,d59be290c033fabab5b8,9f6d02e1e991650bbbd7,26a29d37d813f69c96c5,5bbcd7dfbc6f2ea7e0f6'
oh fuck
they always did with js files they just tweaked it for css too
i am convinced that discord only has lazy loading because their codebase is bloated and shit
That completely bricks the concept for both ClientTheme lightmode fixes and FixHardcodedColors
do you have console shortcuts f53?
I can
for client themes probably not
as the important css it needs is probably always loaded
for fix hardcodedcolors maybe
but it's not impossible to workaround and listen for new css
light mode fixes of client theme replaces all --white-500 backgrounds with --primary-100
hmm
wreq.k in the console, jump to the function
still painful
that's the amount of css files discord lazy loads
lazy loading is standard and encouraged
every website with substential code should lazy load if possible
yeah it's very standard
yes I agree with that
yet at the same time how in the fuck is a chat app this bloated
@dull magnet would it be ok if I made clientTheme just load all these on boot for lightMode fixes
how big are these
sure it has weird code in some places, but it's not really bloated
¯_(ツ)_/¯
it is not haha
you need to listen for when new css is added
how would I go about even starting to do this
probably a dom observer
freeeezee
right...
here is my take on this 
#👾-core-development message
you can split only that chunk if you want
it's the only one caught in the wreq.m listener
yeah this is bloat 
In a patch, what are $1, $2, ... It may be related to the changing obfuscated names in discord that we want to remove (a, e, ...)
Is it about this ?
(sorry to interrupt btw)
regex groups
listen up
what if
we chunk discord chunks
100 modules every vencord chunk
a source file every 100 modules
unless it's patched of course
that would be 210 chunks in total
i highly recommend learning regex so you understand related things. do note that Vencord has it's own "identifier" selector \i for variable names/properties
what are you
about
now how would I do this with patching using proxy...
well actually
we only need to do this for the initial chunk
lazy loaded chunks are generally small
which makes this easy
i have a stupid question
hm?
do either of you know how big all of discord's client JS is in total
😭
purely out of curiosity
I dont
this cannot be good for your computer
its still going
only 21k?
yes...
It's joever
I'll cook this now
why do you even need to store users in datastore like that
TLDR: Save and load profiles, so i need to store the user object to pass it to the profile popout component
syntax highlighting for https://en.wikipedia.org/wiki/Maxima_(software) ?
Maxima () is a powerful software package for performing computer algebra calculations in mathematics and the physical sciences. It is written in Common Lisp and runs on all POSIX platforms such as macOS, Unix, BSD, and Linux, as well as under Microsoft Windows and Android. It is free software released under the terms of the GNU General Public Li...
long ass string
how
Yall said using fetch is a bad idea but currently clientTheme does for css?
...
for (const styleLinkNode of styleLinkNodes) {
const cssLink = styleLinkNode.getAttribute("href");
if (!cssLink) continue;
const res = await fetch(cssLink);
out += await res.text();
}
...
Should I switch to something else?
oh god it's highlightjs
holy fuck
almost 1mb just for code highlighting
i didn't know it's so bloated
mfw when dev branch of vencord crashes
I made it execute the predicate in the addPatch method
oh
which means vencord object is still initializing
cool
nah a shit ton of plugins still use the global
it shoudlnt cause any issues
doesnt for me
oh nvm i can
oh
in fact only one xd
nah those are all fine
yeah
how did patchhelper not catch it?
nah dont
lemme just finish up editusers and we can throw it in with it
aight
oh
uh did we run patch helper on dev?
I don't find anything related to $1,$2,$&, is it vencord specific too ?
cause it removes the predicates
that too lmao
regex101 is your friend
The replace() method of String values returns a new string with one, some, or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function called for each match. If pattern is a string, only the first occurrence will be replaced. The original string is left unchanged.
I was missing the parenthesis to make \(\i\) become a group.. thanks !
bump (#🧩-plugin-development message is also probably important)
it's too niche sorry
btw browsers have tts inbuilt
speechSynthesis.speak(new SpeechSynthesisUtterance("meow"))
yeah but the browser tts cant sing 👀
isn't dectalk proprietary
speechSynthesis.speak(new SpeechSynthesisUtterance("vencord vendor venniecord"))
what about moyai
voncord
what's wrong with niche plugins anyways
YEA EXACTLY
imagine moyai but being able to change the sound for individual emojis
moyai shouldve been that in my opinion
do it
i could
the fact that if we allowed everything, it would become a mess
you are still welcome to distribute it yourself
with third-party plugins being extremely annoying for users, it's pretty much impossible
unless we start doing a Bukkit
third party plugin library 
whats a bukkit 
and we have Vencord editions of Spigot, Paper, Tuinity, Yatopia etc.
so, infinite forking
pain
were adding betterdiscord plugins to vencord
"this is Vencord but we added 5 plugins"
"this is Vencord but we added 14 plugins (but not the one from the 5 plugins in the other one that you really need)"
not for people who want to use your plugin
I do a dev install too
but it's beyond most people
make plugins modular?
was discussed a thousand of times probably, and the answer is no
eh, that just makes more issues
ok but why is it called plugin then
because it plugs into Discord
it does, infact, not plug into Vencord (because it's in it already)
nope
it's not
until you enable a plugin it doesn't affect Discord in any way
it's not loaded at all
too bad
use betterdiscord or smth or make your own fork
I don't see why including everything (if it's not just CSS wrapped in a plugin, and is otherwise up to quality standards) would make a mess
it might make a mess from the plugin menu? in that case make a better plugin menu
vencord compile to .plugin.js soon
harder to provide support, and will decrease vencord quality generally
vencord is stable because plugins are handled officially
as soon as you enable the ability to install more plugins easily, users are gonna start experimenting broken plugins which last months or forever
harder to provide support
disable lesser known plugins that cause problems on updates, have their devs fix them instead in a certain time window, if they don't - remove
the quality argument I don't get
we have a plugin that's a cat that follows a cursor (real)
oops didnt meant to reply
have a clear separation between "community" and "official" ¯_(ツ)_/¯
skill issue on their part
The current setup works fine
With community content there is always going to be issues that people will blame the project itself for
not everything has to be modular. from day 1, vencord has always aspired to "just work", which is only possibly by keeping it first party and strictly vetting contributions
if you don't like that, there are better alternatives for you, like betterdiscord
it's not changing so there's no point discussing it
.theme-dark .container_f1fd9c,.theme-dark .header_f1fd9c has a background color of #2c2e33
converting --primary-645-hsl to rgb gives #2b2d31
These two are nearly identical, with VERY minor changes (r: -1, g: -1, b: -2)
This makes my current implementation of fixHardcodedColors break because I don't currently have margin for error in the implementation.
my main question is how the fuck I would implement a margin for error
idk how your plugin works, buy could you just ignore something if its within like 10 total points of error
sum the differences and if its under some number
I am struggling to think of how to implement that cleanly
can you link your plugin, idk what it even is
discord has 419 color variables that aren't #FFFFFF or #000000, and 200+ instances of styles that have hardcoded colors
one sec I will make a Draft PR for it
@hushed loom
ill look at it in a moment, i think i found a really odd vencord bug
@cedar marsh do you have some example css and a place where i can see an obvouse difference
(not that good with css, just need somehting to test a fix)
channels & roles is what inspired me to do this
I think I almost have a solution cooked up
I fixed
Hey, i'm trying to patch the icon on the home button but i can't find the right component for the life of me. I've only managed to patch all of the clyde component (not sure if it's used anywhere else so it might be fine)
find: "M19.73 4.87a18.2 18.2 0 0 0-4.6-1.44c-.21.4-.4.8-.58",
replacement: {
match: /let{size:\i="md",width:\i,/,
replace: "if($self.IsAnyoneTyping()) return $self.TypingIcon(); $&"
}
how would i interface with rpc via a plugin (https://discord.com/developers/docs/topics/rpc#setuservoicesettings)
look at the better folders patch which has discodo in it
try to see if that is what you want
It is! tysm 
Hello!
When someone has time do you mind looking at my plugin pull request (#2642)?
uwu
The description could use some work
Seems hard to understand, why not just "Allows you to open more connections in browser" or something of that nature
is it possible to get the png of an emoji by its id
it could also be through a cache
I mean emotecloner must do it
So
horror
Gfd
sure!
owo
not entirely sure where to ask this since theres no installer development channel (trying to build the installer) but trying to run
go get package github.com/AllenDang/imgui-go
is giving an error
go: malformed module path "package": missing dot in first path element
yeah but some packages were showing as missing after running go mod tidy so for some reason so i tried installing them manually
bump
I am asking here, so is it possible to write a js, that can i execute in the dev tools. It should deauthorize all apps for me.
yes, just find how the list of apps is being fetch and delete using the app id.
you can look into how plugins use RestAPI and find the endpoint of the authorize apps
Mhhh, it sounds a bit hard for me. I am not really into coding. I'll figure out another way.
Enable consoleshortcuts Stores.AuthorizedAppsStore.getApps().forEach((app) => RestAPI.del("/oauth2/tokens/"+app.id))
Oh thanks :)
and open the apps in settings so they get initialized
Unfortunately, it didn't work, but I have found a workaround. I simply recorded my mouse and then played the whole thing back until the page was empty. :D
But thank you anyways. :)
Are there any docs for writing plugins? If so, can someone send?
yooo they made the roles in profile popouts expandable in canary, showallroles shaking in its boots
Thanks. Couldn't find it from the home page or READMEs
bump 2: electric boogaloo
to do what
Change the panning on a user
i believe im in an override group for... reasons
rip my ShowAllRoles plugin lmao
can I somehow nuke csp for userscript users
i doubt its possible
it explodes all image related requests
however non-image related requests work fine
How would I go about making a plugin?
thanks
dont use rpc, find the internal client functions that control this
fair enough
tho looking at the code
actually i lied
@jagged briar ```js
findByProps("setLocalPan").setLocalPan(userId, left, right)
for rpc functions if you search the command in src you can usually easily find their handler
which you can see here
hey there, is there a way of modifying the electron properties of the main discord window inside of a plugin? (transparent, always on top, etc.)
what are you trying to do?
given the examples they gave, id presume #850
look at native.ts file
GuildMemberStore
oh i see
it's not in the types so i was kinda confused
how about forcing a fetch of a user
specifically the profile
you could look at the code of Valid User
UPDATE_HANG_STATUS_CUSTOM i think
hang status is for VCs, right?
not sure lol
Look at how the stock status changer does it
I know you can add a presend listener but is there any way to prevent a message from sending?
without invalidating the message by removing its content and stuff, i'd rather not send bad requests to discord
neat, is it possible to change whats in the text box too?
insertTextIntoChatbox() although that just appends
not certain if theres a way to change already existing content
ive been looking into that
I'm guessing no success then?
no, i just havent had time
ill let you know if i find anything
me quoque
@oak sundial i was able to clear the text
you can prob do something with clearing then appending
yeah that'll work for me
how did you do it?
srsly
this could prob get pr'd to vencord, i might do that later
ComponentDispatch.dispatchToLastSubscribed("CLEAR_TEXT")
i dont know how to get the current contents of the text box
@oak sundial it seems you can also get the current contents of a channel with this
(there could be better ways)
DraftStore.getDraft(channelId, draftType)
interesting
would it be possible to make something similar to this #1032200195582197831 message, except use most recent reaction?
would vencord have to store the recent reactions itself?
there is probably a flux event for reaction add that you could use then store the four most recent ones
ok cool
idk how to do that lmao
not very familiar with vencord codebase nor javascript/typescript
yep
https://github.com/nyakowint/vencord-plugins/blob/main/unfinished/reactionNotifier.tsx something i never got around to doing
look at some plugin code
you can sub to flux events in your definePlugin
Can someone please port over this plugin so I can leave betterdiscord https://betterdiscord.app/plugin/RemoveBlockedUsers
wrong channel + this is already a plugin
noBlockedMessages
fake, devilbro isnt blocked
vp noblockedmessages

Not the same big differens between them
like you can see on this pictures one is Vencord and the other one is better discord
No need to request it
https://github.com/Vencord/plugin-requests/issues/187
I fear to say there is a clientSideBlock in #1032200195582197831. I don't have time to answer questions
It's the last response to the issue I just linked 
¯_(ツ)_/¯
Maybe it doesn't to work in a channel where people are supposed to already have a dev install

that’s prolly it
would make sense
Yop
There's still a few things I haven't added
[data-list-id="chat-messages"]>[class*=groupStart_]:has([class*=blockedMessageText_]) {
display: none;
}
oops forgot to reply
^
and you can do most if not all of this with css
oh but that clientsideblock plugin is probably better
I want to build a plugin to edit this, and the join a server menu inside of it, should these be separate plugins?
Depends if the functionality is linked/relevant to eachother
Not really and I already decided no
Fair
did i cook (so far)
you definitely cooked
yup
Hi, how can i utilise the native.ts file i have just created? it uses the node:fs module but when i call it directly i get this error
The package "node:fs" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.```
However i saw from public plugins that this line is used:
```ts
const Native = VencordNative.pluginHelpers.PluginName as PluginNative<typeof import("./native")>;
``` but then also realised, apparently my plugin also doesnt appear there but nly plugins. What is there that im doing wrong?
can you send the file structure of where you created your userplugin
This is in this folder
make sure your plugin is enabled and full restart discord, not ctrl R, and dont import node stuff outside of native
also what plugin are you making 
alr i will give it a try!!!
use vscode not webstorm
well i made a plugin for spoofing some.. information sent to the websocket and i had an ETF encoder and decoder but it doesnt work good with BigInts like discord timestamps so it just
them and prolonges them
i didn't even notice it was webstorm
tbh its nice
i am not paying for it, its that my school pays it otherwise i wouldnt
thank you~, it worked like a charm
how can i edit a message by id?
A message you sent?
yeah
There is probably a better way, but this will work
https://docs.discord.sex/resources/message#edit-message
Messages are the core of Discord. They are the primary way users communicate with each other, and they can contain text, images, and other media. Embeddable content, such as polls, system messages, an...
ah thank you
welp ive run into a new issue, cant figure out how to get authentication
never use the raw fetch() function to make your http request, use RestAPI. an example for this would be
RestAPI.patch({
url: `/channels/${channel.id}/messages/${messageId}`,
body: {}
})
takes care of auth, and adding special headers to make sure your account doesn't get flagged
oh ok, thank you!
does anyone have an idea or even a starting point on how to get the current position of the curser in the text box (the little I-beam thing)
selection prop
Chat how's this? (Sry ik this channel for plugins but there isn't any channel to showcase theme so..)
#🎨-theme-development exists
Ah thanks
I like it btw
It's not on my channel list
It's available on my github
Is posting links here allowed?
Yea cuz it's my alt
how does vencord standardly capture variables like eS or eN that are subject to change?
\i
ty
So, I wanna write a plugin that splits message tags on the DOM by an arbitrary RegEx pattern. Do y'all think this is an useful idea? Also, would it be appropriate to be a brand new plugin or a feature merged within an existing plugin?
on the DOM?
Through patches, I mean
"message tags"?
lemme give you an example
The message content tag has an inner span, which essentially could be split onto many span tags given an arbitrary pattern. For example /\s+/g would split this message into four spans lemme take an example
Yeah
Discord already splits messages into small chunks, which was a pain for me
What is the point of changing this behavior completely? Discord does this, so it can apply all markdown rules as needed
It doesn't split it in a way that's nice to theme
And how exactly do you want to change it?
In example above discord creates a new chunk with '(' for example, which is important for links
Vencord is the ultimate Discord tool with 100+ plugins, including SpotifyControls, Translate, and Free Emotes/Stickers
⚠️ vencord.app is a fake malicious site! The only real website is https://vencord.dev! If you have downloaded anything from vencord.app, remove everything you have downloaded immediately, run a malware scan and change your Discord password.
Discord uses this regex /^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff]|\n\n| {2,}\n|\w+:\S|[0-9]+\.|$)/ for a normal text, which is not hard to modify, but changing it might break something
If I have a file object, does anyone know how I can attach that file to the user's text box, like when users upload files to their messages?
look at petpet
ok
How can i get the most recent message (specifically who sent it) from a channel id?
Oh i think lastMessageId in the channel object will work
It seems like lastMessageId is null unless you load the channel at least once
well why would ya be checking the id of an unloaded channel?
just ooc
cant you just like, load the channel if its a set id? idk, ive never tried to do that.
like, where are you getting the channel ID from?
I'm getting the id from getDMIdFromUser
Might have butchered that method name
There's definitely a better way to do it other than just force loading the channel
im trying to patch the onContextMenu of emojis in statuses to pass props i need for a context menu patch, but i cant find where it calls the context menu
from react devtools, all i could find was this
which just seems to hide this
getting the name of an emoji by ID would also work
can someone hop in vc for a sec I need to harvest flux events
TimezoneDB but it just determines timezone from /(?:GM|UT)C(?:\+|-)\d{1,2}/gmi in profile
its fine I figured out everything is still fucking VOICE_STATE_UPDATES
can someone help me test now?
sure
summer time:
So true
The plugin could automatically update timezone in profile every time you open the app
have you ever heard of proper timezones that already account for summer time
Then you need a lib to parse or hardcoded table
I got basically no sleep and am up way earlier than normal so this is probably all a really bad idea
Don't understand how this is husk
because it's stupid when real timezones exist
UTC offsets > "real timezones" any day.
Please give example of "real timezone"
(my plane landed)
Europe/Berlin
https://www.npmjs.com/package/@protontech/timezone-support
https://bundlephobia.com/package/@protontech/timezone-support@3.0.0
Regex for matching zones would be harder, but the concept still works
How do you then
Because I can't find a way you would decode without
Everything I see says you need a lib to get info from those timezones.
?
So the goal is to see the local time of every user when you open their profile
If a user specifies a timezone in profile, it gets the timezone, does math to get what their local time is, display it live in profile
Is there a nice way to provide an overlay over messages that meet a specific criteria? I want to colour the bgs of messages that contain certain words etc etc
I know message logger does some funky stuff but not sure how I can apply this outside of that
you might want to patch messages directly
also look at message logger
this seems just a little bit painful

use react devtools to select a component, click the view code button, and find where youd insert your own code. then, turn off the beautifier in the bottom left to view the unformatted code, then make a regex to match and replace that
adding elements is usually patching children on a jsx call
why don't we have any indian people here to make a youtube video how-to
look at anything that adds stuff?
first thing to come to mind that should be simple is vencordtoolbox
look at how it patches the top right icons
or gameactivitytoggle
is there any reason i shouldnt send a message to a channel that isnt focused?
why would you be
im letting the user edit specific bot messages, then using a pre-edit listener, sending a command to edit the message.
the idea is to simulate vanilla discord message-editing as closely as possible, and the current method, sends a message, which is quickly deleted.
but the message doesnt have to be in the same channel, so if i send a message in another channel (eg. a channel specified in the plugin settings), it wont have the drawback of moving the chat up and down for a message to be sent and deleted.
mb if thats overly verbose

as long as you make the bot delete the command to edit it, that should be fine
one request per user action
wouldnt the command be a slash command?
Got it, thank you
thats up to scyye
pluralkit hasnt migrated to slash commands, and probably wont as far as im aware
ah, thats what you're doing
havent used pk in ages, why dont you make it dm the bot the command?
instead of manually specifying channel id
thats... actually really smart, thanks lol
ofc !
is there a way in discord i should add a keybind or should i just add an event listener
discord has a keybinds system but vencord plugins dont use it, just add an event listener
@hushed loom for your emotecloner pr why are you saving that let?
whar
The patch
Granted I'm not on PC rn but
It should be fine without the let in general (needs testing)
I haven't looked at that find yet
it should be known that most of my plugins are ideas that come to me in a random craze at one am while i am on very little sleep
I feel that
That's why I was in unity for 12 hrs today
I'll look to see if I can do a better patch for you tmrw
If you want I should say
I see
Do you have the original model ss'ed?
what
Not modified
Version of handleContenxtMenu
Or is it just remove that second line
I'm tired and not thinking
checks out
Is that let there normally?
yes??
Cool
This makes literally no sense
find: "renderPrioritySpeaker",
replacement: {
match: /(handleContenxtMenu",\i=>\{)/
replace: "$1 this.props.user.HangStatus=this.props.hangStatusActivity;"
}
how does it not make any sense
I think it's just the .*? But the let should just get moved down unless I'm being stupid again
that would prob work
ungreedy wildcard
I hate using .*? In prod code
okay
(also me using it because I don't want to match something properly)
All this was is that patch looked unclean for some reason but that let just wasn't needed it could either be just moved down normally or no () around it and $2 as let if it's truly needed (less typing ig idk)
Someone already did that
I forgot when but someone definitely did that
You had to host a server for it
I don't think the project is continued so it wouldn't be a bad idea to remake it
I'd use it
i love checking my github notifications
I don't think it's available in electron
it usually works by sending the audio to a google server
nope
Firefox doesn't support it at all
it's probably kinda hard to do locally
cause you need an engine
like google doesn't really gain anything from making it a server, if anything it just costs them money to run the api
so there has to be a reason it's via api
probably just so that they can fix bugs if smth arises
Can’t wait for the chrome ai window api to become mainstream!!!
There’s only a couple days before Firefox adds it!
chrome ai what window now
dont tell me theyre pulling the same as bing
and adding ai everywhere
horror
God fucking damnit
no one
tbh AI in browser can be useful
if you're reading something and want to summarize
I only considered shitty chatbot support agent that doesnt know wtf its talking about
Discord Summaries (but local)
"please put glue on your pizza" incident
Google Is Paying Reddit 60 Million Dollars For Fucksmith To Tell Its Users To Eat Glue™️

Absolutely but not as a stock feature
Depends what it entails actually
depends on situation 
they should fired who comes up with those ideas
is there any way to DM a user, without moving them up in your dm list?
no
you'd have to reorganise the DMs by sending a message or something like that
I mean TECHNICALLY yes?
You could patch the member list to locally store the order and only change it when you want to
But that would probably be too much effort for something that small
failing to send a message does this
why are you doing this in the first place
@dull magnet Recently CtrlEnterSend has broken twice. This time we need to revert 7749206 to fix the problem. Actually Discord has been switching back and forth between those two places to handle message submission logic for multiple times (4 times as I personally experienced). In every version, both patches can be applied without a problem, so would it benefit if we simply include both patches although only one of them is at effect? This way the plugin should break less often.
yes do it then
why am I doing what?
Why are you trying to do what you're asking about
Xy problem
automatically dm a specific user something when the user does something, rather than in a specified channel.
Sounds dodgy
... how...?
i dont see a reason for that to exist and sounds a little like self-botting depending on the action the user has to do
number of user actions = number of requests, no?
accepting an edit on a message not sent by the user
look at the previous conversation I had here, if ya need more info on specifics
agreed especially when im at school this is an ai bypass so i dont have to do the most annoying papers ever
bro will stop praying to AI gods and pray to document.hasFocus = () => true
uh what does that do again
funny things
does this actually work?
i dont have any school stuff to try it with during the summer, but it works on snap
what
it works with snapchat web
thought so
idk what it actually changes though
i bombed my snapchat account a few years back
I only have snapchat to fuck with my transphobic ex every once in a while
I bombed like every social media account that I had a couple of years ago, and then I just made an Instagram and a few others that was tied to my discord persona
i love maintaining my pr
i just fixed an issue where the verification checkmark would be its default color and mismatch with the text when the text color is black
what..
terrible wording
ive gotten warned a few times cuz they dont like me using perma messages
i need that stuff dude my classmates are weird
Note the "with", PLEASE
does someone know where discord handles what should happen on certain kind of links (like clicking on oauth2 link, that it opens in-app)
or how I can modify a oauth2 modal (which can be opened by any link in the chat)
i can't rly find it
You could probably just go into the react Dev tools and go to the on click part of links
Also look at always trust
tried (I might just be stupid)
what are u trying to do
i made the chrome extensions for oauth2 scope rewrites and I essentially want to do the same for vencord now lol
look how reviewdb opens oauth modal
and you will find the component for it
u should be able to just patch it
yeah I look at how the cloud integration does it
i mean I have probably 3 ways I could do this,
- just modify the links in messages of oauth2 urls to remove scopes
- make oauth2 links open the plugins' modal, where scopes are removed
- mess with the oauth2 modal which discord opens already and remove scopes
YES
ok I found this list of oauth2 scopes, how can I use that in a plugin now (sorry never used lazy finding or stuff)
Is there not a list of types just in discord types?
wdym use
just hardcode them
ok I thought that it would be a better idea to just use the list discord provides but alright
Not like it will change often
well yes, but I usually use enums if they already exist lol
not sure if this is intentional, but clicking on an user profile pic with ViewIcons plugin now opens the profile pic instead of opening the user's profile
isn't that the point of the plugin?
yes, but that wasn't previous behavior
specifically, I mean the mini-profile, not the full one
it seems it was already fixed, but wasn't upstream'd yet https://github.com/Vendicated/Vencord/commit/14e940eb9972a95f32078bae6842cc229c7e94b3
Is there a way to access the live value of another setting (like before hitting save), without having it set a global value onChange?
Does anyone know how the SpotifySocket (findByProps("getActiveSocketAndDevice")) work that is used by SpotifyControls?
ask a better question
not so vague
what is your goal
To greate goal is to create a modified version of SpotifyControls for YouTube music.
And therfore i think it is necessary to understand how to SpotifySocket works
you cant
@dull magnet thanks for the plugin! #plugin-news message
suggestion: add option to show avatars after the name (on the right)
le css
but it comes from a plugin, so IDK if it's "appropriate" to just tinker with CSS, maybe an option would fit more naturally?
I was working on a plugin, went to build it and got this error:
X [ERROR] Could not resolve "react"
src/plugins/profanityFilter/index.tsx:10:69:
10 │ import React, { createElement, ReactNode, useEffect, useState } from "react";
╵ ~~~~~~~
You can mark the path "react" as external to exclude it from the bundle, which will remove this
error.
am I stupid or somthing?
import those from @webpack/common
Thanks!
(if you aren't already, use vscode and install the recommended extensions as shown here, as this should've been catched on your editor pre compile time, as shown below)
might help you too
adding a thing to ThemeAttributes, does anyone need any other ways to detect things that can't be (easily) detected with pure CSS
i'm injecting into the classes here
Wait what do you mean with that.
That i cant understand how that works or to create a modified version for ytm
spotifysocket is built into discord
youd have to make your own inhouse version for ytm
and i dont know if their apis allow controling the player
I'm saying it's not possible
YouTube music just doesn't have an public API afaik
No, Spotify is just weird in the fact they provide an API like that because they LOVE cloud based remote casting solution 
My intention was to use it with youtue-music. You can create your own plugins like Vencord plugins. So i would not need any Public API
my opinion is you should be using system apis
it's been requested and suggested before
Good for me though, made my own spotify client with that (Web Playback SDK)
git submodule abuser
just curious but why
love committing entirety of #1256395889354997771 to feature PR to upstream vencord shhhhhhhhhhhhh
I found out about the SDK and wanted a super minimalistic client, with just controls 'n stuff and search
still use the normal client most of the time
but it is still useful
interesting
this is why modern web frameworks exist
Web Components would be great if you could preload attributes onto elements before attaching them to the DOM
I wrote this, when I was dumb and thought "React is useless, just use pure JavaScript"
React indeed is bloated because of the virtual dom stuff IMO
But raw dom manipulation is absolute boilerplate hell
discord should remove FocusRing
i think i regret making typingindicators who is typing
not because it's a bad feature (it isn't) it's just it makes me feel like I need to write a comment on stuff more than I used to
is there any plugin that adds keybinds to discord
im sure there were prs but no
what kinds of keybinds
any, just want code to look at
event listeners*
did i cook
why does this exist the metadata Literally Isnt Passed To The Server
its just sent separately as an analytics event
YEAHHH
wait, what did you even do
Added my own server template
fire plugin idea
