#development
1 messages · Page 1983 of 1
yeah include fields for each like the specs, price/free tier eligible and maybe free trials
why most slash commands don't show emojis?
and drawbacks perhaps like card required
wut?
Yep
And because I’m online too much I can update when needed
@boreal iron Why don't I show emojis on most slash commands
wdym
multi-guild
Asking the same question again doesn't make it more understandable
Lol
Nope
I made slash commands on my public bot, updated it and set it up for everyone to use. In embeds on my slash commands, the bot doesn't want to show the emojis it displayed on regular commands.
@boreal iron
custom emojis?
i'll make a raw list of my host experiences (not much)
Nah dude, I totally disabled and blocked most assets like emojis, and stickers off discord

Smart
as they're fucking annoying
I wanna block gifs
But, what I can do about it??
azure - free $100 student credit every once a while (not sure how frequently) if your school has a microsoft account for you or you apply for it
contabo - good specs for a good price (sus tho)
aws - 12 month free VM instance and other goodies (please remember to cancel before 12 months)
about all i have right now
any idea?
make sure your bot actually has access to the emoijs
bot have access
otherwise there would be no work on regular commands
I’ll add those, will make sure to put to remember to cancel
aws makes it very difficult to turn/delete resources off lmao
Yeah
so make sure to keep a track of them
They randomly charged £250 once
WTF
Luckily refunded because they admitted it was their fault
They counted bandwidth for something which I cancelled 2 months prior
im gonna start using virtual credit cards soon for cloud providers
google compute engine changed their free tier from f1micro to n1micro or soemthing like that, free tier went from 512mb ram to 1gb ram
but they didnt change my account
yeah they changed it
so they started charign me normal price for the f1 micro
Oh the fun’s of free shit
lmao
imagine paying more for less power
they also set the default disk to a premium disk which made me accumulate a 4 pence charge before i noticed
you dont care anymore if you're rich, sir
can someone send link for auctions

lmao
why hiding your email address?
that is scary
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
we will take care of it, trust us
im gonna double check my aws to make sure i deleted all of my free usage stuff
I get enough spam as is 😂
Nah seriously though, I get so much spam
honestly though a cloud provider like aws can easily fuck people over
even big businesses
charge extra and claim its because they had a spike in traffic
I've seen most hosts be generous about accidents whether by the host or the user
From a few hundred dollars to $48k because someone used your account to mine bitcoin
Ah shit ignore me leaking my non proxied addresses
lmao
should i just pay my fuck up or dispute it lmao
already uploading on 4 chan
dispute it
i mean its only 4 pence-
you should be petty about money
This is a good deal tho (an 8gb ram server and 3 2gb ram servers for €12 a month)
i'll dispute it then lmao
invest them in 0.00000000000000000000000000000000000001 bitcoins tho
i'll gamble my 4p bill in bitcoin
bitcoin totally crashed right now which totally means it will totally go up
which totally means it will totally go up
which means it will totally crash after again
you're just dead 💀
you dont know the way of crypto like an ambitious almost adult native person
you can't sell it if the value is high (enough) as nobody wanna buy it, and more and more governments are banning crypto stuff
that's how the world is
the average idiot thinking he can get rich by investing into bitcoin usually looses most or anything
that's how it is, dude
don't expect an OS dev to know things about the real world aka. realitiy


