#🧩-plugin-development

1 messages · Page 47 of 1

green vessel
#

i dunno where pluginHelpers is

amber mantle
#

VencordNative.pluginHelpers.yourPluginFolderName (with the first letter capitalized)

floral plaza
#

^

green vessel
#

so i need to import it through pluginHelper?

green vessel
# floral plaza <https://github.com/Vendicated/Vencord/blob/main/src/plugins/openInApp/index.ts#...

tried doing it and im getting 2 errors now.
first are

Property 'readdirSync' is incompatible with index signature.
    Type '{ (path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false | undefined; } | BufferEncoding | null | undefined): string[]; (path: PathLike, options: { ...; } | "buffer"): Buffer[]; (path: PathLike, options?: BufferEncoding | ... 2 more ... | undefined): string[] | Buffer[]; (path: PathLike,...' is not assignable to type '(event: IpcMainInvokeEvent, ...args: any[]) => any'.
      Types of parameters 'path' and 'event' are incompatible.
        Type 'IpcMainInvokeEvent' is not assignable to type 'PathLike'.
amber mantle
#

is that in main file cause dont

green vessel
#

oh it's not, it's a class.

floral plaza
#

what's in the native file

amber mantle
#

anyways
native folder/native.ts = native code
everything else = plugin code (including the native import)
-> Native.whatevermethod

green vessel
#

just this:

/*
 * Vencord, a Discord client mod
 * Copyright (c) 2024 Vendicated and contributors
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

export { readdirSync } from "fs";
export { join } from "path";
amber mantle
#

instead export a method that calls those

green vessel
#

alr

#

Now it doesnt accept arguments

// native/index.ts
import { readdirSync } from "fs";
import { join } from "path";

export function nativeReaddirSync(path: any) {
    return readdirSync(path);
}

export function nativeJoin(path: any) {
    return join(path);
}

// changed to 

export function nativeReaddirSync(path: any, ...args) {
    return readdirSync(path, ...args);
}

export function nativeJoin(...path: any) {
    return join(...path);
}
#

oh nvm

green vessel
#

hi

balmy sky
#
            find: "g.default.Messages.EMOJI_MATCHING",
            replacement: {
                match: /autocompletes:t/,
                replace: "autocompletes:t.filter(emoji => emoji.guildId != null)"
            }

im trying to patch the autofill so that default emojis aren't included in the autofill, only custom ones. This patch works with the autofill visually but when i press tab, it sends the default emoji with the same name 🤔

balmy sky
#

I did it yippee yippee yippee yippee yippee

green vessel
thorn drift
green vessel
cerulean bane
#

Ur fake 😥

golden shore
#

working on a (much simpler) discord mod with a couple friends rn just as a side project. We've been looking into making custom settings sections for plugins, themes, etc. So I took a look at vencords source (Vencord/src/plugins/_core/settings.tsx Line ~76) and to me it looks like they're injecting react into alr compiled html. Am I missing something?

floral plaza
#

it's injecting into the settings sidebar's react props

trail talon
#

should i make a plugin that allows you to like view github issues and PRs within discord

jagged briar
#

Wish I thought of that sooner

#

I would use it frfr

trail talon
#

ill work on it rn then

pure temple
#

maybe better github embeds would be useful but i don't see the purpose of in-app issues

#

it'd be pretty funny if there was a way to automatically turn #68 into an issue link... xd

dull magnet
#

the text replace in question:

cedar olive
#

text replace works

#

but what about a plugin that lets you set a github repo for every server

#

and when you do #68 it uses that link

jagged briar
#

or a more rich embed that shows more stuff

cedar olive
#

that too

dull magnet
#

horror

#

richer embed requires ephemeral message

jagged briar
#

i meant like the one that MessageLinkEmbeds does

strong tide
#

i checked in console and this error pops up every time i try to screenshare, and second pic is what my screenshare looks like when i open it. any mods causing this?

dull magnet
#

looks like a discord issue

#

try to reinstall

viral roost
#

happened to me too pretty sure discord broke something

#

sharing entire screen instead of app fixed it

crystal bolt
#

is there a vencord developer documentation (i tried to find one but i couldnt find any)

strong tide
dull magnet
strong tide
#

can you just answer me rq

versed osprey
strong tide
balmy sky
#

Still on this, i literally still have no clue somehow walterDIES

golden shore
#

if so could you send it

versed osprey
swift delta
#

coding 👍

brittle nacelle
dull magnet
#

v+ needy @strong tide

old badger
#

hello you beautiful people is there a way to prevent a message from being sent ive got addPreSendListener but other than that im confumbled

tired oar
# balmy sky Still on this, i literally still have no clue somehow <a:walterDIES:117263649864...

i think its here

shouldNotifyForSelectedChannel: function() {
                return D
            },
//...
function D(e, t) {
            var n;
            let l = g.default.getChannelId(I.default.getGuildId());
            if (l !== t)
                return !1;
            let a = C.default.getChannel(t);
            e.type === x.MessageTypes.THREAD_STARTER_MESSAGE && (a = C.default.getChannel(null == a ? void 0 : a.parent_id));
            let s = N.default.getCurrentUser()
              , i = N.default.getUser(null === (n = e.author) || void 0 === n ? void 0 : n.id);
            return !(null == a || null == s || null == i || a.isManaged() || i.hasFlag(x.UserFlags.SPAMMER) || E.default.isBlocked(i.id) || i.id === s.id || S.default.getStatus() === x.StatusTypes.DND /*<------ here*/ || _.default.allowNoMessages(a)) && !0
        }
oblique lark
#

mojang the type of devs to make a getter for a public field

#

ok literally what the fuck is this

stuck herald
#

one here is not like the others

stuck herald
oblique lark
#

yeah

#

net.minecraft.world.level.LevelReader

