#š§©-plugin-development
1 messages Ā· Page 6 of 1
I am just having fun rn loading all users
there is also a small margin/padding that looks weird if it's not loaded yet

I don't know about ratelimites there but they seem to be pretty high (aka not strict) so maybe adding a option that it fetches the first page of all reactions of a message (if uncached) to display the pfps
should probably not show reactions when there's more than <max> reactions on the same reaction and if more than <max> reactions on the same message
Speaking of the cache, there's a plugin to fix invalid-user for Aliucord
Someone should do that for Vencord

Unless that's not much of an issue on desktop
yesyes load up 20k members to cache every single user who reacted on one message
š
it can be way easier than that
Pretty sure it's not a desktop issue 
what the aliucord plugin does (and the old bd plugin) is attempt to cache the data of a mentioned user that wasn't already cached not the entirety of a server

Yeah ik
And then it'll stop getting updates because ven forgor
doesn't hovering the tooltip show names of who reacted
did u reply to the wrong msg or
oh you mean validuser
yeah

How's the vencord support for armcord going
Gone
Is it just like the web extension

Good
for whoreacted if u hover a message it fetches users
Ah
Yop
can't u do funny math

What
u can get reaction count and u display max four users
I guess, but the installation is automatic
20 reactions show 4 users +16
nice
I'm gonna install armcord on my usb drive beacuse official discord client is just too fat
and I don't feel like using browser discord

is armcord on scoop outdated
I love scoop
make a release now @fierce tendon
armcord code is absolutely wild
You mean the lack of empty space between lines?
i am directing the rewrite
I don't get why legcord uses Python
that and also just very hacky lmao

it works⢠though
that's all that really matters
Yeah
Using webview or tauri sounds like a better idea
didn't read the code

It launches pywebview but why
More like didn't read description 
"should've used webview!!!"

what do you mean 
it's not tho
it doesn't explain why it uses a python script to launch
Yeah
This was my main question
what
Guhh
python uses insane resources so using a wrapper script with 2 lines of python will waste loads of resources for almost nothing
Because fridge is python and js codemonkey
YES YES USE RUST USE 26854 CRATES FOR 3 LOC

looks like nim can import C(--), so it could just import libwebkit.h or whatever tf there is and call it from nim
and yeet python
Yeah
This server is rustphobic smh

you are ruststruck
Kyirocord will feature only rust wasm code
I love installing a bajillion crates
that python lib just wraps this https://github.com/webview/webview
so instead import this from nim and you can yeet python entirely

That library has an actual nim wrapper
Nim bindings for https://github.com/zserge/webview - GitHub - oskca/webview: Nim bindings for https://github.com/zserge/webview
@fierce tendon immediately
tbh using tauri would still be better than using python
YOU ARE INSANE

tauri is very poopy
(I never actually used tauri btw)
someone on this server I don't remember who tried tauri and it literally used more ram than electron
I only used wry if anything
Looked like peepo Hitler at first 
š
it's literally just so unnecessary
or was it tao
the fucking window creator
it's a WHOLE electron alternative
no it's good
dioxus-desktop uses it
Insanity
horrid
won't work
it uses ie11 on Windows lmao
there's no modern webview bindings for nim

cuz webview changed to C++ and now nim doesn't play with it well

there were attempts but they're not cross platform
legcord just uses pywebview lol
it doesn't import automatically
Well semi automatically
If you want to make a wrapper lib you need to hook up nim functions to C functions
it's a bit of work
there's a thing that does it automatically but it's in alpha iirc

look above
How much is the actual executable though
debug is 69.5mb
Guhh
And release?
What about release
release is 13.5mb

wtf
granted it can be less
yeah crates take so much space
I'm no longer a fan of tauri
it's not for this
dioxus still cool though
mainly dioxus-desktop

also this is https://github.com/tauri-apps/wry you can't actually do that with tauri
world if cef was optimized

average rust project
time to fork cef and optimize it
actually with all this fame on electron i donāt get why they havenāt made their own shit lazy mfs
or at the very least optimize cef
yeah i think itās down right laughable that the only company with bearable cef is riot games
itās also so stupid how electron keeps on āoptimizingā their project while cef is the main issue, this is like āokay guys my game runs on 16fps seems like i canāt aim so im getting a new mouseā

