#development
1 messages Β· Page 23 of 1
Hmm.. I have that but it's not in the offers?
one sec
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox gogo
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...
It should be? Else just sign into their website using ur Github account that you have the student pack in.
As long as you have github student license
you can just signup/in with github
and you automatically get em
And then you'll get the license for +- 1 year
I'm viewing it from here, no? https://education.github.com/pack/offers
Did you signin/up with github?
Wot.
No reason it shouldn't of worked
It works for me
Did you make an actual jetbrains account?
π
Bruh.
π
Contact support
Done.
xD
Cuz that was so fast, I'll just imagine u said "Hey. License no work. Help"

Ayy u did it!
Damn, I have a .me domain, a .tech domain, and some other name.com domain I can make for free.
Any ideas? 
or just develop open-source stuff
Yes. Think of a gud name xD and whalla!
just two lines for the love of god
bro
raging much? π
A fast, refined, and cleanly written all multi-purpose discord bot.
I got it
look
like margin: 4% or something
sayuri this very moment:
margin-inline-start inside a flexbox
π
explain why code results in undefined behaviour
ok will u relax -_-
no need to hate on my css skills
just tell me how to do this properly
just said that it exists
you have three childs
yeah
and the parent is flex
yes
so you just need to specify the gap
then justify-content: center to align them all in center of the parent
that's it
ah bet
you put gap on the child
π
you put both properties on the parent element
which has the flexbox
oh π
those properties affect its child
not itself
to correct child position use anything with self suffix
A fast, refined, and cleanly written all multi-purpose discord bot.
it didn't work π
it just enlarged the buttons themselves
π π
the parent
the div parent π
the div that has the class of buttons
the div that contains all 3 buttons
and that I should put it on the buttons
correction: solution
ohh u put it in the style
where else would you put π
okay hold on wtf
what
Wtf ads 
wdym I have no ads
why
oh that?
on the parent

didn't u tell me to bofore?
but the class inherited it
oh wtf
it inherited those classes
as a result it's no longer needed to specify the properties on target element
Weird⦠not on iOS
same on windows
The inconsistencies of the Android builds compared to desktop and iOS builds
True
it's a lil too big so I'll set it to like 15px
Well it's being rewritten in React-Native so it's good, almost everything is consistent on that rewrite
Because nobody likes android or will be known as android developer
u want me to use something else?
FakE news ong

for multiple sizes i suggest using responsive values
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?
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
width: 100%
that's the issue
wait
no
https://butler.scarlex.org/main.css gonna be a pain looking for that here u know the class it comes from at least 
it's not
Looking at Bae's cursed code episode 357

tbh I do want u to look at the code I wrote yesterday
misty called it "irrelevant"
wanna rate it?
it's not that bad...
No thank you I want to be able to sleep tonight
π
Itβs pretty terrible
The indentation is the scariest part of it
The rest of it I couldnβt focus on because the indentation is garbage
Astaghferallah
@ancient nova the issue might be in your react code
how do I make it auto redirect?
for some if u visit /dashboard I want it to auto redirect u to /dashboard/home
Might as well just call your code obfuscated
woooow
what's the implementation
react?
angular?
vanilla?
express
π
bro don't hate on express π
express is not client-side
He is rendering html files with express
alright so vanilla
Imagine obfuscation your own code to protect it from yourself
uh mb ig
butβ¦why
in that case use location.push
Just use react at that point :c
Now I know why Bae doesn't trust themselves with an eval command

mb

use location.assign
Epic dotpost fail
it's been ages since i last use express
https://butler.scarlex.org/dashboard if u visit this does it redirect u to /dashboard/home now?
A fast, refined, and cleanly written all multi-purpose discord bot.
affirmative
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
same title bar, and something something else
i can't suggest anything without knowing the contents to be put on the page
Man⦠sayuri not being very flexible
scss for me
since you are a curly brackets guy
and i wanna make it close to css
I heard sass was scss on crack
idk
it apparently offers what scss does and then some but idk
it's indent-based so i don't like it
Ima use scss
indented based syntax is broken still apparently
Even though the issue was brought up in 2011
only python devs like that
just told u, some stats, command list and some info about ur guild when the bot is in there
but the guild thing I'll do last since I'm going to have to use oauth for that
still not enough context
or
my brain stopped workign
lmfao
tf is a jfif
jfif
ok
some another higly compressed image file
its something related to the jpeg file extension
JPEG File Interchange Format (JFIF)
more like jpg not jpeg
I see

