#🧩-plugin-development
1 messages · Page 20 of 1
your code should automatically update when you receive the member
oh
^^
I was going to await for it
and if no load then just display "failed to load"
instead
hmm
New question i thought of. So in the og code it says
onClick: ce;
Which makes me think ce doesn't take in any arguments to begin w. So why did you add the part with $2(... arguments) where it now takes in arguments it didn't before
useStateFromStores(
[GuildMemberStore],
() => GuildMemberStore.getMemberIds(guildId),
null,
(old, current) => old.length === current.length
);
it actually doesnt
but it may in the future
the old code directly references it
that's why you dont see it being ce()
I remember u saying this now that u say it again oops
o so should I like
use a react state ?
to update members inside the ui
basically this would cause a re render every time you receive a member
(you would receive a member when you fetch the owner)
yh
What I did was like
subscribe to the event before
and just unsubscribe if what i received matched my request
(notFound and members)
I read it like "in case it uses specifically arguments in the future" but I see. It's just in case one day anything gets passed in
but your solution seems better
this way it wouldn't wait for the owner to actually display
Same thing really. No brain cell
oh
I talked with megu about the plugin i wanted
they said they also were going to do something like that
FluxDispatcher.dispatch({ type: "USER_PROFILE_MODAL_OPEN", userId: friendId })}
OMG
this is what I NEEDED
I didn't know you can force load it with that
my friend and I were looking to like
grab function from webpack
and stuff
const friendIds = useStateFromStores(
[RelationshipStore],
() => RelationshipStore.getFriendIDs(),
null,
(old, current) => JSON.stringify(old) === JSON.stringify(current)
);
useStateFromStores(
[GuildMemberStore],
() => GuildMemberStore.getMemberIds(guildId),
null,
(old, current) => old.length === current.length
);
const friendsToRequest = friendIds.filter(friendId => !GuildMemberStore.isMember(guildId, friendId));
React.useEffect(() => {
FluxDispatcher.dispatch({
type: "GUILD_MEMBERS_REQUEST",
guildIds: [guildId],
userIds: friendsToRequest
});
}, []);
const friendsInGuild = friendIds.filter(friendId => GuildMemberStore.isMember(guildId, friendId));
and we tried and failed hard
this is the important part
yh
so
hmm
okay
yeah maybe it is about time I switch my UI code to be more react style
lmao
the reason theres a React.useEffect there is to only run that once after the component is rendered
and not on every re render
lol
its a bit different because I was building on top of already structured code
like this is how it looks like
oh wtf
OH
OK
Thank you so much @cedar olive
I owe you a drink
is there a way to detect middle click on a channel
is start not running once intended behaviour? @dull magnet
no
provide more info :3
that doesn't even have the console.log
yeah
i was doing it now
lmao
so for some reason guild-context is now running every time you interact with the context menu for guilds (before it didn't do that for me)
this is normal react behaviour
why didn't it do it before what the helllll
because we changed the way the api works
before it would never call your function twice
now you have to manualyl opt into this behaviour by returning a function from your callback
ah
react can call your function multiple times because Ha!
addContextMenuPatch("guild-context", () => {
console.log("runs every time");
return () => console.log("runs only once");
});
if you're only adding elements you don't need to run more than once
running every time is only important for react hooks and modifying discord's stuff
working on light mode compatability (the very light ones i still have to work on)
feedback?
@hasty stag
it no longer pushed chat up
but it's kinda jank...
welp just found a solution 10x better, nevermind
wip of replacing discord's default loading screen
gimme feedback or smth @tight epoch
Wait what exactly do you want feedback on here, the refreshedlime thing? Layout?
idk everything
light mode colors mainly
can anyone help me why is this here
fixd it
anyone know how to divide a list into other lists in intervals of 5 (its fine if new lists are created) if so can you help me out with that since thats my coding homework this is in python btw
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
but like it should create lists like a list for numbers 1-5, a list for 5-10, 10-15, and so on
Ah, hmm looks good, though I can't really say much since light mode themes aren't really my cup of tea
As for the custom loading screen thing, seems really cool and I'm interested to see where you end up taking it later down the line
new lists
okay so if im hearing this right
input: [2, 4, 5, 6, 10, 3, 15]
output: [2, 3, 4, 5], [6, 10], [15]
you can probably just do a simple for loop and if statements then
if n in interval
then append to interval list
also this is a bit confusing because 10 can't belong in two lists at once
is it exclusive or inclusive
no like im saying
input: [1,4,6,20,24,31,]
output: [1,4], [6], [20,24], [31]
round it up to the list with higher number intervals
is the input always sorted by default
its not but i used list_input.sort()
This seems very easy ngl but I'm on mobile rn and I gotta go somewhere soon
one second im trying to make an example
Anyways, first thing you'll need to do is figure out how you're gonna pass these numbers into a function
to better explain myself
i dont know what that is im like a rlly big newbie
not necessarily
python is scripting language. functions aren't necessary
like 2 months in
We're talking about input/output
Don't ask me, they brought it up
i don't think 4nullxz meant literally an input and output
but since we are, it would be helpful to think of this in terms of a function
It's a function lol
i say just use a for loop and put the logic in a for loop
yeah it is a function but you don't need to code it that way
@ebon pivot you dont' need to use this bit of logic later right
If you're 2 months in and abstraction to a function is really that difficult, I might be worried
your'e only using it once to finish this hw assignment?
the only reason you need a function would be if it's a repeated thing
used elsewhere
in this case if it's just for a hw assignment a function isn't neccessary
probably not
but
Generally assignments end up requiring the use of a function
So that you can run tests
if your gonna send me the code
ill be better of askin
*askin
*asking
my teacher
not the assignments ive ever done
like in leetcode maybe
but if it's for a TA to grade?
if they don't sepecify the need for a function why bother
¯_(ツ)_/¯
im trying to thing of pseudocode tbh
I still don't think a function makes anything complex
¯_(ツ)_/¯
hmm i don't think complexity is the right word. it's like, the first thing you said was step 1) we need to input the numbers
but that step is unnecessary if you're not gonna make a function
why do something that's unnecessary
ezpz 🙄🙄🙄🙄
nice
from math import floor # function to always round down values
imp = [1,4,6,20,24,31] # input but named `imp` because see PFP
out = {} # output dictionary
for n in imp: # loop through numbers in input
try:
out[floor(n/5)].append(n) # tries to append to a currently existing list at idx `floor(n/5)` (which makes it work)
except:
out[floor(n/5)] = [n] # if we fail to access a currently existing array, we write a new array with the number at the same index
print(list(out.values())) # we convert all values in the array to a list and print them
i did too tbf
i could have sworn i used modulo for this but while trying to figure it out i remembered it was for round robin sorting threads by their id. which is def not the same thing
yeah i tried modulo but this is notably Not Right
yuppppp
floor makes so much more sense https://cdn.discordapp.com/emojis/814012804445110313.webp?size=48&name=facepalmcry&quality=lossless
we love strencher
from requests import post as p
from time import sleep as s
while True:
p('https://discord.com/api/v9/channels/1094688170156773526/messages', headers = { 'authorization': t }, data = {'content': "**MRBEAST DONATED 300 DOLLAS THROUGH SUPERCHAT**"})
s(1*60)
RATE MA CODE
0
0
0
{"NaN":0}[0/0]/10
im making icons for the theme selection instead of just the color (the really dark one will have an svg rendered on top of it)
where's the token
oh what is it
i heavily changed the theme menu - thoughts?
Nice
looking good
does anyone know how to do this
yeah ive tried with that but i need to know the channel id and other info for it
plugin
how would i go about appending ?.gif to the href of all a [data-role="img"]?
You need to do that with js
I have decided to embark upon another one of my dumb "this should by no means be feasible using pure CSS but that won't stop me from trying" misadventures, this time: can I get an average colour (or what is perceived as such) from an album image in the spotify player to then use it for the background of that spotify player?
I'm thinking I can use a blur filter and upscaling through transform to get an image's average colour as the background, but then the question is how would I extract the image link and get it put somewhere else using pure CSS
definitely not possible without js lmao
I mean I found a way to change the profile container's border depending on one's currently set status, so I've already done something I and a fair few others thought wouldn't be possible with pure CSS
Whichever way, I find it fun to challenge myself to do this kind of stuff, and want to see how far I can push CSS, so I'm still gonna try to do it lol
i mean
i made a lot of stuff that isn't normal for discord themes
like custom loading screens and changing almost the entire settings menu
This is a stupid idea, but I will do it
adhd just made me type something completely different lmao
Mood
Hmm wait, maybe if I can find a way to use inherit or something similar? So long as it works on a ::before or ::after pseudoclass it might be possible that way?
You've got me using a considerable amount of complex selectors like those as well lol
does anyone have a list of all markdown discord supports
maybe look at their parser
wouldve been really funny if markdown images worked
I think that's it?
ye
that's plain text behavior no?
- a
- asd
- 35435
- b
- c
- d
- e
- f
- h
- i
- j
- k
- l
- probably
2. nestable
yop
- a
- a
you don't even need to make the numbers proper, this is 4 times 1.
it counts for u
lmao
Discord™️'s markdown
nah that's how it works in normal markdown as well
it's part of the markdown spec
how deep
lmao
- https://cdn.discordapp.com/emojis/1026532927368085534.webp?size=44&quality=lossless
- https://cdn.discordapp.com/emojis/1026532927368085534.webp?size=44&quality=lossless
- https://cdn.discordapp.com/emojis/1026532927368085534.webp?size=44&quality=lossless
- https://cdn.discordapp.com/emojis/1026532927368085534.webp?size=44&quality=lossless
https://media.discordapp.net/stickers/1075075140666282036.png?size=160&name=sobb
- https://media.discordapp.net/stickers/1075075140666282036.png?size=160&name=sobb
- https://media.discordapp.net/stickers/1075075140666282036.png?size=160&name=sobb
2. https://media.discordapp.net/stickers/1075075140666282036.png?size=160&name=sobb
- https://media.discordapp.net/stickers/1075075140666282036.png?size=160&name=sobb
- https://media.discordapp.net/stickers/1075075140666282036.png?size=160&name=sobb
- https://media.discordapp.net/stickers/1075075140666282036.png?size=160&name=sobb
LOVE RECURSION
what now
that looks horrid on mobile lmao
transforming working perfectly
well
this did not work how I wanted
aha
just a small flaw
completely removes the markdown stuff
so many things are dispatch jee
yeah there are more than thousand events
discord insane
cord
const MessageActions = findByPropsLazy("sendGreetMessage");
MessageActions._sendMessage(channel.id, msg, options);
beat me to it
wtf i didnt know u could do this
its the same thing as > "u" i showed earlier
i just didnt know u could even compare entire strings lmao
bro
does it just make the number all of the char numbers then check which ones bigger or something
?
that didn't make a lot of sense but you can compare characters by their ascii value, so what that does is just compare each character
thats what i meant
wait why doesnt it complain
the func signature doesnt allow undefined
oh i think it's because the type implies that every string has a mapping
huh?
js
where anything is an anything
trolley
you cant straight up impl Ord for String sadly because out-of-crate traits cannot be impled on out-of-crate structs
wait
wait a minute
i didn't even need to implement it myself
that's just the default behaviour in rust
for strings