lol
Already thought that this looks weird lol
dunno if it is my theme, but why member since showing in user accounts
discord feature
actual braindead discord moment
Done this, not sure what I can compare them to though (if anything)
Or.. Could do that if all are new, then none are new, as it's impossible that they're all new
yes do that
is anyone already working on dynamically installing userplugins?
cause i wanna do that rn with @shadow ruin
and they dont know if anyone already did this
(also when firefox support)
when you marry m,e
i think i did an oopsie and didn't add the key to the components
will fix
can you pull and git checkout fix/plugin-list-keys & rebuild and tell me if it fixes?
poggers
i will blindly merge this inconsequential change
theres an open pr
ven beat me to it
u can finsh it
i have arrived
guhh why are u p*lish
Could you merge https://github.com/Vendicated/Vencord/pull/234
So I don't have to worry about fixing conflicts
@dull magnet how find props if idk their name 
can't 
what module do u wanna find
I should finish my client modding crash course
I'm curious how SpotifyAPIMarker was found
BC it's nowhere to be found in Discord's js
Oh
Lol
That makes more sense


I got confused BC of that
basically I needed to patch that module anyway because it doesn't have post
so I just also added my own marker so it's easy to find
I'm used to aliucordrn's plugin thing
Don't get confused by something appearing BC of regex patch

wtf
what thing
oh u mean monkey patches
Ye
yeah ig regex patches can be confusing because we're literally rewriting discords code

Ye
Injections are so much better than regex patches in statically typed languages
But swc + dynamic language + need exported to patch
monkey patching in discord swc is horrid
That's why I was confused where SpotifyAPIMarker appeared
I didn't pay attention to regex patches last night when looking at it.
me when js before(mod, "Wx" () => {})

What did u fix 
and don't forget everything is a getter so now u need to patch webpack to make them not getters but then that breaks things because if something is initialised later its ultra pain
lmao wdym
Lmao
Me when breaks every variable update
You love 
Well it's solvable by doing one of
const [mod, key] = find(...)
findAndHook(filters.byCode(...), ...)
but still it's not the same
ohhh
yeah just make the patch also add delete

Yeah, it's not great.
why do u even need to do oauth
Scopes
lol
user-library-modify and user-library-read are the scopes that are needed to save/read saved songs
so people need to reauth
Ye

meowdal




@dull magnet does regex patching replace all occurences 
well more like how the fuck can i check if my patch happened or not

only the first
if it didn't happen, it would print in console
you can also find the resulting code in one of these if it patched successfully
xd
You can just search Patched by PluginName
could be patched by more than one plugin
ye
the easiest way to find how ur patch looks is to just search for the code ur patch inserts
but also just use Patchhelper lmao
it shows u nice diff and stuff 
yeah, I used PatchHelper 
I can't add /g there tho

pog
no more console spam

source maps still useful to have sourcemaps for vencord
what if
intercept requests with electron
if request is for discord source map return empty string

so it doesn error
ah
true
I was trying to patch the emote picker experiment 
to attempt to revert big emotes
but doesn't work unfortunately, ig it's gotta be done on css
or patch discord's component for emojis

WIP console filter to hide spammy/useless messages, I will update this whenevr I add smth new annoying (or reply with ur own addition)
-/load\ssource\smap/
-/\[DEPRECATED\]/
-/render\swindow/
-/\[Violation\]/
-/Deprecation/
-/GET.+404/
-/status of 404/
-/duplicate\slistener/
hm?
what
all goes in 1 line ig
fail
you need spaces
-/Deprecation/

