#🧩-plugin-development

1 messages · Page 1 of 1 (latest)

lone panther
#

first

green vessel
#

first

austere gulch
#

first

dull magnet
#

fuck yall I was first

#

deletes all messages except mine

green vessel
#

second

wanton sierra
#

69th

dull magnet
#

hejekemeshsjske;;[. wiwowjwoemw.. wwiwi

faint swan
dull magnet
#

treble

faint swan
#

yes

#

thx

faint swan
#

yes thx

amber mantle
#

70th

vapid latch
#

oh hey dev channel now pog

cedar olive
green vessel
#

when development isnt in nerd corner 😔

vapid latch
#

i could move it but idk if ven wants me to

#

exterminated where microsoft edge string go

oblique prairie
#

I l o ve beung drunk

#

I just spend 15 mij

#

Figuring outnwy i couldn't dm someonr

#

Turns out

#

I jihad d I Spotify oprn instead of discord

#

💀

proud cargo
#

(((that j was on purpos)))

dull magnet
green vessel
tropic torrent
green vessel
#

no

tropic torrent
#

ok it ddidnt then

dull magnet
#

should I make a gay porn chanel

tropic torrent
#

lesbian porn

#

i need some material

green vessel
dull magnet
#

y

#

kinda gay, brother

green vessel
dull magnet
#

Also I lied there wasn't any but I have plenty of it bookmarked lol

green vessel
#

bro really sent

dull magnet
green vessel
dull magnet
#

me

green vessel
tropic torrent
#

lick feet

slow charm
dull magnet
surreal lark
#

what has this become

green vessel
slow charm
#

development

dull magnet
#

no proof

slow charm
green vessel
slow charm
#

is coffee

tropic torrent
#

ass

#

nice

green vessel
tropic torrent
#

ay neko maid

simple folio
stuck falcon
tropic torrent
#

im in class brah

stuck falcon
#

fair

oblique prairie
proud cargo
slow charm
proud cargo
slow charm
#

no

wraith carbon
#

What if plugins had a "NEW" badge when they're added, just for a few days/weeks?

opal fern
#

why tho

#

that would be annoying as fuck to implement, plus if you wanna know if a plugin was added just look at prs

wraith carbon
#

because I'm too lazy to look at PRs

#

lol

#

It's relatively simple, I just did it in a few minutes

#

The complicated thing would be to do it automatically

dull magnet
#

it's not that hard to do automatically

wraith carbon
#

I got this far

dull magnet
#

check the files stats to see when it was created

wraith carbon
#

but adding new: true

wraith carbon
#

but if someone just installed vencord then all files will be new

#

no?

dull magnet
#

just compare

#

or make esbuild do it

lone panther
dull magnet
#

no

lone panther
#

yes

wraith carbon
#

lmao

austere gulch
#

git diff --name-only

#

look for ones in plugin folder

#

ezzzz

#

Well we're trying to avoid git actually so nvm

wraith carbon
#

oh

austere gulch
#

just stat the file lmao

wraith carbon
#

alrighty

austere gulch
#

fs.stat or whatever

wraith carbon
#

let me see if I can do this

#

first time using ts properly and it's fricking annoying

#

lol

cedar olive
wraith carbon
#

I just need to get used to it

cedar olive
#

it's very simple

austere gulch
#

ts good

cedar olive
#

ts super good

wraith carbon
#

it gives errors because I didn't set type correctly and it's just like uh frick of I know what type it's gonna be

#

it's gonna work.. trust!

cedar olive
#

then set the type lol

austere gulch
#

if you don't know what type it's gonna be then that's pretty bad...

wraith carbon
#

i know what it's gonna be just didn't specify it

#

and it didn't work auto idk

#

I think that interfaces are classes all the time and they're not

#

i'm confused on where to give the plugin an isNew(): bool function someone help me I'm being very dumb rn

austere gulch
#

edit the plugin type in types.ts
the one with dependencies and enabled and stuff

#

put it in there

#

not the defineplugin one

wraith carbon
#

why can't it resolve fs

#

I need a class on ts icl

dull magnet
#

because that's in renderer

#

it has no node

#

patcher.ts & ipcMain/* = main process, this is where you should do node stuff like fs, childprocess etc

preload.ts = node & browser, no need to touch this

everything else = renderer, this runs in the browser process and has no node

#

the way you do node stuff is via ipc

#

basically go into ipcMain and add a handler for an event via ipcMain.handle(IpcEvents.YOUR_EVENT, () => { return "yop" })

#

then u can call that method from renderer via VencordNative.ipc.invoke(IpcEvents.YOUR_EVENT)

#

you can find plenty of examples in the code

wraith carbon
#

ic

dull magnet
#

but also u should do that in the build script

wraith carbon
#

plugin age

hollow inlet
#

is this a general dev channel or just vencord

wraith carbon
#

🤷‍♂️

hollow inlet
#

i'll ask in bd dev then

dull magnet
hollow inlet
#

oh alr

#

(completely mod unrelated) say i have a message with variables i want to fill in, the way i tried doing it (replacing the key names in the content with the value), doesn't seem to work, it just spits out unedited content

const memberVars = {
    author: [author.user.username, author.user.discriminator].join("#"),
    aID: author.id,
    aNAME: author.user.username,
    aCURNAME: author.nick ?? author.user.username,
    aAVATAR: author.avatarURL ?? ""
};
const guildVars = {
    guild: guild.name,
    gNAME: guild.name,
    gID: guild.id,
    gICON: guild.iconURL ?? "",
    gBANNER: guild.bannerURL ?? "",
    gCREATED: `<t:${Math.floor(new Date(guild.createdAt).getTime() / 1000)}>`
};
const channelVars = {
    channel: channel.name,
    cNAME: channel.name,
    cID: channel.id
}
for (let i of [memberVars, guildVars, channelVars]) for (const val of Object.keys(i)) content.replace(new RegExp(val, "g"), i[val]);
return content;
dull magnet
#

what

#

you mean you want to fill in place holders?

hollow inlet
dull magnet
#

Welcome to {GUILD_NAME} {USER_NAME}! You are the {MEMBER_COUNT}. member

#

like this?

hollow inlet
#

something like that yeah

dull magnet
#
const vars = {
   GUILD_ID: 42
} 

"welcome to {GUILD_ID}".replace(/{(\w+)}/g, (m, name) => vars[name] || m)```
hollow inlet
#

hm.

#

ty

dull magnet
#
const re = /\{(\w+)\}/g;
String.prototype.substitute = function(map) {
  return this.replace(re, (m, name) => map[name] ?? m);
}

const s = "Today is {DAY} and the current server is {GUILD_NAME}".substitute({
  DAY: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][new Date().getDay()],
  GUILD_NAME: "trolley"
});```
amber mantle
#

stop talking about BALLER

wraith carbon
#

lol

viral roost
#

how is BALLER

#

unrelated but is a ||= b the same as a = a || b or a = b || a

hollow inlet
#

iirc ||= and &= are bit value things

viral roost
#

oh yeah google exists my bad

dull magnet
austere gulch
hollow inlet
#

oh

dull magnet
#
a ||= b    /* - - - - - - - */  a = a || b
a ??= b    /* - - - - - - - */  a = a ?? b
austere gulch
#

megu ??= min

dull magnet
#

ye

hollow inlet
#

wait

#

could a ||= b even be used in variable assignment?

dull magnet
#

wdym

hollow inlet
#

looks like it's not gonna work if you const a ||= b;

dull magnet
#

?

#

it's a language feature

#

it's similar to +=

#

js just has shortcuts like that for many things

#

normal arithmetic

+=
-=
*=
/=
**=  pow

logical assignment

||=    Assign rhs if lhs falsy
??=    Assign rhs if lhs nullish
&&=    Asssign rhs if lhs truthy

bitwise

&=  AND
|=  OR
^=  XOR
<<=   left shift
>>=   right shift
>>>=  unsigned right shift
hollow inlet
#

^ isn't arithmetic?

dull magnet
#

no

#

^ is XOR

viral roost
#

for pow its **

hollow inlet
#

ohh

dull magnet
#

**= also works

hollow inlet
#

i'm learning more and more about js everyday

dull magnet
#

rhs/lhs = right/left hand side

dull magnet
#

there should also be

<<=
>>=
>>>=
#

yes

hollow inlet
#

the hell do those do? true or false on greater/less than?

dull magnet
#

bit shifts

#

it shifts all bits

#
100110111 << 2
=> 10011011100

1011 >> 1
=> 101
#

you don't really have a lot of use cases for bit manipulation in js so it's no wonder you've never used them

#

though you probably did use them in bot libraries

#
intents: Intents.MESSAGES | Intents.GUILDS | Intents.PRESENCES
viral roost
#

discord loves magic numbers because of bit shifts

dull magnet
#

each bit stands for one flag

#

so you can store 8 booleans in one byte

#

32 booleans in one single int

hollow inlet
dull magnet
#
1      = 00000001
1 << 1 = 00000010
1 << 2 = 00000100
1 << 3 = 00001000
1 << 4 = 00010000
1 << 5 = 00100000
1 << 6 = 01000000
1 << 7 = 10000000
#

here each bit stands for a specific flag so by combining them you can do a custom combo

#

and then later check if the value contains a specific bit with the AND (&) operator

#

you can combine them with the OR (|) operator

#

bitwise is also useful when working with hex numbers

#
const r = (color >> 16) & 0xff
const g = (color >> 8) & 0xff
const b = color & 0xff
cinder wigeon
#

bitstupid when

cinder wigeon
dull magnet
#

there's boolean XOR

#

(it's !=)

viral roost
#

who needs js courses when you have ven

dull magnet
#

bitwise is also cool for decryption

#

xor decryption is awesome

#
function xorEncrypt(data, passwd) {
    const out = new Uint8Array(data.length);
    for (let i = 0, passwdLen = passwd.length; i < data.length; i++) {
        out[i] = data.charCodeAt(i) ^ passwd.charCodeAt(i % passwdLen);
    }
    return btoa(String.fromCharCode.apply(null, out));
}

function xorDecrypt(data, passwd) {
    data = atob(data);
    const out = new Uint8Array(data.length);
    for (let i = 0, passwdLen = passwd.length; i < data.length; i++) {
        out[i] = data.charCodeAt(i) ^ passwd.charCodeAt(i % passwdLen);
    }
    return String.fromCharCode.apply(null, out);
}

const data = xorEncrypt("some very secret private shush message", "some key of sufficient size");
console.log(data);
console.log(xorDecrypt(data, "some key of sufficient size"));
tribal stream
#

Hey i have a quick question im trying to add my own plugin to vencord but in plugins it doesn't show up in plugins tab

#

and i don't see any error in console...

tribal stream
#

oh...

dull magnet
tribal stream
#

i should put that to plugins folder yes?

#

i don't see userplugins

#

or i should create it

viral roost
tribal stream
#

oh ye

#

i see now lol sorry

#

i still don't see my plugin... am i stupid or idk...

viral roost
#

did you refresh discord after building

tribal stream
#

ye

viral roost
#

like from taskbar or ctrl+r

tribal stream
#

quit

viral roost
#

um

#

you sure console's empty

tribal stream
#

i think so only something from spellchecker and spotify my plugin

#

but i had it before

#

too

viral roost
#

yeah you can ignore that

#

check warnings too

#

i'd just show all instead of filtering to only errors tbh

tribal stream
#

ye but still i don't see anything related to my plugin

#

and i don't think it had any error its just a bit modified more commands plugin

#

oh i have it now lol

dull magnet
#

you need to enable ur plugin

tribal stream
#

yes i know that

#

i think i used bad command to rebuild vencord... lol

dull magnet
#

just run pnpm watch

tribal stream
#

oh

#

sounds good

#

thanks for help i will try to do something usefull ;))

