#๐Ÿงฉ-plugin-development

1 messages ยท Page 62 of 1

rocky falcon
#

what are you talking about

amber mantle
#

brain rot lmao

granite wharf
#

bro is insane

#

???

dry patio
#

this took me

#

admittedly

#

like four hours

rocky falcon
#

send it i dare you

dry patio
#

well it doesnt work yet

#

getting it to highlight took 4 hours

#

๐Ÿ˜ญ

rocky falcon
#

u go girl

dry patio
#

shit was like a scavenger hunt

#

the only problem now is that it also highlights in other messages

#

@someone

#

and thats not good ...

granite wharf
#

horror what the hell

#

how do i use an object as a settings store value
its not saving

iron epoch
#

that could be the problem

granite wharf
#

no its an empty object

#

on second thought

#

its a proxy of the previous store state

hushed loom
iron epoch
#

4 hours for a highlight??

midnight plinth
iron epoch
#

can I understand how MarkdownRules is undefined but in console is not nor in Api

#

why do I feel evil huisk

#

||ignore Devs.Ven||

dull magnet
#

code might be running too early

#

actually nah that doesn't make sense

iron epoch
#

I am so confused??? what's that suppose to say

safe glade
#

MarkDownRules instead of MarkdownRules

iron epoch
#

OH

safe glade
#

I guessed that was because your plugin is called MarkDownRules but ยฏ_(ใƒ„)_/ยฏ

iron epoch
#

I hate myself

safe glade
#

no

#

Markdown is just 1 word :3 โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹

#

not Mark Down

dull magnet
#

snake case wouldn't have changed anything

#

you would have just typed mark_down_rules

#

and exploded

iron epoch
#

welp imo it would been easier to spot

#

but I remind myself that we are on ts

swift spear
balmy sky
#

Why he squished

iron epoch
#

finally done with the markdown api

iron epoch
#

that's isn't ideal, is it? I don't want it to complain about the Rules function returning missing attrs so made two different interfaces
MarkDownRules branch

#

I believe there is an obvious way to deal with this without as unknown

#

but aren't seeing it

normal oriole
#

Use Partial<MarkdownRules>

iron epoch
#

thanks

swift spear
iron epoch
#

noted

balmy sky
strong sable
balmy sky
#

THAT WAS SUCH A FAST BAN LMAO

iron epoch
iron epoch
swift spear
balmy sky
#

Oh wait you already have

#

Oops

iron epoch
balmy sky
#

Wowie my brain hurts

#

And i haven't even started yet

#

I am so smart

#

Github wizard

balmy sky
iron epoch
# balmy sky Got it set up now but i have like no idea how to work the api, even after readin...

lemme. here, check module 428595, and debug

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

import { MarkDownRules, PluginMarkDownRules } from "@api/MarkDownRules";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";


export default definePlugin({
    name: "Rules",
    description: "Test Markdown Rules",
    authors: [Devs.iamme],
    dependencies: ["MarkDownRulesAPI"],
    start() {
    },
    rules(rules: MarkDownRules) {
        return {
            PROFILE_BIO_RULES: {
                codeBlock: rules.RULES.codeBlock
            }
        } as PluginMarkDownRules;
    }
});

#

rules.Rules has all the rules I think, it has the mention rule

#

I still don't understand rules completely, but I learnt how they work kinda

#

here js snippet that was satting for months in my inputbox #๐Ÿ“œ-js-snippets