i would insert graphs for those basic stats
along with an animated background
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
so is the menu as well
what's ejs? π
embedded js
ok
idk how to add an animated background other than having a gif as a background
? I didn't send this
write them manually
use css
or js
bruh I wanted to have something like that
or wasm
an interactive background
hold on I'll show u an example
mrdoob's work
it's cool af
i'm thinking of detroit become human triangles
yeah when u hover ur mouse over something and it reacts
yeah but I still don't actually know how to replicate something like this in pure CSS 
let interactive animations for interactable elements, say menu items or dashboard items
the wave can be done in css
but as for live mouse tracking it needs js
as expected, it uses canvas
No
I see
I'll use JS
do you have any examples I could copy?
I am curious tho do you know what wasm is?
some coding lang related to websites, I never used it tho
gonna copy dyno's dashboard tbh it looks good af

as expected
wait no ofc not
already told you my ideas
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
i focus on animations
Copyright: exists
Bae: more like a suggestion list
lol
π
I'll text u when I get some sorta inteligable layout
then we can try adding animation
No idea how figma even works ngl
latex but for web
never heard of it
man didn't compose math documents
it's a language for making diagrams, formulas and shit
tf you talking about sayuri
My brother in Christ, how do you not know about LaTeX
see this? yes, it's latex
if u even need to make formal math formulas, you'll probably use latex
especially in graduation projects
not everyone is voltrex
maballs
thats why
jk it's a design tool
Latex pants? I see your fetish- call me daddy
@civic scroll how do u do comments in html again?
<!--this is a comment-->
ty
ItsOkayBae: asks something
the fucking internet and stackoverflow: am i a joke to you??
imagine not searching on internet before asking others
cringe tbh
He would rather wait 2 minutes for a reply instead of 15 milliseconds for a google search π
it's okay i asked here too
Now for the real test
lets see if I can do scss
with little knowledge of base css

What can go wrong
Absolutely everything

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
Eww I will never use flex
This is new in VSC: https://cdn.hamoodihajjiri.com/mcL9hlS4uI .
Could've pressed CTRL + E, but it's still cool.
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%;
}
Because flexbox is the size of the child elements inside it
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
there is indeed a nav tag
height: 100vh
it tried to do 100% content height, which is current only the hello world box
that causes overflow on y though
position: sticky
How to center a div
How to make a div fill width
How to make a div fill height
How to make a gradient with CSS
How to use flexbox
Or just donβt use flex here because itβs not the proper case for it
did it work
no
what
using 100vh works but causes overflow, and 100% just makes it stay the same size as the child element inside it
body { position: relative; h 100% w 100%}
Margin probably causes the overflow
also yeah that
Or just do something like overflow: hidden
Won't that interfere in the future
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
Alr gonna seem dumb but cant seem to figure this out
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
even using overflow: hidden didn't stop it from overflowing
Your config isnβt set to be a module
So you canβt use es6 style imports like that
I dislike how you are relying on a interface for this but π€·ββοΈ
you can try to compile it to .mjs
Interfaces are kinda built for this sort of thing just saying
icic
indeed

but I prefer going for a class approach rather than exporting a default object
Yeah
But itβs not required
Class would work but I went for interface
Interfaces are essentially just abstract classes
i didn't get what you meant by that
https://butler.scarlex.org/dashboard/home what do u guys think so far
A fast, refined, and cleanly written all multi-purpose discord bot.
done the home page
Moment
Now I have a system to welcome new members understand that?
At this point it isn't cause of the navbar anymore I don't think
I think its the body
> sayuri reload --module Brainstorm
Body padding
devtools go
also yeah
I believe the default is 15px
wait
Yeah
on body
From what I understand... you are using the custom link such as .gg/something (custom vanity url). Discord doesn't recognize it as invited by a user so it doesn't return one. You can catch for that and just say that it's from vanity.
Takes like 7 seconds to load
the bot stats should not be condensed into a single tile
wot
I was looking at the dev tools
takes 1 second for me
Itβs slow to load for me
when you no inspect devtools
yes
anyway does it look good?
I hardly know the tricks
How ?
Pro tip misty: devtools saves headaches and time
:cough:
@civic scroll how do I make the line in the middle go to the very bottom
what if someone has a 4k screen

