#development

1 messages · Page 1457 of 1

earnest phoenix
#

the docs suck ass

boreal iron
#

Hmm gonna take look into it tomorrow

#

Looks like something new exciting nobody asks for but why not

odd stratus
#

Is MongoDB faster and better than quick.db/SQLITE?

hollow sedge
#

probably

#

i mean

#

they're probably about the same?

odd stratus
#

The thing is sqlite is just in one big file so idk

earnest phoenix
#

it's going to be faster yes

odd stratus
#

I’m considering changing my level database to MongoDB that’s why

hollow sedge
#

if you use something like postgres though

earnest phoenix
#

sqlite doesn't scale well at all

hollow sedge
#

im pretty sure it'll be really fast

earnest phoenix
#

postgres is extremely powerful yeah

odd stratus
#

My music bot uses postgres but I wanna try something different for my level code

#

But yeah Postgres pre good

#

But is it possible to transfer all data from an SQLITE file to a Postgres database though?

earnest phoenix
#

you can create a small script that does it 🤷‍♂️

#

create all tables that sqlite has and migrate the values

#

they both use SQL

earnest phoenix
#

Does anyone know how to dm a embed? I have been trying to figure it out for my help command.

#

sending a message is the same no matter where you're sending it to

#

js

#

well I am trying to figure out how to send the embed thru a dm*

#

it is?

#

so do i replace the with something?

message.channel.send('SMTH')

quartz kindle
#

if you already know how to send an embed to a normal channel, its the same, just send it to a user instead.
if you already know how to send a text dm to a user, its the same, just send an embed instead.

earnest phoenix
#

ok

odd stratus
#

Something like user.send()

However you define the user

earnest phoenix
#

ok

#

oh

#

im dumb, thank you for explaining

rose geode
#

$kyucity

hollow sedge
#

"Editing js.js" 👀

#

mans about to make js in js

odd stratus
strong igloo
#

loving how this project is turning out so far (added the tags for nice website url embed too as seen above)

boreal iron
#

That’s the wrong place for ads okeh

earnest phoenix
#

@lost berry adtum

strong igloo
#

the bot isn't even done so don't want people to add it yet really

boreal iron
strong igloo
#

I can delete it though if that'd be consider against the rules

earnest phoenix
#

Pk

#

Oh*

#

Its fine

#

As long as its for feedback and not ad lol

strong igloo
#

yeah bot ain't ready yet

#

if people added it now they'd remove it in minutes lmao

mellow kelp
#

lmao

#

how bout adding a robots.txt to the page

#

or making it a pwa

strong igloo
# mellow kelp or making it a pwa

hmm not a bad idea for as I progress right now trying to keep it simple and just a way to intro people to the bot not a full dashboard like mee6 and such

mellow kelp
#

aight

boreal iron
#

Watch out! A robot AI may will turn evil and try to kill you once a beautiful day.

mellow kelp
#

then our last layer of protection will be robots.txt

glacial trench
#

How do I create slash commands In discord.js Hmmmm

mellow kelp
#

Robot: Reads robots.txt

User-Agent: *
Disallow: /earth

Robot: aw shit we outta here boys

boreal iron
#

lmao

vale garden
#

hi

#

yesterday this was working fine

#
await asyncio.sleep(3)
        new_msg = await ctx.channel.fetch_message(m.id)

        for i in new_msg.reactions:

         users = await i.users().flatten()
         users.pop(users.index(self.bot.user))

         for user in users:
          txt = ""
          member = await commands.converter.MemberConverter().convert(ctx, str(user.id))
          txt += str(member.display_name)
          print("txt1: " + txt)
          if not re.search( '🍐', txt ): 
           txt += f" {i}" 
           print("txt2: "+txt)
           await member.edit(nick = txt)
           print("name: " + member.display_name)
#

but today all the lines after await member.edit(nick = txt) and that line itself isnt executing

#

plz help