...
can I put array as type?
it seems obvious but idk
in my schema, in the cards: ```js
cards: {type: Array, default: {}}
ok
why is the default an object tho?
nope it's not empty, i just put it as example
Ah
it'll be like this: ```js
{"Giant", "Archers", "Minions"}
my bad
wouldn't even be a valid obj tho
Exactly
do I need to enable DIRECT_MESSAGES intent to dm a user?
cards: { common: {type: Array}, epic: {type: Array}
}
``` something like this?
no, is there even such an intent? i dont think so
You can create an object that matches what you want.
So in this case for mongoose you'll just say it's type object.
Outside of that (and probably your default) you'll give it a body with values.
There is one.
yes there is. but I think it only enables dm message event
yeah might be the case
ty
lmao, that's how development works
bug 420
I think mongodb is easy now
all the inventory (80% info) in a few lines
it'll be less in vsc, it's in replit's test bot
mongodb is king
yeah
but you need to neaten your formatting 😛
yeah
my eyes
well it's in a test bot
will make it better when passing to vsc
Can I add data to it later?
I have some things planned to add (chests..., i want to add them later in the profile not now
The callback doesn't get instantly called
at first asd will always be undefined
You should check if asd is undefined, and if it is render something else
can I?
Can I do something like giving a loading screen until the data comes in?
or pre-render the page and then polyfill the data in later
Is it possible to forcibly block on a promise as opposed to using await
block the whole thread?
yes
There was something cursed flaze sent where it used a while loop. You could hook in where it detects while a value is undefined
or spawn the logic off onto another thread. Idk if it offers a pause function
Actually that gives me an idea. So something like this.
function block(promise) {
let value;
promise.then((val) => {
value = val;
});
while (!value) {};
return value;
}
But then you'd have to block on that thread
why would you ever want to do something like this
flaz sent this a few days ago
for science
anyone knows docker and postgres
cuz im seriously frustrated lol
no point in me explaining the situation if nobody can help me
I know some postgres with typeorm but I don't know docker
Well
Actually all I need to do is copy all the data from one remote postgres server to another remote postgres server
but idk how to do that
And yes I searched for this online
But didn't find anything helpful
That would also work on windows
dumb the database and import it?!
HUH?!

just login as database user or root and export the database
how do I install pg_dump on windows
there's nothing to install
all of it as for any other database engine is already on board
Bruh wdym
you gotta hop into your bin dir, open a command prompt and call the pb_dump.exe yourdatabase > filetostore.sql
may requires you to authentificate yourself, not sure here
you will see
The postgres server is not on my machine
im trying to dump the data from another machine
you know
well you can also do a remote dump
if you're fully broken and have no clue, then use any app, login into your remote db and let it do the job for you, using the UI
Fine ig
it's quite easy to take a dump with postgres
How can you actually have no access to pg_dump?
is there a bare minimum postgres install option?
maybe it doesn't come with any plugin
there's a way to make a backup without pg_dump, you just get way less options to customize what u dump
I think like he actually has no ssh access to his database machine
tf
like, maybe u can disable dump for some users
getting my mongo hacked
but that'd mean s/he doesn't have root access
STOP GUESSING, HE DIDN'T TELL US

That's why I asked
How can you actually have no access to pg_dump?
just let him use any sort of phpmyadmin tool, navicat or however they're all called
how can i automatically get the userid from this message
@empty scarab Bump done! :thumbsup:
Check it out [on DISBOARD](https://disboard.org/server/886667952617844826).```
nodejs
Probably gonna use pgadmin
regex
ignore the fact i'm making a bump tracker - its specifically for private use to credit people for bumping
just get the mention?
Do you use discord.js or not
the userid is always in the same place
discord.js
and its in embed description
so its not a mention
is it not
I think discord.js has parsers for it
It has
pgadmin won't dump without pg_dump
well yeah, then stick with regex, without global flag
which means it takes the first result only
you should also cover the nickname mentioning format
<@USER_ID> and <@!USER_ID>
Actually nah I will use datagrip and use that instead cuz its a gui tool lol
its a jetbrains product btw
ik, its feature are also embedded on intellij
Im pretty sure datagrip can just install the binaries necessary to operate the stuff
not on remote
bruh
Well my situation is a bit more complicated cuz im using supabase
Which is a backend as a service
and the database is on there so yeah
Whatever im gonna ask in thier server instead
Cya

