#development

1 messages · Page 1854 of 1

jovial nexus
#

Yes the emoji ID

sudden geyser
#

https://cdn.discordapp.com/emojis/<id>.<extension>?v=1

earnest phoenix
#

I didn't know emojis had ids

jovial nexus
sudden geyser
#

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_

jovial nexus
#

and how do i fetch it

#

with only the id

sudden geyser
digital ibex
#

still im having trouble with this, now i've got another issue

earnest phoenix
#

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

digital ibex
#
               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?
sudden geyser
#

which has the guild id

earnest phoenix
#

why

jovial nexus
#

maybe the bot is not in that guild

earnest phoenix
#

you can just access emojis on the guild object and access its cache and get using the emoji id

digital ibex
#

in the form i am entering data

earnest phoenix
#

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

jovial nexus
#

umh yes

#

djs has a function for that

#

but it gives you the id not the url

boreal iron
#

Take a look at the properties

jovial nexus
#

i told that is not in the guild

#

the bot

earnest phoenix
#

Then what is the point ?

jovial nexus
#

gitting the url of an emoji with the id

earnest phoenix
#

I dont see a way to actually get the emojis extension or not

boreal iron
#

Guess he wanna use emojis from guilds his bot is not in

jovial nexus
#

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

earnest phoenix
#

I wonder

boreal iron
#

Thought you can only fetch these things if you’re in the guild

earnest phoenix
#

Nah

#

if you have the id and extension you can easily get the emote

jovial nexus
#

fuck me

#

i know how

earnest phoenix
#

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

#

😢

jovial nexus
#

the parseEmoji has a .animated option

earnest phoenix
#

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

digital ibex
eternal osprey
#

:RainbowHeart:

#

how do i check the amount of users in djs v12?

earnest phoenix
#

Huh?

#

Amount of users in what

#

a guild or all that the client has access to

eternal osprey
#

message.guild.cache.members.size is what i have now

#

not sure whether that is the right approach

earnest phoenix
#

uh

#

no

#

not at all

#

you have the cache in the wrong spot

#

<Guild>.members.cache.size

rose warren
#

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?

earnest phoenix
#

How are you getting the users avatar?

rose warren
#

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

earnest phoenix
#

Mm possibly not, could just be discord being weird. But I don't get why it would return a 403 for that

tulip ledge
#

403 is forbidden access right?

rose warren
#

Yeah

earnest phoenix
#

Indeed

tulip ledge
#

Maybe your authentication is wrong?

earnest phoenix
#

Well if its in a bot I doubt this.

rose warren
#

It's a bot

earnest phoenix
#

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.

rose warren
#

I'm either using displayAvatarURL() method or https://cdn.discordapp.com/avatars/${trib.id}/${trib.avatar_slug}.png

#

On a canvas

earnest phoenix
#

Erm

rose warren
#

But if I use displayAvatarURL() in an embed thumbnail it works fine

earnest phoenix
#

is it the users id?

rose warren
#

user id

earnest phoenix
#

and trib.avatar_slug is the avatars hash?

rose warren
#

yeah

#

It's not a problem with how the URL is formed

#

It's a server error somewhere between my VPS and Discord

earnest phoenix
#

Yea, I am just making sure .

rose warren
#

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

earnest phoenix
#

I don't know then.

#

I haven't heard of such a thing happening if I am being honest

short patio
#

does anyone know how long a bot has to be offline for before they remove your badge?

tulip ledge
#

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

stuck scaffold
earnest phoenix
#

Could be discord.js fucking smth up or discord is being weird today

stuck scaffold
opaque seal
#

noice

earnest phoenix
#

discord did fuck up

rose warren
#

Oh thank god

earnest phoenix
#

I dont know why discord does this to us

tulip ledge
#

discord giving is more reasosn to move to guilded KEKW

earnest phoenix
#

No matter what discord does im not moving to guildede

opaque seal
earnest phoenix
#

I would make my own platform before that happens

tulip ledge
earnest phoenix
#

I know

tulip ledge
earnest phoenix
#

but I will make a discord clone before I move to guilded

tulip ledge
#

Making ur own platform

earnest phoenix
#

I am already sorta working on that

#