distant cobalt
#
const attachment = new Discord.MessageAttachment(canvas.toBuffer(), 'approve.png')
.attachFiles([attachment])```

How come the image isn't in the image? How do i fix?
slender thistle
#

Jesus lord, just use get_member

#

Why the converter

vale garden
#

cuz i tried that and it didnt work bruh

slender thistle
#

Fun

#

I'm curious about how that wouldn't work

vale garden
#

so am i

#

it worked perfectly fine yesterday

#

and the code wasnt even changed

#

oh hsit

#

shit

#

i know why

#

its due to perms

#

skskskskk

slender thistle
#

Are you legitimately silencing your errors

vale garden
#

well i have to

#

and i just realized i did

#

ok what am i saying i didnt have to

#

but i forgot that i did

lyric mountain
#

Woops, wrong reply

summer torrent
mellow kelp
#

you must have some invalid option in your tsconfig

summer torrent
#

which one

mellow kelp
#

that just happened to me today

#

I think its module

#

It should be in "CommonJS"

crimson vapor
#

is that js?

tribal siren
#

is that python

crimson vapor
#

or ts?

summer torrent
#

is it case sensitive

mellow kelp
#

thats ts

summer torrent
#

mine is 'commonjs'

mellow kelp
#

hmm

earnest phoenix
#
"moduleResolution": "node", "esModuleInterop": true
tribal siren
#

i think if it's python it is supposed to look like from discord-akairo import { Command }

mellow kelp
#

moduleResolution wasn't necessary for me but its worth trying

tribal siren
#

oh

earnest phoenix
#

@tribal siren thats typescriot lol

tribal siren
#

oooh

#

im not ur helper then

summer torrent
#

vscode intellisense suggested me to use CommonJS

#

time to try

mellow kelp
#

yea it should be commonjs

earnest phoenix
#

@summer torrent yo

#

"moduleResolution": "node", "esModuleInterop": true

#

These too

#

Add these too

summer torrent
#

hold on

#

same

opal plank
#

aaaah finally my shackles are free

crimson vapor
#

hello Erwin

#

were you working?

opal plank
#

hello

#

yeah was making an API wrapper

#

just published it

#

took a whole day

mellow kelp
#

cool

#

whats the api?

opal plank
#

for genshin impact

#

Teyvat API

summer torrent
#

my tsconfig: json { "compilerOptions": { "module": "CommonJS", "target": "ES2020", "outDir": "dist", "lib": [ "ES2020", "ESNext.Array", "ESNext.AsyncIterable", "ESNext.Intl", "ESNext.Symbol", "ESNext.String", "DOM" ], "sourceMap": false, "inlineSourceMap": true, "inlineSources": true, "incremental": true, "esModuleInterop": true, "moduleResolution": "node", "experimentalDecorators": true, "emitDecoratorMetadata": true, }, "include": [ "src/**/*" ], "exclude": [ "node_modules" ] }

opal plank
#

no strict?

mellow kelp
#

ah yes

#

chika s l a p

opal plank
#

add strict to ts

mellow kelp
#

yea

opal plank
#

watch: true

mellow kelp
#

wait watch?

opal plank
#

yeah

mellow kelp
#

well maybe its necessary

opal plank
#

its just handy

mellow kelp
#

well probably

summer torrent
#

what does watch do

mellow kelp
#

i just run ts-node-dev for development

mellow kelp
opal plank
#

helps recompiling

summer torrent
#

oh

mellow kelp
#

ah yes

#

Debbuging: NotAGenshinBot

unreal cliff
mellow kelp
#

wait wut

#

is that possible

earnest phoenix
#

New stuff

opal plank
#

not for most

earnest phoenix
opal plank
#

its still whitelisted

unreal cliff
#

had to manually do requests

opal plank
#

its all cool n shit but it seems like an annoying thing to do

unreal cliff
#

not in any library yet

#

actually it will be pretty easy once the major libraries adopt it

opal plank
#

imagine 20 bots with a help command

unreal cliff
#

its just an event

opal plank
#

ik

#

i've played it it before it came out

summer torrent
mellow kelp
#

yeah im pretty sure

fierce ether
#
    "port": 3000,
    "clientId": "",
    "clientSecret": "",
    "scopes": ["identify", "guilds"],
    "redirectUri": "http://localhost:3000/authorize/callback"
}``` how can i add my own domain instead?
mellow kelp
#

whats that?

fierce ether
#

wdym?

lyric mountain
#

Oauth2

mellow kelp
#

you gotta add a redirect uri with your domain on the oauth2 section of your app

fierce ether
lyric mountain
fierce ether
#

so just change redirect? and add the redirect in Oauth2?

mellow kelp
#

yeah

#

oauth2 is pretty cool isnt it

fierce ether
#

i get this now

mellow kelp
#

that's something on the server

fierce ether
#

using freenom for now

lyric mountain
fierce ether
#

wdym

#

app.listen(port, () => console.info(`Listening on port ${port}`));

#

?

lyric mountain
#

Else you'll get an unauthorized status

fierce ether
#

is there a reason it does that screenshot?

lyric mountain
fierce ether
#

still does it

lyric mountain
fierce ether
lyric mountain
#

Did u configure the dns?

fierce ether
#

no

#

wat does it need to be?

lyric mountain
#

Your server's ip

fierce ether
#

what server?

lyric mountain
#

Your vps

fierce ether
#

i dont have one atm

lyric mountain
#

What are you using to handle the oauth2?

fierce ether
#

localhost

lyric mountain
#

No

#

Localhost only exists on ur pc

#

It's like saying "here"

fierce ether
#

its only running off my pc atm

#

and heroku