so in mongodb, $inc is increase, then $dec is decrease?
i just did message.embeds[0].description.split('>')[0].replace("<@", "")
ik its cringe
i also added ! removal underneath
lmao
even better
message.embeds[0].description.split('>')[0].replace("<@", "").replace("!", "")
even better idea: use substring and indexof so your eyes don't burn
my intention was to blind every dev
How about using match and a capture group?
const str1 = "@empty scarab Bump done! :thumbsup: Check it out [on DISBOARD](https://disboard.org/server/886667952617844826).";
console.log(str1.match(/<@!?([0-9]+)>/));
// Array ["@empty scarab", "798245188413816833"]
regex is slow
you're slow
and unreadable
you're unreadable
true
personally if it's in the same spot every time, the substring will do the trick quite easily
waff... wall... wuff.. fflee.... I CAN'T
nah who needs regex when you got big buns .replace.replace
just a random poll sorta: do you guys prefer jwts or sessions?
bruh i got ads in dms from a dude in this server
@fathom drift
fuck
can i just make a ticket somewhere or some stuff
contact some mod
import __prismaClient from '@prisma/client';
const prisma = new __prismaClient.PrismaClient();
async function main() {
prisma.$on('beforeExit', async () => {
console.log('disconnecting from database');
await prisma.$disconnect();
console.log('disconnected from database');
});
console.log('connecting to database');
console.time('connected');
await prisma.$connect();
console.timeEnd('connected');
console.log('connected to database');
}
main();
Console:
connecting to database
connected: 1:05.683 (m:ss.mmm)
connected to database
why it takes so long?
datbase is on the same server?
is a mongodb cluster
schema.prisma:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "mongodb"
url = env("MONGO_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["mongoDb"]
}
model User {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
email String @unique
name String?
}
I am redoing my portfolio and I want to know if this looks good (mostly speaking about the tabs up top) I want to know if the tabs look good or if I should just go with a typical nav
I like it
The UI looks fine imo, except for the white bar at the top (but that's probably not intentional)
Though you could fix some of the grammar, like capitalizing "name" in the title and specifying what kind of developer you are
nononono, Typing Like This Is A Serious Issue
just lowercase "My" and everything is fine
That's how titles are written
no
At least formally.
No, titles work like that too.
They could make the "My" lowercase if they wanted.
But formal titles use lots of capitalization.
my should be lowercase here though
uppercase letters are only used at the start of the sentence
or in names
This is about titles.
not sentences
If I ever become an English teacher and see a student write "Hamlet's fight against Denmark" I will immediately fail them.

And in titles where every word starts with a capital letter
Can bots use other bot's slash commands? For some reason, it's a permission on the developer portal.
Err no only clients should be able to
By storing the timestamp when somebody votes
If somebody runs the command again check if 12h are already passed
thankyou for your answer
yea I already fixed that
https://lynnandtonic.com/ okay so this is pretty cool
@lyric mountain So apparently klay is either correct or every dev site i've seen is wrong cause a lot of people do it like "Hello My Name is Mistyy"
I guess it comes down to preference
yeah
this looks better
and are a beginner frontend dev
Did you just change the spelling or what did u change
I see
Besides what is it that you are working on
Just a portfolio website or something?
What u making it with
Nextjs + Mantine
Im always interested in website development so thats why im asking
Yooooooooo
It really is
import type { NextPage } from 'next'
import {Container, Tabs} from "@mantine/core";
import About from "./about";
import Home from "./home";
const Main: NextPage = () => {
return (
<>
<Container>
<Tabs grow position="center" variant="outline">
<Tabs.Tab label="Home"><Home /></Tabs.Tab>
<Tabs.Tab label="About"><About /></Tabs.Tab>
<Tabs.Tab label="Projects" disabled>Third tab content</Tabs.Tab>
</Tabs>
</Container>
</>
)
}
export default Main
This is the entire "home" page
I personally love that I can just easily configure a primary color in mantine
It is how I display the content of different sites
Thats kinda what I wanted in other frameworks as well
I probably shouldn't be doing this as it doesn't change the url to that page it just stays on /
just like a single setting to change the primary color for everything
Yeee
My idea for mantine is to use it to make like a google docs
I started messing around with mantine earlier, I like it but I have almost 0 experience with frontend frameworks so I still need to learn how react works in general
Same
I barely have any experience with react
Or actually web development in general
what's that thing called when your app is fully rendered on the client side
Never really looked into it much but I wish I did
I think it starts with an s
Shitty?
Server side rendering?
no but a good description of it
that wouldn't make sense though
no not that either
I have 0 experience with react really I just know some stuff based on what i've seen other people use
It’s called “something” 
I don't use mantine with nextjs lol
You should
nextjs is a bit overkill imo so I just use vite
how is nextjs overkill?
Vite is pretty poggers
So I assume you don't use react all at do ya
If im just trying out mantine I don't need a full framework like next.js
Isn't vite a vue tool
I want to go back to writing websites that receive all their UI and data from the server
Ah I see
vite is a tool for anything ngl
I heard it was a vue tool
but there was this really interesting paradigm someone brought up in a video about the differences
Imagine going back to the basics and write all code yourself instead of using frameworks 
Vite can be used in vue, react and also svelte
I still want a framework, but all the client side rending and handling has been cancerous for me to try getting right
History API, reloading, state management, security, etc.
I feel like if im just trying out mantine I don't need to use something like next.js
Besides im not doing anything on a production level
Thats all
I wasn’t speaking about JS at all my gosh
What has php to do with frontend
But sure if you wanna use next.js go ahead I aint stopping you
Wtf is wrong with you
I personally just prefer vite
what's wrong is I can't remember the word I'm looking for
Single Page Application?
YES THAT
Lmao
Tell me the word and i will remind you
It is what I currently do with my old portfolio
yes that's what's been giving me a pain
How come?
this #development message
I was also looking for this video https://youtu.be/860d8usGC0o
that link looks sketch /s
Video ads you genius
ublock origin 😏
Something is wrong with you
I can still block ads in videos
brave does it
You just have to ask it nicely three times and click ur heels as well
That’s for plebs
NoScript is what you use
And a pihole
That’s no network wide solution
No but it is a solution
It’s nothing
i haven't been able to get pihole to block video ads, thats why i use ublock origin on top of that
Shhh… you’re too young to understand how the internet works 
Fake has been around since Pangea split
lmao
I only ever saw everything titlecased when it was real titles, like movies or books, where the title is actually a name
it looks VERY weird on anything else tbh
This works, but how do I add a line break?
\n
ok tyy
guild.systemChannel.send(`Hello, I'm Universe List. Thanks for inviting me! /n test`)
like that?
no
that will put "test" on another line
ok ty!
oh, sorry, u need \ not /
guild.systemChannel.send(`Hello, I'm Universe List. Thanks for inviting me! \n test`)
He could risk something, doing something totally crazy and use uppercase on the whole line 
how can i use emojis and other things for github readme?
windows + .
my discord bot sends this message: Use the command -help to see what I can do!
isn't it supposed to?
How can I make the -help in code blocks
without breaking the bot
```
text
```
and "without breaking the bot" makes me worried that u don't know what ur doing
I'll show u what i mean
guild.systemChannel.send(`Use the command -help to see what I can do!`)
thats the code so far
so?
but I can't add double ` inside that code
look, so can I do:
guild.systemChannel.send(`Use the command `-help` to see what I can do!`)
would that work?
Escape it
no right?
how?
ohhhh ok ty
use 👏 "
or just do js guild.systemChannel.send("Use the command `-help` to see what I can do!")

that's what I said
What she said?
Might not be the best idea tho to send a message into a random channel even if it’s supposed to be the system channel
my god awful wifi says ur welcome
Are you on crack?
nah
sorry I was fixing it
I didn't know what channel I should send the welcome message to tho
I wouldn’t send a message at all tbh
But that’s up to
Don’t forget to check if you actually have the permissions to send a message at first
mhm the bot has the SEND MESSAGES permission
And if a system channel exists anyway
Doesn’t mean Someone inviting your bot also grants him that permission
true
When coding you always need to try to cover any possibility
ok, that helps me tysm
MongoNotConnectedError: MongoClient must be connected to perform this operation
but
mongo is connected
ah it works now
magick
if i make my slash command multi guild and wait an hrs to test the cmd. and change the slash cmd do i have to wait another hr to retest the cmd
you can specify a guild id when creating a slash command to test it instantly
yea ik that but just asking
if the cmd is already registered do i have to wait hr to test it
no? You can specify a guild id like I said
for testing
if you're for some reason testing in production, then it may take up to an hour for global slash commands to appear
but just specify a guild id and your changes will appear instantly
Updates on commands are mostly instant but no guarantees on that as I experienced delays my own already
ik i'm doing that. when i publish my bot globally and change code do i need to wait hr to use that cmd
This ^
You shouldn’t need to change your code very often in prod anyways, only for updates and bug fixes. If it’s a severe bug then take your bot offline and fix the issues before putting it back up
aight
It depends. The 1 hour cooldown is only really important if the command doesn't exist beforehand or if it exists but hasn't been refreshed.
It can take up to 1 hour, but it doesn’t always take that long
In the case of the latter, running the command should trigger an error for the user, but reappear and work just fine the next time.
Discord is usually pretty fast with it now, but it’s not guaranteed
Im wildly guessing any guild does frequently do updates (with Discords backend) - in this case every hour - based on its creating date, in order to that not all guilds do backend requests in the same second
If you luckily register your command close before that update happens, I guess that’s the case it doesn’t take an hour
Wut?
message.users.cache.fetch(args[0]) is not working :v
message.users ?
No
i mean i wanted to use id instead of pinging them, like ?message <id> <message>
You wanna fetch an api user?
Yeah and you wanna fetch that user by its ID after?
Is the user a guild member or just a random discord user you wanna fetch?
guild member
ye?
Oh a guild member
Wrong link then
it’s guild.members.fetch(id) then
There we go
Ill look for it thanks
what is wrong with this
const commands = [];
const commandFolders = readdirSync('./slashCommands');
for (const folder of commandFolders){
const commandFiles = readdirSync(`./slashCommands/${folder}`).filter(files =>files.endsWith('.js'));
for(const files of commandFiles){
const command = require(`../slashCommands/${folder}/${files}`);
commands.push(command.data.toJSON());
}
}
err is
commands.push(command.data.toJSON());
^
TypeError: Cannot read properties of undefined (reading 'toJSON')
command.data is undefined
Why would You actually push that as JSON to an array?
What do you wanna archive?
that code is just to have subfolders inside of the main folder like slashCmd > moderation > ban.js
@boreal iron sorry for ping, but there's any documents for set-config? for channels instead using name or id to set?
idk what it does it was in discord.js guilde to make slash cmd
https://discordjs.guide/interactions/registering-slash-commands.html#guild-commands
as it says in the guide, that code is to register slash commands
also as it says in the guide, it only works if your command files are made exactly like the command handling part of the guide says
more specifically, it requires all your commands to have this
your error basically means that you have one or more commands that do not have the above structure
aight thx
huh
The data of the example above simply is an object, you can write yourself instead of using this ugly, shitty, dirty, useless, … builder tools
data:
{
name: ping,
description: "Replies with Pong!"
}
That’s literally what your data is after using the useless builder tool
Wdym?
like ?set-channel for curtain command
Oh you wanna create a set-channel command?
Does it create a channel, move or edit one or …?
hello
You gotta be quick… going to sleep in a few minutes
no no, after using set-channel, only there can use the commands of my bot
waifu.pics 
Damn I havent been checking on the stats for that thing in a long ass time, it got this big?
I should update it
lol
Sorry I don’t get it
You wanna overwrite the channel permissions?
Is that what you mean?
pretty sure they are saying that bot commands would only be usable if they set that channel
to prevent the bot from being entirely useless for events using channel perms but also preventing bot spam
I feel like he wanna set a channel the bot is listening to exclusively
(for commands)
@bright hornet
Is that what you wanna do?
yep
Well once somebody runs the command, you verify the channel he mentioned, then put the channel ID into your database (associated with the guild ID)
After that you create a property for this guild defining the channel the bot should listen to
(e.g. guild.commandChannel = channel_id)
On an app restart you read the database and update the guild property
Once somebody executes a command you gotta check if the guild property commandChannel exists and if the current channel matches the one defined in the property
Sounds complicated but is actually pretty easy
Damn that is pretty cool!
That project looks rather interesting I was just looking at the waifu-api repo is that all the code for the api?
If so I am interested in how it all works as I am limited on my knowledge of go and I haven't really made many apis in it so I am curious how you're actually serving the files
yep, hasnt been updated in a while though, was thinking of rewriting it soon to add some more stuff like custom image lists and exclusion lists and all that
with optional custom tokens
I see
Im uploading the images to S3 and serving it through the S3 api
Ah
So go uploads to s3 and cloudflare caches it so i dont pay for 20tb of traffic monthly
kek
so yeah its not very expensive to run, 8$ a month?
Go very fast and scales on multiple threads so I can run it on a VPS (contabo since high spec and cheap). S3 is handled by S3 and uploads are the only thing i pay for
Didn’t you already cry about a 5$ vps today 
Since downloads are cached by Cloudflare after one time and discord auto caches images too
That wasn't me
That was someone else
I haven't talked here much today
lmfao
Ahh nvm then, I’m old
anyway if i was to write waifu.pics today I would have used rust
Go is a little funky structured
At least I remembered something
Ah, that is pretty sweet
I have been looking for projects to try and contribute to (with my limited knowledge of course)
https://github.com/JSH32/Backpack this is a project im working on now
Although its kind of... not a starter project. Its based on the similar things as Waifu.pics but selfhosted and not for public image serving
Yeah its like pomf or lolisafe (bad name) if you have heard of it
basically screenshot tool uploads to it or its like anonfile but with accounts
Ah, nah I have never heard of them sadly
waifu pics is an interesting project though
yeah i need to update it since popularity
Is the entire service just user's uploading their own pics to it?
people upload pics to it and it goes to dashboard for me to sort through or approve
i need to make a thing that says that since lots of ppl get confused
no way in hell would people keep the upload box free from garbage without manual veritifcations 
Ah I was thinking how you'd manage making sure someone doesn't mark a nsfw as non nsfw
Yeah i look thru it. I also make sure that nothing is like nekos.life with the loli pics and whatnot
Are you the only one who does verifications?
yeah, not many uploads come in surprisingly
every month or so i get 150 images total
Oh god I stopped using nekos.life recently cause I found that
I still have yet to remove it from a bot im using it in tho
yeah this was created because i had a huge discord bot project i was making before that i gave up on (i got tired of discord bot dev honestly) but i made waifu.pics for this reason
nekos.life too much questionable content
first it was written in shitty js code overnight but i rewrote in go later so it could serve mass requests to the public
I am also getting tired of discord bot development and am trying to find projects I can contrib to so I can further my experiences
try making some sort of content management system, a basic one
like Backpack is meant for files and pastebin like stuff, but you could do articles too
I don't really want to make anything of my own since I don't have money to spend right now
Which is why im looking for projects I like to contrib to
what does money have to do with it? Writing code is free
Well yes but I wouldn't be able to host any of it
Ah, here its like 12 (US)
I was going to suggest oracle cloud, it gives you two free intel VPSs running with 2gig of ram each and 1cpu core
12?
Yeah
What state do you live in
Illinois
Cause here in Washington it is 18
:^)
Unless I have a legal guardian sign off
and I don't trust my dad with access to my money
it gives you 4cores and 24 gigs of ram which you can split 4 ways how you want
Ah fair enough, difficult situations.
I hope you have physical money saved up to put into your account then next year
Nope
My dad got my social security card stolen so I can't get a job
I am as broke as a joke rn
And due to covid I can't get an appointment to get a new one
as in he stole it or it got stolen from him?
I see I should sell my unused system resources to < 18yo dudes
It got stolen from him
Taking their soul as payment
Have you tried calling social security administration?
I will give my soul :)
Indeed
They put me on hold for an hour and a half and then hung up on me
this guy needs an identity theft lawyer not server space 
twice
I've decided I will just have to wait a bit cause I can't ever get through to em
Either way it doesn't stop me from taking online gigs like bot dev (ew but whatever)
Or somebody who doesn’t care about his personal information but about his money
I still have a paypal and a cash app my dad gave me
so I have two ways of storing money
Gimme money and I will create a vps with the resources you need, I got too much unused left
Welp it sucks I am broke
I have an old laptop that shuts off if the screen is placed wrong
If I open it too far or too little it shuts off
Cool you got a server
Aye
I also have some server space my friend lets me use but I can't host anything major on it
Only a website or a bot
And bots are what I wanna stay away from
I’ve got quite a lot of resources left after upgrading it recently
Nice
@zinc condor should I continue studying go to make fast apis or should i just say screw it and keep using ts
do whatever you like, theres Go, TS, Rust. All of them are super in demand
Mmm I was just wondering what you'd suggest
Web APIs wont go away so either way you are set in terms of skill
thanks tho
Well, TS is the easiest and is clean
But at a certain point it will get slow wont it?
Go is messy as fuck till you get used to it but its really fast
Rust is the hardest but it makes extremely clean code
So, TS is a bit weird here
V8 which runs JS code (which TS compiles to) is a JIT compiler and concurrency makes things run fast
Its the slowest out of the 3 (slower than Java too, its a misconception that java is slow, minecraft is just written like garbage) but its still incredibly fast
I see
So I am fine using typescript for a good while before I would notice any performance issues assuming I wrote my code properly
the only performance issued you would notice are if you write games or threaded code
Ah I see
Most languages have multiple threads which lets you do two things at once but JS has one actual calling thread for anything other than FS/HTTP tasks
how you write your code matters much more than which language you use
so promises or async functions you make are still run on one thread. Its just that waiting for http requests runs on multiple because node or chrome runs separately and resolves promises
many people write shit js code then blame the language for being slow or bloated
actually, JS is optimizing after multiple passes so most people blame the language for being slow when its not even slow in the first place
Unless they just write stupid code, then their code is written to be slow
Not only shitty JS code
and people take npm modules as the standard, while tons of npm modules are actually garbage
But yeah one benefit to compiled languages or even Java over JS/TS is multithreading, which does theoretically exist in Javascript for IO tasks but doesn't exist anywhere else
Which is why a JS based game engine doesn't really exist in big games outside of simple scripts
Lua does exist in that world because LuaJIT is almost as fast as C, its quirky for scripting
well for a game engine you wanna access the gpu more than anything, so you need langs that can do that, js is too abstracted for that
Mmm youd be surprised, the only API you need to render to the gpu is OpenGL or vulkan
Node to JS bindings exist for that already
Thats what everything is based on and thats all you need
yeah but its an extra layer of abstraction
calling native code from js is not cheap
True but abstraction doesn't matter as much anymore, CPUs are fast and its cheaper than you think (ive embedded V8 in programs before, lots of misconceptions about JS)
In fact, it would be pretty easy to make an engine in C++ and define scripting API for entities in JS, its just usually not proffered over C# or Lua
The reason a pure JS game engine cant exist easily is because you need many threads to handle many things. Like physics cant be handled on the main thread
that will absolutely kill the performance
Although, you could get around that by making bindings to a physics engine in C++ that uses threading and resolving promises, just like IO in JS, but doing it natively in just Node is impossible
In fact getting anything on the screen is impossible without C bindings
that goes for any scripting language
What are your opinions on using a framework like nestjs for apis
Do you think people should use them or just go with just something like express, koa or fastify
Nestjs is very nice
It simplifies handling for Middleware and auth with recievers. here in rust with actix we have the same thing and it's hailed as a design choice
From what I've seen nest is both light while giving you features of swing routing so I'd use that
Plus nestjs uses express under the hood
Well OK scratch that
Updates made it use fastify
Yeah
So we are the same you dont see it as a bad choice to use in production apps?
they are not bad choices, but at the same time they are clear examples of npm useless bloat
you can easily make a good webserver using the built in http/https/http2 and it will pretty much outperform all of those npm modules
its basically convenience in exchange for performance
there are plenty of examples
require("http").createServer((req, res) => { ... }).listen(port, cb);
It builds on top of the native http APIs. the scripts are small enough that the performance difference will be so little
If you really cared about performance you wouldnt use JS or any scripting language for that matter, you would use Go or Rust
As for performance bloat, I agree, dont use modules for everything, only when it makes sense
try it, you'd be surprised
I use Rust with actix, nothing will surprise me anymore, 1ms response times on localhost
Fastest framework I think is Drogon for C++ with some other ones in the middle and then actix is #3 top speed
i mean, you'll be surprised just how bad npm libs can be compared to doing it yourself
Well its true for a lot of cases, nestjs is not one of them
a simple example is the well known ws package for websockets
its pretty much the standard
until i made my own websocket using net and it turned out to be 10x faster
many of "defacto standard" libs are just not good enough to be considered standards
maybe so, i stick away from Node for server apps
My primary use case for JS/TS is frontends and simple apps I dont deploy anywhere outside of personal use or scripting
or embedding
https://github.com/diatomfn/tranquil did a whole thing on that actually
replaced it recently with ivm native portion
yes, my point is a lot of issues with js are blamed on the language, when it should be blamed on the ecosystem
yeah
send help
interesting choice in theme
my fingers are on fire from remaking my typings package for the past 5 hours
theme is called sweet.
icon theme looks realy nic
probably just the icons though
Im not as smart as you to make my own stuff
:^)
I still don't even know how websockets work when making a chat app
https://i.kawaii.sh/yHAouz-.mp4 rate webdesign
decent
i saw something suspicious
very cool
took two years to finish the UI because im bad at UX and i kept project hopping

