#development

1 messages Β· Page 23 of 1

sharp geyser
#

pretty sure he said half that css isn't even his so

civic scroll
#

the parent div is literally a flexbox

#

?????

feral aspen
#

Hmm.. I have that but it's not in the offers?

sharp geyser
civic scroll
#

The Flexible Box Module, usually referred to as flexbox, was designed as a one-dimensional layout model, and as a method that could offer space distribution between items in an interface and powerful alignment capabilities. This article gives an outline of the main features of flexbox, which we will be exploring in more detail in the rest of the...

rancid moss
sharp geyser
#

As long as you have github student license

#

you can just signup/in with github

#

and you automatically get em

rancid moss
#

And then you'll get the license for +- 1 year

sharp geyser
#

1 year

#

and you have to renew every year

feral aspen
sharp geyser
#

Did you signin/up with github?

feral aspen
#

Yes, I did.

#

And I authorized.

sharp geyser
#

πŸ€”

#

You did smth wrong then

feral aspen
#

Wot.

sharp geyser
#

No reason it shouldn't of worked

#

It works for me

#

Did you make an actual jetbrains account?

rancid moss
feral aspen
#

Bruh.

rancid moss
#

Guess you'll have to pay a bit

#

Β―_(ツ)_/Β―

civic scroll
#

or just study in schools

feral aspen
#

πŸ˜‚

sharp geyser
#

Contact support

feral aspen
#

Done.

rancid moss
#

xD
Cuz that was so fast, I'll just imagine u said "Hey. License no work. Help"

feral aspen
rancid moss
#

Ayy u did it!

feral aspen
#

Damn, I have a .me domain, a .tech domain, and some other name.com domain I can make for free.

#

Any ideas? Eyes

civic scroll
#

man used margin inside a flexbox

ancient nova
#

still playing with it

lyric mountain
rancid moss
civic scroll
ancient nova
civic scroll
#

remove your margin bullshit

#

you are using a flexbox

rancid moss
ancient nova
#

but I want it to resize when the screen is smaller

#

mobile for example

civic scroll
#

then use responsive values

#

you are using fixed values for your margin anyway

ancient nova
#

I got it

#

look

civic scroll
#

like margin: 4% or something

ancient nova
#

nvm

#

lmfao

#

it's off center

lyric mountain
#

sayuri this very moment:

civic scroll
#

margin-inline-start inside a flexbox

#

πŸ’€

#

explain why code results in undefined behaviour

ancient nova
#

no need to hate on my css skills

civic scroll
#

i'm very chill rn

#

not hating

ancient nova
#

just tell me how to do this properly

civic scroll
#

just said that it exists

civic scroll
ancient nova
#

yeah

civic scroll
#

and the parent is flex

ancient nova
#

yes

civic scroll
#

so you just need to specify the gap

#

then justify-content: center to align them all in center of the parent

#

that's it

ancient nova
#

that broke it

civic scroll
#

you put gap on the child

#

πŸ’€

#

you put both properties on the parent element

#

which has the flexbox

ancient nova
civic scroll
#

those properties affect its child

#

not itself

#

to correct child position use anything with self suffix

ancient nova
#

it didn't work πŸ’€

#

it just enlarged the buttons themselves

civic scroll
#

bro

#

πŸ’€

ancient nova
#

πŸ’€ 😭

civic scroll
#

the parent

ancient nova
#

the div parent 😭

civic scroll
#

the div that has the class of buttons

ancient nova
#

I had it on there before

#

u said that was wrong

civic scroll
#

the div that contains all 3 buttons

ancient nova
#

and that I should put it on the buttons

civic scroll
ancient nova
#

ok give a sec

#

that prolly won't work tho

civic scroll
#

that MUST work

#

if it doesn't that means you wrote it wrong

ancient nova
#

yeah it didn't

#

check the html

#

of my website

civic scroll
#

did you write it like this

ancient nova
#

ohh u put it in the style

civic scroll
#

where else would you put πŸ’€

ancient nova
#

okay hold on wtf

civic scroll
#

what

ancient nova
#

my b my b

#

I know what I did wrong

civic scroll
#

finally

ancient nova
#

where do I put justify-content: center; tho?

#

on the buttons?

earnest phoenix
#

Wtf ads troll

ancient nova
civic scroll
#

oh that?

#

on the parent

earnest phoenix
ancient nova
#

didn't u tell me to bofore?

civic scroll
#

but the class inherited it

ancient nova
civic scroll
#

it inherited those classes

ancient nova
#

lmfao

#

how the hell did disscord manage to take my server out of the html

civic scroll
boreal iron
civic scroll
boreal iron
#

Must be the freedom of android to show ads

ancient nova
#

woo it worked

#

do u see the spacing

earnest phoenix
#

The inconsistencies of the Android builds compared to desktop and iOS builds

boreal iron
#

