#development
1 messages ¡ Page 2058 of 1
i dont even know what show it is
but its the standarized meme for "text is too small, cant read"
stereotype comedy
is it because their eyes are narrow
I have to think about my design again ugh
How should I represent my ECS, I have a GenerationalIndexArray<T> right now for each component
Which is basically just a vector, but more efficient
But the problem I'm facing is the fact that I need to be able to iterate over each component in different systems, but I don't know how to access them mutably
Does anyone know how to get the components from the struct based on their type ```rs
pub struct Ecs {
pub entity_allocator: GenerationalIndexAllocator,
physics_components: EntityMap<PhysicsComponent>,
render_components: EntityMap<RenderComponent>,
// pub components: AnyMap,
pub physics_objects: Vec<Entity>,
}
with functions that look likers
pub fn get_component<T: 'static + Component>(&self) -> Option<&EntityMap<T>> {
}
pub fn get_component_mut<T: 'static + Component>(&mut self) -> Option<&mut EntityMap<T>> {
}
git gud
The beauty of C is the segmentation faults and undefined behaviors
afaik this can't be possible
yeah I'm saying fuck it and using specs instead now
đ
is it possible to essentially do this, add a role then return a message (and not run through rest of code)
What would an example usage of get_component look like
actually nevermind found a diff solution
if you want to send that message inside a function theres no need have the "return" but if you *need to have it return just have it return the string and do message.channel.send outside the function
nah i just dont want it to run through the rest of the code
like its just checking if someone has a role
if they do, then i dont want them to be re-entered into something
you can do a break statement, or return 0
that works as well
bet you aren't as good as him in rust 
@earnest phoenix i've been meaning to ask about this for years, why is Buffer.latin1Slice not documented anywhere? as well as other Buffer methods like hexSlice
like many of these have never been documented nor discussed anywhere
lots of other properties that exist on Buffer are also not documented nor typed, like Buffer.offset
never knew that
it seems they are all aliases for .toString(encoding, ...) and .write(..., encoding)
but there are some minor performance differences (used to be major differences, not anymore)
then you probably have the reason why it wasn't documented
I'm not exactly sure what they were used for, but from what I've seen, I suppose they were either the original methods that were internally used, or was just documented but then undocumented for certain reasons
I think barely anybody in the organization even knows about those
welcomeMessageChannel.send({embeds: [welcomeMessageEmbed]});
``` how to capture the error if there isn't a channel I can message?
it still detects but doesn't seem to have permission to type there, is what I'm saying
do you have the guild bans intent enabled?
how are you defining welcomeMessageChannel
you need an intent for that now?
I think I enabled every intent there is tho
one sec
intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES, Intents.FLAGS.GUILD_PRESENCES, Intents.FLAGS.GUILD_MEMBERS ],
that's all the intents I've gotten
Need Intents.FLAGS.GUILD_BANS
ty
const welcomeMessageChannel = await guild.channels.cache.filter(chx => chx.type === "GUILD_TEXT").find(x => x.position === 0);
``` that's how I define the channel
it does find it though since it does work
If it finds but doesn't have permissions to send messages/ embeds, either need to put it in a try catch setup, or just <channel>.send(...).catch(...)
are you sure that's the correct intent?
the event still doesn't fire
or is there something wrong with my code?
what event doesn't fire? @ancient nova
also you have no reason to await this, it's not an async call
guildBanAdd, turns out it WAS in fact firing but it was never passing the first check
no idea why
module.exports = async (guild, user) => {
const settings = getSettings(guild);
if (guild && settings.modLogChannel !== undefined) {
const modLogChannel = settings.modLogChannel;
const modLogChannelRegex = /^<#(\d+)>$/;
let channelCheck, channelID;
if (modLogChannelRegex.test(modLogChannel)) {
channelCheck = guild.channels.cache.get(modLogChannel.replace(/<#(\d+)>/, "$1"));
} else if ((channelID = modLogChannel.match(modLogChannelRegex)) !== null) {
channelCheck = guild.channels.cache.get(channelID[1]);
} else {
channelCheck = guild.channels.cache.find(_ch => _ch.name.toLowerCase() === modLogChannel.toLowerCase());
}
if (channelCheck !== undefined) {
const guildBanLog = new MessageEmbed();
guildBanLog.setTitle("Moderation Logs (Action: Member Banned)");
guildBanLog.setColor(commandColor);
guildBanLog.addField("Member Banned", user.tag + `(${user.id})`);
return channelCheck.send({embeds: [guildBanLog]});
}
}
}
``` DiscordAPIError: Missing Permissions
I have no idea whether it's my fault or not
oth guild and user seem to be undefined?
(guild, user) is not a thing according to the docs
it's just a ban object
you could do ({guild, user}) I believe
just ban?
^^^^
read that and you'll see
I have
obviously not otherwise you would know
that's what's given
oh so getting the ban parameter and doing ban.guild would work is that what you're saying?
that didn't appear to work either
try debugging
I have, returns either undefined or Object object
all I can tell you is what the docs say, I haven't seen more than like two lines of code
anyone else getting "internal server errors" from discord api?
I had that just now I panicked cause I thought I was getting ddosed cause I went to like 3 different websites and all of them had the 500 server error
I panicked so hard I started clearing cookies n stuff accidentally deleted like 350 saved passwords
cool
I wanna die
Ah yes because ddos = delete saved passwords 5Head
I panicked ok đ
I got logged out of everything what am I supposed to do
Funny thing is it seems like discord went down for everybody except me
lucky
it literally went down as my bot started dming me random errors
I got scared đ
Your bot probably isnât even hosted anywhere near you
same here
welp turns out it isn't discord but cloudflare
it's hosted in in uk pretty sure
OHHHH
so that's why other websites died as well
I legit thought someone hacked my PC started messing with connections idk why
? ok then
wouldn't you think the same if every website you visit suddenly has the 500 server timeout error seconds before your bot spamming ur dms about errors for no reason?
No I would not
I would assume that there is either an issue with my home internet provider or an issue with top level companies such as the one that caused this exact issue
And given your bot also gave you errors then I would assume the 2nd one since my bot is hosted a thousand miles away from me :p
weird thing is, it giving me errors is unexpected since it DMed me them and never in the code I put a single snippet that would dm me the error
You know you should have tried plugging out and plugging in your router first
even if an external library dmed the errors somehow to me how does it know my discord ID?
I have
even restarted my PC
x to doubt
I would've remembered if I did -_-
Bot ainât gonna randomly do something you didnât tell it to
that's the normal response as a human being
well somehow it did tho
Your bot didnât just become sentient and dm you errors out of the blue
Just do a quick MTR test to check your connection
âHey nodejs you know what would be funnyâ
âWhatâ
âWhat if I became sentient and sent this dude errors to fuck with himâ
âYeah bro go aheadâ
I did tell it to DM me whenever someone joins or leaves the guild with my bot but still how does it show the errors?
đ
not funny
Iâm just saying that I hiiiiighly doubt you got sent errors without putting that in somewhere
Well that happened before when discord released Text in Voice
The bot started to DM random error
out of nowhere
Discord.js released v13.8 to fix that
Try using 13.7
I wouldnât lay a finger on djs anymore 
It breaks something within the library which is stupid for some reason
I am using 13.8 tho
ÂŻ_(ă)_/ÂŻ
13.8 works fine
then why did it dm me
I swear I didn't ever put any snippet of code that will make it DM me an error
I'm not talking about this error anymore
I know, but I'm talking about the error I got
I''m talking about the past when a library started breaking on it's own
Tbh moving to v14 now when editing your code makes sense as lot of stuff got changed again
yeah takes a while, while driving
the only error I recieved pre 13.8 is the one that breaks channel caching when guild gets added
but since upgrading I didn't get any error
They renamed FLAGS to Flags or something
Big brain
lol
They did things like on each major version
As least as long as Iâm using it
Some days ago with the latest dev build lots of functions from the util class have become available globally
Idk why tbh
Itâs confusing and I had to update my recently updated code again