Only people with money to waste uses 4k
and those people surely won't visit your site no offense
@ancient nova the border should be on aside element instead
ah bet
yes
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
@ancient nova also the aside has some top padding, consider removing it
that's on purpose actually
for what
the butler dashboard text to be a little lower from the top
then you just offset the text element
instead of the aside
what happens when you change the bg of aside
well the bg of aside is transparent anyway so changing the main background won't affect it
i said aside
it should be considered when you add color schemes for themes later on
just do .catch((e) => {}) if using js
https://butler.scarlex.org/dashboard/home does it look better now?
A fast, refined, and cleanly written all multi-purpose discord bot.
I think there is an easier way? If someone logs in via a link that Discord can't read, they tell me in the welcome that they have been invited by <owner>
Do you know this ?
that's literally what im telling you to do...
catch(() => null); please
.catch((e) => {}) and do anything you want on catch


ahh bet
Gonna sell it to voltrox
voltrox
@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?
What color scheme should I go for π€
at this point just generate the html directly on the server and send to client
I am not too familiar with the cocnept
since you technically can embed js into html I thought that was possible
π
Color wheel
<script> exists
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
also at this point use ajax style
Aka colors on opposite sides of the color wheel look good together
you may be right
I did a little bit of web design which meant learning basic color theory
i do everything to my hearts content
Basically because theyβre opposite to each other they have high levels of contrast which is why they look good
π
also why would you do script inside body
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?
Also when you do script inside the body
wait I'm gonna have to install fetch module dam
HUH
what
Other bots do not receive POST requests made to the bot who posted the message
I see, so it won't work. Thank you!
God I am tired
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.
went to sleep at 4am and woke up at 8 being spammed with text messages
ayeee wooot
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
My guy....
How the fuck would we do that
and yeah i have the permissions to do so, but haven't got the clue to do that
API endpoints on the other bots, if you have access to their code (Iβm assuming itβs other bots youβve made?)
Waffle doesn't the browser have a native fetch implementation?
You can use a webserver like express to receive the data and then use node fetch/your preferred API wrapper to send a POST request to said endpoint
I mean yeah, javascript has it built in
@ancient nova look up your issues before immediately assuming a solution if youβre unsure you dingus
I see! Way too hard. I will just create slash commands
Not very hard, but definitely annoying to try to communicate between bots
yeah, it's not hard but don't have the energy to do such api post and get requests for a simple command
tho, thank you waffle for helping me!
π
have you heard of trying it and seeing π
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
margin-top?
margin top yeah
do style="margin-top: whateverurnumberpx;" on the text
Donβt put your API token client side π
I'm using env though, should be alright
Well that ain't how that works at all
If itβs loaded by the browser, environment variables does not work. Client will have full access to it
read this
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
If you're going to be doing smth like this
breh
and how will that server work
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
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
@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
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?
yes
You saying top,gg isnβt the most reliable site out there?
idc I'm not going to make a server nor I'm going to put my website directly into my bots source
My guy it goes down randomly as is
When have we ever gone offline π§
This guy relying on top.gg to get
the guild count of his botanything
FTFY
/j
Letβs not be toxic :D better to explain why itβs a bad idea than to just hate on it
I have already tried countless times
it gets boring after a while
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
We tried, and again, and again, and again, and...
But they always come back
I see no issue with retrying it, as long as you don't get rate limited
although it being a 404 is definitely something to look into
that shouldn't be happening
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
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
That's like, the first result on google
Yea, at this point if he doesn't attempt to read what we link ima just ignore em
this going to work?
Sometimes people who ask for help here should learn how to lookup their issues/questions before coming here
Although they don't seem to do that 
hem hem ItsOkayBae
try it and see
Always try what you do, if it errors attempt to fix it
if you get stuck
if you can't figure it out still come here
tf is that last promise handler
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
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
get element by id guilds?
it gets an element by id
on an html document
but why have that
π€·ββοΈ
the data returned is a json
or whats the context of that
or ```html
<h2 id="guilds"></h2>
ohhhh
so
doesn't matter
yes it does 
The first then() call doesn't return anything, so the data parameter in the second then() call will be undefined
loom you aren't helping
btw best is to have a backend for that instead of exposing your api token within your webpage
sowwy
We've mentioned
I see then how should I make it work????
I mean I'm even getting paranoid for having a backend on my site, but that backend having access to my docker socket
if someone doesn't come with malicious intentions they probably won't do anything bad
You can either use the return keyword to return the data to the function or just (resp) => resp.json(), direct return
That is a HORRIBLE mindset
But yeah. Looks pretty nice. Been running pretty much the same architecture for a while myself. Never has the issue you mentioned tho
Guess my message queues takes a bit longer causing me to not get 404s
People won't trust what you build if you aren't secure
I mean they can essentially do anything with that token, don't assume nobody would care
Hell
really best to have a backend for that
will this work?
I would do smth just to teach you a lesson
I don't even know where to start
fetch() returns a promise, you gotta resolve it
lets just let em do him
making a backend
depending on what language, just a express server that has a endpoint called "guilds" and that just does what you did above
not the place for this
without exposing your token
but when just anyone can call the guilds endpoint?
...
Ooo wow they got your guild count
where do im gonna text it then ??
oh my b I thought about something else 
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
they can, thats the purpose of your publicly facing feature you're making
point being, you're not exposing a token
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

That would be highly counter productive to what we've been saying
thats just as if you'd post your token right on the site and what you're making rn
yeah nw I'll make that api
essentially a backend that does actions in behalf of the site without exposing access keys etc
Tbh
its not hard to attach a simple api to your bot
you will need it anyway if you wanna get member counts
top.gg can't give you that
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
Ran into CF ratelimit not too long ago, that ratelimit is DEFINITELY still there
Yeah. Seemed weird that they did not list 404 as a invalid request type. Seems like something they should have stricter limits for to prevent brute force for scraping etc
then its fine
fetch is not defined
tho you have to actually return the data
Not only 404, but any client-side error iirc
and yall said it was built in 
Use node 18 for built in fetch
Repeat too many times and BOOM, locked for a day
node 18 has the built in fetch for ndoejs
when using it in html its browserjs
completely different from node
alternatively you can use something like undici
installing node-fetch then
node-fetch trash
good enough for my purpose
although undici iirc requires a higher node version anyway
as it uses the built in fetch node 18 offers
undici may be best option as it is what node 18 uses
Makes it easier to migrate in the future
u always choose the "good enough" options dont u?
I can't upgrade to v18 node v17 is what my vps chooses
He'd have to update node
if u got into java I BET you would choose org.json
They don't have to
Doesn't undici require node 18+?
Undici supports running on Node.js v14 even
nsfw lib 
"node": ">=12.18β from their package.json
I will turn you into an nsfw lib
But the fetch() method Undici provides only works with Node.js v16 and higher

I see
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
a la powerpoint
π
how do I import the freaking esm module
so annoying
TypeError: fetch is not a function
SyntaxError: Cannot use import statement outside a module
CODE
Why not use require
if you use v3 sure
it used to be able to be used with require
Yep. Thatβs why I sent the link above
alright how do I install the v2? what's the actual version code?
bet
Look at the link I sent above
didn't know it was called just v2 but ok
Works wonders when you read
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
I hope it overrides the old modules
It should yeah
That is a can of worms on its own
Yeah π
he shouldn't touch esm at all
Show your package.json
{
"dependencies": {
"express": "^4.18.1",
"node-fetch": "^1.0"
}
}
or is this after you installed node-fetch
well thats not a good idea
That error is coming from the the URL you're making a request to
It returns an invalid response to consume as JSON
uh then what exactly is wrong ?
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));
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
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?
what are you doing
From worse to worser 
Remove the Promise.resolve() call, because the promise is already resolved by the await keyword
Try it
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
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

-_-
doesn't return the guild count so hold on
LMAO didn't even think of that
the sheer amount of refreshes will make ur bot get listed out of the api
I feel like Iβm horribly right with my guess
just please don't, don't make my life harder
unless it's ur own api
I don't need to, u already do that willingly
Donβt worry, the internet is a save place, nothing bad happens if you let your door open

Maybe because youβre accessing the wrong property 
Notice how there is a ? at the end of server_count
if no server_count is present it will show null or smth
Why do you send a screenshot of the api fields?
how do I get the server_count to show then?
Show your code
what are you doing
this is basics to getting help
why do people fail so hard at it
the api code or the one in the html?
Do you even post your guild count?
omfg if I wanted to do that I would've integrated my damn bot into the website
How the hell is top.gg going to get your guild count
there is no endpoint on discord's api for that
Magic
If only
you can even cheat the guild count
Shhh
sure but it only promotes bad growth
im just sayin 
Jumping from 500 to 1000000
bruh π ok I'll do the post on the "ready" event
Organic growth
sudden #mod-logs notification
where do I even post the guild count to
just post like every 3-12 hours
in the once ready event set an interval yeah.
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
djs v13.3.1
WUT
I am not running anything, it comes from my index file
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?
Ahaa i caught it and it's apparently coming from an Addchoices method!
Aha
I only passed the {} instead of wrapping it in []
What sort of weird error logger is that