True

ancient nova
#

it's a lil too big so I'll set it to like 15px

civic scroll
#

at the end, you used fixed size for the gaps

#

how ironic

earnest phoenix
#

Well it's being rewritten in React-Native so it's good, almost everything is consistent on that rewrite

boreal iron
#

Because nobody likes android or will be known as android developer

ancient nova
boreal iron
civic scroll
ancient nova
#

nah I don't need that, I just wanted that to be centered whenever someone visits my website on mobile

#

btw

#

those buttons seem to disappear if ur on mobile, do u know why?

earnest phoenix
# boreal iron <:doubt:622740523203035176>

Well the Discord Android builds were first chosen to use React-Native but failed to use it since React-Native itself had issues with Android, but nowadays it's all smoother than ever

#

Android development is nice, if you choose the right tools

civic scroll
#

that's the issue

#

wait

#

no

ancient nova
civic scroll
#

it's not

earnest phoenix
#

Looking at Bae's cursed code episode 357

boreal iron
ancient nova
#

misty called it "irrelevant"

#

wanna rate it?

boreal iron
#

Save us

#

Please

ancient nova
#

it's not that bad...

earnest phoenix
#

No thank you I want to be able to sleep tonight

ancient nova
#

πŸ’€

wheat mesa
#

The indentation is the scariest part of it

#

The rest of it I couldn’t focus on because the indentation is garbage

earnest phoenix
#

Astaghferallah

civic scroll
#

@ancient nova the issue might be in your react code

ancient nova
#

how do I make it auto redirect?
for some if u visit /dashboard I want it to auto redirect u to /dashboard/home

earnest phoenix
#

Might as well just call your code obfuscated

ancient nova
civic scroll
#

react?

#

angular?

#

vanilla?

ancient nova
civic scroll
#

πŸ’€

ancient nova
#

bro don't hate on express 😭

civic scroll
#

express is not client-side

sharp geyser
civic scroll
#

alright so vanilla

boreal iron
ancient nova
wheat mesa
civic scroll
#

in that case use location.push

wheat mesa
#

Just use react at that point :c

sharp geyser
#

I can't guess this guy's intentions

earnest phoenix
wheat mesa
civic scroll
#

mb

boreal iron
civic scroll
#

use location.assign

sharp geyser
#

or

#

res.redirect when you visit a certain endpoint on your express app

earnest phoenix
#

Epic dotpost fail

civic scroll
#

it's been ages since i last use express

ancient nova
civic scroll
#

affirmative

ancient nova
#

perfect

#

hmm now how exacty should I go about the html for the dashboard

#

do u guys have any ideas how to make it look good?

#

want to have 3 pages for now
/home
/commands
and /settings or /guild

civic scroll
#

man i spent too much time doing spas

civic scroll
#

i can't suggest anything without knowing the contents to be put on the page

boreal iron
#

Man… sayuri not being very flexible

civic scroll
#

not enough context

sharp geyser
#

Okay

#

so

#

Sass, Scss, Less or just css

#

which one

civic scroll
#

since you are a curly brackets guy

#

and i wanna make it close to css

sharp geyser
#

I heard sass was scss on crack

civic scroll
#

idk

sharp geyser
#

it apparently offers what scss does and then some but idk

civic scroll
#

it's indent-based so i don't like it

sharp geyser
#

I haven't looked into either

#

so

#

Mmmm let me look at em for myself then

sharp geyser
#

indented based syntax is broken still apparently

#

Even though the issue was brought up in 2011

civic scroll
#

only python devs like that

ancient nova
#

but the guild thing I'll do last since I'm going to have to use oauth for that

civic scroll
#

or

#

my brain stopped workign

ancient nova
#

gonna make it look something like this

#

wow

sharp geyser
#

lmfao

civic scroll
#

tf is a jfif

sharp geyser
#

jfif

ancient nova
civic scroll
#

just copy it

ancient nova
#

ok

ancient nova
sharp geyser
#

JPEG File Interchange Format (JFIF)

ancient nova
sharp geyser
#

its called jpeg

#

jpg is just the shorthand file extension

ancient nova
#

I see

ancient nova
civic scroll
#

along with an animated background

spiral crag
#

Hey guys, I am using discord.py, and one of the commands requires the user to input some time, for example like this !somecommandname 9:05, where 9:05 is the time the user inputted, however i would like to know what the user's timezone is so how would i do that

civic scroll
#

so is the menu as well

ancient nova
#

what's ejs? 😐

ancient nova
#

ok

ancient nova
civic scroll
#

or eloquent js

#

jk

ancient nova
civic scroll
#

use css

#

or js

ancient nova
civic scroll
#

or wasm

ancient nova
#

an interactive background

#

hold on I'll show u an example

#

mrdoob's work

#

it's cool af

civic scroll
#

i'm thinking of detroit become human triangles

