#πŸͺ…-progaming

1 messages Β· Page 2 of 1

ionic lake
#

not so professional and yes

winged mantle
#

tbh that seems like a very minor thing

#

maybe they were having a bad day idk

ionic lake
#

I guess she has more things to say besides whatever was shared in the convo between us in uwunet

royal nymph
#

whats the problem here

#

looks fine 2 me

#

its probably more this

#

saying "but so many of your stupid design decisions just leave me frustrated" to a maintainer is kinda rude tho like its their library they get to choose the design MenheraThink1

winged mantle
#

tbf

camelCase is the worst

#

that's why i always use snake_case in javascript :D

royal nymph
#

personally i think both are stupid and would prefer iconUrl sorrykirino but i also dont really care cause its their lib they get to decide

winged mantle
#

it's so minor

#

following js conventions, iconUrl or iconURL makes the most sense

ionic lake
#

it's so minor yeah

winged mantle
#

whilst i don't like following conventions blurtroll i get it

ionic lake
#

I could just automate all renaming with ast-grep

fleet cedar
#

Js... conventions? Is there such a thing?

royal nymph
#

yes

#

well yes but actually no

winged mantle
#

vee told me that snake case is blasphemy /lh

fleet cedar
#

The snake was the original sinner so that makes sense

winged mantle
#

but i don't get it because it's not that unusual to have your own conventions vs the standard library
(in C++ the standard library uses snake case for classes but people don't usually follow that)

ionic lake
#

but I won't recommend it

#

uh what url was it

winged mantle
#

i was wondering how to implement a server whitelist system
would you have to manually implement getting the guild id for each event

#

and ignore events outside of an allowed guild

#

simply leaving guilds seems bad

woven jolt
#

because i assumed oceanic was an eris fork originally but it was a full rewrite and there was a lot of opinionated things i didnt like about it
plus donovan can be a bit of an asshole

#

everyone that was using eris bandwagoned to oceanic because of donovan making prs in the past

royal nymph
#

that's what id do

winged mantle
#

what if you run commands in the short time the bot is in the guild

wicked stump
#

well

#

that would require someone to run the command in the like 0.5 seconds between when your bot gets the GUILD_CREATE event and when discord receives the leave guild api request from your bot

#

and if you're worried about someone maybe adding your bot to a guild when it's offline so it wouldn't get the event, guild create is fired for every guild you're in when you connect to the gateway so there's a very, very low chance of you possibly missing it

winged mantle
#

what if somebody finds another ownership transfer exploit

wicked stump
#

whar

winged mantle
#

need i say more

wicked stump
#

that's not an exploit, you can transfer ownership to bots via api and bots can create guilds

winged mantle
#

why did they patch the more elaborate way of doing it then

wicked stump
#

but if you can't leave the guild because the bot is owner then you could just delete it

wicked stump
#

but again someone would need to invite the bot and transfer ownership to it in the time it takes your bot to handle the guild_create event so it feels fairly unlikely

winged mantle
#

noo transfering to a bot that didn't make it

dusk otter
#

how to open that thing that i dont know the name where you are allowed to search for users, channels and etc?

winged mantle
#

because mavin and me found a way which involved deleting the application 😭

dusk otter
#

how can i open it using vencord api?

winged mantle
#

uh i did this a while ago

fleet cedar
#

Same way as you do anything in discord

#

Dig through the code until you find it

dusk otter
#

okay

#

thx

winged mantle
#

i already wrote code

dusk otter
winged mantle
#

Vencord.Webpack.findByCode("type:\"QUICKSWITCHER_SHOW\"")()

dusk otter
#

thx bro!

winged mantle
#

you should use a const to store the function

dusk otter
#

okay

#

thx

winged mantle
#

oh it might have broken since 2023

dusk otter
#

let me take a look

winged mantle
#

see WebKeybinds

dusk otter
#

maybe i could try using flux dispatcher?

winged mantle
#

that's what it's using

dusk otter
#

oh

#

ill take a look into it, if i get anything i will return here, thx a lot :)

wicked stump
#

I tried to test right now but 2FA on all my accounts makes it a pain and I'm technically at work so I should get back to work

dusk otter
#
FluxDispatcher.dispatch({
    type: "QUICKSWITCHER_SHOW",
    query: "",
    queryMode: null,
})

@winged mantle this worked for me

royal nymph
wicked stump
#

yeah

royal nymph
#

if you're worried about that u could just make the bot create 10 guilds

wicked stump
#

err

#

if it's in less than 10

#

that's what applies to the create limit

winged mantle
royal nymph
#

gonna transfer vencord server ownership to mee6

wicked stump
#

I don't think the limit applies to transfer

#

just to create

#

because discord doesn't want a broken loop bot creating 28748976438298748762398543 guilds

winged mantle
#

I DELETED THE APP TO TRANSFER 😭

#

and they specifically changed it so that deleting doesn't choose a bot

wicked stump
#

tbh that seems like a bugfix more than an exploit

#

because if an app owns the guild and gets deleted and the guild gets transferred to a random bot the ability for users of the guild to recover the server is like 0

#

(I'm kinda assuming that is what was happening, idk the exact thing you're talking about)

winged mantle
#

i didn't think it was an exploit

#

but i think somebody reported it as one idk

royal nymph
#

i think if the owner gets banned you can also request a transfer

wicked stump
#

well yes but making it so that doesn't need to happen cuts down on requests

winged mantle
#

...but the server would've needed to be owned by a different bot in the first place

#

why would you do that with a bot you don't control in the first place

wicked stump
#

wait i'm confused now

#

I thought this whole conversation was about whether you could still transfer a server to a bot and I thought you were saying you couldn't anymore

#

are you only talking about situations where the bot created the guild?

dusk otter
#

how to get channel id from an user dm by its user id?

royal nymph
#

what?