i added spaces at the end of each line so it copies properly
wha show
unfailed
i already have [DEPRECATED] doesnt that work
oh that lmao
done
pog
could also add 404 and similar errors
added 404
nice
I added this bc of the massive [READY] log for it
where
disable verbose level or disable gateway log xd
Usually the onChange callback has a boolean parameter
I kinda think this should be a toggle and not a checkbox
Like, the text to change
checkbox good
Also, do you hate the Spotify client that much?
You'd rather use discord to control it?
Inb4 someone embeds discord within the Spotify client using spicetify
SpotifyControls is really good because you don't have to have the spotify electron client in foreground
I wish I knew what CEF is
<Menu.MenuCheckboxItem
id="foo"
label="foo"
checked={checked}
action={setChecked}
/>```
So like a lite version of electron?
(In comparison I mean)
still the entrie chrome is running
slightly
not by much
id rather have everything that's possible as a pwa (in a perfect world)
that way only 1 main chromium process runs for most apps
and not 10 different ones
new tab is faster than a whole new Browser
I don't like PWAs bc often enough, you can't export your data
And if you change your browser nothing can be transferred over
nico you can swap the checked and unchecked checkbox svgs for the button no?
sorry heart
Linux also has qt web engine and smth from GTK as well
ok
Since discord already uses native code + js
Why not use tauri?
Native code for the overlay, dunno about any other place
Even tho I advocate for them
It still feels kinda early
there is wdym
show code
wha
if you need that then using a discord component isnt the right approach
make a custom component
function MyCustomitem() {
return (
<Flex>
<Forms.FormText>Like</Forms.FormText>
<Svg />
</Flex>
);
}
<Menu.MenuItem
id="idk if u still need this"
label="still dunno"
render={MyCustomItem}
action={isThisStillUsedOrShouldYouJustMakeUrOwnOnClickIdek}
/>```
smth like this iirc
@dull magnet can we please bundle a library?
Like Mantine or AntDesign
I really like Mantine's hooks
I really love Mantine
Been using it professionally since September
thats a github moment actually because git does recognise you moved a file and edited it
youve chaged too many lines so it thinks it a new file
for?
you deleted ts file and created tsx file (for git)
git recognises renames, but if you change the file too much it doesnt :P
like cloudburst said
original is 205, new is 295
yes
Git is just basic
UI shit
Fancy meeting you here
hi
Hi
tbh i forgot u where talking about venmod in #870761489101901954 b4
Lmao

@dull magnet the plugin settings modal has two buttons for exiting
One is "exit w/o saving" and the other is "save and exit"
Why not name the first one just "exit"? It is kinda obvious that it does not save since there is another button for that
Well, my concern is not that, it just looks ugly
And I gave an actual reason for why it could be renamed
Name the first one cancel 
usually alt+f4
it also could be win+m
or win+L
f12
thatās web
theme issue likey
@austere gulch

Cancel - Save & Close
option 3
that one

@austere gulch INSANE
just make it save
tf
save and cancel
like
save | cancel
this is the same thing that windows does with OK, Cancel, and Apply on all of its billion dialogs
and no one knows the difference between Apply and OK because everyone still clicks apply before OK
functionally no one will cry if it's just save
apply and ok imples save and continue and save and close
it's all ambiguous, yes, that's the point I was trying to make
same
wha
show code lmao
why are their weird question mark boxes
gotta use funny arrow function
I see, probably there's a base item you should use
try to find an instance if discord using a custom item in the code

should help you find the right item
I'm trying to understand what's going on in that emoji
side view with u sitting?

wtf is LodashWrapper
i think the plugin with custom messages for startup is my favorite
okay i was about to
how do i encode/decode the xor thingy hto
i know the key but what to run
you mean like /uwuify?
aahh
you run the xor func guhhhh
xor goes both ways lol
good
xor = function(quote) {
const key = "read if cute";
const codes = Array.from(quote, (s, i) => s.charCodeAt(0) ^ (i % key.length));
return String.fromCharCode(...codes);
}
u can run xor('whatever') and it'll return the xor'd version
if u run xor with the xor'd version, you'll get back the original

ven will 1984 this because yes


