#development

1 messages · Page 1983 of 1

spark flint
#

I’ll reformat it

#

The whole message I mean

split hazel
#

yeah include fields for each like the specs, price/free tier eligible and maybe free trials

maiden nimbus
#

why most slash commands don't show emojis?

split hazel
#

and drawbacks perhaps like card required

boreal iron
spark flint
#

And because I’m online too much I can update when needed

maiden nimbus
#

@boreal iron Why don't I show emojis on most slash commands

spark flint
#

wdym

maiden nimbus
#

multi-guild

boreal iron
#

Asking the same question again doesn't make it more understandable

spark flint
#

Lol

quartz kindle
#

anyone tried this?

spark flint
#

Nope

maiden nimbus
#

I made slash commands on my public bot, updated it and set it up for everyone to use. In embeds on my slash commands, the bot doesn't want to show the emojis it displayed on regular commands.
@boreal iron

boreal iron
#

custom emojis?

split hazel
#

i'll make a raw list of my host experiences (not much)

maiden nimbus
#

do you know what is the problem?

boreal iron
#

Nah dude, I totally disabled and blocked most assets like emojis, and stickers off discord

spark flint
#

Smart

boreal iron
#

as they're fucking annoying

spark flint
#

I wanna block gifs

maiden nimbus
#

But, what I can do about it??

split hazel
#

azure - free $100 student credit every once a while (not sure how frequently) if your school has a microsoft account for you or you apply for it

contabo - good specs for a good price (sus tho)

aws - 12 month free VM instance and other goodies (please remember to cancel before 12 months)

about all i have right now

maiden nimbus
#

any idea?

boreal iron
#

make sure your bot actually has access to the emoijs

maiden nimbus
#

otherwise there would be no work on regular commands

spark flint
split hazel
#

aws makes it very difficult to turn/delete resources off lmao

spark flint
#

Yeah

split hazel
#

so make sure to keep a track of them

spark flint
#

They randomly charged £250 once

quartz kindle
#

WTF

spark flint
#

Luckily refunded because they admitted it was their fault

#

They counted bandwidth for something which I cancelled 2 months prior

split hazel
#

im gonna start using virtual credit cards soon for cloud providers

spark flint
#

Smart

#

Or just use better providers

quartz kindle
#

google compute engine changed their free tier from f1micro to n1micro or soemthing like that, free tier went from 512mb ram to 1gb ram

#

but they didnt change my account

split hazel
#

yeah they changed it

quartz kindle
#

so they started charign me normal price for the f1 micro

spark flint
#

Oh the fun’s of free shit

quartz kindle
#

lmao

split hazel
#

lmao

#

you always have to watch out

quartz kindle
#

imagine paying more for less power

split hazel
#

they also set the default disk to a premium disk which made me accumulate a 4 pence charge before i noticed

boreal iron
maiden nimbus
#

can someone send link for auctions

boreal iron
quartz kindle
#

lmao

spark flint
#

Found it

#

Best thing was, I was using free tier

split hazel
#

lmao

boreal iron
#

why hiding your email address?

split hazel
#

that is scary

spark flint
boreal iron
#

we will take care of it, trust us

split hazel
#

im gonna double check my aws to make sure i deleted all of my free usage stuff

spark flint
#

Nah seriously though, I get so much spam

split hazel
#

honestly though a cloud provider like aws can easily fuck people over

#

even big businesses

#

charge extra and claim its because they had a spike in traffic

sudden geyser
spark flint
#

Yeah

#

That remind me, i need to go pay for my 4 servers

sudden geyser
#

From a few hundred dollars to $48k because someone used your account to mine bitcoin

spark flint
#

Ah shit ignore me leaking my non proxied addresses

quartz kindle
split hazel
#

should i just pay my fuck up or dispute it lmao

boreal iron
sudden geyser
#

dispute it

split hazel
#

i mean its only 4 pence-

spark flint
#

Dispute it

#

Be petty

sudden geyser
#

you should be petty about money

quartz kindle
#

MY 4 CENTS

#

BACK OFF

boreal iron
#

Tim stupid

#

Didn't used my ref link

spark flint
#

This is a good deal tho (an 8gb ram server and 3 2gb ram servers for €12 a month)

split hazel
#

i'll dispute it then lmao

boreal iron
#

invest them in 0.00000000000000000000000000000000000001 bitcoins tho

split hazel
#

i'll gamble my 4p bill in bitcoin

#

bitcoin totally crashed right now which totally means it will totally go up

boreal iron
#

which totally means it will totally go up

#

which means it will totally crash after again

split hazel
#

you're just dead 💀

#

you dont know the way of crypto like an ambitious almost adult native person

boreal iron
#

you can't sell it if the value is high (enough) as nobody wanna buy it, and more and more governments are banning crypto stuff

#

that's how the world is

#

the average idiot thinking he can get rich by investing into bitcoin usually looses most or anything

split hazel
#

lmao

#

im gonna send this to my friend thats obsessed with crypto

#

facts

boreal iron
#

that's how it is, dude

#

don't expect an OS dev to know things about the real world aka. realitiy

split hazel
earnest phoenix
#

...

#

can I put array as type?

#

it seems obvious but idk

#

in my schema, in the cards: ```js
cards: {type: Array, default: {}}

split hazel
#

that should work

#

assuming you're using mongoose

earnest phoenix
#

ok

quartz kindle
#

why is the default an object tho?

round cove
#

Yeah why isn't it defaulted to empty array

#

Also type the array

#

Array<string>

earnest phoenix
round cove
#

Ah

earnest phoenix
#

it'll be like this: ```js
{"Giant", "Archers", "Minions"}

round cove
#

Square brackets

#

[]

earnest phoenix
#

yeah that

#

lol

round cove
#

{} Is for objects

#

Lmao

earnest phoenix
#

my bad

boreal iron
#

wouldn't even be a valid obj tho

round cove
#

Exactly

earnest phoenix
#