then did a rewrite of the UI in like 2 days
looks pretty damn good
sussy indeed
do you see that vent on the floor?
the vents in the roof wym
You need to understand that not everyone is as skilled as you

I just make my own scripting language with threading and http library
is that pure css?
wasnt very fast, did it for experience
used chakra + react with customizations
the pokemon?
no the react comp+hook lib
Is it possible to manually launch 2 shards instead of setting it to "auto"?
feels very teleport-y
but looks nice
you give it the amount of shards you want it to spawn iirc
oh this actually looks nice, might use in future
At 1,060 servers, how many shards should I be launching, supposedly?
1
What happens if I launch 5, let's say?
Waste of resources
Meaning?
At max launch 2
its not about people being as skilled as me, its about library developers being conscious about performance
mf i wish i knew about this like a week ago
im not rewriting again
Doesn't sharding decrease the use of ram or?
It increases the amount of servers the bot can handle
at huge amounts of guilds yes but not at all for small number of guilds
^
if you have a really big bot sharding lets you split the workload to multiple physical bot servers
I did it with my old bot
Can I manually launch 2 shards at 8 servers, the testing bot?
One program would connect to get shard count and split shards on multiple servers
I wish I had a bot that was somewhat successful then I wouldn't feel like i've wasted 4 years
idk ask tim(othy)
anime bots get big, use anime pfp
sure you can
I will use waifu.pics :^)
you can launch 9999 shards with 1 server
*1 tnt cannon
do you mind if I launch u?
lmao
well yes, but only one shard will be doing anything
You cannot launch tim with one server
WAFFLE WHEN TF ARE U GETTING BACK
actually i dont think it will slow anything down since still only one websocket
I was home like 3pm-6pm but I was tired so I took a nap instead of doing react with you 
no errs but the / cmd is not registering
I've been sitting here waiting
Yeah I would’ve but I fell asleep
yeah its great for testing, you can launch a single shard with only your guild in it, logs in super fast
😔
Ti-Ti-Timo Timo, Ti-Timo Timothy~
Now I’m at a friends house watching them play fucking super Mario bros on the wii
Hi shiv my precious brother
Hi bro
That sounds boring
It’s fun
w- wil-will you switch to python senpai
Nah it’s fun
Do you ever get the urge to slam your hand down on a thumb tack?
No
shivaco is that you?
senapi
span ei
I was typing fast
stfu
the "fuck up" is now sad
I will come to all ur houses and eat your bread and leave only the end pieces
You never know
why did you shut him
Jokes on you I don’t own bread
no errs but the / cmd is not registering
You radiate python energy
You're clearly shivaco
I don’t own bread because I can’t eat it lul
pythonk
I radiate the gay also
Sorry but we don't help here we talk about gluten
ghey
Precisely!
the channel name is development
lol
lol
Im kidding ofc, have you made sure the bot has permissions, reloaded the client?
Sometimes it can be a visual bug
the bot has permission
Try reloading the client
what u mean by reloading
Are they global slash commands or guild commands?
guild
Try checking in the bots dms if slash commands appear
If so then they might not be loading properly in the guild
Can you show how you're loading the commands?
Did you invite your bot to the server with the applications.commands scope?
you're not actually putting anything inside the commands array?
just to make sure
@quartz kindle waiting for the day when you at me with that Discord compliant ws module that's tons faster
Already did a gateway v10 update D:
i mean, its been on github for months
This ^^^^
yea like tim said commands is an empty array so it wont load any commands to begin with
Standalone?
Yep
this is what it is showing
commands.push(command.data.name, command)
^
TypeError: Cannot read properties of undefined (reading 'name')
Doesn't push only take one prop?
yes no but what's wrong is that command.data.name
command.data still doesnt exist
Looks like it's command.name based off what you sent
its not standalone as a websocket, its standalone as a raw discord shard
is it tiny-discord websocketshard?
ye
tim you're still working on tiny-discord?
Oh Tim my bot uses djs-light in production now 
kinda, there not much left to do with it for my use cases at the moment