delicate shore
#
Error: listen EACCES: permission denied MY IP
    at Server.setupListenHandle [as _listen2] (net.js:1301:21)
    at listenInCluster (net.js:1366:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1503:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:8)
Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1345:8)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  code: 'EACCES',
  errno: -13,
  syscall: 'listen',
  address: 'MY IP',
  port: 80```
#

I get this error

lyric mountain
#

You can't use localhost anywhere outside ur pc

delicate shore
#

for testing discord slash cmds

lyric mountain
#

Because "here" is wherever your "here" is

fierce ether
#

so what do i do?

lyric mountain
#

Buy a vps

#

Else no custom domain

fierce ether
#

ok then once i done that

lyric mountain
#

Some site builders also allow custom domains ig, not free tho

#

Probably more expensive than a vps

fierce ether
lyric mountain
fierce ether
#

how do i get auth code?

lyric mountain
#

In this case, your vps ip

delicate shore
lyric mountain
lyric mountain
fierce ether
#

see i dont understand

lyric mountain
crimson vapor
lyric mountain
#

So you can have 100% sure it's coming from top.gg

crimson vapor
#

you shouldn't need the protocol

lyric mountain
#

Because it's not valid

crimson vapor
#

wait what are we helping with?

lyric mountain
#

Your domain doesn't have a server, or anywhere to go

#

It's just a name

fierce ether
#

so i need to buy vps

lyric mountain
#

Nothing more

fierce ether
#

before

#

then add that?

lyric mountain
#

Yes

#

Heroku doesn't open ports afaik, so your only resort is a vps

#

Also note that, despite having a vps, you'll also need a webserver

#

To handle the requests

fierce ether
#

how much is that?

lyric mountain
#

You need code

#

Webhooks will only send the url a request containing vote data, nothing more

crimson vapor
lyric mountain
#

It's up to you how you'll handle it

fierce ether
#

that works?

lyric mountain
lyric mountain
#

You need to handle it

crimson vapor
#

could use a sdk or whatever they are called

#

idk maybe not the name

lyric mountain
#

Sdk?

crimson vapor
#

yeah it isnt

#

umm

#

its like

opal plank
#

yeah

#

its sdk

crimson vapor
#

ok

opal plank
#

@top-gg/node-sdk

#

they deprecated dblapi

crimson vapor
#

dblapi was pog

opal plank
#

it did its job, wasnt anything too fancy

crimson vapor
#

yeah

lyric mountain
#

It was like iexplorer

crimson vapor
#

which made it pog

opal plank
#

i mean the new one is likely better

crimson vapor
#

didn't have to deal with shit not working

#

probably

mellow kelp
#

probably

crimson vapor
#

anyone here use json as storage and wanna find the most common letters?

lyric mountain
#

Stopped reading at "json as storage"

hollow sedge
#

What's the difference between json and any other string

crimson vapor
#

none

crimson vapor
hollow sedge
#

Then why not just iterate over each character and save the amount of occurences

crimson vapor
#

thats what I want

#

I want to know the most common letters

hollow sedge
#

But...did I not just tell you how to do it?

crimson vapor
#

I want it of other people's jsons

#

so I can make the most efficient code

hollow sedge
#

What

lyric mountain
#

Not using jsons is a good start

hollow sedge
#

Yeah ^

crimson vapor
#

well yeah ik that

#

basically I want to know the most common letters people use when they use JSONs

lyric mountain
#

Btw, common letters in jsons would teach nothing

hollow sedge
#

I don't know what "jsons" are

#

Wouldn't you just need the values

#

That doesn't help

lyric mountain
#

Like, json is a simple key-value structure

#

Nothing more

crimson vapor
#

ik

mellow kelp
#

like

#

most used chars in json

lyric mountain
#

There's no "commonly used" letters

crimson vapor
#

but if you replace every occurance of a letter with a word it would make more sense to have the most used letter as the shortest word

hollow sedge
#

WHAT DOES THAT MEAN?

lyric mountain
mellow kelp
#

e.j {, }, ", etc

hollow sedge
#

I think we need to know why you help you

#

Why are you trying to get the most used chars in a json string

crimson vapor
#

poggers

mellow kelp
#

because of a thing i made LMAO

hollow sedge
#

sigh

#

You two have fun

lyric mountain
#

You're likely trying to count sand grains in a beach

hollow sedge
#

Yeah

#

It's not worth it

#

And not useful

lyric mountain
#

Also it won't teach u anything about the beach

hollow sedge
#

Lol

lyric mountain
#

Only that it's made out of sand

mellow kelp
#

well this is more of joke anyways

hollow sedge
#

The joke will become much slower than before

crimson vapor
#
  "0": 4471,
  "1": 7660,
  "2": 5314,
  "3": 4899,
  "4": 4918,
  "5": 4859,
  "6": 4930,
  "7": 5304,
  "8": 4517,
  "9": 4301,
  "{": 2467,
  "\"": 14642,
  "l": 4787,
  "e": 4824,
  "v": 2393,
  "s": 5,
  ":": 7286,
  "x": 2427,
  "p": 2427,
  ",": 4820,
  "}": 2467,
  "g": 1,
  "u": 3,
  "i": 36,
  "d": 1,
  "r": 38,
  "f": 35,
  ":tm:": 35,
  "️": 35,
  "o": 1,
  "w": 1,
  "n": 1,
  "t": 1
}```
#

my json

mellow kelp
#

wat

hollow sedge
#

Ok

#

What's wrong with that

crimson vapor
#

a lot

lyric mountain
#

Who uses numbers in keys?

crimson vapor
#

not just keys

#

everything

hollow sedge
#

Those are valies

#

Values

#

Oh wait

crimson vapor
#

all

hollow sedge
#

He's counting characters for each one I think?

#

THIS LITERALLY MAKES NO SENSE

crimson vapor
#

````{}`.split('').forEach(e => x[e] ? x[e]++ : x[e] = 1)```

mellow kelp
#

whats x

hollow sedge
#

WHY ARE YOU SPLITTING IT

crimson vapor
#

because I needed to run it once

lyric mountain
#

Congratz, you just discovered that jsons are made out of LETTERS

hollow sedge
#

why not just iterate over the string

summer torrent
#

@mellow kelp i get exports is not defined error in compiled files bloblul

crimson vapor
#

I don't need to make hella efficient code if I run it once

lyric mountain
#

Such a breakthrough

hollow sedge
#

It's not about efficiency

#

But think about it

summer torrent
#

sure

mellow kelp
#

well thats a first

hollow sedge
#

If you have a big json file, you will be splitting every single character in it

#

And storing it temporary in a list

opal plank
hollow sedge
#

IN MEMORY

crimson vapor
#

I only need to do this once

lyric mountain
#

Strings are already arrays

#

Char arrays

hollow sedge
#

Yeah

lyric mountain
#

I still don't get the reason tho

hollow sedge
#

Why not just store the count of each one in a dict and then sort it after

