#development

1 messages · Page 2035 of 1

quartz kindle
#

does cs even teach you anything about modern programming?

#

isnt it more hardware oriented?

split hazel
#

in my school not really

#

they teach you about old architectures of the CPU

#

like really old

#

back when cpus only had one general purpose register

crimson abyss
#

it teaches you about how we got where we are today 🙂

quartz kindle
#

and how utterly hopeless we all are

#

and how one major disaster means back to stone age because nobody actually knows how anything actually works

earnest phoenix
#

The usual activity of uninformed people casually scaring other people of a "world ending" scenario while nothing is actually going to happen, or at least nothing so bad

#

It's actually annoying when people talk about stuff they have no idea about

quartz kindle
#

hey tell that to mr putin :^)

slender thistle
#

Putthatout

boreal iron
#

Tim’s dream, somebody finally pressing the red button

#

And he wouldn’t need to finish his API anymore

#

As well as the 5000 unfinished projects

near stratus
boreal iron
quartz kindle
#

lmao

cinder patio
#

God React is so much nicer than Vue

#

Next.js > Nuxt.js specifically

proven lantern
#

what about svelte?

#

$:

cinder patio
#

idk

proven lantern
#

here's a simple count app ```js
<script>
let count = 1;

// the `$:` means 're-run whenever these values change'
$: doubled = count * 2;
$: quadrupled = doubled * 2;

function handleClick() {
    count += 1;
}

</script>

<button on:click={handleClick}>
Count: {count}
</button>

<p>{count} * 2 = {doubled}</p>
<p>{doubled} * 2 = {quadrupled}</p>```

#

no useHook nonsense

woeful pike
#

this is insanity I hate it

#

so much compiler magic involved you don't even know what the code is doing at this point

quartz kindle
#

rather have that than a virtual dom nonsense

proven lantern
#

i'm still pretty new to it, but it's nice so far

quartz kindle
#

if you like react try solid.js

#

but i like svelte better

proven lantern
#

mmmkay

#

svelte has been around since 2016 and i just heard about it

#

im a noob

woeful pike
#

using labels for variables seems like madness, why do we need this level of abstraction I don't understand

#

I don't want things to feel like I'm incrementing a variable if that's not what's going on under the hood. Vue is guilty of this too imo

quartz kindle
#

i feel the same way whenever i look at react code

proven lantern
#

svelte doesn't allow you to write a function that returns a component which is weird at first

woeful pike
#

but react is just regular js that is built on top of a few rendering rules

#

my ideal js framework is no framework but the way browsers work by default leaves so much to be desired idk

quartz kindle
#

react has a shit ton of modules and functions and classes that do things for you, so you have to learn how to write web pages almost from scratch

#

with svelte besides some minor differences, i still feel like im writing actual html+css

cinder patio
#

Does it though? Everything is pretty much the same

#

just JSX

proven lantern
#

you cant write a function that returns components. that a big different there

woeful pike
#

the label magic is kind of a deal-breaker to me

quartz kindle
#

it feels like a js program that somehow creates html for you

cinder patio
#

I mean in a way that's what it is yes

proven lantern
woeful pike
#

yes but anything else you want re-computed needs a label for it. Normally it does nothing but svelte's compiler looks for a magic $ to rewrite code under the hood to make that reactivity happen and I don't like things being that far abstracted from me

proven lantern
#

you like writing the useState and useHooks stuff better?

cinder patio
#

I feel like a simple function call would suffice, tbh.

onChange(() => {
   // Code here...
}, [variable1, variable2]);

allows to be more explicit, too.

woeful pike
cinder patio
#

The compiler would still remove it

woeful pike
#

also I like react's philosophy of no-mutations a lot more

proven lantern
#

that is a good philosophy

woeful pike
#

but that has its own bag of issues that come with it

proven lantern
#

i like the actor model

#

one mutation per request

#

or message

woeful pike
#

wait what does the actor model have to do with that

proven lantern
#

mutations

woeful pike
#

actors don't share mutable state with other actors

proven lantern
#

actor is purely functional until it changes state(mutates) for the next message

woeful pike
#

also I don't think the idea of an actor specifically says anything about mutation. Elixir is built on that idea and doesn't allow mutable state but ponylang does

proven lantern
#

think about the back account example

#

the balance mutates after a deposit message

#

they dont create another actor with a new balance

woeful pike
#

yeah but that behavior is opaque to the person sending the deposit message. You can implement it that way and the caller wouldn't know or care

proven lantern
#

yep, the message gets sent to an address and all you get is the ACK

#

then the actor does pure function stuff based off it's current state and then mutates its state for the next message

woeful pike
#

mhm

proven lantern
#

it's probably the best way to handle mutation

hidden gorge
#
const DIG = require("discord-image-generation");
const Discord = require("discord.js");

module.exports = {
    config: {
        name: 'rip',
        description: 'RIP!',
        aliases: ["rip"],
        usage: '',
        group: 'fun',
    },
    run: async (bot, message, args) => {
  // const m = bot.findMember(message, args, true);
   
 let user = await message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(r => r.user.username.toLowerCase() === args.join(' ').toLocaleLowerCase()) || message.guild.members.cache.find(r => r.displayName.toLowerCase() === args.join(' ').toLocaleLowerCase()) || message.member;
 let m = await message.channel.send("**Please Wait...**");   
 let avatar = user.user.displayAvatarURL({
      dynamic: true,
      format: "png",
    });

    let img = await new DIG.Rip().getImage(avatar);

    let attach = new Discord.MessageAttachment(img, "rip.png");
    m.delete({ timeout: 5000 });
    message.channel.send({ embeds: [ attach ] });
  },
};```
proven lantern
hidden gorge
#

but where?

proven lantern
#

on this let attach = new Discord.MessageAttachment(img, "rip.png");

#

attach.description = "things"

#

and message attachment probably isn't an embed

hidden gorge
#