CTRL+R to the rescue
@quartz kindle ima try the oracle cloud thing on a diff card now
completely different email and incognito mode in case they banned those too
aight bro
idk why i got banned
they wont tell me why
its like i committed fraud or something
and i havent even signed up đ
its probably because they saw that i faked my details initially
bc i dont feel comfortable giving oracle every spec of my info
but looks like i have to
declined again
but this time i think its because the bank is blocking it
i got a different message saying to check my details
if it still doesnt work, send them an email from this new email of yours and tell them that its not working
if you're lucky, you'll get "we fixed some things and it should work now"
then it will work
is there an event for when a bot is kicked from a vc?
this starting ti be annoying, any1 know what can be cause of this?
I was making simple timoeut command,
After I restart bot, and call this command for the firs time. everything works fine, but after i call it for second time, I got this error...
BTW, i tried mongo forum & stackoverflow, bot it didnt help
const { SlashCommandBuilder } = require('@discordjs/builders')
const { MessageEmbed } = require('discord.js')
const Schema = require('../../models/timeout-schema')
const OWNER_ID = require('../../config/cfg.json')
module.exports = {
data: new SlashCommandBuilder()
.setName('timeout')
.setDescription('Timeout a user for a set amount of time')
.addUserOption(option =>
option.setName('user')
.setDescription('The user to timeout')
.setRequired(true)
)
.addStringOption(option =>
option
.setName('duration')
.setDescription('Duration of the timeout (In Minutes) ')
.setRequired(true)
)
.addStringOption(option =>
option
.setName('reason')
.setDescription('The reason for the timeout')
.setRequired(false)
),
async execute(interaction, client) {
try {
if(!interaction.member.permissions.has('DEAFEN_MEMBERS') || !interaction.member.id === OWNER_ID ) {
interaction.reply('You are not allowed to use this command!!')
return
}
let user = interaction.options.getUser('user')
let member = interaction.guild.members.cache.get(user.id) || await interaction.guild.members.fetch(user.id).cache
let duration = Number(interaction.options.getString('duration')) // Getting number from string
let reason = interaction.options.getString('reason')
if(!reason) reason = "No reason given" // If no reason is given, set it to "No reason given"
let embed = new MessageEmbed()
let embedPublic = new MessageEmbed()
// need to get choices from option
// DM Embed
embed = new MessageEmbed()
.setTitle('Timeout')
.setDescription('You have been timed out for **' + duration + ' minutes.' + '\n**Reason: ** ' + reason + '**')
.setThumbnail(member.user.avatarURL({dynamic: true, size: 512}))
.setColor('#F66969')
.setTimestamp()
user.send({embeds: [embed]}).catch(() => { interaction.reply({ content: `I am unable to send message to ${user} because they either blocked communication with the BOT, or they have closed DM's.` }) })
// Add the role to the user
member.timeout(duration, reason)
// remove role from user after duration has passed
embedPublic = new MessageEmbed()
.setTitle('User Timeouted')
.setDescription(`${user.username} has been timeouted for **${duration}** minutes.
**Reason**: ${reason}`)
.setColor('#A7FFBE')
.setTimestamp()
interaction.reply({embeds: [embed]})
Schema.findOne({ Guild: interaction.guild.id }, (err, data) => {
if(data) {
data.User = member,
data.Duration = duration
data.Reason = reason
data.save()
}
else {
new Schema({
Guild: interaction.guild.id,
User: member,
Duration: duration,
Reason: reason,
}).save()
}
})
} catch(err) {
console.log(err)}
}
}
``` here is whole code for timeout...
Again, like before youâre adding the entire member object to your schema, when itâs not going to know how to serialize that. You need to be adding member.id, not member
Ahhh... Tnx man
He's been doing it longer than me so you'd be right
I mean, 2 days vs 2 weeks
turns out you can learn a lot in 2 weeks
I've got a decent understanding of rust now but I'm still working on understanding how to better structure an application
I also have a decent understanding for only using it for 2 days
I at least understand the major parts of rust at a basic level
at least all the ones you told me to look at 
@quartz kindle turns out my bank flagged the transaction as fraudulent and placed a block on my card
i honestly dont blame them if i saw oracle trying to take 80p out of someones account id block it too
lmao
but it should be running again in 10 minutes
hopefully they havent blocked my card now because my bank blocked the transaction and refuse to tell me again why
I got my card blocked when I was 13 or 14 for a full day because I was trying to buy PC parts after I had saved up enough for it
They blocked my card after I spent 60 bucks on a case lmao
lol apparently some random company ive never made a transaction to taking 80p from my account aint usual activity
aight ima try again watch it get banned
It also might be known that there is a verification charge for many VPS providers like Oracle, and I figure it wouldn't be too uncommon for people that get their cards stolen to be used as a botnet on VPS services
bro why is it so hard to give 80p to oracle
call your bank and tell them to fuck off
bruh
i promise i havent done anything đ
it might be because its a new card
yeah they havent banned my account i can try again
oh wait
could it be because im using brave
which blocks trackers
Awhile ago I saw an article somewhere that said because of it's free tier VMs Oracle can't process that many user requests so they're using an "AI based system" to fend away bots or Random users who're using it for free tier perks only.
I'll se if I can find the link
đ
so tim is a business user who is clearly not trying to freeload but i am đ
what if i tell them im running a startup business who is planning to use oracle
I've had a VPS with oracle for like a year now, wonder if they'd let me hop on that 24gb ram train
i need to wait like 6 minutes before my email verificaiton link expires otherwise it wont let me make a new one
oracle is a shithole đ
My gosh⌠Iâm close to create a new VM for you with the needed resources to end this mess
nope i tried using chrome on my phone and it still didnt work
ima email them.. again
the card isnt banned so theres hope
đ
bro im not just gonna pass up 24gb ram easily
Gonna give you 25 to end this
I can also try to call Oracle, telling them Iâm your mom and they should fucking give you the server to make you stop begging

bruh
hosting is overpriced okay
so free hosting is a good deal
i also mentioned in the email im planning to migrate my services to oracle
in case that helps
i never said id be paying for it though
wtf itâs not, absolutely not if you stick to cheaper providers
otherwise ima go cry back to contabo
Not to say you wonât even get servers by level 1 or 2 providers as private person
considering im a student with a part time job with an 8 hour contract for now since they're trialing me out its very expensive for me to get a decent vps for a good price
Well there are ways to earn fast money on the streets 
maybe contabo has something good idk
im planning to invest in a proper server so i dont have to deal with these hosting companies
Hetzner is also quite cheap or ovh even if ovh is just trash
With a bad support and trash customer panel
im looking for a uk server mostly
im planning to mostly use it as an alternative to WSL on my poor laptop
and to host some things occasionally
is there some kind of generator for css code that will add -ms and -webkit properties?
I donât see why Germany or Finnland would be a noticeable difference
yeah those should be close enough
i have a galaxygate vps which is in the US and the latencies are horrible
it keeps disconnecting too
There arenât such properties for most of the existing css properties
oh
i think i'll try out contabo for now
Well then have a look what both providers have to offer once Oracle declines you at all
and another question, why doesn't the css for my email render in gmail but it does in different email clients?
Because there are 1000s of different email clients not rendering some html/css content for reasons, donât ask me wh
Or simply donât even support it
Since there are so unbelievable many things you would need to respect itâs a lot easier to use a common email html generator
Those usually manage to create compatible html code which will work in most of the email clients
thank you
bruh contabo has a "one time setup fee"
ima hold off for now
this is kinda like digital ocean sketch type shit where they force you to topup a certain amount of money before you can access more expensive servers
even tho you're on a free trial
alright thanks not gonna buy digitalocean vps
lol
Most providers not to say all have setup fees for dedicated servers
actually its risen because of "penalty fees"
lmao
Not so for cloud or virtual servers
dedicated servers id understand
i also have a 8 euro penalty fee for a "free service"
but not virtual servers
If you think thatâs expensive check what ordering IPv4s nowadays costs, a /29 subnet has a setup fee of more than 180âŹ
đ
im trying right now to find affordable domain registration + email + vps to run express websites
lets just say its not that easy
Itâs not since an huge amount of bot orders took in place the last years
Providers try to do things against this
Many also decline new customers and let them send pictures of themselves holding their ID card in the hand
It has become a little bit tricky as new customer nowadays to rent a server
But itâs good it is like that tbh
I once ran an express server on a cpanel thing
Since it said in their ads that they run nodeJS
welp
Since then I don't go for cheap things
and?
Most TLDs cost about $12 per year, so itâs very affordable
you'll learn the hard way
Stick to normal tlds like com for example, net or org etc
you'll go in debt for 2$ per month ?
That's something
uhhh
no
but i couldnt find everything combined wich would come to 2 usd / month
Well $2 for a virtual server is quite cheap tbh, you should expect around 5 bucks
try visiting some shady websites
For something thatâs reliable
uhhhh
128mb Memory
0.001VCPU
100mb STorage
tf
that's a fucking raspberry pi divided between 30 people
Most of my USB sticks are more powerful than that
lmao
pretty sure my alexa has more power than that
Damn this is sus af
The homepage explains
Yeah like I assumed
is this the 2000's
idk why VPS providers restrict storage so much... it's dirt cheap
Cause they can
Well that ainât true
it's like 120 bucks for an 8tb HDD
who uses HDD anymore
a lot of people
most VPS have SSD tho
all about that speed
80 bucks for 1tb SSD
Since most environments use raid5 setups for their entire system
SSD is more expensive than HDD though waffle
Dumbass thatâs the price for consumer hardware not enterprise server hardware
I'm aware
No youâre not
I'm just saying that 5gb SSD for a server... really... come on
damn fake why being toxic
ok old man
5gb might be 20gb as result of the raid
Also like another 20gb as redundant backup storage providers have internally
Looking at a 7.68tb data center SSD, it costs about 1050USD. If you give 5gb to each customer for $10.68 a year, you're making back $16,798.19 per year
I understand it's difficult to get that many customers but like... 5GB is nothing!
You can notice the difference yourself when ordering a dedicated server adding additional storage to it
Thatâs mostly damn cheap since it usually comes as raid1 (if you wonât to)
yolo and make it raid0
make it a man in the datacenter writing on a stone tablet every time he gets a signal through his dystopian neuralink implant
Some people have quite a lot IO threads which kills storage within a small amount of time
So investments are being shared between all customers
I'm just saying that 5gb is barely anything
I pay nothing per year and get like 30gb I think
Yes thatâs why I said that provider is trash
Granted my vps is run by a multi billion dollar company that can easily afford it but still
Im not even sure if that offer was a server or just a container
I managed to try out every fucking known cheap provider existing in the eu the last 14y
And they were all trash without any exception
All those mini providers popping up and offering servers without having own datacenters relying and price and support stability of others are trash, pain in the ass
Also something to mention is that lots of providers have static server offers without the chance to dynamically add ram or cpus or storage as option for your virtual or cloud servers
Some may need more ram, some more storage etc
Itâs like most of the time things arenât really flexible
Even if they could be
https://www.serverhunter.com/ is great
ok...fixed this with db, but now ammm...instead of adding new data to mongo database, it doesnt do that, but instead it overwrite previous results
for finding cheap servers
so...it's just overwtite, instead of adding new data.
whats your code look like?
so you're trying to upsert?
User is an array and you're just overwriting what the previous user array was
upsert?
yea, ik that
So don't?
and I trying to add new data, instead of overwritting old one
as I said, ik for .update() but dk here should I use that
I would just use findoneandupdate, and enable upsert
https://mongoosejs.com/docs/api.html#query_Query-findOneAndUpdate
upsert: bool - creates the object if it doesn't exist. defaults to false.
I'm assuming thats what you want.
Create a new row for a user if it doesnt exist, if it does update it.
Would make sense to add a document only if an user has a timeout role and completely remove the record if he doesnât have anymore
Instead of blowing up the database without any reason
Well... It dosent have role, but yea, i Could rwmove rexords
hi i dont can creat a token can somebody help me?
a token where?
api token for my bot
const topgg = new Topgg.Api("") //top.gg token
you can't yet
you first need to get your bot reviewed and approved on top.gg
after that, you can find your token on bot edit page
ah okay thanks
extract the api from package perhaps
Browse 8+ Song Lyrics APIs available on RapidAPI.com. Top Song Lyrics APIs include Mourits Lyrics, TheAudioDB, Genius and more. Sign up today for free!
why wouldn't something like this work?
const test = function() { return test(); }();
this will execute the function without the need of calling it
(() => { ⌠})();
then why did u ask?
huh
what do you mean
I'm asking why u can't execute the same function again from the function you're calling it in
How would you example make sense in any way?
A self executing function that is bind to a var?
that's a constant variable and that's how I store functions for later use
You can of course call your own function in a function
then why is there a snippet of code that doesn't work?
But not like you did
Because you're not calling the function, the function isn't even interpreted properly, and yet you're still calling it
then what am I doing wrong?
Remove the () at the end and call the function manually since youâre binding it
This example can never be self executing
The interpreter thinks that the () is unexpected, as the function isn't even interpreted properly
You can just wrap the function and then call it
no I can't call it by itself then call it again from somewhere else but I can't call the function inside itself
the variable isn't assigned when the function is ran
right-side of the assignment doesn't know what exists on the left-side
recursivity only works for traditional functions because it's hoisted (technically, every function is declared twice - once for the header and once for the body)
I see
wouldnt a timer be easier here anyway?
probably
what do you mean by that?
JavaScript setInterval() method with javascript tutorial, introduction, javascript oops, application of javascript, loop, variable, objects, map, typedarray etc.
cant u just use traditional function syntax?
I can ig
smells like bad design in your code
only real reason why you'd use a pattern like this is inline async functions
and that even could be bad design depending on the context
why is it that every time i try to do something in typescript it ends up as being utterly impossible
fuck this im just gonna write a script to textedit my .d.ts files
I'm currently having issues with my models
whitelisted = fields.ManyToManyField("models.UserModel", on_delete=fields.SET_NULL, null=True)
logs_channel = fields.ForeignKeyField("models.ChannelModel", on_delete=fields.SET_NULL, null=True)
bro you're just using the language wrong
you're supposed to absolutely give up on whatever you're trying to do and find a different way to do it
Aye like creating your own language that perfectly fits your needs

whever ts users use that argument it makes my blood boil
MAYBE IF YOU DIDNT WRITE BLAND CODE 24/7 YOUD REALIZE
thats what im going to do right now
except the only way to do what i want apparently is to manually write/hack .d.ts files myself
fuck ts
from now on i only use jsdoc and use an actual statically typed standalone language instead of using typescript
because standalone statically typed languages have an ecosystem that has adapted to the use of strict types and so you rarely run into issues like that
Is there literally anything you do which doesnât end in a mess, like doing something without issues and scratching it from the list? 
i was so happy with using jsdoc and getting all the strict type checking, until i found out its impossible to document events with it
apparently not
lol
i dont really like jsdoc but what can you do
Poor boy
you know types in javascript are only really there to assist the programmer and for them to know what type something is
what if you just made it completely editor specific
like you can right click on something and set what type it is if it couldnt predict it
tricky adding types to a language that doesnt strictly enforce them
What if poor people like me using npp ?
The editor doesnât know shit
Or how to interpret your stuff
notepad++?
Yeah
lol
its mostly the osdev youtube videos
To quote Waffle: Shut up dingus
because there arent any sane osdev people nowadays
Im not switching my editor
I donât like new stuff you know
So accept this and build something compatible for me 
c++ users after realizing notepad++ isnt a c++ IDE
good for you
activities beyond your wildest imaginations
just nice having a free vps with ram
even tho oracle will probably find a reason sooner or later to take it away from you
Nvm itâs more than the half
True
why cant javascript have type casting and pointers i always have to go to some online c++ compiler to test my prototype code
@earnest phoenix bro javascript pointer update drops when?
Don't worry ma'am, I'm about to drop the truly statically typed JavaScript in a few minutes

i was testing my code which predicts the output length of aes256 ciphertext
size_t encode_res_length(size_t length) {
return 16 + (length / 16) * 16;
}
but then i forgot javascript has no integer division
thats inlined btw
gotta keep that performance
I still barely understand when to inline something tbh
I guess itâs for when you have a function that basically just dispatches itself to other functions or quick one liners that can just be inserted anywhere instead of having to look them up in the call stack
usually its when you have a very short function where its nice syntactical sugar to keep it as a function and so you dont repeat code but dont want to have the overhead of calling an actual function
if you try to inline a function thats too long the compiler will usually ignore it
i think i have more or less found a way to properly document events with jsdoc like i wanted
its ugly af
class ABC extends EventEmitter {
/**
* @callback A
* @param {"name"} event
* @param {(data: string) => void} callback
* @returns {this}
*
* @callback B
* @param {"test"} event
* @param {(data: number) => void} callback
* @returns {this}
*/
/**
* @type {A & B}
*/
this.on;
}
bros doing AND operations in jsdoc đ
well its vsc jsdoc which is powered by typescript
so it supports everything typescript does
types wise
tim just make a library already which adds types to code
ayo
let something = libraryInt(somedata.unknowntype);
Just sounds like you want Number(somedata)
what if you have a class
easy ```js
module.exports = function libraryInt(unknowntype) {
return undefined;
}
yeah nvm dont think that will work
can someone already make an ai powered jsdoc which can accurately predict types
Lol an ai powered program
dont laugh
Sounds like fun for debugging
âWhy the fuck is it crashing???â
ai maniacally laughing in the background
you want to also predict runtime types by looking into the future and recording which types the program will ever receive?
quantum time travel type checker
Well this is on it's way, so you won't really have to do that anymore
https://github.com/tc39/proposal-type-annotations
It'll be much easier
god knows how many years that will take to ever arrive
considering its a MAJOR breaking change to the entire js language
it will take a while until every js-powered thing out there will even support it
browsers, v8, node, vsc, etc
It's mostly based on the engine itself, so others are mostly irrelevant, but in case of them updating to the engine version that supports it, yeah that'll be a concern
also all the relevant tooling would require updates
even things like browser console hints / autocomplete
I guess we'll be doing a shit ton of work to make this a possibility
voltrex secretly laughing in a secret private v8 discussion repo coming up with a reason to deny it and when
i cant see how adding native types to js is even realistic at this point
Maybe
"no types for you"
i feel like this is akin to "pls make discord.js support python"
the proposal is cool but it is a major breaking change
it will basically kill any older unmaintained browser versions if a website decides to use them
the only way i see it working is for the engine to treat all type syntax as comments
actually looking more at the proposal it looks like its just trying to turn the whole language into typescript
That's exactly what it's going to do
so basically is not typechecked js
its js that allows typescript syntax without complaining its invalid js
and ignore it
Yeah, you're basically just writing JSDocs but in a more expanded and easier way, as if you're using TypeScript without the actual type-checking
It would be pretty useful as writing JSDocs is a pain in the ass
Indeed
V9 
type hints in python are so confusing because it feels like they should be checked but they don't. Don't want js to feel like that tbh
I don't wanna have to see
function a(): number {}
and wonder if it's a real type or a fake type lol
true
probably not really confusing in the context of an existing project but
2030 javascript developers wondering why their function marked as returning a string returns a number
A lot of people were asking "what will happen when V8 reaches v8?"
much like 2022 typescript developers wondering why their function marked as returning string returns undefined because they don't have strict typechecking turned on
or a function marked as returning string returns literally anything at all because any still exists
typescript devs wondering why their program is crashing with cant read x of undefined because they keep using var! everywhere
typescript devs wondering why their program is crashing because programming sucks and I hate it
easy, dont be a typescript dev :^)
typescript devs wondering why they cant pull
Imagine going back in time and making JavaScript a statically typed programming language from the very start
But even then, I don't think it would be as popular and widely used as it currently is, considering it's used mostly because it's simple and fast enough
yeah thats called java in a browser
Java is literally hell
Java developers explaining why having 500 keywords is a good idea
which mfs voted for this shit
dafuq are those even
decorators in js would be clean
i think they mean something like c++ has with its type overloading for streams
like std::cin >> variable
idk tho
what about functions lol
Well decorators are stage 3 so expect it pretty soon
yes, less go and more stop
decorators have been supported by typescript ever since I started coding lol
C++ stream operators are so cursed, they're just an overload of bitshifts
I can't think of a more confusing way to implement them
c++ streams are awful
js is to typescript what discord is to bot devs
slowly but surely stealing its features
đ
For those who are wondering what they mean by the "Pipe Operator", it's this
https://github.com/tc39/proposal-pipeline-operator
the only proposal that matters https://github.com/tc39/proposal-iterator-helpers
dafuq is that
some things are regular functions while some things are << >> or whatever
I don't understand why ppl want pipes
I love functional programming, but this seems like a pointlessly confusing feature
Basically an operator to "simplify" the passing of values to functions and similar, and make it more readable
it works beautifully in elixir because it's baked into the language
i thought javascript was supposed to be readable not become rust
these are the only things tha t matter tbh
there's no ^, piping stuff simply passes the return value as the first parameter and there's no async/await sugar
temporal is also huge
Btw, operating overloading was actually proposed, but it's currently inactive and probably just dead
pls no operator overloading
Maybe for the good, because it would make JavaScript an unpredictable hellscape
javascript users wondering why a + b prints hello world to the console
imagine ```js
+.prototype.... = ....
i like operator overloading but its just not for javascript
Operator.create("$", (a, b) => a + b + 10)
console.log(1 $ 2) // 13
There are also these
https://github.com/tc39/proposals/blob/main/inactive-proposals.md
this one is very interesting
that would essentially make threading in js very similar to threading in other langs
the problem is that the underlying threading mechanism would probably still use worker_threads and would make people confused as to how it actually works under the hood
Yeah, unfortunately the proposal was also withdrawn as the champion is no longer participating in TC39
But instead of inactive and mostly rejected proposals, these have a chance
https://github.com/tc39/proposals/blob/main/stage-1-proposals.md
About a year
resizable buffers would also be top shit
really? i feel like i remember them since like 2016
The proposed dates are shown in the tables, but that's when they were proposed to TC39, the ideas existed way before
ye
also
watch resizable buffers be implemented only to be slower than creating new buffers and copying data
:^)
Lmao, I'm sure it'll be way faster and more efficient, as long as there's a viable approach
xD
a lot of things usually start slow and then have performance improvments added later
like replaceAll used to be much slower than replace(//g)
Yeah
Buffer.subarray used to be much slower than Buffer.slice
then you go and deprecate .slice
xD
Initial implementations of many features have always been way slower compared to their speed in today's world
I remember when Array.prototype.sort() was used to be extremely slow
i posted in a server for the first time in 3 months
and got autoreplied by a bot saying "get a life"
Damn that's #deep
tc39 pointer proposal
examples
let num1 = 5;
let num1ptr = &num1;
function a(ptr) {
*ptr = 10;
};
a(num1ptr);
console.log(num1); // 10;
does anyone how why this doesn't work?
Object.assign(document.body.children[0].style, {
'background-image': 'url("https://i.imgur.com/uKVG1XM.jpeg")',
'background-attachment': 'fixed',
'background-position': 'center center',
'background-size': 'cover',
'background-repeat': 'no-repeat',
});
``` I'm trying to change discords background to an image instead of a static color
it works for a second then changes back, I tried using a interval to change the CSS, but it never changed after the intitial change
btw I did check and it's not against ToS
It actually is against the ToS, any type of modification is; but mostly the Discord staff don't give a fuck about style changes
I mean maybe? though I did ask about it in the official discord developers server
btw I also tried creating an overlay image with z positon behind all the text but that didn't work either
the color doesn't want to remain invisncible so the image gets hidden almost instantly
Maybe that would be a good proposal who knows, I'll probably bring up the idea and tell someone to make a proposal out of it, since I don't have the time to manage it myself
can anyone figure out why or what should I do?
i was mainly joking but it wouldnt be a terrible idea tbh
tried injecting animaton frames/ hooking to a mutation observer
pointers would defeat js's immutability
nothing seems to work
it would be cool if functions that arent closures could modify another variable
in order implement pointers, youd need to add a new mutable primitive type
we make the whole language mutable
js die
so whos gonna make the proposal
:troll:
i still dont get why strings are immutable
tc39: "js is now mutable"
v8 devs: FUUUUUUUUUUUUUUUUUUUU
epic troll
when i began js i did get fucked up by the fact objects are passed by reference but types such as ints etc get passed as copies
c++ developers realizing passing a number as reference is slower and has greater overhead than just copying it
the world is wrong
please đ
when tim trolls you know its over
i wouldnt know i dont use features like object assign
i dont even know what you're talking about
what do you mean?
^
did you even read what I said
lmao
i have no idea what that is
what is the context?
is that for topgg description?
is that a browser extension?
is that your website?
what is that?
I'm trying to make discord's main body be an image while everything else be transparent
(async window => {
'use strict';
Object.assign(document.body.children[0].style, {
'background-image': 'url("https://i.imgur.com/uKVG1XM.jpeg")',
'background-attachment': 'fixed',
'background-position': 'center center',
'background-size': 'cover',
'background-repeat': 'no-repeat',
});
})(window);
``` everything gets overriden instant the application opens though
using dev tools it works, but in a script it doesn't
I'm confused
if it works in dev tools then you're probably running that too early
is that in a window load event?
nope, it injects instant I enter the website
then you need to wait for the window load event
apparently its been withdrawn because google disagreed with it
@earnest phoenix any info?
the proposition owner really looked like google did something to him đ
To be honest, I myself don't have any idea what really happened to that proposal but from what I've seen so far, it seems like the idea was being either rejected or withdrawn due to either "better" ideas existing that could replace this proposal or might be an issue with how the proposal is put up, about Demonic though, Google itself isn't really against them of course, just a few Googlers who are a part of the TC39 committee are against the idea and bringing up the aforementioned "better" ideas or similar, fighting up against protecting your own ideas and beliefs is extremely hard in these cases
And if you didn't know, everyone from every member company of the TC39 can object to stop/block the proposal from going forward due to reasons they might provide, as the whole thing must come down to full consensus, so it's a hard fight to partake in
I don't think they would really dare, Demonic themselves are a Googler, things like this usually never happen enough to turn out like that
But that doesn't mean rejections/withdrawals are common
This fucked with me since I started with a foundation in C++ lmao
It still does honestly
how can I line those up
with Tailwind
<button class="py-3 pl-5 pr-12 rounded-xl btn text-left">
<i class="fa-solid fa-triangle-exclamation text-3xl btnIcon"></i> <span class="ml-12">Create report</span>
</button>```
oh so he is an employee too
that makes sense
i can see how they would pick on him because they didnt like something about the proposal or the constant questions and objections
Css display: block + vertical-align: middle?
no difference
flex and align center.
how to keep track postion 1 in setdescrption
for example track queued - position 1 <=
well, heres me done for the night
https://github.com/brainboxdotcc/DPP/pull/429
a monster of a pr
Looks interesting brain
anyone tried out the new automod feature in discord yet?
i had a play with it, felt like it was designed for communities full of very young kids
the default block list filters words like.... those two things on a cows head followed by the letter Y
since when was that swearing lol
Just put where the song is on the list
I agree
we need pointers in high level languages
pointers in js
talk about giving enough rope to hang a dev