kekw

#

Just not yet cause of school

tulip ledge
#

What language(s)/frameworks?

#

Could u make it with react/electron?

earnest phoenix
#

Well ofc

#

Discord uses electron for its desktop application

tulip ledge
#

actually

#

I didn't know that

earnest phoenix
#

Indeed

tulip ledge
#

interesting

#

even league of legends client uses it

earnest phoenix
#

Which is why can you press CTRL SHIFT I for the dev console and tools

#

its basically just a browser for a single website

tulip ledge
#

Oh well I'm gonna wake up early tomorrow and make a discord clone too kekw

#

It'll be fun

opaque seal
#

isn't it like a pwa basically?

earnest phoenix
#

Probably

#

I dont know a lot of web dev terms

tulip ledge
#

what is pwa?

earnest phoenix
#

I just recently started getting into it heavily

opaque seal
#

Why don't stores like microsoft stores or apple store just accept pwa as apps

earnest phoenix
#

progressive web application

opaque seal
#

pwa are the future imo

earnest phoenix
#

I have no idea what that even means if I am being honest

#

I need to learn alot of web dev terminology

tulip ledge
#

As a great man once said anything that can be written in js, will eventually be written in js

quaint wasp
#

So ig its just a matter of time untill I will stop needing to walk to the restroom

tulip ledge
#

kekw

zealous trellis
#

can anyone reccomend a serverless database?

earnest phoenix
#

sqlite

#

file based

zealous trellis
#

will it work for a high-density bot

#

with a lot of requests

tulip ledge
#

yes it's only less scalable tho

zealous trellis
#

what?

zealous trellis
earnest phoenix
#

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

zealous trellis
#

I want a headless serverless DB

#

no overhead

quartz kindle
#

aka sqlite

earnest phoenix
#

yea

#

sqlite sucks when using in a larger bot though

quartz kindle
#

depends how large

earnest phoenix
#

Yea

zealous trellis
#

I dont get it, is there NO large scale DB that runs locally 😒

quartz kindle
#

it should be able to handle 50k+

earnest phoenix
zealous trellis
#

pg?

#

postgre?

earnest phoenix
#

postgres

quartz kindle
#

most dbs can be run locally

zealous trellis
#

ok.

earnest phoenix
#

typically you'd run it on the server your bot is hosting on

zealous trellis
earnest phoenix
#

and connect to it

quartz kindle
#

yes

zealous trellis
#

that just looks so messy and hacky

earnest phoenix
#

Not really

zealous trellis
#

seems like a load of shit to me

quartz kindle
#

because thats how you make it handle that much concurrency

zealous trellis
#

why would you need a server layer

#

only to connect to it locally

#

its useless overhead

#

even if its fast

#

its still overhead

earnest phoenix
#

?

quartz kindle
#

yes, but its easier than a hacky ipc solution

#

besides, they can run on unix sockets

#

which is faster than tcp

zealous trellis
#

so should I use PostgreSQL or SQLite

earnest phoenix
#

Up to you really

#

whatever your needs are

zealous trellis
#

-.-

#

Im horrible at choices

quartz kindle
#

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

zealous trellis
#

isnt that what threads are for?

quartz kindle
#

not exactly, threads require some sort of shared context to be good

zealous trellis
#

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

quartz kindle
#

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

zealous trellis
#

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

quartz kindle
#

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

zealous trellis
#

.-.

#

RIP

#

Guess Im using PG

#

my nodejs instance is single threaded

#

atleast rn

quartz kindle
#

then use sqlite

zealous trellis
#

what..

#

the hell

#

Im so fucking confused

quartz kindle
#

if you have a single process, use sqlite

zealous trellis
#

am I just screwed?

quartz kindle
#

your process executes them sequentially

zealous trellis
#

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

quartz kindle
#

in most use cases yes

zealous trellis
#

but I want it to work for all use cases

#

thats what Im asking

quartz kindle
#

it covers the lack of threading with the speed advantage of having no network overhead

zealous trellis
#

because Im planning on scaling this bot up quite a lot

quartz kindle
#

therefore most queries will be faster than a server db query because of network overhead

#

sqlite has an option called "WAL mode"

zealous trellis
#