ancient nova
ancient nova
civic scroll
#

compute intensive

#

i would prefer static animated background for this context

ancient nova
#

yeah but I still don't actually know how to replicate something like this in pure CSS kek

civic scroll
#

let interactive animations for interactable elements, say menu items or dashboard items

civic scroll
#

but as for live mouse tracking it needs js

ancient nova
#

can u give me an example of how it would look like?

#

the pure css 1?

civic scroll
#

as expected, it uses canvas

civic scroll
#

from highest to 0

sharp geyser
#

don't even bring it up

ancient nova
#

misty can u stfu

sharp geyser
#

No

ancient nova
civic scroll
#

for canvas it

#

it's animated using either js or wasm

ancient nova
#

kinda sounded rude

ancient nova
#

do you have any examples I could copy?

sharp geyser
#

I am curious tho do you know what wasm is?

ancient nova
#

gonna copy dyno's dashboard tbh it looks good af

lyric mountain
#

as expected

civic scroll
#

πŸ’€

#

so my recommendations are dumped

#

great to know

ancient nova
civic scroll
ancient nova
#

I just wanna copy the layout

#

meaning where and how the buttons are placed

#

yk

sharp geyser
#

so basically infringe

ancient nova
#

what

#

I just wanna copy the position of the buttons not the actual dashboard

#

I just want my dashboard to look like a dashboard

#

taking inspiration

civic scroll
#

i focus on animations

lyric mountain
#

Copyright: exists
Bae: more like a suggestion list

sharp geyser
#

lol

ancient nova
#

then we can try adding animation

civic scroll
#

go

sharp geyser
#

No idea how figma even works ngl

civic scroll
#

to create prts

lyric mountain
#

latex but for web

sharp geyser
#

latex?

#

you mean rubber?

civic scroll
#

no

#

latex

#

as in language

#

laTex

sharp geyser
#

never heard of it

civic scroll
#

man didn't compose math documents

lyric mountain
#

it's a language for making diagrams, formulas and shit

sharp geyser
earnest phoenix
#

My brother in Christ, how do you not know about LaTeX

civic scroll
#

even voltrex knows

#

why don't you know

lyric mountain
#

see this? yes, it's latex

#

if u even need to make formal math formulas, you'll probably use latex

#

especially in graduation projects

ancient nova
sharp geyser
civic scroll
sharp geyser
#

thats why

lyric mountain
civic scroll
#

jk it's a design tool

boreal iron
lyric mountain
#

this is funny for some reason

ancient nova
#

@civic scroll how do u do comments in html again?

civic scroll
ancient nova
proven escarp
#

ItsOkayBae: asks something
the fucking internet and stackoverflow: am i a joke to you??

#

imagine not searching on internet before asking others

#

cringe tbh

wheat mesa
#

He would rather wait 2 minutes for a reply instead of 15 milliseconds for a google search πŸ˜‰

sharp geyser
#

Now for the real test

#

lets see if I can do scss

#

with little knowledge of base css

boreal iron
#

What can go wrong

sharp geyser
#

Absolutely everything

boreal iron
sharp geyser
#

Okay so lets think about this

#

I wanna do a side nav, so I have to use flex box and stick it to the top left

boreal iron
#

Eww I will never use flex

feral aspen
#

Could've pressed CTRL + E, but it's still cool.

boreal iron
#

A search bar to search things?

#

Pretty modern piece of technology

#

Ngl

sharp geyser
#

Okay so bad color but trying to visualize

#

Why is the height not filling the entire screen

#
.nav-container {
  display: flex;
  position: relative;
  top: auto;
  left: auto;
  width: 20%;
  height: 100%;
}
wheat mesa
#

Because flexbox is the size of the child elements inside it

sharp geyser
#

Mmmmm

#

Forgot that

wheat mesa
#

What you’re looking for is more like block or inline-block

#

Pretty sure there’s also a navbar element that might help, but I’ve never used it so idk

#

99% of the time I’m doing frontend I’m just looking up the same 5 issues

sharp geyser
#

there is indeed a nav tag

civic scroll
#

it tried to do 100% content height, which is current only the hello world box

sharp geyser
civic scroll
wheat mesa
civic scroll
#

height 100%

#

top 0 left 0

wheat mesa
#

Or just don’t use flex here because it’s not the proper case for it

sharp geyser
#

yea

#

I stopped using flex

#

I am using inline-block

civic scroll
#

did it work

sharp geyser
civic scroll
#

what

sharp geyser
#

using 100vh works but causes overflow, and 100% just makes it stay the same size as the child element inside it

civic scroll
#

body { position: relative; h 100% w 100%}

wheat mesa
#

Margin probably causes the overflow

civic scroll
#

also yeah that

wheat mesa
#

Or just do something like overflow: hidden

sharp geyser
#

Won't that interfere in the future