needs an unsafe keyword too!
hello qt null
but to be able to do it without bindings
hai misty
this is where the real game begins
yes
I am writing a parser in java first to get a feel of how to do it 
It is a lang I know and also one craftinginterpreters.com uses
Yes, but all that matters is the concepts I get from learning
fair enough
As long as I understand how it works I am confident I will be able to bs my way through it in rust
So you're planning on writing an interpreter
I plan on writing an argument parser for my cli but this book just so happens to teach how to write that kind of stuff rather well
just copy my argument parser code smh
Can't if I don't know where it is null
dms
also I don't really feel like copying code I don't understand the concepts behind
i'm sure you can understand it
I have a feeling our talk about making a command parser unchained all this
Whatever do you mean?
The urge to write a parser 
Actually nah it has nothing to do with what we talked about
Ah
I was planning on making a cli tool in rust but had no way of parsing arguments from the terminal
If u can read java, I got a good example of implementation if u want
So now i just have this shit show in java
Well this is just me testing out making scanners and parsers
I plan on doing something a bit differently with my cli tool
Try making a jetbrains language plugin
It covers exactly that, and their tutorials are kinda good
U barely write java tbh
Only for type declarations and stuff
The rest is dealing with flexer
This is the entire scanner class that I made by going through the book
Give a read on lexers, they make that a lot easier
Maybe u can get something from how it's implemented internally
I haven't gotten that far in the book only the first chapter which is setting up the scanner
Ah
The next chapter is setting stuff up for the parser to work smoothly
Btw what's the null after each line?
null is when it doesn't have a literal
Ic
I don't quite understand what they exactly mean by literal in this context
but I assume it is just when it doesn't have a value
like a string has value
it has the words inside it
Same with numbers
it just is represented in it's Double form
I think it's because those tokens don't represent a value at all
yea
Like, in that case 100 represents 100, but var represents nothing, it's value is its existence
yea
The book is pretty extensive on this topic of making a "language"
The one I am going through is the tree-walk interpreter
i tried for example if i play multiple songs how to keep the position 1,2,3
When printing ur probably either looping or adding a new song
For loop just print the current index + 1, when adding just print the queue size + 1
^ this
anything that doesn't have a literal associated with it is for the parser to understand
makes sense
I am taking a break for today though
My head hurts after reading the second chapter forming the ast
https://cdn.discordapp.com/attachments/985658168921182288/989012805619433522/2022-06-21_22-43-01.mp4
Got bored and wanted to make my sites 404 page mimic my zsh theme
Looks bad /s
Seriously though it looks amazing
I love the look of it
What'd you use to make it all happen?
I kind of liked the other version
Just a bit of html/css is all.
I did too but it wasn't very explicit to whoever saw it
Nah I like that it's more explicitly known as a 404 page
yeah
I feel like it conflicts with what you were going for tho but đ¤ˇââď¸
otherwise some non technologically adept people may think that they're doing something wrong
recruiters
^
lol
what non technological person would visit someone's portfolio
lots of people
.... HR recruiters?
you seen the people that post jobs online?
Misty about to learn abotu linkedin
lmao
Meh whatever, don't really wanna voice my opinions here
It's genuine.
REQUIRED:
- At least 25 years of experience in C, C++, Go, Swift, Kotlin, JavaScript, Pascal, FORTRAN, C#, Java, and Rust
- Be able to program complex data structures in the most efficient assembly possible
- Accept 0 salary for the first 3 months, then $1500/month afterwards
- Be a team leader
- Meet deadlines early
There are lots of recruiters that visit portfolios.
Hello is there anyone who developing bots to play games?
A friend suggested making the terminal type out a panku.io -h command and then it prints out 404 page not found
why not the page name they tried visiting instead of -h?
panku.io --route "route here" then print 404 page not found
or that
kinda worried if they make the route long enough it takes years to type out lmao
Aye, but depends what u mean with that
@wheat mesa btw, do u know anything about monte carlo or making ai for card games?
put a cap
unironically big brained lmao
I'm making it a component now so i can reuse around the site and pass it an array of "commands" and "outputs" for each command so I can like
list skills and other things
make goofy outputs
I miss google url easter eggs
nope
Nhe
thanks
this was fun
yes
css css?
Yeah I already fixed, was jkust copy/pasting to get the amount right
Ah lol
Favorite skill, yeah
I was trying to create a command that has cooldown on it. Im almost done and working perfectly fine, but the thing is. How do I create the automatic delete if its the right term after the time ends?
Delete the message being sent when the command is being executed
Hey can somebody explain me this annoying error?
Error: querySrv EREFUSED _mongodb._tcp.cluster0.mofw2.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (node:dns:276:19) {
errno: undefined,
code: 'EREFUSED',
syscall: 'querySrv',
hostname: '_mongodb._tcp.cluster0.mofw2.mongodb.net'
}```
couldnt find anything on internet
the mongodb.net server refused to connect
and how can i solve that i tried everything
from making new cluster
to disabling and re enabling allow access from everywhere to ip settings
I'm gonna sound nooby here but
When message is a valid channel it says false
y
what is $message[>]?
Last word user put
Like "$create channel" the message = channel
In this case $checkz test
what did you put as channel?
Channel is called test
If I type in $checkz test
It should say true
Instead it says false
channel Id exists?
how do I get it
mobile lmfaoo
bro deleted it
oh it's at the bottom
Hmmm
Restructured
$channelExists[$channelID[$message[>]]]
is there not a way to extract channel ID from "#development"?
is what that $channelID does?
epic
feel free to copy the code... for whatever requires needing to know if a channel exists
$channelExists[$channelID[$message[>]]]
$message[>] takes the last word and feeds it into $channelID then for $channelExists to determine
Dumb question probably no but with BDScript 1/2 can you automatically make the creator of a channel to have perms for that channel?
My current setup is
$nomention
$cooldown[3m;no spamming but nice try, wait 10m]
$createChannel[$message;text]
Can I make user who used command perms to channel?
(you don't have to spoon feed me. Just a y/n.)
Helloo, not Discord bot related, but I need help with Git.
How do I combine two different git history on top of each other?
For example, I have remote branch with these commits:
- commit-0a
- commit-1a
Then I have commits on my local branch like this: - commit-0b
- commit-1b
How do I combine them so that it would look like this:
- commit-0a
- commit-1a
- commit-0b
- commit-1b
(Local commits is on top of remote commits)
i still dont understand where should i put or what should i put
to automatically delete the data
Anybody familiar with how to update server count on Top.GG? I'm pretty sure my code follows the TopGG Java library docs to the tea but nothing seems to be happening on the website. Do I need to wait for the changes to appear?
@Override
public void onReady(@NotNull ReadyEvent event) {
String TOPGG_TOKEN = bot.config.get("TOPGG_TOKEN");
if (TOPGG_TOKEN != null) {
DiscordBotListAPI api = new DiscordBotListAPI.Builder()
.token(TOPGG_TOKEN)
.botId(event.getJDA().getSelfUser().getId())
.build();
api.setStats(event.getGuildTotalCount());
}
}
Welp the java library is broken for a long time
See pins in #topgg-api
They have some fixes
This message specially
Yes I already have that version
That dependency tag doesn't work so i forked the master branch myself
Should I just do a POST request instead using OkHTTP?
I swear botmakers are harder to understand than actual programming
Quick question, the systemctl list-units command attempts to show the loaded/active units, in addition to the --all switch which will list the active and the inactive service. What exactly does systemctl list-unit-files do?
they weren't even being an ass abt it, why did u have to say that?
Hey any idea how do I club this in a msg like-
User Votes
User#1 10
User#2 90
Type of thing?
I am trying this from long time, can you anyone help me pls
And yeah let that user#1 be the userid.
<array>.push([id, votes])
How would I club that into a mesage it will just return the first value ig 
for id: <array>[index][0]
for votes: <array>[index][1]
a bunch of devs had a 20 minute conversation last time you asked this.
<array>[index][1] returns the values of first item and not all or i am wrong, i have no idea about what is [index] is
When đ
it returns the second value of the supplied entry index
index is the position in the array you want to access
if u want to return both values just use <array>[index]
So it goes like 0,1,2,3......
Yes
unless ur using lua, yes
Hmm...thanks :)
Hmm...
So now how do I join all index+1 with \n (line leave) ?
arr.map(x=> `${x[0]} ${x[1]} ` ).join('\n')
that's BDScript lmao
hi
well yes, a botmaker
it's rather easy and simple
idk, maybe it's because I'm used to programming, but
if (message.guild.channels.cache(channelID)) {
// ...
}
seems easier
hey my goal is to make a router in React
I did something like this but it doesn't work
The site opens when I go to http://localhost:5000/dashboard
but but when I go to the http://localhost:5000/twitch/dashboard address, a white screen opens
routers don't work that way?
I have no idea
did u set ur root to that?
if so, the correct path would be http://localhost:5000/dashboard/twitch/dashboard for ur last message
I tried restarting but the problem is not solved