#

Why does all the code have to be one line

crimson vapor
#

basically I want to be an idiot and introduce some shit code as a joke

hollow sedge
#

Why are we here, just to suffer?

crimson vapor
#

but I don't want it to fuck my cpu

#

so I need to make it more efficient

hollow sedge
#

Instead you destroy your memory

#

Smart move

lyric mountain
crimson vapor
#

how, I posted some example code that was fast to write

#

and I only need to use it once

hollow sedge
#

Your code is taking all the characters from the string and building an array

#

Which isn't necessary anyway

lyric mountain
opal plank
#
for(let c of String) x[c] ? x[c]++ : x[c] = 1
lyric mountain
#

Like doing chmod 777 -R /

hollow sedge
#

Omg

#

NO WAY

#

GOOD CODE ON ONE LINE

opal plank
#

more performant and arguiably smaller

#

forEach() is shit

mellow kelp
#

wasnt foreach faster?

#

or does it depend

opal plank
#

other way around

#

forEach() is the least performant of the loops

hollow sedge
#

Is there a reason to use forEach

lyric mountain
#

Foreach creates an anonymous method or something like that

opal plank
#

it has it uses, but its garbage performance wise

mellow kelp
#

oh well

#

im gonna try some tests just in case

hollow sedge
#

I mean you can write terrible code but the one you wrote could easily break

#

will*

opal plank
#

mine?

hollow sedge
#

No

#

Theirs

opal plank
#

o

mellow kelp
#

o

lyric mountain
#

Also always remember kids: you never delete something from an array during its iteration

mellow kelp
#

YEAH that thing

#

i remember when I used to do that when i was starting

#

oh boy

hollow sedge
#

That moment when your poggers db needs a method to get highest-occurring character in a JSON string

opal plank
#

OH, thats what we doing?

#

you want shit code?

crimson vapor
#

you guys still mad at me?

opal plank
#

cracks nuckles

lyric mountain
#

Next goal: store a sqlite binary inside a mongodb

crimson vapor
#

mongodb maxes at like 16mb iirc

hollow sedge
#

No one was mad at you, your code was just funny

#

WHAT

crimson vapor
#

doc size

hollow sedge
#

oh ok

#

I was about to yell at you

lyric mountain
crimson vapor
#

nope

#

never used sqlite

hollow sedge
#

Why would you

crimson vapor
#

Erwin I don't think I can let you continue typing

hollow sedge
#

When you have a poggers db

crimson vapor
#

exactly

#

no corruptions™️
no tests™️

hollow sedge
#

Million you got to sell that stuff

mellow kelp
#

yes

crimson vapor
#

poggers

hollow sedge
#

Microsoft would buy it

mellow kelp
#

you bout to get richer than bill gates

crimson vapor
#

they should store their data in .poggers

hollow sedge
#

You can finally live up to your name

crimson vapor
#

yes

mellow kelp
#

"the million poggers man"

lyric mountain
#

Best and most secure db: PoggersDB

#

No failures, no bugs, smallest size

crimson vapor
#

LOL

mellow kelp
#

"so secure, the decryptor might actually fail sometimes"

lyric mountain
#

Also, there's no db at all

hollow sedge
#

A new NoSQL database set to surpass MongoDB

lyric mountain
#

You can't have errors if you don't have a db

mellow kelp
#

oh boy

#

the man said it

queen needle
crimson vapor
#

ty

cosmic monolith
#

don't use DB, store data in JSON

hollow sedge
#

Oh god

cosmic monolith
crimson vapor
#

POGGERS repeated 1 million times is 7 mb

hollow sedge
#

There's an npm package now :(

mellow kelp
#

im ditching mysql and mongodb from now on

lyric mountain
crimson vapor
#

always has been

queen needle
#

million made it

summer torrent
#

@mellow kelp idk how. But i fixed it

mellow kelp
#

the hottest million dollar idea

lyric mountain
#

Filenames don't affect file size /s

crimson vapor
#

imagine

mellow kelp
#

mind size MEGA

crimson vapor
#

using file name as storage

hollow sedge
#

Can't wait for some random kid to come here and ask why their discord bot that uses poggers db keeps running out of memory

crimson vapor
#

I like your idea

summer torrent
mellow kelp
#

Poggers penguin

queen needle
#

file name db would be intresting

summer torrent
#

i just removed 'type': 'module' from package.json

lyric mountain
crimson vapor
cosmic monolith
crimson vapor
#

my on ready event

mellow kelp
summer torrent
#

stealed

earnest phoenix
#

use discord as your db 🧠
150ms access time is a feature, not a bug!

mellow kelp
#

yeah if i saw your package.json i wouldve known

#

that makes node run scripts as es modules

crimson vapor
hollow sedge
summer torrent
mellow kelp
#

you can save memory by deleting system32

cosmic monolith
lyric mountain
queen needle
#

use your brain as db

hollow sedge
#

:ooo

summer torrent
hollow sedge
#

That's the future

mellow kelp
#

BIG BRAIN

crimson vapor
hollow sedge
#

YO WHAT

#

Is that actually a thing

mellow kelp
#

who needs databases when you got your brain

hollow sedge
#

Can bots have notes

#

Nah

crimson vapor
#

I don't think so

hollow sedge
#

What am I thinking

#

Poggers.db had corrupted me

summer torrent
#

i remember i saw something about notes in djs docs

crimson vapor
#

anything can be a db if you try hard enough

mellow kelp
#

indeed

crimson vapor
queen needle
#