function extractCodeBlocks(messageId, channelId) {
    let index = 0;
    const message = Vencord.Webpack.Common.MessageStore.getMessage(channelId, messageId).content; // replace them with the actual ids
    const parser = Vencord.Webpack.wreq('428595').default.RULES.codeBlock;
    while (index < message.length) {
        const char = message[index];
        if (parser.requiredFirstCharacters.includes(char)) {
            const l = message.slice(index);
            const matched = parser.match(l);
            if (matched) {
                console.log(matched[0]);
                index = index + (matched[0].length);
            }
        }
        index++;
    }
}```
#

it prints every codeblock found in the inputted message

#

it emulates how the actual discord parser works

#

yk, maybe emulating the mention is better by mimicking the style

rocky falcon
balmy sky
#

Like record time

balmy sky
iron epoch
#

it been a while

#

saying my experience may mislead because the unknown nature of the crashing

balmy sky
#

Oh baller it works

iron epoch
#

ofc it works, I made it

rocky falcon
#

idk what the context of this is, but does it work in notes?

iron epoch
#

oh wow, when summaries was so accurate?

balmy sky
#

So fucking real

iron epoch
#

you could patch the component tho and force it to use the rules blobcatcozy

balmy sky
#

There is probably 20 million different ways i fucked that pr up but it's there if you want it blobcatcozy

#

Alright you're on your own

iron epoch
#

goddamnit

balmy sky
#

I also have no fucking clue how to do the mention thing

#

Turns out it isn't as simple as shoving the mention rule in the bio

#

๐Ÿ˜” ๐Ÿ˜” ๐Ÿ˜” ๐Ÿ˜”

iron epoch
#

but sure thank you for your attempt

balmy sky
#

My incredibly feeble attempt

#

I feel like it wouldn't be hard to write a custom rule instead of trying to grab the pre existing one

#

Not efficient when one already exists but if it's not gonna work, might as well try

iron epoch
#

that's how may be possible yeah

rocky falcon
#

hey question for you 2 nerds (or anyone else but youre active rn and every time ive asked i havent gotten an answer so idek if its possible but im hoping it is anyways imma shut up and ask my question now);
Is there a way to, and if so how do i, grab and render a react component from base discord? if that makes sense.

balmy sky
#

There's a bunch of plugins that do that

#

Use findComponentByCodeLazy

#

You pass a list of code the component contains until you have a specifier good enough that it only matches that component

rocky falcon
balmy sky
#

Ummm yeah holdo n

#

I couldn't think of one so here's a line from one of my unreleased plugins

const UserPopoutComponent = findComponentByCodeLazy("customStatusActivity:", "isApplicationStreaming:", "disableUserProfileLink:");
#

Essentially, the user popout component is the only component that contains all 3 of those code snippets, so that's what the function returns

#

You can look at the component definition for parameters (and make an interface for it if it matters)

rocky falcon
#

userpopout being this thing?

rocky falcon
balmy sky
#

Yeah feel free to steal it idm

#

There is probably a way better find for it tho lmfao lmfao lmfao

iron epoch
#

how to break discord 101

balmy sky
#

How the actual fuck

balmy sky
rocky falcon
#
* {
  display: flex;
}
iron epoch
rocky falcon
#

works pretty good as well

iron epoch
balmy sky
wet turret
#

uh how would I find that part of the javascript is controlling this array of roles in the profile

#

I found onOpenProfile but there are like 50 finds

#

(onOpenProfile is triggered when clicking the +4)

dull magnet
#

react devtools

dry patio
wet turret
#

took me way too long ๐Ÿ˜ญ

#

should I create a pr for that to create as a new plugin? since others' probably would want that too, not sure

rocky falcon
#

just ineligible yourself from the experiment

wet turret
#

I just hate the simplified roles and bio

#

(which I both did fix)

amber mantle
#

ye

#

id only minimize the roles if theres an obnoxious amount of them

#

if thye only have like 10 roles whytf would i go full profile

wet turret
#

yeah true

balmy sky
#

So i'm patching the getUserProfile function so i can modify the non nitro user profile theme to an averaged pfp color, to make it less ugly. Problem is, i need the avatar data to process it so the function needs to be async.

TLDR: What's the best way to go about patching in async processes in an already existing non async function (if it's even possible bruhcat )

rocky falcon
#

would useAwaiter() work?

#
useAwaiter(async () => {

})
balmy sky
#

Worth a shot

#

Yeah i don't think it works unless i'm stupid

hushed loom
balmy sky
#
    patches: [
        {
            find: "UserProfileStore",
            replacement: {
                match: /(?<=getUserProfile\(\i\){return )(\i\[\i\])/,
                replace: "useAwaiter(async () => {await $self.colorDecodeHook($1)})"
            }
        },
    ],
    async colorDecodeHook(user: UserProfile) {
        if (user) {
            if (user.themeColors) return user;
            let palette = await Vibrant.from(user.getAvatarURL()).getPalette();
            if(!palette.LightVibrant?.hex || !palette?.DarkVibrant?.hex) return user;
            let newUser = user;
            newUser.themeColors = [Number.parseInt(palette.LightVibrant?.hex), Number.parseInt(palette.DarkVibrant?.hex)];
            return newUser;
            
        }
        return user;
    },

there is also a huge chance i fucked up the color format

balmy sky
#

THANK YOU EINSTEIN

rocky falcon
balmy sky
#

It doesn't, but it's also just as likely to be a stupid mistake of mine

scenic kite
#

so you don't have to make your own types

rocky falcon
#

I don't think plug-ins are allowed to add dependencies

scenic kite
#

not an individual plugin

swift spear
#
GitHub

A library to parse discord style markdown into an abstract syntax tree. - ItzDerock/discord-markdown-parser

GitHub

Create rich embed messages for Discord (previously discord.club) - merlinfuchs/embed-generator

scenic kite
#

they use either version 0.7.1 or 0.7.2 of simple-markdown

#

but the only change in 0.7.2 is the removal of @types/node as a dependency

#

so you might as well use 0.7.2

swift spear
#

so they use their own version or even one from scratch

#

tbh even in discord-markdown-parser heading doesn't work correctly under some conditions

scenic kite
scenic kite
#

i have compared the minified code

swift spear
#

probably they just put it there as source of their fork

scenic kite
#

they use simple-markdown 0.7.1 or 0.7.2

#

they use a lot of old dependencies with no modification

swift spear
scenic kite
#

no

swift spear
#

at least*

scenic kite
#

simple-markdown allows you to define your own rules

#

and override the defaults

swift spear
#

almost same as fork I think

#

fine then

scenic kite
#

they defenitely do not

swift spear
scenic kite
#

look im telling you i compared the code

#

it matches

swift spear
#

but they works

iron epoch
frosty holly
#

Im not sure if this is the chanel for this question, but how do i change the dm icon with CSS?

iron epoch
honest stump
#

would it be too "suspicious" if I patch the sendMessage function and change the flags? for example attaching SuppressEmbeds which you normally wouldnt be able to

floral tapir
#

okay so ive been doing some research

im going to pr the showhiddenchannels plugin to listen to events which would indicate that the state of a guilds channels has been updated, and then resolve those updated channels. idk if that makes sense or not

#

trying to fix a bug where, when you first join a server that gives you a role upon joining that gives you access to those channels, the channels are automatically unhidden

#

sorta asking here if its worth doing or not for my first (proper) pr

iron epoch
#

doesn't sound very useful either

floral tapir
#

i suck at communicating this but

join server with hidden channels
given role that gives you access to those channels
instead of pressing ctrl + r, my code will subscribe to the channel opened event (i think thats the right name?) and resolve all the opened channels

cedar olive
#

what?

#

what do you want to do exactly

floral tapir
#

show channels as open when they should be

iron epoch
#

or you saying if you sub to those channels before they get closed you will be able to listen to messages?

cedar olive
#

I dont understand what you want

iron epoch
cedar olive
#

oh I get it

#

you want to get a list of channels which you got access when you got a role (and obviously do something with it instantly)

#

hmm I don't know if there is an easy way for that

floral tapir
#

sorry i was murdering a bunch of small ants

#

so when a user gains access to a channel they did not previously have access to, the plugin will reflect that

#

as of right now, when a user gains access to a channel, it still shows as "hidden" @iron epoch @cedar olive

#

if that makes le sense

cedar olive
#

oh

floral tapir
#

do i use the flux dispatcher interface to listen to events?

cedar olive
#

is it in a component?

floral tapir
#

its @webpack/common

cedar olive
#

no

floral tapir
#

unsure

#

i still need to learn the codebase

cedar olive
#

wdym unsure

#

what shows as "hidden"

floral tapir
#

this

#

if a user gets a role that gets access to the log channel, it should turn into a normal channel

#

but it does not

#

the channel still displays as being hidden

cedar olive
#

does it fix when you switch servers?

floral tapir
#

stby lemme test

#

yes

cedar olive
#

ignore it for now

#

the plugin needs a rewrite

floral tapir
#

its a very easy fix tho

cedar olive
#

doesn't matter, it's a thing that rarely happens

floral tapir
#

listen to the channel opened event, and then pass all those channels to the resolver

cedar olive
#

and that can be fixed when the plugin is rewritten

floral tapir
#

bruh

floral tapir
#

i just wanna start contributing to vencord pls lemme do dis pepepray

#

so i can get my feet wet

#

lol

#

ive got zero experience working with this codebase but i wanna start contributing

cedar olive
#

there are easier things to do than this

floral tapir
#

such as

cedar olive
#

look at plugin requests if you want an idea for a plugin

floral tapir
#

i dont wanna make a plugin from scratch

#

5 scary 6 me

cedar olive
#

also the actual fix for that issue will need deep debugging to see why it's not working in the first place

#

it should already be working, the functionality does need to be added

floral tapir
#

the issue i was talking about?

cedar olive
#

yep

cedar olive
floral tapir
#

it doesnt have any event listeners tho

#

thats why it doesnt work

cedar olive
#

it does

#

and I can prove to you

floral tapir
#

where

#

pretty pls

#

maybe im stupid and missed it and i wanna learn

cedar olive
#

create a voice channel which is locked, then give you a role that gives you permission to connect it

floral tapir
#

educate me sir

cedar olive
#

you are gonna see the icon change and the voice channel be accessible now

#

which means the listener is there and it should be working for hidden channels too

#

the listener is not something vencord adds, it's something discord already has for the channels

floral tapir
#

shit ur right

cedar olive
#

also the actual fix for that issue will need deep debugging to see why it's not working in the first place
it should already be working, the functionality does need to be added

#

so this applies

floral tapir
#

mm maybe i went too much ๐Ÿค“ โ˜๏ธmode

cedar olive
#

choose something more simple from the issues in the repo

floral tapir
#

i have my code ready but i wanna test it first

cedar olive
#

wip but should help a bit

floral tapir
#

tyily

#

all the easy fixes are literally one line fixes

#

do i add myself to the devs for super minor changes

#

lol

iron epoch
tribal fable
#

I am having problems trying to inject compiled vencord with my plugin, according to cli it was patched but when I open discord it is default

tribal fable
hidden obsidian
#

Am I allowed to ask questions regarding the development of plugin in this channel?
Basically, m tryna understand how to get started. Like the general process of getting started with plugin development

rose fiber
hidden obsidian
rose fiber
hidden obsidian
#

THANKS A LOT

#

oops wrong ping ๐Ÿ˜”

tribal fable
floral tapir
tight canyon
tribal fable
#

fixed, thank u โค๏ธ

tribal fable
#

I am trying to use a photo in the rich presence but it does not work, what can it be?

rocky falcon
#

arent those assets that are on the application?

tribal fable
#

I can't use image links there?

rocky falcon
#

not afaik

tribal fable
#

im so stupid XDDDD

#

its working now

#

thank u

tribal fable
#

I have finished the plugin, how can I make a request for it to be added? should I make a pull request?

vale parrot
#

please guys add a plugin that see hidden channel just see text but cannot send

#

i will give money forthat

safe glade
#

physically impossible โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹

vale parrot
#

whyyyyyyyyyyy

swift spear
#

money first KEKL

fluid ridge
#

name checks out

safe glade
#

tru โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹

floral tapir
#

hii quick question

dull magnet
#

discord functioon

floral tapir
#

currently trying to find which function is called when you click on a gif while running a command so i can pr gifpaste

rocky falcon
floral tapir
tribal dragon
#

@floral tapir Are you rasputin

sharp frost
swift delta
tribal dragon
#

But I was talking about their pronouns

#

It said "Russian's greatest love machine"

floral tapir
tribal dragon
swift spear
cyan rune
#

why is this not pinned yet

novel canyon
#

where'd the docs in the vencord repo go?
did they move somewhere else

nevermind, found them

granite wharf
safe glade
#

mission impossible โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹โ€‹

median flare
runic talon
balmy sky
#

Is there a way to use react devtools while breakpoint paused? i might be stupid but the element eyedropper thing just doesn't display or pick anything

runic talon
undone void
#

can someone make a custom ringtone plugin of the Halloween call sound or the xmas one they where good

flint bronze
hidden obsidian
#

hey, sorry this might be a dumb question, but im trying but idk how to get the function i want
basically, the plugin that i am trying to make will , once the user types a msg and hits enter to send it, the plugin will get the text and replace some texts within the user input before sending it. it ill work as the user is typing it. but idk how to get the function thats related to this

#

itll be generous if someone helps . tnx

cyan rune
#

there's the text replace plugin for that

hidden obsidian
#

what can i do with it if u dont mind me asking

cyan rune
#

I don't use it myself so I couldn't tell you, but if you want a simple plugin to replace text in messages when they get sent, use text replace

#

you did mention replacing text in the message bar before it was sent, I'm not sure the use case tbh?

hidden obsidian
#

well bascially i want to replace texts with icons

rocky falcon
hidden obsidian
#

so if user does something like
this is a {{cat}} my plugin will replace it witha cat emoji
this is a ๐Ÿฑ

hidden obsidian
#

i would like to use other icons as well that u cant find in emojis

rocky falcon
#

like what lol

#

just use textreplace and/or AHK

hidden obsidian
#

the plugin u gave, like can i define my own text replacement?

rocky falcon
#

mhmm

hidden obsidian
#

k lmme check

tight canyon
#
import {
    addPreEditListener,
    addPreSendListener,

    removePreEditListener,
    removePreSendListener
} from "@api/MessageEvents";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";


export default definePlugin({
  name: "idk",
  description: 'idk',
  devs: [],
  start() {
    this.presend = addPreSendListener((_, msg)=> {})
  }
  stop() {
    removePreSendListener(this.presend)
  }
})
#

@hidden obsidian

#

but yeah, if you can it might be better to justr use TextReplace

rocky falcon
hidden obsidian
rocky falcon
#

i sent that before your message rendered :p

hidden obsidian
rocky falcon
#

np

hidden obsidian
#

m happy and sad at the same time after finding it ๐Ÿ˜‚ ๐Ÿ˜”

cyan rune
#

dw, I spent way too much time trying to do something CSS can do in 1 line haha

#

that time wouldn't have gone to anything useful anyway

hidden obsidian
#

lol

jagged briar
#

unrelated but

  1. why are you making a plugin repo (defeats the whole purpose of vencord)
  2. why are you downloading the entire repo locally instead of downloading each plugin individually when the user installs them
viral roost
#

so i tried to make a plugin to make the view full bio button expand in the same popup as the profile

#

and after like 30 mins of trying stuff i present to you the worst patch that has probably ever been made

#
{
        find: ".viewFullBio,",
        replacement: {
            match: /(\[(\i),\i\]=\i\.)useState\(!1\);(.{0,100}ref:(\i))=>{null!=\i(.{0,500})className:(\i.descriptionClamp)(.{0,300})onClick:\(\)=>{.{0,300}}\)}/,
            replace: "$1 useState(null); const [clamp,setClamp] = Vencord.Webpack.Common.React.useState(true);" +
                "$3 => { $4 != null && $2 == null" +
                "$5 className:clamp ? $6 : null" +
                "$7 onClick: () => setClamp(!clamp)"
        }
    }

(broke the next day its joever)

jagged briar
ashen pebble
#

I also made my 2nd plugin I just copy and paste from other plugins till it worked the way I wanted it too lol

#

its cancer the code

#

but it works

#

supports twitter/tiktok as well

ashen pebble
#

now I need to force myself to learn patching

#

pain

ripe smelt
# jagged briar unrelated but 1. why are you making a plugin repo (defeats the whole purpose of ...
  1. I think you've asked before, but to make it easier for advanced users to find and install third party plugins. There's no plausible way a plugin repo would work on base Vencord either way. Its meant to only be used with dev Vencord as a third party plugin
  2. The repo itself doesn't have the plugins stored in it. All the plugins are downloaded from their respective githubs elsewhere in the code. This code just makes sure the plugin repo's code is up-to-date and automatically updates it so the user doesn't have to manually update it
minor jolt
#

hello, quick question doing waitFor subscribe and dispatch to get the fluxdispatcher for some reason returns me something else that's not the dispatcher, temp1

dull magnet
#

there are multiple subscribables

#

and why use waitFor instead of the common

minor jolt
#

cuz my plugin starts on domcontentloaded and i need to wait for webpack stuff to load before using it

#

last time i asked there wasn't a way to start it after webpack but before login

#

dunno if that's still the case

dull magnet
#

why do you need that?

minor jolt
#

because if the user isn't logged in, the plugin will never load, but i want to send an event when discord is loaded (eg on login screen)

#

regardless of logged in status

#

i took the snippet from webpack/common/utils.ts, been using it for months with no problems

#

now it stopped working smh

#

i guess adding register in the parameter list further narrows it down and it brings me the correct thing, dunno if it's the ideal solution tho

dull magnet
#

@viral roost you need to stop with these dangerous patches

#

you cannot define a variable in one patch and use it in another

#

that's very dangerous because if the first patch fails but the second one still works you are guaranteed to cause a crash

#

try to avoid it, or if there's no way around it mark your patches as group: true

viral roost
#

thats what the try is for

#

though yeah group is a better idea

tight canyon
dull magnet
#

yes

tight canyon
#

Which one is yes ๐Ÿ˜ญ

#

Revert or not applying next ones

viral roost
#

revert

tight canyon
#

Then my plugin needs grouping

#

Thanks

dull magnet
#

but yes group

tight canyon
#

#๐Ÿ‘พ-core-development message

@iron epoch
It will work in implementation that you have sent, but it will not work in discord default one

Discord takes the whole string, matches a rule with smallest order and removes match from a parade string to pass what has left to other rules

So if a string doesn't start with a needed character it will pass it to the text rule, which will eat your cookies

proud parrotBOT
iron epoch
#

can you point where discord takes the whole string?

tight canyon
#

o.prevCapture?""

Search for it, I can't make a screenshot since I'm not home

tight canyon
#
var c = function(t, o) {
    var s = [];
    for (n = o = o || n; t; ) {
        for (var u = null, l = null, d = null, f = -1e5, p = 1e5, h = [i.get(t.charCodeAt(0)), a], m = 0; m < h.length; m++) {
            var g = h[m];
            if (null != g)
                for (var _ = 0; _ < g.length; _++) {
                    var b = g[_]
                      , v = e[b]
                      , y = v.order;
                    if (y > p)
                        break;
                    var E = null == o.prevCapture ? "" : o.prevCapture[0]
                      , S = v.match(t, o, E);
                    if (S) {
                        var x = v.quality ? v.quality(S, o, E) : 0;
                        (y < p || x > f) && (u = b,
                        l = v,
                        d = S,
                        f = x,
                        p = y)
                    }
                }
        }
        if (null == l || null == d)
            throw Error("Could not find a matching rule for the below content. The rule with highest `order` should always match content provided to it. Check the definition of `match` for '" + r[r.length - 1] + "'. It seems to not match the following source:\n" + t);
        if (d.index)
            throw Error("`match` must return a capture starting at index 0 (the current parse index). Did you forget a ^ at the start of the RegExp?");
        var w = l.parse(d, c, o);
        Array.isArray(w) ? Array.prototype.push.apply(s, w) : (null == w.type && (w.type = u),
        s.push(w)),
        o.prevCapture = d,
        t = t.substring(o.prevCapture[0].length)
    }
    return s
}
#

That's how discord parses it despite having my custom rule

#

And that's how it works if I change text-rule-regex to stop right before hsl( or rgb(

tight canyon
#

pinged wrong person oops

#

@iron epoch

iron epoch
#

oh, I see now

#

or think so

#

I will analyze the code more to understand how it works

tight canyon
#

That's default text regex that discord uses

iron epoch
#

the regex for the text rule?

tight canyon
#

yes

iron epoch
#

fair point than

#

I will experiment with reactParserFor, to see if i am able to create a set of rules

flint bronze
#

note for note hook: wreq(702557).Z

#

?remindme 12h continue notes plugin notable stuff wreq(252032).Z wreq(252032).Z

fathom pivotBOT
#

Alright @flint bronze, in 12 hours: continue notes plugin notable stuff wreq(252032).Z wreq(252032).Z

flint bronze
#

wait wreq(252032).Z not notable

#

702557

flint bronze
#

724593

flint bronze
#

?reminder list

fathom pivotBOT
#
Reminders
1452282: <t:1719622584:R>

continue notes plugin notable stuff wreq(252032).Z wreq(252032).Z

flint bronze
fathom pivotBOT
#

Successfully deleted reminder.

flint bronze
#

get real

#

FUCK

#

i have to do DM sidebar too

flint bronze
#

i hate lazy loaded classes

bitter root
swift spear
#

as temp solution u can move all plugins (all folders but d3soxUpdater, shared and native) from D3SOX-userplugins into just userplugins

#

it will remove feature to auto update of his plugins but it works (as temp "updater" u can just check his github for fix)

balmy sky
#

Is there a designated function to check if anyone in your dms is typing? I'm trying to make a plugin that changes the home button icon to a typing indicator if someone is typing, i started it a few weeks ago but gave up- right now it has this absolute monstrosity of a function and i doubt it even works

//pain
let isTyping = findByCodeLazy("isTyping(", "getTypingUsers(");
let getTypingUsers = findByCodeLazy("isTyping(", "getTypingUsers(");

    IsAnyoneTyping()
    {
        let channels = PrivateChannelSortStore.getPrivateChannelIds();
 
        return channels.some(channel => 
        {
            if(ChannelStore.getChannel(channel)?.isMultiUserDM())
            {
                return getTypingUsers(channel).some(e => e.id !== UserStore.getCurrentUser().id);
            }
            else
            {   
                if(isTyping(channel, ChannelStore.getChannel(channel).getRecipientId()))
                {
                    return true;
                }
            }
        })
    },
balmy sky
#

It's joever

balmy sky
#

I got it to work!

const ThreeDots = findExportedComponentLazy("Dots", "AnimatedDots");

const TypingStore = findStoreLazy("TypingStore");

const PrivateChannelSortStore = findStoreLazy("PrivateChannelSortStore") as { getPrivateChannelIds: () => string[]; };

export default definePlugin({
    name: "HomeTyping",
    description: "Changes the home button to a typing indicator if someone in your dms is typing",
    authors: [Devs.Samwich],
    TypingIcon: () => 
    {
        return (
            <ThreeDots dotRadius={3} themed={true} /> 
        )
    },
    IsAnyoneTyping()
    {
        let channels = PrivateChannelSortStore.getPrivateChannelIds();
        return channels.some(id => Object.keys(TypingStore.getTypingUsers(id)).length);
    },
    patches: [
        {
            //insanely cursed find
            find: "M19.73 4.87a18.2 18.2 0 0 0-4.6-1.44c-.21.4-.4.8-.58",
            replacement: {
                match: /let{size:\i="md",width:\i,/,
                replace: "if($self.IsAnyoneTyping()) return $self.TypingIcon(); $&"
            }
        }
    ]
});

Only thing is, the home button icon doesn't change until you hover over it, is there a way i can update it as soon as someone starts typing?

#

I assume it's some react insanity

amber basin
#

useForceUpdater and setInterval to check every few seconds

#

and if its true call the forceUpdater

#

or just forceupdater every few seconds, either will work

balmy sky
#

Yeah i was gonna say

#

Would calling force updater like that have any performance problems?

amber basin
#

i think no? since its only rerendering the tiny dms icon

balmy sky
#

Ah ok

amber basin
#

ideally u would useStateFromStores to get live updates

amber basin
#

but idk how to do that with all dms

flint bronze
#

use that

balmy sky
#

I think i am having a stroke

flint bronze
#
return useStateFromStores([TypingStore], () => channels.some(id => Object.keys(TypingStore.getTypingUsers(id)).length > 0));
#

?

#

yeah that works

#

doesnt work with the in app icon feature @balmy sky

balmy sky
#

Oh shit i didn't even consider that

#

Uhhhhhhhhhhhhhhhhhh

flint bronze
#

you are literally patching entirety of ClydeIcon btw

balmy sky
#

Fucking

#

Damnit

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

import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findExportedComponentLazy, findStoreLazy } from "@webpack";
import { useStateFromStores } from "@webpack/common";

const ThreeDots = findExportedComponentLazy("Dots", "AnimatedDots");

const TypingStore = findStoreLazy("TypingStore");

const PrivateChannelSortStore = findStoreLazy("PrivateChannelSortStore") as { getPrivateChannelIds: () => string[]; };

export default definePlugin({
    name: "HomeTyping",
    description: "Changes the home button to a typing indicator if someone in your dms is typing",
    enabledByDefault: true,
    authors: [Devs.Samwich],
    TypingIcon: () => {
        return (
            <ThreeDots dotRadius={3} themed={true} />
        );
    },
    IsAnyoneTyping() {
        const channels = PrivateChannelSortStore.getPrivateChannelIds();
        return useStateFromStores([TypingStore], () => channels.some(id => Object.keys(TypingStore.getTypingUsers(id)).length > 0));
    },
    patches: [
        {
            // insanely cursed find
            find: "M19.73 4.87a18.2 18.2 0 0 0-4.6-1.44c-.21.4-.4.8-.58",
            replacement: {
                match: /let{size:\i="md",width:\i,/,
                replace: "if($self.IsAnyoneTyping()) return $self.TypingIcon(); $&"
            }
        }
    ]
});
#

here is what I have right now

balmy sky
#

Yeah mine is pretty much indentical

#

It works for me tho

#

Guess all i need now is to move the patch

flint bronze
#

yeah pretty much

balmy sky
#

Thanks for the help vennieheart

#

Well that aint right

robust lantern
#

ะ ะพััะธะธ ัะปะฐะฒะฐ

swift spear
cedar olive
#

look at how typing indicator does it

flint bronze
#

which is useStateFromStores

cedar olive
#

yep

flint bronze
#

my solution should work good enough for this simple use case then

cedar olive
#

what's your solution

cedar olive
#

oh yeah it's right

balmy sky
#

Yeah it works well enough blobcatcozy

leaden fable
#

How can I findbyCode this:

api = Object.values(wpRequire.c).find(x => x?.exports?.tn?.get).exports.tn;
sonic zinc
#

uhhh did i miss something

rose fiber
sonic zinc
#

well i thought it was weird that it didnt recognize the modules

rose fiber
#

does it build?

#

do you have it opened as a folder and not just the file?

sonic zinc
sonic zinc
#

i have it opened as a folder

rose fiber
#

and what's the error?

sonic zinc
rose fiber
sonic zinc
#

oh nevermind i guess i just had to restart my pc, now it works fine

#

thanks and sorry for bothering

swift spear
leaden fable
# balmy sky Give more context
let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);

let ApplicationStreamingStore, RunningGameStore, QuestsStore, ExperimentStore, FluxDispatcher, api
ApplicationStreamingStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getStreamerActiveStreamMetadata).exports.Z;
RunningGameStore = Object.values(wpRequire.c).find(x => x?.exports?.ZP?.getRunningGames).exports.ZP;
QuestsStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getQuest).exports.Z;
ExperimentStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getGuildExperiments).exports.Z;
FluxDispatcher = Object.values(wpRequire.c).find(x => x?.exports?.Z?.flushWaitQueue).exports.Z;
api = Object.values(wpRequire.c).find(x => x?.exports?.tn?.get).exports.tn;

This works fine in the console. Trying to convert it to a plugin and get "api" using findByCode

balmy sky
#

Somehow you gave more context and i am even more confused

cedar olive
#

no need to find what's already a common

leaden fable
cedar olive
#

what?

dull magnet
#

RestAPI sends all the correct headers

#

so best to use that

#

it's already in vencord webpack commons so you can just import it

leaden fable
#

Okay thanks

dull magnet
#

or are you not using Vencord?

amber basin
#

password protect channels

#

:D

#

navigating to channels/@me is necesary for it to refresh the nsfw popup, just need to make it refresh on unlock and change some strings

#

@dull magnet can u put gifs in plugin readmes

#

i wanna put the above

dull magnet
#

yes

#

but also

#

i recommend using a better format

#

like webp or avif

#

or use a mp4

amber basin
#

oki

#

i just did a gif bc thats what my sharex records blobcatcozy

dull magnet
#

but also a screenshot of the lock screen is probably enough?

amber basin
#

oki

tough ridge
#

why simplified profile experiment is not showing up?

dull magnet
#

v+ needy @tough ridge

hushed loom
#

does this error mean anything
im getting it randomly, but my plugin still works
odds are i am doing something very wrong

cedar olive
#

you are trying to set the value ofa setting to something like a class or proxy or function

cedar olive
#

yes

#

make sure the object is not a proxy

hushed loom
#

ok, thanks

cedar olive
#

if you need help put a breakpoint and inspect everything you are trying to save

hushed loom
#

its 3 am for me, that will be an issue for future me

cedar olive
#

lol

hushed loom
#

?remind 7hr fix plugin

fathom pivotBOT
#

Alright @hushed loom, in 7 hours: fix plugin

green vessel
#

hello, is there any start-up guide on how to start developing plugins?

swift delta
green vessel
#

thank you

sand isle
#

every day we are closer to me having the motivation to make the annoying vencord popup plugin

#

it will have 0 use and just be a nuisance

royal kindle
#
    font-family: "Builder";
    font-code: "Builder Mono"; 
      --font-family: 'Builder ;
  
  src: url('https://files.catbox.moe/8u8dak.woff2') format('truetype');
}

body
{
    font-family: 'Builder Sans' !important;
    --font-display: "Builder Sans";
    --font-headline: "Builder Sans";
    --font-code: "Builder Mono Regular"; 
    src: url("https://raw.githubusercontent.com/ardishco-the-great/catpuccin-with-emojis/main/Terminess%20(TTF)%20Nerd%20Font%20Complete.ttf");
}

[data-list-item-id^=channels___] {
    font-family: "Builder Sans", var(--font-primary);
}

@import url('https://raw.githubusercontent.com/ardishco-the-great/catpuccin-with-emojis/main/Terminess%20(TTF)%20Nerd%20Font%20Complete.ttf');

:root {
    --font-primary: "Builder Sans";```