and can I do a subcategory?

#

like 4 rarities inside of cards?

rocky hearth
#

do I need to enable DIRECT_MESSAGES intent to dm a user?

earnest phoenix
#
cards: { common: {type: Array}, epic: {type: Array}
}
``` something like this?
boreal iron
round cove
#

So in this case for mongoose you'll just say it's type object.

#

Outside of that (and probably your default) you'll give it a body with values.

orchid nebula
rocky hearth
boreal iron
#

yeah might be the case

neat ingot
#

~ really feels like that sometimes 😦

boreal iron
#

lmao, that's how development works

solemn cipher
#

bug 420

earnest phoenix
#

I think mongodb is easy now

#

all the inventory (80% info) in a few lines

#

it'll be less in vsc, it's in replit's test bot

wheat mesa
#

oh my

#

that's a lot of data

neat ingot
#

mongodb is king

earnest phoenix
#

yeah

neat ingot
#

but you need to neaten your formatting 😛

earnest phoenix
#

yeah

neat ingot
#

so much prettier to view 😛

earnest phoenix
#

well it's in a test bot

#

will make it better when passing to vsc

#

Can I add data to it later?

#

I have some things planned to add (chests..., i want to add them later in the profile not now

rigid maple
#

I will be damned!

cinder patio
#

The callback doesn't get instantly called

#

at first asd will always be undefined

#

You should check if asd is undefined, and if it is render something else

rigid maple
cinder patio
#

yes

#

that's what you should do

lament rock
#

or pre-render the page and then polyfill the data in later

sudden geyser
#

Is it possible to forcibly block on a promise as opposed to using await

lament rock
#

block the whole thread?

sudden geyser
#

yes

lament rock
#

There was something cursed flaze sent where it used a while loop. You could hook in where it detects while a value is undefined

#

or spawn the logic off onto another thread. Idk if it offers a pause function

sudden geyser
#

Actually that gives me an idea. So something like this.

function block(promise) {
  let value;

  promise.then((val) => {
    value = val;
  });

  while (!value) {};

  return value;
}
sudden geyser
cinder patio
#

why would you ever want to do something like this

wheat mesa
#

flaz sent this a few days ago

sudden geyser
marble juniper
#

anyone knows docker and postgres

#

cuz im seriously frustrated lol

#

no point in me explaining the situation if nobody can help me

wheat mesa
#

I know some postgres with typeorm but I don't know docker

marble juniper
#

Well

#

Actually all I need to do is copy all the data from one remote postgres server to another remote postgres server

#

but idk how to do that

#

And yes I searched for this online

#

But didn't find anything helpful

#

That would also work on windows

boreal iron
#

dumb the database and import it?!

marble juniper
#

Yeah

#

b u t h o w

#

I know what I need to do

#

but not how

boreal iron
#

HUH?!

marble juniper
boreal iron
#

just login as database user or root and export the database

marble juniper
#

But

#

h o w

#

do I run some command or something

#

how the fuck do I export it

boreal iron
marble juniper
#

how do I install pg_dump on windows

boreal iron
#

there's nothing to install

#

all of it as for any other database engine is already on board

marble juniper
#

Bruh wdym

boreal iron
#

you gotta hop into your bin dir, open a command prompt and call the pb_dump.exe yourdatabase > filetostore.sql

#

may requires you to authentificate yourself, not sure here

#

you will see

marble juniper
#

The postgres server is not on my machine

#

im trying to dump the data from another machine

#

you know

boreal iron
#

well you can also do a remote dump

marble juniper
#

But I dont have access to the pg_dump command

#

cuz I don't have it on my pc

boreal iron
#

if you're fully broken and have no clue, then use any app, login into your remote db and let it do the job for you, using the UI

marble juniper
#

Fine ig

lyric mountain
#

it's quite easy to take a dump with postgres

boreal iron
#

How can you actually have no access to pg_dump?

lyric mountain
#

is there a bare minimum postgres install option?

#

maybe it doesn't come with any plugin

#

there's a way to make a backup without pg_dump, you just get way less options to customize what u dump

boreal iron
#

I think like he actually has no ssh access to his database machine

lyric mountain
#

tf

boreal iron
#

But I dont have access to the pg_dump command

#

I assume

#

He hasn't... idk

spark flint
#

iara_drops_all_tables

#

me

lyric mountain
#

like, maybe u can disable dump for some users

spark flint
#

getting my mongo hacked

lyric mountain
#

but that'd mean s/he doesn't have root access

boreal iron
#

STOP GUESSING, HE DIDN'T TELL US

#

That's why I asked

#

How can you actually have no access to pg_dump?

#

just let him use any sort of phpmyadmin tool, navicat or however they're all called

spark flint
#

how can i automatically get the userid from this message

@empty scarab Bump done! :thumbsup:
Check it out [on DISBOARD](https://disboard.org/server/886667952617844826).```
#

nodejs

marble juniper
#

Probably gonna use pgadmin

spark flint
#

ignore the fact i'm making a bump tracker - its specifically for private use to credit people for bumping

boreal iron
#

just get the mention?

marble juniper
#

Do you use discord.js or not

spark flint
#

the userid is always in the same place

#

discord.js

#

and its in embed description

#

so its not a mention

#

is it not

marble juniper
#

I think discord.js has parsers for it

boreal iron
#

It has

marble juniper
#

Just search the docs for these ig

#

Cuz I don't remember how they were called

lyric mountain
boreal iron
#

which means it takes the first result only

#

you should also cover the nickname mentioning format

#

<@USER_ID> and <@!USER_ID>

marble juniper
#

its a jetbrains product btw

lyric mountain
#

...yk, datagrip won't also

#

they both rely on pg_dump to generate a dump file

lyric mountain
marble juniper
#

Im pretty sure datagrip can just install the binaries necessary to operate the stuff

lyric mountain
#

not on remote

marble juniper
#

bruh

#

Well my situation is a bit more complicated cuz im using supabase

#