#

just wanna ask if really simple plugin that just adds some kaomojis have chance to get accepted?
personaly i like to use them sometimes but searching them isn't really something i like to do :))

regal rune
#

kaowhat

#

this?

tribal stream
#

something like

regal rune
#

(゚⁠ο゚⁠人⁠)⁠)

tribal stream
#

>﹏<

#

yes

regal rune
#

mreow

tribal stream
#

more commands only have lenny so

#

( ͡° ͜ʖ ͡°)

amber mantle
#

you can add to morecommands i guess

tribal stream
#

makes sense

#

but i don't know do i can

#

lol

amber mantle
tribal stream
#

i think adding them in other plugin is better idea not everyone will like to have maybe 10 or more commands like that :))

#

copilot loves to suggest me more kaomojis lol

hollow inlet
#

how to regex

shadow ruin
#

i gtg in a bit but i think i can do a pretty easy explanation

go to https://regex101.com/ and drop in the part of code you want to select,(dont forget to set the flavor to ECMAScript) then just mess around and write shit until you got a regex working

#

its not that hard

near aurora
#

how 2 quick build & inject

#

when making a pr

#

without picking the same discord instance for injecting every time

austere gulch
#

what

#

you only have to inject once

#

lol

near aurora
#

oh so i just build?

#