what does that do?

quartz kindle
#

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

tulip ledge
#

Question is cassandra free?

zealous trellis
quartz kindle
#

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

zealous trellis
#

but again, is that viable for large scale projects

quartz kindle
#

the only limits are HEAVY write usage

#

for example writing several megabytes of data per second

zealous trellis
#

Im talking thousands, maybe tens/hundreds of thousands of requests

#

can it handle that?

zealous trellis
#

its a set of high speed SSDs

quartz kindle
#

it can handle thousands per second

#

it depends on the efficiency of your queries

zealous trellis
#

alrighty, I guess Ill use SQLite

#

now I gotta figure out how to change those settings

quartz kindle
#

how much will you write compared to read?

zealous trellis
#

reading will be cached anyways

#

and only updated after some time

#

or enough changes

tulip ledge
#

Also sqlite doesn't support alot of datatypes

quartz kindle
#

well, you will have to test your use case

zealous trellis
#

all Im really using are strings, ints and booleans

quartz kindle
#

but if you run a single process, there is really no advantage on running a server db

tulip ledge
#

SQLite only supports: Blob, integer null text and real

zealous trellis
#

what..

quartz kindle
#

if you're gonna scale into the thousands like you say, that implies scaling your process to multiple processes as well

tulip ledge
#

If you ever need to use a different datatype you can't use it is what I'm saying

quartz kindle
#

once you get to that point, a server db is better

zealous trellis
tulip ledge
#

I moved from sqlite to mysql btw

quartz kindle
#

a real is basically a float/double

tulip ledge
#

it's a "real" number

zealous trellis
#

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

quartz kindle
#

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.

zealous trellis
#

so like, I can store an array of values for a player ID?

tulip ledge
#

Also once your database grows and becomes rlly large sqlite will use alot of memory

quartz kindle
#

you will have to serialize it

tulip ledge
#

That's why I switched from sqlite ot mysql

quartz kindle
#

actually, sqlite does include a json extension

zealous trellis
#

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

quartz kindle
#

mongo

#

lol

zealous trellis
#

.-.

#

back to server db

quartz kindle
#

postgres also supports them

#

sqlite supports json via extensions

tulip ledge
#
# Disadvantages of SQLite:

- Lacks user management and security features
- Not easily scalable
- Is not suitable for big databases
- Cannot be customized
zealous trellis
#

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

#

.-.

tulip ledge
#

If you want scalability go with server based ones

#

sqlite doesn't scale well

zealous trellis
#

what do already large scale bots use

#

like mee6 and dyno

quartz kindle
#

likely mongo or posgres

#

and they have their db in a separate vps

tulip ledge
#

I use mysql

boreal iron
#

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

zealous trellis
quartz kindle
#

no

zealous trellis
#