bob has about 5 coins or something

lyric mountain
#

From the same creators of "SwiftKey Ninja Pro theme": Windows Explorer Ninja Pro theme

summer torrent
#

use new Map()

lyric mountain
#

No filenames

#

Only icons

delicate shore
#

GUYS I DID IT

summer torrent
delicate shore
#

I DID IT

lyric mountain
#

Also no icons, they're a lie

hollow sedge
#

GUYS HE DID IT

mellow kelp
#

you can make a bot with wires and mechanical stuff that writes data into a piece of bread

queen needle
#

THEY DID IT

delicate shore
#

I DID IT

hollow sedge
#

YO

delicate shore
#

SLASH COMMAND

#

I DID IT

hollow sedge
#

HE DID IT

mellow kelp
#

HE DID IT BOYS

delicate shore
#

HYPE GUYS

crimson vapor
earnest phoenix
crimson vapor
#

hmm

mellow kelp
#

"in the future, everything will be chromium"

earnest phoenix
#

chromium is cancer

mellow kelp
#

well guess what

delicate shore
mellow kelp
#

discord runs on chromium

delicate shore
#

I DID

sudden geyser
#

yeah (╯°□°)╯︵ ┻━┻

earnest phoenix
#

ik lol

fierce ether
#

<button class="btn login-btn btn-outline-accent my-2 my-sm-0" style="font-size: 10px !important;font-family: poppins !important;" href="/authorize">LOGIN</button> nothing happens?

crimson vapor
#

discord uses so much ram

#

more than chrome at times

mellow kelp
#

yea

lyric mountain
summer torrent
#

imagine not using opera

mellow kelp
#

freakin electron

hollow sedge
#

Electron is cool

earnest phoenix
crimson vapor
#

so I can use extentions

summer torrent
#

nO

mellow kelp
#

i use microsoft edge

sudden geyser
#

what happened to native apps 😔

mellow kelp
#

its pretty fast

hollow sedge
#

Electron is the future

summer torrent
#

opera best

crimson vapor
summer torrent
hollow sedge
#

Electron is now

earnest phoenix
#

electron is cool but it's such a ram chonker

crimson vapor
#

yo

mellow kelp
cosmic monolith
#

waiting for a Electron operating system with nodeos

lyric mountain
crimson vapor
#

who wants to code filename.db for jason.db?

odd stratus
#

Hey, does anyone know how I can fix this?

This method always worked for me with Quick.db but doesn't seem to work with MongoDB.

opal plank
#
    let alp = 'abcdefghijklmnopqrstuvwxyz'.split(''),
      map = new Map(),
      str = 'Im sexy and i know it';

    for (let e of alp) {
      let exp = new RegExp(`${e}`, 'g'),
        match = str.match(exp);
      if (match?.length) map.set(e, match.length);
    }
    console.log(map);
    message.channel.send(JSON.stringify([...map], null, 2), { split: true });

There, proper cursed code

earnest phoenix
sudden geyser
summer torrent
sudden geyser
#

yes you can write an os in Node.js

crimson vapor
#

im not gonna be reading that Erwin

hollow sedge
#

People can afford it

crimson vapor
#

too many lines of brainfuck

hollow sedge
#

You don't deserve discord if you don't have 8 GBs

fierce ether
#

<button class="btn login-btn btn-outline-accent my-2 my-sm-0" style="font-size: 10px !important;font-family: poppins !important;" href="/authorize">LOGIN</button> nothing happens?

mellow kelp
#

we did it boys

hollow sedge
#

At least

lyric mountain
#

Actually, there's a js OS

mellow kelp
#

"several people are typing"

earnest phoenix
fierce ether
#

i am?

hollow sedge
#

"apps and games"

#

Wait what

earnest phoenix
#

yeah

hollow sedge
#

Games?

mellow kelp
#

unity will remember that

earnest phoenix
#

you can use their API to render html/css/js in your game

opal plank
earnest phoenix
#

since it's c++

hollow sedge
#

Ohh

#

That's really cool