epic

austere gulch
#

ye

near aurora
#

& restart

#

right?

#

discord

austere gulch
#

just CTRL+R in discord

#

is enough

#

also you can use pnpm watch which will rebuild it automatically when you make a change

near aurora
#

oh nice

#

what would i do to reuse discord's setting icon svg?

austere gulch
#
<svg aria-hidden="true" role="img" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M19.738 10H22V14H19.739C19.498 14.931 19.1 15.798 18.565 16.564L20 18L18 20L16.565 18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069 19.498 8.203 19.099 7.436 18.564L6 20L4 18L5.436 16.564C4.901 15.799 4.502 14.932 4.262 14H2V10H4.262C4.502 9.068 4.9 8.202 5.436 7.436L4 6L6 4L7.436 5.436C8.202 4.9 9.068 4.502 10 4.262V2H14V4.261C14.932 4.502 15.797 4.9 16.565 5.435L18 3.999L20 5.999L18.564 7.436C19.099 8.202 19.498 9.069 19.738 10ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16Z"></path></svg>
#

apparently

near aurora
#

just put it into a react's return thingy?

#

like this?

#

or define as const at top

#

and use interpolation to add it in

#

i don't really use react but i know svelte so im kinda making educated guesses on what to do. im expecting to make some mistakes, so i'll gladly take feedback & edit the pr until it's mergeable

austere gulch
#

that's a component so you can just use it like any other react element

#

you could even do

const SettingsIcon = <svg aria-hidden="true" role="img" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M19.738 10H22V14H19.739C19.498 14.931 19.1 15.798 18.565 16.564L20 18L18 20L16.565 18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069 19.498 8.203 19.099 7.436 18.564L6 20L4 18L5.436 16.564C4.901 15.799 4.502 14.932 4.262 14H2V10H4.262C4.502 9.068 4.9 8.202 5.436 7.436L4 6L6 4L7.436 5.436C8.202 4.9 9.068 4.502 10 4.262V2H14V4.261C14.932 4.502 15.797 4.9 16.565 5.435L18 3.999L20 5.999L18.564 7.436C19.099 8.202 19.498 9.069 19.738 10ZM12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16Z"></path></svg>

and just use it like <SettingsIcon/>

near aurora
#

uhhhh

austere gulch
#

oh

#

const SettingsIcon = () => put the svg here

#

mb

near aurora
#

okay

#

is there a way i can directly use this component? i wrapped it in a button but it's really wide lol

#

i have this but the switch won't toggle

#

do i maybe need to debounce the value assignment or something?

#

@near aurora fart

#

ok

#

epic

#

works

#

still have to somehow fix styling of settings button and switch

#

why the switch so tall lol

near aurora
#

how can i open pr from vs code

dull magnet
#

git

near aurora
#

ye but i need to fork it first and switch to that remote?

dull magnet
#
  • Fork on github
  • Open terminal
# Add your fork repo
git remote add fork YOUR_FORK_URL

# check out feature branch
git checkout -b my-feature

# Add and commit
git add .
git commit

# push to remote "fork" and branch "my-feature"
git push -u fork my-feature


# if you want to pr a second feature

# first, follow the second code block below to get a clean Vencord. You won't lose your first feature assuming you made a new branch for it