;(

#

ffs

tulip ledge
#

I'm pretty sure github uses mysql no?

zealous trellis
#

guess everythings falling back to mongo and postgre

#

pg might be the easiest to go along with

#

idk

quartz kindle
#

pg is not easy

#

pg is like the linux of databases

quartz kindle
#

mysql is like microsoft

tulip ledge
#

pg is hard but powerfull

zealous trellis
#

so what do you reccomend for me

quartz kindle
#

another option is redis lol

zealous trellis
#

between mongo, pg and mysql

#

which one would be best for me

#

simple, fast, scalable

quartz kindle
#

you cant have all 3

#

lmao

tulip ledge
boreal iron
#

If you wanna use MySQL then choose MariaDB

quartz kindle
#

can be used as a db too

tulip ledge
#

I just use MySQL

#

plain old mysql

zealous trellis
#

please dont give me even more choices to cry over

#

;-;

boreal iron
#

What a question…
Because MariaDB is maintained by its owner and not thrown away like Oracle does

zealous trellis
#

fuck it

#

mongodb

#

sigh

quartz kindle
tulip ledge
zealous trellis
boreal iron
#

Not really as most databases can handle big data

quartz kindle
#

how much data is not an issue

#

how fast the writes are is a bigger issue

tulip ledge
#

@boreal iron Is it easy to convert from mysql to mariadb?

quartz kindle
#

they are like 99% api compatible

boreal iron
#

It actually is yes

#

Just google about the advantages of MariaDB compared to MySQL and how Oracle is going to ruin anything they own

quartz kindle
#

i have tried mysql, mongo, redis, postgres and sqlite

tulip ledge
#

I would say don't go with sqlite if you want scalability

quartz kindle
#

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

boreal iron
#

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

zealous trellis
#

so I dont really know if I can choose anymore

#

I might just get mongoose and got over myself

tulip ledge
#

I mean you could always go to scylla

quartz kindle
#

if your data is heavily json-style including nesting and such, mongo would be a better fit

tulip ledge
quartz kindle
#

although pg supports json, its natively a table-based system, like all other sql dbs

tulip ledge
#

I mean I use mysql which is also table based but I use keyv so it's key value like json

zealous trellis
quartz kindle
#

does mongo support domain sockets?

zealous trellis
#

no clue

boreal iron
#

At the end you can switch anyways if you don’t like your choice

quartz kindle
#

it does

zealous trellis
#

what is a domain socket useful for anyhow?

tulip ledge
zealous trellis
boreal iron
#

Even if that might result in manually writing scripts to transfer your data regarding compatibility

zealous trellis
#

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

quartz kindle
tulip ledge
quartz kindle
zealous trellis
#

and converting databases would cause all kinds of drama

tulip ledge
#

If you need to you can just read all data from one database and write a script to write it in the new one

boreal iron
#

Yeah understandable but still possible

tulip ledge
#

didn't discord go from mongo to cassandra?

quartz kindle
#

didnt they always use cassandra?

tulip ledge
#

I thought they used mongo in the beginning

#

Apparently they use scylla not cassandra

modest maple
#

Err yes and no

tulip ledge
#

but isn't scylla built on cassandra?

modest maple
#

Discord went from a fork of mongo to scylla

tulip ledge
#

like with API

modest maple
#

and no scylla is not built on cassandra

tulip ledge
#

Well idk how to explain

modest maple
#

scylla is a re-write of cassandra in cpp using async IO

tulip ledge
#

that's what I meant

zealous trellis
#

never heard of em using mongo

#

only cassandra

#

and then switching to scylia

modest maple
#

mongo was a long time ago

tulip ledge
#
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.
quartz kindle
#

lmao

tulip ledge
#

kekw same thing

modest maple
#

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

tulip ledge
#

That's the exact same thing with sqlite

#

fast developing

#

lack of scaling

modest maple
#

well yes and no

tulip ledge
#

u like ur yes and nos don't u

zealous trellis
#

is discord still using scylia right now?

boreal iron
#

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

tulip ledge
#

Yes

modest maple
#

Sqlite un-ironically is more powerful than most DBs around

boreal iron
#

You will have to rewrite it for djs v14 again anyways

modest maple
zealous trellis
#

hmm

#

so is scylia viable

#

for what Im doing

tulip ledge
#

If ur willing to pay

#

alot

quartz kindle
zealous trellis
#

I cant find a nodejs package for it

modest maple
#

not really

#

scylla is going to cause you more pain than good really

zealous trellis
#

typical

modest maple
#

scylla isnt proprietary

#

but sure

tulip ledge
zealous trellis
tulip ledge
#

15/month

zealous trellis
#

:3

quartz kindle
#

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

zealous trellis
#

ah now you edit

#

XD

modest maple
zealous trellis
#

hmm

#

was just curious

#

anywho, Ima go use mongodb

modest maple
tulip ledge
#

mongo should be fine

boreal iron
#

Amen

tulip ledge
#

if you do become as big as mee6 and shit u could always change

boreal iron
#

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

zealous trellis
#

its more for a web project then anything

#

so its less scalable for guilds

quartz kindle
#

there isnt a single solution that can handle all scenarios, you will always need to migrate at some point

tulip ledge
modest maple
# tulip ledge explain.
  • 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
zealous trellis
tulip ledge
#

And boy if a db that is best in all fields ever comes into existense the developer will be the new elon musk

tulip ledge
modest maple
#

Sip Man idk, I follow an awful lot of database and systems designs cuz work

quartz kindle
zealous trellis
quartz kindle
#

more performance = more memory/storage requirement

#

more efficiency = less performance

tulip ledge
modest maple
#

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

zealous trellis
#

out of curiosity, what about composite databases

modest maple
#

relationships are very common, sql databases are very efficient at storing this data, and overall very very performant

zealous trellis
#

like.... using multiple types in the same process for different uses

tulip ledge
#

I'm curious now, I have no clue what composite databases are

zealous trellis
#

hmm

#

that gives me ideas

quartz kindle
#

people often use redis in combination with another db

zealous trellis
#

thanks for all the help, Ill try some things out and come back if I have any other issues

modest maple
quartz kindle
#

also that

tulip ledge
modest maple
#

yes and no

tulip ledge
#

boy you are on fire with your yesses and nos

quartz kindle
#

xD

modest maple
#

I mean welcome to database design lol

earnest phoenix
#

are we still talking about databases

modest maple
#

People use it for caching both when they should and when they shouldnt

earnest phoenix
#

its been like an hour and a half

#

wew

modest maple
#

also use it for locks

earnest phoenix
#

also sup Chillfish

modest maple
#

also use it for buffer streams and ipc

tulip ledge
#

yeah this is getting way too technical for me I'm just a 15 year old who knows how to code in js/ts

boreal iron
modest maple
#

In the end, pick a db out of Sqlite, Mongo, Postgres and it'll probably do you really

tulip ledge
#

What about mysql?

zealous trellis
boreal iron
#

lol

tulip ledge
modest maple
# tulip ledge What about mysql?

It exists, generally not a massive reason to use it over postgres anymore. Postgres just offers more without the oracle strings

tulip ledge
#

I just love javascript and typescript and don't enjoy any other languages

boreal iron
#

As like anyone suggested at least once use mongo

zealous trellis
quartz kindle
#

i dont like how mongo is designed to eat your ram lel

modest maple
boreal iron
quartz kindle
#

ye

modest maple
quartz kindle
#

my vps has 1gb ram thank you very much

tulip ledge
#

Then sure js, (ts if u count it), python, java, c++, c# that's 6

boreal iron
zealous trellis
# tulip ledge Oh you mean simple programs?

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

earnest phoenix
tulip ledge
#

@modest maple U think I should use a different database then?

earnest phoenix
quartz kindle
#

wut

modest maple
#

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

tulip ledge
#

idk I was using sqlite but then when rewriting to work with djs 13 I swapped to mysql for scalability

modest maple
quartz kindle
#

sqlite is working on wal2 mode

tulip ledge
#

well my friend told me it's the smartest

modest maple
#

you're friend is naive but bloblul doesnt matter now

quartz kindle
#

you are friend

#

:^)

