#🪅-progaming
1 messages · Page 1 of 1 (latest)
pro gaming??
new channel?
silly =w=
meow
But this isn't the channel formerly known as progaming
Thats #🧩-plugin-development mow
yeah
pro gaming
Welcome to #🧩-plugin-development for stupid idiots who can't request a role
Real
This was gayming no?
This branch office is brand new
It used to be gayming
They changed it lol
Look at chat above
O wait
me when i spread misifnormation online
this is a new channel for off topic programming
Lol, I didn't notice
O ok
So where is gayming?
O alr
give us huskboard
nice
This channel was needed I kept posting programming stuff in off topic

@woven mesa
i "deleted" the old programmign channel because it wasnt very active and programming stuff was fine in off topic
but now that off topic is EXTREMELY active and filled with whitenames, it's better to have a separate programming channel so u can have intellectual conversations away from the crackers

this server hates white people
wing wong so racist
Thank u vee ❤️❤️❤️❤️❤️

Can anyone guide me if there's a channel for themes?
there isn't
ok
i liked ur other banner
@alpine pecan u want it back
yopppp (i deleted because i realized what channel this is)
holy shit css clip-path is so cool
Bring back huskboard
Marketing statistics predict great success for a huskboard
is this programming or progaming
both

so real
Rest in pieces huskboard
@woven mesa wtf swiftui animations are easy and cool
bro is that the minecraft chat font
honestly i absolutely hate this syntax
the () are so ugly
but yeah that's a thing 

Yeah, there’s a monospace Minecraft font you can use with your IDE. Used to use it myself
Callback/promise hell I see in ur near future
apologies, this would fit hard in a unix#### theme
Fr 😂
this looks like Java
no its tewi
@woven mesa
give me 1 yen
why does it go backwards
Wdym
you should make the next part come from the right rather than the left
what does your code look like
nor do I know how to make it so this view appears first and be able to dismiss it
do you want me to implement that
It looks funky
maybe
ah
sure
i can try at least
I like seeing others do stuff so I can learn
but reminder this is a UIKit swiftui hybrid so its like completely different than what ive seen with swiftui lol

ah fuck I need to push my code
There we go
Had to boot up mac
ysah
same
fr
Is that in react?
Oh i see
is this new
Ye
since when did java have "console.log" lol
so true oomfie