wheat mesa
#

Not if you’re just putting it on that div

#

It’s still sort of a duct tape solution to an inherently wrong approach though

blissful coral
#

Alr gonna seem dumb but cant seem to figure this out

earnest phoenix
#

If I have a welcome system, the inviter feature
but i have custom link for my server ,
When the user enters through the custom link, he does not recognize the inviter and says to me in the error that I cannot recognize the inviter correctly!? What is the solution

sharp geyser
#

even using overflow: hidden didn't stop it from overflowing

blissful coral
#

Shouldn't be a issue I wouldn't think

wheat mesa
#

Your config isn’t set to be a module

#

So you can’t use es6 style imports like that

sharp geyser
#

I dislike how you are relying on a interface for this but πŸ€·β€β™€οΈ

civic scroll
#

you can try to compile it to .mjs

blissful coral
#

@sharp geyserI did that to see what was up

#

Not gonna keep it that way hopefully

wheat mesa
sharp geyser
#

icic

sharp geyser
#

but I prefer going for a class approach rather than exporting a default object

wheat mesa
#

Interfaces are useful for polymorphism type safety

#

A base class would work as well

blissful coral
#

Yeah

wheat mesa
#

But it’s not required

blissful coral
#

Class would work but I went for interface

wheat mesa
#

Interfaces are essentially just abstract classes

civic scroll
sharp geyser
#

To each their own

#

its just a personal preference at the end of the day

blissful coral
#

Fun

ancient nova
#

done the home page

earnest phoenix
sharp geyser
#

At this point it isn't cause of the navbar anymore I don't think

#

I think its the body

civic scroll
#

> sayuri reload --module Brainstorm

wheat mesa
#

Body padding

civic scroll
#

also yeah

wheat mesa
#

I believe the default is 15px

civic scroll
#

wait

wheat mesa
#

Something like that

#

Depends on browser

civic scroll
#

just set the margin and padding to 0

#

it should work

wheat mesa
#

Yeah

civic scroll
#

on body

ancient nova
#

@civic scroll so?

#

:]

proven escarp
wheat mesa
sharp geyser
#

that worked

civic scroll
ancient nova
civic scroll
sharp geyser
#

I was looking at the dev tools

ancient nova
#

takes 1 second for me

sharp geyser
#

and realized that padding and margin was in the way

#

:p

wheat mesa
#

It’s slow to load for me

civic scroll
wheat mesa
#

It’s faster now

#

Probably major caching issue

civic scroll
#

yes

ancient nova
#

idk

sharp geyser
#

so

ancient nova
#

anyway does it look good?

sharp geyser
#

I hardly know the tricks

wheat mesa
#

Pro tip misty: devtools saves headaches and time

ancient nova
#

@civic scroll how do I make the line in the middle go to the very bottom

sharp geyser
#

change its height /s

#

idk if thats true

#

I suck at frontend

ancient nova
#

what if someone has a 4k screen

sharp geyser
#

Fuck em

#

who uses 4k

ancient nova
sharp geyser
#

Only people with money to waste uses 4k

ancient nova
#

I have a 2440p screen

#

so 2k

sharp geyser
#

and those people surely won't visit your site no offense

civic scroll
#

@ancient nova the border should be on aside element instead

sharp geyser
#

aside?

#

thats a thing?

ancient nova
#

ah bet

civic scroll
#

pro tip: devtool is your best friend

civic scroll
sharp geyser
#

never knew this

#

πŸ˜”

#

I got a lot to learn

#

I plan on having my navbar be a drawer effect

#

so i gotta hide it and transition iirc

civic scroll
#

@ancient nova also the aside has some top padding, consider removing it

civic scroll
#

for what

ancient nova
#

the butler dashboard text to be a little lower from the top

civic scroll
#

then you just offset the text element

#

instead of the aside

#

what happens when you change the bg of aside

ancient nova
civic scroll
#

i said aside

#

it should be considered when you add color schemes for themes later on

proven escarp
ancient nova
civic scroll
#

turned off my pc

#

could not audit

earnest phoenix
#

Do you know this ?

proven escarp
#

that's literally what im telling you to do...

boreal iron
proven escarp
#

.catch((e) => {}) and do anything you want on catch

proven escarp
boreal iron
civic scroll
#

fake no

proven escarp
#

i catched @radiant kraken

#

there

#

you can have it fake

ancient nova
boreal iron
#

Gonna sell it to voltrox

proven escarp
#

voltrox

boreal iron
#

Shhh

#

Auto correct does whatever it wants

ancient nova
#

@civic scroll now can I make an api call and get the value to be embedded into text with just html or do I need js for that? if I do need js then how do I take js variables and use them in html?

sharp geyser
#

What color scheme should I go for πŸ€”

wheat mesa
#

Ah yes make an API call with html

#

Makes sense

sharp geyser
#