I smell Rust
what other plugin fixes did people want
favourite files
@cedar olive pardon the ping but wtf
i was gonna start debugging the js just now as i have some time to look at it
and it just.... worked??????
i haven't done anything different
well that's good lol
(referring to the close folders thing)
yeah
im so confused
ive been restarting my discord all day
and it wasnt working?
yeah
🤨
that's for sure not the reason lol
right???
but that's the only thing i changed
i was going through my servers being like ugh it still bothers i have to click once to open the folder, once to open the server, and then again to close the folder
and then i was like fine ill look at the js to see if i typed something wrong somehow
and then... it worked
odd
it is a little laggy tho
idk why that is
like the closing animation is a slightly less smooth than when i open two folders at once
even tho it's the same function
no idea about that
okay final question, should i keep this as just a me customization or make a PR
do you think others would find this useful 🤔
I guess it doesnt hurt having it an option
it's like 8 more lines of code ish
ig ven can be like "why would anyone want this ?" and deny it
so it can't hurt
Except when clicking on the server you're in at the time
Then it closes smoothly
I feel like I should fix the lag before PR
why wont the color of this change 😭
i put !important after the color code
but the color will not change
it remains
green
I got logged out of my account by trying to help you...
That's not a good sign
what 💀
I went into inspect element
or whatever
and I clicked the Discord in the top left
What's the point of "::after"?
idk it just was there when i got it from #🎨-css-snippets
Well, I ended up turning it red locally
tell me HOW
changed the style of wordmarkWindows-2dq6rw
ah
How do you QuickCSS? 🥴
Like if I wrote CSS, where would I put it
ohhh
settings > vencord > open quick css
lol it works fine for me
.wordmarkWindows-2dq6rw {
color: #00FF00 !important
}
this changed it green
oh, it doesn't work if I use ::after, though
Why?
oh this is so weird
that is bro
stfu
maybe its because the theme i use changes the text already
so theyre liek fighting for it
idk
its weird
talk to cat
enable the NoConsoleWarn plugin to fix that
so then Discord's just crashing?
idk
it restarts but sends me to the login screen
I'm not restarting on purpose, so it should be crashing
.wordmarkWindows-2dq6rw {
display: none;
color: #bbb !important;
}
.wordmarkWindows-2dq6rw::after {
content: 'endcord' !important;
display: block;
position: relative;
width: 200px;
height: 16px;
line-height: 16px;
font-family: var(--font-headline);
font-size: 11px;
font-weight: 600;
}
idk why the f is it purple instead of gray but eh
thank you so much
Why does this not work for me 🤔
it just... hides it
.wordmarkWindows-2dq6rw {
display: none;
color: #FF00FF !important;
}
.wordmarkWindows-2dq6rw::after {
content: 'meow' !important;
display: block;
position: relative;
width: 200px;
height: 16px;
line-height: 16px;
font-family: var(--font-headline);
font-size: 11px;
font-weight: 600;
}
their theme is weird
Fascinating