fathom pivotBOT
#

@hushed loom, <t:1719645225:R>: fix plugin

ionic breach
#

Woah

#

We have Danny here!

#

I love this bot

tight canyon
balmy sky
#

Ah makes sense

north flame
#

Hey, anybody got a patch for channel hover?

haughty maple
#

Hello, i'm new to plugin development, how do I find patches?

hushed loom
haughty maple
hushed loom
#

use that to make patches

haughty maple
#

thanks for the info!

hushed loom
haughty maple
hushed loom
tight canyon
haughty maple
hushed loom
tight canyon
hushed loom
#

mods, lobotomize this person

hushed bloomBOT
hushed loom
#

is it possible to set a default value to a TextInput

#

(not a placeholder)

swift spear
hushed loom
balmy sky
#

Would a plugin that adds support for loading chrome extensions be a terrible idea

#

I feel like it could have some random uses

flint bronze
#

Yes

#

Vencord already uses the devtools extension loading thing

#

for react

dull magnet
#

used for loading react devtools

#

it can download and load extensions from chrome webstore

#

it just has no way to use it

flint bronze
dull magnet
#

no

#

vencord

flint bronze
#

yeah i'm looking at that]

dull magnet
#

installExt("fmkadmapgofadopljbjfkapdkoienihi")