Which is a backend as a service

#

and the database is on there so yeah

#

Whatever im gonna ask in thier server instead

#

Cya

boreal iron
earnest phoenix
#

so in mongodb, $inc is increase, then $dec is decrease?

spark flint
#

ik its cringe

#

i also added ! removal underneath

boreal iron
#

just use preg match

#

/<@!?([0-9]+)>/

#

whoops php flash back

spark flint
#

even better

#

message.embeds[0].description.split('>')[0].replace("<@", "").replace("!", "")

wheat mesa
#

even better idea: use substring and indexof so your eyes don't burn

spark flint
#

my intention was to blind every dev

boreal iron
# spark flint even better

How about using match and a capture group?

const str1 = "@empty scarab Bump done! :thumbsup: Check it out [on DISBOARD](https://disboard.org/server/886667952617844826).";
console.log(str1.match(/<@!?([0-9]+)>/));

// Array ["@empty scarab", "798245188413816833"]
wheat mesa
#

regex is slow

boreal iron
#

you're slow

wheat mesa
#

and unreadable

boreal iron
#

you're unreadable

wheat mesa
#

true

#

personally if it's in the same spot every time, the substring will do the trick quite easily

boreal iron
#

waff... wall... wuff.. fflee.... I CAN'T

spark flint
boreal iron
#

SORRY FOR MENTIONING A PROFESSIONAL ALTERNATIVE WAY

shy turret
#

just a random poll sorta: do you guys prefer jwts or sessions?

sudden geyser
#

depends

#

I wouldn't use JWTs for sessions

#

but other stuff, like verification

acoustic reef
#

bruh i got ads in dms from a dude in this server

#

@fathom drift

#

fuck

#

can i just make a ticket somewhere or some stuff

sudden geyser
#

contact some mod

spark flint
acoustic reef
#

o wait i thought this was general

#

stupid me

earnest phoenix
#
import __prismaClient from '@prisma/client';

const prisma = new __prismaClient.PrismaClient();

async function main() {
    prisma.$on('beforeExit', async () => {
        console.log('disconnecting from database');
        await prisma.$disconnect();
        console.log('disconnected from database');
    });
    console.log('connecting to database');
    console.time('connected');
    await prisma.$connect();
    console.timeEnd('connected');
    console.log('connected to database');
}

main();

Console:

connecting to database
connected: 1:05.683 (m:ss.mmm)
connected to database

why it takes so long?

lyric mountain
#

datbase is on the same server?

earnest phoenix
#

is a mongodb cluster

earnest phoenix
#

I am redoing my portfolio and I want to know if this looks good (mostly speaking about the tabs up top) I want to know if the tabs look good or if I should just go with a typical nav

cinder patio
#

I like it

sudden geyser
#

The UI looks fine imo, except for the white bar at the top (but that's probably not intentional)

#

Though you could fix some of the grammar, like capitalizing "name" in the title and specifying what kind of developer you are

lyric mountain
#

just lowercase "My" and everything is fine

sudden geyser
#

That's how titles are written

lyric mountain
#

no

sudden geyser
#

At least formally.

lyric mountain
#

that's how name are written

#

not titles

sudden geyser
#

No, titles work like that too.

#

They could make the "My" lowercase if they wanted.

#

But formal titles use lots of capitalization.

cinder patio
#

my should be lowercase here though

#

uppercase letters are only used at the start of the sentence

#

or in names

sudden geyser
#

This is about titles.

#

not sentences

#

If I ever become an English teacher and see a student write "Hamlet's fight against Denmark" I will immediately fail them.

boreal iron
sudden geyser
#

Can bots use other bot's slash commands? For some reason, it's a permission on the developer portal.

boreal iron
#

Err no only clients should be able to

torn salmon
#

Hello how do I know when I can vote again with my bot on top.gg with a command?

boreal iron
#

By storing the timestamp when somebody votes

#

If somebody runs the command again check if 12h are already passed

torn salmon
#

thankyou for your answer

earnest phoenix
#

@lyric mountain So apparently klay is either correct or every dev site i've seen is wrong cause a lot of people do it like "Hello My Name is Mistyy"

spark flint
#

my name is NAME

earnest phoenix
#

I guess it comes down to preference

spark flint
#

yeah

earnest phoenix
#

I dislike this tho

#

It don't look right to me

#

this looks better to me

spark flint
wheat mesa
#

and are a beginner frontend dev

earnest phoenix
#

I fixed that grammar

#

I need to stop reading poorly translated manhua

#

:^)

marble juniper
earnest phoenix
#

I changed the capitalization in the h2

#

My Name -> my name

marble juniper
#

I see

#

Besides what is it that you are working on

#

Just a portfolio website or something?

earnest phoenix
#

👀

#

Yes

marble juniper
#

What u making it with

earnest phoenix
#

Nextjs + Mantine

marble juniper
#

Im always interested in website development so thats why im asking

marble juniper
earnest phoenix
#

React components and hooks library with native dark theme support and focus on usability, accessibility and developer experience

marble juniper
#

thats what I wanted to use as well!

#

Looked into mantine lately

earnest phoenix
#

Yea

#

I just discovered it last night

#

I prefer it now over chakra

marble juniper
#

Discovered it a few days ago

#

It seems pretty easy to use to me ngl

earnest phoenix
#

It really is

marble juniper
#

Chakra is more complicated ngl

#

Also bootstrap is disgusting

earnest phoenix
#
import type { NextPage } from 'next'
import {Container, Tabs} from "@mantine/core";
import About from "./about";
import Home from "./home";

const Main: NextPage = () => {
  return (
      <>
          <Container>
              <Tabs grow position="center" variant="outline">
                  <Tabs.Tab label="Home"><Home /></Tabs.Tab>
                  <Tabs.Tab label="About"><About /></Tabs.Tab>
                  <Tabs.Tab label="Projects" disabled>Third tab content</Tabs.Tab>
              </Tabs>

          </Container>
      </>
  )
}