tulip ledge
#

I am friend

#

So you're saying it's fine that I'm using mysql?

modest maple
#

mysql was the 'smartest' back in like, 2000

modest maple
tulip ledge
zealous trellis
tulip ledge
#

I still haven't produced my bot

#

I can still switch

#

So if I should tell me now pls

modest maple
zealous trellis
#

thats the whole reason I came here looking for a decent DB

tulip ledge
#

Cuz this guy gave me doubts

zealous trellis
#

JSON only works for like a solo bot for like 1 or 2 servers

tulip ledge
zealous trellis
#

:3

quartz kindle
#

i used json until 2500 servers

modest maple
#

We un-ironically use JSON for metadata in our WORM indexes lol

zealous trellis
#

or Im throwing way too much overhead into mine

#

that 1 server could break it

tulip ledge
boreal iron
modest maple
#

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

quartz kindle
modest maple
#

if you really want to switch just use mariadb which is a drop in replacement

#

but otherwise meh

tulip ledge
#

oh god mysql wtf moments?

boreal iron
#

Already suggested him to use mariadb

tulip ledge
#

i should've looked more into this before swapping KEKW

modest maple
#

MySQL and unicode bloblul

boreal iron
#

But he’s resisting

zealous trellis
tulip ledge
earnest phoenix
#

remember when json was a db

quartz kindle
#

wal mode and synchronous off

zealous trellis
#

ty

tulip ledge
zealous trellis
#

how do you enable those XD

tulip ledge
#

i even asked if it was hard to switch