I want it to be pleasing to the eye

#

Also color theory is a thing I gotta look into

civic scroll
sharp geyser
#

I am not too familiar with the cocnept

ancient nova
civic scroll
#

πŸ’€

wheat mesa
wheat mesa
#

Colors opposite to each other are complimentary, colors next to each other are analogous

#

I think

#

@civic scroll you do art I’m sure you can correct me if that’s wrong

civic scroll
wheat mesa
#

Aka colors on opposite sides of the color wheel look good together

sharp geyser
#

damn

#

even sayuri doesn't know

civic scroll
#

i haven't studied color theory yet

#

i'm still focusing on lineart

wheat mesa
#

I did a little bit of web design which meant learning basic color theory

civic scroll
#

i do everything to my hearts content

wheat mesa
#

Basically because they’re opposite to each other they have high levels of contrast which is why they look good

civic scroll
#

"if it good it good"

#

πŸ’€

sharp geyser
#

Okay so thats cool

#

but my issue is how do I use those colors

ancient nova
#

omg my vps has js syntax highlight inside html

#

that's how u know it's good

sharp geyser
#

That doesn't mean its good

ancient nova
#

😭

civic scroll
#

also why would you do script inside body

eternal osprey
#

hey, is it possible to have 1 shared embed with buttons sent in the server, and the other bots would be able to detect the button interactions as well?

sharp geyser
#

Also when you do script inside the body

ancient nova
#

wait I'm gonna have to install fetch module dam

sharp geyser
#

its usually before the closing body tag

#

Uh no

civic scroll
#

HUH

sharp geyser
#

browsers have native fetch

civic scroll
#

what

wheat mesa
civic scroll
#

this man

#

πŸ’€

#

pleas eresd docs

eternal osprey
civic scroll
#

or at least search dgodgkte

#

google

#

gn it's 4.34sm

#

am

sharp geyser
#

God I am tired

ancient nova
#

butler-console@:~$ npm i node-fetch
npm ERR! code EJSONPARSE
npm ERR! path /home/container/package.json
npm ERR! JSON.parse Unexpected token "}" (0x7D) in JSON at position 50 while parsing near "...ress": "^4.18.1",\n }\n}\n"
npm ERR! JSON.parse Failed to parse JSON data.
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.

sharp geyser
#

went to sleep at 4am and woke up at 8 being spammed with text messages

ancient nova
#

ayeee wooot

wheat mesa
# eternal osprey I see, so it won't work. Thank you!

However you can set it up in a way (if you have access to the other bots) where the bot who posted that message receives the interaction and sends POST requests to the other bots where they can receive them and do whatever they wish with the interaction data

eternal osprey
#

and yeah i have the permissions to do so, but haven't got the clue to do that

wheat mesa
#

API endpoints on the other bots, if you have access to their code (I’m assuming it’s other bots you’ve made?)

sharp geyser
#

Waffle doesn't the browser have a native fetch implementation?

wheat mesa
wheat mesa
sharp geyser
#

so tell me

#

why is this man trying to install node-fetch

#

πŸ‘€

wheat mesa
#

@ancient nova look up your issues before immediately assuming a solution if you’re unsure you dingus

eternal osprey
wheat mesa
#

Not very hard, but definitely annoying to try to communicate between bots

eternal osprey
#

tho, thank you waffle for helping me!

wheat mesa
#

πŸ‘

ancient nova
#

@wheat mesa so fetch is native?

#

no need to even define it?

wheat mesa
#

have you heard of trying it and seeing πŸ˜‰

ancient nova
sharp geyser
#

you see the ||| its a placeholder for now, but I wanna add some space at the top as well but it doesn't seem like I can

#

I thought adding margin was the answer but it only adds it to the left

wheat mesa
#

margin top yeah

ancient nova
#

@civic scroll

#

idrk how to use it, any ideas?

sharp geyser
#

that was the first thing I tried

ancient nova
sharp geyser
#

I already tried that

#

as I said

ancient nova
#

if u want to do it on the div u can try margin-bottom

#

I see

winter pasture
ancient nova
sharp geyser
winter pasture
sharp geyser
#

read this

wheat mesa
#

Never ever ever put your api token client side

#

That shit will be gone in 2 hours

#

I will personally take it if that’s what it takes

ancient nova
#

wow

#

what else am I supposed to do lmao

sharp geyser
#

Make a server

#

and call to it

wheat mesa
#

^

#

You’re going to need webserver stuff for that type of thing

sharp geyser
#

If you're going to be doing smth like this

ancient nova
#

breh

sharp geyser
#

always make a server

#

saves you from exposing shit

#

and its just easier

ancient nova
#

and how will that server work

wheat mesa
#

Or just have a GET endpoint on your bot that gives stats

#

And make sure you ratelimit and/or just have values you update every x amount of seconds

#

This will make you vulnerable to a certain extent though