stuck herald
#

that's a bit depressing

jagged briar
#

Maybe that’s why they take so long to add anything

thorn drift
#

average java moment

pure temple
#

you can't see the comments they wrote

#

if there's something wrong with the decompiled version it's not their fault

oblique lark
#

it's still missing the actual deprecated interface on the first one

potent fox
#

not source but community recreated mappings

#

it still counts as source tho

vast karma
#

There's official deobf mappings too

#

I think most modders avoid them to avoid legal issues, though I never understood what's those issues would be

#

I think they just don't want to have to rename all function calls in their code

trim cedar
vast karma
#

No idea, I never looked into the major apis much

fathom carbon
#

fabric uses it’s own mappings called yarn

austere mauve
dull magnet
#

what loicense is it

#

free software license or proprietary

austere mauve
#

proprietary

dull magnet
#

we will pirate it

#

​ 🛸
ba

austere mauve
#

apparently the issue is that its too vague

#

(when a license doesn't cover something it means all rights are reserved to the copyright holder)

#

idk why they didn't go with a normal license if their intention is clearly to make it available for everyone

amber mantle
#

average forge

fathom carbon
#

🔥🔥🔥

green vessel
#

i dont rly know what im doing cuz i dont know any js, but how would i go about making a plugin that would allow a local rpc client to specify the application name and activity type when sending a SET_ACTIVITY packet for personal use?

amber mantle
#

(use customrpc plugin) flux dispatcher

remote kestrel
#

@wide obsidian

#

this is actually nice

#

rust if it was good

wide obsidian
#

serenity os

#

install

remote kestrel
#

soon

potent fox
#

not really forge

#

forge itself uses LGPL 2.1

stuck herald
stiff cargo
#

Very rusty

glass oracle
#

the syntax is a bit bla

supple walrus
#

is there a way to see logs of ppl i accepted friend reqs of?

supple walrus
#

?

#

not talking about pending friend requests

#

yk when u accept someone's friend req

#

it shows "you accepted x's request"

#

but goes away after reloading

#

anyway to see it again?

dull magnet
#

no

#

and not coding

glass elbow
#

decor not let me sign up pls f*cking hellllllllllllllllllllppppppppppppppppppppppppppppppp

dull magnet
#

v+ needy @glass elbow

balmy sky
#

Wtf does that do lmao

steady knot
#

adds needy for support role on the person and locks them into support channel

vague echo
#

anyhow I can get all common members between two guilds using webpack?

#

GuildMemberStore from common doesn't seem to give me what I want which is all mutual members

cedar olive
#

you need certain permissions to be able to fetch all members from a server

#

I forgot which specifically

#

so no, you can't

vague echo
#

oh

#

thanks for the insight though

dull magnet
#

you can get the mutual members that are cached

#

but it will be incomplete if the servers aren't small

#

if you have audit log (iirc) permissions in both then you can fetch all members

vague echo
#

I don't in one of them so I guess I'll leave this now

dull magnet
#

what is this for anyway?

smoky basin
dull magnet
#

how'd it even get ddosed by some kid

smoky basin
#

i have no idea it's behind cf

dull magnet
#

reviewdb often gets attempted to be ddosed but it usually doesn't do much unless caddy shits itself but we're gonna switch back to nginx soon to fix it

#

go is so efficient that it doesn't affect it much

#

only caddy explodes sometimes for some reason

dull magnet
smoky basin
#

i really don't know wtf was up right bc

#

i checked unifi and there was nearly no traffic

#

as in the ddos almost wasn't reaching my network

#

but cf says this

#

they managed to get the cf tunnel down

#

idk its all weird

stiff cargo
#

I wish cloudflare could just say what you’re allowed to use the tunnel for

#

I kinda want to route my Plex through it but it feels sketchy

smoky basin
#

the tunnel is set up in a docker system to only go to decor

dull magnet
#

280m horror

pure temple
dull magnet
#

i hate js

#

i want it to return ["foo", "bar baz"]

dull magnet
#
const stream = createReadStream(file, { autoClose: true });
await finished(stream.pipe(hash));
#

why does this never resolve

pure temple
# dull magnet i want it to return `["foo", "bar baz"]`
if (string.length === 0)
    return [];

const splitPoint = string.indexOf(" ");
if (splitPoint === -1 || splitPoint === string.length - 1)
    return [string];

return [string.substring(0, splitPoint), string.substring(splitPoint + 1)];

😍

#

worst thing i've written in my life

dull magnet
pure temple
#
const splitPoint = string.indexOf(" ");
return [splitPoint === -1 ? string : string.substring(0, splitPoint), splitPoint !== -1 && string.substring(splitPoint + 1)].filter(str => str && str.length > 0);

blobcatcozy

dull magnet
#

what the hell

jagged matrix
#

when did this channel exist it just appeared for me now

dull magnet
#

Your branch is based on 'origin/main', but the upstream is gone.

#

WHAT

oblique lark
chrome elbow
#

pro gamming

dull magnet
#

lets go

dull magnet
#

but i didnt end up needing it anymore WatameStareConfused

jagged matrix
dull magnet
#

i renamed it in hopes that it will reduce the amount of idiots asking for support

jagged matrix
#

i would’ve too tbh

frigid bay
#

pro gamming

dull magnet
#

mb, fixed

frigid bay
#

thats better

fathom carbon
jagged sierra
#

#faq message

Can’t soundboard be imitated by transmitting the requested sounds directly into the microphone; bigger upload size be imitated by uploading the file to an external source and sending the link instead; and animated avatars be imitated via a custom server that will send avatars to other people with the plugin installed trollshrugguesswhat

jagged sierra
#

It’s not impossible though

#

So the message is wrong

#

And you should feel BAD WHAT

trim cedar
#

It isn't but it's unnecessary

#

Why would you go through so much effort when you can literally just use a normal soundboard

#

It's no different from a normal soundboard at that point

jagged sierra
#

Ik

#

But it’s not not possible blobnerd

trim cedar
#

You know that the FAQ Message is talking about unlocking the actual features

#

Not immitating them

#

You can also reverse the Discord API and make your own instance

jagged sierra
trim cedar
#

But that's not what people want when they talk about "free nitro"

jagged sierra
#

Emotes are imitated with fakenitro

trim cedar
#

Yeah but in a sane way

#

If you're so keen on "it's possible though" then just contribute it

jagged sierra
#

Nah I have other shit to do

#

The message should just say it would be unnecessary or insane or whatever the fuck

#

Cause not possible is wrong normal2

trim cedar
#

I can't belive I'm having this conversation lmfao

balmy sky
#

But really fuckin clunky and pointless

green vessel
austere mauve
#

this is horrible practice, you should really avoid this

green vessel
austere mauve
#

you should not modify network requests

green vessel
austere mauve
#

no one should

green vessel
austere mauve
#

what is bro on

#

plugins shouldnt do this. this very likely wont be added as an api

viral roost
#

worst idea ive seen in a while

#

just do it properly and only modify the request you care about

austere mauve
#

what she said

green vessel
#

Also you still have to check the URL for the request you want to modify, this is simply wrapper for it

austere mauve
#

vencord has a really cool feature called patching

green vessel
#

Adding that much code with patching is the most stupidest idea I heard

austere mauve
#

have you looked at like any plugin

viral roost
#

just call a method within your plugin from a patch?

green vessel
austere mauve
#

because you dont need to hook into functions like that if you patch properly

green vessel
austere mauve
#

patch whatever calls the api

#

oh my god

green vessel
#

Sometimes you don't know what calls the requests exactly

austere mauve
#

skill issue

viral roost
cloud goblet
#

shiggy hi

green vessel
dull magnet
#

playing sound through the microphone is not possible on discord desktop. only on web

#

and uploading to external file host is not the same as uploading to discord

jagged sierra
#

You can make it look the same kinda like with emotes shrug

dull magnet
#

false

#

discord won't even embed media above a certain size

#

and it'll always just be a link

jagged sierra
#

Yeah ik that but it won’t embed those with nitro either right

#

Also this is just for images/video/audio

#

Text files just get embedded with a simple file icon and name

#

That can easily be imitated

dull magnet
#

quit yapping buddy

jagged sierra
dull magnet
#

the entire point of fake nitro is that it works without requiring the receiver to have the plugin

jagged sierra
#

Well for receivers they would just be able to click the link

#

Like with emotes

#

Fakenitro users see an discord emote they can click on and stuff

#

And regular users just see an image

jagged sierra
carmine spade
#

maybe i can help

green vessel
carmine spade
#

ah

#

then yea you don't need to hook into the http calls for that

#

there's a convenient function addInterceptor() which lets you intercept and modify flux events

#

no wait that wasn't the name

#

one sec

#

nvm yeah it's addInterceptor()

dull magnet
#

you can just patch the MESSAGE_CREATE handler

carmine spade
#

or that

dull magnet
#

adding global flux interceptors seems like a bad idea

green vessel
carmine spade
#

but if he's absolutely unwilling to use patches and only wants it for himself then interceptor is always a solution

carmine spade
#

so if you make a proper patch then it will work even after you reload

#

which field do you want to change exactly?

green vessel
#

Also what do you mean patch MESSAGE_CREATE handler? You mean patch the function that listens to MESSAGE_CREATE?

dull magnet
#

search discords code for MESSAGE_CREATE:

green vessel
#

How wait

carmine spade
#

open devtools, press ctrl shift f

green vessel
#

that will search for elements

carmine spade
#

nop

trim cedar
carmine spade
trim cedar
#

Ctrl Shift F will also search them

dull magnet
#

what exactly is it you're trying to do anyway

green vessel
#

thats nice i found ittt but like what 💀

carmine spade
#

assuming you want to change how the message is displayed in chat, you should find the handler that's responsible for that functionality and make a patch which lets you modify the data

green vessel
#

is this the right one

carmine spade
#

honestly i don't know, breakpoint it and see

green vessel
#

you can breakpoint?

dull magnet
#

yes

carmine spade
#

ye you can click the bar on the left

#

then you can use the console to modify the variables, just like if you were inside that function

dull magnet
#

don't break for too long or your discord will reload AoV_vioGiggle

green vessel
#

ok just saw it happen

green vessel
#

uhhhhh

#

anyways if i wanted to create patch to like insert my code into the function how i would do that

dull magnet
#

what is it you're trying to do

green vessel
#

modify content to turn some stuff into other stuff

carmine spade
#

im guessing you're trying to spoof other people's messages?

dull magnet
#

be more descriptive

carmine spade
#

then what

green vessel
#

find certain strings and replace them

dull magnet
#

so text replace but for other people's messages?

green vessel
#

yes

#

message.content.replace("xddd", "replace")

#

is that even js function

#

idk

dull magnet
#

i don't think actually changing the message objects is a good idea. it'd be better to patch the message renderer

green vessel
#

wouldn't that mean it would break replying since it would show original message

dull magnet
#

?

#

use react devtools to inspect a message then find the highest element in the tree that is still the message and see its code

green vessel
#

if I only modify the code to render messages, the content you see when you reply wouldn't be modified

dull magnet
#

then enable it?

green vessel
#

how?

stiff cargo
carmine spade
green vessel
#

ok

stiff cargo
#

its usually very far to the right

dull magnet
green vessel
#

or its just not there

carmine spade
#

it should look like this

#

make sure you've done a full restart

green vessel
#

yeah i def dont have that

#

i did

dull magnet
#

requires a full restart

carmine spade
#

right click system tray icon -> Quit Discord

#

then reopen it

green vessel
#

ok it was hidden in some weird seting

#

ok now

carmine spade
#

now select a message, then find the highest parent which is still the message component

green vessel
carmine spade
#

now click dis

#

and you should have the function responsible for the message component

green vessel
#

ok I do have

carmine spade
#

now you should be able to patch it to change what's being rendered

green vessel
#

yeah once I understand how to patch then yes

stiff cargo
carmine spade
#

i will try to explain, maybe you will even understand xd

#

a patch consists of find and one or more combinations of match and replace

#

find is any unique string that's only present in the webpack module that you're targeting

dull magnet
#

cursed

stiff cargo
#

i didnt have vesktop set up in dev mode when i started playing around

carmine spade
trim cedar
#

Can Kitware fix their fucking Gitlab

#

Its soooo slow holy shit

carmine spade
#

or .default.Messages.MESSAGE_A11Y_ROLE_DESCRIPTION

#

(just examples, might not actually be unique enough)

dull magnet
#

tbh patching is a really simple concept you just

  • find a find which is a unique string in your module. pick any string that seems unique in your target module (and test that is indeed unique)
  • regex replace the source code in your target module
carmine spade
#

because you don't want your regex to accidentally break 30 other scripts

green vessel
#

seems to be unique enough

dull magnet
#

yep

green vessel
#

ok and what if i wanted to insert my code

#

not modify

dull magnet
#

regex replace can do that

green vessel
#

how

dull magnet
#

have you never used replace in your life

green vessel
#

i did

#

do you want me to match a code and just replace it with the code and new lines

dull magnet
#
"hello world".replace(/hello/, "hello banana") // => hello banana world
trim cedar
carmine spade
#

that way your regex isn't cluttered

#

vencord has a convenient identifier $self which you can use to make it reference your module in the replace text

green vessel
carmine spade
#

ye

dull magnet
#

you can't match that

green vessel
#

whar

dull magnet
#

show the code you want to patch

carmine spade
#

you can match the stuff after it

green vessel
carmine spade
#

here you could match the let {id: g, message: I, object

#

and insert your call in front of it

green vessel
#

seems complicated but why

carmine spade
#

assuming it's not repeated in other functions of the same module

green vessel
#

why not the first line

trim cedar
#

best to match things that are not minified so that it doesn't break as easily

dull magnet
carmine spade
trim cedar
#

t, n, l may be completely different random names in the next version

carmine spade
#

these specific names not of course

#

but when matching, you will ignore variable names

#

since they can change

green vessel
#

uhhh

carmine spade
#

vencord has a \i regex identifier for matching a variable name

green vessel
#

so i can match let {id: g, message: I and infront of it call my function?

carmine spade
#

ye

dull magnet
#

i wouldn't do that

#

check where that func accesses I.content

green vessel
#

how do you know its message

carmine spade
dull magnet
carmine spade
green vessel
#

oh

#

oh right

#

here it deserializes

#

the properties

dull magnet
# carmine spade

oh this calls into their parser, passing the raw message object

#

you might want to patch that D.default instead

green vessel
#

so if I wanted to call my method between let r; and let {id: g, message: I how I would exactly do that

#

eslint what is your problem

carmine spade
green vessel
#

what in the world is that

carmine spade
#

it matches the non-prettified version of that code, so this

#

and inserts your function call between let r; and let{id

green vessel
#

why the $2 thing

carmine spade
#

those are regex capture groups

#

aka what's inside the () brackets

green vessel
#

what

carmine spade
#

uhh have you used regex before

dull magnet
stiff cargo
#

:)

green vessel
frigid bay
#

and u never used capture groups?

carmine spade
#

and u want to insert dis before `like

#

you make a match like this

#

then take the first one

#

then put "dis" between them

#

then take the 2nd one

#

that's basically what you do with code patches

green vessel
#

(function\((\i\)){var \i,\i,\i;let \i;) is first group
(let{id:\i,message:\i) second group

and the $2 means we replace in between those groups?

green vessel
carmine spade
#

each $n refers to one of the () capture groups

#

so in your new code it'd be $1$self.yourFunction()$2 if anything

#

second of all

#

that regex will match a lot of random things

#

you should ideally go with vee's suggestion and match the D.default call further below

viral roost
#

also you kept in the spaces from the prettified version, those aren't there normally
you can and should check in patch helper if your patch matches anything

carmine spade
#

yea if you build vencord with pnpm watch you will get a Patch Helper section in settings

green vessel
#

is this error stopping me from building bc it seems like

viral roost
#

whats the error when you hover over it

green vessel
#

i already tried click resolve, thats what it added but it still screams

carmine spade
#

have u tried pnpm lint --fix

green vessel
#

it matches two things

green vessel
#

didn't help

#

Patch helper says it would work but wasnt patched weird

viral roost
green vessel
shy fossil
#

yo, would it be possible to make a plugin to replace discords file uploader with a custom one? like the ui and stuff stays the same, but it uploads to a custom server and just sends a link

jagged matrix
#

not to bring down your idea or anything, but why would you want that

shy fossil
#

i have a self hosted file server and i absolutely hate the 25mb limit

jagged matrix
#

ah

#

well personally idk

#

since i specialize in html and css, sadly not typescript

jagged briar
green vessel
#

Why are my patches just not applying (changes arent even seen in source), patch helper said it found and know where to place things so I'm confused

jagged briar
#

Is your plugin enabled

green vessel
#

Yes

#

well uhh

jagged briar
#

Btw your patch does remove important stuff it probably shouldn’t

#

Also your changes appear in a file called WebpackModule(module id)

#

Not whatever it was before the patch

green vessel
#

its working...

#

somehow

#

it deleted the one thing but doesnt seem to be issue uh oh

#

seems to be working

green vessel
#

how I would regex this to insert new line?

jagged briar
#

(get\(\i\)\{)(return this\._cachedMessages\.get\(\i\))

#

$1console.log(“whatever”);$2

green vessel
#

well that makes sense

#

can I know why are you doing $1 and then $2

jagged briar
#

Those are capture groups

#

Basically inserts whatever’s in the ()

#

$1 is the first group, $2 is the second

green vessel
#

then what are you inserting into the second

jagged briar
#

And there’s some other ones, look in patch helper

green vessel
#

wait wouldnt you replace the get()

jagged briar
green vessel
#

you said you are inserting into 1 (get(e){) the console.log(“whatever”);

jagged briar
green vessel
#

ohhh

#

so like $1 is the get()

jagged briar
#

Yeah

green vessel
#

ourcode

#

and then the remaining code

jagged briar
#

Yes

#

That’s called a capturing group

#

Define it in the regex with () and use it with $index

green vessel
#

no i was only confused about the $ use

jagged briar
#

Well now you know hopefully

green vessel
#

👍

green vessel
#

finally i made it work 😭

jagged briar
#

dont use variable names in finds

#

cause as soon as discord updates your patch will break

#

anytime you see a variable like a, t, N, use \i

#

for finds you cant use that though, find something else

dull magnet
#

you complained about lack of documentation yet you didn't even read the documentation that is available

#

SpeeWhat you confuse me

#

because it specifically tells you how to write patches without hardcoding minified names

fathom carbon
green vessel
cedar marsh
minor jolt
green vessel
#

I have a script that is being fetched from discord, is that possible to patch?

balmy sky
#

Yes

#

Patch the fetching

sacred crescent
#

Hi, how to pin discord servers ?

frigid bay
shrewd yacht
#

so i basically want to, when a new message is sent, replace the content of the message with it’s raw content (document.getelementById("message-content-MESSAGEID").text="RAWCONTENT")
that or for every message, replace the content of the message with it’s raw content (document.getelementById("message-content-MESSAGEID").text="RAWCONTENT") but that would probably be too laggy
now i don't know how to do an event on a new message, then i don’t know how to get the id of that message, then i don’t know how to get the raw content. i tried looking into the code of https://vencord.dev/plugins/ViewRaw but i didn’t get anything out of that (well skill issue probably)
it has some code like that

addButton("ViewRaw", msg => {
            return {
                label: "View Raw (Left Click) / Copy Raw (Right Click)",
                icon: CopyIcon,
                message: msg,
                channel: ChannelStore.getChannel(msg.channel_id),
                onClick: () => openViewRawModal(msg),
                onContextMenu: e => {
                    e.preventDefault();
                    e.stopPropagation();
                    copyWithToast(msg.content);
                }
            };
        });
``` (from <https://github.com/Vendicated/Vencord/pull/275/files>) and i can’t figure out where the fuck that `msg` comes from (well the frist one is just a variable that is set to the return value of that anonymous function but the rest??? <https://github.com/Vendicated/Vencord/blob/main/src/plugins/viewRaw/index.tsx>)
#

can someone help me?

#

btw, it doesn’t necessary need to be a vencord plugin, it could just be a tampermonkey plugin

sudden citrus
#

anyone know how to make tampermonkey scripts

#

JSON.stringify(this.$nuxt.$children[2].$children[0].$children[0].elements)

sudden citrus
#

is this like

#

good wayo f doing things

#
    var that = this.$nuxt.$children[2].$children[0].$children[0];
    var crafter = that.craft;
    that.craft = (e, n) => {
        crafter(e,n);
        console.log('uwu');
    };```
green vessel
shrewd yacht
green vessel
shrewd yacht
#

i think i want to do MessageStore.addChangeListener()?

sudden citrus
#

how to run tampermonkey on window.onload

#

it's not the same as

#

@run-at

#

@require

#

h

#

m

shrewd yacht
sudden citrus
#

what is this

remote kestrel
#

@dull magnet is crystalline broken cause it just does nothing when i set the extension to use it

dull magnet
#

() => alert("test")

shrewd yacht
#

thanks

#

it doesn’t do what i want and makes discord reload forever tho

#

i don’t know what i’m doing

shrewd yacht
#

oh i think i would need to try to catch when discord renders the message and replace that with rendering it raw

shrewd yacht
#

i found that this.renderMessages = new u("\uD83C\uDFA8","React Render Messages",!0), but i don't think it’s usefull

dull magnet
#

anyway what r u trying to do

#

you likely need to just patch the message component

shrewd yacht
#

yes, i’m trying to make it so there is no rendering done on the messages, so all messages are “raw”

#

i want to see the messages as they were typed, exactly

#

the problem is that i can’t use react devtools for that right? so i’ve been trying to find the function that renders the message with ctrl+shift+f in dev tools

#

oh i can pause script execution, send a message with an alt, and then step through the function calls

#

i don’t even need an alt

dull magnet
#

inspect message component

#

see code

shrewd yacht
#

i see, thanks. that led me to some var h = i.memo(function(e) { in a file that has been patched by messagelogger. so i’m not too far

#

“Webpack Module 497880”

glass oracle
#

@austere mauve :)

sudden citrus
#

window.onload

#

okay

#

cool

#

no

#

why does it not work

#

i know why but

#

ok

#

also require isnt working

#

ugh im just gonna setTimeout

#

okay maybe it was because i didnt have // @grant unsafeWindow

#

IT WORKS

#
// ==UserScript==
// @name         Infinite Craft autosave
// @namespace    http://ow0.me/inf
// @version      2024-02-01
// @description  Yuri Empire [First Discovery]
// @author       Ina
// @match        https://neal.fun/*
// @icon         https://ow0.me/inf/icon.png
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        unsafeWindow
// @require      https://neal.fun/_nuxt/992eef7.js
// @require      https://neal.fun/_nuxt/dcc1889.js
// @run-at       document-idle
// ==/UserScript==

var yuri = () => {
    'use strict';
    console.log('establishing yuri empire');
    var that = unsafeWindow.$nuxt.$children[2].$children[0].$children[0];
    // load
    var savedElements = GM_getValue("elements", null);
    if (savedElements !== null) {
        that.elements = savedElements;
    }
    var savedDiscoveries = GM_getValue("discoveries", null);
    if (savedDiscoveries !== null) {
        that.discoveries = savedDiscoveries;
    }
    // save
    var crafter = that.craft;
    that.craft = (e, n) => {
        crafter(e,n);
        GM_setValue('elements', that.elements);
        GM_setValue('discoveries', that.discoveries);
    };
    console.log('yuri empire established');
}

window.addEventListener("load", yuri);```
sudden citrus
cedar olive
proud parrotBOT
cedar olive
#

search for the find and you will see the code that does it

polar cave
#

Hi, im trying to make a script that uses the shiggy api that when i type /shiggy it gets a url then embeds it here to discord, but i get an error and i cant see it cuase it says this

balmy sky
#

Send the script

polar cave
#

ok

#

Import definePlugin from "../utils/types";
import { Devs } from "../utils/constants";

async function getShiggyPicture(): Promise<string> {
const res = await fetch('https://shiggy.fun/api/v3/random');
const pictureUrl = await res.text();
return pictureUrl;
}

export default definePlugin({
name: "Shiggy Pictures",
authors: [
Devs.echo
],
description: "Fetches random pictures from Shiggy",
dependencies: ["CommandsAPI"],
commands: [{
name: "shiggy",
description: "Fetches a random picture from Shiggy",
execute: async opts => ({
content: await getShiggyPicture()
})
}]
});

#

I dont know how to send it in the message.txt format sorry, lol

balmy sky
#

The pictureURL is being returned as whatever the fuck this is

polar cave
balmy sky
#

Idfk lmao

#

It's an issue with the api

#

Essentially

polar cave
#

O

balmy sky
#

You're probably getting the wrong property or using the wrong method

polar cave
#

I also made a scipt to get quotes using the quotes api

#

"All difficult things have their origin in that which is easy, and great things in that which is small." -Laozi

#

Use the same method works fine

#

Or that that gets pictures of the sunset

#

But its not really sunsets lol

balmy sky
#

How about just

    commands: [{
        name: "shiggy",
        description: "Fetches a random picture from Shiggy",
        execute: async opts => ({
            content: 'https://shiggy.fun/api/v3/random'
        })
    }]
#

Works fine for me lmao

stiff cargo
polar cave
#

O

#

How do i fix it lol?

stiff cargo
#

You do it like Sam said

#

The shiggy api returns a picture not a link to a picture

balmy sky
#

The api url itself embeds a random image, it's kinda useless to make a request anyway

polar cave
#

O

#

So i just directly display it

#

ok ill brb

stiff cargo
#

You could probably do it using a file upload but I have no idea how to do that…

polar cave
#

Did it

#

Finally

balmy sky
#

At that point could you not just send the link

#

There's no real practical use for a command that just pastes text

flint bronze
#

Isn't there a tags plugin that does this

#

yes

flint bronze
balmy sky
#

Uhhhhhh what

flint bronze
#

Posted to the wrong channel sorry about that

#

(I was last focused here)

balmy sky
#

Ah

shrewd yacht
#

that looks very close to what i’m looking for yeah

shrewd yacht
#

i did

find: '["strong","em","u","text","inlineCode","s","spoiler"]',
replacement: {
    match: /.*/,
    replace: ""
}

to test and it didn’t do anything :(

viral roost
#

are you sure it didnt do anything because the patch failed since it generated invalid js, instead of failing cause it didn't find anything

jagged matrix
#

yo need help

#

I want these to just be beside each other

#

but it aint going beside each other

#

This is the code I have for it

#

im highly confident it isnt my tooltip code, i just cant figure out what would be causing them to do this

vast karma
#

Why don't you just use title attribute for tooltips

#

That's what it's for

#

Also use flex

jagged matrix
#

sadly using flex just makes them snap together vertically

steady knot
#

divs by design stack vertically

shrewd yacht
shrewd yacht
#

i’m not getting Vencord PluginManager Starting plugin RawMessages though

vast karma
shrewd yacht
#

yes

#

and restarted

jagged matrix
shrewd yacht
#

debugging by bleh!

#

works everytime

#

still doesn’t do anything tho

jagged matrix
#

i need them to be in there not going out of the window

shrewd yacht
#

ok so i did

find: '["strong","em","u","text","inlineCode","s","spoiler"]',
replacement: {
    match: /.*/,
    replace: "console.log(\"bleh\")"
}

and it does log bleh in the console

shrewd yacht
shrewd yacht
#

because messages are still rendered the same

#

it does create empty messages for fake nitro emojis

jagged matrix
jagged matrix
#

you're late

balmy sky
#

Don't care xoxo

#

I'll never miss your bad coding pookie <3

#

I'll always be here

jagged matrix
#

i am NOT your pookie!!!!

shrewd yacht
balmy sky
jagged matrix
#

what

balmy sky
#

I am going to smash it

#

With a sledgehammer

#

I am scared

shrewd yacht
#

she is dirty minded

balmy sky
#

For real

jagged matrix
#

i’m probably more dirty minded

#

than you think

shrewd yacht
#

inlinecode s ||spoiler||

shrewd yacht
cedar olive
#

you have to make it not call the render function

#

and instead use the content directly

shrewd yacht
shrewd yacht
#

only problem is that i can’t manage to single out this render function XD

#

thanks for the help btw

shrewd yacht
#

so yeah i have to understand well the code

#

in that file there is a svg path that looks like that. i think it’s the svg when you scroll up and the messages are loading

floral plaza
swift delta
potent fox
#

/run

const (
    one = (iota + 1) & 1 == 0
    two
    three
)
 
println(two)```
worldly oxideBOT
#

@potent fox I only received go(1.16.2) error output

true
potent fox
#

Wait wrong

#

/run

const (
    MathHomework = string(iota)
    TurkishHomework
    CookingHomework
 )
 

println(CookingHomework)
worldly oxideBOT
#

@potent fox I only received go(1.16.2) error output


frigid bay
shrewd yacht
#

cool

#

i’ll stick to stdbool tho

shrewd yacht
#

damn i’m going nowhere with my plugin

shrewd yacht
frigid bay
#

idk but i thought it was funny af so i shared it

vernal gullBOT
shrewd yacht
shrewd yacht
#

oh i know what i could do actually. i could search for strings that are set in the html of a message

#

||like for spoilers||

#

or for timestamps <t:1706953811>

#

damn look what i found

#

i’ll block it with ublock origin to see

#

breaks everything

#

yeah this is literally it

#

so close

potent fox
shrewd yacht
#

yes

#

translations

#

one could maybe use that when they update class gibberish again

glass oracle
#

aaa

astral mantle
#

@potent fox whats up with the weird timestamps on some reviews

{
    "id": 227760,
    "sender": {
        "id": 6178,
        "discordID": "574669003755356162",
        "username": "nebuawa",
        "profilePhoto": "https://cdn.discordapp.com/avatars/574669003755356162/a_7b52c7fed24b53dee880170d7948b31f.gif",
        "badges": []
    },
    "comment": "develope r",
    "type": 0,
    "timestamp": -62135596800
},
potent fox
#

which resulted with every review having timestamp 0 in the database

#

idk why its -62135596800 though

glass oracle
#

overflow :^)

nocturne apex
#

bruh, vencord got hacked..

shrewd yacht
#

yeah, i saw that.. the whole source code got leaked.... the situation is pretty bad right now

grizzled narwhal
#

hello

#

im tryin to fix this

#

but idk how

#

This snippet banishes users back to Message Requests when you close their DM.

Snippet:

channelId="DM Channel ID Here"
;try{await(webpackChunkdiscord_app.push([[""],{},e=>{m=[];for(let a in e.c)m.push(e.c[a])}]),m).find((e=>e?.exports?.default?.getAPIBaseURL)).exports.default.delete(`/channels/${channelId}/recipients/@me`),(webpackChunkdiscord_app.push([[""],{},e=>m=Object.values(e.c)]),m).find((e=>e.exports?.default?.showAlert)).exports.default.openAlertModal({title:"Success",body:"DM has successfully been removed, and added back to Message Requests queue!",confirmText:"OK"})}catch(e){console.log("%c Error!\n%cChannel ID may be invalid (use DM Channel ID. not UserID), or script may be outdated. More information:","font-size: 50px","color: red; font-size: 18px",e)}
shy fossil
teal relic
#

im trying to copy someone's id when clicking someone's message avatar
this is the relevant code, (useClickMessageAuthorAvatar is not passed the author id)

        let f = a.memo(function(e) {
            let {message: t, channel: n, compact: i=!1, groupId: r, isGroupStart: o, usernameProfile: f, avatarProfile: h, setPopout: C, author: p, repliedMessage: m, roleIcon: E} = e
              , g = (0,
            d.useContextMenuUser)(t.author.id, n.id)
              , S = (0,
            d.useClickMessageAuthorUsername)(t, n, f, C)
              , A = (0,
            d.useClickMessageAuthorAvatar)(h, C)
              , _ = a.useCallback(()=>C({
                usernameProfile: !1,
                avatarProfile: !1,
                referencedUsernameProfile: !1
            }), [C]);

this uses the following functions:

        useClickMessageAuthorAvatar: function() {
            return P
        },
        function P(e, t) {
            let n = g("avatarProfile", e, t);
            return v(n)
        }

and this function's call back is called when i actually click the messae

    function v(e) {
        return l.useCallback(t=>{
            // this is where I wanna call my own function
            t.preventDefault(),
            t.stopPropagation(),
            e()
        }
        , [e])
    }

the problem is i only have access to the mouseevent (t), and i don't have any access to the user's id

astral mantle
jagged briar
#

make your selector more specific

#

use parent elements

dull magnet
#

set to random date

#

set to like 2089

#

people will think they travelled to the future

#

wrong channel

stuck rampart
dull magnet
#

no?

#

take a look at the channel list

#

you can figure it out

stuck rampart
#

i thought programming is the right channel i dont really know

austere mauve
dull magnet
stuck rampart
#

had it disabled sry

dull magnet
#

vor vor 9 stunden aktiv

#

discord drunk

shrewd yacht
sudden citrus
#

wait im so confused

#

is this a troll

#

vencord is gpl3

shrewd yacht
sudden citrus
shrewd yacht
# sudden citrus wait im so confused

well aren’t we all. all of the contributors are trying to find out how it hapened. the leak is pretty severe, like everything is released now…

shrewd yacht
#

the only solution was to relicense as gpl3

#

to try limit the damages

olive gulch
#

I'm pretty sure its possible to get the sound board working with freenitro, because of Sound-mojis.
In order play the sound it must send said sound the server must send the audio file to the client.
So basically you request the audio file from discord's servers then you route the audio from the sound-moji to the voice call.

frigid bay
#

try it and see

olive gulch
frigid bay
#

Rip

olive gulch
#

The best i can do would be to have 2 instances of discord open then routing the audio output of one instance to audio input of the olther using QPWgraph.

#

And i don't see why that wouldn't work.

jagged briar
shrewd yacht
olive gulch
olive gulch
jagged briar
#

I meant bypassing the api wasn’t possible, but yes putting it through your own mic is

oblique lark
#

is there a reason why playing soundboard sounds on your own mic with a plugin isn't a good idea?

frigid bay
#

other than that not rly

jagged briar
#

^

#

It would be hard for windows/mac systems and would prob require another program

viral roost
olive gulch
frigid bay
#

so

viral roost
#

on your own mic

frigid bay
#

to get the audio

#

..

#

soundboard sound

viral roost
#

how is that selfbotting

#

its the result of a user action

frigid bay
#

¯_(ツ)_/¯

viral roost
#

so its fair game

frigid bay
#

i guess

jagged briar
#

Go for it if you want to

#

Actually this looks promising https://www.npmjs.com/package/naudiodon

viral roost
#

discord made their own thing for recording and playing audio on the desktop app

#

you can play stuff over the mic on web fine and it has been partially done before but its impossible on the desktop app

silk bone
#

howdo progam plugn

fringe frost
trim cedar
trim cedar
glass wing
fathom carbon
#

how on earth do i learn SQL?

#

i can't find any good guides or anything

fathom carbon
#

yeah that's what i did

jagged briar
#

Literally the first one looks fine

polar cave
#

lol

polar cave
#

Help

#

I want to make a script that when used it sends a differen mewing gif

#

Form giphy

#

But it always sends this

#

I have the parameter set as 10 but it doesnt help

#

Dont steal my api key please

#

@steady knot i see that

#

If anyone responds ping me, i might respond after a few hours cuase i aint home

#

I get the same issue with the same picture with the shiggy api

#

I dont rlly know how to code so if someone can explain how to make it be different everytime i use the command, it will be very helpful

spice hemlock
#

hi...

rocky sable
#

Beomp

jagged briar
balmy sky
jagged briar
#

Also try watching some tutorials

balmy sky
#

^

polar cave
jagged briar
balmy sky
#

(maybe)

#

(dont quote me on that)

jagged briar
polar cave
jagged briar
#

Change the 0 on the line where you’re getting the image to the index of the one you want

polar cave
polar cave
balmy sky
#

Why are you grabbing 10 if you only want a single random one

polar cave
#

Boiiii

#

I need to learn...

#

I actually don't know shit

balmy sky
polar cave
#

Gyattttt

#

Gimme her ears

#

Lemme eat them

balmy sky
polar cave
#

Ok sorry, I'll be back 😔

balmy sky
#

Is there a way i can check if a user has a specific permission in the channel they're currently tabbed into?

versed osprey
balmy sky
#

I tried looking myself but i couldn't really make sense out of any of it

versed osprey
#

Ya dw

#

Is there like a new project you are working on?

balmy sky
#

A few things

versed osprey
#

Oooo

balmy sky
#

But mainly i want to make a plugin that hides the gif button if you don't have embed perms

versed osprey
#

Oh that shouldn't be that hard

#

I'll see if I can find the code for the perms checking when I'll get home

#

School is killing me lol I finish in an hour (5:30pm) and I've been here since 8:30am

versed osprey
#

School is a nightmare

trim cedar
versed osprey
jagged matrix
#

god fucking damn it

balmy sky
jagged matrix
balmy sky
#

What's that one plugin guide that shows how to make a send button on emojis?

#

I need to totally very much not steal the code for the send message function

#

🔥

jagged matrix
#

not telling you since you disrespecting my css

#

🔥

balmy sky
#

IT DISRESPECTS ITSELF

jagged matrix
#

AT LEAST IM SPENDING HOURS TO FIX IT

jagged matrix
#

fucking

#

neocities runs on ace editor

balmy sky
#

Why do you not just host it on github pages

#

It's so much better

#
  • a non stinky domain 🔥
jagged matrix
polar cave
#

@balmy sky sry for the ping i just had vodka, it looks like this?

balmy sky
#

Surely there's a better endpoint than that

#

A random gif getter or smth?

#

If you're searching the same term every time, you'll get the same result

polar cave
polar cave
balmy sky
#

Idfk

#

Look at the api docs

polar cave
#

K

#

/mewing

jagged matrix
#

L

polar cave
#

@balmy sky i fucked up my code and now it wont work help me

balmy sky
#

Lmao

polar cave
jagged matrix
polar cave
#

It worked fine

#

lol

#

I just add a parameter and it broke it

#

lol

#

Ping me when you respond im reviewing the docs

balmy sky
#

Dawg add logging to it

#

Ffs

#

😭

#

Also dude stop leaking your api key lmao

jagged matrix
#

please don’t tell me his file name is the fucking api key

balmy sky
#

Api key variable

jagged matrix
#

ah my fucking god

balmy sky
#

I just read the api docs

#

You're getting the wrong value

polar cave
polar cave
polar cave
#

Ill brb

balmy sky
#

We know

balmy sky
#

Also why do you have the author set to echo lmao

#

Boom

#

Fixed

#

It

polar cave
balmy sky
#

Ish

polar cave
#

Echo?

polar cave
balmy sky
#

Why do you not want your id in the author

polar cave
#

Cause i dont know if imma put it on github and dont want everyone knowing my discord

#

Maybe its just me being paranoid

#

lol

balmy sky
polar cave
#

You look dissappointed

#

In

#

Me

#

lol

jagged matrix
#

fine then, have the plugin made by @shadow ruin then

balmy sky
#

The issue is with the parameters and the tag

jagged matrix
#

because Dev.echo is their ID

polar cave
balmy sky
#

If you change the tag to something more common like "cat"