zealous trellis
#

is there a config file?

tulip ledge
#

I'm rlly considering

quartz kindle
#

you use pragma queries

earnest phoenix
modest maple
earnest phoenix
#

wrong mention

#

meant to mention tim

#

ffs

zealous trellis
tulip ledge
#

Well changing to mariadb it is then

earnest phoenix
#

isn't pragma where you use placeholders

#

like ?

zealous trellis
#

well Im confused already XD

modest maple
#

the fact that this project exists and gets sponsored honestly sums up the JS ecosystem in a nutshell

earnest phoenix
#

i told ya

#

json is a db

zealous trellis
#

thats the one I broke with 2 servers
and a fuckton of requests

modest maple
#

Why do you think I found it out mmLol

tulip ledge
#

which I used to use

zealous trellis
#

I still use json for single access config

#

like on bot startup

#

super easy to access

#

store my tokens n shit

tulip ledge
#

yeah ofcourse

#

Also how hard is it to go from mysql to maria?

modest maple
#

literally a drop in replacement. So none

tulip ledge
#

is it just some command line stuff or will I have to redo queries and stuff

earnest phoenix
#

imagine using json

modest maple
#

literally a drop in replacement. So none

earnest phoenix
#

over yaml

zealous trellis
#

like, having this, and just being able to go config.bot.token is so sexy its impossible to give up.

tulip ledge
#

and does keyv still work with it?

zealous trellis
#

¯_(ツ)_/¯

earnest phoenix
#

No

zealous trellis
#

and yaml is more anoyying

#

its newline and space delimited

earnest phoenix
#

how is yaml annoying

zealous trellis
#

euw

earnest phoenix
#

what

zealous trellis
earnest phoenix
#

you just dont know the power of yaml

#

so sad

tulip ledge
#

I remember the good old days before I learn to code when I felt like a dev configuring yaml files from minecraft plugins

earnest phoenix
#

yaml is so good for config files

zealous trellis
earnest phoenix
#

json is just messy and ugly

zealous trellis
#

wound up just JSON-ifying everything

#

worked perfectly

earnest phoenix
modest maple
#

laughs in pr

earnest phoenix
#

take for example dahlia

quartz kindle
#

i dont remember that one

earnest phoenix
#

its really good at parsing yaml

zealous trellis
modest maple
tulip ledge
#

is dahlia a js library?

#

cuz tbh I prefer yaml over json

earnest phoenix
#

it has ts support as well tho

tulip ledge
#

u mean like

#

typing?

#

like with json

zealous trellis
#

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

earnest phoenix
#

it can support typescript types

#

so you can easily integrate it with ts

zealous trellis
#

JSON is more strict but allows more flexiblity in the messiness of its output

tulip ledge
#

so for ts you're better of using yaml then?

zealous trellis
#

no

#

jSON

earnest phoenix
zealous trellis
#

theres no point wasting time setting up yaml

#

.-.

quartz kindle
earnest phoenix
#

Yaml takes no time at all to setup

#

what are you on about

#

I can setup a yaml config in 5s

zealous trellis
#

:l

earnest phoenix
#

Okay

#

but json is better used for output

#

not config

zealous trellis
#

its terrible as a DB

modest maple
earnest phoenix
#

What

zealous trellis
#

its perfect for config

#

are you slow

earnest phoenix
#

Who the hell uses json as a db

zealous trellis
earnest phoenix
#

what do you output in an api that returns data

#

its a json response typically

zealous trellis
#

you shouldnt be writing to JSON at all unless youre using single access batch writes

#

as its usually used for config anyways

earnest phoenix
#

No one is talking about using it as a db

zealous trellis
#

yet another reason not to use YAML actually

earnest phoenix
#

You...

earnest phoenix
#

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

zealous trellis
#

like

#

that makes zero sense

earnest phoenix
#

How does that make 0 sense

#

thats legit what it is primarily used for

tulip ledge
#

this conversation is 2 py and js native people arguing about python and javascript

quartz kindle
#

yaml is for python users

tulip ledge
#

and java

quartz kindle
#

stupid indendations

zealous trellis
#

stop

#

evil

#

dont corrupt java with yaml

#

disgusting

tulip ledge
#