winter pasture
#

Could configure a quick Cloudflare worker

#

Have a worker function just call the api, return the JSON and use Cloudflare key value storage for caching

ancient nova
#

@winter pasture I'm trying to get my bots details from the api, what's the endpoint for that?

#

mainly trying to get the guild count

winter pasture
sharp geyser
#

This guy relying on top.gg to get the guild count of his bot

#

what the absolute fuck

#

what happens if top.gg goes down

#

then what

#

just can't display your guild count?

ancient nova
#

yes

winter pasture
#

You saying top,gg isn’t the most reliable site out there?

ancient nova
#

idc I'm not going to make a server nor I'm going to put my website directly into my bots source

sharp geyser
winter pasture
#

When have we ever gone offline 🧐

lyric mountain
winter pasture
#

/j

sharp geyser
#

This guy has to be the laziest dev ever

#

and he wants his bot to grow

#

jokes

winter pasture
#

Let’s not be toxic :D better to explain why it’s a bad idea than to just hate on it

sharp geyser
#

While I may be being harsh

#

it is constructive in itself

sharp geyser
#

it gets boring after a while

proven lantern
#

This is how i am planning to setup my bots architecture. One issue i'm running into is that sometimes the Discord API isn't ready for the follow up and gives me a 404 and retrying it a few seconds later works. Is retrying the 404 error ok in this case? i plan to retry 5 times over 30 seconds

lyric mountain
sharp geyser
#

although it being a 404 is definitely something to look into

#

that shouldn't be happening

lyric mountain
#

Countless hours trying to explain how they should research and where they can find the documentation and all the info they ever need

#

They didn't evem search how to add comments on html

winter pasture
#

Yeah I know. The best to do is to link to the resource to where they can get information. We can’t really spoon feed

lyric mountain
#

That's like, the first result on google

sharp geyser
ancient nova
#

this going to work?

earnest phoenix
#

Although they don't seem to do that troll

sharp geyser
#

Always try what you do, if it errors attempt to fix it

#

if you get stuck

#

google

#

if you can't figure it out still come here

rustic nova
#

tf is that last promise handler

winter pasture
# proven lantern This is how i am planning to setup my bots architecture. One issue i'm running i...

Don’t see 404 being listed on their invalid list so http status codes https://discord.com/developers/docs/topics/rate-limits#invalid-request-limit-aka-cloudflare-bans
I think 2 years or so I did get a rate limit for fetching 404s to often with what seemed like a lower rate limit than the standard 200 OK limit, so may have changed

Discord Developer Portal

Integrate your service with Discord β€” whether it's a bot or a game or whatever your wildest imagination can come up with.

rustic nova
#

get element by id guilds?

proven escarp
#

idk it looks weird lmao

#

oh no

sharp geyser
proven escarp
rustic nova
#

but why have that

proven escarp
#

πŸ€·β€β™‚οΈ

rustic nova
#

the data returned is a json

sharp geyser
#

so

<h1 id="guilds"></h1>
#

It would just put all the json into an h1

rustic nova
#

or whats the context of that

proven escarp
rustic nova
#

ohhhh

sharp geyser
#

so

rustic nova
#

nvm

#

ye

#

ok, is within a document

sharp geyser
proven escarp
earnest phoenix
sharp geyser
#

as long as the id is there on any element

#

it will use that element

proven escarp
#

it could also be an h3

#

or an h4

#

or even a p

sharp geyser
#

loom you aren't helping

rustic nova
#

btw best is to have a backend for that instead of exposing your api token within your webpage

proven escarp
#

sowwy

ancient nova
rustic nova
sharp geyser
#

I plan on just making a graphql api for majority of what I do

ancient nova
earnest phoenix
winter pasture
sharp geyser
#

People won't trust what you build if you aren't secure

rustic nova
sharp geyser
#

Hell

rustic nova
#

really best to have a backend for that

ancient nova
#

will this work?

sharp geyser
#

I would do smth just to teach you a lesson

rustic nova
#

I beg

#

please make a backend

#

this hurts to see

ancient nova
#

I don't even know where to start

earnest phoenix
sharp geyser
#

lets just let em do him

ancient nova
#

making a backend

sharp geyser
#

if he gets fucked

#

thats his fault

#

we tried warning em

fresh geyser
#

i got banned for modding when i dont even know how to hack

#

in a fivem server

rustic nova
#

depending on what language, just a express server that has a endpoint called "guilds" and that just does what you did above

sharp geyser
rustic nova
#

without exposing your token

ancient nova
sharp geyser
#

Whats the harm in that

ancient nova
#

...

sharp geyser
#

Ooo wow they got your guild count

fresh geyser
sharp geyser
#

this is a dev channel

ancient nova
sharp geyser
#

I also once again

#

do not suggest using top.gg to get your guild count

#