Looks like a regular bitmap font
The only one I know that makes an attempt at TTFs is Cozette and I believe that’s the font in question edit: nvm Cozette doesn’t have italics, nvm then
pro grammar
For peoples who grammar very good
could somebody please give me the image posting role so i can post screenshots of my stupid apps?
you also grammaring very good!
i think i need to ping vee to get the role
huh what are u cooking here @odd vigil
That is so cursed
<script>
const userPromise = getUser(id);
</script>
{#await userPromise}
<p>Loading</p>
{:then user}
<Profile {user} />
{:catch error}
<p>Failed to fetch user {error.message}</p>
{/await}
this is how u do promises in svelte
not sure if this is a me thing, so i wanted to ask
onmount way seems much snappier to me (altho my impl wasnt very safe)
i tried with disabling cache too
it's the same for me
the first page just takes longer to load
the second loads instantly but loads for a bit
svelte await consistently takes 100-200ms more time to fully load
it might just be the additional check rather than onmount vs await itself
well not a check exactly, just thought it could be the error safety considering i didnt have that and thats pretty much the only difference beside switching from onmount to svelte await
not sure how it works under the hood lol
but i just added typesafety to onmount and it still consistently finishes 200ms faster for some reason

this is where im looking for the total ms for each, maybe i should be looking somewhere else?
maybe try to remove your fallback
{#await userPromise then user}
<Profile {user} />
{/await}
try just that
maybe svelte has a transition between the fallback and the result
but that seems really weird
seems like å bug
you inspired me to make my own demon list viewer for android 
holy shit W
best part about compose is that you can do this shit quickly
I can’t wait to see what it looks like
i have the login flow completely done
I don’t have any login features yet but I plan on doing it after I get my onboarding finished
for now i just persist the token and a serialized user object
not even in a db bc i don't think a sophisticated caching solution is really needed here
I only cache thumbnails
the image loading library ill use probably does that for me
Something I wish the demonlist has was a history of changes to the list
but they only seem to have it for like each individual demon

idk how to do etags with ktor client
I've only seen stuff for them for ktor server
ikr
meow
bun and deno: *exist*
type some bitches
some bitches
they typed some bitches
mid and mid
nuh uh
how does bun help
do they really just have to bump these? but for some reason don't
https://github.com/microsoft/monaco-editor/blob/main/package.json#L68-L70
**package.json: **Lines 68-70
"vscode-css-languageservice": "5.4.1",
"vscode-html-languageservice": "4.2.4",
"vscode-json-languageservice": "4.2.1",
very good 10/01
deno isnt that mid but bun is a fucking joke and a half
idk anything about bun, whats bad about it?
I recently used it and got annoyed that it blocks whatever (sub-)package's postinstall script it finds suspicious
one was core-js, I think, and it found a dyanmic import for a postinstall, "suspicious," and that they implemented this bespoke package.json spec
Yeah that's certainly not a scam
u can spam it really fast without any scripts so makes sense
it woudlnt work bc of ratelimit but the anim would play
core-js spamming users logs and getting dev locked in prison since i forgot when
javascript ecosystem 
though the guy did make a followup post a few years later
I forgor how to make multiline ternary not cursed
can see
There is no such thing as a not cursed ternary
For example, Python
dw mine looked like this too one time
yeah i just needed something in order to test paging
Python's are the most cursed of the bunch
i only like python's cause it's readable but really weird from a programming standpoint
Something's possibly wrong with my "build css and convert images to avif" thing, it's taking ~5 mins to run on github actions, anyone got a spare pair of eyes to take a look? https://github.com/MiniDiscordThemes/Snippets/blob/main/src/build.ts
how many input files are there?
your code is entirely synchronous. if there are dozens of files, try paralellisng it
yeah about 30 files and increasing, cheers I’ll take a look at that when I’m up
aka use async fs methods instead of sync, and see if sharp has async methods
and use Promise.all to run everything in paralell
could someone translate this for me
It means if you do def foo(bar = []):, that default value is evaluated when the function is defined, not when it's called
You're not supposed to use mutable types as default values in python ever yop
When would you even do that
the "proper" way would be
def foo(bar: list|None = None):
if bar is None:
bar = []
...
also I love how the guy in the tweet is like, python doesn't work like js
who woulda thunk it
You could also just
def foo(*_bar):
bar = list(_bar) # in case you really need it to be a list for some reason
Python's behavior is ridiculous though
That's not at all the same thing
It isn't
But I can't come up with a use case where you would need an empty list as default argument
true
it makes sense to me(knowing how mutables are passed around combined with how functions work), not gonna comment on if it's ridiculous because python was my first lang, so absolutely clueless
how does it make sense 😭
why tf would you ever want the same array shared across function invocations
javascript is also probably way less performant
by reinstancing it everytime
but also why the hell would you use a mutable object as a default value
but yea kinda horror for arrays
/run ```py
def funny(bar = 0):
bar += 1
print(bar)
funny()
funny()```
Here is your py(3.10.0) output @pine coyote
1
1
am i stupid
/run ```py
def funny(bar = []):
bar.append(1)
print(bar)
funny()
funny()```
Here is your py(3.10.0) output @fleet cedar
[1]
[1, 1]
WHaT THE FUCKING IS THE DIFFERNT
Integers aren't mutable
guh
/run ```py
x = 1
y = x
y += 1
print(x, y)
x = []
y = x
y.append(1)
print(x, y)
Here is your py(3.10.0) output @fleet cedar
1 2
[1] [1]
Ub my behated
mutables aren't copied when being passed around, and the way functions work in python is, it gives the def statement(the statement alone and not the body of the function) a once thru, at which point the empty list is initialized, and the same list is passed around upon calling the function however many times you call it, the list is initialized before you even call the function the first time if I'm not wrong
python drfaults are global
The thing that does not make sense is why the language was defined that way
function argument defaults
gotta ask python's bdfl
yes im saying that makes no sense
It makes sense from an implementation perspective, but not from a design perspective
I mean creating an empty list isn't probably the biggest bottleneck that comes with using js 💀
or python for that matter
Any case that would use an empty list as default already does that, just with a null check first
how are integers not mutable
Python makes a new one on any operation and deletes the old one
it doesnt have to be biggest bottleneck, slowing down from several places can create perf issues too
Every language does that
but eh tbh it probably wont even affect lot
/run
a = 5
print(id(a))
a += 7
print(id(a))
Here is your py(3.10.0) output @delicate sinew
140671911969136
140671911969360

at least every high level lang
Of course most languages don't box integers, but still conceptually the same
horror
Integers having identity is horror
ig it makes sense in some places like auto converting 32 bit to 64 bit number
Everything has in python lol
Python is slow for a multitude of reasons
@native spruce i will make this
:0
apple users are so good at design tbh
don’t you mean apple developers
/run
console.log('bot test');
Here is your js(18.15.0) output @summer mulch
bot test
#🤖-bot-commands
ty
/run
puts 'hi'```
Here is your rb(3.0.1) output @wispy palm
hi
/run
section .data
hello db 'Hello, World!', 0x0a ; null-terminated string with newline character
section .text
global _start
_start:
; write syscall
mov eax, 4 ; syscall number for sys_write
mov ebx, 1 ; file descriptor 1 (stdout)
mov ecx, hello ; pointer to the message
mov edx, 13 ; message length
int 0x80 ; call kernel
; exit syscall
mov eax, 1 ; syscall number for sys_exit
xor ebx, ebx ; exit code 0
int 0x80 ; call kernel
Here is your nasm(2.15.5) output @wispy palm
Hello, World!```
@wispy palm I only received js(18.15.0) error output
/piston/jobs/a81d7198-d3e0-4ae3-9c57-7a1950b3ef23/file0.code:1
console.log(client.token)
^
ReferenceError: client is not defined
at Object.<anonymous> (/piston/jobs/a81d7198-d3e0-4ae3-9c57-7a1950b3ef23/file0.code:1:13)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Node.js v18.15.0
/run ```js
console.log(process.env)
Here is your js(18.15.0) output @buoyant trellis
{
PWD: '/piston/jobs/2ed159b9-c84e-42af-bde5-6b7c73db382e',
SHLVL: '1',
PISTON_LANGUAGE: 'javascript',
PATH: '/piston/packages/node/18.15.0/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:.',
_: '/piston/packages/node/18.15.0/bin/node'
}
/run ```js
console.log(require("fs").readdirSync("/"))
Here is your js(18.15.0) output @buoyant trellis
[
'.dockerenv', 'bin', 'boot',
'dev', 'etc', 'home',
'lib', 'lib64', 'media',
'mnt', 'opt', 'piston',
'piston_api', 'proc', 'root',
'run', 'sbin', 'srv',
'sys', 'tmp', 'usr',
'var'
]
@native spruce
VeeStack
/run ```lua
print(_ENV)
Here is your lua(5.4.4) output @frosty zodiac
table: 0x55e6af663c10
more html
i think in html6 they should remove every tag except div
They need to keep <style> and <marquee> too
#justicefor<marquee>
nah
/run
print(":3")
Here is your swift(5.3.3) output @woven mesa
:3
@woven mesa is there a way in swift to detect if u have a certain device or newer
if not then man
rf
had to type out like 50 chars manually
amazing
cool this app has the same problem
I wish I could get the default system insets
@Subscribe
public void onSwitch(ServerConnectedEvent event){
var username = event.getPlayer().getUsername();
if (!Playtimev2.isPlayerOnline(username)){
logger.info("player not found as online, adding player to list");
Playtimev2.addPlayer(username, event.getServer().getServerInfo().getName(), String.valueOf(System.currentTimeMillis()));
} else {
logger.info("player is online, changed server. closing play in old server and opening in new");
var playerInfo = Playtimev2.getPlayerInfo(username);
if (playerInfo == null){
logger.error("HOW");
logger.error("something is going extremely wrong, so bad, very wrong. contact echo");
return;
}
logger.info(username+ " playtime: " + (System.currentTimeMillis() - Integer.parseInt(playerInfo[2])));
}
}```
rate @calm ruin
is it good ux to search through the api if its using the legacy list
but not if its using the other lists
@woven mesa m
progress
the main list is apparently 1-75
i think 100 is a better number
id really like do the color fade like you do, where its the dominant color of the thumbnail
i could even theme the text with that
hmmm
rn im doing a simple gradient
I think you should do the dominant color
ill just need to find a good library for doing so
maybe cache the color with the key being the thumbnail url
probably not too bad but id rather just not recalculate it very often
i wouldn't be doing a blur, id have to use some library that can extract the dominant color of a bitmap
i already know of a couple
this was the first iteration
i was not very happy with it
the circles are not such a bad idea tho tbh
yeah im probably gonna swap out the rounded rectangles for a circle again
also dear lord this font is gross
yeah the official site has some interesting design choices
😭
you know they used to have ads but removed them
and.. with that they kept the padding for the ads
so its off centered
also i hate that they provide the lowest possible quality for the thumbnail
NINE CIRCLES REFERENCE
another funny thing about their api is that they don't use the standard Link header for some reason
they use "links"
guh
yeah I know
some thumbnails are discord links too
idk why they don't host the images themselves
they aren't dealing with a huge amount of user generated content so it shouldn't be an issue
I think they do that to preserve thumbnails, so to prevent trolls
one of them is 'the golden'
me neither
**app%2Fsrc%2Fmain%2Fjava%2Fxyz%2Fwingio%2Fhellish%2Futil%2FNetworkUtil.kt: **Lines 25-64
object LinkPageExtractor {
private val LINK_REGEX = "<(.+?)>; rel=(next|prev)".toRegex()
fun getPageInfo(response: HttpResponse): Pair<PageInfo?, PageInfo?> {
val linkHeader = response.headers["links"] ?: return null to null
val links = linkHeader.split(",")
var next: PageInfo? = null
var prev: PageInfo? = null
links.forEach { link ->
val match = LINK_REGEX.matchEntire(link)
val url = match?.groupValues?.get(1)
val rel = match?.groupValues?.get(2)
when(rel) {
"next" -> next = extractFromParams(url)
"prev" -> prev = extractFromParams(url)
}
}
return next to prev
}
/**
* Extracts the necessary paging parameters from the [path]
*
* @param path Path returned inside the links header
*/
private fun extractFromParams(path: String?): PageInfo? {
if(path == null) return null
val parsedUrl = Url("${BuildConfig.BASE_URL}$path")
return PageInfo(
after = parsedUrl.parameters["after"],
before = parsedUrl.parameters["before"]
)
}
}
that's how i get the paging stuff
I should do better paging
repurposed from a mastodon library i haven't touched in a bit
i just use the official android paging library
it does most of the work
I dont use any libraries for the api sadly, its all manually done
im writing the api stuff myself too
though the code is basically repurposed pixivapi that llsc worked on
I should make a package for this so other people can use it
androidx paging is just what calls the api when you scroll to the end of the feed

all done myself
im the same with swift
convergent evolution
hehe
most of that is reused from other projects
the only thing that's really new are the models
i just develop it as i go
i only support two routes right now bc so far that's all i need
im glad their ratelimit is so generous
Today I wrote some TS that made me happy
https://tsplay.dev/w2g7jN
are you remaking tachiyomi?
What?
nvm
Does anyone know how I can decode the Discord gateway websocket messages in the DevTools?
wss://gateway.discord.gg/?encoding=json&v=9&compress=zlib-stream it seems to connect to this URL
I think there was something in #1032200195582197831 to use uncompressed
I wrote this a while ago for a friend
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "zlibFreeGatewaySocket",
authors: [Devs.Arjix],
description: "",
patches: [
{
find: "static isDiscordGatewayPlaintextSet(){return!1}",
replacement: {
match: /!1/g,
replace: _ => `!!1`
}
}
],
});
I have it enabled and my discord hasn't had any issues, so I assume it still works as expected
How would I use this with the web version?
Same way as any other version
I feel like replacing every single false in the file with true feels a bit risky
But what do I know
uhhhh
Do I just paste that it console?
..
I don't think that would work
I just realized that's what I am doing, yikes
That's not how you install plugins
I am not using Vencord
lmao
but hey, I have had no issue for the past 2 months, so it ain't so risky am I right?
It's certainly risky
surely
😭
But maybe it works anyway
I'd still refine the regex a bit just to be safe
Either that or whole-ass it and replace false with true in every module
yeah it seems to be affecting some other functions as well
updated version:
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "zlibFreeGatewaySocket",
authors: [Devs.Arjix],
description: "",
patches: [
{
find: "static isDiscordGatewayPlaintextSet(){return!1}",
replacement: {
match: /isDiscordGatewayPlaintextSet\(\){return/g,
replace: _ => `isDiscordGatewayPlaintextSet(){return true;`
}
}
],
});
guys
enable experiments plugins > settings > developer settings > enable logging of gateway events
no need for plugin 😭
lmao
i remember when i made a plugin ages ago that monkey patched discord_erlang to log the payloads
then someone told me about this toggle and i was devastated


4wjefhbwkjgerwm,rtjrmfhrtrkjfbwrwtikghrfdsk4rtgfbuderygtrkderyiesrkjbriirtgkh
Really?
a program (didnt spam keyboard real)
does anyone know why tf the website uhhhh
idk how to explain it
(its bright blue to demonstrate the change)
it kinda changes position and then adds another scrollbar
Why does this stupid fucking scrollbar keep appearing
nvm found it
make it bold imo
i made a bold
so good
time to find yt svg
cute
cute
I just use UIColor.white.withAlphaComponent(0.1)
why not add visual effect layer instead
no point in doing more blur if theres already some
im not apple
the reason apple does it is because the blur effect doubles on overlap
creates better control contrast
check HIG
@woven mesa
hiii
the back button doesn't have alot of contrast here
guh
@frosty obsidian
thoughts on position label circles
i like
pretty proud of them
oo
(I did not tint them based on their position I got lazy)
i was also able to make the image loader i use switch to the lower quality version of the thumbnail if the high res one didn't work
automatically 
i love interceptors
im just sticking with the lower res ones
that would have been easier but i hated staring at the mess of pixels
xd
the Acheron one is just disgusting
idk why the highres version just doesn't exist for some of them
I asked
since I couldnt find it in the docs (from me looking anyway)
guh
**mod.rs: **Lines 234-262
pub fn score(&self, progress: i16) -> f64 {
let position = self.base.position;
let beaten_score = if 55 < position && position <= 150 {
let b = 6.273f64;
56.191f64 * (2f64.powf((54.147f64 - (position as f64 + 3.2f64) as f64) * ((50f64.ln()) / 99f64))) + b
} else if 35 < position && position <= 55 {
let g = 1.036f64;
let h = 25.071f64;
212.61f64 * (g.powf(1f64 - position as f64)) + h
} else if 20 < position && position <= 35 {
let c = 1.0099685f64;
let d = 31.152f64;
(250f64 - 83.389f64) * (c.powf(2f64 - position as f64)) - d
} else if 0 < position && position <= 20 {
let e = 1.168f64;
let f = 100.39f64;
(250f64 - f) * (e.powf(1f64 - position as f64) as f64) + f
} else {
0f64
};
if progress != 100 {
(beaten_score * (5f64.powf((progress - self.requirement) as f64 / (100f64 - self.requirement as f64)))) / 10f64
} else {
beaten_score
}
}
}
i can't read rust at all lol
me neither
doesn't help at all that they use single character variable names
i can somewhat read rust but what the hell is that
some amazing code
I translated it to swift

print(score(progress: 100, position: 2, requirement: 48))
my beloved
guh
its so ugly
no idea why they made it like this
import UIKit
import Foundation
func score(progress: Int16, position: Double, requirement: Int16) -> Double {
var beatenScore: Double = 0.0
if 55 < position && position <= 150 {
let b: Double = 6.273
let exponent = (54.147 - (position + 3.2)) * ((log(50.0)) / 99.0)
beatenScore = 56.191 * pow(2, exponent)
beatenScore += b
} else if 35 < position && position <= 55 {
let g: Double = 1.036
let h: Double = 25.071
beatenScore = 212.61 * pow(g, (1 - position)) + h
} else if 20 < position && position <= 35 {
let c: Double = 1.0099685
let d: Double = 31.152
beatenScore = (250 - 83.389) * pow(c, (2 - position)) - d
} else if 0 < position && position <= 20 {
let e: Double = 1.168
let f: Double = 100.39
beatenScore = (250 - f) * pow(e, (1 - position)) + f
} else {
beatenScore = 0
}
if progress != 100 {
return (beatenScore * pow(5, (Double(progress) - Double(requirement)) / (100 - Double(requirement)))) / 10
} else {
return beatenScore
}
}
print(score(progress: 48, position: 2, requirement: 48))
so many magic numbers
spaghetti
Oki soo uh can someone help me connect oneko into a webpage?
yop
easiest way is with https://github.com/adryd325/oneko.js/
A hacky script I wrote to put a cat on my site. Contribute to adryd325/oneko.js development by creating an account on GitHub.
if you take a look at the demo.js it's pretty much as easy as including the script and making sure the image is in the right place
is that a rock
i making funny js snippet that "furry"-ifies your messages
explain
owo
remember back when /uwuify was a mainline plugin
hi
yall id really appreciate a point in the right direction, i just need a plugin that allows me copy in all the profile data from a profile when the user clicks on a button in the profile popout. just wondering how i would use react dev tools to search the source code for a place to inject this as im unfamilar with working with minified code
Have you considered hooking into this context menu with ContextMenuAPI?
Read how other plugins get parameters from context menu patches
wat uwu?
Is it possible to get by automation the urls of every wumpus SVG?
is it possible to grab the link to someones profile picture dynamically so it updates live (yes i know it creates a new string, but there are website that do it so i wanted a definitive answer)
@woven mesa how do I change the statusbar style based on background content?
not sure how to
yet
Also this is what inspired me to make an app lmao https://x.com/fakedenni/status/1770555295871230100?s=46
activity in #🪅-progaming ?????
dear lord does this look like something
Have you programmed before
bye then
you will never know

its told me to kill myself about 3 times through my speakers
its even told me my address
it's tough love 😔
^^
like ven does
naur
i'm talking about in general
like userid->profile picture and updating
for a concept that's not bad
obviously needs a lot of improvement but they weren't doing it seriously so nbd
you should not be let near a javascript ide
btw does anyone know what the Vencord.Webpack functions all do
am very confused
what its for
or how it works
or how to use it
updated to use template tags (they don't need brackets for calling methods with strings, saving two characters)
globalThis['console']['log']['call']`${"Hello World"}`;
typescript jumpscare
export type NamedOptionMap = {
[name: string]: Omit<ApplicationCommandOptionsWithValue, "name">;
};
type InteractionOptionsWithResolvedValue =
| InteractionOptionsString
| InteractionOptionsNumber
| InteractionOptionsInteger
| InteractionOptionsBoolean
| { type: ApplicationCommandOptionTypes.ATTACHMENT; value: Attachment }
| { type: ApplicationCommandOptionTypes.USER; value: User }
| { type: ApplicationCommandOptionTypes.MENTIONABLE; value: User | Role }
| { type: ApplicationCommandOptionTypes.CHANNEL; value: Channel }
| { type: ApplicationCommandOptionTypes.ROLE; value: Role };
type OptionalFalse = false | undefined;
type RequiredBy<T, K> = T extends OptionalFalse ? undefined | K : K;
export type MappedCommandOptions<T extends NamedOptionMap> = {
[K in keyof T as K]: RequiredBy<
T[K]["required"],
(InteractionOptionsWithResolvedValue & {
type: T[K]["type"];
})["value"]
>;
};
writing complex types is sometimes a pain especially when you don't realize your tsconfig is incorrect but the end result is satisfying :]
when the type is scripted!
What the FUCK is that
Minecraft enchanging table
it takes an object typed like this
{
test: { type: ApplicationCommandOptionTypes.STRING }
}
```and turns it into this type
```ts
{
test: string
}
``` 
I have angered the typescript gods

you just broke an intergalactic law. YOU USED LIGHT MODE!!! /j
There is one thing wrong with this message
The /j
The nice thing about the Light Theme Law is that it's self-punishing
Yep
It is a graceful and everlasting cycle
Right above god in the hierarchy of power you have punishment of light theme users
Hi
Hey, how you doing today bro🫡
some day discord users will finally outgrow light theme jokes and it'll be nice
Never
lmao i love getting these
i think that means that your ApplicationCommandOptionTypes.BOOLEAN are somehow not compatible
i spent like two hours trying the figure it out last night and woke up this morning with an idea for the fix
if u send full code i can see

is this for a bot lib or smth
it kinda reminds me of vencord's settings types
I haven't gotten on my pc to check yet but I think somewhere in the chain I accidentally un-narrowed the type from ApplicationCommand....BOOLEAN to just the ApplicationCommand... enum
so just missing a generic somewhere
on that note, i hate that ts makes "downcasting" so hard
like converting "hi" to string
I'm making an interaction command handler because I dislike how all the ones I've been able to find work
it does loosely follow how some of vencord's stuff works though yeah
type CastDown<T> =
T extends string ? string : T extends number ? number : T extends : ...;
makes me cry

horror
i forgot what i needed this for
right i remember
// getOption(args, name, defaultValue)
getOption(args, "foo", "hi") // string
getOption(args, "bar", 42) // number
basically you need to convert the last argument to a more generic type, cause you don't want the return type to be "hi" lmao
hm
i think I've seen people solve the same issue by writing a billion overloads but neither of those options are very nice
yeah you either need overloads for each type, or a DownCast type like that
typescript having a builtin BaseType<T> or smth would be neat

**literal-to-primitive.d.ts: **Lines 22-36
export type LiteralToPrimitive<T> = T extends number
? number
: T extends bigint
? bigint
: T extends string
? string
: T extends boolean
? boolean
: T extends symbol
? symbol
: T extends null
? null
: T extends undefined
? undefined
: never;
society if ts had a type-level switch case
that was in fact the issue
it's so satisfying but also so frustrating when you think of a solution to a problem while in bed
like why couldn't I have figured that out while I was actually looking at the code???
i have that sometimes
try to fix issue for hours with no success
sleep over it
next day solve issue in 20 seconds


ohh I did something like that with my bot in the past
it takes the type definition of the args array and in the handler function it makes an object with the props
supports optional args and nested too
if you want me to send to you I can
that would be awesome if you wanted to share that
(done using oceanic btw)
that's pretty much what I've been working on doing
but with less experience with advanced types so I tried to avoid arrays and stuff too much (but now I realize that it would have been easier with infer)
@native spruce improved the color palette generation
now any image that isn't black and white will work
before it didn't for some reason
i made that way in the past
public args = {
emoji: ArgTypes.GuildEmoji,
name: { type: ArgTypes.String, description: "The new name" }
} as const;
public async callback(ctx: CommandContext, { emoji, name }: IParsedArgs<Command>) {
emoji; // type: GuildEmoji
name; // type: string;
}
public args = {
scope: {
type: ArgTypes.String,
choices: ["server", "user"],
description: "prefix scope"
},
action: {
type: ArgTypes.String,
choices: ["add", "remove", "set"]
},
prefix: { type: ArgTypes.String, default: process.env.DEFAULT_PREFIX, description: "new prefix" }
} as const;
public async callback(ctx: CommandContext, { scope, action, prefix }: IParsedArgs<Command>) {
scope; // "server" | "user"
action; // i think you get the idea
}
it's super cool doing stuff like that
https://github.com/Vendicated/VendyMachine/blob/main/src/commands/Settings/setprefix.ts
i wouldnt write a bot like this anymore today, but it's pretty cool what i did back then
very hard but when you can do it 🔥
**CommandArguments.ts: **Lines 227-245
type IPossiblyOptionalArg<Arg extends Argument, T = ArgLookup[Arg["type"]]> = Arg["optional"] extends true ? T | undefined : T;
// This hurts my brain but I somehow made it work
type IParsedArg<Arg> = Arg extends Argument
? Arg["choices"] extends ReadonlyArray<infer T>
? IPossiblyOptionalArg<Arg, T>
: IPossiblyOptionalArg<Arg>
: /* --------------------------------- */
Arg extends ArgTypes
? ArgLookup[Arg]
: never;
/* Converts Command args object to interface with strongly typed parsed arguments */
export type IParsedArgs<Command extends IBaseCommand, Args = Command["args"], Flags = Command["flags"]> = {
-readonly [prop in keyof Args]: IParsedArg<Args[prop]>;
} &
{
[prop in keyof Flags]: boolean;
};
I have to say crazy typescript is SO unreadable
**CommandArguments.ts: **Lines 205-225
interface ArgLookup {
text: string;
boolean: boolean;
number: number;
float: number;
channel: Channel;
message: IMessage;
user: User;
role: Role;
url: string;
"server emote": GuildEmoji;
"server emotes": GuildEmoji[];
"custom emote": ParsedEmote;
"custom emotes": ParsedEmote[];
"default emoji": ParsedEmoji;
"default emojis": ParsedEmoji[];
"custom emote or default emoji": ParsedEmoji | ParsedEmote;
"custom emotes or default emojis": Array<ParsedEmoji | ParsedEmote>;
_empty: undefined;
_never: never;
}
like you have to stare at the code for so long to understand what's happening
it's something you do once
and never touch again
true..
https://github.com/mrubun2/rustyrender how do i make my shitty rendering engine better
what the FUCK did I click into this channel and see
kill me
i hate typescript
after looking at @serene elk's code I was able to make my types a lot better and things work how I wanted them to 
this is what I have now (it doesn't handle subcommands at all but I will add that later + autocomplete)
function defineCommand<T extends ApplicationCommandOptionsWithValue[]>(
command: ChatCommandDefinition<T>,
) {
// logger.trace(`Command "${command.name}" defined.`);
return command;
}
type InteractionOptionsWithResolvedValue =
| InteractionOptionsString
| InteractionOptionsNumber
| InteractionOptionsInteger
| InteractionOptionsBoolean
| { type: ApplicationCommandOptionTypes.ATTACHMENT; value: Attachment }
| { type: ApplicationCommandOptionTypes.USER; value: User }
| { type: ApplicationCommandOptionTypes.MENTIONABLE; value: User | Role }
| { type: ApplicationCommandOptionTypes.CHANNEL; value: Channel }
| { type: ApplicationCommandOptionTypes.ROLE; value: Role };
type RequiredBy<T, K> = T extends true ? K : K | undefined;
type InteractionOptionsWithResolvedValueType<T> =
InteractionOptionsWithResolvedValue & { type: T };
export type ArrayMappedOptions<
T extends
ApplicationCommandOptionsWithValue[] = ApplicationCommandOptionsWithValue[],
> = {
[K in keyof T & `${number}` as T[K]["name"]]: RequiredBy<
T[K]["required"],
InteractionOptionsWithResolvedValueType<T[K]["type"]>["value"]
>;
};
type ChatCommandDefinition<
T extends
ApplicationCommandOptionsWithValue[] = ApplicationCommandOptionsWithValue[],
> = CreateApplicationCommandOptions & {
options: T;
handler: (
this: ChatCommandDefinition<T>,
interaction: CommandInteraction,
options: ArrayMappedOptions<T>,
) => void;
};
and then you can go (non-important properties removed for brevity)
const result = defineCommand({
options: [
{
name: "test",
type: ApplicationCommandOptionTypes.STRING,
},
{
name: "another",
type: ApplicationCommandOptionTypes.BOOLEAN,
required: true,
},
] as const,
handler(options) {
options.test; // Possibly undefined
options.another; // always boolean
},
});
what the fuck is this
is that rust
it is your beloved typescript 
ShiggyCord
What is ShiggyCord? :0
ShiggyCord is the ultimate tool to shiggyify your Discord experience with the one and only adorable Shiggy! Yippee!!! :3
What Can ShiggyCord Do? :D
- Shiggy-fy Your Discord: Inject some cuteness into your Discord chats by spawning adorable Shiggy gifs all over your screen! :0
- Customizable Shiggys: Use
Ctrl+Shift+Jto spawn a single Shiggy, orCtrl+Shift+Kto summon five at once! :3 - Shiggy-bonuses: Want to clear the screen of those bouncing Shiggys? No problem! Just press
Shift+Escto make them vanish! :D
How to Use ShiggyCord? :3
- Download and run the
shiggy.exefile. - Open Discord and focus on the app. :0
- Use the hotkeys to summon Shiggys and spread the cuteness! Yippee!!! :D
Important Note :0
Keep in mind that ShiggyCord is a fun tool meant for entertainment purposes only. Use it responsibly and remember to keep Discord fun and respectful! :3
Credits :D
ShiggyCord is brought to you by the one and only Shiggy lovers' community. Special thanks to Viggy, our beloved inspiration! (Oxygen not included, Viggy died) :(
--remember ctrl+alt+f to exit the program, as it doesnt show in task manager, tray, or taskbar.
oh ok cool
i recall someone made shiggycord or onekocord that added shiggys in different locations using css
:3
mine is a no install, just run an exe and it's done, it perfectly resizes and doesnt interfere with click either
your clicks pass through shiggy
:p
wanna try it?
downloading an exe isnt really no-install lol
i'd rather have a plugin than an external program
and no i dont trust you enough to run your exe
download and install are two different things
fair enough
they are lol
how u gonna use it without installing it
nvm im stpid
dont mind me
do you have a github repo
"The file you downloaded in most cases is a program that performs the install, not the actual program itself"
for your project
it's just a program no install
i made something like this xD
thanks for the RequiredBy trick (i haven't worked that out)
i dunno how to upload with that lol, my damn file is 30 megabytes but the limit is 25 in web
sob
i think you might be using github wrong
me when I accidentally commit node_modules
git clone https://github.com/my/repo.git
cd repo
cp /path/to/my_file .
git add my_file
git commit -m "Add file"
git push origin main
me, my trust issues and a random .exe file 
are they supposed to be animated
i'm thinking of adding functionality for a menu for custom pet
because I saw like 10 gif frames in your files
oh ye i gotta fix the anims
did u really just run a random exe some whitename sent

i checked it first ofc
im not a total idiot
you can do a lot of harm with 30mb
although i should put a src folder so people can see the source code
one day when i'm not too lazy
python exe 😭
yes or you will look like one of those skids who host malware on github
real
that thing used 15% of my cpu
funny pygame
it's just to make it look cooler
WHAT
nop
IT DOESNT EVEN USE 1% FOR ME

HUH???
i clicked the button probably a bit too much
bruh
smelly nerd blaster mode activated. exploding all smelly nerd devs
real
yeah it's detected as a virus by defender cuz like the description on git says, to exit the program the ONLY CHOICE is to run ctrl+alt+f. you will not find shiggycord in tray, TM, or taskbar.
i dont remember how i did that
it was 6 am
lol
uses skidding tool
why antivirus think malware?!!?!?
@balmy lintel just fixed the animations, i was a bit busy lol so it took a bit
@deep mulch you love
/**
* Uses [Palette] to retrieve a seed color from any image
*/
class PaletteGeneratorInterceptor(
private val paletteManager: PaletteManager
): Interceptor {
private val logger = AppLogger("PaletteGenerator")
@OptIn(ExperimentalCoilApi::class)
override suspend fun intercept(chain: Interceptor.Chain): ImageResult {
val result = chain.proceed()
result.image?.let {
// Only generate if image is a bitmap and hasn't been processed before
if (it is BitmapImage && !paletteManager.hasSeedColor(result.request.data.toString())) {
Palette.Builder(it.bitmap.copy(Bitmap.Config.ARGB_8888, false)) // Force bitmap to use different Config due to Config.HARDWARE not being supported
.addTarget(Target.DARK_VIBRANT)
.generate { palette ->
palette?.getSwatchForTarget(Target.DARK_VIBRANT).let { swatch ->
if (swatch == null) logger.warn("Couldn't generate color for: ${result.request.url}")
else paletteManager.setSeedColor(result.request.url, Color(swatch.rgb))
}
}
}
}
return result
}
}
oh
did you know that theres a library for that already
it sucks
kmpallete
it would eat all the memory
i use materialkolor to make a colorscheme from the color that palette generates
i am the only programmer that hates ligatures
wrong
i didnt notice i had them on
trying to see if i can get the nokee plugin to work in the kmp project
would make it easier
i have no idea what that is
guh
rust would be funny
ive been wondering
if a gradle plugin could be made
that could automatically generate jni bindings
like
kotlin native can use cinterop easily
go is also a nice candidate but lacks any real gradle integration
would need some work making gradle call its compiler
when will we have venscript jni
soon
how can I inject vencord into an iframe
working on a proxy website and can't get it to inject before discord loads
I think they're talking about proxy websites as in the one u use to bypass school restrictions (something I produce myself! :D), since they don't have inspect, most extensions, and no access to GitHub and a lot of other stuff like that and it's ChromeOS, they can't install without apk and dev mode, which ven doesn't have. The person is trying to create an app in-website which injects vencord and then loads discord fully in web within an iframe (basically an embed :p)
(Just saying you probably knew a lot of that but I just wanted to explain anyways)
I like talking
proxy site for reasons
iframe as part of the ui
oh god
mutual friends check out
yeah this is why
are these wild TN members

tn is cursed anyways
w h a t
as in, TN members
??
I guess they're trying to proxy discord.com and inject vencord along with it for an activity
I'm just guessing
is this oceanic.js or discordjs
I'm in desperate need for an well enough oceanic.js command handler
oceanic
my stuff is very broken though and not in a good state at all
hopefully it'll get there eventually but we'll see
the one I'm using is still on the lts v13 version of discordjs
and i want to use something else than discordjs
I've used slash-create for interactions on oceanic before
I'm not a fan of how much functionality it sorta sweeps under the rug and does for you though
other than that it's alright ig
/run
#include <stdlib.h>
int main()
{
for (;;) {
malloc(1024 * 10);
}
}```
xd idk what would happen if i did it
/run
console.log(error)```
@wispy palm I only received js(18.15.0) error output
/piston/jobs/b7edea74-3cb4-482b-8cc6-4d0ad6c4efbd/file0.code:1
console.log(error)
^
ReferenceError: error is not defined
at Object.<anonymous> (/piston/jobs/b7edea74-3cb4-482b-8cc6-4d0ad6c4efbd/file0.code:1:13)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Node.js v18.15.0
/run
throw "meow"
@ionic lake I only received js(18.15.0) error output
/piston/jobs/feb47beb-c453-48cc-8804-a24e94e9e7d4/file0.code:1
throw "meow"
^
meow
(Use `node --trace-uncaught ...` to show where the exception was thrown)
Node.js v18.15.0
do you actually need a complex handler
i use something super simple
**source.ts: **Lines 4-12
defineCommand({
name: "source-code",
aliases: ["source"],
async execute(msg) {
return reply(msg, {
content: "I am free software! You can find my Source code at https://codeberg.org/vee/bot"
});
}
});
yes
not bloated asf, not java ported to javascript
discordjs has gone to shit it's insane
have u checked some of the code samples
they use builder patterns for everything
instead of
const conmand = {
name: "balls",
description: "cool beans"
}
``` they use like ```js
const command = {
data: new SlashCommandBuilder().setName("balls").setDescription("coop beans")
}
just look at the examples on this page https://discordjs.guide/slash-commands/advanced-creation.html#subcommands
it's awful
module.exports = {
// data: new SlashCommandBuilder()...
async execute(interaction) {
const target = interaction.options.getUser('target');
const reason = interaction.options.getString('reason') ?? 'No reason provided';
const confirm = new ButtonBuilder()
.setCustomId('confirm')
.setLabel('Confirm Ban')
.setStyle(ButtonStyle.Danger);
const cancel = new ButtonBuilder()
.setCustomId('cancel')
.setLabel('Cancel')
.setStyle(ButtonStyle.Secondary);
const row = new ActionRowBuilder()
.addComponents(cancel, confirm);
await interaction.reply({
content: `Are you sure you want to ban ${target} for reason: ${reason}?`,
components: [row],
});
},
};
who wants to write their code like this instead of just using plain arrays / objects 😭
you can still do the former in most cases
since you can do
new ButtonBuilder({
custom_id: "cancel",
label: "Cancel"
})
idrc
simply make a vencord plugin for every bot
I personally would prefer using it due to maturity
oceanic is way better but it has occasional bugs
i'd rather have stability
😔
💥
@undone sonnet runs on it
but how bad are the bugs?
@pearl stag also seems to use oceanic
basically all the bots in this server use oceanic

subtle
like there was a bug where threads created by the bot wouldn't properly be added to the cache
it's using Dysnomia
**modmail.ts: **Lines 78-84
const thread = await threadParent.startThreadWithoutMessage({
type: ChannelTypes.PRIVATE_THREAD,
name: ticketId,
invitable: false
});
// FIXME: workaround for oceanic bug where newly created channels wont be cached. remove once fixed
threadParent.threads.set(thread.id, thread);
**index.js: **Line 1
const {Client, Collection} = require("oceanic.js");
i wonder why you'd switch away
the gitdab branch is using discord.js and is more up to date
wrong thing
A fork of Eris focused on keeping up with the latest Discord API changes.. Latest version: 0.1.3, last published: 8 months ago. Start using @projectdysnomia/dysnomia in your project by running npm i @projectdysnomia/dysnomia. There are no other projects in the npm registry using @projectdysnomia/dysnomia.
oceanic is very similar api to eris
i think it's meant to be an eris replacement
also nuckyz is oceanic maintainer so you can just ping nuckyz with all ur bullshit 
i did this a bunch

@royal nymph can you add vendymachine here
is it the emoji bot

emoji vendor
most of its features are obsolete if u have a client mod 
you will still add vendymachine 
i guess hiddenphox has a ton of useful stuff
I do actually need slash commands
I'm currently maintaining a personal fork of alyxia's fork of onion-lasers, however the type dance and logic required to compile onion lasers commands to discord api understandable ones has been insane
she had a few problems with oceanic's maintainer
a
the furry or nuckyz
he has a name lol
"the furry" 💀
just call me the brit 
that seems pretty normal
slightly rude?