crimson vapor
#
return this.options.caching ? this._data ? this._data : (this._db._read())[this.name] : (this._db._read())[this.name];``` good code?
mellow kelp
#

oh god why

sudden geyser
#

Writing an OS in Node.js is the same as bdsm torture if you're into that

#

nested ternary expressions 🤢

crimson vapor
lyric mountain
#

Did u just use bdsm and torture in the same sentence?

cosmic monolith
earnest phoenix
#

lightweight
using node.js
proceed to laugh

crimson vapor
#

wait

cosmic monolith
sudden geyser
crimson vapor
#

node is single threaded

earnest phoenix
#

by default yes

#

you can use worker threads though

crimson vapor
#

I guess they must have spent time doing that

earnest phoenix
#

but worker threads are so stupid

crimson vapor
#

wait

cosmic monolith
crimson vapor
#

I should add worker threads to jason.db?

earnest phoenix
#

you lose the main feature you'd use threading for; synchronization

crimson vapor
#

WorkerDB

#

extends PoggersDB

odd stratus
crimson vapor
odd stratus
#

🤔

lyric mountain
#

Node threads are like releasing a bunch of balloons to the sky

crimson vapor
lyric mountain
#

They'll fly but....what else?

mellow kelp
#

since they're async

crimson vapor
#

so who wants to add FileNameDB to jason.db? or do I have to do it?

odd stratus
#

Oh weird it works on quick.db though

earnest phoenix
odd stratus
#

Ima try with await though

crimson vapor
lyric mountain
odd stratus
#

ye

lyric mountain
#

Or if they'll fall someday

sudden geyser
crimson vapor
#

or if they somehow popped

odd stratus
#

Thanks :) @mellow kelp @crimson vapor

crimson vapor
#

mongodb returns promises

mellow kelp
#

no problem freerealestate

mellow kelp
crimson vapor
#

jason.db doesnt

mellow kelp
#

LMFAO

odd stratus
#

Yeah I was hella confused when I console logged it at first

crimson vapor
#

mongodb is a good db

#

jason.db exists

mellow kelp
#

jason.db is a better db

opal plank
#

i updated it

mellow kelp
#

(jk never use it in your entire life)

opal plank
#

Much better now

    var alp = 'abcdefghijklmnopqrstuvwxyz'.split(''),
      map = new Map(),
      str = 'Im sexy and i know it';

    for (let e of alp) {
      let exp = new RegExp(`${e}`, 'g'),
        match = str.match(exp);
      map.set(e, `${match.length}`);
    }
    console.log(map);
    message.channel.send(JSON.stringify([...map], null, 2), { split: true });
sudden geyser
#

jasawn.dbee

odd stratus
#

Just switched to MongoDB from quick.db, feels much better

#

Holy

mellow kelp
#

jaysown.deebee

crimson vapor
#

Erwin could you make a function that grabs a in a specified folder and renames it to a stringified json?

opal plank
#

a what now?

crimson vapor
#

shh

#

its like 11

mellow kelp
#

🅰️

opal plank
#

{} is blacklisted

crimson vapor
#

it is?

#

damn it I guess we will have to use a replace function

lyric mountain
crimson vapor
#

can jason.db just be a complation of useless dbs?

#

thats what I want

mellow kelp
#

aight

#

first

crimson vapor
#

but like actually working

mellow kelp
#

lmao k

#

what other useless stuff can it have

cosmic monolith
old cliff
#

I finally did it ! I finally coded a cloudflare worker which forwards the request to the specified port !!!

crimson vapor
#

lol

lyric mountain
#

I'll make a trashbin db, the data will not use space because it's already deleted /s

opal plank
#

this is the regex i use

mellow kelp
#

ah yes, my best friend regex

opal plank
#

actually

#

{} is valid

#

so yes, its doable

crimson vapor
#

can you send that so I can copy it

#

time to plan this code

opal plank
#

spoonfed

#

no

crimson vapor
#

LOL

opal plank
crimson vapor
#

its

lyric mountain
#

Regex is an introvert, because it can't express itself

crimson vapor
#

a fucking string

opal plank
#

why u asking for a 2 line code?

crimson vapor
#

LOL

mellow kelp
#

yo that dog emoji is epic

crimson vapor
#

alright ill just make a shittier version of it

mellow kelp
crimson vapor
mellow kelp
#

i got an idea

#

an incredible idea

#

a database that hashes data with bcrypt so that it becomes almost near-impossible to decrypt ever again

crimson vapor
#

lol

mellow kelp
#

isnt that great

crimson vapor
#

no

#

the one requirement is that it needs to work

#

and not fuck the cpu

#

memory is ok

opal plank
#

wait until they realise thats how you "securely" store tokens and personal info in databases

cosmic monolith
sudden geyser
#

linked lists

mellow kelp
#

who would have thought

crimson vapor
#

he means the entire db

#

so

mellow kelp
#

isnt a write-only database revolutionary

crimson vapor
#

why

opal plank
#

you guys want fuckery?

crimson vapor
mellow kelp
#

i mean

#

you cant even read it again

cosmic monolith
#

now we need a read-only database

lyric mountain
#

What about a database that stores the word obama for each entry?

odd stratus
#

Does anyone know how I can get my MongoDB's connection url so I can run it from another machine

lyric mountain
#

ObamiumDB

mellow kelp
#

Yes

crimson vapor
#

have you read the code for poggers yet?

mellow kelp
#

nope

crimson vapor
#

its quite something

mellow kelp
#

im working on my bot thing

#

oh no

#

that cant be good

crimson vapor
#

just the encryption I mean

mellow kelp
#

MY PRECIOUS CODE IM GOING

lyric mountain
crimson vapor
#

make sure the port is open and you setup authentication

hollow sedge
opal plank
#
let epoch = Date.now();
let newArrayIndex = epoch.toString().charAt(epoch.toString().length - 1)

Done, now like Lua, make it so that index is the new index at which arrays start.
If the last digit of epoch is 8, arrays start at 8;
This would change everytime you restart your node and its almost impossible to detect since theres ms of delay between operations and you cant reliably get the same epoch timestamp of when whoever made the noodle code ran the function

crimson vapor
#

im already working on FileNameDB

mellow kelp
#

yes

#

obama must be unique tho

#

we need useless ideas

opal plank
#

i gave one right above your msg but nobody read

#

random array indexer

#

Lua starts at 1? pff, plebs, my indexes start based on last epoch digit

mellow kelp
#

pfft

#

my arrays start at the end

lyric mountain
#

Next id is cheetos, and you can never reach the third id because it'll yell to stop the count

cosmic monolith
#

my arrays starts at Math.min()

crimson vapor
#

my arrays start at 0

old cliff
crimson vapor
mellow kelp
#

how about

#

a database

#

that only stores data as long as the code is running

old cliff
#

unless you are storing passwords

mellow kelp
#

and when the program finishes it deletes everything

cosmic monolith
#

TempDB

slender thistle
#

So

mellow kelp
#

like the files i mean

#

yes

slender thistle
#

RAM

mellow kelp
#

you see

slender thistle
#

But in files

old cliff
mellow kelp
#

it has many benefits

slender thistle
#

Fun

opal plank
#

@slender thistle yes u

mellow kelp
#

you store data

opal plank
#

wheres ts u cuko

#

even Tim agree shiv, where the heck u at?

cosmic monolith
mellow kelp
#

even though its gonna be deleted from storage as soon as the code ends,

#

you don't have to worry about ever running out of storage space

cosmic monolith
#

import a ramdisk npm package, and then use FileNameDB there

old cliff
#

lol @mellow kelp

odd stratus
#

reeee

cosmic monolith
mellow kelp
#

Which is better

#

StoriesDB

#

or

#

TempDB

slender thistle
#

Non-existent

#

Or, rather, not working

opal plank
slender thistle
#

No idea

opal plank
#

im not saying you should steal someones pc or going for a job that would require grinding in a pole

#

im just saying its only bad if someone catches you doing it

slender thistle
#

KEKW if only there was someone to steal one from

opal plank
#

pole dancing doesnt seem like a bad option

slender thistle
#

Yeah

#

Except I've got something poking out between my legs

opal plank
slender thistle
#

xd baka

opal plank
#

legit though, Ts is life, Ts is love

crimson vapor
#
const fs = require('fs');

class FileNameDB {
  constructor(folder, options = { startString: 'OBAMA' }) {
    this.options = options;
    this.folder = folder;
    if (!fs.existsSync(this.folder)) throw new Error('The folder must already exist.');
    console.log(this._getData());
  }
  
  _getFile() {    
    const dir = fs.readdirSync(this.folder, 'utf8');
    const fileArray = [];
    dir.forEach(e => {
      if(e.startsWith(this.options.startString)) fileArray.push(e);
    });
    if(fileArray.length === 0) throw new Error(`There are no files in the folder that start with "${this.options.startString}"`);
    if(fileArray.length > 1) throw new Error(`There are ${fileArray.length} files in the folder that start with ${this.options.startString}`);
    return fileArray[0];
  }

  _getData() {
    const fileName = this._getFile();
    return JSON.parse(fileName.slice(this.options.startString.length));
  }
}

module.exports = FileNameDB;
``` status so far
hollow sedge
#

