#development
1 messages · Page 1854 of 1
https://cdn.discordapp.com/emojis/<id>.<extension>?v=1
I didn't know emojis had ids
yes and how do i get the extension with only the ID
The extension is up to you.
png/jpg/gif
but to pick between a gif and regular you'd probably need to fetch it
In the hash, you can tell if it's prefixed with a_
You'll need the guild ID as well. https://discord.com/developers/docs/resources/emoji#get-guild-emoji
still im having trouble with this, now i've got another issue
Or if you are using discord.js you can just get the emojis from the guild object
and access the cache of the emojis and use get
const formData = new FormData(form);
function send(event) {
console.log(formData)
event.preventDefault();
fetch('/guilds/<%- id %>/general', {
method: 'post',
body: formData
}).then((data) => data.json());
}
``` why is `formData` an empty object?
which has the guild id
why
Yes but
maybe the bot is not in that guild
you can just access emojis on the guild object and access its cache and get using the emoji id
in the form i am entering data
Then how do you expect to get the emoji
if you have the id then you can form the url but you wont know if its a gif or not unless there is another way
Then what is the point ?
gitting the url of an emoji with the id
I dont see a way to actually get the emojis extension or not
Guess he wanna use emojis from guilds his bot is not in
Its for a command that makes the emojis into images
i know a lot of bots that do that without being in the guild
png/gif they get it right
I wonder
Thought you can only fetch these things if you’re in the guild
typically to get the id you'd have to go through the guild
what
am i a joke to you
In the browser it plays as a gif without an extension
but if I post it here it dont wanna be a gif
😢
the parseEmoji has a .animated option
Is what you are trying to do copy the emote and download it to your guild?
If so, use the url they give you to download the emote upload it to the guild and then delete the emote from your system
it wont matter then if you can form a url or not
thids
any ideas? #development message
message.guild.cache.members.size is what i have now
not sure whether that is the right approach
uh
no
not at all
you have the cache in the wrong spot
<Guild>.members.cache.size
I'm getting a 403 error when trying to get a user's avatar to put on a canvas, but it works fine if I just want to use it as an embed thumbnail. Any ideas why?
How are you getting the users avatar?
I don't think it has anything to do with the code
My commands with canvases and avatars just stopped working and it's across all bots on my VPS
Mm possibly not, could just be discord being weird. But I don't get why it would return a 403 for that
403 is forbidden access right?
Yeah
Indeed
Maybe your authentication is wrong?
Well if its in a bot I doubt this.
It's a bot
It would use the bots token which is valid
unless the token regened but then you wouldn't even be able to run the bot.
I'm either using displayAvatarURL() method or https://cdn.discordapp.com/avatars/${trib.id}/${trib.avatar_slug}.png
On a canvas
Erm
But if I use displayAvatarURL() in an embed thumbnail it works fine
user id
and trib.avatar_slug is the avatars hash?
yeah
It's not a problem with how the URL is formed
It's a server error somewhere between my VPS and Discord
Yea, I am just making sure .
It was working fine until like an hour ago and I hadn't touched the code in weeks
I was wondering if it was a rate limit but it's not
I don't know then.
I haven't heard of such a thing happening if I am being honest
does anyone know how long a bot has to be offline for before they remove your badge?
My bot has been offline for months and I still have it
i don't think they remove your badge
I hope they don't
yeah I am having the same problem
Could be discord.js fucking smth up or discord is being weird today
How are you trying to get it?
noice
Well mac there is your answer
discord did fuck up

Oh thank god
discord giving is more reasosn to move to guilded 
No matter what discord does im not moving to guildede
If anyone sees any issue with this let me know, I still haven't received a response from anyone of the repo https://github.com/discord/discord-api-docs/issues/3703
I would make my own platform before that happens
me neither its a joke
I know
That'd be fun tho
but I will make a discord clone before I move to guilded
Making ur own platform
Indeed
Which is why can you press CTRL SHIFT I for the dev console and tools
its basically just a browser for a single website
Oh well I'm gonna wake up early tomorrow and make a discord clone too kekw
It'll be fun
isn't it like a pwa basically?
what is pwa?
I just recently started getting into it heavily
Why don't stores like microsoft stores or apple store just accept pwa as apps
progressive web application
pwa are the future imo
I have no idea what that even means if I am being honest
I need to learn alot of web dev terminology
As a great man once said anything that can be written in js, will eventually be written in js
So ig its just a matter of time untill I will stop needing to walk to the restroom
kekw
can anyone reccomend a serverless database?
yes it's only less scalable tho
what?
that doesnt make sense
It will work ig
But its not really meant to handle that kind of stuff
You'd really wanna use something like ig mongodb or a variant of sql, like postgresql, mysql, etc
I really hate the hacky localhost head layer that most DBs have, mongo included
I want a headless serverless DB
no overhead
aka sqlite
depends how large
Yea
I dont get it, is there NO large scale DB that runs locally 😒
it should be able to handle 50k+
you can run pg locally ig
postgres
most dbs can be run locally
ok.
typically you'd run it on the server your bot is hosting on
yes, but you must connect to them eitherway
and connect to it
yes
that just looks so messy and hacky
Not really
seems like a load of shit to me
because thats how you make it handle that much concurrency
why would you need a server layer
only to connect to it locally
its useless overhead
even if its fast
its still overhead
?
yes, but its easier than a hacky ipc solution
besides, they can run on unix sockets
which is faster than tcp
so should I use PostgreSQL or SQLite
sqlite is embedded inside your process, it lives with it. which makes it extremely fast and low overhead, but its limited to your process, therefore multi processing it is not as easy
the rest lives in a separate process, which is why it needs some form of communication
if your app runs as a single process, go for sqlite
isnt that what threads are for?
not exactly, threads require some sort of shared context to be good
I thought the point of DBs is that you can handle more than 1 request at the same time
up to hundreds or thousands at the same time
also depends which language you're running, as threading is very different from language to language
most server dbs are multi-threaded by default
they are focused on "accepting multiple clients" rather than processing multiple requests
because dealing with clients and connections is more expensive than actually executing queries
I still dont get the difference
both PG and SQLite are multithreaded
and can take more than 1 request at once
what makes a local DB worse
like
whats the difference
sqlite is not multi threaded by default
it lives inside your process, so you can make it multi threaded if you make a multi threaded process
as long as you respect its limits
.-.
RIP
Guess Im using PG
my nodejs instance is single threaded
atleast rn
then use sqlite
if you have a single process, use sqlite
and then what happens if someone executes commands at the same time .-.
am I just screwed?
your process executes them sequentially
so
I want to make a command thatd update the DB
so if I use SQLite
itll just... work?
even if people are using it at the same time
in most use cases yes
it covers the lack of threading with the speed advantage of having no network overhead
because Im planning on scaling this bot up quite a lot
therefore most queries will be faster than a server db query because of network overhead
sqlite has an option called "WAL mode"
what does that do?
and also an option called "synchronous"
which you can disable
in wal mode, database writes are writted to an in-memory file first
and only written to disk in batches
meaning writes are as fast as your ram
Question is cassandra free?
so is that more fool-proof then just good ol' original settings? atleast for very large scale projects?
and with synchronous disabled, sqlite will give the data to the operating system, and let the operating system write it, therefore imediately unblocking your process
WAL mode + synchronous disabled makes sqlite stupid fast
but again, is that viable for large scale projects
the only limits are HEAVY write usage
for example writing several megabytes of data per second
Im talking thousands, maybe tens/hundreds of thousands of requests
can it handle that?
my host system is incredibly fast, can write 3.5 gigabytes in 1 second
its a set of high speed SSDs
alrighty, I guess Ill use SQLite
now I gotta figure out how to change those settings
how much will you write compared to read?
probably more writing then reading
reading will be cached anyways
and only updated after some time
or enough changes
Also sqlite doesn't support alot of datatypes
well, you will have to test your use case
wdym?
all Im really using are strings, ints and booleans
but if you run a single process, there is really no advantage on running a server db
SQLite only supports: Blob, integer null text and real
what..
if you're gonna scale into the thousands like you say, that implies scaling your process to multiple processes as well
If you ever need to use a different datatype you can't use it is what I'm saying
once you get to that point, a server db is better
whats a "real"...
I moved from sqlite to mysql btw
a real is basically a float/double
it's a "real" number
text is simple enough, imfact I can write booleans and floats as text if needed
oh, reals can replace floats then
ok
thats fine
I only need those 3 types
NULL. The value is a NULL value.
INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.
REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number.
TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE).
BLOB. The value is a blob of data, stored exactly as it was input.
can I write to it like a key/value system, similar to JSON?
so like, I can store an array of values for a player ID?
Also once your database grows and becomes rlly large sqlite will use alot of memory
you will have to serialize it
That's why I switched from sqlite ot mysql
actually, sqlite does include a json extension
whats a database that does support arrays / key-value systems
itd really help to easily read and write values
and organize them in a way thats simple to understand
# Disadvantages of SQLite:
- Lacks user management and security features
- Not easily scalable
- Is not suitable for big databases
- Cannot be customized
oml why does there have to be a million different DBs
I just wanna store damn data from my damn discord bot thatll scale upward for really large bots
.-.
Any database supports key value as long as you sterialize the value
If you want scalability go with server based ones
sqlite doesn't scale well
I use mysql
If you don’t necessarily need to store plain array and can live with to serialize things SQL is a pretty good choice and scalable as well
isnt postgre also serverless like sqlite
no
I'm pretty sure github uses mysql no?
guess everythings falling back to mongo and postgre
pg might be the easiest to go along with
idk
mysql is like microsoft
pg is hard but powerfull
so what do you reccomend for me
another option is redis lol
between mongo, pg and mysql
which one would be best for me
simple, fast, scalable
isnt redis used for caching?
If you wanna use MySQL then choose MariaDB
can be used as a db too
why
I just use MySQL
plain old mysql
What a question…
Because MariaDB is maintained by its owner and not thrown away like Oracle does
how big is your bot rn?
The more u know
I think the better question is how much data do you need to store
Its not large server-wise, but its a private utility bot that stores a LOT of data, and is updated / read from constantly
Not really as most databases can handle big data
@boreal iron Is it easy to convert from mysql to mariadb?
they are like 99% api compatible
It actually is yes
Just google about the advantages of MariaDB compared to MySQL and how Oracle is going to ruin anything they own
well i can tell you my experience, although my use case is different from yours
i have tried mysql, mongo, redis, postgres and sqlite
I would say don't go with sqlite if you want scalability
and sqlite was by far the best one for my use case
my bot is at about 9.5k guilds
holds about 30k rows of data in the db
queries take 0.1ms on average and uses almost no memory
I’m storing a hash table with currently 799GB of size with exactly 4 billion rows.
It’s been queried ~ 1000 times per minute with a average response rate of about < 20 ms
I can’t complain unless your Database is not optimized for what you wanna do
honestly everything I can find online keeps going back to Postgre and Mongoose/MongoDB
so I dont really know if I can choose anymore
I might just get mongoose and got over myself
I mean you could always go to scylla
if your data is heavily json-style including nesting and such, mongo would be a better fit

although pg supports json, its natively a table-based system, like all other sql dbs
I mean I use mysql which is also table based but I use keyv so it's key value like json
yeah, thats probably the best choice, I really dont like the messy localhost server thing, but at this point Id rather get started working on it, and get it functional before the end of the night, rather than waste 4 hours finding which one I want to USE
does mongo support domain sockets?
no clue
At the end you can switch anyways if you don’t like your choice
it does
what is a domain socket useful for anyhow?
switching isn't always easy
After storing the data, there isnt really an easy way of going back
Even if that might result in manually writing scripts to transfer your data regarding compatibility
I have a chance right now to rewrite my entire bot for support with DJS 13
so Im taking this chance to restart
use an actual DB
Exactly what I did yesterday
wdym no way of going back?
unix domain sockets are a communication method that uses a block of memory to share messages between processes, instead of sending the messages via the network drivers
my servers are logging specific data that is really quite anoyying to write again
and converting databases would cause all kinds of drama
If you need to you can just read all data from one database and write a script to write it in the new one
Yeah understandable but still possible
didn't discord go from mongo to cassandra?
didnt they always use cassandra?
Err yes and no
but isn't scylla built on cassandra?
Discord went from a fork of mongo to scylla
like with API
and no scylla is not built on cassandra
Well idk how to explain
scylla is a re-write of cassandra in cpp using async IO
that's what I meant
mongo was a long time ago
The original version of Discord was built in just under two months in early 2015. Arguably, one of the best databases for iterating quickly is MongoDB. Everything on Discord was stored in a single MongoDB replica set and this was intentional, but we also planned everything for easy migration to a new database (we knew we were not going to use MongoDB sharding because it is complicated to use and not known for stability). This is actually part of our company culture: build quickly to prove out a product feature, but always with a path to a more robust solution.
kekw same thing
I mean hey, they used mongo's best feature, fast developing
unfortunately they got hit with mongo's worst feature
scaling
or lack there of
well yes and no
u like ur yes and nos don't u
is discord still using scylia right now?
I would probably stick to mongodb regarding the stuff you wanna store.
You said u need to rewrite the whole bot for djs v13 anyway
Yes
Sqlite un-ironically is more powerful than most DBs around
explain.
You will have to rewrite it for djs v14 again anyways
scylla* and yes
not really
I cant find a nodejs package for it
thats what I said..
15/month
:3
these databases like scylla and cassandra are focused on extreme scalability, meaning they are only good if you are actually sharding and replicating your database across multiple machines
sorry i meant isnt*
They're also highly specialised at target retrieval, they are far more optimised for writes than reads
mongo should be fine
Amen
if you do become as big as mee6 and shit u could always change
That's why discord used it
As I said you will have to rewrite anything on djs v14 anyways and will then know if your choice was a success or not
its more that Im just logging indefinitely large amounts of data back and fourth on a few servers
its more for a web project then anything
so its less scalable for guilds
there isnt a single solution that can handle all scenarios, you will always need to migrate at some point
I still don't get what u mean with "logging indefinitely large amounts of data"
- Memory tables
- Shared process tables / databases
- Temporary file databases
- Standard file databases
- Dynamically loadable extensions
- Adaptable query handling
- Deployed on almost every system around
- Fully embedable
I suppose it doesnt matter, at this point I should just try a DB and see if it works
And boy if a db that is best in all fields ever comes into existense the developer will be the new elon musk
Why do u know so much about this stuff?
Man idk, I follow an awful lot of database and systems designs cuz work
its technically and physically impossible, there are always tradeoffs
not sure that metaphor is relevant anymore lol, theres already small indie rocket science companies doing shit way more advanced then space x
more performance = more memory/storage requirement
more efficiency = less performance
with the new elon musk I meant richest man alive
tbf there is a reason why SQL has existed for so long
and why even the popular noSQL databases follow some of the relational handling
out of curiosity, what about composite databases
relationships are very common, sql databases are very efficient at storing this data, and overall very very performant
like.... using multiple types in the same process for different uses
I'm curious now, I have no clue what composite databases are
sure, why not
people often use redis in combination with another db
thanks for all the help, Ill try some things out and come back if I have any other issues
people often use redis in places they just dont need 
also that
don't they use redis for caching tho?
yes and no
boy you are on fire with your yesses and nos
xD
I mean welcome to database design lol
are we still talking about databases
People use it for caching both when they should and when they shouldnt
also use it for locks
also sup Chillfish
also use it for buffer streams and ipc
yeah this is getting way too technical for me I'm just a 15 year old who knows how to code in js/ts

In the end, pick a db out of Sqlite, Mongo, Postgres and it'll probably do you really
What about mysql?
Im a 16 year old who knows how to code in 7 different languages yet I CANT FUCKING UNDERSTAND DATABASES WHAT THE HELL

lol
Well I know more languages too but I'm not really proficient in most
It exists, generally not a massive reason to use it over postgres anymore. Postgres just offers more without the oracle strings
I just love javascript and typescript and don't enjoy any other languages
As like anyone suggested at least once use mongo
Id like to think Im proficient enough to transpile / write the same simple programs in 5-6 of my known languages and all of them function quite similarly or the same
I know some languages that just simply cant be applied in ways others can, such as Lua
i dont like how mongo is designed to eat your ram lel
not even that, just the fact that it doesnt release it unless you restart, but doesnt use it even if it does have it
Oh you mean simple programs?
lol is having not enough RAM still an issue in 2021?
ye
50GB mongo db eating 5GB of ram
my vps has 1gb ram thank you very much
Then sure js, (ts if u count it), python, java, c++, c# that's 6
lmao
If I can write the exact same math in all 6 languages, that means I should be able to make basically any program in all 6, and all of them do the same thing, maybe at different performance rates, but atleast the same program
wait you get 1gb?
@modest maple U think I should use a different database then?

wut
what ever works for you really
realistically speaking
you guys are never going to push any of the dbs to their limits
or atleast you shouldnt be
if you are, something has gone wrong
idk I was using sqlite but then when rewriting to work with djs 13 I swapped to mysql for scalability
no massive point in changing then
sqlite is working on wal2 mode
well my friend told me it's the smartest
you're friend is naive but
doesnt matter now
mysql was the 'smartest' back in like, 2000
meh, yeah
Before I was bron 
I broke LowDB and JSON on a high speed network VPS with a powerful dedicated CPU and a lot of RAM
Alright that doesn't rlly convince me
I still haven't produced my bot
I can still switch
So if I should tell me now pls
Well im not surprised, because they're not really databases 
thats the whole reason I came here looking for a decent DB
And now I need to find a decent DB too
Cuz this guy gave me doubts
JSON only works for like a solo bot for like 1 or 2 servers

:3
i used json until 2500 servers
We un-ironically use JSON for metadata in our WORM indexes lol
You probably had a better setup than I did
or Im throwing way too much overhead into mine
that 1 server could break it
What database do you think I should swap to?
That sounds like ur budget is an issue not the database
man if you're already using mysql literally no reason to swap unless you're doing something odd that start exposing the mysql wtf moments
just make sure you have an efficient design, there are many tricks that can massively reduce the strain on your database
if you really want to switch just use mariadb which is a drop in replacement
but otherwise meh
oh god mysql wtf moments?
Already suggested him to use mariadb
i should've looked more into this before swapping 
MySQL and unicode 
But he’s resisting
btw what were those settings tricks you mentioned about SQLite earlier? ones that speed it up alot?
Im going to make a composite DB between Mongo and SQLite
oh yeah I've noticed that
remember when json was a db
wal mode and synchronous off
ty
wdym resisting?
how do you enable those XD
i even asked if it was hard to switch
is there a config file?
I'm rlly considering
you use pragma queries
json is a db change my mind
also changing the index so it's not using a B-Tree
pragma wut 
Well changing to mariadb it is then
well Im confused already XD
the fact that this project exists and gets sponsored honestly sums up the JS ecosystem in a nutshell
I used that previously
thats the one I broke with 2 servers
and a fuckton of requests
Why do you think I found it out 
it's like json config store
which I used to use

I still use json for single access config
like on bot startup
super easy to access
store my tokens n shit
literally a drop in replacement. So none
is it just some command line stuff or will I have to redo queries and stuff
imagine using json
literally a drop in replacement. So none
over yaml
like, having this, and just being able to go config.bot.token is so sexy its impossible to give up.
and does keyv still work with it?
yaml is better
ew
No
how is yaml annoying
euw
what

I remember the good old days before I learn to code when I felt like a dev configuring yaml files from minecraft plugins
lmao
yaml is so good for config files
Bruh I wasted 2 months converting 8000 indices of data written in YAML for an ancient game.... it was a major hemroid of a pain trying to use
json is just messy and ugly
There are packages for accessing yaml data
laughs in pr
take for example dahlia
is that also a pragma?
i dont remember that one
its really good at parsing yaml
jeesus
ngl I cannot remember
perfect
u mean like
typing?
like with json
honestly yaml is simple enough, I could parse it myself, but it just seems like such an unstable format, nothings delimited, and stuff like commas and quotations can be optional, which is weird asf
JSON is more strict but allows more flexiblity in the messiness of its output
so for ts you're better of using yaml then?
https://www.npmjs.com/package/@sach1/dahlia It doesn't have any readme docs but its straight forward to use
hmm i cant find anything on disabling btrees for indexes
Yaml takes no time at all to setup
what are you on about
I can setup a yaml config in 5s
JSON is builtin to web and node JS
:l
no its not
its terrible as a DB
ill find it tomorrow maybe, it was a fairly fiddly thing
What
Who the hell uses json as a db
youre saying to use it for output data .-.
you shouldnt be writing to JSON at all unless youre using single access batch writes
as its usually used for config anyways
No one is talking about using it as a db
no shit, its easy to parse REST data in JSON, and basically every browser / web JS engine supports it
yet another reason not to use YAML actually
You...
I don't get how you completely misread what I said
JSON is better used for outputting data since thats what its best for, yaml is excellent for config files
which is why its used as such in a lot of things
yaml isnt better for config
like
that makes zero sense
this conversation is 2 py and js native people arguing about python and javascript
yaml is for python users
and java
stupid indendations
no
stop
evil
dont corrupt java with yaml
disgusting

how do u mak config files in java then?
you mean, dont corrupt yaml with java?
Json...
:^)
ok well stupid question
I grew up configuring yaml files from minecraft plugins
if I think about java I think about yaml
minecraft writes everything in JSON by default for all its config
;3
even modules
like resourcepacks and mods
mostly json
.-.
minecraft plugins is third party

well I'm heading to bed
I can't
Take sleepin pills
Don't have
wikihow has a good tutorial
Step 1: Just fall asleep
pro tip
Step2 take pills (according to wikihow)
Lmao
Read somewhere those small blue ones with a v for very good sleeping are good

And the ones with XTC on are also good
Unisom
I take em
work pretty well
or melatonin
amogusdb
oh really
lmaooo
So I pushed a fix to a problem that was no longer there
thank you sir
At least you tried
amogusdb really popular
its what the cool kids use
Stop it
Got it meanwhile after googling it
Lmao

get trolled
I’m literally too old for this slang shit

this is why new devs are given a bad rep
:L
E
Hmm
The revenge will happen once a beautiful day I’m old enough to shit into my pants and younger people like you need to deal with it 
lol
@quartz kindle I thought mongodb ran on the device... what is this digital hosting BS
Pretty sure there's a local version is there not?
where?
^
Community version is self hosted
where do I get it
Well I’m in business for ~ 14 y now…
I’m just not really into this young people slang but well aware of sarcasm lmao
Nothing to worry if he’s trolling
in the community version tab
I will throw that phone away once a day
lol
I wish the day would have a few hours more, 24 isn’t enough
Ikr
24 more like 42/7
I'd love there to be 42 hours a day
more time i get to sleep
discord did an oopsies
Im trying to save the guild name and ID, is this the valid way to do it in discordjs v13 (via slash commands)
guildName: interaction.message.guild.name,
guildID: interaction.message.guild.id
Yeah you may wanna check it the guild is available before for reasons
idc about the checks, I can do that later
I just want to know if thats the valid way to select the name and id
:3
Without the message property
I could just use interaction.guild and interaction.guildid
just found it in the docs
:3
im slow
Yeah didn’t see the message property on the first look too
What I wanted to say was it might be a good idea to check if(interaction.guild.available) before accessing its properties at least once
In your event listener
why is interaction.reply() not in the docs
I wanted to see the docs for the sent message thing again
but cant find it .-.
->-
nvm
guess it doesnt include extended methods
sucks
available is an actual prop on guild?
Yes
Since when
You should always check if the guild is available on guildCreate and guildDelete events before doing anything
this would of made life so much easier
Since forever
Bruh
I swear these things have never been a thing
like client being on pretty much everything
I know guild.available was a thing since djs v11 at least
I guess I completely missed it
But why are people always doing if(!guild) or smth
if available exists
It depends what you're using it for
But on the guildCreate and guildDelete events, always do
if(!guild.available) return
Before doing anything else
Didn’t know it was available before, too
Just saw it now with the v13 updated docs
Otherwise it crashes your bot
And yes it makes a lot of things easier
My bot got stuck in an error loop because of an unavailable guild while I was asleep one night and I woke up to a 72h identification rate-limit
lmfao
Checking it once in your event listener before working with guild is a lot of checks less you have to do
that had to suck
Yeah I just added that line and no more problems
That’s ur fault not monitoring ur system 24/7 and be awake 

Like when Discord fucks up their CDN
And I eat cold dinner at midnight because I was fixing a problem that was already fixed by the time I pushed to git
Nah just an evening
I mean you could pay the Indian tech support to call you if something goes wrong.
Heard those guys are premium
I’m using SMS io to receive messages if any outtake happens
I mean I integrated the API into my own monitoring systems
Is more reliable than push notifications relying on the mobile internet
But I shouldn’t continue as younger people will wonder what a SMS is.
Imagine I would talk about other reliable services I’m still using like a FAX. 
Time has changed so fast
sms without a plan more like scam
In France, if you want to organise a last-minute protest or demonstration, you have to send a fax to the prefecture... What is this? 1990?
lol
Dunno why I still like all the old services but they somehow work, most of the times
So many companies still rely on old technology as well as our government systems
It sometimes feels like a 3rd world country regarding technology but better than being watched and monitored like in China for example
those systems have been setup by people who are either dead, were fired long ago, or disappeared somewhere, therefore all these companies have this "if it works, dont touch it" mindset and everyone is afraid of changing anything because there is nobody left to fix it
:^)
Yeah never change a running system, Sir
You're not old enough if you didn't take school exams that had that alcohol stench
Idk how they're called in English tho
It was basically an alcohol press
But man did it smell good
Not better than gasoline tho
Alright I’m done for today
Need to stand up in 2,5 hours, yaaay
Tf
Life you know… 
mongoose.connect('mongodb://localhost/data', { useNewUrlParser: true, useUnifiedTopology: true });
if (Player.exists({ id: interaction.user.id })) {
const logEmbed = new MessageEmbed()
.setTitle('Updated Player Info');
Player.updateOne({ id: interaction.user.id }, {
name: interaction.user.name,
avatar: interaction.user.avatar,
lastTime: interaction.createdAt
}).then(interaction.reply({embeds: [logEmbed], ephemeral: true }))
.catch(e => console.log(`(use.js) Updater Error: ${e}`));
} else {
const logEmbed = new MessageEmbed()
.setTitle('Added Player Info');
const newLog = new Player({
_id: mongoose.Types.ObjectId(),
id: interaction.user.id,
name: interaction.user.name,
avatar: interaction.user.avatar,
addedTime: interaction.createdAt,
lastTime: interaction.createdAt,
rank: 0
});
newLog.save()
.then(interaction.reply({embeds: [logEmbed], ephemeral: true }))
.catch(e => console.log(`(use.js) Setter Error: ${e}`));
}
Sorry to post such large code, but Im wondering if anyone can help me understand why when I check for something in mongoose... it says it exists... that if statement returns true, even though it doesnt exist.
and so it says it successfully edits the data anyways, even though inside mongodb compass, I literally deleted the user data, and its never updated (yes I clicked the refresh button.
@round cove did you watch this yet? https://www.youtube.com/watch?v=LleJbZ3FOPU
Deranged, insane, mouth-breathing gremlin reviews Yandere Simulator's code for 57 whole minutes.
The purpose of this video is to let everyone learn from one man's mistakes, from a mostly objective point of view, focusing ONLY on the code and resolving any and all misconceptions and myths. I've learned a great deal about the internals of this ga...
i think the one thing that horrifies me the most about his code is him storing event data as a string
this.event = "Murdered"; is actually mortifying
not an enum or int or even a class method
nah just raw string data
that is the best way to do it ofc
What's wrong with that?
you are a living troll
No, a string is fine.
it's not necessarily "wrong" in the sense of logicality
it's "wrong" to me because it's an odd choice to store data
it's not limited to just this.event but also other things e.g. weapons, character movement, facing directions, etd.
He could've used an enum/integer/etc. but what matters is it's an identifier
and a string is a pretty fine identifier
i just don't like it
i would obv much rather prefer using some intflag/enum format
because personally to me that seems more intuitive as identifiers
if it suits you then sure
yeah sure, wondering how do you do it lol
true lmao
i see, thanks, if it dosnt work ill just modify it i guess
i think you need to await the exists function
idk
Yes, it returns a promise so await it
Also, .then(interaction.reply({embeds: [logEmbed], ephemeral: true })) is wrong
You need to provide a function instead of calling it directly
.then(() => interaction.reply({embeds: [logEmbed], ephemeral: true }))
Good afternoon all,
Just wondering if anyone has had any experiences converting a IRC chat bot to a discord bot
a 10 char string takes up 40 bytes of data.
Formula: 20+(n/2)*4
quite a bit more than 4 bytes for an int
but eh
I am getting some errors in basic python program...can anyone check ?
Well no
Not without the errors
😅 Hang on
I'm trying to make a basic hangman game.
I wrote a while loop to prevent user from entering anything other than 1 letter.
But it's showing syntax error
Someone please tell me how to correct it
No one can help you without the error
Oh it is written here
Ohhh
Ok I'll check it out thanks a lotttttt!!!
<a class="link" href="https://bit.ly/3jaiAoN">Invite</a>
why wont this show as a link?
?
a string is only fine if you dont care about memory, performance, or maintainable code. if you use strings, and you have a state thats a string called "Murdered", first that takes 10x as much as a simple byte state, and second if you typo it to "Murder" in another bit, it breaks...
not pinging, as this was ages ago. but i had to stick my oar in here
Also it leads to bad overhead over time
Its more than just "using it is an acceptable identifier" because memory allocation and garbage collection is vital for game development
C#
i didnt look at the video, dont have time to watch videos when a written page will do
Unity utilizes mainly C#
its unity, ah ok
that's what Yandere Simulator is written in
yeah there's a shit ton of reasons why Yandere Simulator's FPS is horrible
or was horrible
you gotta be even more careful then
if you actually run the game now it runs almost beautifully
as unity uses a really old mono as its framework core iirc
some crazy optimization has been done
which isnt as streamlined
just use unreal engine like real devs do 
but there are some horrible practices being used in the YS source code
and string identifiers like those is one of them
because there are a good 2-3K lines of those with this.event being overwritten over and over
all under 1 mono loop
you can imagine how much that begins to take a toll
no
i just want game devs to be as smart about their code as the Quake III devs were
In this video we will take an in depth look at the fast inverse square root and see where the mysterious number 0x5f3759df comes from. This algorithm became famous after id Software open sourced the engine for Quake III. On the way we will also learn about floating point numbers and newton's method.
0:00 Introduction
1:23 Why Care?
3:21 The Cod...
absolutely loved this
if(((((findLengthfast(&rotatetarget)>150&&(i!=0&&k!=0))||(findLengthfast(&rotatetarget)>50&&player[0].rabbitkickragdoll/*currentanimation==rabbitkickanim*/&&(i==0||k==0)))&&normaldotproduct(rotatetarget,player[k].coords-player[i[/i]].coords)>0)&&((i==0||k==0)||((player[i[i]].skeleton.oldfree==1&&k!=0&&animation[player[k].currentanimation].attack==neutral)||(player[k].skeleton.oldfree==1&&i!=0&&animation[player[i[/i]].currentanimation].attack==neutral)||(player[i[i]].isFlip()&&!player[i[/i]].skeleton.oldfree&&(i==0||k==0))||(player[k].isFlip()&&!player[k].skeleton.oldfree&&(i==0||k==0))||(i==0||k==0))))||((player[i[i]].targetanimation==jumpupanim||player[i[/i]].targetanimation==jumpdownanim||player[i[i]].isFlip())&&(player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim||player[k].isFlip())&&(i==0||k==0)&&(!player[i[i][/i]].skeleton.oldfree&&!player[k].skeleton.oldfree))){```