how do u mak config files in java then?

quartz kindle
#

you mean, dont corrupt yaml with java?

zealous trellis
quartz kindle
#

:^)

tulip ledge
#

ok well stupid question

#

I grew up configuring yaml files from minecraft plugins

#

if I think about java I think about yaml

zealous trellis
#

minecraft writes everything in JSON by default for all its config

#

;3

#

even modules

#

like resourcepacks and mods

#

mostly json

tulip ledge
#

Yes but as I said

#

Minecraft plugins

#

not minecraft

zealous trellis
#

.-.

tulip ledge
#

minecraft plugins is third party

zealous trellis
tulip ledge
#

well I'm heading to bed

hoary pewter
#

I can't

zealous trellis
hoary pewter
#

Don't have

zealous trellis
#

oh wells

#

cant help ya there

hoary pewter
#

Any tutorial?

earnest phoenix
#

wikihow has a good tutorial

wheat mesa
#

Step 1: Just fall asleep

boreal iron
#

pro tip

earnest phoenix
#

Step2 take pills (according to wikihow)

boreal iron
#

Lmao

boreal iron
tulip ledge
#

And the ones with XTC on are also good

boreal iron
#

Did u finally choose a db?

#

Had to leave the convo at some point

split hazel
#

amogusdb

boreal iron
#

Never heard of that one lol

#

Must be some after 2000 modern shit

rose warren
#

@earnest phoenix

#

I literally pushed my fix to git and then saw their announcement

earnest phoenix
#

lmaooo

rose warren
#

So I pushed a fix to a problem that was no longer there

earnest phoenix
#

kekw

#

seems legit

silent whale
#

thank you sir

boreal iron
earnest phoenix
#

its what the cool kids use

boreal iron
earnest phoenix
#

Lmao

boreal iron
earnest phoenix
#

get trolled

boreal iron
#

I’m literally too old for this slang shit

earnest phoenix
#

lmao

#

sorryy

boreal iron
earnest phoenix
zealous trellis
#

:L

earnest phoenix
#

Im not a new dev though

#

so get rekted

zealous trellis
#

you sound like gen z

unborn fiber
#

E

earnest phoenix
#

Its called trolling

#

and joking around

#

stop being so serious its annoying

unborn fiber
#

Hmm

boreal iron
# earnest phoenix sorryy

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 smirk

earnest phoenix
#

lmao

#

dw gramps I will take care of ya

boreal iron
#

Again this slang…

#

Alright bruh

#

that seems to be ooy

#

Wut… damn auto correct

earnest phoenix
#

lol

zealous trellis
#

@quartz kindle I thought mongodb ran on the device... what is this digital hosting BS

pale vessel
#

Download the community version

#

You can self host it

wheat mesa
#

Pretty sure there's a local version is there not?

zealous trellis
#

where?

wheat mesa
earnest phoenix
#

Community version is self hosted

zealous trellis
#

where do I get it

boreal iron
pale vessel
earnest phoenix
#

in the community version tab

boreal iron
#

That’s what we do 25/7 in here

#

omg why

#

*24/7

earnest phoenix
#

FakE has changed the amount of hours are in a day

#

all hail FakE

boreal iron
#

I will throw that phone away once a day

earnest phoenix
#

lol

boreal iron
earnest phoenix
#

Ikr

#

24 more like 42/7

#

I'd love there to be 42 hours a day

#

more time i get to sleep

wheat mesa
#

discord did an oopsies

zealous trellis
#

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
boreal iron
#

Yeah you may wanna check it the guild is available before for reasons

zealous trellis
#

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

boreal iron
#

Yeah it is

#

Err whoops nope it isn’t

zealous trellis
#

oh

#

wait

boreal iron
#

Without the message property

zealous trellis
#

I could just use interaction.guild and interaction.guildid

#

just found it in the docs

#

:3

#

im slow

boreal iron
#

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

zealous trellis
#

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

pale vessel
#

It does

#

You were looking at base interaction

earnest phoenix
#

available is an actual prop on guild?

rose warren
#

Yes

earnest phoenix
#

Since when

rose warren
#

You should always check if the guild is available on guildCreate and guildDelete events before doing anything