if top.gg goes down for an extended period of time you will lose that information access

rustic nova
#

point being, you're not exposing a token

ancient nova
#

yeah my b I thought of something entirely differerent

#

idk why but I thought yall wanted me to make an endpoint that returns the key

rustic nova
#

its just a really really highly suggestion

#

oh nah

sharp geyser
#

That would be highly counter productive to what we've been saying

rustic nova
#

thats just as if you'd post your token right on the site and what you're making rn

ancient nova
#

yeah nw I'll make that api

rustic nova
#

essentially a backend that does actions in behalf of the site without exposing access keys etc

sharp geyser
#

Tbh

#

its not hard to attach a simple api to your bot

#

you will need it anyway if you wanna get member counts

#

Just run an express server on the same process as your bot e.g start it when you start your bot. and pass client to it

#

then you can access whatever you want about your bot

lyric mountain
winter pasture
ancient nova
#

is this going to work?

sharp geyser
#

in your html file

#

you make a request to that endpoint

rustic nova
#

then its fine

sharp geyser
#

fetch("http://localhost:port/api/topgg")

#

or whatever the url is

ancient nova
#

fetch is not defined

sharp geyser
ancient nova
lyric mountain
ancient nova
#

and yall said it was built in kek

winter pasture
#

Use node 18 for built in fetch

lyric mountain
#

Repeat too many times and BOOM, locked for a day

sharp geyser
#

when using it in html its browserjs

#

completely different from node

ancient nova
#

my version is Node.js v17.1.0

#

damnnn

sharp geyser
#

alternatively you can use something like undici

ancient nova
#

installing node-fetch then

sharp geyser
#

node-fetch trash

ancient nova
#

good enough for my purpose

sharp geyser
#

although undici iirc requires a higher node version anyway

#

as it uses the built in fetch node 18 offers

winter pasture
#

undici may be best option as it is what node 18 uses

#

Makes it easier to migrate in the future

lyric mountain
ancient nova
#

I can't upgrade to v18 node v17 is what my vps chooses

sharp geyser
lyric mountain
#

if u got into java I BET you would choose org.json

sharp geyser
#

which wouldn't be a problem if he had nvm

lyric mountain
#

which is a terrible memory hog

#

but "good enough" for json

earnest phoenix
sharp geyser
#

Doesn't undici require node 18+?

earnest phoenix
#

Undici supports running on Node.js v14 even

sharp geyser
#

Oh damn

#

I thought it was for 18+ only

lyric mountain
#

nsfw lib mmLol

winter pasture
#

"node": ">=12.18” from their package.json

sharp geyser
earnest phoenix
#

But the fetch() method Undici provides only works with Node.js v16 and higher

lyric mountain
sharp geyser
#

Also I got distracted and stopped working on my website

#

So how do I do animations on click πŸ€”

#

Cause when I click something I want it to slide out in a transition

lyric mountain
#

a la powerpoint

sharp geyser
#

πŸ‘€

ancient nova
#

how do I import the freaking esm module

#

so annoying

#

TypeError: fetch is not a function

sharp geyser
#

thats VERY helpful

#

instead you could show how you do everything as well

winter pasture
ancient nova
#

SyntaxError: Cannot use import statement outside a module

sharp geyser
#

My god

#

SHOW

ancient nova
sharp geyser
#

CODE

ancient nova
#

OK RELAX

#

I WAS GETTING THE SCREENSHT

sharp geyser
#

Why not use require

winter pasture
#

node-fetch does not use commonjs

#

ESM only

sharp geyser
#

if you use v3 sure

ancient nova
#

it used to be able to be used with require

sharp geyser
#

v2 is still available

#

and it still gets criticle fixes

winter pasture
#

Yep. That’s why I sent the link above

sharp geyser
#

npm install node-fetch@v2

#

easy

ancient nova
#

alright how do I install the v2? what's the actual version code?

ancient nova
winter pasture
#

Look at the link I sent above

ancient nova
#

didn't know it was called just v2 but ok

sharp geyser
#

Works wonders when you read

winter pasture
#

You could also enable "type": "module", in package json. Or make it a .mjs file. But let’s not get started with that now xD

ancient nova
#

I hope it overrides the old modules

winter pasture
#

It should yeah

sharp geyser
winter pasture
#

Yeah πŸ™ˆ

sharp geyser
#

he shouldn't touch esm at all

ancient nova
#

SyntaxError: Unexpected token o in JSON at position 1

#

god damn

#

so many errors

sharp geyser
#

Show your package.json

ancient nova
#

{
"dependencies": {
"express": "^4.18.1",
"node-fetch": "^1.0"
}
}

sharp geyser
#

or is this after you installed node-fetch

ancient nova
#

that's literally it

#

lmao

sharp geyser
#

why is it using 1.0

#

πŸ‘€

ancient nova
#

