#development
1 messages Β· Page 134 of 1
yoooo we are into something
this is a apng
noo this is from the second one
it's not a apng
OH i know now
const buffer = canvas.toBuffer("image/png");
fs.writeFileSync(`watermarked${i}.png`, buffer);
this saved all the frames
and it looks very correct with the background too
@quartz kindle you were right, now i gotta figure out how to actually use it
π
there is still an issue tho but gonna figure that out later
like after a few frames u can see that they aren't being cleaned
oh nvmm that's my bad
so i am kinda limited to doing that here:
// Encode the APNG image
console.log(
"HELLOOO",
frames,
+" " + "WIDTH" + " " + canvas.width,
canvas.height,
apng.frames.length
);
const apngBuffer = UPNG.encode(
frames,
canvas.width,
canvas.height,
0,
new Array(apng.frames.length).fill(frameDelay)
);
console.log(`Encoded APNG image: ${apngBuffer.byteLength} bytes`);
try {
await ctx.replyWithDocument({
source: Buffer.from(apngBuffer),
filename: "watermarked.apng",
});
console.log("Sent APNG document");
//Saving it locally for testing purposes
// console.log("apngBuffer before:", apngBuffer);
fs.writeFileSync("watermarked.apng", Buffer.from(apngBuffer));
console.log("Saved watermarked.apng");
// console.log("apngBuffer after:", apngBuffer);
} catch (err) {
console.error(`Error sending APNG document: ${err.message}`);
}
since the encoding function wont take canvas.toBuffer to generate the apng
what format do the frames have to be for UPNG.encode?
Uint8Array
if it doesnt accept a Buffer object, you can convert it to Uint8
but the thing is you also need to make sure it does accept png bytes as returned by canvas.toBuffer
and not some different kind of raw byte data
Has anyone ever coded a bot using Eris?
If yes, then pls tell, I need help.
someone suggested me Discordeno
what do you need help with?
since i wasn't able to make it at this moment i'll be working later on it. however i made one manually with the frames the bot generated
yes commiting it manually cuz i am at work
also thank you very much @quartz kindle i might bother u a bit later
xD
just update to slash commands xd
message deletes do not include any message data
unless the message was already cached
thats what the raw api provides
anything other than that is added by your library based on your cache
the only way to log message deletes is to keep them in the cache at all times
which is terrible for memory usage, unless you store them all in a database, which is also terrible for performance and storage
tim do u know any secret tech that I can use to count how many trues are in this resultset?
the first 3 columns are grouped, but the next 2 cannot be (else they'll become 2 lines)
I'm trying not to use a subquery
So, in discord.js, we can see bot's ping with bot.ws.ping, I want to my bot to show it's ping. (In Eris).
I could use a window, but then the owned columns would need to be grouped
it's postgres btw
ignore the dangling window there
lmao
well, solved it with a subquery anyway, tho I hate to add indentation levels on queries
trues as in n_owned and c_owned?
yes
so in that image the result should be 4?
kuu
there are more results below the image
basically there are 14 trues for "n_owned" and 1 true for "c_owned"
common -> rare -> epic -> unique -> legendary
used to be ultra rare, but it was appearing when filtering by "rare"
cuz shared name
x-files theme
lmao, well I don't have one to show either
Oh no
what should i do to get Sayuri into the system /j
client.shards has a Collection of shards
shard.latency has the ping for that shard
make an anime
(so I can buy it)
if you only have one shard, you can do client.shards.get(0).latency
anyway, back to the api
I am new in Eris, and my bot is private and is only in 1 server for testing so it doesn't have any shard
π eris still exists?
one shard is the default, if you dont use sharding, then you have one shard
so you can use client.shards.get(0).latency
I did this one time, the bot says Infinity ms
yeah but itβs not updated anymore
it got a new release 3 months ago
maybe it didnt connect yet, or didnt have enough information yet
it should collect ping information slowly over time
where is the string coming from
also, avoid usage of eval
i made a 4-stage eval system on my bot lmao
as a way to inspect the program's value?
yeah that was to fix audio stuff, it hasnβt had an actual update since this time last year
i made a live one
should have used CLI REPR
it goes through 4 different evals
to handle edge cases
for example, one with function, one without function, and 2 more for async
eval command is so easy to make i thought it would be hard
not really, but i wanted it to support stuff like /eval await fetch(something)
and show the actual result, and not Promise<pending>
ayoooo
i had this
should be enough yes
a jumble mess
xD
unless someone hacks your account π§
3 classes
my eval was a normal eval, no security features or anything
i liked overengineering
xD
π
heres my eval lmao
async function ev(f) {
try {
const result = eval(`(()=>{
return ${f}
})()`);
const p = result instanceof Promise;
let error = false;
return {
promise: p,
data: p ? await result.catch(e => { error = true; return e; }) : result,
error
};
} catch(e) {
// no-op
}
try {
return {
data: await eval(`(async()=>{
return ${f}
})()`)
};
} catch(e) {
// no-op
}
try {
const result = eval(`(()=>{
${f}
})()`);
const p = result instanceof Promise;
let error = false;
return {
promise: p,
data: p ? await result.catch(e => { error = true; return e; }) : result,
error
};
} catch(e) {
// no-op
}
try {
return {
data: await eval(`(async() => {
${f}
})()`)
};
} catch(e) {
return {
error: true,
data: e
};
}
}
e
v
Check docs
Assuming you use d.js
Obviously, dyno bot uses that
dyno uses a heavily modified eris though right?
Search for message mentions
it's right here
yes it's still a thing
it does
?
New docs 
Discord js docs site has always had issues with that. It's fixed by clearing cache / local files for the website
does anyone know zod? If so is there a package that adds decorators to it? so like
class Hi {
@Validate(z.number(), z.number().nullable())
public increased(initial: number, increaseBy: number = 1): number {
return initial + increasedBy
}
}```
or
```ts
class Hi {
@Validate()
public increased(@T(z.number()) initial: number, @T(z.number().nullable()) increaseBy: number = 1): number {
return initial + increasedBy
}
}```
if not ill just make it
absolutely no context
app.get('/:channel/followers', async (req, res) => {
const channel = req.params.channel;
client.getChannel(channel).then(channel => {
const canvas = createCanvas(0, 200);
const ctx = canvas.getContext('2d');
ctx.font = '50px';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText(channel.followersCount, canvas.width / 2, canvas.height / 2);
canvas.toBuffer((err, buff) => {
if (err) console.error(err);
res.set('Content-Type', 'image/png');
res.send(buff);
});
});
});
is that kotlin?
now show the error stacktrace
that's literally it
typescript
are u using a custom logger?
where are u catching uncaught exceptions?
what
try changing channel.followersCount to channel.followersCount.toString()
node crashes on uncaught exceptions now, since that's clearly uncaught u oughta be catching them somewhere
i don't understand what you mean
i'm not catching anything
const express = require('express');
const Client = require('kick-api-wrapper');
const { createCanvas } = require('canvas');
const app = express();
const client = new Client();
app.get('/:channel/followers', async (req, res) => {
const channel = req.params.channel;
client.getChannel(channel).then(channel => {
const canvas = createCanvas(0, 200);
const ctx = canvas.getContext('2d');
ctx.font = '50px';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText(channel.followersCount.toString(), canvas.width / 2, canvas.height / 2);
canvas.toBuffer((err, buff) => {
if (err) console.error(err);
res.set('Content-Type', 'image/png');
res.send(buff);
});
});
});
app.listen(3000, () => {
console.log('Listening on port 3000');
});``
this is all the code
everything
that was the issue?
Yes.
whys it fully black
@quartz kindle then yeah, canvas also doesn't support 0-length dimensions
why not?
also fontSize does not work
did u restart the code?
yea
wtf
classic discord
it does on browsers
:^)
localhost
why isn't it embedding
You are joking right?
you can't be serious
lmao
perhaps it secretly creates a 1x1 canvas
maybe
?

because ur site is broken smh my head
black text + black background
browser background
yea
you don't, images are static
what part of static don't u get?
you can make the site return different images tho
which is the second thing I mentioned
yeah
but it'll not work on discord
this is what i want
simply generate the image and return it
but
like when i'm on the website
i want it to automatically update
with new image
make the website fetch the image every X seconds
setInterval isn't working
lmao
or simply use a text with css styles
because canvas literally uses css
where did you put the setInterval?
u just said it's for a website
then what is it?
app.get('/:channel/followers', async (req, res) => {
const channel = req.params.channel;
client.getChannel(channel).then(channel => {
const canvas = createCanvas(500, 100);
const ctx = canvas.getContext('2d');
ctx.font = 'bold 50px sans-serif';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText(channel.followersCount.toLocaleString(), canvas.width / 2, canvas.height / 2);
canvas.toBuffer((err, buff) => {
if (err) console.error(err);
res.set('Content-Type', 'image/png');
res.send(buff);
});
});
setInterval(() => {
client.getChannel(channel).then(channel => {
const canvas = createCanvas(500, 100);
const ctx = canvas.getContext('2d');
ctx.font = 'bold 50px sans-serif';
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText(channel.followersCount.toLocaleString(), canvas.width / 2, canvas.height / 2);
canvas.toBuffer((err, buff) => {
if (err) console.error(err);
res.set('Content-Type', 'image/png');
res.send(buff);
});
});
}, 1000)
});
api
you cant res.send multiple times lmao
can u give any context at all?
you don't
...
its a server, the server answers to people's requests
the requester is who decides if they want to update or not
once a request has been answered its gone
you have no control over it
a new request has to be made
so how can i achieve what i want
you cant
which is?
update image
update image where
i want it to update like every 60 seconds
make your page request the image multiple times
how
setInterval
or reload page
worth to note that reloading will not work for embedding that image in other places
only if someone opens the url on the browser
so how do i do this
look
where do you want to use that image?
what app/software/program are you gonna use
to VIEW the image
open broadcast software
finally a context
well, whatever that open broadcast software is, its there that you need to re-request the image every x time
you don't need that, obs supports scripts
you don't know obs?
you don't need an api at all
where
i know obs as "obs", not by its full name lmao
simply make a script to fetch the number, then style it with built-in obs styler
no
lol
you can't force obs to refresh the page
so unless u make a site that displays the number not as an image, you can't
how do other places do it then\
see my message above
and for that, you'll need react or svelte or next.js or jquery or whatever
you can also just have an HTML file as an overlay that updates the image constantly
also note that each html source is a new browser window on obs
no
and each will affect your stream performance
I know because I used to stream in the past
i don't do websites
either make a website to display the count or make a python/lua script
no other way around
lmao
then you can change your damn images
I used to have like 3-4 web sources on my stream, until I noticed how it fucks your transmission
because each source takes a slice of cpu time
there has to be a video codec out there thats stupid efficient at not re-sending the same pixels
so the transmission rate should effectivelly be 0bps outside of heartbeats
until the image actually changes
you'll not, I guarantee
you underestimate my smartness
I don't even think you have smartness, can't underestimate a void
gave up already eh
ah yeah, Later
!!!
make a discord lib from scratch
i tried
it's too complex
wtf happened to github
good question
but i think it would make things complex
in addition youd also have to send the location the changed pixels are supposed to be in since youre not sending the whole canvas
maybe that trade off just isnt worth it
best bet is lossless compression rn lol i think
but it should be so easy for you
But I thought you knew everything
just make a codec that does send the whole canvas on every frame
You gotta pick one, either βIβm a beginnerβ or βI know everythingβ, canβt pretend you know everything then hide behind the βbeginnerβ idea every time youβre wrong
and make it play at 0.2 fps
funny enough, a py script for that is as easy as it gets
i've never said I know everything
I used to have one for displaying spotify song name
and automatically skipping ads ofc
Tim, is it possible to infer types from a parameter decorator?
no idea, never used decorators
hm
pls no
this one looks easier to make https://github.com/timotejroiko/tiny-discord/blob/master/src/RestClient.js
its in stage 3
im gonna completely rewrite that
imagine setting the required data from a request body with something like @required({ a: int, b: string })
why
because its not good
does c++ have decorators
why?
I mean I am doing something similar, it works but the number param isnt inferred, would be useful If I can get that to work
part of why I love java annotations
It has attributes of sorts
Not necessarily decorators
I think what u want is AOP, which allows executing code before the actual method is called
which is Aspect Oriented Programming
I already have the logic down
but then wdym with "isn't inferred"?
well, it'll not work ofc
annotations are meaningless by themselves
they depend on something else to use them for something
for that reason, they only work during runtime, unless you make a plugin for your editor to pre-process them
you never know with ts π€·
nah, the concept is the same
annotations/attributes/decorators whatever are just "landmarks" for reflection
they contain metadata that can be used, but they do nothing on their own
are you sure you are on the same page as me?
likely, ur trying to make this infer that number is a number right?
yes
then yeah, wont work at code time
annotations do nothing without something else to process
they just say "hey, this class/method/param is marked by me, do you need it?"
why
this is an example that I use on my DAO class
both annotations (@NotNull and @Language) hint to the IDE what data is expected to those params
they only work because the IDE is actively looking for places annotated by them
when I try using it, a highlighting will appear telling me it cant be null
because fetch is cross-platform rn
so its required to make it work on all engines
so to sum it up, if you want your annotations to infer types, you'll need to write a plugin for whatever editor u use
node/bun/deno/browser
what is bun and deno
hi guys i am back
wanna talk about the elephant in the room?
isnt bun dead
you read my mind yk that
if u didn't see my chat log here is where i am left off
and here i am one lunch and a cigar later
meanwhile Graves still cant have a cigar
you all doubted him but hes giving it a shot
yeah
looks to be on the right track so far
this is different
it's much simplier then making a client to connect to the gateway
π§
lmao
Graves?
league of legends character, they removed his cigar a few years back because wokeness
HAHAHA
stupidd
i never like when such changes happen
but i bet they had a bunch of Karens on them
yeah the whole company is filled with them
they had a massive class action lawsuit
hundreds of women accused the company of toxic gaming culture
its true though a cigar is not inclusive
absolutely disgusting
how are you even defending this Timothy?
lmao
π«
oh so that's why they removed mundo's quote "Mundo finds you sissy"
almost, but kinda
idk maybe
they probably did go through a massive review for inclusivity and what not
and then there's kled
apparently there are companies that are specialized in that, and you hire them to go through your entire company and point out everything they find wrong
after dark and darker is released all other companies can stop making games
guys in jsdocs can u mark something as optional?
write it out
...jsdocs are literally just documentation
@param blablabla This parameter is optional
also, jsdoc will automatically mark it as optional if you set default values for your parameters
oh really
at least it does on my vsc
that's fancy
just use github desktop
how do i remove folder from repository
or vsc git menu
remove everything from inside it
no
like
i made repository
then i deleted
now i try to make again
and it says it already is a git repository
git clone?
did u really delete the repo or just disable?
delete
try acessing the url
why
to see if u can
go to the url
idk the url
https://github.com/yourname/repository
also I think github keeps it for some time before actually deleting
in case u want to restore it
^
LITERALLY SOMETHING ELSE ENTIRELY
wym
what are you trying to accomplish?
it doesn't mean the repository exists, it means the folder you're trying to delete holds git data
git != github
yes
so how do i
abloish that data
that means that whatever folder you tried to create a repository in, already has a hidden .git folder (thats how github tracks your local repositories)
open the folder, delete folder
you have to remove that
throught windows
delete what folder
that ain't there
might be a hidden folder
wym
enable hidden files and delete it
im not deleting my code
do note
dang, was about to post the same
ok i deleted
xD
you'll lose your entire git history for that repo
idc
i made that repo a moment ago
i just accidently leaked something so i had to dleete
why did u delete then?
what's the shortcut on mac? cmd alt s or something
look
this is why
ain't ur repository private?
Command + Shift + Period for mac
...was it a token?
no
cuz like, github is infested with bots, depending on what u leaked it was already grabbed
bruh
remember when people used limewire and they would share their entire harddrive? i would download people's AIM friends lists pretend like i knew everyone. they were so confused
why do u think leaking tokens on github was so dangerous?
there
if it was just people lurking they'd not find your repo at all
that didn't fix what you leaked
whatever you leaked
it did
regenning it is the only way to be sure
i deleted the repository and remade
^
who can validate my elo logic?
can try
no
fk then, until you find out deleting a repo doesn't erase its existence from the internet
hmmm...huh?
it does
BRO
github can't hold me data without permission
that's lacking some sense of knowing the internet
here's the input to the one i'm confused about. for 1v1v1v1... matches
they technically can, but I dont mean github
if you deleted something from the internet that doesn't mean it's truly deleted
anyone could literally download your repository the moment it was created
plus services like wayback machine exist
what should the new Elos be?
tho wayback only stores meaningful sites, but someone else could have their own version of it for storing only github pages
{
newPlayerRatings: [
{
id: '123',
distinctPlayerElo: 1248,
overallPlayerElo: 1248,
combinedPlayerElo: 1248
},
{
id: '321',
distinctPlayerElo: 1216,
overallPlayerElo: 1216,
combinedPlayerElo: 1216
},
{
id: '456',
distinctPlayerElo: 1184,
overallPlayerElo: 1184,
combinedPlayerElo: 1184
},
{
id: '654',
distinctPlayerElo: 1152,
overallPlayerElo: 1152,
combinedPlayerElo: 1152
}
]
}
this is what i currently get for 1v1v1v1 scores
it's not illegal if it's following the data collection law
people who steal data couldn't care less for being illegal
battleless finding out that people actually do illegal things everyday
especially online
that's a MMR system
idk what I should look at tbh
and plus anything could be archived and probably a bot stored the data you thought was deleted
the k-factor is 32
I've used it to look at specific repositories before, doesn't it save sites by their traction?
here's the chage for a 1v1
{
newPlayerRatings: [
{
id: '123',
distinctPlayerElo: 1216,
overallPlayerElo: 1216,
combinedPlayerElo: 1216
},
{
id: '456',
distinctPlayerElo: 1184,
overallPlayerElo: 1184,
combinedPlayerElo: 1184
}
]
}
no github keeping my data is illegal
idk, perhaps
they wouldn't do that
ik sayuri's site is stored there
bro they aren't google
read this
i did illegal yesterday
slowly
POV: you donβt know what terms and conditions are
i j walked
listen i don't think you're getting point
I'm not talking about github, I'm talking about the rest of the internet
anyone can download public repos
this needs to be pinned
i dont speak genZ, no idea what that is
openai using your hard made code to train their proprietary cash cow large language models
free of charge
jaywalked
dude ur like 20
dont jwalk. has some respect for the road
still no idea what that is
ok but it was only viewable for like 30 seconds
so i think i'm ok
Jaywalking is the act of pedestrians walking in or crossing a roadway that has traffic if that act contravenes traffic regulations.
cars are supposed to be on roads, not people
tokens are stolen the moment they are posted on github
like, instantly
well jaywalking you don't use the crosswalk but you cross somewhere else instead of using the crosswalk
so basically crossing the road outside of crosswalks, during red light, in between traffic jam, etc?
exactly
not for discord tokens tho, as github checks before the push happens
or cross the crosswalk when it's a red hand
how
event listeners
bots
Scraping
can i sue them
yes
You can sue anyone for anything
I mean, you can, if you find who is
Doesnβt mean youβll win
ill just ask github who they are
battleless logic
they are owned by microsoft
microsoft gets government military contracts
also keeping a copy of a public repository is not illegal
but in the case of legal action they have to
Not without a subpoena
Most companies do not voluntarily give user data to individuals without a subpoena
Since giving away user data like that would violate their privacy policies most likely
americaβ’οΈ
yeah no not so simple to get subpoenas like that
that would be something
im a good guy know?
you'd break anubis' scale with how good you are
Init
whats your guys favorite song
whats the most illegal thing you ever did?
I don't do illegal things
I want a good future
you already said you did jaywalking
well
so too late
lmao
that's not a bad illegal
Heβs probably violated some user data laws somehow
huh?
Almost everyone has jaywalked before ngl
tfw battleless admitted to crimes
Usually not a big deal unless it actually affected cars
everytime someone jaywalks i judge them
everyone in the world has done something illegal at least once in their lives
guys what about my orginal question?\
based tim
i saw that dot
wha
dot posts are auto-deleted by topggbot
u guys r mean
pretty explainable
I'm kind to u guys always

you're not kind to our neurons
One of the classics https://open.spotify.com/track/3kGt9uxpJzKTxwp2uJHrU5?si=7c4j5Uz1Qwa6KM_neK0mQg
have a good afternoon everyone
πΊ
it's not afternoon yet
it's 2pm
timezones
can i have a good time now too?
its 9pm
wrong.
why are you saying random words?
timzones
1:58pm actually
i dont do time
ok aztec
i updated my unit tests so that it expects what the functions was already doing instead of changing the function.
now they all pass!
btw, that's for a discord game right?
nope, the idea is that a discord gaming community would use the bot to keep track of a ladder leaderboard thingy for whatever game they are playing
people never cheese. espically in videogames
@proven lantern thoughts on the elephant being yellow
unacceptable
IKR!
must be pink
yes
least obvious trojan horse will not be downloading
one small elephant for the elephant two small steps for me
that's a compliment yo
did you watch the video i assigned to you?
Dumbo 70th Anniversary Edition is now available to own on Bluray!! The scene in Dumbo in which Dumbo and Timothy have dreams of Pink elephants from being drunk. Comment, rate, and subscribe!! I OWN NOTHING!
lmfaoo yes
the elephant has to be pink
all i gotta do now is figure out the color issue
and get the artist to remake their gif into an APNG
what song are you going to animate it to? yakety sax might be a good one
yes might do that
@quartz kindle i got rid of the getImageData and did what u said:
const buffer = canvas.toBuffer("raw");
const uint8Array = new Uint8Array(buffer);
const arrayBuffer = uint8Array.buffer;
frames.push(arrayBuffer);
had to figure out what types the encoder accepted
it's being dithered cuz it's a gif yeah
no no the result of the apng was that
cool stuff
you got the apng a bit over that
also my friend contacted me for a rich presence someone set up for him and he wants to turn that off, it's running on one of his servers but he can't find it
is there a way he could turn it off from his discord by resetting something?
btw, if the encoder accepts an array of ArrayBuffer, you should be able to give it buffer.buffer, afaik canvas.toBuffer is already a copy of the canvas data, no need to double copy it
gotchya
why does js have so many buffer/static arrays
its so annoying
altenrating between arraybuffers and uint8arrays
the same reason c/c++ has so many integer types
why not
ngl im more of a uint8array type of girl than an arraybuffer one
overflow isn't handled correctly
when you see a junior js developer using normal arrays to store large buffers and files instead of statically typed arrays (i cant interfere its a canon event)
my serializer uses them all: arraybuffer, buffer, uint8array and dataview
me when byte[]
It can provide very fast performance on integer values, eliminating the performance justification for a separate int type and avoiding the terrible errors than can result from int truncation.
https://www.crockford.com/dec64.html
eliminating the performance justification for a separate int type
why elephant yellow
and my second verified bot took 2 weeks
yea I was surprised too
If they donβt escalate your application it shouldnβt take that long
you likely swapped channels
probablyy
yellow is the anti of light blue
but hey i am hapy
why not take it a step further, make the channels random lmao
you either get a blue elephant, a yellow elephant or a pink elephant
tween between colors
it would be so annoying to write code like this
yes
i used Uint8Array once when i was base64 encoding/decoding images
my client would love that yk yk
i think i'll get creative and make a discord bot that no one will use with this
it's usual for bot devs to never get deeper than arrays
as the processing is mostly abstracted
you need to willingly push yourself deeper to have the need to use lower data structures
for example bitfields
you should use a programming language like rust or c++ if you want to do system level stuff
don't mean system-level deep
you only need it if you actually work with binary data
programming languages have a lot of baggage
if you're using nodejs you probably have used Buffer at some point
which is (mostly) the same as uint8array
you can ignore like 90% of features that languages have
you'll write better code by avoiding the bad partsβ’
why is apng so not supported i'll make a video of it
JS has null and undefined, but you'll write better code if you never use null and only use undefined
telling the developers how amazing it is
please
yeah, you only use them when you need them, if you dont need dont use
man not supporting transparent background automatically makes the extension a shit one
apng deserves to take the throne of the false king that's gif
or only use null and never undefined
because null is normal in most languages
undefined is not
JSON uses undefined so you have to use it
oh yeah
js returns undefined for an undefined var
so you need it
typeof x === 'undefined'
:^)
you can get away with never using null
blocked

yeah, unless you need empty fields in json
but i use null quite a lot
i find it nicer to inisitalize variables as null rather than as undefined
you shouldn't store empty fields
depends, sometimes you need it, also json returns in apis often return null values
JSON.stringify will remove undefined like you would want, but it erroneously keeps null values
but yeah its mostly a matter of semantics
I mean, null is a valid value in json
null is to denote an empty value where a value could be present, undefined is to denote something that is just void
That's how they were designed in mind in JavaScript
any plans to remove null?
There's absolutely no reason to remove null
like if you're working with schemas and well defined structures, you're not gonna want to add/remove fields randomly, that will break your schemas
undefined is used in the language
instead you replace them with null
null is extra
Yep, exactly
see the toilet paper
null has a meaning that undefined cant have
null means there is a place for a value, but it's empty
things can have meaning and not be useful in application programming
i never use null and have no problems
null is a code smell for me
null means there's a spot for a value, undefined means the abscence of a spot whatsoever
This is also the reason it has a type of object, it's in the place of an object that could've been present
pointers need to be added to js change my mind
honestly this is kind of dumb, you always have to check for typeof data === "object" && data
lmao
but yeah it makes sense somehow
theres gonna be a v15?
let me guess, more breaking changes for no reason?
v14 got moved to old domain, they're definitely cooking something
We wanted to change it's type to null just like how undefined has it's own type, but since this type decision was made by the creator of JavaScript where it was made in 10 days... and it broke way too many websites when we tried to removed it
exdee
thats the problem with big things, once they get big, you cant change them anymore
and soemtimes things get too big too fast
and then its too late
bro made the whole language in 10 days while it takes yall to 5 years for a single proposed change to be added π
Yeah, if you want to change something like that in something incredibly big you have to go through tons of bikeshedding
Anyone got a clue. I havent used rich presence in years
bikeshedding
never heard that word either lmao
Do you know how many things we need to do to ensure that it's stable, has a good enough design, and has stable and good implementations?
i know that was a joke:) it sounds funny
tf it's actually a thing
i know theres a lot of consideration that goes into not breaking every browser and website
damn so THATS what i do 24/7
shedding bikes all the day
im not procrastinating anymore! im bikeshedding!
although honestly i think proposed changes take too long even very good ones
they take so long the original proposers get discouraged and abandon it
maybe thats the point
u can also make a lua bot
use whatever you feel better about for any given job
show discord.php some love
idk, I don't use lua
only for scripting my mouse
also u could try to make mods for starbound
can be a fun project if u like lua
the game itself no, but the modding api is in lua
like, the game (as in, the core game) is made in cpp iirc
but they included a framework for integrating lua into it dynamically
I mean, when you're proposing changes to THE most popular programming language in the world used pretty much everywhere, you should expect that to happen to not break billions of things
yeah but years?
node could get more changes since it's serverside only. maybe split the language
browsers could ship with 2 engines for the 2 javascript versions
not really, but because it's very flexible
u can setup a safe environment where the mods are sandboxed from the core
and choose exactly what u want to allow modders to use
Generally it doesn't take years for proposals to be accepted, the longest it has taken for a proposal to be accepted has been a year, because good design is not easy to achieve, while also ensuring full stability and good implementations across multiple JavaScript engines
thats more reasonable i just thought it took way longer for some reason
maybe because some were abandoned for years instead
but if u love oop so much u could try java
which is a lang made entirely around oop
The most important implementations are the ones on V8 and SpiderMonkey
i cant interfere its a canon event
π·οΈ π
java is too strict for websites
when firefox names their js engine after ben 10
smalltalk
Literally nobody would be willing to do that, it just makes things a lot harder to maintain, especially when ensuring compatibility, avoiding standard defects, and more
using java
do not call upon the names of the forbidden ones
what about some use strict string placed at the top of scripts that could indicate that the stricter syntax is being enfored, but it still uses the same engine. so it'll error when null is present when in strict mode
wdym?
only product that uses smalltalk on earth is scratch
Again, no reason to disallow usage of the null keyword, besides it would break the web
We DO NOT break the web, that's the thing you're not allowed to do in any possible way
I say we just delete JavaScript and start over
so im playing around with geocoding apis and find it funny to see many "professional" apis with lots of paid plans being simply clones of openstreetmap
lmao
if the maintainers of discord.js also maintainted the js standard the web would be over as we know it
it would be like macos where older programs cant run every update
We definitely should use C++ to make websites /j
someArray.cache.filter(a => a.cache.value === 2).cache.sort((a, b) => a.cache.value - b.cache.value)
so true
Rust to make c++ to make websites
the .cache thing broke every discord bot
.cache.cache.cache.cache.cache
"Let's rename every keyword in the programming language because we want to be more consistent with some programming languages!"
"We also renamed all enums to pascal case because why not"
djs should also make their own scripting language and interpreter in js so people have to make bots using their language
it would only break if the script has some new indicater at the top. i know use strict was used before. just use that same idea, but with a new string. use super strict
djs = the new bdfd
isn't bdfd made over djs?
lmao
discombobulate
Bro why do you act like the null keyword threatened your family and killed your dog or something
i want to help others. null did kill my dog
it all started when i was programming his dog feeder before a long vacation
π

null created Ben Wick
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Nothing we're just communicating funny programming jokes with telekinesis
wait discord.js started using bigints internally instead of strings for ids?
Nope
good old discord.js
its in here https://github.com/discordjs/discord.js/blob/14.11.0/packages/discord.js/src/managers/RoleManager.js#L355