so js Discord.MessageAttachment(img, "rip.png"0: attach.description = "things"?

proven lantern
#

make a new MessageEmbed() and perhaps there is an setAttachment method

hidden gorge
#

so remove img, "rip.png"?

proven lantern
#
const { MessageAttachment, MessageEmbed } = require('discord.js');
// ...
const file = new MessageAttachment('../assets/discordjs.png');
const exampleEmbed = new MessageEmbed()
    .setTitle('Some title')
    .setImage('attachment://discordjs.png');

channel.send({ embeds: [exampleEmbed], files: [file] });```
hidden gorge
#

like this?

proven lantern
#

yep

hidden gorge
#

ok

#

wrong?

proven lantern
quartz kindle
#

dafuq is that image above

#

thats cursed

hidden gorge
#

i did it wrong i think

quartz kindle
#

yes very wrong

#

that makes zero sense

hidden gorge
#

ok what do i do to fix it?

quartz kindle
#

read the link Ben posted

hidden gorge
#

i am

quartz kindle
#

it literally shows you how to do it

hidden gorge
#

i am confused

wheat mesa
#

earnest phoenix
#

Usual developer that lacks the ability to read

boreal iron
#

Confusing is quite normal in that channel

hidden gorge
#

hold on

#

think i got it

earnest phoenix
quartz kindle
#

no you didnt get it

wheat mesa
#

Sometimes I wonder how clear one must be in this channel for someone to understand things

hidden gorge
quartz kindle
#

you need BOTH MessageAttachment AND MessageEmbed

hidden gorge
wheat mesa
#

I don’t understand where this extra parenthesis is coming from

boreal iron
#

That parentheses acting as bracket

#

JavaScript in 2022

hidden gorge
quartz kindle
#

you're just blindly trying out random things instead of reading and understanding lol

boreal iron
hidden gorge
#

lines

boreal iron
#

Take a closer look

hidden gorge
#

line 31 im guessing

boreal iron
#

Chance you find it is 1 out of 8

quartz kindle
#

lmao

boreal iron
earnest phoenix
#

The ); in line 28 is unnecessary, I'm getting the feeling that you don't know JavaScript fundamentals

hidden gorge
#

i do understand

earnest phoenix
#

And to dumb it down for you in literal steps instead of reading and understanding, you also need to use the attachment:// as a prefix in the setImage() method for it to consider using the attachment you've just attached to the message

quartz kindle
#

also, you didnt add the actual image data to the attamcjment

#

you just added a name

earnest phoenix
#

And the timeout option in the <Message>.delete() method was removed in discord.js v13, use setTimeout() instead

hidden gorge
#

hm i know stuff

#

oh im dumb

boreal iron
#

Well yeah using the right path would also help a lot

cursive finch
#

How I can delete my bot from top.gg? I just stopped developing my bot already.

earnest phoenix
split hazel
#

@quartz kindle i really dont like the C and C++ api for reading/writing to files

#

so i might just write my own

#

after all great ideas spark from problems

#

C++ ones is slow and overly complicated

#

C ones is buggy as hell

#

tho if i have to deal with shit like sectors and paging i'll pass

quartz kindle
#

i need a suggestion

#

say my api takes in an array of object ids, and returns data for said object ids

#

if an object id is invalid, would it be better to remove it from the return value and put it in some kind of errors array, or keep it in the return value but replace it with some kind of error indicator

#

like
input => [a,b,c,d,e]
result => { result: [a,b,c,error,e] } or { errors: [d], result: [a,b,c,e] }

split hazel
#

tricky

#

dont like the "error instead of object" thing

#

usually youd just make it fail alltogether or ignore the failed ones

cinder patio
#

former

quartz kindle
#

@_@

split hazel
#

'='

quartz kindle
#

my old api returns an object instead of an array, like this: { a: result, b: result: c: result, d: error, e: result }

#

but somehow i dont really like it because it makes it harder for the end user to iterate over it

#

which is what they will want to do 90% of the time

#

but i guess they can iterate using the array they sent in the first place and just map the ids

boreal iron
#

Why not something simpler like null for invalid id and false for no result people can read in your documentation

quartz kindle
#

because there are different types of errors

boreal iron
#

I would only return an error like bad request if the entire input is wrong

#

Ah okay

quartz kindle
#

its complicated

#

lmao

#

some specific configurations or invalid options invalidate the entire request and return 400

#

other configurations should invalidate only specific object ids

#

for example id is not valid, or id cannot be calculated using those specific options or id cannot be calculated for that specific date

boreal iron
#

I see but since you’re returning the exact same order like the input I would not return the error as separate key

#

Inputting 5 items and getting 4 back and an error under a different object key is confusing

quartz kindle
#

i can replace the errored one with something like { error: error message }

#

since all items return an object

boreal iron
#

Oh all items are an object?

quartz kindle
#

basically yeah

boreal iron
#

Ffs you could have said that earlier

quartz kindle
#

lmao

#

¯_(ツ)_/¯

#

sorry

boreal iron
#

I would still prefer the first version

quartz kindle
#

so basically

boreal iron
#

You gotta be consistent

quartz kindle
#

[a,b,c,d] => [{id: "a", a:1, b:2}, {id: "b", a:99, b:55}, {id: "c", error:"abc"}, {id: "d", a:500, b:200}]

boreal iron
#

I would do {c:null, error:…}

#

My gosh

#

Changing while I’m writing

quartz kindle
#

lmao

boreal iron
#

We don’t work well together tonight sir

quartz kindle
#

or ever

#

lmao

boreal iron
quartz kindle
#

i think im gonna settle for this then

#

and get rid of a global array of errors

boreal iron
#

Yeah you changed to what i was writing actually

#

Keep the key, c in that case with its data as null and add an extra key error with the message as value

quartz kindle
#

replacing with null i already do in a different scenario lmao

#

if only parts of the object are possible to calculate

#

the parts that are not possilble are nulled

boreal iron
#

No no

#

If haven’t seen your latest change

quartz kindle
#

anyway i g2g

boreal iron
#

kthxbb

quartz kindle
#

be back later to change more answers while you type

boreal iron
#

lmao

#

devil

split hazel
split hazel
#

alright fake

boreal iron
split hazel
#

sorry i am currently using a premium web framework

sharp geyser
boreal iron
#

But I’m proud of that!

#

Fuck all these fucker out there smirk

#

I’m my best friend

quartz kindle
#

best thing about the english language

#

you can say "fuck the fucking fucker" and its both gramatically and semantically correct and makes sense

boreal iron
#

I think the word fuck is about right in any possible form within the American English

#

I, you, he/she/it fuck(er/ing/s/…)

#

You know

dry imp
quartz kindle
#

someone help me organize this mess

boreal iron
#

Great image on mobile

#

0 height, 10000 width

quartz kindle
#

get a bigger screen

boreal iron
#

lol

#

Discord has no vertical mode

#

Hold on

#

Horizontal mode

#

… whatever is right

quartz kindle
#

i'll just paste it as text

#
    objectTypes: "PACHLMTSX", // planets, asteroids, comets, hypotheticals, parts, moons, sats, stars, points
    extendedObjectTypes: ["PA", "PP", "PN", "PS", "PF", "AA", "AP", "AN", "AS", "AF", "LD", "LN", "L!", "S@", "S!", "H!"],
#

lmao

boreal iron
#

Ok now how I fix discord code blocks on mobile

quartz kindle
#

lmao

#

but basically

boreal iron
#

And where’s the mess?

quartz kindle
#

im trying to organize all the possible object types into categories, but it gets a bit complicated

#

all object ids start with a letter, or 2 letters, followed by a number or any information about it

#

for example P5 would be planet 5, A30 would be asteroid 30, etc

#

but then some of them are extended or combined, like PA5 would be the aphelion of planet 5

#

but now i need to add another type

#

that is basically a midpoint between any 2 existing types

#

and idk what kind of syntax i wanna use

boreal iron
#

Poor Tim, needs to categorize the entire verse

quartz kindle
#

something like[P5, A5]

#

or $P5+A5

#

idk

#

$[P5+A5]

#

but

#

the type L! already does this, but with 3 objects, for example L!P5,A5,X5

#

but the calculation used in L is different, so i need to add a new one anyway

#

lmao

boreal iron
#

About 20 message above my brain stopped understanding anything

quartz kindle
#

lmao

boreal iron
#

Currently being on the highway might be the reason

#

Or just because im stupid

#

Idk

quartz kindle
#

just ignore me and drive

#

im not worth your time

boreal iron
#

lmao

#

I do always

quartz kindle
#

doesnt feel like it

#

lmao

boreal iron
#

Tim my secret lover

quartz kindle
#

oh my

#

.<

boreal iron
#

Meant to say friend

#

I’m sorry baby

quartz kindle
#

1000 bucks and im yours

boreal iron
#

Wew that’s cheap

#

I take it

quartz kindle
boreal iron
#

lmao

quartz kindle
#

this is on my actual github sponsors page

#

:^)

boreal iron
#

Totally okay for me as long as you keep your clothes on your body

quartz kindle
#

no problem for me as long as that cash keeps coming

#

:^)

boreal iron
#

:D

quartz kindle
#

only fans with extra steps

#

i'll take my clothes off if you stop paying :^)

boreal iron
quartz kindle
#

fuck

earnest phoenix
quartz kindle
#

redirects to a twitch tv channel

#

.>

#

294 followers

#

what a noob

ancient nova
#

member.user.presence.status
Cannot read properties of undefined (reading 'status')

#

what did they change it to?

#

I'm creating my first bot after like 3 years so ion know anything bout the new api

boreal iron
#

an users presence requires a privileged intent

#

iirc

#

As well as the gateway intent

#

In your case means that the property presence is undefined

ancient nova
#

I think I got it enabled, or is it verified bots only? I created a new bot cause I can't change the name of my verfied one

#

if not then most likely I enabled it

boreal iron
#

Check if you also have the gateway intent

ancient nova
#

either way what do I change it to if I want to fix it?

tiny ruin
ancient nova
#

yeah all 3 intents are checked

quartz kindle
#

are you using discord.js v13?

ancient nova
quartz kindle
#

did you also add them to the intents option in your client?

ancient nova
#

not sure

#

how would that look like?

quartz kindle
#

new Client({ intents: [your intents here] })

ancient nova
#

intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES ],

#

hold on

#

what are all the intents I need called again?

quartz kindle
ancient nova
#

no I'm asking which I need for the status to work

#

I assume there is more than one

quartz kindle
#

GUILD_PRESENCES

ancient nova
#

still doesn't work

quartz kindle
#

btw member.user.presence is wrong

#

user doesnt have presences

#

member does

ancient nova
#

then what do I change it to?

#

I'm completely clueless about the new api

quartz kindle
#

i literally told you

#

user doesnt have them, member does

ancient nova
#

I have no idea what that is supposed to mean

boreal iron
#

lol now I see it, too

quartz kindle
#

....

boreal iron
#

member.user.presence lol

ancient nova
#

I'm getting the member already

quartz kindle
#

think carefully

#

member.user.presence
user does not have presence
member does

ancient nova
#

ohhhhhh

#

my bad

#

@quartz kindle so it does work when I use it on myself but it doesn't when I mention

#

why?

quartz kindle
#

the data is not cached

#

presences only get cached when the member is active, for example when they send messages, etc

#

you have to fetch the member to get them if they are not cached

#

there is only one way to fetch presences

#

await guild.members.fetch({ user: ['66564597481480192'], withPresences: true })

ancient nova
#

show me da way

#

do I add that to the member constant?

quartz kindle
#

yes and no

ancient nova
#

actually can I not just do this

quartz kindle
#

sure you can

ancient nova
#

great

#

nevermind that didn't work for some reason

#

thought if I had a || it would ignore the error

quartz kindle
#

what error?

spark flint
#

i personally do member.presence?.status

ancient nova
#

why is this giving me a fucking error

quartz kindle
#

because \ is an escape character

#

meaning, "treat the next character as a literal string no matter what"

#

so it makes the second ' become part of the string, and not the closing of the string

ancient nova
#

then how else am I supposed to write a path?

quartz kindle
#

you can use \ to escape itself: '\\'

#

but using / is better for paths anyway

ancient nova
quartz kindle
#

windows is smart enough to know how to handle both \ and /

#

even when mixed together

#

but linux for example only uses / and does not support \

#

so using / is also better for compatibility

ancient nova
#

that's good to know

#

thanks

sharp geyser
#

😔

quartz kindle
#

not many use cases for it?

#

i never needed to split a path into an array of path names

sharp geyser
#

wait wut

#

path.sep is the separator for windows and linux

#

depending on the platform it either uses / or \

quartz kindle
#

ah lel i only looked at this

#

didnt notice the split

sharp geyser
#

oh, I use path.sep when I am looking up files that can be on linux or windows

quartz kindle
#

i use relative lookups

#

like __dirname + "/../../someotherfolder/"

sharp geyser
#

ye

#

I've had cases where using __dirname bugged out for some reason so I had to do the full path myself

quartz kindle
#

lel weird

ancient nova
#

@quartz kindle did they change statuses as well?

#

TypeError: Cannot read properties of undefined (reading 'clientStatus')

#

client.users.cache.get(message.mentions.users.first().id).presence.clientStatus

earnest phoenix
#

Users don't have presences, guild members do

ancient nova
#

so again just chening message.mentions.members will work?

earnest phoenix
#

It should, and just use the user/member returned instead of getting it from the cache again

quartz kindle
#

why are you getting from cache something that you already have

ancient nova
quartz kindle
#

message.mentions.users.first() and client.users.cache.get(id) both give you exactly the same thing, it makes no sense to use one to get the other, its the same as using something to get itself again for no reason

ancient nova
#

oh I got you now

ancient nova
#

why does it not work

#

it's a string so why does .contains not work?

quartz kindle
#

string.contains doesnt exist

#

its string.includes

ancient nova
#

but yea I figured it out

ancient nova
#

no way it mixed up the languages

#

Cannot read properties of undefined (reading 'Util')
let parsed = Discord.Util.parseEmoji(emoji);

sharp geyser
#

What is Discord

dry imp
#

this is Discord

feral aspen
#

@ripe prairie

ancient nova
#

why does this return null?

#

I'm not aware of what discord changed in the API but this should return the first message

lament rock
ancient nova
lament rock
#

an ID

ancient nova
#

huh?

lament rock
ancient nova
#

they must've changed that because it did work on previous discord.js version

lament rock
#

is a Snowflake

#

well, 1 could be considered a Snowflake, but it would be the earliest message ever

ancient nova
#

ReferenceError: result is not defined

lament rock
#

idk

ancient nova
earnest phoenix
quartz kindle
#

{ limit: 1, after: 1 } does work for me

#

(which is a nice little trick to get the first message in a channel, i havent thought of doing that before)

quartz kindle
#

using a message you already have to get the exact same message again for no reason

#

plus you're doing the second one wrong, thats why you're getting that error

boreal iron
#

Can’t even find limit or after in the base fetch options documentation lol

#

While I can find limit as option in one code example

stiff lynx
#

Why I get this err?

const roles = await member.roles
                .fetch()
                .sort((a, b) => b.position - a.position)
                .map((role) => role.toString())
                .slice(0, -1)```

```console
TypeError: member.roles.fetch is not a function```
earnest phoenix
stiff lynx
earnest phoenix
split hazel
#

I have a navbar which sits on top of everything with a fixed position, but elements under it ignore it and go over/under the navbar and not after it, any fixes?

#

do I have to apply a margin offset or something?

boreal iron
#

Yeah by creating a wrapper around the other content and using padding-top (navbar height) not margin

#

Also make sure to assign a z-index to the navbar to make sure it’s in front (always)

split hazel
#

i still dont know the difference between padding and margin

pale vessel
#

padding inside margin outside

spark flint
#

if i throw an error in JS

#

is that gonna stop the execution like return does?

earnest phoenix
#

@quartz kindle @dry imp @earnest phoenix i learnt codingg!!

#

Les goo

#

i learnt html and css basics

#

i'm pretty good at css

#

not MASTER bb_skul

dry imp
#

show me your website

boreal iron
spark flint
#

awesome

earnest phoenix
#

setting up an adfs environment for testing a feature in my bot but windows is giving me grief, what?

earnest phoenix
spark flint
#

just send a link here

earnest phoenix
#

yeah wait

#

@earnest phoenix

#

There you go

#

@dry imp

#

@earnest phoenix

#

In this full course, we learn how to build websites with HTML and CSS, and get started as a software engineer.
Exercise solutions: https://supersimple.dev/courses/html-css-course#exercises
Copy of the code: https://supersimple.dev/courses/html-css-course#code
HTML and CSS reference: https://supersimple.dev/html

Lessons:
0:00 Intro
1:02 1. HTML ...

▶ Play video
#

?

boreal iron
#

I see only plain text on that screenshot

earnest phoenix
#

really?

earnest phoenix
#

ohhh

#

But uh

#

i just credited you

#

also @earnest phoenix i am busy so i did that in 20 mins 💀 l

boreal iron
#

Excuse me. Plain text, bold text and an anchor freerealestate

dry imp
#

cmon fake he doesnt copy any youtube videos thats an improvement

boreal iron
#

lmao

#

My bad

dry imp
#

my pyscript website also looks like that

boreal iron
#

True but I expected a little bit more after reading this:

i'm pretty good at css

dry imp
#

ouch thats mean

#

eh mine would also looks like that if bootstrap wasnt applied

#

tailwind cringe

#

i might actually use it later down the line

earnest phoenix
#

I HAVE TO GO

dry imp
#

use bootstrap, tailwind or some sort to make it look better

earnest phoenix
#

sorry caos

#

caps

earnest phoenix
#

tell me the element for that

#

i did not learn that yet

#

i know to make shadows

#

hover

#

active

#

and stuff

#

like .<class>:hover

#

hm

#

okay

#

butt

#

idk how to put images..

dry imp
#

my website without bootstrap

earnest phoenix
#

And how to add them in the <style> </style> area

#

idk

dry imp
#

<img> tag

earnest phoenix
#

.img tag

#

thats it?

#

And then we write the styles

#

right?

#

idk that

#

I dk boosttrap

#

and stuff

#

i mean

#

bootstrap

dry imp
#

or you could start by looking through other website

earnest phoenix
#

WAIT I HAVE TO DOWNLOAD THAT??

dry imp
#

editing the html and stuff

#

to get a better understanding of the mechanics

earnest phoenix
#

mann i am getting confused

dry imp
#

i mean tbh i use templates aswell

earnest phoenix
#

uhh i 'll just learn html now

#

and css

dry imp
#

okay i'll give you an example

earnest phoenix
dry imp
#

you use replit right

earnest phoenix
#

i use vs code

#

I did this

#

when u hover on the cursor it shows this

#

like animation and stuff

boreal iron
#

These frameworks like bootstrap just give you an huge amount of prebuilt styles you can use and customize, not more or less

dry imp
#

ofc u can lmao

earnest phoenix
#

idk maybe? i never tried

#

I know the codes

#

and the <body> and <head> stuff

#

and the ccs stuff

#

elements

#

void elements

dry imp
#

apparently the link to the example is dead

earnest phoenix
boreal iron
#

Knowing “all” of them is just the first step

dry imp
#

i dont even know all of them

boreal iron
#

The combinations and how things work together (or not) are endless

dry imp
#

i skipped the first step

boreal iron
#

That’s the sort of experience you need to gather in order to create fancy stuff, how the kids would say nowadays

#

Well not only the tags are important, the attributes are important, too

earnest phoenix
dry imp
#

you dont need to remember all of it

boreal iron
#

I’ve got no words

earnest phoenix
boreal iron
#

Collecting experience takes a lot of time, that’s how it is

earnest phoenix
#

You know i have a printer?

boreal iron
#

Except if you’re just damn talented

dry imp
#

try searching for websites templates on google and modify a little things

earnest phoenix
dry imp
#

eh thats what i used to do on my early days

#

then i edit the structure

#

then i add some feature

#

my current website used to be a online template lol

earnest phoenix
dry imp
#

but i've modify them so much from what it used to be

earnest phoenix
#

just copied this website

dry imp
#

i had the files of the template

earnest phoenix
#

To this

#

is it same?

#

Idk how to put the apple one

boreal iron
#

You should be careful with using trademark logos without permission

earnest phoenix
#

i did it by hand without using inspect elements ( exept the color codes )

earnest phoenix
#

yes

#

in the video they told me to do

boreal iron
#

Nope the apple logo is just an apple, not a trademark, alright

earnest phoenix
#

But instead of copying exactly from the video

#

i made on my own

dry imp
#

it used to be the same folder and the same projects

earnest phoenix
#

🥷🏻

boreal iron
#

I’m sorry

#

But …

#

Yeah

earnest phoenix
boreal iron
#

That’s no embed

slender thistle
#

It's > a quote

earnest phoenix
#

then what is

slender thistle
earnest phoenix
#

the line

#

tho

#

he

boreal iron
earnest phoenix
#

the linee

slender thistle
#

That's how quotes are displayed

earnest phoenix
dry imp
#

its >>> actually

slender thistle
#

You could've tried it the way I showed

#

>>> for multiline, > for single line

boreal iron
#

magic embed self botting

earnest phoenix
#

magic embed self botting

#

Not coming for me

dry imp
#

among us

#

ew

earnest phoenix
#

Hi

#

Oh ok it worked

slender thistle
#

asd

boreal iron
#

Selfbot confirmed, ban incoming, bye

slender thistle
#

Good job

dry imp
#

you understand markdown now

boreal iron
#

For some reason quotes got abandoned

#

_enough of that weird discussion _

#

FakE’s gonna enjoying the sun now

#

And pissing of car drivers

earnest phoenix
#

i am learning <strong> element

earnest phoenix
#

Did somebody do a complicated dashboard with vuejs or similar?

  • for example
    I have a dropdown, should I fetch data from the parent and pass to dropdown component or should I fetch inside the dropdown component for choices.

Not planning to use ssr

stiff lynx
#

This if is never true...

const ruolo = await interaction.guild.roles.fetch("973168091154493460");
    if (interaction.member.roles.cache.has(ruolo)) {```
cinder patio
#

.has accepts a role ID, not the role object

stiff lynx
#

dam

#

there is a way to fetch and not cache it?

lyric mountain
#

can't u just check if the member has given role id?

#

instead of retrieving the role

stiff lynx
#

wdym?

lyric mountain
#

if (interaction.member.roles.cache.has("973168091154493460")) {

quartz kindle
#

whats up with people doing redundant stuff lately

boreal iron
#

There must be a new popular, professional tutorial telling them to do so...

neon jay
#
const userGuilds  = await axios.get(DISCORD_API_URL + '/users/@me/guilds', {
        headers: { Authorization: `Bearer ${req.user.accessToken}` }
    });
#

anyone know how to solve this error ?

lyric mountain
#

u supplied an invalid token for that scope

wheat mesa
neon jay
earnest phoenix
#

@lyric mountain Hi I want to make my bot page in dark mode. I am going to design in dark mode and light mode both but when it turns to light mode top.gg text color automatically converts to black. Can I change that text color too ? If so then how

lyric mountain
#

The ping was unnecessary tbh

#

You need to change the theme color instead of the text color, since toggling between light and dark applies the theme on top of any styles

earnest phoenix
earnest phoenix
lyric mountain
#

Did u read my last comment?

earnest phoenix
#

how ?

lyric mountain
#

Google time

#

I'm not up to date with top.gg styling names, you'll need to either find someone who is or find out yourself

#

All I know is that top.gg uses variables for each theme, and u need to change those instead of the direct component

earnest phoenix
lyric mountain
#

Not "my" support members, I'm just a bot dev

earnest phoenix
lyric mountain
#

As I said, either find someone who actively uses top.gg styling or find out yourself

#

I stopped doing styles in top.gg a long time ago

lyric mountain
#

Just as here and wait for someone to answer

#

It might take a minute or an hour, be patient

earnest phoenix
boreal iron
#

Look at both messages as reference

#

I explained how it works

earnest phoenix
boreal iron
#

Ok well I see the second link was a different story

#

But the first one is accurate

#

regarding the user's theme selection (and the site (text) colors) you can choose to pick a darker or lighter background for example

#

To ensure a readability without trying to change the general site style like text, colors etc.

earnest phoenix
boreal iron
#

👍

undone ivy
#

Sorry for disturbing, I want to submission my project, what can I do now?

lyric mountain
undone ivy
#

Yes, I've already submited

lyric mountain
#

it was already approved no?

undone ivy
#

But I've seen a line tell me to test bot's func in this server, I dont know if I understood it right

lyric mountain
#

nope, bots aren't added here

#

THEY test the bot, you just wait

undone ivy
#

Thank you for your guides, have a good day sir!

#

By the way

#

Excuse me, if my bot get verified, will it be faster?

lyric mountain
#

no

#

all bots are reviewed equally

undone ivy
#

Thank you so much, sorry for disturbing

#

🙏

lyric mountain
#

@quartz kindle btw our talk abt bitfields the other day helped a lot regarding my cards lul

#

impressive how I managed to reduce 5 variables to 1 by packing everything inside a single int

#

and still have unused bits left

#

maybe I could pack it even further by using only the first 2 bytes for those 0-1 values

#

ye, way better

round cove
#

that's a nice looking comment block

lyric mountain
#

whenever I work with bitfields I try to draw what each field is holding

round cove
#

What are you trying to make?

lyric mountain
#

for the sake of sanity

lyric mountain
round cove
#

Card game?

lyric mountain
#

ye, yugioh-like

#

this part is for card states

#

before I had many variables that could be merged into a single bitfield

#

the longest disable a card can suffer lasts 10 turns (petrification), I don't think I'll be adding anything longer than that

round cove
#

Is it stunne dif it's anywhere between 0-15?

lyric mountain
#

that's the duration

round cove
#

oh

#

interesting

quartz kindle
lyric mountain
quartz kindle
lyric mountain
#

holy

split hazel
#

my database is doing gods work

lyric mountain
#

password=YOUR_PASSWORD

heretic, it should be passwd=YOUR_PASSWORD

split hazel
#

💀

simple stump
#

Is there any way to bypass hotlinking protection (or whatever the term is)?
Trying to do this:

<img src="img_link_here">

But the site uses hotlinking protection or something cause I get a 403 forbidden error in console.

quartz kindle
#

are there ways? yes
should you do it? probably not

simple stump
#

Dang.

quartz kindle
#

hotlink protection exists for a reason

#

you're using their server to host your images, basically stealing resources from them

#

just download the images, upload them to your server, and link them from there

simple stump
#

Ah okay. That makes sense. Just wondering cause it's so much easier to just use the direct link then having to do another step

boreal iron
#

Which ends up being the same reason you mentioned basically

#

lol

quartz kindle
#

:^)

wicked pivot
#
const config = require('./config.json')

const fs = require('fs')

function SAVE() {
  fs.writeFile("./config.json", JSON.stringify(config), (err) => {
    if (err) console.log(err)
  })
}








if(config[responses] == 'A'){
  config[responses] = 'B';
  await SAVE()
}
else if(config[responses] == 'B'){
  config[responses] = 'C';
  await SAVE()
}
else if(config[responses] == 'C'){
   config[responses] = 'A';
   await SAVE()
}```

when I make a change it deletes everything in the config
vivid fulcrum
#

because you're writing to a file

#

you're re-writing the file with new data every time

wicked pivot
#

The problem is that it does not rewrite

#

Could it be due to a lack of time, for example?

#

because it is a loop according to what I write in the console?

quartz kindle
#

doing async writes concurrently on the same file = disaster

dry imp
#

true

#

thats why i love json db

boreal iron
#

jasondb

earnest phoenix
#

json db panic

sharp geyser
#
<ref *1> BaseStore(1) [Map] {
  '957867801119449113' => GuildChannel {
    client: BaseClient {
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      ws: [WebsocketShardManager],
      token: 'asdasdasd',
      _intents: [Array],
      _presence: [Object],
      options: [Object],
      rest: [RestManager],
      channels: [Circular *1],
      guilds: [BaseStore [Map]],
      [Symbol(kCapture)]: false
    },
    id: '957867801119449113',
    type: 2,
    guild: Guild {
      client: [BaseClient],
      channels: [BaseStore [Map]],
      id: '957867801119449109'
    },
    guildId: '957867801119449109'
  }
}

When caching a channel to the client cache should I make it a GuildChannel which has the bare minimum, just the id, type guild and guildId or should I cache them depending on their type like VoiceChannel, TextChannel, etc

earnest phoenix
#

how do you check how many voice connections the bot has?

sharp geyser
lyric mountain
#

A file can only be opened in 3 modes:
R = read-only mode, cannot edit
W = write-only mode, cannot read
W+ = read-wrife mode, you detain full control over the file

#

And write ops can only come in 2 modes:
Append = add content to the tail of the file
Overwrite = clear the file and replace with content

#

In your case, you're doing a W+ overwrite op on more than one "thread" (quotes intentional), and they don't acknowledge each other in any way (each execute in their own context)

#

As such, if all tasks start at the same time, the last to finish will null the result of every preceding task, because they don't know what the file looks like after the previous tasks finished

#

Now, "but why is it clearing the file?" you may ask, well, imagine you have two travelers A and B, both share a single book of countries visited, they go on their way to visit wherever they want to

#

A visits the entire europe and asia, filling the book with many seals and photos, wonderful memories

#

B however gets stuck at an australian airport and gets his wallet stolen, preventing further traveling, also delaying his arrival at the encounter location

#

When A finally meets B, he notices the book no longer has all the places he visited, only australia is there.

That's called race condition, when many tasks start at the same time, sharing the same reference, but each end with their own version of it

dry imp
#

you can also append

lament rock
#

I forgor if you can read stream a file multiple times at the same time

lyric mountain
lament rock
#

does read stream lock

lyric mountain
#

Don't think so, read holds no lock at all

lament rock
#

interesting

lyric mountain
#

It's only when it comes to writing that the issue begins

sharp geyser
#
Channel {
  client: <ref *1> BaseClient {
    _events: [Object: null prototype] {
      debug: [Function: log],
      ready: [Function (anonymous)],
      messageCreate: [AsyncFunction (anonymous)],
      channelUpdate: [Function: log]
    },
    _eventsCount: 4,
    _maxListeners: undefined,
    ws: WebsocketShardManager {
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      shards: [BaseStore [Map]],
      presence: [Object],
      client: [Circular *1],
      totalShards: 1,
      socketStack: [SocketStack],
      [Symbol(kCapture)]: false
    },
    token: 'asdad',
    _intents: [ 512, 1 ],
    _presence: { status: 'dnd', activities: [Array] },
    options: { intents: [Array], presence: [Object], cache: [Object] },
    rest: RestManager { client: [Circular *1] },
    channels: BaseStore(5) [Map] {
      '957867801119449113' => [GuildChannel],
      '972334766399582218' => [GuildChannel],
      '972342210685206569' => [GuildChannel],
      '972974453367652362' => [GuildChannel],
      '972975386549968936' => [GuildChannel]
    },
    guilds: BaseStore(1) [Map] { '957867801119449109' => [Guild] },
    [Symbol(kCapture)]: false
  },
  id: '961530915799060500',
  type: 4
}

Okay so I like that client is there, but I don't like that it is all thrown out like that, anyway I can make it collapse when logging (I doubt there is but it is a hope)

lyric mountain
#

That's why sqlite allows N reads but only 1 write at a time

lament rock
#

Make your Discord caching system file based hippo
store the raw jsons in their own files under their own folders based on an arbitrary indexing system

sharp geyser
#

sounds like a good idea

lyric mountain
#

Go a level higher, store in the filename

lament rock
#

fair

#

empty file content

sharp geyser
#

go a step higher and store all the data in an image metadata

lament rock
#

that texture atlas will be huge

sharp geyser
lament rock
#

use util.inspect and change the depth

#

but that affects all members

lyric mountain
#

Well u can format the text output

#

Process the string before logging

sharp geyser
#

Mmmm, I don't think I really wanna go that route tbh

lament rock
#

I wrote my own cursed JSON.stringify that supports circular references

lyric mountain
#

It's logging, no need to get too fancy

sharp geyser
#

I wouldn't mind the client being logged like that if it didn't have info that is relatively useless to some people

lyric mountain
#

I'm afraid to ask, but who "some people"?

lament rock
#

pretty sure there's a special Symbol property for when an Object is inspected

lyric mountain
#

Aren't only u seeing the logs?

sharp geyser
sharp geyser
#

a client is attached to just about every structure

lyric mountain
#

delete obj["client"]; Console.log(obj)

sharp geyser
#

Well no I don't wanna delete the client entirely from the response

#

just want to limit the result

lyric mountain
#

Make a copy of the object

#

Delete only in the copy

sharp geyser
#

Mmm well again wouldn't that delete the client entirely from the response?

lyric mountain
#

Only from the copy

sharp geyser
#

But the copy is what is being shown to the user

#

so like again not what I want at all

lyric mountain
#

Then show the original to the user

#

I don't really know what exactly ur trying

#

Why is the user seeing debug logs?

sharp geyser
#

It isn't a debug log

#

it is the common response discord gives back when logging smth like a channel or guild

lyric mountain
#

But why is the user seeing it?

sharp geyser
#

🤦‍♂️

lyric mountain
#

User should be abstracted of anything internal

sharp geyser
#

Discord.js does exactly this

#

if you log message.channel you get the channel object back right ?

lyric mountain
#

Right

sharp geyser
#

Okay then

#

that is exactly what is happening here

lyric mountain
#

But that's my question, WHY is the user seeing the message.channel being logged?

sharp geyser
#

THEY aren't unless THEY do console log it

#

right now I am testing my lib and seeing the responses back

lyric mountain
#

They both are and arent?

sharp geyser
#

as if im a user

lyric mountain
#

...for context, is the user a discord user or a lib user?

sharp geyser
#

What does that even mean

lyric mountain
#

Who is "user"?

sharp geyser
#

They'd have to be a user of the lib if they are going to be interacting with the lib to console log message.channel

#

I feel like this is going entirely in the wrong direction

lyric mountain
#

So it isn't a user in the sense of a random person on discord, it's a developer that's using your library

#

Right?

sharp geyser
#

Yes

lyric mountain
#

That makes more sense then

#

I was thinking you had a bot and the user was just a rando

sharp geyser
#

No

#

This is my own lib that I am making and am trying to make the responses back as clean as possible and not so junky

lyric mountain
#

You can make you own wrapper and override the toString function

sharp geyser
#

I was thinking of just making my own logger that people can use to control the depth of what gets logged, but then again that probably wont end up ever getting used so I see no point

lyric mountain
#

Remember log4j

#

Loggers are dangerous if done wrong

sharp geyser
#

the logger that had a massive exploit ye

#

One of the other reasons I can't really be bothered

lyric mountain
#

Just make a wrapper, ez pz

sharp geyser
#

I might just say fuck it and leave it how it is at this point if someone cares enough they can just fork my lib and implement smth

lyric mountain
#

Like, just a class to enclose the response

#

Or just a function to parse into more readable string

sharp geyser
#

Ye, but at this point I just can't spend my time on it anymore

#

I have other things to work on

quartz kindle
#

works for util.inspect too

sharp geyser
#

But doesn't that basically just remove the entire thing from the response?

quartz kindle
#

it hides it yes

#

which is what djs does to most of its _props

sharp geyser
#

I see

quartz kindle
#

and stuff thats not supposed to be seen/used by the user

sharp geyser
#

I noticed that do that a lot yes

#

they use Object.defineProperty on a lot of stuff

quartz kindle
#

you can still see it with showHidden:true

sharp geyser
#

I will work on that kind of stuff at a later point tho tbh

#

I am more worried about the rest api integration and making the gateway client better as well

quartz kindle
#

it also affects json

sharp geyser
#

right now if you were to leave the session going and smth happens you don't know why it just says request failed or smth

sharp geyser
#

Well so far I have Text, Voice and Category Channel data support

#

But I feel like I am doing this a bit wrong when converting the raw data to the proper channel data

#
        if (client.options.cache.channels) {
            for (const rawChannel of data.channels.values()) {
                switch (rawChannel.type) {
                    case ChannelTypes.GUILD_TEXT: {
                        const textChannel = new GuildTextChannel(this.client, rawChannel as GuildTextChannel, this);
                        this.channels.set(textChannel.id, textChannel);
                        break;
                    }
                    case ChannelTypes.GUILD_VOICE: {
                        const voiceChannel = new GuildVoiceChannel(this.client, rawChannel as GuildVoiceChannel, this);
                        this.channels.set(voiceChannel.id, voiceChannel);
                    }
                    case ChannelTypes.GUILD_CATEGORY: {
                    }
                }
            }
        }

Actually I haven't really started the caching of category channels but the class is ready to be used.

#

This is how I currently do it

quartz kindle
#

data.channels is an array, not a map

#

it doesnt have .values()

sharp geyser
#

Seems to

sharp geyser
#

Tho tbh there really is no reason to use .values I don't even remember why I had it

#

But I am still questioning on whether converting the data to the proper type of channel like that is the best and most efficient way to do so

quartz kindle
#

huh why do arrays have .values lol

sharp geyser
#

no idea but it exists

#

especially since arrays are iteratorable

#

and plus arrays don't really have any keys so what is the point of getting the 'values' as a new array when the array already has the values

sharp geyser
#

Should I do something if it sends the heartbeat but receives no ack after a long period of time?

crystal wigeon
#

hi

#

what does this mean FetchError: request to https://discord.com/api/v9/channels/963056926906789888/messages failed, reason: read ECONNRESET

#

rate limit?

rustic nova
#

connection died

#

"ECONNRESET" means the other side of the TCP conversation abruptly closed its end of the connection.

crystal wigeon
#

trying to figure out why it would happen in the first place?

#

maybe if there are too many requests?

earnest phoenix
#

@quartz kindle can you help with div element and CSS display property

#

And place holder

crystal wigeon
#

umm is there a way i can use node-canvas to use ctx.drawImage() asynchronously ?

#

i understand drawing on canvas is synchronous, but its causing event loop blocks

#

so what's the optimal solution then?

#

bop

split hazel
crystal wigeon
#

also how do i create canvas in rust? any links would help

split hazel
#

two things drawing at the same time aint exactly great

crystal wigeon
#

hmm

split hazel
#

i dont think you should they're very fast

#

but you could try worker threads not sure

crystal wigeon
#

its actually being laggy for me

split hazel
#

by blocking the event loop you mean nothing else can be done?

crystal wigeon
#

all my images are completing in less than 500ms but because there are lot of calls. its causing event loop blocks

#

yeah

#

until canvas finishes everything else is stuck

split hazel
#

you can actually wrap your drawing function in a promise and i believe it will be executed on another thread eliminating a blocked event loop

#

an example:

crystal wigeon
#

i mean, that's what im currently doing

#

im still seeing weird behavior

#

let me send code snippet

split hazel
#
function drawSomethingExpensive(ctx) {
  return new Promise((resolve, reject) => {
    ctx.drawImage();
    ctx.drawRect();

    resolve();
  });
}

something like this?

crystal wigeon
#
  card: Pick<
    CharacterCanvasProps,
    "filepath" | "difficultyIcon" | "type" | "isSkin" | "rank"
  >,
  isNotStar: boolean
) => Promise<Canvas | undefined> = async function (card, isNotStar = false) {
    try {
        const ns2ms = 1000000;
        const startTime = process.hrtime();
        const ctx = canvas.getContext("2d");
        ctx.save();
        ctx.setTransform(1, 0, 0, 1, 0, 0);
        ctx.clearRect(0, 0, canvas.width, canvas.height);
        ctx.restore();
        ctx.fillStyle = "#000000";
        ctx.fillRect(0, 0, canvas.width, canvas.height);
        const startImageTime = process.hrtime();
        const image = await loadImage(card.filepath);
        const endImageTime = process.hrtime(startImageTime);
        loggers.timerify(
            "Info canvas image load path: ",
            card.filepath,
            "took:" + endImageTime[0] + "s " + `${endImageTime[1] / ns2ms}ms`
        );
        const border = await loadImage("./assets/images/border.png");
        const borderCtx = borderCanvas.getContext("2d");
        borderCtx.save();
        borderCtx.setTransform(1, 0, 0, 1, 0, 0);
        borderCtx.clearRect(0, 0, borderCanvas.width, borderCanvas.height);
        borderCtx.restore();
        // borderCtx.clearRect(0, 0, borderCanvas.width, borderCanvas.height);
        borderCtx.drawImage(border, 0, 0, borderCanvas.width, borderCanvas.height);
        borderCtx.globalCompositeOperation = "source-in";
        borderCtx.fillStyle = elementTypeColors[card.type];
        borderCtx.fillRect(0, 0, borderCanvas.width, borderCanvas.height);
        const starPath = "./assets/images/star.png";
        const star = await loadImage(starPath);
        const starCtx = starCanvas.getContext("2d");
        starCtx.drawImage(star, 0, 0, starCanvas.width, starCanvas.height);
        // starCtx = desaturate(starCtx, starCanvas);
        // starCtx = colorize(starCtx, starCanvas, starlen[card.rank].color);
        ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
        ctx.drawImage(borderCanvas, 0, 0, canvas.width, canvas.height);
        const num = 48,
            multiplier = 20;
        if (!isNotStar) {
            for (let i = 0; i < ranksMeta[card.rank].size; i++) {
                ctx.drawImage(
                    starCanvas,
                    i * num +
            canvas.width / 2 -
            multiplier * (ranksMeta[card.rank].size + 1),
                    canvas.height - 150,
                    num,
                    num
                );
            }
        }
        const endTime = process.hrtime(startTime);
        loggers.timerify(
            "Info canvas completion took: ",
            endTime[0] + "s " + `${endTime[1] / ns2ms}ms`
        );
        return canvas;
    } catch (err) {
        loggers.error(
            "helpers.canvas.createSingleCanvas(): something went wrong",
            err
        );
        return;
    }
};```
#

oh

#

im doing something like this

#

haha

split hazel
#

bit of a "hacky" solution but it should solve your issue of the event loop blocking

crystal wigeon
#

gotcha,

#

what would be the right way?

#

if i were to do this right

#

create workers ?

split hazel
#

there is no right way i dont think

crystal wigeon
#

that's kinda slow tho.

#

hmm

#

also how do i reuse the same canvas to draw a new image, i tried ctx.clearRect(0, 0, canvas.w, canvas.h) but somehow it manages to persist older image and kinda shows that as well

split hazel
#

you dont even need to make it an external function either you could do something like:

... your code
await (new Promise((resolve, reject) => {
  // do your canvas work
  resolve();
}));
crystal wigeon
#

yeah i need to load image using await loadimage() as well

split hazel
crystal wigeon
#

that's not working actually.

#

its either showing old image

#

or doing some weird overwrites

split hazel
#

can you show before and after?

crystal wigeon
#

only happens when many users make this call

#

hang on

split hazel
#

are you using the same canvas across multiple users?

crystal wigeon
#

yeah

#

createCanvas() is at the top of the file

#

that's what re-using canvas means right

#

its just doing weird mix n match. sometimes even the entire canvas height is screwed

split hazel
#

you mean the context?

crystal wigeon
#

yeah

split hazel
#

if so you need to make it local to the function otherwise you'll run into weird bugs

#

if you're using the same canvas across multiple users they will overwrite each other

crystal wigeon
#

this the full file code

#

createCanvas is on top of file

#

then the context is inside local func

split hazel
#

yeah the create canvas calls need to be inside of the function

crystal wigeon
#

then what's the use case for reusing canvas

split hazel
#

you're probably running into race conditions

crystal wigeon
#

indeed

split hazel
#

not many creating a canvas does not have a massive overhead so its fine to create it when you need it

crystal wigeon
#

gotcha

#

thanks, i'll try stuff

split hazel
#

also a general question: should I use recaptcha v3 (invisible) or v2 (im not a robot button) for a registration/login form?

slender thistle
#

How do those captchas work?

#

Yeah that and v2

split hazel
#

yeah i was thinking v3

slender thistle
#

I mean how it functions behind the scenes

split hazel
#

does v3 start a manual v2 captcha if you make too many requests?

#

v3 also has that but it only appears when it thinks you're a bot

#

v3 is a little more privacy invasive because it tracks your mouse movements and actions

#

yh

spark flint
#

and try not to ghost ping people

#

(@supple spruce you were ghost pinged by @fossil spear)

dry imp
#

damn @supple spruce , your jammin website is actually cool lmao

earnest phoenix
#

<div> command

#

and the CSS display property

#

anyone

boreal iron
#

Go on, explaining your issue

supple spruce
spark flint
#

lmao

quartz kindle
crystal wigeon
#

2250 x 2000

quartz kindle
#

jesus fucking christ

#

why?

dry imp
#

he is a painter

crystal wigeon
#

cause im drawing 6 images haha each image is 750x1000

#

2 rows, 3 cols

quartz kindle
#

canvas scales with image size, abmnd it scales horribly

crystal wigeon
#

yeah i made sure all my image sizes are less than 100kb

quartz kindle
#

its not meant to use with big images

#

what are yiu using it for?

crystal wigeon
#

lemme send you a screen shot

quartz kindle
#

is it for a discord bot?

quartz kindle
#

file size doesnt matter

crystal wigeon
#

yeah image reso is 750x1000, thats why my canvas width is 750 * 3 and height is 1000 * 2

quartz kindle
#

canvas operates on pixel-by-pixel

crystal wigeon
#

end result im looking at

quartz kindle
#

thats nowhere near your original resolution

#

discord scales it down anyway

crystal wigeon
#

yeah

quartz kindle
#

so yiure using big images for nothing

crystal wigeon
#

if i try any other reso, the image is distorted or looks weird

quartz kindle
#

then youre doing something wrong

crystal wigeon
#

no like, if there's 1 image the reso is 750x1000

quartz kindle
#

you should pick a maximum size and resize everything to fit it

#

dont just add up images without resizing them

crystal wigeon
#

so im guessing 1000 height is the max size

#

yeah iam resizing my images

#

original image reso is 750x1000

lyric mountain
crystal wigeon
#

so when i draw on canvas the canvas reso is also 750x1000 if there's only 1 image

#

but like you said for 3 x 3 images, its down sized so no point in me drawing 750x1000 image on canvas 2250 x 2000

quartz kindle
#

size it down more

crystal wigeon
#

by how much tho, that's the point

quartz kindle
#

the total size should not be much bigger than what discord shows

#

i usually aim at 800x800

#

thats my default canvas size