#🧩-plugin-development

1 messages Β· Page 27 of 1

uneven charm
#

Idk my 1st day using VenCord

#

I'm still gonna use it tho

chrome elbow
#

vns

shrewd tundraBOT
chrome elbow
#

but no

proud cargo
#

Trying to decompress socket messages, but i cant get it to work with pako. onData never gets called even though theres data in the output, zlib inflater doesnt seem to recognize the Z_SYNC_FLUSH
Any help?

const inflate = new pako.Inflate();
inflate.onData = (data: any) => console.log(data);

const s = new WebSocket("wss://gateway.discord.gg/?v=9&compress=zlib-stream&encoding=json");
s.binaryType = "arraybuffer";
s.addEventListener("message", ({ data }: MessageEvent<ArrayBuffer>) => {
    const len = data.byteLength,
        doFlush = len >= 4 && new DataView(data).getUint32(len - 4, false) === 65535;
    inflate.push(new Uint8Array(data), doFlush && pako.constants.Z_SYNC_FLUSH);

    // if (doFlush) {
    //     const out = inflate.strm.output.slice(0, inflate.strm.next_out);
    //     console.log(new TextDecoder().decode(out));
    // }
})
proud cargo
#

or do i just set up a new inflator for every socket message.

hybrid dune
#

just use https://raw.githubusercontent.com/DiscordStyles/HorizontalServerList/deploy/bottomhsl.css

green vessel
#

How to make plugin

#

Websites documentation is... None existent

dull magnet
#

vban 7 @green vessel selfbotting

shrewd tundraBOT
proud cargo
jagged matrix
#

can somebody do some code that removes the edited text?

shadow ruin
jagged matrix
#

I have the message 'logger' plugin so I like only seeing the edited text below and the original at the top, no need for the edited symbol

jagged matrix
shadow ruin
#

bleh

shadow ruin
jagged matrix
#

thank you, ill put it in my quickcss now

tacit sonnet
#

how can i put custom plugins?

tacit sonnet
#

it only tells how to install and uninstall

hasty tiger
tacit sonnet
#

and where do i create the userplugins?

drowsy chasm
#

read

tacit sonnet
#

so i download the repo?

#

then make userplugins

drowsy chasm
#

which is what the first page says, yes...

tacit sonnet
#

then when i make my file..?

#

plugin

#

when its done

drowsy chasm
#

ok well first what plugin are you trying to add

tacit sonnet
#

third party

drowsy chasm
#

then just follow the instructions
clone the vencord repo, install dependencies, make a new folder called userplugins under the src folder, download the plugin and drag it into that folder and build + inject your local build

#

both of those docs pages explain it all

tacit sonnet
#

how do i build + inject

drowsy chasm
tacit sonnet
#

uhh..

#

im on linux

#

will it work too?

drowsy chasm
#

probably

#

try it and see

tacit sonnet
#

Okok

#

Nope 😦

drowsy chasm
tacit sonnet
#

Ok

dry lodge
#

Needed this, thankss

proud valley
#

my vencord is giving weird errors when i run pnpm build and my plugins dont show up in vencord settings

#

let me get a pic of the error

atomic hemlock
#

vns

shrewd tundraBOT
proud valley
#

oh ok

hasty tiger
#

question does using import(url) make a network fetch each time

#

is it better to actually copypaste everything

ionic breach
#

I haven't noticed any significant difference

hasty tiger
#

ah

dull magnet
#

just use link

#

it doesnt matter

hasty tiger
#

ig the difference would be in organization then 'cause css file would be much cleaner with import

#

do import statements need to be at the top of the file?

#

huh
I was under the impression they worked like c++ #include where it basically copypastes it in

hasty tiger
#

why is that?

dull magnet
#

why is the sky blue

austere mauve
#

i painted it like that

ionic breach
#

Light refraction πŸ€“

tacit sonnet
#

How do i publish third party plugins?

dull magnet
#

send it here

tacit sonnet
#

why?

dull magnet
tacit sonnet
#

btw how do i make a plugin?

#

πŸ’€

lone panther
#

asking how to publish one BEFORE how to make one is kinda crazy ngl

drowsy chasm
#

😭 why did you ask how to publish one before even knowing how to make it in the first place

tacit sonnet
#

πŸ’€ πŸ’€

#

no i know how to make

viral roost
tacit sonnet
#

i know how to make betterdiscord plugins

#

but not vencord

#

is it the same?

drowsy chasm
#

no

#

completely different

tacit sonnet
#

difference?

drowsy chasm
#

a lot

tacit sonnet
#

is it only raw js?

#

the js only

viral roost
#

it's ts

drowsy chasm
#

^

tacit sonnet
#

or it has start() and stop()

drowsy chasm
#

have a look around the repo

viral roost
#

(and css)

tacit sonnet
drowsy chasm
#

good luck making a plugin then

tacit sonnet
#

πŸ’€

drowsy chasm
#

they don’t grow on trees

viral roost
drowsy chasm
#

😭

lone panther
#

offering paid vencord plugins for 1k$/100LOC πŸ—£οΈ

tacit sonnet
#

someone send me the repo

drowsy chasm
tacit sonnet
#

im a busy man

drowsy chasm
#

brother it takes 5 seconds

hasty tiger
lone panther
hasty tiger
#

does that mean you can make it as many lines of code as there are tokens

lone panther
#

i'll add so many comments

worldly summit
#

is there any way to restart websocket connection?

tacit sonnet
#

bro plugins r written w ts?

drowsy chasm
lone panther
#

we said that like 3 minutes ago ?????

drowsy chasm
tacit sonnet
#

question: can i build it without ts. answer: yes/no

drowsy chasm
#

okay

#

go for it

hasty tiger
#

no need to ask

lone panther
#

can you build the typescript project

#

without typescript

drowsy chasm
#

i wonder why all the plugins are written in ts

tacit sonnet
#

ts is bad

#

good

drowsy chasm
#

opinion

tacit sonnet
#

im bad

#

in it

hasty tiger
#

don't worry ts compiles to js or smth like that

tacit sonnet
#

is it hard?

lone panther
#

/j???????????????

tacit sonnet
hasty tiger
drowsy chasm
tacit sonnet
#

wip

dull magnet
#