Isn't there something more useful you could be doing

crimson vapor
#

nah

pale vessel
#

typical million behavior

#

which is why we love him

crimson vapor
#

yes

#
  _clean(data) {
    data = JSON.stringify(data);
    let str = '';
    for (const c of data) { str += dataMap[c] ? dataMap[c] : c; }
    return str;
  }``` someone yell at me and give me a better way to do this
sudden geyser
#

dataMap[c] ?? c

crimson vapor
#

smart

#

I forgot I could do that

pale vessel
#

remove the brackets while you're at it

crimson vapor
#

whats a char I can use that files can be named but but will not be used in a json

summer torrent
crimson vapor
#

you think you want data

#

but you actually want that

summer torrent
#

yes

swift cloak
mellow kelp
#

You have to set a route that sends the file

#

Instead of accesing it directly

crimson vapor
#

or you can use folders

#

and index.html

#

iirc

mellow kelp
#

Yea

fierce ether
#

<p class="card-title" style="font-size: 50px !important;line-height: 15px !important;letter-spacing: -0.06em !important;font-weight: bold !important;"><client.guilds.cache.size></h1>

res.render('index', {pageTitle: 'Bucks Discord Bot', user: req.session.user || null, client: client}); no error jus nothign shows

crimson vapor
#

thats what I do KEKW

earnest phoenix
#

you can also just create a rewrite rule lol

fierce ether
#

wdym

mellow kelp
#

Big brain move right there

earnest phoenix
#

i just use rewrite <regexp> $1$2 permanent on nginx

#

super easy

crimson vapor
#

I have so far gotten to reading and parsing data as well as cleaning it but I need to figure out how to write

earnest phoenix
#

dont forget to make it support concurrency lol

crimson vapor
#

huh

earnest phoenix
#

this is the part where people choke and corrupt their files

crimson vapor
#

nah no

#

fuck that

earnest phoenix
#

google concurrency and concurrent access

crimson vapor
#

why can't I fucking unlink OBAMA.OBAMA

#

reeeee

#

wait ik why

#

rip

#

my dream

#

NOOOOOOOO

#

file name max length

mellow kelp
#

Aw shoot

#

Then how about

#

A folder per collection

#

Each file inside has the name of a key:value pair

swift cloak
#

it shows this

#

wait

mellow kelp
#

No like

#

Make an index.html in each folder

crimson vapor
#

it is

#

you need to run the code

mellow kelp
#

O

crimson vapor
#

well yes

#

he needs an index.html

swift cloak
#

i have an index.html

crimson vapor
#

in /example folder?

swift cloak
#

wait

#

no

old cliff
#

how to code / commands ?

earnest phoenix
old cliff
#

ok ty

#

hmm

#

its more like the guilds.join thingy

mellow kelp
#

Does discord.js support slash commands yet?

twilit geode
#

Im gonna go ahead and assume that in-memory storage would be in ram?

earnest phoenix
#

yes

twilit geode
#

herm

#

let us all recall how much a pi3 has ram wise xD

crimson vapor
#

1gb?

twilit geode
#

yea I think so

#

not much...

crimson vapor
#

POG

#

it worked

mellow kelp
#

YES

crimson vapor
twilit geode
#

PLACEHOLDER

crimson vapor
#

I can't do string replacements due to limitations

twilit geode
#

herm

crimson vapor
#

I need to shorten placeholer

mellow kelp
#

Dang

twilit geode
#

ph

swift cloak
#

all the dir

crimson vapor
#

make sure there is a express.public() on the folder

swift cloak
#

like

mellow kelp
#

*express.static

swift cloak
#

wat?

earnest phoenix
#

Do someone have a good hosting

#

free tho

fierce ether
#
    res.render('index', {pageTitle: 'Bucks Discord Bot', user: req.session.user || null, guild});```