yeah just run the message through the function 
yop
const quotes = [
"Eyrokac",
"Rdcg$l`'k|~n",
'H`tf$d&iajo+d`{"',
"Sucqplh`(Eclhualva()&",
"Lncgmka'8KNMDC,shpanf'`x./,",
"Ioqweijnfn*IeuvfvAotkfxo./,",
'Hd{#cp\x7Ft$)nbd!{lq%mig~*\x7Fh`v#mk&sm{gx nd#idjb(a\x7Ffao"bja&amdkge!RloƬkhf)hyedfjjb*\'^hzdrdmm$lu\'|ao+mnqw$fijxh~bbmg#TjmƮefd+fnp#lpkffz5',
"h",
"sijklm&cam*rot\"hjjq'|ak\x7F xmv#wc'ep*mawmvvlrb(|ynr>\"Aqq&cgg-\x7F ugoh%rom)e\x7Fhdpp%$",
'Tnfb}"u\'~`nno!kp$vvhfzeyee"a}%Tfam*Xh`fls%Jboldos-"lj`&hn)~ce!`jcbct|)gdbhnf$wikm$zgaxkmc%afely+og"144?\'ign+iu%p$qisiefr gpfa$',
"Ndtfv%ahfgk+ghtf$|ir(|z' Oguaw&`ggdj mgw$|ir(me|n",
"(!ͣ³$ĶŹ'ͩ¹#",
"(ļ¾āćā,ļ¾-2ャļ¾ā¬",
"Ynw#hjil(ze+psgwp|&sgmkr!",
"Tikmolh`(fl+a!dvjk\x7F'y|e\x7Fe/,-",
"3/3750?5><9>885:7",
"mdmt",
"Wdn`khc+(oxbeof",
'Ig"zkp*\'g{*xolglj`&~g|*gowg/$mgt(Eclm`.#ticf{l*xed"wl`&Kangj igbhqn\'d`dn `v#lqrw{3%$bhv-h|)kangj_imwhlhb',
"Tscmw%Tnoa~x"
];
function xor(quote) {
const key = "read if cute";
const codes = Array.from(quote, (s, i) => s.charCodeAt(0) ^ (i % key.length));
return String.fromCharCode(...codes);
}
for(var i in quotes) console.log(xor(quotes.at(i)))
ez

is this the key they actually use
what
I will implode
oh I remember hearing discord also xors their quotes
do they?
they don't I think
lol
Idk
average vencord contributor spreading misinformation
thought u was talking about vencord not discord guhh
im retarded

@dull magnetcheck my pr before I go sleep again š
Implod
is this fine then or what should I mark the type as lol
omg I forgot sorry
I wish github had a way to disable the "pull requests from first time contributors need manual approval for workflows"
who cares if someone mines bitcoin in my repo

let them get the bag
who makes bit coin mining plugin
that's literally why they added that workflow approval lmao
lol
less CI minutes for you i think

because people would pr bitcoin miner workflows to random repos and mine bitcoin with their ci minutes
cause ci minutes are limited for some repos
idk I have infinite?
oh?
so idec
doesnt the ci run inside of your fork instead of the main repo?
ven github edu or smth?

why don't u have infinite
idk
btw how do u check that
lmao
š
GitHub Actions usage is free for standard GitHub-hosted runners in public repositories, and for self-hosted runners. For private repositories, each GitHub account receives a certain amount of free minutes and storage for use with GitHub-hosted runners, depending on the product used with the account. Any usage beyond the included amounts is controlled by spending limits.
ah
public repos have no limit
bitcoin mining in public repos it is
@dull magnet bitcoin miner added 
@dull magnet check dms for new loading quotes i wrote to approve them before i xor them
epic miner
btw why is it called messageTags
wouldn't customTags make more sense
no
vennn pls check epic and cool loading messages
because those are tags for messages
and not a custom "Montag", "Dienstag" etc
this is totally not an excuse
and then there is Mitwoch
can u change ur bio to "I am the official discord. everything I say should be taken literally and I truly mean it. I am a threat to society"

I certified mod in my server told me that I get germinated for using discord so thats why I added that lmao
lmaoo
certified mod as in discord mod badge?
btw how do u even call urself discord, I'm pretty sure they block that word from nicknames
do u have some funky characters in there
it's only a nick on the server, maybe it's not checked then