# now go to step 2 in this block and just use a different branch

Later to return back to clean Vencord main:

# checkout main branch
git checkout main

# fetch origin (original repo)
git fetch origin

# reset your local clone
git reset --hard origin/main
near aurora
tall kiln
#

guess what

#

wait shit wrong channel

near aurora
#

lmao?

near aurora
#

yes

#

i can remove the border

#

from bottom

#

but idk how

#

also the colors are from my theme

dull magnet
#

that looks kinda weird with how the settings cog is a bit smaller than the switch

near aurora
#

is it

#

oh my bad

dull magnet
#

Also they're basically making out with how close they are

near aurora
#

how 2 remove the border???

#

it's a child in the switch component

dull magnet
#

yeah that's already way better

#

the border on the bottom?

near aurora
#

yes

#

any idea?

austere gulch
#

the border is weird yeah xd

near aurora
#

how 2 remove????? lol

tropic torrent
near aurora
#

i can just apply a css rule on it but crinj

austere gulch
#

uhh

#

how did you even add the divider

#

can you show the source code of the component?

near aurora
#

i didn't

#

i just used the Switch component

#

and the switch component has the border by default

austere gulch
#

okay sec

dull magnet
austere gulch
#

i quite like u too

dull magnet
#

the heart reaction burst is nice

austere gulch
#

owo

#

i dont have bursts

dull magnet
#

its experiment

dull magnet
#

hideBorder: true

austere gulch
#

ah that's why i was confused

#

i was looking at Switch but this is SwitchItem

#

i was gonna say i remember there being a hideBorder sort of thing

near aurora
#

megu ven?

fickle plinth
oblique lark
#

children: any ;)

austere gulch
#

lol

near aurora
#

feel free to fix the "click on card to open modal" bc in the pr only way to open the modal is the settigns icon, i had to remove the onclick so the switch would work

austere gulch
#

to be honest the clicking on te card was a nice side-effect but wasn't actually intended originally

#

thing is

#

we dont want the settings cog on every plugin

#

only ones with settings

near aurora
#

i had it so it shows another icon but it was wierd

#

and idk where discord had an i icon

#

i had this icon

austere gulch
#

could use this one?

#

or does it look weird

near aurora
#

yeah it was kinda wierd

#

like

austere gulch
#

hmm

#

yeah we really want a ( ! )

#

icon

#

or smth

shadow ruin
near aurora
#

or a ( i ) icon

austere gulch
#

yeah

dull magnet
#

yeah change the cog pls

#

owo

slow charm
#

can't u hide if plugin doesn't have settings

austere gulch
#

we just discussed that

#

but also

#

there's a modal with more info about plugins

#

so we'd still need a way to open that

#

good news

#

there's an i icon

#

@near aurora without us having to add the SVG ourselves, we can import from discord using filters.byCode

can get them by searching for:

cog wheel: 18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069

info icon: 4.4408921e-16 C4.4771525,-1.77635684e-15 4.4408921e-16

#

some random extracts from the svg

#

it's unlikely to change

cedar olive
#

someone please help me understand why is handleActivityToggle fired when you over the button and not when you click it

#

install it and it's the second button in the Registered Games tab

austere gulch
#

sure lemme check

cedar olive
#

I'm really trying to reuse this component as much as possible instead of making it by hand trollely

austere gulch
#

@cedar olive nice easy fix

#

basically uh

#

your handleActivityToggle function is run immediately

#

"() => Vencord.Plugins.plugins.IgnoreActivities.handleActivityToggle(gameProps)");

#

use that instead

#

and it should only log on click now

cedar olive
#

oh my god

#

that makes so much sense

austere gulch
#

xd

cedar olive
#

lmao I'm so dumb

austere gulch
#

lmk if it doesn't do what you expect tho

cedar olive
#

aight

#

thanks

austere gulch
#

np

cedar olive
#

perfect

#

just what I wanted

austere gulch
#

:)

near aurora
#

got some example code for searching for an icon like that?

lone panther
#

@dull magnet how call extension api

austere gulch
dull magnet
#

see patcher.ts line 89

#

just add ur own below

lone panther
#

fair

austere gulch
#

meow

dull magnet
#

the weird random string argument to the function is the id

lone panther
#

yeah ik

#

no way

#

witnesses

#

zarn it doesn't work

dull magnet
#

what did u install

lone panther
#

i don't remember if they're enabled by default or not

dull magnet
#

how does it work

#

what does it do

lone panther
#

no goddamn clue

#

replace words

#

with funny xkcd

oblique lark
#

this is amazing im keeping this

lone panther
#

yeah it's great

#

i've been trolled by it multiple times

dull magnet
lone panther
#

literally the link i sent

oblique lark
#

for firefox or chrome

dull magnet
#

for that article

#

the extension does nthing for me

oblique lark
#

oh its just liz truss's wiki page

dull magnet
#

lmao

#

works

oblique lark
#

clapping perfect

#

spaces in url and everything

austere gulch
#

oh @near aurora just realised u might've meant searching for the module

let CogWheel;
wp.waitFor(wp.filters.byCode("18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069"), m => CogWheel = m);
#

should probs work

#

ah wait

#

im an idiot

#

wrong func

#

uhghg i feel like my brain is frying atm

#

ok fixed the code

near aurora
#

and for icon i use the same thing but icon snippet?

austere gulch
#

yeah

#

I'd call it InfoIcon or smth

near aurora
#

where do i put it

#

in webpack/common?

austere gulch
#