I installed it on my PC and then moved the files to my VPS

sharp geyser
#

well thats not a good idea

earnest phoenix
#

It returns an invalid response to consume as JSON

ancient nova
#
    res.setHeader("Content-Type", "application/json");
    
    const TOPGG_FETCH = fetch(`${TOPGG_BASE}/bots/973306610501947423`, {                                  
        method: 'GET',                       
        headers: {      
            'Authorization': TOPGG_HOOK,            
        }
    }).then(resp => resp.json());
    
    res.json(JSON.parse(TOPGG_FETCH));
earnest phoenix
#

Uh, you're not supposed to call the JSON.parse() method on the response, and the fetch() function returns a promise, resolve it

#

When you call the json() method on the response, it already gets consumed and converted to a JSON, if the response is valid and returns a JSON response of course

ancient nova
#
    res.setHeader("Content-Type", "application/json");
    
    const TOPGG_FETCH = await fetch(`${TOPGG_BASE}/bots/973306610501947423`, {                                  
        method: 'GET',                       
        headers: {      
            'Authorization': TOPGG_HOOK,            
        }
    }).then(resp => resp.json());
    
    res.json(Promise.resolve(TOPGG_FETCH));
#

I assume that's fine then?

earnest phoenix
#

AndroidSkull what are you doing

boreal iron
#

From worse to worser freerealestate

earnest phoenix
#

Remove the Promise.resolve() call, because the promise is already resolved by the await keyword

ancient nova
#

ok..

#

now what?

earnest phoenix
#

Try it

boreal iron
#

I mean if you would have looked into the docs once you could have easily just copied the example

#

That would at least make things a bit better

ancient nova
#

works

boreal iron
#

Are you going to call the request whenever a client loads the site?

#

I feel like I have to spam the F5 key once I’m back home to try it out

ancient nova
#

doesn't return the guild count so hold on

lyric mountain
#

the sheer amount of refreshes will make ur bot get listed out of the api

boreal iron
#

I feel like I’m horribly right with my guess

ancient nova
#

uhhh it doesn't return guild count bruhh 😭

lyric mountain
#

but it is an api access

#

and any api transaction includes a ratelimit

ancient nova
lyric mountain
#

unless it's ur own api

lyric mountain
boreal iron
ancient nova
#

bruh why does it only return the shard count

boreal iron
#

Maybe because you’re accessing the wrong property freerealestate

ancient nova
#

I'm not

sharp geyser
#

Notice how there is a ? at the end of server_count

#

if no server_count is present it will show null or smth

boreal iron
#

Why do you send a screenshot of the api fields?

ancient nova
#

how do I get the server_count to show then?

boreal iron
#

And not the code you wrote

sharp geyser
#

what are you doing

#

this is basics to getting help

#

why do people fail so hard at it

ancient nova
#

the api code or the one in the html?

boreal iron
#

Do you even post your guild count?

sharp geyser
#

Show both if ou have to

#

either one will eventually be helpful

ancient nova
#

oh hell no I need to actually post the guild count to the top.gg api? I thought top.gg was getting the guild count automatically

lyric mountain
#

cant u simply use top.gg widgets?

sharp geyser
#

You

#

πŸ€¦β€β™‚οΈ

boreal iron
#

I knew it

#

πŸ€¦β€β™‚οΈ

ancient nova
#

omfg if I wanted to do that I would've integrated my damn bot into the website

sharp geyser
#

How the hell is top.gg going to get your guild count

#

there is no endpoint on discord's api for that

boreal iron
#

Magic

sharp geyser
#

If only

dry imp
#

you can even cheat the guild count

boreal iron
#

Shhh

sharp geyser
dry imp
#

im just sayin PekoShrug

boreal iron
#

Jumping from 500 to 1000000

ancient nova
boreal iron
#

Organic growth

lyric mountain
ancient nova
#

where do I even post the guild count to

wheat mesa
solemn latch
#

in the once ready event set an interval yeah.

eternal osprey
#
ncaught ZodError ZodError: [
  {
    "code": "invalid_type",
    "expected": "array",
    "received": "object",
    "path": [],
    "message": "Expected array, received object"
  }
]```huh
#

Copy\node_modules\@discordjs\builders\dist\index.js:3:7535)coming from the builders

winter pasture
#

What’s your code?

#

And DJS versjon

boreal iron
#

Wut

#

That’s no djs error

eternal osprey
#

djs v13.3.1

boreal iron
#

WUT

eternal osprey
winter pasture
#

I mean the error must come from somewhere 🧐

#

If your not running anything, does it just pop open when you open your terminal?

#

Or do you run a node command?

eternal osprey
#

Ahaa i caught it and it's apparently coming from an Addchoices method!

winter pasture
#

Aha

eternal osprey
#

I only passed the {} instead of wrapping it in []

boreal iron
#

What sort of weird error logger is that