export default Main

This is the entire "home" page

marble juniper
#

I personally love that I can just easily configure a primary color in mantine

earnest phoenix
#

It is how I display the content of different sites

marble juniper
#

Thats kinda what I wanted in other frameworks as well

earnest phoenix
#

I probably shouldn't be doing this as it doesn't change the url to that page it just stays on /

marble juniper
#

just like a single setting to change the primary color for everything

earnest phoenix
#

Yeee

marble juniper
#

My idea for mantine is to use it to make like a google docs

wheat mesa
#

I started messing around with mantine earlier, I like it but I have almost 0 experience with frontend frameworks so I still need to learn how react works in general

marble juniper
#

Same

#

I barely have any experience with react

#

Or actually web development in general

sudden geyser
#

what's that thing called when your app is fully rendered on the client side

marble juniper
#

Never really looked into it much but I wish I did

sudden geyser
#

I think it starts with an s

wheat mesa
#

Shitty?

marble juniper
#

Server side rendering?

sudden geyser
#

no but a good description of it

marble juniper
#

that wouldn't make sense though

sudden geyser
#

no not that either

earnest phoenix
#

I have 0 experience with react really I just know some stuff based on what i've seen other people use

wheat mesa
#

It’s called “something” mmLol

marble juniper
#

I don't use mantine with nextjs lol

earnest phoenix
#

You should

marble juniper
#

nextjs is a bit overkill imo so I just use vite

earnest phoenix
#

how is nextjs overkill?

marble juniper
#

Vite is pretty poggers

earnest phoenix
#

So I assume you don't use react all at do ya

marble juniper
earnest phoenix
#

Isn't vite a vue tool

marble juniper
#

no its not

#

bruh

sudden geyser
#

I want to go back to writing websites that receive all their UI and data from the server

earnest phoenix
#

Ah I see

marble juniper
#

vite is a tool for anything ngl

earnest phoenix
#

I heard it was a vue tool

marble juniper
#

Vite acts like a server

#

It servers ur website

sudden geyser
#

but there was this really interesting paradigm someone brought up in a video about the differences

marble juniper
#

And has features like hot reload etc

#

Vite is also super fast

boreal iron
marble juniper
#

You should read more about it here

earnest phoenix
#

Already looking at it

#

I'd prefer to use nextjs over it tho

marble juniper
#

Vite can be used in vue, react and also svelte

sudden geyser
#

History API, reloading, state management, security, etc.

marble juniper
#

I feel like if im just trying out mantine I don't need to use something like next.js

#

Besides im not doing anything on a production level

#

Thats all

boreal iron
#

I wasn’t speaking about JS at all my gosh

sudden geyser
#

oh yeah

#

php guy 🤮

boreal iron
#

What has php to do with frontend

marble juniper
#

But sure if you wanna use next.js go ahead I aint stopping you

boreal iron
#

Wtf is wrong with you

marble juniper
#

I personally just prefer vite

sudden geyser
#

what's wrong is I can't remember the word I'm looking for

marble juniper
#

Bruh

#

Time to shower cya in a bit

earnest phoenix
sudden geyser
#

YES THAT

earnest phoenix
#

Lmao

wheat mesa
#

Static

#

Static website

boreal iron
#

Tell me the word and i will remind you

earnest phoenix
#

It is what I currently do with my old portfolio

sudden geyser
#

yes that's what's been giving me a pain

earnest phoenix
#

How come?

sudden geyser
earnest phoenix
#

that link looks sketch /s

boreal iron
#

Clicked that link and the first thing I see are ads

#

My gosh

earnest phoenix
#

Use Brave

#

no ads

#

nerd

boreal iron
#

Video ads you genius

sudden geyser
#

you can still block those

#

if you try hard enough

coral sigil
#

ublock origin 😏

boreal iron
#

Something is wrong with you

earnest phoenix
#

brave does it

#

You just have to ask it nicely three times and click ur heels as well

boreal iron
#

NoScript is what you use

#

And a pihole

earnest phoenix
#

Just use brave

#

smh

boreal iron
#

That’s no network wide solution

earnest phoenix
#

No but it is a solution

boreal iron
#

It’s nothing

coral sigil
#

i haven't been able to get pihole to block video ads, thats why i use ublock origin on top of that

earnest phoenix
#

that is why you're fake

boreal iron
#

Shhh… you’re too young to understand how the internet works freerealestate

wheat mesa
#

Fake has been around since Pangea split

boreal iron
#

lmao

wheat mesa
#

(He didn’t notice because he was texting while driving)

boreal iron
#

Great one tbh

lyric mountain
#

it looks VERY weird on anything else tbh

earnest phoenix
#

This works, but how do I add a line break?

earnest phoenix
earnest phoenix
# coral sigil \n
guild.systemChannel.send(`Hello, I'm Universe List. Thanks for inviting me! /n test`)
#

like that?

barren anchor
#

no

boreal iron
#

omg

coral sigil
earnest phoenix
coral sigil
#

oh, sorry, u need \ not /

barren anchor
#
guild.systemChannel.send(`Hello, I'm Universe List. Thanks for inviting me! \n test`)
earnest phoenix
#

ohhh ok

#

tyy

spark flint
#

if this is the bot/server list you're making (cloning), you can't add to top.gg btw KEKW

boreal iron
half bear
#

how can i use emojis and other things for github readme?

lyric mountain
earnest phoenix
#

my discord bot sends this message: Use the command -help to see what I can do!

lyric mountain
#

isn't it supposed to?

earnest phoenix
#

without breaking the bot

lyric mountain
#

```
text
```

#

and "without breaking the bot" makes me worried that u don't know what ur doing

earnest phoenix
#

I'll show u what i mean

#
guild.systemChannel.send(`Use the command -help to see what I can do!`)
#

thats the code so far

lyric mountain
#

so?

earnest phoenix
#

but I can't add double ` inside that code

lyric mountain
#