nah since it's not used much, just have it at the start of pluginsettings/index.tsx

#

you could use lazyWebpack like these if you wanted

#

and just change the stuff inside byCode to be the SVG stuff instead

#
const CogWheel = lazyWebpack(filters.byCode("18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069"));
#

ig

near aurora
#

no icon

austere gulch
#

huh

#

can u copy paste the code to me

#

i'll test

#

those 2 lines

near aurora
#
const CogWheel = lazyWebpack(filters.byCode("18.564C15.797 19.099 14.932 19.498 14 19.738V22H10V19.738C9.069"));
const InfoIcon = lazyWebpack(filters.byCode("4.4408921e-16 C4.4771525,-1.77635684e-15 4.4408921e-16"));
#

and i just did this

austere gulch
#

hm

near aurora
#

looks like you have to pass the filterfn?

#

or is that optional

austere gulch
#

filters.byCode is the filterFn

near aurora
#

oh

#

it no worky tho

#

still

austere gulch
#

seems to work in browser

#

any error in console?

near aurora
austere gulch
#

oh wait

#

i just saw how you're using it

#

you have to use it like a component

#

{plugin.options ? <CogWheel/> : <InfoIcon/>}

near aurora
#

oh

dull magnet
#

@vital torrent

near aurora
#

lmfao sry

austere gulch
#

you can give it a width={16} and height={16} as a param

#

16 being the size number

#

try making bigger maybe? idk

near aurora
#

i wanted w and h 24

austere gulch
#

then set to 24

#

its 16 by default

near aurora
#

epic

austere gulch
#

owo

near aurora
#

can i add styles to this

#

i wanna do a funny

austere gulch
#

feel free if it looks okay

near aurora
#

what how

#

im confusion

#

where is that

#

what you sent

#

where do i edit

austere gulch
#

hm

#

i mean its your code

#
<Text variant="text-md/bold" style={{ flexGrow: "1" }}>{plugin.name}</Text>
dull magnet
#

what do u wanna style about it

austere gulch
#

just edit the style={{...}}

near aurora
#

nonono i wanna edit the switch's inner wrapper that wraps the text + switch

#

i wanna create what i made in the mockup

#

separate header which has the switch and title + cog

dull magnet
#

huh

#

show the mockup again pls

near aurora
#

border + diff color

dull magnet
#

probbly have to reimplement from scratch for that

#

border is easy tho

#

actualy

#

the switch takes a style prop

#

just pass ur custom style

#
interface SwitchProps {
    value: any;
    disabled: any;
    hideBorder: any;
    tooltipNote: any;
    onChange: any;
    className: any;
    style: any;
    note: any;
    helpdeskArticleId: any;
    children: any;
}
slow charm
#

i like the big button that says enable

dull magnet
#

I like ur mom

wraith carbon
#

toxic

#

omg I did it

#

the new thing

#

it works

#

it's so easy

#

but took me ages to figure out lost

dull magnet
#

what's the new thing

wraith carbon
#

the "NEW" badge

#

for plugins

#

where is the guideline for PR titles (if there is one)

#

I see most prs have feat: x or feat(plugin): x

dull magnet
#

theres none

wraith carbon
#

ah

austere gulch
#

the guideline? explode

wraith carbon
#

explode i will

near aurora
#

i think i don't wanna do the separate header. id have to style the child which im not capable with inline styles on the parent

dull magnet
#

btw

#

this page is super useful

#

i just discovered it 2 minutes ago

green vessel
#

its been there for a few days ven

austere gulch
#

lol

#

it's been on mobile forever

#

quite nice they added to desktop

near aurora
#

ok ven did the thing

#

s

#

wait i broke it lol

#

looks good by me

#

now its fixed ven

carmine nexus
tropic torrent
#

No overload matches this call.
The last overload gave the following error.
Argument of type '(_: string, lang: any, code: any) => void' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'.
Type 'void' is not assignable to type 'string'.

#

pussy

#

types

dull magnet
tropic torrent
#

figured forgor to return string

dull magnet
#

Well no

#

you're not using the result

#

so replace is misplaced

#

use re.exec

tropic torrent
#
function balls(balls: { balls: { balls: { balls: boolean } } }) {
	return { balls: true }
}

#

brah

#

oh wait

#

it did

#

only one error left prettier and prettierPlugins global

#

should i just ts-ignore it

slow charm
#

honestly don't know which i like better

#

the cogs are pretty nice though

slow charm
#

ok the switches are better

wicked panther
#

Me gusta switches

shadow ruin
near aurora
slow charm
#

this is my current quickcss

@import url("https://xmc.c7.pm/modular/scheme/amora.css");

@import url("https://xmc.c7.pm/modular/font/unifont.css");
@import url("https://xmc.c7.pm/modular/textarea/mobile.css");

@import url("https://xmc.c7.pm/modular/9x_bot_tag.css");
@import url("https://xmc.c7.pm/modular/unread.css");
@import url("https://xmc.c7.pm/modular/nyantro.css");
@import url("https://xmc.c7.pm/modular/cozy_compact.css");
@import url("https://xmc.c7.pm/modular/old_roles.css");
@import url("https://xmc.c7.pm/modular/status_icons.css");
@import url("https://xmc.c7.pm/modular/old_titlebar.css");
@import url("https://xmc.c7.pm/modular/hide_tag.css");
@import url("https://xmc.c7.pm/modular/left_reply.css");

@import url("https://xmc.c7.pm/modular/base.css");