with all due respect i highly doubt you will be able to make a plugin based on your last dozen of messages

tacit sonnet
#

can ur manager on the mic RN

dull magnet
#

anyway you can find very basic docs in the repo

tacit sonnet
#

i made plugins

indigo meadow
drowsy chasm
#

i redirected you like 3 hours ago to the repo docs

#

so many times

tacit sonnet
#

Nooooooo, it has the start()stop() llike bd

lone panther
#

not what

#

/j means

hasty tiger
#

the statement is meant to be humorous due to being misleading
so /j

tacit sonnet
#

i should kms

hasty tiger
#

question: do you guys have separate github accounts for like. online stuff and irl stuff

drowsy chasm
#

do not

austere mauve
drowsy chasm
austere mauve
#

i simply do not have a gh account

hasty tiger
#

ΓΆ

austere mauve
#

we praise codeburger in this household

hasty tiger
#

is that blue pacman but pointing down

dull magnet
#

tecnically agains ttos anyway

dull magnet
#

codeburger

hasty tiger
#

oh huh

austere mauve
#

yea

dull magnet
#

it is

#

we are sooo barrack

austere mauve
#

it only died for a bit

hasty tiger
#

never heard of it before but it seems cool

tacit sonnet
#

this community's responses r so dead

drowsy chasm
#

πŸ’€ cope

cerulean orchid
# tacit sonnet

No your just asking incredibly stupid questions and doing no prior research thumbeline

hasty tiger
#

guys how do I breathe

#

time sensitive question

#

guys how do I breathe

#

guys how do I breathe

cerulean orchid
#

OH GOD

#

UH UH UH

#

APPLY PRESSURE TO THE CHEST

hasty tiger
vague echo
cerulean orchid
#

It's against tos to have more than one GitHub account period

#

But it's widely accepted as ok to have work and personal seperated

#

I highly doubt you will get termed unless you abuse benefits

#

I've seen people get termed for just having a second account they don't even use though

hasty tiger
#

I think I found a vesktop bug

drowsy chasm
woven lion
#

does anyone know if we have an API for taking people to a settings page

#

i want to be able to click a notif and go to the cloud settings page

jagged matrix
#

curious, how do I install third party plugins with vencord? I know how to do it with BD, but confused as hell with vencord

woven lion
hasty tiger
jagged matrix
#

do i need to install vencord using my terminal?

drowsy chasm
proud parrotBOT
woven lion
#

perfect thats actually what i was looking for

#

ty

drowsy chasm
jagged matrix
hasty tiger
woven lion
#
// pre-check for local shared settings
if (
    Settings.cloud.authenticated &&
    await dsGet("Vencord_cloudSecret") === null // this has been enabled due to local settings share or some other bug
) {
    // show a notification letting them know and tell them how to fix it
    showNotification({
        title: "Cloud Integrations",
        body: "We've noticed you have cloud integrations enabled in another client! Due to limitations, you will " +
            "need to re-authenticate to continue using them. Click here to go to the settings page to do so!",
        color: "var(--yellow-360)",
        onClick: () => SettingsRouter.open("VencordCloud")
    });
    return;
}
drowsy chasm
#

oh nice

#

honestly such an obscure bug

woven lion
#

it makes sense once you realise how it works

drowsy chasm
#

don’t think i’ve ever seen it mentioned before

woven lion
#

vencord has a common location for settings

#

cloud integration enable state is stored in settings

#

secrets are stored in indexeddb

#

indexeddb is not shared

#

because settings are source of truth, everything assumes cloud integrations is set up correctly

#

when they arent

#

so it just doesnt work

#

when you turn it off and on it redoes the validation

#

and it realises "oh shit"

drowsy chasm
#

lmao yeah

woven lion
drowsy chasm
cerulean orchid
hasty tiger
#

im so proud of myself for being maybe a little useful

woven lion
raw moth
#

Weird question, but you see the plugin that tells you what platform someones on, desktop, web, mobile, etc, and yet even though im constantly in a state of appearing offline, from my desktop i can pick up when my discord is being accessed from my mobile, now im not great with discord's API i havent done too much research/studying into it, but surely if i can pick up a device accessing my discord even when offline, that means it would be possible for a plugin to detect if a user is offline or just appearing so?

hybrid dune
raw moth
#

ah, understood

dire fern
unreal night
#

would be a major invasion of privacy as well if that was the case

hasty tiger
#

free

tacit sonnet
#

@dull magnet bro

#

cmon

#

tf

crude iron
#

Glad I blocked them ages ago

cerulean orchid
#

@tacit sonnet you are not entitled to support, we are not a business, nor is ven explicitly paid for his work

#

vns moment too

shrewd tundraBOT
ionic breach
dull magnet
#

im more confused why there are so many linux users who don't even know about how to elevate with sudo

#

how do they do anything

visual mortar
#

just a rnadom question , a browser that is cross instance with your phone and any other device, kinda like the sync tool but on stariods like what ever tabs are open on my device those are the same ones open on my phone and vice versa, same with history and everything like that, but i have not been able to find a broswer like that or a similar extention and the sync feature in todays broswers are imcopantant, and i want to make my own if possible but is it a worth while indever

cerulean orchid
#

i see a lot of linux users that are

#

clueless

visual mortar
#

most users just end up switching to linux just to say they use it idky seems like a waste if you ask me, having a tool and not knowing how to use it what a shame

ionic breach
#

p much my thoughts as well

bright marsh
#

or its them getting blue screens

#

i mean if you get it so consistently and eventually get suggested to use one

#

idk

cerulean orchid
proud valley
#

im getting an error that causes my vencord to crash and i can trace the error back to my code