flint bronze
#

it's a wrapper though

#

probably useless in this case though

#

for the reason you are already familiar with

#

cough cough chrome web store review

balmy sky
#

Is it possible to interact with datastore in a native.ts function? i'm trying to use native to fetch the data of an image (not relevant), but as soon as i add the DataStore.get("cachegifs-cache") line vesktop just loads indefinitely

flint bronze
#

Sounds redundant

#

This is your issue

balmy sky
flint bronze
#

yeah that isnt your issue

#

they're all CDN links

#

through the media proxy

#

probably regenerated every load though

balmy sky
#

Maybe the world aint ready for this tech yet

flint bronze
balmy sky
#

Settings would be fineee

#

It works well from what i can tell tho

#

Downloading the data has frozen my client on 9 seperate occasions now tho

swift delta
#

Oh god what r you cooking Sam

balmy sky
#

I'm cooking ok just trust

#

ok asking for a friend

#

Um

#

Is it bad if opening my vencord settings backup takes up 5gb of ram

flint bronze
#

yeah

#

shit is worse than a devilbro plugin

balmy sky
#

THE DATASTORE DATA WAS SO BIG IT BROKE THE BACKUP SYSTEM

#

LIKE I COULDN'T IMPORT OR EXPORT ANYTHING

#

๐Ÿ˜ญ