```  <p class="card-title" style="font-size: 50px !important;line-height: 15px !important;letter-spacing: -0.06em !important;font-weight: bold !important;"><%guild%></h1>``` why does it not enter the guild size amount?
crimson vapor
#

good code

swift cloak
mellow kelp
#

Nope

#

Like

#

You should have a public/ folder

#

With your public files like html and that stuff

#

And then do

#

app.use(express.static('public'))

crimson vapor
#

rate my code please

mellow kelp
#

So that they get served as public files

mellow kelp
crimson vapor
#

rip

mellow kelp
#

Im supposed to be sleepin rn

crimson vapor
#

you should get the gh app

mellow kelp
#

I got it

crimson vapor
mellow kelp
#

Lmao yes

#

Wait same here

#

Bruh where do u live

crimson vapor
#

FL

mellow kelp
#

o

#

Poggers

crimson vapor
#

ye

#

honestly

#

who would have known you could rename a file to a json

#

ima start making weird shit with json

mellow kelp
#

Lmao

odd stratus
#

How long would it take for a bot to cache through about 150,000 members without the { fetchAllMembers: true } ?

crimson vapor
#

too long

odd stratus
#

._.

#

For some reason

#

When I use fetchAllMembers my level code and commands stop working

#

Not sure why

#

Idk if its cause the server the bot is in has too many members or something

pale vessel
#

Do you have the guild members intent?

odd stratus
#

Ye

crimson vapor
odd stratus
#

I need the forceful fetching for the users rank position

pale vessel
#

You can debug

odd stratus
#

Otherwise it shows as 0

crimson vapor
#

only fetch when needed

#

realistically fetch 10 at a time max

#

and only on user input

odd stratus
#

This is gonna take like 15 days mikebruh

crimson vapor
#

and then when your bot restarts

#

its gone

pale vessel
#

Debug

crimson vapor
#

anyway flaze

#

2 new features today

#

poggers and filename

mellow kelp
#

Yes

#

Isnt that poggers

pale vessel
#

how does filename work

mellow kelp
#

Stores data in file names

crimson vapor
#

you input a folder and it will choose a file to use the as the db

pale vessel
#

bruh

mellow kelp
#

We have successfully revolutionized the database industry

delicate shore
#

I'll ask my query when everyone's else query is solved
Because my problem will take some time

mellow kelp
#

Ye same

delicate shore
#

Okk

#

My issue is a long one and on the issues page of mongoose

#

Can you guys check it there

#

Noone has replied because many issues are there I doubt they'll reply me

#

So I'm asking here

crimson vapor
#

what version mongoose are you using?

delicate shore
#

V5.x

mellow kelp
#

Was that the last one?

summer torrent
mellow kelp
#

Indeed

crimson vapor
#

thats why I added typings to my code

#

so I can see that KEKW

mellow kelp
#

Ts is life

summer torrent
#

yes

crimson vapor
#

anyway

crimson vapor
delicate shore
#

Alright

mellow kelp
#

Ah yes

delicate shore
#

Btw I think I found the issue

crimson vapor
#

first method

#

always reinstall

mellow kelp
#

Oh cool

delicate shore
#

I have done GuildID : msg.guild

mellow kelp
#

Lmao yea that stuff happens

delicate shore
#

Lol

crimson vapor
#

wait

delicate shore
#

Lemme change that and see if it works

crimson vapor
#

because you can't place an object in a string

delicate shore
#

Yes indeed

#

If message mentions channels than its msg.mentions.channels.first().id

crimson vapor
#

oh I didn't see code

#

yea

delicate shore
#

Thanks

#

Now I should study for my tomorrow's exam

#

Haven't read a single thing

#

Bye

mellow kelp
#

Oh good luck then

#

Cya

delicate shore
#

Thanks

mellow kelp
#

Now i better go to sleep

crimson vapor
#

same

wicked sapphire
#

🌛

delicate shore
#

I have to tasks

#

I want to wait till first one is finished

earnest phoenix
#

if they're sync

#

doesn't that already happen by default

delicate shore
#

Wait

#

Yaa

#
    let messagechoose = new Discord.MessageEmbed()
    .setTitle(`Time to set the Message!`)
    .setDescription(`
Kindly send the message which you would like to set as welcome message . 
    **PlaceHolders** -
 1.` + " ` " + `{mention}` + " ` " + " - Mentions the user. For eg - @PGamerX "+
`2.` + " ` " + `{usertag}` + " ` " + " - Writes the username along with tag . For eg - PGamerX#7851 "
`3.` + " ` " + `{memberCount}` + " ` " + " - Writes the member count " )
.setColor("GREEN")

    const botMessage2 = await message.channel.send(messagechoose)```
#

TypeError: " - Writes the username along with tag . For eg - PGamerX#7851 " is not a function

earnest phoenix
#

what the fuck is that string

#

if you want to use backticks in your string just escape them lol