then dont use `

#

u don't need that specific string type

#

just use normal ' or "

earnest phoenix
#

look, so can I do:

#
guild.systemChannel.send(`Use the command `-help` to see what I can do!`)
#

would that work?

boreal iron
#

Escape it

earnest phoenix
#

no right?

earnest phoenix
boreal iron
#

The brackets

#

\

earnest phoenix
#

ohhhh ok ty

spark flint
#

or just do js guild.systemChannel.send("Use the command `-help` to see what I can do!")

boreal iron
boreal iron
#

What she said?

#

Might not be the best idea tho to send a message into a random channel even if it’s supposed to be the system channel

spark flint
boreal iron
#

Are you on crack?

spark flint
#

nah

boreal iron
#

Not sure if I can trust this answer

earnest phoenix
#

I didn't know what channel I should send the welcome message to tho

boreal iron
#

I wouldn’t send a message at all tbh

#

But that’s up to

#

Don’t forget to check if you actually have the permissions to send a message at first

earnest phoenix
#

mhm the bot has the SEND MESSAGES permission

boreal iron
#

And if a system channel exists anyway

#

Doesn’t mean Someone inviting your bot also grants him that permission

boreal iron
#

When coding you always need to try to cover any possibility

earnest phoenix
spark flint
#

MongoNotConnectedError: MongoClient must be connected to perform this operation

#

but

#

mongo is connected

#

ah it works now

quartz kindle
#

magick

fallen holly
#

if i make my slash command multi guild and wait an hrs to test the cmd. and change the slash cmd do i have to wait another hr to retest the cmd

wheat mesa
#

you can specify a guild id when creating a slash command to test it instantly

fallen holly
#

if the cmd is already registered do i have to wait hr to test it

wheat mesa
#

no? You can specify a guild id like I said

#

for testing

#

if you're for some reason testing in production, then it may take up to an hour for global slash commands to appear

#

but just specify a guild id and your changes will appear instantly

boreal iron
#

Updates on commands are mostly instant but no guarantees on that as I experienced delays my own already

fallen holly
# wheat mesa for testing

ik i'm doing that. when i publish my bot globally and change code do i need to wait hr to use that cmd

wheat mesa
#

You shouldn’t need to change your code very often in prod anyways, only for updates and bug fixes. If it’s a severe bug then take your bot offline and fix the issues before putting it back up

fallen holly
#

aight

sudden geyser
wheat mesa
#

It can take up to 1 hour, but it doesn’t always take that long

sudden geyser
#

In the case of the latter, running the command should trigger an error for the user, but reappear and work just fine the next time.

wheat mesa
#

Discord is usually pretty fast with it now, but it’s not guaranteed

boreal iron
#

Im wildly guessing any guild does frequently do updates (with Discords backend) - in this case every hour - based on its creating date, in order to that not all guilds do backend requests in the same second

#

If you luckily register your command close before that update happens, I guess that’s the case it doesn’t take an hour

bright hornet
#

how do i use id instead of pinging them?

#

what should i put in the code?

boreal iron
#

Wut?

bright hornet
#

message.users.cache.fetch(args[0]) is not working :v

boreal iron
#

because cache fetch doesn’t exist

#

users fetch does

austere surge
#

message.users ?

boreal iron
#

No

bright hornet
# boreal iron Wut?

i mean i wanted to use id instead of pinging them, like ?message <id> <message>

boreal iron
#

You wanna fetch an api user?

boreal iron
#

Is the user a guild member or just a random discord user you wanna fetch?

boreal iron
#

Wrong link then

#

it’s guild.members.fetch(id) then

#

There we go

bright hornet
#

Ill look for it thanks

fallen holly
#

what is wrong with this

  const commands = [];
  const commandFolders = readdirSync('./slashCommands');
  for (const folder of commandFolders){
      const commandFiles = readdirSync(`./slashCommands/${folder}`).filter(files =>files.endsWith('.js'));
      for(const files of commandFiles){
          const command = require(`../slashCommands/${folder}/${files}`);

          commands.push(command.data.toJSON());
      }
  }

err is

 commands.push(command.data.toJSON());
                                     ^

TypeError: Cannot read properties of undefined (reading 'toJSON')
boreal iron
#

command.data is undefined

#

Why would You actually push that as JSON to an array?

#

What do you wanna archive?

fallen holly
#

that code is just to have subfolders inside of the main folder like slashCmd > moderation > ban.js

boreal iron
#

No I mean why do you push command.data to an array?

#

What’s command data btw?

bright hornet
#

@boreal iron sorry for ping, but there's any documents for set-config? for channels instead using name or id to set?

fallen holly
quartz kindle
#

also as it says in the guide, it only works if your command files are made exactly like the command handling part of the guide says

#

more specifically, it requires all your commands to have this

#

your error basically means that you have one or more commands that do not have the above structure

fallen holly
#

aight thx

boreal iron
#

Tim recommending the djs builders

#

I’ve lost all my hope in humanity

fallen holly
#

huh

boreal iron
#

The data of the example above simply is an object, you can write yourself instead of using this ugly, shitty, dirty, useless, … builder tools

austere surge
#

yes

#

isnt that the same for many things though

boreal iron
#

data:
{
name: ping,
description: "Replies with Pong!"
}

#

That’s literally what your data is after using the useless builder tool

bright hornet
boreal iron
#

Oh you wanna create a set-channel command?

#

Does it create a channel, move or edit one or …?

novel canopy
#

hello

boreal iron
bright hornet
zinc condor
#

waifu.pics blush

#

Damn I havent been checking on the stats for that thing in a long ass time, it got this big?

#

I should update it

left osprey
#

lol

boreal iron
#

You wanna overwrite the channel permissions?

#

Is that what you mean?

zinc condor
#

pretty sure they are saying that bot commands would only be usable if they set that channel

#

to prevent the bot from being entirely useless for events using channel perms but also preventing bot spam

boreal iron
#

I feel like he wanna set a channel the bot is listening to exclusively

#

(for commands)

#

@bright hornet
Is that what you wanna do?

boreal iron
#

Well once somebody runs the command, you verify the channel he mentioned, then put the channel ID into your database (associated with the guild ID)

After that you create a property for this guild defining the channel the bot should listen to
(e.g. guild.commandChannel = channel_id)

On an app restart you read the database and update the guild property

Once somebody executes a command you gotta check if the guild property commandChannel exists and if the current channel matches the one defined in the property

#

Sounds complicated but is actually pretty easy

earnest phoenix
#

That project looks rather interesting I was just looking at the waifu-api repo is that all the code for the api?

#

If so I am interested in how it all works as I am limited on my knowledge of go and I haven't really made many apis in it so I am curious how you're actually serving the files

zinc condor
#

with optional custom tokens

earnest phoenix
#

I see

zinc condor
#

Im uploading the images to S3 and serving it through the S3 api

earnest phoenix
#

Ah

zinc condor
#

So go uploads to s3 and cloudflare caches it so i dont pay for 20tb of traffic monthly

earnest phoenix
#

kek

zinc condor
#

so yeah its not very expensive to run, 8$ a month?

earnest phoenix
#

Woah tf

#

That is pretty cheap

#

I'd thought it'd be more

zinc condor
#

Go very fast and scales on multiple threads so I can run it on a VPS (contabo since high spec and cheap). S3 is handled by S3 and uploads are the only thing i pay for

boreal iron
zinc condor
#

Since downloads are cached by Cloudflare after one time and discord auto caches images too

earnest phoenix
#

That was someone else

#

I haven't talked here much today

#

lmfao

boreal iron
#

Ahh nvm then, I’m old

zinc condor
#

anyway if i was to write waifu.pics today I would have used rust

#

Go is a little funky structured

boreal iron
#

At least I remembered something

earnest phoenix
#

I have been looking for projects to try and contribute to (with my limited knowledge of course)

zinc condor
#

Although its kind of... not a starter project. Its based on the similar things as Waifu.pics but selfhosted and not for public image serving

earnest phoenix
#

File host on crack

#

Love it

zinc condor
#

Yeah its like pomf or lolisafe (bad name) if you have heard of it

#

basically screenshot tool uploads to it or its like anonfile but with accounts

earnest phoenix
#

Ah, nah I have never heard of them sadly

#

waifu pics is an interesting project though

zinc condor
#

yeah i need to update it since popularity

earnest phoenix
#

Is the entire service just user's uploading their own pics to it?

zinc condor
#

people upload pics to it and it goes to dashboard for me to sort through or approve

#

i need to make a thing that says that since lots of ppl get confused

#

no way in hell would people keep the upload box free from garbage without manual veritifcations PepeLaugh

earnest phoenix
#

Ah I was thinking how you'd manage making sure someone doesn't mark a nsfw as non nsfw

zinc condor
#

Yeah i look thru it. I also make sure that nothing is like nekos.life with the loli pics and whatnot

earnest phoenix
#

Are you the only one who does verifications?

zinc condor
#

yeah, not many uploads come in surprisingly

#

every month or so i get 150 images total

earnest phoenix
#

I still have yet to remove it from a bot im using it in tho

zinc condor
#

yeah this was created because i had a huge discord bot project i was making before that i gave up on (i got tired of discord bot dev honestly) but i made waifu.pics for this reason

#

nekos.life too much questionable content

#

first it was written in shitty js code overnight but i rewrote in go later so it could serve mass requests to the public

earnest phoenix
#

I am also getting tired of discord bot development and am trying to find projects I can contrib to so I can further my experiences

zinc condor
#

try making some sort of content management system, a basic one

#

like Backpack is meant for files and pastebin like stuff, but you could do articles too

earnest phoenix
#

I don't really want to make anything of my own since I don't have money to spend right now

#

Which is why im looking for projects I like to contrib to

zinc condor
#

what does money have to do with it? Writing code is free

earnest phoenix
#

Well yes but I wouldn't be able to host any of it

zinc condor
#

ok so, do you have a debit card?

#

like in general

earnest phoenix
#

Well not really no

#

Still underage

#

Legal limit here is 18

#

im 17

zinc condor
#

Ah, here its like 12 (US)

#

I was going to suggest oracle cloud, it gives you two free intel VPSs running with 2gig of ram each and 1cpu core

earnest phoenix
#

12?

zinc condor
#

Yeah

earnest phoenix
#

What state do you live in

zinc condor
#

Illinois

earnest phoenix
#

Cause here in Washington it is 18

#

:^)

#

Unless I have a legal guardian sign off

#

and I don't trust my dad with access to my money

zinc condor
#

Ah fair enough, difficult situations.

#

I hope you have physical money saved up to put into your account then next year

earnest phoenix
#

Nope

#

My dad got my social security card stolen so I can't get a job

#

I am as broke as a joke rn

#

And due to covid I can't get an appointment to get a new one

zinc condor
boreal iron
#

I see I should sell my unused system resources to < 18yo dudes

earnest phoenix
#

It got stolen from him

boreal iron
#

Taking their soul as payment

zinc condor
#

Have you tried calling social security administration?

earnest phoenix
earnest phoenix
#

They put me on hold for an hour and a half and then hung up on me

zinc condor
earnest phoenix
#

twice

#

I've decided I will just have to wait a bit cause I can't ever get through to em

#

Either way it doesn't stop me from taking online gigs like bot dev (ew but whatever)

boreal iron
earnest phoenix
#

I still have a paypal and a cash app my dad gave me

#

so I have two ways of storing money

boreal iron
#

Gimme money and I will create a vps with the resources you need, I got too much unused left

earnest phoenix
#

Welp it sucks I am broke

#

I have an old laptop that shuts off if the screen is placed wrong

#

If I open it too far or too little it shuts off

boreal iron
#

Hmm my server only shuts down if the electricity is missing

#

Weird thing

earnest phoenix
#

Cool you got a server

boreal iron
#

Aye

earnest phoenix
#

I also have some server space my friend lets me use but I can't host anything major on it

#

Only a website or a bot

#

And bots are what I wanna stay away from

boreal iron
#

I’ve got quite a lot of resources left after upgrading it recently

earnest phoenix
#

Nice

#

@zinc condor should I continue studying go to make fast apis or should i just say screw it and keep using ts

zinc condor
earnest phoenix
#

Mmm I was just wondering what you'd suggest

zinc condor
#

Web APIs wont go away so either way you are set in terms of skill

earnest phoenix
#

thanks tho

zinc condor
#

Well, TS is the easiest and is clean

earnest phoenix
#

But at a certain point it will get slow wont it?

zinc condor
#

Go is messy as fuck till you get used to it but its really fast
Rust is the hardest but it makes extremely clean code

zinc condor
#

V8 which runs JS code (which TS compiles to) is a JIT compiler and concurrency makes things run fast

#

Its the slowest out of the 3 (slower than Java too, its a misconception that java is slow, minecraft is just written like garbage) but its still incredibly fast

earnest phoenix
#

I see

#

So I am fine using typescript for a good while before I would notice any performance issues assuming I wrote my code properly

zinc condor
#

the only performance issued you would notice are if you write games or threaded code

earnest phoenix
#

Ah I see

zinc condor
#

Most languages have multiple threads which lets you do two things at once but JS has one actual calling thread for anything other than FS/HTTP tasks

quartz kindle
#

how you write your code matters much more than which language you use

zinc condor
#

so promises or async functions you make are still run on one thread. Its just that waiting for http requests runs on multiple because node or chrome runs separately and resolves promises

quartz kindle
#

many people write shit js code then blame the language for being slow or bloated

zinc condor
#

Unless they just write stupid code, then their code is written to be slow

boreal iron
#

Not only shitty JS code

quartz kindle
#

and people take npm modules as the standard, while tons of npm modules are actually garbage

zinc condor
#

But yeah one benefit to compiled languages or even Java over JS/TS is multithreading, which does theoretically exist in Javascript for IO tasks but doesn't exist anywhere else

#

Which is why a JS based game engine doesn't really exist in big games outside of simple scripts

#

Lua does exist in that world because LuaJIT is almost as fast as C, its quirky for scripting

quartz kindle
#

well for a game engine you wanna access the gpu more than anything, so you need langs that can do that, js is too abstracted for that

zinc condor
#

Node to JS bindings exist for that already

#

Thats what everything is based on and thats all you need

quartz kindle
#

yeah but its an extra layer of abstraction

#

calling native code from js is not cheap

zinc condor
#

True but abstraction doesn't matter as much anymore, CPUs are fast and its cheaper than you think (ive embedded V8 in programs before, lots of misconceptions about JS)

#

In fact, it would be pretty easy to make an engine in C++ and define scripting API for entities in JS, its just usually not proffered over C# or Lua

#

The reason a pure JS game engine cant exist easily is because you need many threads to handle many things. Like physics cant be handled on the main thread

#

that will absolutely kill the performance

zinc condor
#

In fact getting anything on the screen is impossible without C bindings

#

that goes for any scripting language

earnest phoenix
#

What are your opinions on using a framework like nestjs for apis

#

Do you think people should use them or just go with just something like express, koa or fastify

zinc condor
#

It simplifies handling for Middleware and auth with recievers. here in rust with actix we have the same thing and it's hailed as a design choice

#

From what I've seen nest is both light while giving you features of swing routing so I'd use that

#

Plus nestjs uses express under the hood

#

Well OK scratch that

#

Updates made it use fastify

earnest phoenix
#

yea it uses express or fastify

#

You can choose which is for u

zinc condor
#

Yeah

earnest phoenix
#

So we are the same you dont see it as a bad choice to use in production apps?

quartz kindle
#

they are not bad choices, but at the same time they are clear examples of npm useless bloat

#

you can easily make a good webserver using the built in http/https/http2 and it will pretty much outperform all of those npm modules

#

its basically convenience in exchange for performance

earnest phoenix
#

Mmm

#

I do agree

#

I'd like to use the built in stuff I just don't know how

quartz kindle
#

there are plenty of examples

pale vessel
#

require("http").createServer((req, res) => { ... }).listen(port, cb);

zinc condor
#

If you really cared about performance you wouldnt use JS or any scripting language for that matter, you would use Go or Rust

#

As for performance bloat, I agree, dont use modules for everything, only when it makes sense

zinc condor
#

I use Rust with actix, nothing will surprise me anymore, 1ms response times on localhost

#

Fastest framework I think is Drogon for C++ with some other ones in the middle and then actix is #3 top speed

quartz kindle
#

i mean, you'll be surprised just how bad npm libs can be compared to doing it yourself

zinc condor
#

Well its true for a lot of cases, nestjs is not one of them

quartz kindle
#

a simple example is the well known ws package for websockets

#

its pretty much the standard

#

until i made my own websocket using net and it turned out to be 10x faster

#

many of "defacto standard" libs are just not good enough to be considered standards

zinc condor
#

maybe so, i stick away from Node for server apps

#

My primary use case for JS/TS is frontends and simple apps I dont deploy anywhere outside of personal use or scripting

#

or embedding

#

replaced it recently with ivm native portion

quartz kindle
#

yes, my point is a lot of issues with js are blamed on the language, when it should be blamed on the ecosystem

zinc condor
#

yeah

lament rock
#

send help

zinc condor
#

interesting choice in theme

lament rock
#

my fingers are on fire from remaking my typings package for the past 5 hours

#

theme is called sweet.

austere surge
#

icon theme looks realy nic

pale vessel
#

probably just the icons though

earnest phoenix
#

:^)

#

I still don't even know how websockets work when making a chat app

zinc condor
radiant kraken
#

decent

pale vessel
#

i saw something suspicious

austere surge
#

very cool

zinc condor
#

took two years to finish the UI because im bad at UX and i kept project hopping

#

then did a rewrite of the UI in like 2 days

earnest phoenix
zinc condor
#

do you see that vent on the floor?

austere surge
#

the vents in the roof wym

earnest phoenix
pale vessel
zinc condor
earnest phoenix
zinc condor
#

9SpongeDance wasnt very fast, did it for experience

zinc condor
earnest phoenix
#

good job

#

hey Riku have you heard of mantine?

#

accessibility 👍 👍 👍

zinc condor
earnest phoenix
#

no the react comp+hook lib

feral aspen
#

Is it possible to manually launch 2 shards instead of setting it to "auto"?

sudden geyser
#

but looks nice

earnest phoenix
zinc condor
earnest phoenix
#

It is very nice

#

I use it currently very poorly but

feral aspen
feral aspen
#

What happens if I launch 5, let's say?

earnest phoenix
#

Waste of resources

feral aspen
#

Meaning?

earnest phoenix
#

At max launch 2

quartz kindle
zinc condor
#

im not rewriting again

feral aspen
#

How am I wasting resources, what does that mean?

#

More ram?

earnest phoenix
#

yep

feral aspen
#

Doesn't sharding decrease the use of ram or?

earnest phoenix
#

It increases the amount of servers the bot can handle

earnest phoenix
#

^

zinc condor
#

if you have a really big bot sharding lets you split the workload to multiple physical bot servers

#

I did it with my old bot

feral aspen
zinc condor
#

One program would connect to get shard count and split shards on multiple servers

earnest phoenix
#

I wish I had a bot that was somewhat successful then I wouldn't feel like i've wasted 4 years

earnest phoenix
zinc condor
quartz kindle
#

sure you can

earnest phoenix
quartz kindle
#

you can launch 9999 shards with 1 server

earnest phoenix
#

lmao

#

You can launch tim with 1 server

#

0.00033333 guilds per shard

earnest phoenix
earnest phoenix
quartz kindle
#

lmao

zinc condor
wheat mesa
#

You cannot launch tim with one server

earnest phoenix
#

WAFFLE WHEN TF ARE U GETTING BACK

zinc condor
#

catbruh actually i dont think it will slow anything down since still only one websocket

wheat mesa
#

Simply not powerful enough

#

Still not home rn

earnest phoenix
#

Smh

#

I was 2 hours late responding and you went off on an adventure 😔

wheat mesa
#

I was home like 3pm-6pm but I was tired so I took a nap instead of doing react with you KEKW

earnest phoenix
#

BRUH

#

Could of told me

fallen holly
#

no errs but the / cmd is not registering

earnest phoenix
#

I've been sitting here waiting

wheat mesa
#

Yeah I would’ve but I fell asleep

quartz kindle
earnest phoenix
#

😔

slender thistle
#

Ti-Ti-Timo Timo, Ti-Timo Timothy~

wheat mesa
#

Now I’m at a friends house watching them play fucking super Mario bros on the wii

earnest phoenix
slender thistle
#

Hi bro

wheat mesa
earnest phoenix
#

That sounds boring

wheat mesa
#

It’s fun

earnest phoenix
#

Watching them play?

#

Sounds boring to me

earnest phoenix
wheat mesa
#

Nah it’s fun

earnest phoenix
#

Do you ever get the urge to slam your hand down on a thumb tack?

wheat mesa
#

No

quartz kindle
earnest phoenix
#

It is timothy senapi

#

senapi

quartz kindle
#

senapi

earnest phoenix
#

span ei

#

I was typing fast

#

stfu

#

the "fuck up" is now sad

#

I will come to all ur houses and eat your bread and leave only the end pieces

slender thistle
earnest phoenix
#

why did you shut him

wheat mesa
fallen holly
#

no errs but the / cmd is not registering

earnest phoenix
#

then ur poor

#

bread is the cheapest thing you can buy food wise

earnest phoenix
wheat mesa
#

I don’t own bread because I can’t eat it lul

quartz kindle
#

pythonk

earnest phoenix
#

Damn

#

you gluten free or smth?

slender thistle
#

I radiate the gay also

earnest phoenix
quartz kindle
#

ghey

wheat mesa
fallen holly
#

lol

wheat mesa
#

Nope

#

Wrong

#

Incorrect

fallen holly
#

lol

earnest phoenix
#

Im kidding ofc, have you made sure the bot has permissions, reloaded the client?

#

Sometimes it can be a visual bug

fallen holly
#

the bot has permission

earnest phoenix
#

Try reloading the client

fallen holly
#

what u mean by reloading

rose warren
#

Are they global slash commands or guild commands?

fallen holly
#

guild

earnest phoenix
#

Try checking in the bots dms if slash commands appear

#

If so then they might not be loading properly in the guild

fallen holly
#

none

#

in dms

earnest phoenix
#

Can you show how you're loading the commands?

fallen holly
rose warren
#

Did you invite your bot to the server with the applications.commands scope?

fallen holly
#

yep

#

i will redo it

quartz kindle
fallen holly
#

just to make sure

lament rock
#

@quartz kindle waiting for the day when you at me with that Discord compliant ws module that's tons faster

#

Already did a gateway v10 update D:

quartz kindle
earnest phoenix
lament rock
#

Standalone?

rose warren
#

Yep

fallen holly
earnest phoenix
#

Doesn't push only take one prop?

sudden geyser
#

yes no but what's wrong is that command.data.name

quartz kindle
rose warren
#

Looks like it's command.name based off what you sent

quartz kindle
lament rock
#

is it tiny-discord websocketshard?

quartz kindle
#

ye

lament rock
#

ok

#

I'll painfully port later ig

earnest phoenix
#

tim you're still working on tiny-discord?

rose warren
#

Oh Tim my bot uses djs-light in production now poggythumbsup

quartz kindle
#

kinda, there not much left to do with it for my use cases at the moment