dusk otter
#

like

#

i have an user id

#

every user has it dm

#

the dm has it id

#

i want to get the dm id from the user id

winged mantle
#

you need to open a dm i think?

dusk otter
#

kinda

#

i need to send a message to a dm

#

but i only have the user id

royal nymph
#

there's a function for it

#

try to find it yourself

#

use react devtools to inspect the "send message" button in user profiles

#

and see how it opens the dm

clear lagoon
#

why delete?

royal nymph
#

what

clear lagoon
#

other random guy (probably) randomly deleted his msg

wheat kernel
winged mantle
#

yeah i accidentally leaked the secret

#

i was like "haha i will try this there's no way it will work" in a public chat

wheat kernel
#

:(

winged mantle
delicate sinew
#

husk

surreal condor
#

just use x at this point

winged mantle
#

why does type narrowing not work :(

#

shouldn't the type of args become EventTypes["applicationCommandPermissionsUpdate"]

magic shale
#

Doesn’t typescript make you explicitly cast it

winged mantle
#

this feels a little dumb

#

i've already checked than E is "applicationCommandPermissionsUpdate"... right??

fleet cedar
#

Does it work better if you use keyof EventTypes directly without the extends?

winged mantle
#

how do you name it E?

fleet cedar
#

Oh right

winged mantle
#

i think extends just means it meets the constraints here

fleet cedar
#

I don't really know how the dependent type features work

winged mantle
#

this isn't possible

serene elk
#

rust made me prefer snake case over camel case

delicate sinew
# winged mantle this feels a little dumb

What if you put const [data] = args as EventTypes[type] at the top and then check what type is after that it'd be very silly if that worked (I have no idea about ts)

winged mantle
#

that doesn't work

#

you can only index a type with another type

delicate sinew
#

Sadness

winged mantle
#

this works though

#

oh but it breaks the contract

royal nymph
#

imagine

type = "foobar";
if (type === "foobar") {
  // `args` is not necessarily of type foobar
winged mantle
#

but type is E and args is EventTypes[E]

#

if you check that type (and therefore E) is "foobar", i would've thought EventTypes[E] should be treated as EventTypes["foobar"]

royal nymph
#

normally the way you'd solve these issues is to have a field like type on the event

winged mantle
#

this is a discord.js arg array

serene elk
#

maybe you can make a guard function (idk how to call them properly)

royal nymph
#

yeah

#

i was about to say that

#

one sec

#
interface EventTypes {
    foo: {
        value: "foo";
    };
    bar: {
        value: "bar";
    };
}

class EventData {
    constructor(
        public event: keyof EventTypes,
        public data: EventTypes[keyof EventTypes]
    ) {}

    is<T extends keyof EventTypes>(
        event: T
    ): this is { event: T; data: EventTypes[T] } {
        return this.event === event;
    }
}

function handle_event(event: EventData) {
    if (event.is("foo")) {
        console.log(event.data.value);
    }
}

handle_event(new EventData("foo", { value: "foo" }));

#

something like this

winged mantle
#

ty

#

cursed though

delicate sinew
#

What else would you expect from js/ts other than cursed stuff :3

royal nymph
#

unfortunately guard functions cant assert other variables in scope

royal nymph
winged mantle
#

is it a code smell just to have global registries blobcatcozy

winged mantle
#

doesnt't

royal nymph
#

it does :p

winged mantle
#

by which i mean it works exactly the same as before (for me)

#

the guild leaving thing is probably a lot easier blobcatcozy

royal nymph
#

you copied it wrong

winged mantle
#

ohh

#

i just realised

royal nymph
#

this needs to be E

winged mantle
#

AE

#

yeah

#

this is going to be the worst if else ladder

royal nymph
#

and dont manually assign fields in ctor

winged mantle
#

i don't like implicit fields

royal nymph
#
constructor(public type: keyof EventTypes, public data: EventTypes[keyof EventTypes]) {}
royal nymph
#

less boilerplate is good

winged mantle
#

it's confusing because it hoists an argument declaration into a wider scope

#

i wish you could do the same thing as this with switch

royal nymph
#

u can :PPPPP

winged mantle
#

how

#

:PPPPPPPPP

royal nymph
#
switch (true) {
  case data.is("foo"):
    break;
  case data.is("bar"):
    break;
}
winged mantle
#

whaaat

#

inverted

fleet cedar
#

Illegal

#

Sinful

winged mantle
#

that really hurts my head

royal nymph
#

which is kinda cursed but

#

it works

cerulean plover
#

i do horrible things like this too occasionally

royal nymph
#

it's technically less performant than an if else tower cause you're always comparing to every single event unlike the if else which can short circuit as soon as it finds a match

#

but it doesnt matter

winged mantle
#

this code is utterly unreadable

cerulean plover
#

/ignore-this

#

hm

#

dont mind the horrible testing

#

ignore this i am testing messagetags

#

/testing-ignore-this

#

womp womp

winged mantle
#

this is all very cursed

#

i did Pick to choose every single field

cerulean plover
#

why is this channel cursed

winged mantle
cerulean plover
#

ignore this i am testing messagetags

#

well i fixed my shitcode

winged mantle
#

trying a different approach

magic shale
nimble bone
#

the kode tode should have her koding privileges taken away

worthy sun
#

the tode

wheat kernel
dim cave
quick crow
wanton osprey
past coral
# winged mantle

I showed this to my friend and they were very unhappy with me afterwards, lmao.

#

"Block that user, an array of objects would have sufficed" SKULL_SKELETON

winged mantle
#

i made a mistake with fin dand replace and the formatter went crazy

winged mantle
#

is it possible to check at compile whether a type union includes null

golden narwhal
winged mantle
#

why is this not being infered as string | null

royal nymph
winged mantle
#

oops

#

i was wondering why the compiler was being weird

royal nymph
#

strict is good but noImplicitAny is bad rule

winged mantle
#

yeah it's annoying

torpid topaz
#

to use java script on My website do i need to link it somehow?

glacial mirage
#

you need to use a <script> tag

#

you can either have js code inside the tag, or use src="somefile.js" to load an external javascript file

#

examples from mozilla web docs

<script>
  alert("Hello World!");
</script>

<script src="javascript.js"></script>
golden narwhal
#

can someone rate my readme

#

i need feedback

#

because i wanna make it look GOOD

fleet cedar
#

Not enough emoji

golden narwhal
#

where should i add emoji

lament bay
#

πŸ”„ Reverse πŸ› οΈ Engineering

golden narwhal
#

idk what modding discord is so i just put it as modding

tight fern
torpid topaz
#

Guys im currently working on a bio website and im looking to make it a little bit like this ( https://e-z.bio/SKRRRTT ) and idk bc i dont want to copy everything but what should i add custom that could be cool

worthy sun
#

i LOve reverse engineering

#

i reverse engineer everyday

worthy sun
#

theyre annoying as fuck

#

just curious

#

i have never clicked on a bio site link

autumn sapphire
stone plinth
#

im probably being extrememly stupid, i never use regex,
anyone insight on why this patch has no effect,
trying to add a click action to the example button on the edit profile screen.

{
            find: "m.default.Messages.USER_SETTINGS_CUSTOMIZE_PROFILE_EXAMPLE_BUTTON",
            replacement: {
                match: /\(d\.Button, \s * { \s*className: \s*v\.button, \s*color: \s*v\.buttonColor, \s*size: \s*d\.Button\.Sizes\.SMALL, \s*fullWidth: \s*!\d, \s*children: \s*m\.default\.Messages\.USER_SETTINGS_CUSTOMIZE_PROFILE_EXAMPLE_BUTTON\s*}\)/,
                replace: "(d.Button, {\n    className: v.button,\n    onClick: () => {$self.timeMachineClicked()}\n    color: v.buttonColor,\n    size: d.Button.Sizes.SMALL,\n    fullWidth: !0,\n    children: \"Open time machine\"\n})"
            }

        }

again apologies for stupid please educate

#

i litterally just copied the code for the button and changed it to regex for the match

drifting cloak
stone plinth
fleet cedar
stone plinth
#

how am i supposed to target that button then

fleet cedar
#

\i

stone plinth
#

my understanding is \i in regex will take what is there and give it to me as a variable. so if i am to use i then i have to find something consistent that surrounds the button

cerulean plover
#

yes

#

i have been told to not start patches with \i

stone plinth
#

interesting i will look into doing that

royal nymph
cerulean plover
astral radish
#

does anyone know how to work around this ive been pulling my hair out

#
.codeblock {
    border-radius: 6px;
    padding-left: 12px;
    margin: 12px;
    border: 2px white solid;
    background: rgb(24, 24, 24);
    box-sizing: border-box;
}

this is the css i have for it

#

tried word-wrap: break-word; but it does Nothing

#

wait what the fuck

winged mantle
#

🐌

serene elk
#

it is because it's a wildcard so it will most of the times try the rest of the match instead of just moving on

#

I prefer avoiding it

royal nymph
#

it doesn't matter much :p

fleet cedar
#

Any good regex engine starts by finding literals and finding the rest from there

serene elk
#

that is how I write my regex

#

I don't leave it to the engine

serene elk
winged mantle
#

what if the engine matches backwards

astral radish
#

its two of them

#

i managed to fix it earlier by specifying both classes πŸ₯΄

lament bay
#

do you have white-space set to something like nowrap or pre instead of normal

astral radish
#

also yeah i tried that it still didnt work for some reason

#

even after many !importants

#

idk what i did but this works

[class*="language-"] [class="highlight"] [class=highlight] {
    margin-left: 20px;
    margin-top: 20px;
    margin-right: 20px;
    padding: 10px;
    border: 2px rgb(102, 102, 102) solid;
    border-radius: 6px;
    background-color: rgb(29, 29, 29);
    white-space: pre-wrap;
}

and i dont think im touching this LOL

#

jekyll is funny

shell crag
#

goofy ahh selector

frosty obsidian
#

@deep mulch look

#

mocha

deep mulch
#

what are you making

frosty obsidian
#

thats my demonlist app

#

im adding themes

deep mulch
#

good

frosty obsidian
deep mulch
#

Catppuc
cin

frosty obsidian
#

you love text wrapping

deep mulch
#

yop

#

make it marquee maybe

frosty obsidian
#

i will

#

i don't think those cards would look better wider

deep mulch
#

norp

#

@frosty obsidian should i use enum class or const val for this

frosty obsidian
#

i also have latte but idk what color it uses for primary

deep mulch
#

first one starts at -1

#

if i do enum class

#

ill have to add a value field

#

other way is

#

object AVPixelFormat {
const val GUH = -1
...

#

but loses type safety

frosty obsidian
#

just go enum with value property

deep mulch
#

okay

frosty obsidian
#

it's supposed to be an enum anyways

deep mulch
#

i will do

frosty obsidian
#

you love bitmask

#

i might be able to make that a value class

shell crag
#

according to the catppuccin people mauve should be the default accent color

#

at least for mocha

royal nymph
#

devilbro fan app @frosty obsidian

frosty obsidian
#

swapped the bg and surface colors

native spruce
#

@frosty obsidian is the progress bar idea good

frosty obsidian
#

yeah it looks good

deep mulch
#

@frosty obsidian @frosty obsidian are you develop

frosty obsidian
#

whar

frosty obsidian
deep mulch
#

@frosty obsidian what tests can I do for ffmpeg library

#

to ensure the code works

frosty obsidian
#

idk

deep mulch
#

find

#

once both of these are done I can use in hyperion

#

also

#

I'm writing 1:1 bindings

#

might make another project that wraps it to make it easier to use

deep mulch
#

😭

frosty obsidian
#

social image

native spruce
#

I haven't had much time to work on my demonlist app due to trying to recover from body hurting and school sadly

frosty obsidian
#

:(

native spruce
#

I implemented the progress bar thingy in like 10 minutes and was so out of it lmao

frosty obsidian
#

id recommend taking a short break then

native spruce
#

I'm already taking a break from not doing any extensive coding sessions

#

bc well I have no time to anyway

astral radish
calm ruin
ivory heath
#

ffmpeg -buildconf iirc should give you a more detailed list

red mist
#

lsp extension for codeblocks, opinions? (Just an idea at the moment)

fleet cedar
#

Lsp extension for discord code blocks pls

delicate sinew
#

What's that

delicate sinew
#

Never heard

red mist
# delicate sinew What's that

The thing in your code editor that suggests completions is powered by Language Server Protocol, basically a language server running in the background tells your editor here are some completions based on the current context n stuff

frosty obsidian
delicate sinew
#

Ahhh

#

Idk if it's useful for codeblocks usually I just paste into them bwaa

red mist
fleet cedar
#

People got tired of writing support for every language in every individual editor, so they made a protocol so you can implement a language once and support all editors

red mist
astral radish
dawn ledge
fleet cedar
#

It's mostly jetbrains doing that, right?

winged mantle
#

should i group all slash commands into module to avoid limit like carl blobcatcozy
/reminder remindme my beloved

ivory heath
#

I would make the prefix command simpler if you’re gonna do that

dawn ledge
#

/remind me at: what:

#

who cares about grammar :^)

#

this is why text commands are infinitely better

whole cove
#

slash commands suck tbh

cerulean plover
whole cove
#

natural language commands πŸ’œ

#

/mute user for 5 hours

cerulean plover
winged mantle
#

but more importantly people will scream at me if there are no slash commands

cerulean plover
#

(where reasonable)

winged mantle
#

that's what i'm trying to do

#

ah

#

make it so "where reasonable" is just a conviniently small subset of commands

#

ig 100 commands is quite a lot

cerulean plover
#

how do you manage to get 100 commands in a discord bot

winged mantle
#

but i looked at a bot with prefix commands and it had 120

#

there's also other annoying limits

cerulean plover
#

such as

winged mantle
#

i think 9 options, 4000 characters for the json

grand garnet
#

really

winged mantle
dim cave
#

how do i get my discords colors

winged mantle
#

carl bot so good

pearl stagBOT
delicate sinew
#

lol

quick crow
delicate sinew
#

tbf ive done worse in programming

native spruce
#

these compliments r HappyBun

#

I posted my app yesterday on twit and it got some attention

#

I shouldve posted it on gdtwitter and it wouldve blue up

frosty obsidian
whole cove
#

like "do anything with slash commands" yeah sure alright discord

woven jolt
#

css crimes

deep mulch
#

@frosty obsidian

#

i need opinion

#
public expect class AVFormatContext

public expect val AVFormatContext.metadata: AVDictionary
``` im doing this in common to map classes
#

in jvm its

#
public actual typealias AVFormatContext = org.bytedeco.ffmpeg.avformat.AVFormatContext

public actual val AVFormatContext.metadata: AVDictionary
    get() = this.metadata()

#

idk of a better way

deep mulch
#

jvm works cause

#

javacpp fields are methods

#

theres no conflict

#

in k/n they're fields

#

so Extension is shadowed by a member

#

if i just change it to a differfent name then it works but guhhh

#

anyways metadata dumping works

#
n6.1.1
major_brand = mp42
minor_version = 0
compatible_brands = isomavc1mp42
creation_time = 2010-01-10T08:29:06.000000Z
> Task :lib:jvmMainClasses
> Task :lib:compileTestKotlinJvm
w: Opt-in requirement marker kotlinx.cinterop.ExperimentalForeignApi is unresolved. Please make sure it's present in the module dependencies
> Task :lib:jvmTestClasses
6.1.1
major_brand = mp42
minor_version = 0
compatible_brands = isomavc1mp42
creation_time = 2010-01-10T08:29:06.000000Z```
finite isle
woven jolt
#

this is sidebery not tree style tabs

finite isle
royal nymph
dawn ledge
#

least insane css

jagged pelican
# woven jolt

That font is the true crime. Sat here for a good minute trying to figure out what those units were

woven jolt
potent cloud
potent cloud
winged mantle
#

my bot is coming along nicely

quick crow
#

<@{target}>

#

πŸ”₯

winged mantle
#

better than skyra

woven jolt
potent cloud
#

Interesting...

frosty obsidian
#

i love making about screens

native spruce
#

what does the heart mean

royal nymph
#

donate probably

frosty obsidian
#

yop

#

gh sponsors

royal nymph
#

wing will sponsor me for 30000€

frosty obsidian
#

nop

#

you are billionaire

royal nymph
#

i wish

native spruce
#

paypal me 500,000 usd

deep mulch
#

okay

frosty obsidian
royal nymph
#

i have half a million cent @frosty obsidian

#

half a millionaire

frosty obsidian
royal nymph
#

whar

frosty obsidian
#

thats half a million cents

royal nymph
#

no? 😭

frosty obsidian
#

yes

royal nymph
#

wing cant math

frosty obsidian
#

1 cent = 1/100th of a dollar

royal nymph
#

yes

#

500 / 100 = 2.5

deep mulch
#

@native spruce you love c

royal nymph
#

wing so good at math

frosty obsidian
#

guh

native spruce
#

I dont like c but the syntax is dead simple

frosty obsidian
#

idk why i went with quarter of a million

#

brain decided to be stupid

deep mulch
#

wing is an AI

winged mantle
wheat kernel
#

average js

frosty obsidian
#

@deep mulch you love

deep mulch
frosty obsidian
#

mocha actually works really well with m3

deep mulch
#

i am unsure how to model this C api in kotlin

frosty obsidian
#

embrace insanity

deep mulch
#

its a bunch of callbacks

#
public expect inline fun <reified T : Any> MPVStreamCbInfo(
    crossinline read: MpvStreamCbReadFn<T>,
    crossinline seek: MpvStreamCbSeekFn<T>,
    crossinline size: MpvStreamCbSizeFn<T>,
    crossinline close: MpvStreamCbCloseFn<T>,
    crossinline cancel: MpvStreamCbCancelFn<T>
): MpvStreamCbInfo

public typealias MpvStreamCbOpenRoFn = (uri: String) -> Int
public typealias MpvStreamCbReadFn<T> = (cookie: T, buffer: ByteArray, nBytes: ULong) -> Long
public typealias MpvStreamCbSeekFn<T> = (cookie: T, offset: Long) -> Long
public typealias MpvStreamCbSizeFn<T> = (cookie: T) -> Long
public typealias MpvStreamCbCloseFn<T> = (cookie: T) -> Unit
public typealias MpvStreamCbCancelFn<T> = (cookie: T) -> Unit

#
public expect fun Mpv.streamCbAddRo(protocol: String, openFn: MpvStreamCbOpenRoFn)
#

Maybe ill make MpvStreamCbOpenRoFn return the MPVStreamCbInfo object

frosty obsidian
#

im not gonna be any help with native stuff

#

don't know anything about it

deep mulch
#

nop

#

not native

#

just api design

#
ctx.streamCbAddRo("myprotocol") { uri ->
    MpvStreamCbInfo<String>(
        read = { cookie, buffer, nBytes ->
            println("read")
            0
        },
        seek = { cookie, offset ->
            println("seek")
            0
        },
        size = { cookie ->
            println("size")
            0
        },
        close = { cookie ->
            println("close")
        },
        cancel = { cookie ->
            println("cancel")
        }
    )
}
``` maybe something like this
#

@frosty obsidian why is file not multiplatform

frosty obsidian
#

its not part of kotlin

#

its java stdlib thing

deep mulch
#

i know

#

they could make it stdlib

frosty obsidian
#

they probably just want people to use the file stuff provided by each platform

#

they shouldn't

#

but im pretty sure that's their reasoning

deep mulch
#

idk what to use to represent the buffer in common

#
read = { cookie, buffer, nBytes ->
                    println("read")
                    0
                },
``` read is supposed to read nBytes into the buffer
frosty obsidian
#

might have to find some io library

deep mulch
#

wing wong

frosty obsidian
#

kotlinx-io maybe

deep mulch
#

maybe

frosty obsidian
deep mulch
#

what that

frosty obsidian
#

kotlinx-io

#

readme

deep mulch
#

oh

#

what if i use ByteArray as the buffer

frosty obsidian
deep mulch
#

wait

#

no

#

byte array is immutable

frosty obsidian
#

kotlinx io has buffers

deep mulch
#

yop

frosty obsidian
#

use

deep mulch
#

idk though cause

#

maybe i can just use expect actual

#

doesnt jvm have buffer

frosty obsidian
#

why not just use library literally designed for what you need

deep mulch
#

no need if its just 1 thing

frosty obsidian
#

you only need buffers in that one place?

deep mulch
#

yes

#

i think

frosty obsidian
#

id still look into it at least

pearl stagBOT
deep mulch
#

do you understand this

frosty obsidian
#

not at all

deep mulch
#

how

frosty obsidian
#

i mean vaguely

#

idk what cookie is

deep mulch
#

its like

frosty obsidian
#

i know that * is pointer

#

i think

deep mulch
#

the object everything is ready from

#

yes

frosty obsidian
#

fread is file read

deep mulch
#

yes

frosty obsidian
#

no idea what size_t is or what feof does

deep mulch
#

feof checks if its at the end of the file

#

size_t is special type

#

that

#

like 32 bit systems and 64 bit systems have different maximum values

#

so that code works on both systems

frosty obsidian
#

guh

deep mulch
#

ill try kotlinx io in the test

frosty obsidian
#

kotlinx is probably gonna be more efficient cross platform than a custom solution

deep mulch
#

maybe

#

wing real name Roger

frosty obsidian
#

nop

deep mulch
#

are you gonna be able to work on gloom soon

#

i tried github app

#

its still bad

frosty obsidian
#

im currently experiencing shiny object syndrome with hellish

#

im having fun working on it

deep mulch
#

gu

#

release when

deep mulch
#

good

royal nymph
#

i saw cyn messages but then they disappeared

#

hashmap computeIfAbsent

deep mulch
#

cyn moment

royal nymph
#

i think she was asking for equivalent function in js but then realised the question makes no sense cause js is single threaded so there's no need for such an atomic function

royal nymph
#

just random guess

fleet cedar
#

computeIfAbsent is more about convenience than thread safety really

royal nymph
#

wrong

#

its entire point in java is thread safety

#

well ig not really but

#

that's its practical use

fleet cedar
royal nymph
#

hmm that's fair i stand semi corrected

#

but it hardly has a different use case than synchronisation

#

all its uses ive seen were thread safety related

#

if you use a ConcurrentMap, it's thread safe

#

while something like

if (!map.has("foo"))
    map.set("foo", "bar");

wouldn't be

fleet cedar
#

That much is true

royal nymph
#

java thread safety is a nightmare anyway

#

ConcurrentModificationException my love

fleet cedar
#

I've gotten that one more often in singlethreaded than multi

winged mantle
#

🫠

#

it makes sense in typescript imo because you need !

if (!map.has(key))
    map.set(key, "gaming");

const value = map.get(key)!;
frosty obsidian
runic sundial
#

Java thread safety ain't that bad

#

In general, it depends on the access model. But sharing/mutating a collection across threads is always a pain to optimise regardless of the language

#

If you want it to "just work" then use a concurrent map and call it a day

#

If it's a bottleneck, reconsider your ways and try to find a way around having global state

#

If you're hellbent on it, play around with locks and optimise for your access patterns

#

(enjoy your unit tests thoe lmao)

winged mantle
#

JavaScript is just Java but Scripted

runic sundial
#

ECMAScript

royal nymph
#

99.9% of the time you can just write

let value = map.get("key")
if (!value) {
    value = initialise("key")
    map.set("key", value)
}
#

write code like this instead

#

(won't work if you're potentially storing undefined in the map)

winged mantle
#

mutuable data ew

#

but ye that works

grand garnet
#

is it more swagful to use let or var when it doesn't make a difference either way

royal nymph
#

var is ultra swag

winged mantle
#

you should use let unless you need var

#

var

royal nymph
#

funny alias

#

i should remove it cause noone uses this shit

grand garnet
#

lol

crimson cave
#

vhelp

elder yarrowBOT
# crimson cave vhelp

vban (yeet, 🍌) - Does stuff idk
veval (e, $) πŸ‘‘ - Does stuff idk
vfaq (f) - Does stuff idk
vhelp (h, ?) - Does stuff idk
vrole-add (+, ra, ar) - Does stuff idk
vrole-remove (-, rr) - Does stuff idk
vnotsupport (ns, nots) - Does stuff idk
vprune (purge, clear, delete) - Does stuff idk
vsource-code (source) - Does stuff idk
vsupport (s) - Does stuff idk
vupdate (up) πŸ‘‘ - Does stuff idk
vmodmail:post πŸ‘‘ - Does stuff idk

winged mantle
#

blobcatcozy i think my code is slightly spaghetti

#

i should make repo public lol

#

need to implement configuration support pain

grand garnet
#

I should probably private some of my repos because its shit and I don't want pr to fix its shitness

winged mantle
#
// everything where an escape is valid and the character sometimes affects formatting
// (all punctuation seems to be possible to escape?)
// perhaps this is not the best way to do this but it should work everywhere apart from inside codeblocks
const FORMATTING_REGEX = /[\\*_\-`#@<>.~|:]/;

export function escape_all(input: string) {
    return input.replace(FORMATTING_REGEX, "\\$&");
}

trolley will this work for everything

royal nymph
#

is this for discord

#

discord markdown escaping is so inconsistent it doesn't work half of the time

winged mantle
#

escaping always seems to work on special characters even if they do nothing

#

e.g. \Β£

#

even \☺

#

and i think \\ always becomes \

#

and this works with mentions and doesn't even have a ping for users (ofc they are all disabled): <@343383572805058560>

#

even emojis which are innaccessible

#

uh... i forgot about links

delicate sinew
winged mantle
#

Vaccine A Rabbit

worthy sun
#

but ig u escape ` too

#

so i guess its fine

woven jolt
royal nymph
#

damn my assumption was all wrong

woven jolt
#

i think i figured that part of it out thus why i deleted the messages but i have no way to test currently since theres still a bunch of other shit

#

im stuck on Comparator.comparing but i dont know enough about android nor java to know what to replace it with

royal nymph
#

try making a custom comparator instance

#
thing.sort(new Comparator() {
   // implement methods
})
#

i think that's the old way

#

or if you can use lambdas

thing.sort((a, b) -> a.getThing().compareTo(b.getThing()));
winged mantle
#

Comparator.comparing(Thing::getThing) blobcatcozy

royal nymph
#

congratulations on missing the entire point

winged mantle
#

oh

#

πŸͺ

winged mantle
#

hm looks like discord.js probably is a dumb choice because of memory usage

winged mantle
#

stuff like this in oceanic just feels yucky

#

why isn't this nullable

#

it looks like most big bots use eris but that's outdated :(

surreal condor
winged mantle
#

i don't think i like the look of anything else

surreal condor
#

logically irl every big thing has a shitton of legacy code

winged mantle
#

πŸ’”

surreal condor
winged mantle
#

😭

#

and this feels like a pretty big deal because it could lead to a lot of oversights

#

people say eris hasn't been updated but it had a commit 3 days ago

#

husk no automod

#

or messages in voice

#

okaayyy

royal nymph
winged mantle
#

you usually use await fetch?

#

makes sense

#

but it's weird it exists at all

royal nymph
#

well it depends where that property is

#

but at least in the case of messages, you would

if (!msg.inCachedGuildChannel()) return
#

which then gives you full type safety and non nullable guild, member, etc

winged mantle
#

why not fetch stuff if you don't have it

royal nymph
#

i mean u can do that manaully :p

winged mantle
#

are all guilds cached all the time

magic shale
#

how do i mute myself from a discord application? i cant find it on the docs

winged mantle
#

i'm guessing that's the normal behaviour because discord sends them, right?

magic shale
#

my stream deck's discord plugin doesn't work with vencord so i want to make my own with my own application, so i can mute myself on my stream deck

royal nymph
#

via rpc

#

probably

winged mantle
#

i think there's a feature to do that but it's locked behind review (and they're not adding any apps)

#

idk

#

i don't think rpc allows it

magic shale
#

there's an rpc.voice.write permission and it seems to not stop me from using it

#

or is that for actual audio data

royal nymph
#

def not lol

magic shale
#

it requires approval

#

damn

#

time to make custom vencord plugin blobcatcozy

#

out of curiosity would that get merged if i made it

#

"StreamDeckFix"

winged mantle
magic shale
#

idk why the stream deck doesnt work, it works with normal discord and it used to work with vencord but stopped working at some point

winged mantle
#

why not make a vencord plugin which adds muting to rpc

magic shale
#

isnt that a normal discord feature

serene elk
winged mantle
#

or whatever words

serene elk
#

99% of the times that property will vr available

winged mantle
#

it's 01:53

serene elk
#

and if it's not it's your fault

#

so instead of having to say to typescript this is not null

winged mantle
#

i already switched to random eris fork 😭

serene elk
#

it throws an error instead

winged mantle
#

i'm sorry

#

isn't it pretty easy to switch

#

oceanic seems very inspired

serene elk
#

wdym inspired

winged mantle
#

inspired by eris

serene elk
#

yes

#

because it's made by someone who used to contribute to eris

#

and after eris stopped merging anything and getting updates they made their own

winged mantle
#

genuine question, what advantages does oceanic offer over e.g. dysnomia

serene elk
#

its similar to eris but also a complete different lib with opinionated changes

serene elk
#

I could be wrong cuz I didn't check but

#

eris was super behind

magic shale
# winged mantle in WS rpc, not in file socket RPC

im so confused lol
normal discord works just fine, the stream deck sends "SET_VOICE_SETTINGS" to rpc and it works
on vencord i never see it get logged and it doesn't work, and i dont know why it's different

#

is there something in vencord that messes with rpc

winged mantle
#

hm

#

iirc discord has IPC and RPC which are different things to confuse people

magic shale
#

it works when i disable all my plugins

winged mantle
#

it's probably present in IPC then

#

i wasn't sure if this was available in ipc too (which is similar but actually available to all developers)

magic shale
#

i somehow put my vencord in a state where the settings dont show any plugins enabled but all my plugins are enabled

winged mantle
#

well, i have seen dyno take minutes to respond to a command 😭

#

probably nothing do with lib though

deep mulch
#

@frosty obsidian you

#

i need advice

#

mpv has properties

#

and

#

you can add callbacks for when theyre modified

#

so

#

in kotlin i thought of doing like

#
mpv.observeProperty<Long>("volume") {
    println("Volume changed to $it")
}
#

what im unsure of is

#

its not exactly typesafe like

#

the developer could pass any type despite mpv only have like 6 property types

#

i mean something like below would work but its kinda yucky
mpv.observePropertyLong(
mpv.observePropertyString
...

frosty obsidian
#

do

cerulean plover
#

have you tried using a yt-dlp wrapper instead

winged mantle
#

yea okay i think oceanic is the way, using eris feels like using raw opengl

royal nymph
#

LMAO

dawn ledge
#

yeah i started using oceanic last night for a bot

#

loving it so far

winged mantle
#

oceanic keeping killing vscode for some reason

#

maybe it's because there are a lot of errors who knows

#

nah, this is so weird
errors take a very long time to disappear

winged mantle
#

i assume it's bad practice to use ! here?

royal nymph
#

why would member.roles contain undefineds?

winged mantle
#

i don't trust discord api

crimson cave
#

maybe if role isnt cached?

#

oh its ids

royal nymph
#

it shouldnt be possible

winged mantle
#

blobcatcozy it feels bad to rely on behaviour of a https/wss api at compile time

royal nymph
#

it will never send u undefined in the array

#

why dont u trust the api lol

#

if the api is broken your bot wont work either way

winged mantle
#

i feel like you're meant to use it for things that can be verified at compile

#

why do i care about this anyway it's so small xD

winged mantle
#

i think i'm in love with oceanic.js

#

i'm like a youtuber that hates something one moment for clickbait purposes and then loves it the next day

leaden flume
#

z

#

Why is this my name

royal nymph
#

well you probably need to tell it to link meow.c

#

rn you just include the header file

#

oh

#

go build main.go

#

youre only building main.go

#

try go build .

winged mantle
#

DISCORD SLASH COMMAND GROUPS ARE HORRID 😭

nimble bone
#

so true

#

discord slash commands are horror

winged mantle
#

subcommands are options

#

just why..?

#

the way ephemeral works is weird

#

should i just add an option to every command to choose whether you want it ephemeral or not

dawn ledge
#

yes

#

thats how most do it

potent cloud
#

or make it like @wet blaze (Fire) bot and add a incognito slash command to toggle

frosty obsidian
#

cloudflare decided to aggressively captcha me on pointercrates api

#

can't work on the app until it stops

#

guhh

long stream
#

cloudflare lava lamp moment

#

the wall of entropy :3

woven mesa
#

meow

winged mantle
quick crow
#

I used the first free online tool and it didn't add music

magic shale
#

dammit i was about to do it

quick crow
#

Get fucked

winged mantle
#

did you copy that all manually 😭

#

or did you use tessie /ocr or random online thing

magic shale
#

i didnt know that existed and i used a stupid online tool lol

#

worked well actually

#

this one is better

winged mantle
#

should i post in oceanic discord server

magic shale
#

yes

royal nymph
deep mulch
formal belfry
magic shale
grand garnet
#

possibly in your CSS there's a selector to change some other SVG that's picking up the pause icon too

#

or discord fucked it, could be either

magic shale
#

ohh thats true prob

#

yep themes

finite isle
quick crow
#

You need to EARN your imports

dawn ledge
#

i explicitly write out my imports

#

i almost always avoid *

dim cave
#

whats *

dawn ledge
#

import * from ...

alpine pecan
dawn ledge
#

insanely goofy interface names

glacial mirage
dawn ledge
#

slap in a % 100

#

i see no issues

dawn ledge
#

is there a way to emulate this behaviour in js

dim cave
#

what even is that oh my god that looks awful

dawn ledge
#

python is like "how many splits" and js is "how many elements from the splits"

dim cave
#

i cannot comprehend this languages syntax

#

i would help you but i cannot i wish you good luck

dawn ledge
#

what can you not comprehend

dim cave
#

Oh thats python

#

i believe i code in something close to python

wicked stump
dawn ledge
#

yeah

#

my bad

wicked stump
#

you could either

  • split and rejoin the last n elements
  • make some super cursed regex
  • manually get the split indexes and split yourself using substring
#

there might be a more betterer way but my eepy brain can't think of it right now

#

lazy me would just do the first option

dawn ledge
#

i ended up doing the last one

wicked stump
#

fair

glacial mirage
#

gradle hates me

#

why the fuck is it using windows paths

frosty obsidian
#

@native spruce you love

deep mulch
ionic lake
frosty obsidian
frosty obsidian
#

@deep mulch

#

improved

deep mulch
#

upload so I can steal for hyperion

frosty obsidian
#

i just mimicked chrome

winged mantle
#

huh why is my ping command returning a shorter latency on prefix commands than slash commands? is responding actually slower because that's very weird

royal nymph
#

slash commands sooo slow

winged mantle
#

i guess creating a message is implemented with blazingly fast rust

#

are slash commands not

#

just timed how long the request took like another open source bot festivehehe

native spruce
narrow dagger
winged mantle
#

i wondered if you could make a plugin for prefix command autocomplete but idk how you'd make it flexible enough to support most bots

#

command schema file πŸ”₯

#

i also wondered if you could abuse ephemeral replies to respond epemerally to prefix commands

#

when do they expire

winged mantle
#

LOL discord's own in-house bot uses prefixes

#

i guess they never bothered to update it cos they don't need to

nimble bone
#

slash commands are good for noobs but for people that can read they're far better

cerulean plover
#

Slash commands have one advantage and that's that the response can be ephemeral

winged mantle
#

self hosted because idk

#

extra reliability

#

the extra 100ms could've been spent doing something else

#

or maybe 50ms

#

this is my code to make it as fast as possible

#

after the command promise has completed it just stops the timeout

ionic lake
magic shale
#

require all of your messages to be in javascript (not posting in #πŸ“œ-js-snippets cause its stupid)

Vencord.Api.MessageEvents.addPreSendListener((_, ctx) => {
    let res;
    try {
        res = eval(ctx.content);
        if (res) res = res.toString();
    } catch (e) {
        return { cancel: true };
    }
    ctx.content = !res || res.length == 0 ? "no output" : res;
});
quick crow
#

() =>
{
console.log("am i stupid or something");
}

#

() => { E("OH THAT WORKS"); }

#

() => { E("kill me this is hell"); }

magic shale
#

Just write all your messages as strings

fleet cedar
mellow phoenix
#

that's interesting

#
##
###
####
#####
######
#

lol

glass dirge
wooden pagoda
glass dirge
#

Rule 11

wooden pagoda
#

okok

#

ty

rancid thistle
#

yo am i allowed to send yt link embeds in this channel

#

nvm

cerulean plover
rancid thistle
#

wrong chat

cerulean plover
formal belfry
#

Real

dawn ledge
#

how do i add type definitions for pseudo-modules

#

i am generating a module via esbuild loaders

#

i have tried a bunch of .d.ts stuff (nothing worked)

#

i am basically generating an array of commands and importing it like import COMMANDS from "~commands";

#

and ts is complaining about type defs

#

i cant find any way to define the types and have ts detect it

royal nymph
dawn ledge
#

thanks

royal nymph
#

make sure u dont use import outside of the modules

#

or it wont work

#

because ts stupidity

deep mulch
#

@dawn ledge hiii

royal nymph
pearl stagBOT
deep mulch
#

rewrite Vencord in rust

dawn ledge
#
declare module "~commands" {
    const COMMANDS: import("@commands/types").HandleableCommand[];
    export default COMMANDS;
}

blobcatcozy

dawn ledge
#

also haiii

frosty obsidian
#

@deep mulch

deep mulch
#

good

frosty obsidian
#

frecency

deep mulch
#

publish to play store

#

couldnt hurt

frosty obsidian
#

if i get it to a good state

deep mulch
#

soon

leaden flume
#

hey there, does anyone know if it would be possible to intergrate Discord Rich Presences into a website? Ie. when you open a website, a Discord Rich Presence appears. If anyone has any idea or any thoughts lmk here or DMs, working on an interesting project which might appeal to some people meow_popcorn

dawn ledge
#

it is possible and it has been done before too

quick crow
#

Would probably be the easiest way

#

(dont quote me on that)

dawn ledge
#

the easiest way is to

#
  1. self bot
#
  1. have a bot running to watch your presence
winged mantle
#

you don't need a self-bot

dawn ledge
#

ik

#

i gave both options

winged mantle
#

you could just do client-mod i mean

royal nymph
#

or it adds rich presence to your discord that you're viewing the site

leaden flume
leaden flume
royal nymph
#

you could use premid

#

as an extension

ornate quiver
#

EXPLODE

ornate quiver
leaden flume
leaden flume
ornate quiver
#

i can't recall but I think you can embed it as an iframe

royal nymph
royal nymph
leaden flume
dawn ledge
#

idk why you wanna display the site you're viewing as your presence
but it will definitely follow with privacy issues so keep that in mind

leaden flume
ornate quiver
#

but I don't understand why people want to publicize every single thing they're fucking doing

dawn ledge
#

i mean its good that it uses """legal""" ways to display it

#

but meh id rather self bot

leaden flume
winged mantle
#

Playing breathing

leaden flume
#

Yk lemme just post an explanation, lanyard looks smth similar

dawn ledge
#

okay so you have a web minecraft "client" and you want to have rpc for users using the web client?

dawn ledge
#

you will either have to use a user token to edit the presence manually
or you'll need to have a bearer token with activities.write scope (this isnt given to applications anymore and finding one with this scope is pretty rare)

#

idk if arRPC would work (even if it did you cant expect every user to have that on their device)

royal nymph
#

why u still yapping

#

just use premid

dawn ledge
#

:3