I just entered it on mobile
no they dont even block in Nicknames
only bots, user-usernames and webhooks
oh only bots
that's been around for
ages
the annoying thing is you cant set the expiry
it's just always a week
you can only make it for yourself
there's a vencord plugin to create them
@dull magnet ^
NO
CLOSE AND FORGET IMMEDIATLY
I'm kidding
I'm at school
explde
you should enter your token manually after every restart and store randomized in memory
lazy
only people that have access to that is ven and you
yeah ig
mistake
HOW DOES THIS WORK
AND WHY DOES THIS WORK
oh that reminds me of you send a link to a message in a public server clicking the link joins the server without confirmation š
its even worse when its not a redirect
discord is insane
Wait what
So there's no ui for this I assume
is it experiment or something
veval explod
nop
fix
veval console.log(process.env)
nop
veval console.log("uwu")
undefined```

it doesnt even give u console output
i actually have fake console for eval
but was too lazy to format output
veval console.log
[Function: bound _log]```


You will explod
veval console._formatLines
undefined```
oop
veval "ba"+ +"tman"+"a"
'baNaNa'```
veval 120394871230984712309487120394817230948 + 123904871230498123740918237409
nop
nop
real
@dull magnet better lazy scrollers when
veval 120394871230984712309487120394817230948n + 123904871230498123740918237409n
120394871354889583539985244135735468357n```
context: #1015408930060501033 message
there's not really a way to make them "better"
that's just the way they need to work
dynamically sized items are hard to lazily scroll accurately
here's what i've come up with for a translation loader thingy https://github.com/Vendicated/Vencord/pull/257 @green vessel @dull magnet
cuz i own cloudstream.cf domain
veval explod
vexplod
return [4, r.Z.get({
url: v(t, e, i),
query: {
limit: a,
after: o
},
oldFormErrors: !0
})];
s = l.sent();
n.Z.dispatch({
type: "MESSAGE_REACTION_ADD_USERS",
channelId: t,
messageId: e,
users: s.body,
emoji: i
});
explod
wtf
pain
i hate ui i hate ui i hate ui i hate ui i hate ui i hate ui i hate ui i hate ui i hate ui i hate ui
@dull magnet hi idk how react works well, I open the modal but I also want to use an async value for the dropdown default, how would I do that
this is my current code I just tried, but it doesn't work because "Hooks can only be called inside of the body of a function component"
https://hst.sh/qexukaceze.tsx
either put the fetchPronouns above the openModal and use regular await or use openModalLazy with an async function (you can find examples in code i think)
Oh I'm dumb
I thought I tried putting it outside the openmodal but I actually didn't so it still errored
Do those both do the same thing, only open modal after it's fetched
yes
function openModalLazy(modalFactory) {
modalFactory.then(openModal)
}
this is literally all it does
anyway you can just do
openModal(props => <PronounModal {...props} userId={userId} />)
then inside that use hooks like usual
guhh whats the point everyone on the internet is he/him anyway 
there are no women on discord š„±
counterpoint: the entire quiltmc discord server
who cares about quiltmc only good thing they made is that quiltflower thing
this server has more trans girls than males probably

and also other girls but they seem to be a minority at least in the active people I know

soon cloudburst will use she/they pronouns as well

(they put estrogen microplastics in the tap water in warsaw)
its bc you keep filling water supplies with estrogen
good thing i don't drink water
mm estrogen
Accidentally put too much, it was supposed to just turn the frogs gay
I kinda wanna add a plugin just because I wanted it but i'm too lazy too at the same time
do it 
Lmfao
laziness
my status
i just realized there's no proper theme system
can you add
-/Fetch(?:ing|ed)\s\d*\s{0,1}messages/
-/Gap\sdetected\sin\sread\sstate/
@dull magnet can i submit multiple plugins in a single pr
I'd rather u do one pr per plugin

do you want us to tell you about the plugin before making it or
what is the $&, part
also you're using js regex right
making sure
wtf, inspect doesn't prettyify the sources anymore
$& inserts the entire match
oh would've been nice to know earlier 
I've been wrapping everything in multiple layers of groups
trolle
ye I did that too before I knew about $&
bruh simplemarkdown is messing up my head
i can't figure out how to style any of it
because there isn't any react shit
fuck
lol
Does anyone know what optimistic function?
https://github.com/Vendicated/Vencord/blob/main/src/plugins/moyai.ts#L28-L34
**moyai.ts: **Lines 28-34
interface IMessageCreate {
type: "MESSAGE_CREATE";
optimistic: boolean;
isPushNotification: boolean;
channelId: string;
message: Message;
}
from some debugging it looks like it means the client sent the message
more specifically i think its an event fired from the client to itself when it sends a message
rather than a message_create from the gateway
does that include interaction (slash command)?
yea basically an 'optimistic' event is the event for when the client has initiated something but hasnt gotten a response from the server yet. eg: when ur message is first grey when u press enter
hm i dont think so but i can see if theres a dispatcher event for that
what are you trying to do?
Just wanting to know if optimistic is necessary for my plugin.
that helps me none
Optimistic is right after the client sends the message, yes
So that grey message before it's actually sent
So if my plugin only receiving dispatch (editing it later) and no connection or whatsoever for sending message, then I guess is not necessary?
it really depends on what you're doing
im not sure if u mean ur trying to edit a dispatch as it fires, or if ur just trying to grab data from dispatch
if ur trying to as it fires, theres likely a better way to do what you're trying to do
I'm trying to edit the data (appending author object to new message)
do u want to edit the data if the original author is the currently logged in user
if so, include optimistic events
if not, exclude optimistic events
So that means optimistic checking is actually not necessary in this plugin?
https://github.com/Vendicated/Vencord/blob/main/src/plugins/moyai.ts#L63-L76
**moyai.ts: **Lines 63-76
async onMessage(e: IMessageCreate) {
if (e.optimistic || e.type !== "MESSAGE_CREATE") return;
if (e.message.state === "SENDING") return;
if (Settings.plugins.Moyai.ignoreBots && e.message.author?.bot) return;
if (!e.message.content) return;
if (e.channelId !== SelectedChannelStore.getChannelId()) return;
const moyaiCount = getMoyaiCount(e.message.content);
for (let i = 0; i < moyaiCount; i++) {
boom();
await sleep(300);
}
},
wait nvm, I get it now.
those if statements just make sure the boom sound doesnt play if the client is sending a reaction / message
that way if you end up not being allowed to send the message / react, it didnt play a boom for no reason
Does anyone know how to fix this typescript error?
I deadass know for sure that getCurrentUser are returning avatarDecoration key. (image 1)
I tried to change the type to UserJSON (idk why i did this) and got this error. (image 2)
ps: i have 0 knowledge about typescript
i think the vencord typings are just outdated, avatar decorations havent been in stable for long i think
make a pr, ps: the type would be avatarDecoration: string | null
vencord typings or discord-types?
if u ctrl + click getCurrentUser you'll find the typedef for that method
then u can ctrl + click the User return type
and you'll find out what is defining it
it looks like its coming from discord-types, and the repo looks kinda dead
@normal forge try this as an easier fix:
type UserWithDecoration = User & { avatarDecoration?: string | null };
const userData: UserWithDecoration = UserStore.getCurrentUser();
Thank you!
wouldn't
interface UserWithDecoration extends User {
avatarDecoration?: string | null
}```
be the same thing but easier to understand?
np! also heres the docs for that https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types
genuine question cause im bad at typescript too
nah it is the same thing, im just more used to using the type keyword
fair enough
it just makes more sense to me because interface just has extends keyword
but with type i can think in terms of any operator / generic
it depends on who you ask ig
yea its just preference
i think i only prefer interface when im trying to overwrite a type
but you could probably catch me doing it anyways, the golang in me escapes sometimes
it is very much needed because otherwise you get multiple booms for local messages
when you send a message, the client immediately dispatches an optimistic event even before the send succeeds. this is to render the greyed out pending message. then once the send succeeded it sends another event for the exact same message that isn't optimistic. so without the optimistic check it'd trigger twice
lol i missed that condition but thats obv a much more valid reason
vapo why did u do child src instead of worker src in ur armcord pr? what's the benefit of that other than allowing iframes which seems kinda unsafe
lolz
discord doesnt set worker-src, so it falls back on child-src
i could just make another set for replaceoradd policies though
would probably be a lot better to use something like https://www.npmjs.com/package/csp-parse instead of regex replace anyway
deprecated 
oh wait what
**index.ts: **
interface PolicyResult {
[key: string]: string[];
}
export = (policy: string): PolicyResult => {
const result: PolicyResult = {};
policy.split(";").forEach((directive) => {
const [directiveKey, ...directiveValue] = directive.trim().split(/\s+/g);
if (
directiveKey &&
!Object.prototype.hasOwnProperty.call(result, directiveKey)
) {
result[directiveKey] = directiveValue;
}
});
return result;
};
it's super easy to parse
cookie style
could just do that and do it properly instead
i think its literally
like parse, modify, join
just space
wew
šš
everything for you <3
Lol
formatting commit
Help, you did the thing for chat components help
le fishe
Yes
rule #1: no illegal content
Ven: exists
rule #1: sweats
TL;DR Ven is illegal content
rule #1: Shiggy
rule #2: Explode
rule #3: Listen to mods (usually)
rule #4: Donāt be stupid
rule #5: shiggy
shiggy wiggy
react hooks are being very weird
i have loggers here
and one right here
so the null null is when it tries to highlight before shiki has loaded
so there is no theme
and then the next log shows that its not ready because there is no shiki language def either
and then once shiki does init (loads langs and sets initial theme)
it updates the codeblock, currentThemeId has changed
which is one of the useEffect deps
so im wondering why the effect isnt being called again
also i forgot to commit this but, the only difference between my screenshots and the git file is that i changed ready from () => boolean? to boolean?
i'll commit it rn cus why not
@trail ginkgo help with role-color everywhere
there's no react part to replace it with
I just need to update the style š
none of them have a react
wait what are u doing again
role color everywhere š¤¦āāļø
for vencord...?
role color everywhere replugged plugin
id is 258631
oh i see
cause I messed around a bunch with simplemarkdown before
that function is Vencord.Webpack.Common.Parser.defaultRules.mention.react
ok
regex patch tho
can I add custom css
based on this it looks like it might also return type text so Vencord.Webpack.Common.Parser.defaultRules.text.react would also be relevant
yeah u can use css
for now there's no native support so you'll have to just create a style element and set its content to a css string
but there's a pr for proper css support
{
find: 'className:"mention"',
replacement: {
match: /react:function\((.),(.),(.)\)\{/,
replace: '$&return Vencord.Plugins.plugins.YOURPLUGIN.exposedRenderMethod($1,$2,$3);',
},
}```
it is
and then in ur plugin object exposedRenderMethod: (node, output, state) => { /* logic */ }
cause usually discord uses funny mangled classes but seemingly not that time :P
that's replace, not after or before
yes
oh yea i see urs does after
yes, but I have to do what it does
but I have no idea what any of those functions are
in this
u could add a param
look at mine, more up to date
it's a fork
thats a little messy
im not sure if theres a good way to do after patches
feels like you'd need bracket balancing
wait what
oh shit
I never realized that it used simple markdown
i thought it used injection
oh i thought u wanted to do that with regex replace
looks like it wraps the return value in a span and adds a classname
send me link rq, i'm too lazy to find it myself
i don't really get the point of the entire wrapping stuff
it didn't really work without it iirc
cause u could just modify the original element
didnt u say it could be text too
// before
react: function(e, t, n) {
var o = e.userId
, i = e.channelId;
return null == o ? (0,
r.jsx)(k, ne(te({
inlinePreview: n.formatInline
}, e), {
children: t(e.content, n)
}), n.key) : (0,
r.jsx)(X, {
className: "mention",
userId: o,
channelId: i,
inlinePreview: n.noStyleAndInteraction
}, n.key)
}
// after
react: function(e, t, n) {
var o = e.userId
, i = e.channelId;
return null == o ? (0,
r.jsx)(k, ne(te({
inlinePreview: n.formatInline
}, e), {
children: t(e.content, n)
}), n.key) : Vencord.Plugins.plugins.RoleColorEverywhere.Mention(e, (0,
r.jsx)(X, {
className: "mention",
userId: o,
channelId: i,
inlinePreview: n.noStyleAndInteraction
}, n.key))
}