export default definePlugin({
    name: "ExecutableCodeblocks",
    description: "Allows for code inside of codeblocks to be ran directly inside Discord. Powered by Piston.",
    authors: [Devs.dylann4243],
    dependencies: ["MessageAccessoriesAPI"],
    settings,
    start: async () => {
        const runtimeIds = (await runtimes()).flatMap(runtime => runtime.aliases.concat(runtime.language));

        // @ts-expect-error
        addAccessory("executableCodeblock", ({ message }: { message: Message; }) => {
            const regex = /\`\`\`(?<header>.*?)\n(?<body>(?:\n|.)*)\n\`\`\`/gm;

            if (!regex.test(message.content)) return;

            const { groups } = message.content.match(regex)!;

            // this is the line the error traces to
            if (!runtimeIds.includes(groups!.header)) return;

            return (
                <CompileButton />
            );
        });
    },
    stop: () => {
        removeAccessory("executableCodeblock");
    }
});
meager snow
#

which line crashes it

austere mauve
#

fix ur code then

#

:tro\

proud valley
proud valley
#

19

austere mauve
#

have you considered ur !s are wrong

#

wait m

proud valley
austere mauve
#

ltrlly saying groups is undefined

bright marsh
#

how about a ?

proud valley
#

ok

#

i have to add a ! after header tho if i do ?. instead of !.

#

but ill try it

austere mauve
#

..no

#

bad

proud valley
#

oh ok

#

maybe i wont use named captures then

austere mauve
#
const header = message.content.match(regex)?.groups?.header;

if (!header || !runtimeIds.includes(header)) return;
proud valley
#

ok ill try it

#

seems to work

raw moth
#

On my friends list in the ALL section i have 217 friends, i want to unfriend most of them but its slow and tedious with you having to click three dots, then click unfriend, then confirm,

are there any plugins that make this quicker? like just a button next to them to quickly unadd them

cerulean orchid
#

there is a very old script

#

deep in the depths of an old server

#

which is now locked up and private

#

(i dont have it)

raw moth
hybrid dune
#

very late to conversation but I switched to linux mainly to juice another few years' of usable life out of my potato laptop with dying battery

hybrid dune
#

linux: mint
laptop: lenovo thinkpad from ~2013

cerulean orchid
#

oh shit 2013 was 10 years ago

#

I was about to say that its not that old

amber mantle
#

damn

dull magnet
#

@amber mantle

amber mantle
#

wtf

dull magnet
#

open in browser 4 jumpscare

amber mantle
#

wtf duid that do

#

loading jumpscare

opal fern
#

What the fuck

#

@lone panther get the fuck over here

#

How can I make it so typescript can see my .jade files

lone panther
#

uh idk why it couldnt

#

that shouldn't even really have changed

opal fern
#

i mean

#

it might be express fucking up

#

found a fucky workaround

#

Drake now has a permanent marker in my code

dire fern
#

#blamedrake

limpid tusk
#

i'm assuming i need to add the vencord license to the top of my plugin like the other plugins? i don't see a doc for rules about this

cerulean orchid
#

you can choose any license you like

viral roost
#

if you're planning on getting your plugin added to vencord, then the header will getting added in for you by eslint (pnpm lint:fix)

#

otherwise do whatever

limpid tusk
#

ah ok that makes sense

#

maybe a stupid question, but if i plan for the plugin to be merged, i'm assuming i should place it in the /src/plugins folder instead of /src/userplugins/ like the plugin guide says

limpid tusk
#

ok thank you just making sure, not sure how the workflow is around here haha

#

thanks

viral roost
#

yeah it's fine feel free to ask questions

dull magnet
#

you need to use GPL

#

but you may choose the copyright owner line from "Vendicated and vencord contributors" to your own name if you want

#

surprises me not more people do that

compact thorn
#

but unironically

#

do you guys have like a backlog or something/

viral roost
#

backlog of what

dull magnet
#

probably of features

#

not really no

compact thorn
#

how does contribution look like? do you base it off of github issues?

#

or basically just

  1. have an idea
  2. code it
viral roost
#

yeah its the latter

#

if you wanna make something you're free to just make it and open a pr

#

just don't expect quick review times

compact thorn
#

do you have any code style guidelines? what if i write the shittiest code you've ever seen and open a pr?

steep vapor
proud parrotBOT
# steep vapor https://github.com/Vendicated/Vencord/blob/main/CONTRIBUTING.md

**CONTRIBUTING.md: **

# Contribution Guide

First of all, thank you for contributing! :3

To ensure your contribution is robust, please follow the below guide!

For a friendly introduction to plugins, see [Megu's Plugin Guide!](docs/2_PLUGINS.md)

## Style Guide

-   This project has a very minimal .editorconfig. Make sure your editor supports this!
    If you are using VSCode, it should automatically recommend you the extension; If not,
    please install the Editorconfig extension
-   Try to follow the formatting in the rest of the project and stay consistent
-   Follow the file naming convention. File names should usually be camelCase, unless they export a Class
    or React Component, in which case they should be PascalCase

## Contributing a Plugin

Because plugins modify code directly, incompatibilities are a problem.

Thus, 3rd party plugins are not supported, instead all plugins are part of Vencord itself.
This way we can ensure compatibility and high quality patches.

Follow the below guide to make your first plugin!

### Finding the right module to patch

If the thing you want to patch is an action performed when interacting with a part of the UI, use React DevTools.
They come preinstalled and can be found as the "Components" tab in DevTools.
... (53 lines left)
meager snow
#

the bot fr said 53 lines left

compact thorn
#

right, missed taht

meager snow
viral roost
#

actually i should probably just point to that as the plugin guide instead of the plugin doc

compact thorn
meager snow
#

ven is pretty strict

#

you can take a look at other plugins to see how you can structure your code without being yelled at

#

note: they're pretty much all made differently

compact thorn
#

well that's good

#

anyways ty

amber mantle
#

ven is strict but will say skill issue on often occasions

#

xD

compact thorn
#

I'm not afraid to admit my skill issues lol

worldly summit
#

https://www.npmjs.com/package/fastify is good for backend or nah?

#

I don't want to use express lol

dull magnet
#

is good

worldly summit
#

ok thx

bronze otter
#

how to use findByCodeLazy? shouldn't it return a promise or something

dull magnet
#

no

#

it returns the actual module searched

#

you just use it as if it weren't lazy

dull magnet
bronze otter
#

however, after I do an action that loads the module, it works

dull magnet
#

it's lazy loaded then

#

what are you trying to do

bronze otter
#
findByCodeLazy("Messages.USER_PROFILE_MODAL", `.USER_INFO_CONNECTIONS`)
dull magnet
#
waitFor(filters.byCode(...), module => {
    console.log(module)
}) ```
#

this is what you're looking for

#

the callback will be called as soon as the module is loaded

bronze otter
#

oh

#

interesting

dull magnet
#

the lazy find functions a bit differently, it just means defer the search until the module is first used

#

which doesn't guarantee the module has been loaded

#

waitFor only resolves once the module is loaded

bronze otter
#

awesome, thanks

dull magnet
#

what are you doing anyway

#

seems kinda like X/Y problem

limpid tusk
#

finished my first plugin that just causes secret call tone to always play

cerulean orchid
#

@pure temple woul be cool if there was a toggle switch next to each one

ionic breach
#

Like only if includes &&&

#

And then it won't go?

#

Idk

dull magnet
#

yes

#

that'd work

cerulean orchid
#

oh trrue

#
import json from '../plugins.json' assert { type: 'json' };
import { gitFetch, copyGitToVencord, baseDir, copyFiles } from './scripts.js';
import type { PluginList } from './types/pluginsList.js';
import { readdirSync } from 'fs';

const plugins = json as PluginList[];
export function movePlugins() {
    // eslint-disable-next-line @typescript-eslint/no-misused-promises
    plugins.forEach(async (plugin: PluginList) => {
        // this will be undefined if we are not using git, but that should not matter if git when used always has it.
        switch (plugin.type) {
            case 'git':
                await gitFetch(plugin.git!, plugin.host).then(
                    async () =>
                        await copyGitToVencord(plugin.git!.split('/')[1]!),
                );
                break;
            case 'git-files-aio':
                await gitFetch(plugin.git!, plugin.host).then(() => {
                    readdirSync(
                        `${baseDir}/temp/${plugin.git!.split('/')[1]!}`,
                        {
                            withFileTypes: true,
                        },
                    )
                        .filter((item) => item.isFile())
                        .map((file) => file.name)
                        .forEach((file) => {
                            void (async () => {
                                console.log(`Found ${file}`);
                                await copyFiles(
                                    `temp/${plugin.git!.split(
                                        '/',
                                    )[1]!}/${file}`,
                                );
                            })();
                        });
                });
                break;
            case 'static-aio':
                readdirSync(`${baseDir}/${plugin.path}`, {
                    withFileTypes: true,
                })
                    .filter(
                        (item) =>
                            item.isFile() &&
                            item.name.endsWith('.ts' || '.tsx' || '.css'),
                        // this doesn't work as I wanted to, but it DOES work.
                    )
                    .map((file) => file.name)
                    .forEach((file) => {
                        void (async () => {
                            console.log(`Found ${file}`);
                            await copyFiles(plugin.path!);
                        })();
                    });
        }
    });
}
#

horror

austere mauve
#

(item) => item.isFile() && item.name.match(/.(tsx?|css)$/)

#

@cerulean orchid

austere mauve
#

".ts" || ".tsx" || ".css" evaluates to just ".ts"

#

silly

cerulean orchid
#

lmaooo

#

this is strange

cerulean orchid
austere mauve
#

i have no idea what im looking at

cerulean orchid
#

it copys the folder over

#

but then it copies the folder again inside of the folder it just copied

austere mauve
#

he gets it dummy

cerulean orchid
#

i might leave it broken for now because it works in that state

#

ill look into why its broken later

#

or broken when its not broken

#

frankly, this entire thing could probably be in pure bash

#

instead of using js as a proxy

austere mauve
#

now i wanna owrk on something that lets u pick things

oblique lark
#
print('Very Good Script!')

fixed it for you

#

uh

green vessel
#

it doesn't follow pep80 reeeeeeeeee

oblique lark
#

update: merged pr #1 from @green vessel

#

uh oh

#

yeah when i mapped each letter to its spot in the alphebet they got overlapping locations

#

but since the data was identical it didn't matter

#

there's also a second r

#

but which o function would go first

#

ah of course

#

my bad

#

wait do spaces or exclamation marks go before letters

#

genius

#

OH MY GOD

#

removed bloat πŸ‘

austere mauve
#

./run ```js
const epic = (a = "") => new Proxy(Proxy, {
get: (_, i) => epic(a + i),
apply: () => epic(a + " "),
construct: () => Object(console.log(a))
});

new (epic().h.e.w.w.o()[":"][3]);

worldly oxideBOT
#

Here is your js(18.15.0) output @austere mauve

hewwo :3
oblique lark
#

good point

austere mauve
#

pwoxies

#

RecursionError soon

oblique lark
#
new (epic()["amogus"]()[new Date()]()['b']['a']['l' * 2]['s']);

this function is amazing

#

amogus Sun Jul 30 2023 00:00:15 GMT-0400 (Eastern Daylight Saving Time) baNaNs

#

AAAAHH

#
const reverse = str => str.split('').reverse().join('')
#

society if every programming language had python's indexing

#

i hate doing stuff like

str.substring(1, str.length - 1)
#

removes the first and last char

cedar marsh
#

I hate javascript indexing

oblique lark
#

javascript doesn't even actually index

#

it's secretly a map with number keys

cedar marsh
#

Your a map with number keys

oblique lark
#

You're

#

/run

console.log(Object.keys(this))
worldly oxideBOT
#

Here is your js(18.15.0) output @oblique lark

[]
oblique lark
#

/run

function thatThang() {
  console.log(Object.keys(this))
}
thatThang()
worldly oxideBOT
#

Here is your js(18.15.0) output @oblique lark

[
  'global',          'queueMicrotask',
  'clearImmediate',  'setImmediate',
  'structuredClone', 'clearInterval',
  'clearTimeout',    'setInterval',
  'setTimeout',      'atob',
  'btoa',            'performance',
  'fetch'
]
oblique lark
#

mmm circlular references

warm ether
cerulean orchid
#

anyway

#

@trail ginkgo not to be nitpicking, but the third line of #1032200195582197831 message
should be @api/Settings with a uppercase S on settings to avoid throwing an error

warm ether
#

ni hao

cerulean orchid
#

im just making a automated prepackager and just wanted to let you know about that warning

trail ginkgo
#

true im not changing it tho

cerulean orchid
#

lmao

#

im just gonna change the one I redistribute

#

just wanted it to be clear there will be a discrepency

ionic breach
#

Omg you've been aspy this whole time

#

Jumpscare

cerulean orchid
#

lmaoo

viral roost
#

a new, greater aspy

silk sorrel
#

when the low level string immutability

crude iron
#

Make it mutable.

silk sorrel
#

so true

pure temple
gusty copper
#

it's just

#

INCREDIBLY cursed

tacit sonnet
#

is there a possible way to install bd w vc

steep vapor
#

no

trail ginkgo
#

is it like 'abc'[[1,2]] or something

dull magnet
#

fire

trail ginkgo
#

oh uses string

#

reaol

#

this is funny

dull magnet
#

indexes that aren't symbol get converted to string

#

try this

#

/run js console.log({ a: "banana" }[{ toString: () => "a" }])

worldly oxideBOT
#

Here is your js(18.15.0) output @dull magnet

banana
dull magnet
#

the array toString method joins by comma

trail ginkgo
#

yea

worldly oxideBOT
#

@prime lodge

Error

Invalid command format (missing codeblock?)

worldly oxideBOT
#

Here is your javascript(18.15.0) output @gray ocean

[ 'a', 'b', 'c', 'd', 'e' ]
[ 'c', 'd', 'e' ]
[ 'a', 'b', 'c' ]
[ 'c', 'd' ]
#

Here is your typescript(5.0.3) output @gray ocean

[ 'a', 'b', 'c', 'd', 'e' ]
[ 'c', 'd', 'e' ]
[ 'a', 'b', 'c' ]
[ 'c', 'd' ]
crude isle
#

i hate my life

proud rain
#

what da hail is ankha doin

covert rivet
#

oy guys, where is the plugin folder located at? I want to edit the code of a plugin

dull magnet
#

you need to build from source

covert rivet
#

ok

#

thanks

#

i hoped it would not be this way cuz im lazy

#

just wanted to tweak it fast and simple sadKEK

meager snow
#

does vencord have GuildSettingsEmojiStore implemented

dull magnet
#

whar

paper wraith
#

Hi, How can I put a badge of my choice on my profile using CSS

meager snow
#

ignore me i read the wrong file

covert rivet
#

I remade the plugin with the tweaks i wanted. Now it works for my client.
How can i give this compiled plugin to my friends to have them too?

meager snow
#

they'l have to compile it themselves

covert rivet
#

sheeeesh

meager snow
#

but if u want u can do a PR to push it to main and see if it gets accepted ir not

covert rivet
#

it is a edited version of another existing plugin

meager snow
#

🀷

covert rivet
#

even if i change the name and etc it still does not make any sense to accept it cuz its the same but a lil different

#

anyway

#

thank you

#

oh cant i just give them the build i compiled?

#

and just paste the build on top of their build?

#

i guess not cuz they need to inject it into their discord client sadblob

cedar marsh
#

I am doing a dumb thing, so if you don't want to support me πŸ‘

I want to programmatically add a reaction to a message in discord
Normally, fetch run inside of discord includes authorization headers by default.

Attempting to switch a request's method using

fetch(`url`, { method: 'PUT' })

overrides this authorization header

How do I change my request method without overriding the default headers?

async function horseReact(channel, messageID) {
  const resp = await fetch(`https://discord.com/api/v9/channels/$%7Bchannel%7D/messages/$%7BmessageID%7D/reactions/%F0%9F%90%B4/%40me?location=Message&type=0`, {
    method: 'PUT',
    authorization: '' // NO, stinky, i don't want to get my cookie
  })
}
#

ignore ${thing} being replaced with $%7Bthing%7D, discord likes breaking urls even when they are in code blocks

dull magnet
#

don't use manual fetch

#

terrible

cedar marsh
#

what do I use instead?

dull magnet
#

discords method or RestApi class

cedar marsh
#

how can I access either of those?

dull magnet
#

is this in vencord or no client mod?

cedar marsh
#

No client mod

dull magnet
#

oh why

#

btw

normally, fetch run inside discord includes authorization headers by default

idk where u got this from but its not true

cedar marsh
#

Really dumb reason:

Meme in some memes channel, person has every single one of their messages reacted with 🐴

I want to make a script for people to easily horse react all their messages in a certain channel

cedar marsh
dull magnet
#

self boat YoyokoGun

cedar marsh
#

self boat?

dull magnet
#

bot

cedar marsh
#

true

cedar marsh
#

it works for me

dull magnet
#

doesnt

#

leaking my cookie was not the best idea probably

cedar marsh
#

I swear to god that worked for me just a minute ago

dull magnet
#

maybe cause its a public guild

dull magnet
cedar marsh
#

alright I am dumb I guess

dull magnet
#

anyway

#
wreq(163082).rU("1032770730703716362", "1135662554153238669", { id: null, animated: false, name: "🐴" })
#

this is discords func for it

cedar marsh
#

thanks

dull magnet
#

i can write u some snippet that works without client mod

#

if u gimme a minute

cedar marsh
#

You don't have to, its a dumb self bot for a bad joke

dull magnet
#
const wreq = webpackChunkdiscord_app.push([[Symbol()],{},r=>r])
webpackChunkdiscord_app.pop()

const RestAPI = Object.values(wreq.c).find(m => m.exports?.ZP?.getAPIBaseURL).exports.ZP

function horse(channelId, messageId, superReact = false) {
    return RestAPI.put({
        url: `/channels/${channelId}/messages/${messageId}/reactions/%F0%9F%90%B4/%40me`,
        query: {
            location: "Message",
            type: superReact ? 1 : 0
        },
        oldFormErrors: true
    })
}
cedar marsh
#

thanks

drowsy chasm
#

function horse

lone panther
#

horse

#

honse

ashen pebble
#

I get this error where do I set the platform
X [ERROR] Could not resolve "child_process"

src/userplugins/ReUpload/index.tsx:7:21:
  7 β”‚ import { exec } from 'child_process';
    β•΅                      ~~~

The package "child_process" wasn't found on the file system but is built into node. Are you trying
to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[16:17]
trying to use ytdl-p

dull magnet
#

plugins run in the browser process they have no node access

#

if you want to use native nodejs code you need to use ipc

ashen pebble
#

when you mean browser do you mean the desktop client or actual browser?

ashen pebble
#

o thanks I will look into it

grand haven
#

i used my brain today

#

and while that in itself is crazy

#

i came up with an idea

#

what if, the mediasource stream from the mic which is used for sending audio, was intercepted, piped tru an audio context, and then we could download any audio from a soundboard and pipe it into the audio context via mic?

grand haven
#
const gdm = navigator.mediaDevices.getDisplayMedia

const audioElement = document.createElement('audio')

audioElement.addEventListener('ended', ({ target })=> {
  target.src = ''
})

navigator.mediaDevices.getDisplayMedia = async opts => {
  const mediaStream = await gdm.call(navigator.mediaDevices, opts)
  const audioContext = new AudioContext()
  const destination = audioContext.createMediaStreamDestination()
  audioContext.createMediaElementSource(audioElement).connect(destination)
  audioContext.createMediaStreamSource(mediaStream).connect(destination)
  return new MediaStream(destination.stream.getAudioTracks())
}

function playSoundBoard(src) {
  audioElement.src = src
  audioElement.play()
}
#

HMMMMMMM

#

i wonder if this would work

#

god this is fucking stupid

ember charm
#

ive never used react before but im trying to make a simple plugin for personal use and was wondering if i could find some help here. i'm trying to make a plugin that allows you to select a locked voice channel and join it as soon as it is unlocked, but i don't know where to start lol. can anyone help me with this? πŸ™‚

azure gate
#

i have no idea but should have code that monitors the status, when it updates to unlocked then the code makes the user join said VC
might need to have an option for auto mute or auto deafen
again, my two cents but i have no idea what im going off about since i dont code react, i do python

ember charm
#

my problem is more that i dont know how to make the code reference that channel or what functions/variables are available for me to use ☹️

deft hull
#

can someone send me a pic of shiki codeblocks preview rq

#

@trail ginkgo

#

you could actually lol

trail ginkgo
deft hull
#

this is what mine looks lioke right now, but it looks kinda bad

trail ginkgo
deft hull
#

ok, it's just the theme then

#

and the width? why is the width so much bigger

trail ginkgo
#

no its also the border probably

#

uh idk thats just the normal behaviour of codeblocks

#

they always fill up the width of the messages box

#

unless they're in a blockquote

deft hull
#

oh

#

i had console open

#

so

trail ginkgo
#

lolol

#

are u modifying the codeblocks instead of using ur own components

deft hull
#

no, i have my own component

trail ginkgo
#

oh so the line gutter is intentional

#

(the thin line between the line numbers and the code)

deft hull
#

oh yeah, but I removed it

#

it looks better without it

trail ginkgo
#

i c

#

lit

#

you should prob include the theme's background color as an option btw

deft hull
#

imma release this while I figrure out how to get shiki working

#

but maybe

trail ginkgo
#

real

deft hull
#

i gotta look into hljs themes

trail ginkgo
#

why hljs

#

oh as the fallback

deft hull
#

no, because shiki doesn't work

#

so i'm just using hljs

#

and adding the line numbers

trail ginkgo
#

ohh that makes sense

pulsar harbor
#

nix terrible just tried it πŸ₯±

#

whoever invented home-manager is evil

#

ill stick to my arch system that breaks randomly every week for no reason

unreal night
#

got a weird error with my bot. Anyone know what this is going on about?

#

keeps posting this message no matter the command i put in

viral roost
#

active developer moment

unreal night
#

this was a new token

viral roost
#

clearly isnt

unreal night
#

this is the 5th time Pepe00

viral roost
#

uh

#

did you set the uh

#

interactions url thing

#

remove that

unreal night
#

let me check

#

nothing in there

#

yk what

#

i'll just make a new one, no idea wtf happened to this one

#

wait, nvm found the issue CB_thumbsupcat

pulsar harbor
#

speaking of active dev

#

does anyone know if they changed the requirement to let them collect usage statistics to get it?

#

i have it off afaik and it randomly gave me the badge

meager snow
#

no they did not

pulsar harbor
#

bruh 😭

#

is discord ui lying to me

meager snow
#

are some other people using ur bot

pulsar harbor
#

i only have one slash command and it's useless i just made it for the badge

green vessel
calm crater
#

Another mod server to my collection

bright marsh
#

ayy its Gibbu

flint oxide
hybrid dune
#

o/

calm crater
#

I have 21 server related to Discord modding EvilGiggles

pulsar harbor
#

lol

dull magnet
#

i have like 10 and i already find it much

pulsar harbor
#

how many of them have anime themed branding

dull magnet
#

wait

#

I have almost as many as gibbu apparently

#

i have

  1. vendetta
  2. vencord
  3. aliucord
  4. betterdiscord
  5. betterdiscord devs
  6. random dziurwa datamine server
  7. enmity
  8. dead powercord
  9. client modding stupidity archive
  10. mantika reviewdb server
  11. armcord
  12. discord client mod encyclopaedia
  13. aliucord ESP/PT
  14. dead ittai
  15. kernel
  16. strencher
  17. old cumcord server
  18. lighty
  19. materiiapps
austere mauve
#

why are lists so bad

dull magnet
#

they will make them compacter

#

someone make better list css

austere mauve
#

the font is like

#

monospace

#

but not

#

and theeres weird spacing between the numbers

#

1231231312. not to mention whatever this is

#

oh god did they fix it

viral roost
#

discord never fixes things the same year it gets added

austere mauve
#

it doesnt go out of the message anymore

meager snow
#
  1. h
#

shit they actually fixed their shit

cedar marsh
dull magnet
#

still looks bad

#

make better one

silk sorrel
green vessel
#

would it be possible to interface with openasar to repair vencord when its uninstalled cause of a discord update, since the asar file is never replaced on windows installs of discord, i think this would be an awesome feature and mean i dont have to reinstall vencord every discord update

#

obviously i have a bare-bones understanding of how discord works so maybe it wouldnt be possible whilst discord is open via the asar

dull magnet
#

no

green vessel
#

why not

#

😩

dull magnet
#

vizality

calm crater
meager snow
#

i have one and it’s this one

#

beat me

shadow ruin
#

can i redirect <anything>.example.com to example.com/<anything> with caddyfile magic?

rocky jackal
#

I haven't heard that name in a long time

woven lion
#

with a different webserver yes

#

but caddy can't

#

afaik

shadow ruin
#

sad

woven lion
#

oh nvm

#

guess they added it in v2

#

but you have to build caddy yourself with the cloudflare module, for instance

#

so it can fetch a wildcard cert

shadow ruin
#

thats weird

woven lion
#

not rly

#

wildcard certs require dns validation

shadow ruin
#

fair enough

woven lion
#
*.exhq.dev {
    tls {
        dns ...
    }

    redir https://exhq.dev/{http.request.host.labels.2}
}
#

something like that though

lone panther
tacit sonnet
#

is there a possible way to join/hear or just see the screenshares of unjoinable vc?

meager snow
#

no

proud valley
tacit sonnet
opal fern
proud valley
#

should i use the TextInput component or an actual input element?

worthy frost
#

how would i check if a specific user is in a specific guild?

#

(if someone repsonds, please ping me)

civic stone
#

my brain is long gone fucker

#

respect my disability? stop being so TOXIC

proud valley
#

to see a screenshare in a vc

#

u have to be in that vc

#

u cant look at a screenshare in that vc if ur not in the vc

#

🀯

tacit sonnet
#

so its impossible?

proud valley
#

answer that urself

tacit sonnet
#

impossible........ but my mom said nothing is impossible.. 😨

unreal night
proud valley
#

😒

tacit sonnet
#

im-possible 😎 :amanwalking,uptospace,dancing,saying,im,possible:

proud valley
#

πŸ’€

unreal night
#

theres a your mother joke in there somewhere

proud valley
#

bro hold up im getting a weird errror

#

whenever i run pnpm watch, but when i do pnpm i it doesnt install any packages

dull magnet
#

you can't import from react

proud valley
#

you cant?

dull magnet
#

duh

proud valley
#

ohhhh

dull magnet
#

we use Discord's react

proud valley
#

i gotta get from webpack

dull magnet
#

you want webpack commons

proud valley
#

mb mb

#

works now lol

#

i need css

#

imma write some

cedar olive
#

take a look at GuildMemberStore, though that only includes cached members

faint flare
#

hello, can I have the "snippet dev" role pls?

wide parrot
cloud sundial
#

is anyone in here acually nerdy enough to know how discord checks for devtools lol

shadow ruin
cloud sundial
#

wait what

#

you can just listen to the keybind??

#

preventDefault is so not gonna work

shadow ruin
#

it does trolley

cloud sundial
#

it actually does-

#

time to test this on different browsers lol

shadow ruin
#

ive tried it on chrome and firefucks

#

idk about others

cloud sundial
#

I just remembered

#

what else is there other than chromium and whatever ff uses

shadow ruin
#

uhhh you mean the engine?

cloud sundial
#

I doubt edge/opera/... change the way the keydown event works

shadow ruin
#

safari prolly has its own engine

cloud sundial
#

well cool but I don't have a mac

#

vm it is

shadow ruin
#

also instead of ctrl you prolly have to listen for the funny imac keyboard layout

cloud sundial
#

true

cloud sundial
#

why the fck is gnome-shell eating 3gb ram

cunning imp
#

because GNOME

#

try just using a WM, you dont really need more tbf

cloud sundial
cloud sundial
#

from the name of it that sounds like it'll do nothing :)

faint flare
#

hey, would you know a way in regex to match every \s between /- and -/ ?

#

(for example I would like "/-hello how are you-/ another text here" to be replaced with "/-hello+how+are+you-/ another text here")

azure mason
#

/-(?:[^\s]?(\s+))*-//g

#

wait no uh

faint flare
azure mason
#

try tgat

#

im on mobile lmao

faint flare
#

ok thanks, it doesn't work

viral roost
faint flare
#

I have an error with this

viral roost
#

select ecmascript

faint flare
#

ow yea sorry

#

it works, thanks, lmao I'm trying to do one for like an hour and you do it under a minute πŸ˜‚, I'm so bad at regex, at least I learned stuff

green vessel
#

CAN U HELP ME CODER

#

I WANT FLY HACK IN FORTNNITE

#

PLS

untold briar
meager snow
cedar marsh
civic stone
flint oxide
manic junco
amber mantle
pulsar harbor
#

spreading the news that vim's creator died

#

From the splash screen:

 Vim is Charityware. You can use and copy it as much as you like, but you are encouraged to make a donation for needy children in Uganda. Please visit the ICCF web site for more information: https://iccf-holland.org 

https://iccf-holland.org

dull magnet
#

yeah it's very sad

fallen flint
#

rip

green vessel
#

funneh changed badeg nam

manic junco
#

rip

patent lynx
#

how can i make my own plugin

pulsar harbor
#

once you've figured that out make a pr

patent lynx
#

bruh

proud valley
worthy frost
#

how could i listen to a message being sent,
then change the content without having to edit it (to prevent selfbotting)

#

as in stop it from happening all together, run some code, then send it (this applies to 2 usecases i need this for)

untold briar
#

what

worthy frost
#

yea that wasnt a very good way of wording it lol

#

i know what would help, a diagram drawn in ms paint :D /hj

dull magnet
#

what exactly are u trying to do

worthy frost
dull magnet
#

many plugin examples exist for that

worthy frost
#

could you point me to one?

chrome elbow
stuck falcon
#

regexr is pretty buggy

#

it doesn't report errors as nice as regex101 as well

shrewd glacier
#

any suggestion how to introduce persistency for a plugin? writing data to json or in any format as long as i can persist data

dull magnet
#

settings

#

or DataStore

viral roost
#

settings for convenience, datastore if written frequently/you want to store large amounts of data

dull magnet
#

Settings:

  • small data
  • synced across devices
  • json values only
  • user can easily edit this
  • generally only for like the name implies settings
  • synchronous aka blocking, which if used too much could possibly cause lag

DataStore:

  • can store large data (many gigabytes technically)
  • any cloneable js structures (maps, sets, dates, etc)
  • not synced
  • asynchronous / non blocking
shrewd glacier
#

how exactly does DataStore work? what is its structure? im guessing its basically one big map so that each plugin can access "their own DataStore"?

dull magnet
#

it's just indexeddb

rapid gazelle
#

I'd like to try and change the gradient on the coding to make it a blue to cyan to purple instead of gray but I'm completly lost on how to do it, can anyone help?

chrome elbow
rapid gazelle
#

oooh

#

ty

cobalt prism
foggy silo
#

Hello,
I'm trying to create my own plugin. I checked the github with examples but I can't figure out exactly how it works. I searched on my own Vencord to find the items but I can't.
If someone could help me, I would appreciate it. Thanks.

green vessel
foggy wyvern
pulsar harbor
#

You call it no updates, I call it unintentionally immutable os

pulsar harbor
#

So useful

#

It can also show how it matches step by step

#

Which is cool for attacking evil regexes ig

#

Lol

#

After debugging regex for way too long you'll instantly recognize the sidebar from ptsd

dull magnet
#

i never use the site

#

i just write regex in ide and they usually work

pulsar harbor
#

Based af

#

Actually the only thing it's useful for

pulsar harbor
#

Do that with code too

#

Write + pray it works

#

Wat

#

Compile deez nuts in your mouth

cerulean orchid
#

horror

#

what

#

oh

#

i dont trust chat gpt to generate coherent results

#

me when copilot

#

people have too much of a reliance on ai

#

i watched someone dump their bf for an ai

#

yeah but after having a back and fourth of more than 10 messages it starts to get incoherent

cerulean orchid
pulsar harbor
pulsar harbor
#

How do people make money off these things

cerulean orchid
#

all i know is it was free

pulsar harbor
#

Ive tried making an ai thirst trap but the problem is ive never seen an actual thirst trap so idk what to write as a prompt

cerulean orchid
#

dear god why is this a thing

pulsar harbor
#

You could always just not pay if it's not free

pulsar harbor
#

Proud grapheneos user

#

Will not use sandboxed gapps

cerulean orchid
#

this is fucking sad

#

why do these services work

pulsar harbor
pulsar harbor
cerulean orchid
#

they are very clear at avoiding the "gf/bf" term

pulsar harbor
#

terry davis: $0
linus torvalds: until it got popular, $0
ven: $0
these idiots who connect openai api to the sims: insta cash

#

The stereitype of tech startups being out of touch geeks is wrong because these are all clearly made by businesspeople 😭

cerulean orchid
#

i mean sure ive vented into clyde, its better than venting into the void but

#

i havent treated ai any more human than that

pulsar harbor
pulsar harbor
shadow ruin
#

@trail ginkgo how do i just let the user download a file with caddy

#

like

example.com {
  //literally just respond with an image in a specififc path
}```
meager snow
#

yay or nay?

cunning imp
#

fair price

meager snow
#

it's even cheaper in € SKULL_SKELETON

tall kiln
green vessel
#

quick question
how do you fetch discord's webpack modules these days
like I'm trying to get the logout function without a client mod and in betterdiscord I just did BdApi.findModuleByProps("logout") and got its module
and I tried a million other things but can't seem to fetch it

lone panther
#

i dont have a snippet on me, but its the same as it always has been (since the webpack update anyways)

woven lion
#

first result on google :P

green vessel
#

but for some reason betterdiscord is able to get it

woven lion
#

np

green vessel
#

oh yeah also how do you start learning reverse engineering discord's internals

woven lion
#

personally i started with vencord funnily enough

green vessel
#

thing's pretty interesting but I have no idea what to do

woven lion
#

it bundles the react devtools as part of the install, so you can go through and start inspecting react components

#

and find the related source code

#

then you could copy/paste those components out of devtools and into vscode

#

and start renaming variables

#

then you slowly build up a bigger picture on what the original code behind it was

#

though, without vencord, a lot of the reverse engineering effort is mainly deducing what certain variables are and giving them better names

#

when you give them better names, it becomes so much easier to understand how the code works

green vessel
#

noted

#

thanks for the info

woven lion
#

np

steep vapor
#

nice name jawdroppinbro

woven lion
#

lmfao

green vessel
cedar olive
#

I personally never renamed variables lol

dull magnet
#

same lmao

silk sorrel
#

same
I shrimply rename them in my head

wooden dragon
#

anyone knows if discord already makes good use of webworkers?

trail ginkgo
dull magnet
#

they use them for few things but not much

wooden dragon
#

thinking about injecting partytown, but no idea if it'll actually improve things

#

it probably won't work anyways cuz I bet it'll mess up the webpack module thing

trail ginkgo
#

not sure how partytown works but is it different than just putting things in a web worker

wooden dragon
#

Partytown is different. It allows code executed from the web worker to access DOM synchronously. The benefit from this is that third-party scripts can continue to work exactly how they’re coded.

#

the only difference afaik

trail ginkgo
#

wth

#

thats interesting

#

oh the way they do that is so interesting

wooden dragon
#

Yeah, I remember using it once with svelte and now wondered if injecting it into discord could make stuff run better across multiple threads

#

I'll just give it a try now

trail ginkgo
#

doesnt sound fruitful but sounds fun to try

wooden dragon
dull magnet
#

no it can't

#

generally there's not much point in moving stuff to workers unless it is very long running or cpu heavy

like perfect use cases for workers are image manipulation and such

#

the overhead of serialisation / ipc isn't worth it

wooden dragon
#

hmm oki ;-;

trail ginkgo
#

im curious if she can get large flux events to not block the paint thread

#

like channel switching

pulsar harbor
dull magnet
#

no

pulsar harbor
#

O-oh

#

Okay

dull magnet
#

they are somewhat synonymous

#

but (un)marshalling is generally transforming too, like json string to object

#

whereas in that case the data is just converted into bytes then converted back to a object

dull magnet
#

they basically mean the same tbh

trail ginkgo
#

this is almost real

olive plume
#

hi

#

how do i achieve mixins

#

i want to fire an event whenever i send a message

#

a

#

i could try to listen to the messages api endpoint firing but i have no idea how to do that

#

and how to cancel and do my own logic

#

hmmm

steep vapor
olive plume
#

do i redirect the call

#

or smth

steep vapor
#

no idea either

olive plume
#

aueegghhh

trail ginkgo
#

are u trying to modify the content, or just stop the message from sending

olive plume
#

i want to automatically add something at the end of my msgs

#

like a signature

#

this server is more unprofessional than my dev team

chrome elbow
trail ginkgo
#

that was random

broken mesa
#

is it possible to change the background colour of the spotifycontrols plugin?

wooden dragon
#

I'm sure

#

You just have to override the style

broken mesa
#

my ass does not know how to do that

viral roost
#
#vc-spotify-player {
    background: red !important;
}
#

replace with whatever color

broken mesa
#

ty

viral roost
#

nvm

#

i fucked it up