/* Hide Gift Button */
[class^="channelTextArea"] [class^="buttons-"] > button {
  display: none;
}
dull magnet
#

hot

#

I wonder if u can load stylus or smth like that into electron

dull magnet
#

because it looks like you're on the clicked hidden channel
that's a bug that should be fixed

#

as for the collapse issue, that's probably because he doesn't check whether the parent is collapsed so shows regardless

#

yeah

#

@thorny solar do u wanna fix the collapsed issue in ur pr as well?

#

it's pretty simple

#
let CollapsedChannelStore;
waitFor(["isCollapsed", "getCollapsedCategories"], m => CollapsedChannelStore = m);

...

CollapsedChannelStore.isCollapsed(channel.parentId)```
#

it might also be parent_id

dull magnet
#

for userstyles

slow charm
#

wouldn't be way simpler to just implement usercss

dull magnet
#

how

slow charm
#

ur the dev

dull magnet
#

if the extension works then that's easiest

slow charm
#

you need to toggle options

dull magnet
#

ig

slow charm
#

idk how cyn implemented it in hh3

#

u can kang probably

dull magnet
#

horror

slow charm
#

real and true

dull magnet
#

lmfao

#

just check channel type silly

#

or only do the collapsed check when the channel is hidden

#

why do u even do it for all channels

ivory turtle
regal rune
ivory turtle
#

is it just quickCSS?

lost geode
#
        {
            find: ".prototype.shouldShowEmptyCategory=function(){",
            replacement: {
                match: /(\.prototype\.shouldShowEmptyCategory=function\(\){)/g,
                replace: "$1return true;"
            }
        },
#

to fix categories disappearing when they're collapsed

slow charm
lost geode
#

what is the || !can(CONNECT, channel); for ?

dull magnet
#

hidden voice chans

lost geode
dull magnet
#

if they're not minified that's fine

#

you can even rely on e

#

since it's always e

#

but any other minified variable names are a big nono

near aurora
#

would anyone who knows how 2 inject react shit be willing to help me make spotify plugin?

#

i could do the Spotify api communication but i need someone 2 help me inject the ui for it

#

basically trying to re-implement SpotifyControls from powercord/replugged

oblique lark
#

is there a way to add an option to a command thats either a number or a specific string
I want to let the user pick a specific thing or randomize it

#

actually it would probably be easier to just add a second option

dull magnet
#

add second option or make it a string and parse manually

opal fern
oblique lark
#

yeah makes more sense

oblique lark
#

ok so im trying to make this xkcd comic fetcher but discord is being super mean about it

obsidian sorrel
#

set the fetch to no-cors

oblique lark
#

ok that works but i messed up even harder now

#

this is the one case when you should turn off the discordo noise

#

ok i also finally figured out how the options are going to work: theres the integer comic and boolean random, and if you use neither it just does the latest comic

#

according to way too much googling its because im trying to parse non-json as json but its literally the xkcd json page??? why is this not working

dull magnet
oblique lark
#

why not

dull magnet
#

well it depends

#

if you want the response in javascript it wont work

#

cause opaque responses dont give u the body

#

if you want the response in say an html img element, that will work

oblique lark
#

so if i wanted to get the response in js how would i do that

dull magnet
#

you can't

oblique lark
#

ok so no xkcd command then

dull magnet
#

does he not have an api with cors policy

oblique lark
#

its just the one api

dull magnet
#

mm

#

tell him to set cors

obsidian sorrel
dull magnet
#

that will work but it's a very ugly solution

#

i could expose a non cors fetch api

#

or anyone else who wants to pr

#

but need to research how to do that in browser extension and won't work in userscript

oblique lark
#

if the image permalinks were done with numbers i could've just used those instead of fetching the json

dull magnet
#

are they not

oblique lark
#

no the actual images are based on the names of each comic

dull magnet
dull magnet
#

although that may log people's ips

#

so it would be way better if you could message the guy and ask him to add cors

#

aired

oblique lark
#

the only downside is that I'm still really bad at typescript

dull magnet
#

im gonna email the xkcd webmaster

#

maybe he will fix it

green vessel
oblique lark
#

in the meantime the vercel.app one works fine

potent fox
#

js users can cope

#

#nocorsforapis

oblique lark
#

ok xkcd-fetcher 1.0 is finally complete (that took way too long)

near aurora
#

@vapid latch sorry for ping but please consider this: porting GM's SpotifyControls to Vencord? (if needed i could do some boring grunt work just i am not able to do it myself)

dull magnet
#

cause ip logger potential

#

we don't know the guy who runs it

oblique lark
#

yeah once xkcd guy fixes the cors thing ill go back to actual xkcd

dull magnet
#

hope he does

oblique lark
#

in the meantime im just gonna keep this to myself

wanton sierra
#

iirc it should bypass cors issue

dull magnet
#

jsonp?

wanton sierra
#

someone used that route like over a year ago for his smart mirror and he said it worked idk

#

lemme find source

oblique lark
#

how would I do that here

dull magnet
#

it uses a script tag

#

thats horrible

#

isn't that literally xss danger

#

also csp exists

oblique lark
#

so the obvious answer here is to somehow get a script tag into my typescript file

wanton sierra
#

ok agreed in the context of client mod, using jsonp is gross and risky

dull magnet
#

its easy but a very horrible dangerous solution and won't work in userscript

oblique lark
#

until john xkcd fixes the cors im just gonna keep using this proxy thing

grim hare
#

jsonp my beloved

wanton sierra
#

in the meantime you can host the vercel app yourself to avoid ip logger risk

#

on ur vercel account or somewhere I mean

#

funny this xkcd cors issue is going since or before 2019, assuming that handful of people wrote to xkcd dev to fix this and it still isn't fixed , hopefully he responds at least

cinder wigeon
#

doesn't that still have the same issue

dull magnet
#

yeah

#

ip logger potential

oblique lark
#

what if massive lookup table of names and convert number xkcd to xkcd image link directly

grim hare
#

build script that pulls the latest table

hasty cypress
#

man i hate that discord still shows the new message thing even if the only new messages are from someone i have blocked...
sure wish someone could fix that..
🫰
^snapping fingers

potent fox
cinder wigeon
vestal ruin
#

oh, it just led me to block them.

hasty cypress
#

cuz if i send it in 3 different channels, people will be 3x as likely to make it

#

you are all my monkeys and you will dance as i please

potent fox
#

You just made me 3x dumber

#

Temporarily

cinder wigeon
hasty cypress
#

thats not true

#

i know what im doing here sweaty

grim hare
#

i am now 3x more likely to ban you

vague echo
#

you're 3x more likely to explode

dull magnet
#

(100%)

opal fern
#

Actually

#

I'll make a pr that will have that fix... Buuuut keep it a draft

#

And make sure it never prs

hasty cypress
#

NOOOO

#

NOOOOOOOOOOOOOOO

slow charm
#

@hasty cypress

opal fern
#

@slow charm

wanton sierra
#

@opal fern

austere gulch
#

@wanton sierra

cursive plank
green vessel
near aurora
#

so any query with a space or non ascii char is invalid

#

looking at you imdb suggest api

grim hare
#

why in the world are you giving it non ascii characters to use in the function return

#

oh, they encode the search string in the callback, that's dumb

#

in any case, jsonp was a good tool for its time but anything that still relies on it is pretty silly

wanton sierra
#

@near aurora loves prayumaru

near aurora
#

ffs

#

no

near aurora
#

like i want to search

#

"a million ways to die in the west"

#

there are spaces

#

it encodes them no matter what i do

#

and the jsonp returns a%20million etc

#

so unusable garbage

#

do i just replace with underscore??

#

@grim hare

wanton sierra
#

katlyn will first reply to me guhhhh

austere gulch
near aurora
#

yeah

#

i cannot

austere gulch
#

y

near aurora
#

it returns the jsonp like that

#

like

grim hare
#

any sane jsonp api (as sane as a jsonp api can be) would let you provide your own name for the callback, which is why I assumed you were giving it something weird

near aurora
#

i cannot modify a resource before putting it in a script tag

austere gulch
#

o

near aurora
#

could proxy or apify it

#

too much work

wanton sierra
#

guhh katlyn is upset with me 😦

grim hare
#

oh I missed your ping

#

I do use a somewhat undocumented google jsonp api for work and I don't love it too much but it does the job at least

wanton sierra
near aurora
#

@grim hare imdb b like

slow charm
#

waltuh

shadow ruin
hasty cypress
#

just causing a little mayhem, like usual

slow charm
#

kara@hasty cypress

hasty cypress
#

: 😈

oblique lark
#

do userplugins work in subfolders too (just making sure)

grim hare
#

yes

oblique lark
hollow inlet
#

we will male babel faster than swc

potent fox
#

@hollow inlet

hollow inlet
#

no

potent fox
#

You are evil

cursive plank
dull magnet
#

what

#

this.schedule

#

then you're doing it wrong

#

onClick:h?void 0:(...args)=>this.handleClick(...args)

#

is the stage channel one a real onClick btw

slow charm
#

where onClick

#

what do

#

(it's not in stable yet)

dull magnet
#

wha

slow charm
#

better upload button plugin

#

what do

dull magnet
#

cry

slow charm
#

how

dull magnet
#

what did they do to onClick wha

#

what happens if you single click

#

it still work?

slow charm
#

yeah

dull magnet
#

how

slow charm
#

idfk

#

js

#

ig

opal fern
#

@austere gulchguide on injecting react when angelIplead

austere gulch
#

huskkkk

opal fern
austere gulch
#

just overwrite a createElement

#

check the react docs for how createElement works Smile

cinder wigeon
dull magnet
#

soon

oblique viper
#

Is there like a way to determine when settings are getting saved and then do validation on them? So basically when pressing this blurple button

#

Been checking the code and was only able to find stuff to check when a specific setting is getting changed unless I'm misinterpreting the code

austere gulch
#

useSettings() is a hook and you should be able to watch that

#

in components at least

#

but

#

iirc onChange should only run when you hit save @oblique viper

#

i should probably add a generic "onSettingsSave" somewhere

oblique viper
#

hm let's see

#

You are correct, should have tried that before asking, was just so used to component onChange which is live changes

austere gulch
austere gulch
#

it should show their name

#

huh

#

it isnt now

#

i'll have to look into it

#

maybe discord changed smth

oblique viper
austere gulch
#

hmm

#

i can probably add a beforeSave thing

#

entering username and pw on discord tho 🥴

#

what is it for

oblique viper
#

Discord's support tickets directly in Discord

austere gulch
#

lmao nice

#

zendesk trolley

#

i like that

#

i'll add a prerun hook

#

for now, leave it as it and I'll get aroudn to that

#

(fwiw you can also do custom components)

oblique viper
#

Yeah there's three options for authentication on Zendesk. First two are out of question since they are admin only stuff

oblique viper
# austere gulch (fwiw you can also do custom components)

Yeah I know but I'd much rather use an in-built solution rather than doing a custom component so the plugin gets fixed automatically when you make fixes in Vencord rather than me having to update the plugin myself to account for the new changes

austere gulch
#

yea

#

just finished work

#

will do that now

oblique viper
#

👍

austere gulch
#

@oblique viper this okay?

#

(can actually be non-promise as well xd)

oblique viper
#

Probably best if you make it promise and non-promise, so there's the option of async validation if necessary

austere gulch
#

I just said it is

#

the type was just outdated in the sc

oblique viper
#

oh that's what you meant

#

I thought you came to the realization it doesn't have to be a promise or something lol

austere gulch
#

lol

oblique viper
#

but yeah LGTM

austere gulch
#

just finding a good place for the error :>

oblique viper
#

aight

dull magnet
oblique viper
#

What else can I do elgato

#

Prefer if I Base64 it beforehand?

dull magnet
#

uhhh

#

u cant really secure it in any way ig

#

i would probably at least encrypt it

oblique viper
#

Yeah, sadly their auth is via basic auth

fresh birch
#

oh my

#

password in plain sight

dull magnet
#

then (en|de)crypt password with that

fresh birch
#

would hashing be easier

oblique viper
#

right, that'd be an option

dull magnet
#

still not much safer but at least random malware/stealers etc won't easily be able to steal it

dull magnet
fresh birch
#

o they need to reverse it

#

what the, when does one need to have original password

dull magnet
#

he said it above

#

btw is that ur discord login @oblique viper or zendesk specific

oblique viper
#

zendesk

dull magnet
#

ohh

#

ig then it's not as bad anyway

oblique viper
#

I will still probably encrypt and put in the IndexedDB just to be safe

austere gulch
oblique viper
#

thanks h_dance

austere gulch
#

:h:

dull magnet
#

cool it works

#

storing the key in IndexedDB i mean

#

ignore the errors inbetween im dum

oblique viper
#

nice

oblique viper
#

Wonder how I want to integrate it exactly. Contemplating whether I make it a fake guild like Favorites or make it like Inbox or Threads

austere gulch
#

surely a tab here

#

"Support"

oblique viper
#

Hm

#

I kind of want to replace the behavior on this help button though hrmrmrmrm

#

this one

austere gulch
#

o

#

modal?

#

you can change modal size to be dummy thicc

oblique viper
#

Well I wouldn't wanna do a modal, more like a popout like this

austere gulch
#

j

oblique viper
#

However I may just do the home page tab idea

austere gulch
queen glade
#

Is there any guide or wiki for developing plugins?
||& Also pls don explod me||

grim hare
#

there's links in the repo readme

#

they might be a tiny bit outdated with the recent big updates we've had but they're still a good starting point

opal fern
# queen glade Is there any guide or wiki for developing plugins? ||& Also pls don explod me||
GitHub

A Discord Desktop Clientmod. Contribute to Vendicated/Vencord development by creating an account on GitHub.

GitHub

A Discord Desktop Clientmod. Contribute to Vendicated/Vencord development by creating an account on GitHub.

cursive plank
#

The discord dev tools are accessed using it

dull magnet
#

he probably knows

cursive plank
#

Does he?
I doubt he has isStaff enabled in the first place

cursive plank
green vessel
#

👍

cursive plank
#

mf

dull magnet
green vessel
#

it sucks you off

wind jay
#

COPYING AND PASTING!

green vessel
#

LMAO

next stone
#

he 100% knows

cursive plank
#

Yes

PS: I did not look at the name when I sent that message

dull magnet
#

LMAO the icon

#

run via terminal

#

thats how to debug

#

what

#

what

#

why is ur Windows scuffed

lone panther
dull magnet
#

lmao how does ur vm not support opengl

carmine nexus
#

winshit

opal fern
fresh birch
#

the user for their windows is called winshit

carmine nexus
next stone
#

you will PR the console allocation

next stone
#

that's like setting yourself up for internet bullying trololo

carmine nexus
#

ok

granite wharf
#

LOVE THE ICON

#

we should actually ship that as the real icon

#

@dull magnet supports

dull magnet
#

yop

#

I do

#

why do you think that's the icon

#

when no embed

#

oh wait I have disable previews

wraith carbon
oblique viper
#

e.g. when setting GLOBAL_ENV.RELEASE_CHANNEL = "staging" there's a banner down here

potent fox
#

marvin is secretly a discord developer

#

this is just his alt

vague echo
#

marvin has your token

opal fern
#

@lost geode @graceful fractal @thorny solar you guys are listed in showHiddenChannels so ill just mention all of you.

Once you click a channel, it shows on the sidebar as if you were actually in that channel

lost geode
#

yeah it's only visual i'll see if i can fix it later

wraith carbon
dull magnet
#

I brought that up a while ago bleh

opal fern
#

How the fuck do I use functions from a plugins file

#

Thought I did it right but apparently not

viral roost
#

ignoreBlockedMessages is undefined 🗿

lost geode
#

your plugin name starts with a lowercase ? 🤨

viral roost
#

case sensitive moment?

wraith carbon
#

Vencord.Plugins.plugins.{yourplugin}.function(...)

#

I believe

#

at least looking at the AnonymiseFileNames plugin

#

that's what was done

opal fern
#

ok

lost geode
#

yeah

opal fern
#

it was fixed

opal fern
#

it has been fixed

#

Dude that is so stupid

opal fern
#

now my messages are being delayed by a few hundred ms tho