#

This is so cursed

swift delta
balmy sky
#

The motherload

flint bronze
#

@balmy sky I'm begging you to just store these files in a folder like a normal person

balmy sky
#

Not happening

#

Think hard not smart

balmy sky
#

I might try to make an in client integration of the developer dashboard

swift delta
swift delta
# balmy sky OBVIOUSLY

i didnโ€™t mean termed for client modding i mean being termed for the code you write

balmy sky
#

The latter is more likely

balmy sky
#

Dude doesn't use clientsideblock

#

Absolute nerd

iron epoch
#

my brain going to explode

unkempt hemlock
#

@chrome folio hi there. I would like to inform you that your "ShowAllRoles" plugin makes the profile unscrollable with a huge amount of roles.

#

@viral roost hi there. I would like to request a feature for your plugin "MaskedLinkPaste". if possible, could you make an option for it so when pasting it automatically adds <> to block previews?

example + (CTRL+V) -> [example](<https://eff.org/>)

flint bronze
#

what is this regex

balmy sky
#

Hi there.

hushed loom
thin dagger
#

Are there docs on how to use the api (Vencord.Api.*)?

thin dagger
balmy sky
thin dagger
#

Damn

flint bronze
#

Specifically src/api/index.ts
It has comments

thin dagger
#

Can i fork and add a page to docs for that

#

Idk if im just sped but i think thatd be easier like readthedocs type thing

flint bronze
#

Honestly documenting the code with comments as it is is probably easier to develop upon

thin dagger
#

lua โ€” Today at 3:04 AM
That being said can you send a pull request from another git instance I reaaaally dont want to use github

#

Cause i wanna contribute to the docs but theres not a mirror on codeberg

thin dagger
thin dagger
#

so functions dont have to be called like function myFunct(){}?
it can just be myFunct(){} in typescript?

dull magnet
#

if you're struggling with such simple language features you should learn better js first

thin dagger
#

Was just a question damn

#

Im legit just asking for understanding because i know js i *dont know ts * :ass:

dull magnet
#

it has nothing to do with typescript

thin dagger
#

??

tight canyon
#

Writing ts is the same as writing js, but with optional typing, thus better lsp support

thin dagger
#

Okay hold on

#

Okay i was retarded for a little bit ๐Ÿค

#

That should be good

#

I think i can ignore this (question mark)

iron epoch
#

wait, are you putting an image on top of the page?

thin dagger
#

Ya

rose fiber
#

also put that into the start function

#

I beg

thin dagger
iron epoch
thin dagger
rose fiber
#

im referring to the myFunction call

thin dagger
#

yea but wouldnt it like not repeat

#

i might just be ๐Ÿง  โช right now

#

ill try it

rose fiber
#

put myFunction into the start function

thin dagger
# rose fiber put myFunction into the start function

like

start() {
    console.log("its time...");
    generate();
    setTimeout(start, Number(`${Math.floor(Math.random() * (15 - 5 + 1)) + 5}`) * 60 * 1000 * 60 * 1000);
},

or

start () {
    function myFunction() {
        console.log("its time...");
        generate();
        setTimeout(myFunction, Number(`${Math.floor(Math.random() * (15 - 5 + 1)) + 5}`) * 60 * 1000 * 60 * 1000);
    }
}
#

?

rose fiber
#

first one

thin dagger
#

got it

#
1 error
1 error
Build failed
Build failed with 1 error:
src/plugins/brainrotGallery/index.ts:60:8: ERROR: Expected ";" but found "{"
โ€‰ELIFECYCLEโ€‰ Command failed with exit code 1.
#

damn it

#

hold on

#

ok ya im drawing a blank here

start() {
    console.log("its time...");
    generate();
    setTimeout(start, Number(`${Math.floor(Math.random() * (15 - 5 + 1)) + 5}`) * 60 * 1000 * 60 * 1000);
};
rose fiber
#

the start function in your plugin definition

thin dagger
#

thanks

#

ok good news; console.log is working ๐Ÿ‘

#

now we wait

#

okay its. not doing anything lol

#

it's just saying "Cannot find name 'start'"

#

is this also ignorable

dull magnet
#

all of your questions so far have been due to a lack of understanding of Javascript

please take some time to improve your javascript knowledge first

thin dagger
#

But i am still improving

dull magnet
#

your questions so far have been:

  • not knowing what a method is in js
  • should i put my code inside a function that's never called?
  • how do i fix this obvious syntax error
  • not understanding that you can only reference object methods via an object reference

sorry but you in no shape or form "fully understand javascript" lmao

there's nothing wrong with that but these questions don't really belong here, you should improve your javascript skills first

thin dagger
#

Oh wait i see it

thin dagger
iron epoch
swift spear
thin dagger
#

Its over now

#

It works

#

Im committing it

steel field
#

I'm attempting to set things up to create a userplugin, and would like to propose some improvements on the Vencord Docs:

  • https://docs.vencord.dev/installing/custom-plugins/#building-vencord - I created a src/userplugins/foo/index.tsx where the index.tsx is an empty file and still got the TypeError mentioned here. Probably a good idea to be more exact about the conditions that lead to this error, and to point out that this error is expected until you actually have the boilerplate code set up.
  • The Plugin Submission page is empty
  • The docs are clearly incomplete as only the first two bullet points in the Introduction are covered.
Vencord Docs

How to install custom plugins in Vencord

#

what does already exist is very nice tho

rocky falcon
#

The docs are clearly incomplete as only the first two bullet points in the Introduction are covered.
clearly.

would like to propose some improvements on the Vencord Docs:
https://github.com/Vencord/Docs/pulls

GitHub

Vencord user and developer documentation. Contribute to Vencord/Docs development by creating an account on GitHub.

signal goblet
#

Question there was a prop called encodeStreamKey it was removed when all of the patches and stuff broke. without using the encodeStreamKey it seems to work fine but I wonder if it's fine to leave it like that.

signal goblet
#

I see alr thanks

steel field
iron epoch
iron epoch
#

np

steel field
#

since the docs are incomplete, what resources do yall recommend for me to figure out "How to reverse engineer and understand Discord code to find which functions you need to use or patch"?

steel field
#

ah nice, older docs, tyty

steel field
#

also looks very promising

steel field
regal spear
#

Hello, im new to plugin development and i was wondering how to show that a modal is loading after submitted. Like once you click the button to submit the modal, i want it to show a loading icon

queen sedge
#

@chrome folio found an oversight with ShowAllRoles, specifically with roles lists that are... long https://the.yog.zone/2CDGuwd.png
using this as a (temporary) workaround: ```css
/* Add a scroller for long role lists when using ShowAllRoles */
[class^="userPopoutInner_"] [aria-label="Roles"] {
max-height: 58vh;
overflow-y: scroll;
scrollbar-width: thin;
scrollbar-color: var(--profile-body-divider-color)var(--scrollbar-thin-track);
padding-right: 4px;
&:hover {
scrollbar-color: var(--scrollbar-thin-thumb)var(--scrollbar-thin-track);
}
}

canary 306479 (cb6e309) Host 0.0.438 x64 Build Override: N/A Linux 64-bit (6.9.6-200.fc40.x86_64)
Vencord 5c05443 (Standalone)
Electron 30.1.0
Chromium 124.0.6367.243
```
haughty maple
#

how would I get a file using fs and pass it on to my main index.ts file?

dull magnet
#

native.ts file

#

docs soon

haughty maple
dull magnet
haughty maple
#

ok

proud parrotBOT
hidden hemlock
haughty maple
# tight canyon https://github.com/Vendicated/Vencord/blob/main/src%2Fplugins%2FopenInApp%2Finde...

i tried that except it says the function doesn't exist.
index.ts

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

import { Devs } from "@utils/constants";
import definePlugin, { Patch, PluginNative } from "@utils/types";

const Native = VencordNative.pluginHelpers.ExtraConnectionLinks as PluginNative<typeof import("./native")>;

enum contypes {
    Roblox = "Roblox",
    Xbox = "Xbox",
    PSN = "PSN",
}

const uris = { // name = t, and id = l
    [contypes.Roblox]: "https://www.roblox.com/users/${l}/profile",
    [contypes.Xbox]: "https://www.xbox.com/play/user/${t}",
    [contypes.PSN]: Native.resolvePSNDataUri(),
};

const serviceNames = {
    [contypes.Roblox]: "Roblox",
    [contypes.Xbox]: "Xbox",
    [contypes.PSN]: "PlayStation Network",
};

export default definePlugin({
    name: "ExtraConnectionLinks",
    description: "Adds the Open Profile button to connections that don't natively have it in the regular Discord client.",
    authors: [Devs.coopeeo],
    patches: makePatches(),
});


function makePatches(): Omit<Patch, "plugin">[] {
    const output: Omit<Patch, "plugin">[] = [];
    const stringKeys = Object.keys(contypes).filter(v => isNaN(Number(v)));
    stringKeys.forEach(key => {
        const contype: contypes = contypes[key];
        output.push({
            find: "getPlatformUserUrl:e=>",
            replacement: {
                match: new RegExp(`(?<=${serviceNames[contype]}",.*},.+)(?=},)`),
                replace: `, getPlatformUserUrl:e=>{let {name:t, id:l} = e; return \`${uris[contype]}\`;}`
            }
        });
    });
    return output;
}

native.ts

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

import { IpcMainInvokeEvent } from "electron";
import fs from "fs";

let psnUri: string;

function getPSNDataUri() {
    return new Promise<string>((resolve, reject) => {
        if (psnUri) psnUri = fs.readFileSync("./psnUri.html", { encoding: "base64url", flag: "r" });
        resolve(psnUri);
    });
}

export async function resolvePSNDataUri(_: IpcMainInvokeEvent) {
    return getPSNDataUri();
}
tight canyon
#

"function doesn't exist" which one and where

#

Also I'm 100% sure that vee will say to use .map instead of pushing into output in forEach

tight canyon
#

And same with patches, \i in regex for catching variables, cuz they can easily change

haughty maple
tight canyon
#

No idea, i haven't worked with native

haughty maple
#

k

tight canyon
amber basin
#

ctrl+r doesnt reload native.ts changes

#

not possible

haughty maple
tight canyon
haughty maple
tight canyon
#

Can you create a function inside of a plugin like this
function getUri(contentType) {
const uris = {...}

return uris[contentType]
}

And change patches to rerurn smth like this
return $self.getUri(contentType)

haughty maple
#

now it works... i guess i had to wait longer, but also i stopped the pnpm watch --dev command

tight canyon
#

I have a feeling that the native module just hasn't got enough time even load

haughty maple
#

well i mean the plugin don't but vencord loads now

haughty maple
tight canyon
#

Previously you had hardcoded strings

#

Now you resolve something from native part

#

So try it

#

@haughty maple so...?

haughty maple
#

it aint even starting the plugin

tight canyon
haughty maple
tight canyon
haughty maple
#

lets go it's now working

tight canyon
#

I'm going to sleep pretty soon, so yeah

tight canyon
haughty maple
#

but crashes if you open up a profile that shows a playstation connection

tight canyon
#

With what reason

haughty maple
#

and i dont know promise very well

tight canyon
haughty maple
#

its in my geturi function

#

getUri(name: string | undefined, id: string | undefined, contentType: contypes) {
console.log("[ExtraConnectionLinks]: name: " + name + ". id: " + id + ". contype: " + contentType);
return (uris[contentType] as string).replace("${l}", name as string).replace("${t}", id as string);
}

#

because i am stupid!

tight canyon
#

Well, native is loading, it's the most important thing

haughty maple
#

i have to put thing called .then cooper

tight canyon
#

const uri = {}

export default definePlugin({
patches,
async start() {
uri[psn] = await Native.resolve...()
}
getUri(type){ return uri[type] }
})

Horror, but you will have a string there

tight canyon
#

Discord expects a normal string, will get promise/undefined

haughty maple
tight canyon
#

also

async functions have "await" in it

instead of func().then(doSmtg)

const result = await func()

#

but it's more js thing

tight canyon
haughty maple
tight canyon
#

You'll get used to this

tight canyon
#

And I'm going to sleep, gn

haughty maple
tight canyon
#

btw @iron epoch
Do you know the difference between inlineStyle/inlineObject/verbaterm in md rules?

dry patio
#

back to both plugins being completely stalled for official review or dev merge

#

yippee

honest stump
#

huh

balmy sky
#

Does discord already have a component for a vertical volume bar? I can't think of where one would be off the top of my head. I suppose it's possible to somehow rotate the settings slider or something similar

balmy sky
rocky falcon
#

how would i add a reaction to a message?

honest stump
#

i love discord this is awesome to have

balmy sky
#

I love that page

#

Today i learned shiny button exists

honest stump
#

today i learned that custom pills for selects exist

opaque plaza
flint bronze
flint bronze
opaque plaza
#

oh i just checked

#

never noticed it

balmy sky
#

I can't find it in third party plugins now

#

The quick husk thing

flint bronze
#

yeah

honest stump
#

but apparently addReaction got changed

balmy sky
#

Rip

flint bronze
#

fuck

#

horror even

#

discord loves changing their bundler trolley

balmy sky
#

Every 2 seconds

#

MAN why do plugin requests have to be so ass

flint bronze
#

wdym

balmy sky
#

Regular gated plugin requests when

flint bronze
#

braindead?

balmy sky
flint bronze
swift delta
balmy sky
#

They're all either impossible, uninteresting or just flat out stupid

balmy sky
#

Or already tried and failed

flint bronze
#

you know what I hate?

balmy sky
#

What

flint bronze
#

how react devtools doesnt have a "jump to where this component was created" button

balmy sky
#

Oh yeah that's really annoying

#

Also react devtools not working when paused by a breakpoint

#

Just makes it flat out impossible to inspect some elements

flint bronze
#

React devtools is a buggy piece of shit and I'm not afraid to admit it

balmy sky
#

Yop

flint bronze
#

the component picker is so ass

#

its super buggy

balmy sky
#

Ehh it works most of the time

flint bronze
#

because it literally has to inject its own elements into the DOM to even do it

#

instead of native chrome devtools being able to render an overlay properly

balmy sky
#

Searching the class name works well sometimes

#

If you can't pick it

bronze dove
iron epoch
# tight canyon btw <@984392761929256980> Do you know the difference between inlineStyle/inline...

discord code is so obfuscated to tell but I was kinda able to figure out that inlineObject is basically is like an object once created you can't rewrite it and must delete it fully (examples: mentions, emojis). verbatim I have no idea, it does nothing (newline, paragraphs, text). inlineStyle is mostly responsible for rendering them with some effect, change of font or color/highlight (strong, inlineCode). and that all I know, still don't have a full picture of how they work.

(and sorry for the late reply)

tight canyon
#

So the main difference between them all is still unknown, i haven't seen any issues with any of these, it feels like they don't do anything, so that's why I asked, hoped maybe you have figured it out

haughty maple
#

does a thing exist where you can get the path where your plugin is running?

amber basin
haughty maple
flint bronze
#

yeah so

#

basically

amber basin
#

wtf are you trying to do

flint bronze
#

you are trying to load something from the filesystem

#

dont do that

#

look at how quickcss works

haughty maple
haughty maple
flint bronze
#

also

#

let me look at what you have

#

nvm cant because you didnt commit it

#

all I can say is

#

Whatever you are trying to do is a hack

#

and there are better ways of doing it

#

What does that psnUri.html file contain?

balmy sky
flint bronze
#

if you can't implement it within the Discord client it's probably not appropriate to add

#

because I think I know what you're trying to do, open a fake PSN profile replica webpage

flint bronze
#

what does it do then?

dull magnet
#

what are you trying to do

haughty maple
#

it was just for development after i got it done i would replace it and stuff

flint bronze
#

I'm going to be brutally honest

#

This is a really bad hack promoting a user-hostile service

haughty maple
dull magnet
#

you can just import files

import htmlString from "file://psnUri.html"
flint bronze
flint bronze
flint bronze
haughty maple
#

i see an official way calle My PlayStation, but it has dissappeared from the website :(

flint bronze
#

yeah I came to the same conclusion after some brief research

#

thanks reddit

haughty maple
#

WHY SONY WHY

flint bronze
#

console wars is dead

#

no point simping over a certain console

#

ps5 has no games anyway

haughty maple
haughty maple
balmy sky
#

All the people doing console wars became over 10 and swapped to pc

flint bronze
#

i'd assume there are 0 exclusives on xbox these days

haughty maple
#

I have a xbox one that runs like absoulute crap, i tried launching roblox, it didn't launch. My PC has low specs too

flint bronze
#

at this point consoles are glorified mid-range desktops with a fucked up operating system

haughty maple
#

well fuck playstation support!

flint bronze
#

except for the nintendo switch

flint bronze
haughty maple
flint bronze
#

trol

haughty maple
flint bronze
#

doesnt that menu run like ass anyway

haughty maple
shrewd tundraBOT
rocky falcon
flint bronze
balmy sky
#

Well yeah

flint bronze
#

it's called

balmy sky
#

The uhh

#

Video volume thing

flint bronze
#

video

balmy sky
#

Yop

flint bronze
#

yeah

balmy sky
#

But i kinda lost motivation for the idea anyway

flint bronze
#

is that its own component?

rocky falcon
balmy sky
#

Not sure

flint bronze
#

What did you need for it

balmy sky
#

I was gonna make a volume manager thing

#

Like you can change the volume of every sound in the app

rocky falcon
#

thats what i thought

flint bronze
#

i thought someone made this

balmy sky
#

I thought it was only call sounds you could change?

flint bronze
#

probably a BevilDroยฎ๏ธ plugin

balmy sky
#

I love bevildro

amber basin
#

discord gamepidgeon

#

sharing game state through links that embed as images just like they do on gamepidgeon to ppl who dont have it installed

visual rune
#

BevilDro

amber basin
#

boooo

#

thats no fun

flint bronze
#

discord activities trol

slate valeBOT
visual rune
#

i love hacking on gamepigeon

flint bronze
#

HORROR

slate valeBOT
flint bronze
balmy sky
#

@flint bronze i chose the stupidest fucking icon possible

#

It's so beautiful

#

Standing man vs running man

#

I wish there was more running icons

visual rune
gloomy terrace
#

A simple x2 (?)

flint bronze
visual rune
#

its so easy holy shit

#

and archery

#

nah

#

gamepidgeon is written in Obj-C husk

#

so you can hook like ArcheryScene class

#

first of all dump the binary

#

(easy)

#

then you can extract the Obj-C classes

#

dump a header

balmy sky
#

I COULDN'T FIND ANYTHING ELSE

#

I can try

#

The slow icon is just a frog