earnest phoenix
#

this would of made life so much easier

rose warren
#

Since forever

earnest phoenix
#

Bruh

#

I swear these things have never been a thing

#

like client being on pretty much everything

rose warren
#

I know guild.available was a thing since djs v11 at least

earnest phoenix
#

I guess I completely missed it

#

But why are people always doing if(!guild) or smth

#

if available exists

rose warren
#

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

boreal iron
#

Didn’t know it was available before, too
Just saw it now with the v13 updated docs

rose warren
#

Otherwise it crashes your bot

boreal iron
#

And yes it makes a lot of things easier

rose warren
#

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

earnest phoenix
#

lmfao

boreal iron
#

Checking it once in your event listener before working with guild is a lot of checks less you have to do

earnest phoenix
#

that had to suck

rose warren
boreal iron
rose warren
#

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

boreal iron
#

lol another wasted day yikes

#

Happens from time to time

rose warren
#

Nah just an evening

boreal iron
rose warren
#

I should set up Sentry

boreal iron
#

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

zealous trellis
#

interesting, you can send more than 1 sticker?

#

hmm

boreal iron
#

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. KEKW

#

Time has changed so fast

split hazel
#

sms without a plan more like scam

rose warren
boreal iron
#

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

quartz kindle
#

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

#

:^)

boreal iron
#

Yeah never change a running system, Sir

lyric mountain
boreal iron
#

lmao

#

Can’t remember probably because I was drunk

lyric mountain
#

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

boreal iron
#

Alright I’m done for today
Need to stand up in 2,5 hours, yaaay

lyric mountain
#

Tf

boreal iron
#

Life you know… oldEyes

zealous trellis
#
        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.

latent heron
#

@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...

▶ Play video
#

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

earnest phoenix
#

that is the best way to do it ofc

latent heron
#

you are a living troll

sudden geyser
#

No, a string is fine.

latent heron
#

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.

sudden geyser
#

He could've used an enum/integer/etc. but what matters is it's an identifier

#

and a string is a pretty fine identifier

latent heron
#

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

sudden geyser
#

if it suits you then sure

worthy ivy
#

yeah sure, wondering how do you do it lol

#

true lmao

#

i see, thanks, if it dosnt work ill just modify it i guess

stark widget
#

idk

pale vessel
#

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 }))

merry kestrel
#

Good afternoon all,
Just wondering if anyone has had any experiences converting a IRC chat bot to a discord bot

lament rock
#

quite a bit more than 4 bytes for an int

#

but eh

dark herald
#

I am getting some errors in basic python program...can anyone check ?

earnest phoenix
#

Well no

earnest phoenix
dark herald
#

😅 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

earnest phoenix
#

No one can help you without the error

dark herald
#

Ohhh

#

Ok I'll check it out thanks a lotttttt!!!

errant flax
#
<a class="link" href="https://bit.ly/3jaiAoN">Invite</a>
#

why wont this show as a link?

#

?

green kestrel
# sudden geyser No, a string is fine.

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

errant flax
#

wdym?

#

no i meant it doesn't redirect me

#

like it doesn't work

latent heron
#

Its more than just "using it is an acceptable identifier" because memory allocation and garbage collection is vital for game development

green kestrel
#

yes

#

but what language was that game written in

latent heron
#

C#

green kestrel
#

i didnt look at the video, dont have time to watch videos when a written page will do

latent heron
#

Unity utilizes mainly C#

green kestrel
#

its unity, ah ok

latent heron
#

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

green kestrel
#

you gotta be even more careful then

latent heron
#

if you actually run the game now it runs almost beautifully

green kestrel
#

as unity uses a really old mono as its framework core iirc

latent heron
#

some crazy optimization has been done

green kestrel
#

which isnt as streamlined

latent heron
#

yeah no Unity is like 1/2 of the reason why YS is slow to begin with

green kestrel
#

just use unreal engine like real devs do kek_laugh

latent heron
#

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

green kestrel
#

hmm, you wanna see really bad game source code?

#

ever seen Lugaru?

latent heron
#

no

#

i just want game devs to be as smart about their code as the Quake III devs were

#

absolutely loved this

green kestrel
#
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))){```