fff turn green, ddd turn pink, then bbb turn purple lol
wait... what
their theme makes it turn like that
I didn't know that was something that's possible
if i play an animation from a spritemap on :hover
i have a reversed version of it playing when you stop hovering
how do i play that reverse animation from the step it got up to from :hover?
Are you animating the spritemap using an offset?
the fix was just to downgrade to manifest v2
the same code didn't work on v3 but did work on v2
idk why
mv3 causes so many problems sm my y (do not dink me with fact checks I do not care)
sm my h
SelectedChannelStore.getChannelId()
store is in commons
theres also an util to get the full channel object
what is the current best practise for maintainable discord css regarding classes? discord seems to regenerate the hashes like semi-often, im wondering if i should just use class*= selectors...
not a huge fan of them but discord is already so bloated it might not even make a difference
mappings are the most performant but can break for each update
|= is probably the best selector
which mappings?
why not *= ? what if its class1-hash class2-hash and i want class 2?
diy :P
breh
*= is slow
|= is also slow but less so
there are a couple of projects i think that do them
you would have to research, its outside of my expertise
could there be a plugin to remove the hashes?
i'm pretty sure my nitro blocker has stopped working by now lol
removing hashes isn't really something you'd want to do
there are tons of classes that would be duplicates if you removed the hashes, like the container classes
mm conflicting classes my beloved
ah :(
Yeah I've had at least the having to log back in thing as well. Guessing it has to do with me having enabled window transparency, though weirdly enough it hasn't happened again since I turned the setting off, did a full restart, turned it back on, and did another full restart
Dumb idea:
Make as many elements as possible hover-to-reveal, including the textfield, sections in the profile popout(as well as the full profile menu), and just about anything and everything else, no matter how useless it would be 
just make the whole window hover reveal
Yeah I was thinking of doing that too lol
Wehh server bar doesn't want to hide again after being hovered over 
horror
terrifying
I doubt this'll work very well for everyone considering I used px for this, but if anyone for whatever reason were to wanna use this, whether to mess with it, use it in a theme, or try to make it work for different window dimensions and all that, here it is ig
/* The very reason I should not be given this much power: an abomination of a CSS script by DeadVoxels#3520 */
/* textfield */
.form-3gdLxP {
margin-top: -36px;
padding-top: 24px;
margin-bottom: -58px;
transition: all 350ms ease-in;
}
.form-3gdLxP:hover {
margin-top: -24px;
padding-top: 0px;
margin-bottom: 0px;
transition: all 150ms ease-out;
}
/* Member sidebar */
.container-2o3qEW {
position: absolute;
transition: all 350ms ease-in;
right: -245px;
padding-left: 15px;
}
.container-2o3qEW:hover {
padding-left: 0px;
right: 0px;
transition: all 150ms ease-out;
}
/* Channel top bar thingie */
.title-31SJ6t {
top: -36px;
padding-bottom: 5px;
transition: all 350ms ease-in;
}
.content-1jQy2l {
margin-top: -36px;
transition: all 350ms ease-in;
}
.title-31SJ6t:hover {
top: 0px;
padding-bottom: 0px;
transition: all 150ms ease-out;
}
.title-31SJ6t:hover ~ .content-1jQy2l {
margin-top: 0px;
transition: all 150ms ease-out;
}
/* Channels sidebar */
.sidebar-1tnWFu {
margin-left: -233px;
padding-right: 5px;
transition: all 350ms ease-in;
}
.sidebar-1tnWFu:hover {
margin-left: 0px;
padding-right: 0px;
transition: all 150ms ease-out;
}
/* Servers sidebar */
.scroller-3X7KbA {
margin-left: -64px !important;
padding-right: 8px !important;
transition: all 350s ease-in;
}
.scroller-3X7KbA:hover {
margin-left: 0px !important;
padding-right: 0px !important;
transition: all 150ms ease-out;
}
Just realized I also did something that messes with the textfield scrolling, so uhhh 
nothing we can do to fix this, read the error
it's something broken about indexeddb
if you're using Firefox private mode that's why
did you open multiple instances of discord? that's also a reason
yeah that's not supported
for some reason electron locks the indexeddb file on your disk so using it from multiple instances doesn't work
don't use more than one instance
Mac?
is this vencord desktop or discord desktop
do you have openasar with multi instance enabled (I think that's a thing? )
oh I was just asking cause that'd mean our single instance logic is somehow flawed
but it seems to be Discord's being flawed
try uninstalling openasar
and see if it's fixed
yup it's fixed or yup gonna try?
oh so it's an OA bug
odd
Wait, separate from discord/Vencord?
Like, you said "i know i should switch from latte" so i mean, why?
Ah
K
Is there a good replacement
Yeah :/
**MessageEmbedBuilder.java: **
/*
* This file is part of Aliucord, an Android Discord client mod.
* Copyright (c) 2021 Juby210 & Vendicated
* Licensed under the Open Software License version 3.0
*/
package com.aliucord.entities;
import com.aliucord.Main;
import com.aliucord.utils.ReflectUtils;
import com.discord.api.message.embed.*;
import com.discord.api.utcdatetime.UtcDateTime;
import java.lang.reflect.Field;
import java.util.*;
/** {@link com.discord.api.message.embed.MessageEmbed} builder */
@SuppressWarnings({ "unused", "UnusedReturnValue" })
public class MessageEmbedBuilder {
// reflect moment
private static Field authorField;
private static Field colorField;
private static Field descriptionField;
private static Field fieldsField;
private static Field footerField;
private static Field imageField;
private static Field providerField;
private static Field thumbnailField;
private static Field timestampField;
private static Field titleField;
... (487 lines left)
ah, interesting
interesting how the class name is visible too
i'd expect it to be obfuscated
least boilerplatey java code
it's react + nodejs project xd that is from the react page that shows the work hours configuration modal
I think it could be cleaner but not sure how since I started studying react now, i only know decently backend atm
wtf
u definitely dont need that in a react app
when the githubssdddsd
sssdd
I need help making a snippet to automatically go through all possible tags to friend someone don't ask me why
This is what I have so far, it's jank and thrown together pretty shoddily because I'm lazy and in a hurry
(() => {
function range(start , end){
let numbersArray = [];
while (start <= end){
numbersArray.push( start );
start += 1;
}
return numbersArray;
}
const possibleTagNums = range(0, 9999);
const possibleTags = possibleTagNums.map(num => num.toString().padStart(4, '0'));
let tagIndex = 0;
const interval = setInterval(() => {
const tag = possibleTags[tagIndex];
tagIndex++;
if (tag == null || tag == undefined) return;
document.querySelector("#uid_15").value = "SomeUser#" + tag;
document.querySelector("button .lookFilled-1H2Jvj").click();
}, 2000);
window.stop = () => clearInterval(interval);
})()
It also assumes you're already on the Add Friend page
I'd also prefer if there was a way to make it possible to make this not get the user banned while using it (I assume the constant requests at a constant rate will cause an issue)
technically it's fine because it's being done through the UI /j
the modal loads all the work hours currently configured like: 1st: open modal with all fields to type in the work hours you want, 2nd: fill the fields with the currently used values
I think these are used for step 2.
Could probably be a single loop instead of calling 50 functions?
It is using a bot to automate tasks that are supposed to be done by the user
Why are you trying to brute force a discriminator anyways
sounds sus
Discrimination not allowed in this channel
was there a list of flux dispatcher events
and if not does discord have one for retrieving the text in the chatbox
probably not L
impossible + idk why youre asking this here when our rules literally state no selfbots

Make an auto hotkey script for that
.
Still a selfbot
Is there anything that could be helpful to add support for more image formats to Discord via Vencord so that one can send a file in that format and it displays/works just like other supported images?
In fact, there is code for a very cool file format as a chromium addon and it's only a few hundred lines long so I guess I might be able to adjust it but I haven't found any other plugin that adds support for file formats to Discord that I could take as a starting point to make it easier.
If a browser won't support it, good luck getting Discord to support it
For the displaying like other images part I would only need to get the link out of nonMediaAttachmentsContainer and then replace nonMediaAttachmentsContainer with a mediaAttachmentsContainer which seems to be the same across various image formats.
So the format would likely only need to get into electron and then display.
If you can get stuff to render properly in a browser, then you can get it to render properly in Discord
it's just a matter of having Discord recognizing the mime types and handling them accordingly
Part of me feels like you can do that with CSS only, but I wouldn't know, honestly
Yeah, the chromium extension adds basic displaying support for the format to chromium.
That is precisely where things get nasty, sadly
Browsers don't appear to natively be capable of handling "jxl" files
So, you'd basically need to rewrite this extension as a plugin
and on top of that, force Discord to make it work
the way they do it would probably work for discord
they just decode the image and put the contents onto a canvas
but it would need a plugin
I think you'd probably need to convert to a PNG/JPEG in order for things to work properly on Discord
but I wouldn't know, honestly
thats pretty much what they do
let width = Module.getValue(info + 4, "i32")
let height = Module.getValue(info + 8, "i32")
let size = width * height * 4
output = malloc(size)
if (Module._JxlDecoderSetImageOutBuffer(decoder, format, output, size))
error("could not set output buffer")
if (Module._JxlDecoderProcessInput(decoder) !== 0x1000)
error("could not finish processing input")
let image = new ImageData(width, height)
image.data.set(Module.HEAPU8.subarray(output, output + size))
let canvas = new OffscreenCanvas(width, height)
let context = canvas.getContext("2d")
context.putImageData(image, 0, 0)
let blob = await canvas.convertToBlob()
if (!blob) error("could not convert to Blob")
let url = URL.createObjectURL(blob)
``` this is the main code in worker.js
Ah, lol. That might actually make it easier then.
Um, I get this when I run pnpm test, no matter if executed in root directory of Vencord or in the folder I created for the plugin.
System:
Arch Linux x86_64
node v18.15.0
electron v22.3.3
pnpm 8.2.0
Normal build of Vencord using pnpm build works however.
how can I make it so all messages are raw by default, so there is no markup at all?
I want to use discord raw.
delete discord and install an IRC client?
yeah I want to make discord more irc like
average linux user
I use venOS
it's called venOS because it was made by ven
hello would it be possible to make the typing caret glide smoothly as i type instead of it teleporting for each character?
Oops
Tried to do it using pure css, fading in seems possible for sure, but considering the elements get outright removed when not in use, at least that part is likely to need js or ts to function
so would it be possible as a plugin
probably
i think it's probably best just to ask for the number lol
is it possible to make a snippet that changes the size of reactions?
that'd be CSS
(they're asking how to do that with css :P)
is this what u want lol
Part of me does feel like reactions should be a li'l bigger honestly
Some of my glorious emoji are ruined since they're so small
such as

Jesus on a stick
um actually jesus was on two sticks put together 🙄
Y'all, i know you can place a breakpoint for clickable elements like folders opening. If i wanted to style something that doesn't normally change- like the color of your text box- but have it change per server.
How would I breakpoint that?
patch the text bar to add the additional color style
you will have to figure where to get the guild id too
the bar component will probably have the channel obj which you can get the id from
So no breakpointing i guess? Just find relevant code and alter it?
yeah
Oki
use the react dev tools
What if I've added code and nothing happens
And the patch says OK
Nvm this is too situation dependent
I'll tell u more about it when I get time to think about it again
this might be the exact component, but as you can see the channel is a prop
the correct component to patch will have the channel too
Ooo that's so many levels of letters 😵💫
Wait before you're tempted to code this for me I'm not actually trying to change the color of the text chat area ;-;
I just used that as an example because i wanna do the thing I'm trying to do by myself without asking too too much help
I'll probably cave eventually but i don't want you wasting more time 😅
^ 😅 😅 😅
Idk if it's this lol
(I'm too late arnt i)
is there any unofficial documentation for discord css?
thinking of trying my hand at a simple theme
inspect element
learn how to do css (especially hacky css) and the inspector and you'll be good to go

themeing requires a bunch of hacky stuff because u can't control the layout so if u wanna do something the layout wasn't made for (like reorder elements, change content, etc) u gotta do funnies
but yeah it's just those
there's not really any secret
thanks for the help man https://cdn.discordapp.com/emojis/1024751291504791654.gif?size=48&name=shiggy&quality=lossless
yep!
tysm
is it possible to know when i added someone to my friends list
nice preview xd
does anyone how I could get the "unread" messages?
I can only find .getUnreadCount
I guess I can just get last X messages in the chat?
try findStore("ReadStateStore")
no idea how to do that tho
random shot in the dark 
where in the world can I try that
console
right, forgot there is a console haha
running that command returns "findStore" is not defined
enable console shortcuts
it is a plugin
now try that findStore thing
yeah that's done
think i found something
I think I found what I was looking for
now the question is how I'm going to get the messages from that
lol I guessed correctly
yup

i can see there is a messegesAPI
from some examples
is there any documentation for it or naww
yeah u probably just need that store then
unfortunately, from what I've seen, no
getGuildChannelUnreadState seems promising
Yeah but from the info there it's prob just the length
have u tested it
some code on those awful obfuscated scripts seem to only use "count"
since the only things needed is just a bar and also a number, not really the messages themselves
minified not obfuscated 
well it's worth a shot
try the method and see what it returns
aight
time to figure out how the hell to do that now
this is the reference i have and I understand nothing lmao (unindent.ts)
replacement: {
match: /,content:([^,]+),inQuote/,
replace: (_, content) => `,content:Vencord.Plugins.plugins.Unindent.unindent(${content}),inQuote`
}
cannot find how that works on docs
only replacing the whole function
mind helping meh? :)
im gonna try my best
it patches the function code
alright, how can I do this
just call it
findStore("ReadStateStore").getGuildChannelUnreadState(some, args)
ah, like that
i now need to figure out what (e, t, n, r, i, o) means
i tried with some "dummy" arguments and got this thoi
you can see where the function is by looking at the primary store
this is the whole function so figure out what He.getValue is with a breakpoint
where'd you find that?
ctrl shift f in devtools
.
now just a moment because discord decided to freeze
the only thing i can find with that is this
yeah you can search for where its declared
usually .funcName=function( or funcName:function
Hmmmm, you mean this?
click { }
oh, where its decalred
yeah
to make it easier to read
ooohhh alright, looks clean now
alright
returning here for a moment
He.getValue is
e.getValue = function(t) {
var n, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : ne.W.CHANNEL, i = arguments.length > 2 ? arguments[2] : void 0, o = arguments.length > 3 ? arguments[3] : void 0, a = null === (n = e._readStates[r]) || void 0 === n ? void 0 : n[t];
return null == a ? o : i(a)
}
which looks like chinese at first
that just means that all of the args are optional
what you probably care about is the arguments you need to pass to getGuildChannelUnreadState though
only the first arg is required
oh
thats actually useful to know
e is he channel, t and n are just false and i and o are undefined but r looks interesting
look at how it's used to figure out where to get it frm
output of findStore("UserGuildSettingsStore").getChannelOverrides(guildId)
so finally,
...which does not give the actual messages
wait can't you just get the unread count, MessageStore.getMessages() and then only show the last n messages?
yeah the arguments stuff is just how swc transpiles default arguments
like
getValue(channelId, stuff = Foo.CHANNEL)
hm
why does it do that
it just increases the size of the compiled code
backwards compat
their bundler settings are terrible because they have backwards compat for like internet explorer but then ruin it by having some es6 parts
lmao
are there any tools to unminify discord code to remove stuff like this
why
maybe even generate pseudocode, and add the original export or module.exports
hard to read
just get used to it :P
I am jealous of how vue's scoped css works.
Would make custom css so much easier
how would that make it easier
Instead of [class^=] you can just use the actual selector
Ew
or these
these look so fun to theme!!!
Length of them reminded me of tailwind for a second before I realized it was nonsense
same i was about to ask if thats tailwind
that was the idea
It's what I was saying actually
i said from the beginning that it only returns the number
because of how css only needs the number to organise it
sorry for delayed answer, i didn't realise I had the channel on favourites and I couldn't find it lol
this function gives the count of unread messages, thats why I need it
though im just realising that it doesn't return the number
just the state
uh oh
hmmm I'm trying another function but.. i get the same number
I suspect I need another argument
u pass a channel id usually
just the id
alright
It works!
i had to pass a string with the ID
thanks!
Would you mind explaining to me how I would now implement this code?
I'm very confused with the CONTRIBUTING.md
Get the ID of the module you want to patch. To do this, go to it in the sources tab and scroll up until you see something like
447887: (e,t,n)=>{(Obviously the number will differ).
This part for example, I do not understand. Scroll up in what document?? The only thing I can find is where it is declared, but there is nothing about an ID or any of that
you'll see that usually if you scroll up far enough
and make sure it is an actual discord file, and not WebpackModule[numbers] because those are vencord patched files
it is not indeed
oh
i think i found it
who would have guessed I needed to go up 20 thousand lines
lol
this is probably the most confusing thing ive ever done
I need help
I think I'm really awful with regex
can anyone explain to me if this right? And what the hell do I have to type in the replace? The documentation just list to a wiki from mozilla but it's got so many lines and I cannot learn ALL when I only need 1 thing from there
Either I'm dumb or the tutorials are confusing
that makes so much sense how didnt I think of it
I dont understand why almost every discord modules start with the same code
duplicated over and over
why dont they re-use
gud ap
which exactly?
I will show you when I get home
u mean this?
thats one
but why is it duplicated
discord moment
insane
they could just import it yeah
thousands of modules have that same code
The find is used to select the exact module you have to patch, the value you put there should be some part of code that only exists on that module
The replacement is an object or array of objects that contains the patches that will be applied
Match is a regex used to select the code you want to modify, and capture anything you may need (like variable names)
replace is the value to replace the match with
you can use capture groups, or even in the whole match inside your replace
**2_PLUGINS.md: **
# Plugins Guide
Welcome to Megu's Plugin Guide! In this file, you will learn about how to write your own plugin!
You don't need to run `pnpm build` every time you make a change. Instead, use `pnpm watch` - this will auto-compile Vencord whenever you make a change. If using code patches (recommended), you will need to CTRL+R to load the changes.
## Plugin Entrypoint
> If it doesn't already exist, create a folder called `userplugins` in the `src` directory of this repo.
1. Create a folder in `src/userplugins/` with the name of your plugin. For example, `src/userplugins/epicPlugin/` - All of your plugin files will go here.
2. Create a file in that folder called `index.ts`
3. In `index.ts`, copy-paste the following template code:
```ts
import definePlugin from "@utils/types";
export default definePlugin({
name: "Epic Plugin",
description: "This plugin is absolutely epic",
authors: [
{
id: 12345n,
name: "Your Name",
},
],
// Delete `patches` if you are not using code patches, as it will make
// your plugin require restarts, and your stop() method will not be
... (86 lines left)
look at this
this is the bit I don't understand. How or what do I need to put in so it will call, for example, a function.
Two things about your current patch: getUnreadCount exists on multiples modules, your find is likely to break
Believe it or not I've been reading that and CONTRIBUTING.md this whole time
your match contains formatted code, you need to match the unformatted one
okay wait
when I add that to my find
regardless if its correct or not
Will my code be run whenever that function is triggered in the original code? (discord itself)
Or is it just like doing import bar
**muteNewGuild.tsx: **Line 61
replace: (m, guildId) => `${m}$self.handleMute(${guildId});`
look at that plugin
I will
give me one second
{
find: ",acceptInvite:function",
replacement: {
match: /INVITE_ACCEPT_SUCCESS.+?;(\i)=null.+?;/,
replace: (m, guildId) => `${m}$self.handleMute(${guildId});`
}
}
do you know regex?
Not really
At least not in other languages
only odd ones. So I only understand the concept
you need to know the basics to make one to work with vencord
btw \i is a special vencord thing to match variables names
It gets transformed into something else before matching
$self is a reference to the plugin obj
I don't want to ask you everything, don't wanna bother so much
you use it to access functions you define inside the plugin obj
What I'm most confused about is this line /INVITE_ACCEPT_SUCCESS.+?;(\i)=null.+?;/,
and this (m, guildId). Is this supposed to be the borrowed variables?
m is the whole regex match
guildId is my first capturing group
thats just a function that returns a string
now the first line is a regex
right
match the text INVITE_ACCEPT_SUCESS literally, keep going forward until you find ;someVarName=null<MORE CODE I DONT CARE ABOUT>;
so I would need m no matter what
someVarName is put into a capturing group
that's our guildId
m would be that whole match, from INVITE_ACCEPT_SUCCESS to the last ; expected
so the match
alright
so say I want to observe a variable
the one that is returned with getUnreadCount
actually wait no
Sheesh this is very complicated
okay i think i know what to ask
So then, how can I add an event that will call a function whenever a new channel is oppened
it's complicated but extremely powerful
well you dont even need a patch for that
thats what I thought
FluxDispatcher has an event called CHANNEL_SELECT that gets fired when you select a channel
Thing is, I only want to read an event and observe a variable
aight
on channel selected:
- set `unreads_amount` to getUnreadCount()
- clamp `unreads_amount` to 50
- get messages
- get last *unreads_amount* amount of messages from messages
define `organise_messages()`:
- blah blah blah
- return x, y
define `add_popup()`, with info `messages`:
- get `x` and `y` calling `organise_messages(messages)`
- create the popup
- display `x` and `y`
pretty much that
It's hard for me to help you on mobile but you need no patch for that
You can do all that on the FluxDispatcher callback
FluxDispatcher.subscribe("CHANNEL_SELECT", (...args) => ...);
and to get the unread count use the function from the ReadStateStore (I think that's the name)
I updated the message, I think that is also important to determine what I need
I haven't seen any plugins that have a popup
or messages from vencord itself asking to update or could changes
but not a static popup that can be closed
what kinda of popup
modals?
I think modals are what you want
look at the settings of some plugin
if models don't annoy the user and simply provide information then yes
is that what you want?
what plugin?
any plugin
click the settings button
on any that have
dont think it's what you want though
only thing i can find is plugins that add something to the existing UI
nono I mean
go to your discord settingsp
plugins tab
and click on the settings of any plugin
wait shit i dont have gimp installed
oh like that? No not really, since that hides a lot of the screen
hmm
closest thing I can think is notifications
you can put a custom component on them
not sure how big it can be though
could I add another tab, kind of what discord has done with their "Hide/Show User Profile" or even the member list
on dms
wait now that I think about it
can I also try making a command to test it?
and maybe run that command, or set a setting for it
like those custom commands that where Clyde answers
bro what is your theme
Look like material theme
[Reply to:](#🧩-plugin-development message) bro what is your theme
Or fluent thme
One of those names I think
I am a liar
Material theme
I was in fact not a liar
where can i found
In better discord
thx
What linux distro are you using? (If thats linux)
Would there be any way to have the Close DM context menu button initiate a prompt asking for confirmation in CSS, or would it have to be a plugin?
For reference
ah alright
Fedora 38 - gnome 44.
Blur my shell with much more transparency.
well it can kind of
display: none
but that's kind of useless
fwiw all the conversation history will come back when you open a dm with someone again
yeah but I can’t access that dm unless I know the user’s ID
if i close it
How does it suck?
you can get this look on any distro
personal preference. I just dont like how it looks
its just gnome lmao
It looks just like Chrome lol
I dont use chrome 😄
:T
edge is just microsoft chromium
:TSInstall
chrome is just google chromium



