#development

1 messages · Page 75 of 1

lyric mountain
#

emphasis on HUGE

raven parcel
#

okey thank you

lament rock
#

Whenever Rhythm got bent, my bot saw explosive growth she couldn't handle and was a huge pain in my ass because I had to rewrite everything

lament rock
#

long story short. Do not do music.

lyric mountain
#

pretty much

lament rock
#

I am no longer asking SolGun

sterile brook
#

oke guys

#

I came here with another portion of magic

#

I have that kind of situation:
I am using VScode
I am starting bot - everything okay
Asked my friends to bomb my bot with same command - everything fine, bot successfully completed all command calls without any exeptions
Now magic:
When i used same command 3-4 times [same command that my friends used to bomb bot], - bot just stops working
Tested it on different stuff and commands, anyone uses command - everything good, me using command - bot stops working

#

Any thoughts?

dry imp
#

maybe you shouldnt use the bot, just a thought

sharp geyser
#

It'd end up being a guessing game

sterile brook
#

no errors, also tried to catch anything, still nothing

sharp geyser
#

Show code

lyric mountain
#

if a something crashes without any error then ur absolutely muting the exceptions

#

as abe said, please show code

lyric mountain
#

who needs parallelism when everything is sync amiright?

sterile brook
lyric mountain
#

show what appears when the bot crashes

sterile brook
#

emm... okay:)

#

There is just nothing, but ill just show to u be sure

lyric mountain
#

do u have a global exception catcher?

sterile brook
#

Your luck stuff is another func logs, not related to this porblem

#

just stops like this

lyric mountain
#

what logger are u using?

sterile brook
lyric mountain
#

your log is oddly...empty

eternal osprey
#

hey guys

lyric mountain
#

like, when the bot is starting it generates a log of info on the console

eternal osprey
#

i just started using sqlite3 in js

lyric mountain
#

you HAVE to be muting it somehow

eternal osprey
#
let result = await db.query(sql`SELECT * FROM serverdatabase WHERE id = '${server_id}'`)```would this be  a valid way to select something ?
sterile brook
eternal osprey
#

and assume that the table contains id, can i then use result.id?

sterile brook
#

that about bot starting

exotic otter
#

why, it won't let me login to karuta when i try to vote? @ripe prairie

lyric mountain
eternal osprey
#

And imagine i selecteded multiple servers, would i then have to loop over it? I mainly have been learning about how to create the queries, and how they look in duckdb, but haven't been able to implement it into a real language just yet 🙂

lyric mountain
#

@sharp geyser do u happen to know how to enable it on node?

sterile brook
#

same situation

#

bot stops, debugger detaches

#

and thats it

lyric mountain
#

I dont mean debugger

#

I mean debug level, literally

#

logs have many levels, debug is usually much more verbose, and detailed

sharp geyser
#

Are you using djs?

#

If so listen on the debug event and log its responses, thats a good place to start

sterile brook
lyric mountain
#

u dont, u need to use a level flag when starting it

#

try --debug

lyric mountain
sharp geyser
#

Oh, idk

#

I dont think node even has something like that built in

sterile brook
#

nothing in console

lyric mountain
#

then try trace

#

trace HAS to output something

#

if it doesn't then u messed something really hard

sterile brook
eternal osprey
sterile brook
#

cuz guys tested out and everything worked just fine

sharp geyser
#

It has to be something

#

and don't ignore it just cause it currently only happens to you

#

it could happen to others as well

#

Do you do any database stuff?

lyric mountain
sharp geyser
#

If so, something there could be causing an exception

#

I can't even reference their code anymore cause they deleted it

sterile brook
#

i just logged manually and now i know place where this is happens but its kinda weird

sharp geyser
#

Show the code thats stopping the execution

sterile brook
#

its just odd as hell

surreal sage
#

I want to push an object to a field in mongodb

#

database > collection > document > field (array)

#

What atomic should I use

#

To reach field?

#

Document also includes an "userid" that I want to filter with

sterile brook
#

do u use schemas?

surreal sage
#

Not at the moment but it's more "first come first served"

#

I check for fields for functions each time

#

And if it doesn't exist I make it

#

but schemas aint my problem rn

#

wouldn't I

#
{
  "userid":123,
  "profiles": []
}
#

idk

#

New to mongo

surreal sage
sterile brook
#
... .updateOne({userid: certain_user_id}, {$push: {array_field_name: ur_object_var}})
surreal sage
#

ur_object_var = object that gets pushed in?

sterile brook
#

yep

surreal sage
#

sick

#

Do you make a little framework just to help out with mongo?

#

like I have functions for setting fields to specific user(s)

sterile brook
#

no, i am just using mongo schemas atm

#

and nothing else

surreal sage
#

Will come up later for me ig

#
const awaitingObject = {};
            await mongo.pushData({ userid: user.userid }, { $push: { profiles: awaitingObject } });```
```js
            pushData: function (atomic, data, collection) {
                return new Promise(async (resolve) => {
                    resolve(await collection.findOneAndUpdate(atomic, data));
                });
            },```
#

h

#

Might uhh

#

It's called testing sweetheart
no assistance needed anymore

sage bobcat
#

One message removed from a suspended account.

lyric mountain
#

that's called rubber ducking

#

help by listening, people eventually fix bugs by explaining to others

sterile brook
#

that it
Process finished with exit code -1073741819 (0xC0000005)

lyric mountain
#

that's uhhh...not an exception

#

but u can search what that exit code means

#

my guess is that it has to do with some internal lib

#

are u using any lib for webp?

sterile brook
#

ye i searching rn

surreal sage
#

How do you remove a field/key that is inside an object which is inside an array?

#

user: {}
profiles: []
0: {}
uuid: "."
fieldToRemove: []
fieldToRemove2: bool

#

$unset

#

hmm

boreal iron
#

delete user.profiles[0].fieldToRemove;

#

Assuming you're speaking about JavaScript

lament rock
#

pretty sure they mean mongo

boreal iron
#

Then say it?!

lament rock
#

No you should just know what everyone is thinking 24/7

#

Oh you don't?

boreal iron
lament rock
#

skill issue

boreal iron
#

Just wanted to see if you know

#

Test succeeded

lament rock
#

ok

#

chat bots apis are fun

boreal iron
#

Sounds like something you definitely have

sterile brook
lyric mountain
#

And how tf did u manage to access pointers in js?

sterile brook
#

idk

#

tried to google some info

#

most info is generic and not suitable for my situation

lyric mountain
#

Then u saw answers for the wrong language

sterile brook
#

ye

#

mostly for C lol

lyric mountain
#

Because that's definitely some native lib issue

#

@quartz kindle I summon thee wisdom

sterile brook
#

idk how to fix it btw

#

idk what to search for

#

rip me

quartz kindle
#

wot

plain coral
#

Linux error mysql KEKW

solemn latch
#

👀 Classic mysql

quartz kindle
plain coral
sterile brook
#

ill try it rn

#

let me check

plain coral
quartz kindle
quartz kindle
#

do you have disk space?

sterile brook
plain coral
#

no work.

plain coral
#

ubuntu

quartz kindle
#

reinstall mysql lol

plain coral
#

example sudo reinstall..

sterile brook
#

cuz even with canvas

#

it sometimes happens, sometimes not

quartz kindle
#

are you using node-canvas?

#

or skia canvas

sterile brook
#

skia

#

cuz i need filter working

#

on node canvas its not working

plain coral
#

..

quartz kindle
sterile brook
quartz kindle
#

but depends on how you installed it

plain coral
quartz kindle
#

sudo apt remove mysql-server

plain coral
#

and again ?

#

install

#

?

quartz kindle
sterile brook
#

happens not fixed:D

quartz kindle
#

try logging everything you can right before the line that creates the png buffer

sterile brook
quartz kindle
#

so when it crashes, you have logs for the last thing that happened

#

including all values

sterile brook
#

ok sir

#

give me some time

plain coral
#

..

#

again is sudo apt install mysql-server

#

right?

#

@quartz kindle Hm

quartz kindle
plain coral
#

and other? sudo apt autoremove ?

#

ok sigh

quartz kindle
plain coral
#

Ah

#

ok done @quartz kindle

#

and install now?

quartz kindle
#

yes

plain coral
#

same is? sudo apt install mysql-server

#

?

quartz kindle
#

yes

plain coral
#

hmm

#

error CM_Hmm

sterile brook
#

they are before sending canvas in msg

quartz kindle
# plain coral

try uninstall again and delete mysql.cnf file rm /etc/mysql/mysql.cnf

#

(make a copy of the file first)

sterile brook
#

But all of them creates 1 new canvas in it

#

to work with

plain coral
#

sudo rm /etc/mysql/mysql.cnf?

quartz kindle
#

it means it worked, the file is deleted

#

try install again

plain coral
#

?

#

@quartz kindle yeah but use my anydesk or Teamvie?

#

my no idea but first tiem linux learn hard

plain coral
#

yes but said "access denied"

#

Already

#

said same denied

#

hmm idk

#

@covert gale

#

correct there?

#

and pub no?

lyric mountain
#

U don't need the public key at all

plain coral
#

hmm

plain coral
#

is okay

#

and dputty no cant

#

denied

lyric mountain
#

Sorry but please, use another translator

plain coral
plain coral
#

and terminal [CMD] is good

#

access succes

lyric mountain
#

Putty has nothing to do with that error

#

It failed to start mysql server

plain coral
#

yes exactly

#

problem mysql server

sterile brook
#

i modelled this situaction like this

let i = 1
        while(true){
            console.time(i)
            let canvas = new Canvas.Canvas(1910, 970)
            let ctx = canvas.getContext('2d')
            await Promise.all([    
                await this.client.database.createCard(message, cardData), 
                await this.client.database.createCard(message, cardData), 
                await this.client.database.createCard(message, cardData)
            ])
            await Promise.all([    
                this.client.utils.drawCard(ctx, cardData[0], 0, 0),
                this.client.utils.drawCard(ctx, cardData[1], 646, 0),
                this.client.utils.drawCard(ctx, cardData[2], 1291, 0)
            ])  
            const row = new ActionRowBuilder()
            .addComponents(
                new ButtonBuilder()
                    .setCustomId('1')
                    .setLabel('1️⃣')
                    .setStyle(ButtonStyle.Secondary),
                new ButtonBuilder()
                    .setCustomId('2')
                    .setLabel('2️⃣')
                    .setStyle(ButtonStyle.Secondary),
                new ButtonBuilder()
                    .setCustomId('3')
                    .setLabel('3️⃣')
                    .setStyle(ButtonStyle.Secondary),
            );
            await canvas.png
            // Sending msg with summon picture
            // Here randomly bot closes for me
            /*let msg = await message.channel.send({    
                content: `<@!${message.author.id}> is summoning 3 cards`, 
                files:     [
                            new AttachmentBuilder(await canvas.png, {name: "cards.webp"})
                        ],
                components: [row]
            })*/
            console.timeEnd(i++)
        }
#

the thing is

#

await canvas.png is completely alright

#

i tested it till 2k

#

its ok

#

but if i will create and send msgs

#

it crashed after 6th attempt

dry imp
#

maybe u r cursed

quartz kindle
#

and run the test again

sterile brook
#

i run more tests

#

and they did well

#

even with msgs

#

still same situaction

#

sometimes it happens

#

sometimes not

#

gg

hollow python
#

hello

terse bone
#

Bro

#

So that file is in node_modules

#

Which belongs to discord.js

next storm
#

Where does this error emits?

terse bone
#

Console

next storm
#

Bro, which part of code

terse bone
#

Instantly after starting

terse bone
wheat mesa
#

I see you have posted the following
Absolutely nothing of use

Thank you for choosing top.gg #development support

terse bone
#

Ok

sharp geyser
#

Most unhelpful shit ever

#

Instantly after starting could be from a number of places

#

Especially if you run stuff from other files

wheat mesa
#

@terse bone if you want help, you’re going to need to post something that can actually help us, not just “I told ya it’s from modules”

terse bone
#

Bro i mean thats not my code

That's something from node_modules folder

sharp geyser
#

It could be your code though

#

Chances are it actually is cause you're using something wrong

terse bone
#

Nah
I just googled it
And found it happens with discord.js v12

#

I need to update to newer version smh

sharp geyser
#

💀

#

djs v12 ain't even supported anymore

#

the api endpoint it uses is deprecated

terse bone
#

Ye but smh v13 is giving compatibility issues with some of my modules

#

So i had to use v12

wheat mesa
#

Use v14

sharp geyser
#

Then don't use those modules

terse bone
#

But ig now i need to update

wheat mesa
#

Don’t use deprecated versions

terse bone
quartz hill
#

I still using v13

feral aspen
#

I'm willing to create a login system for my website. What's the best way to achieve such so?

Do I use PHP and a database or should I use something else? My website is built with Express.JS.

sharp geyser
#

Why use php only nerds like @boreal iron use it

#

Honestly as long as you can post to your server some way it doesn't matter what you use

#

you can use vanilla js, php, react, whatever

feral aspen
#

Could I do it via passport?

#

Bcrypt, passport, passport-local, express-session, express-flash, and etc?

sharp geyser
#

Sure

#

But I personally dislike passport

feral aspen
#

Why so?

sharp geyser
#

I've had issues in the past of it not passing the expiry stuff

#

which is kinda needed when refreshing tokens if going the oauth route

#

but if youre purely using local then its fine

feral aspen
#

What could I use, instead?

sharp geyser
#

I do all of it by hand

feral aspen
#

If I'm hosting an application via Express.JS and I want a login system... ?

sharp geyser
#

I use 2 things

#

express-session for persistent logins, and bcrypt for hashing

#

Other than that its all up to how you wanna post to the server

feral aspen
#

Fair enough.

feral aspen
#

Do I just use MongoDB as my database instead?

sharp geyser
#

Doesn't matter what db you use

ancient anchor
#

Would there be a better way to design this so I dont get two responses from topgg?

sharp geyser
#

There are session stores for nearly ever db out there

pale vessel
ancient anchor
sterile brook
#

but need more testing etc

#

changed await canvas.png

#

to canvas.toBufferSync()

#

sync func seems to be safer

quartz kindle
#

its safer yes, but it might lag your bot

sacred aurora
#

is it possible to show another modal after a modal submit?

shadow frigate
#

Hey Tim, you remember us talking about this?

#

Wouldn't this still send to them even if they are in multiple servers that the bot is also in?

quartz kindle
#

its possible yes

shadow frigate
#

That's the thing I need to get around

#

How would I only get it to send to them once?

quartz kindle
#

take the script outside of the shards

#

put it in a separate process, or even inside the sharding manager process

neon leaf
#

is there any easy way to convert my spaces as tabs (4x) with normal tabs 4 wide?

solemn latch
#

like, code indentation?

neon leaf
#

I just want my old code written with spaces as tabs to use normal tabs

#

so yeah

#

I just saw a vscode option called convert identation

#

could that be something?

boreal iron
#

Just replace two spaces by tabs?

dry imp
#

i think so

boreal iron
#

Or how many spaces are supposed to be one tab

dry imp
#

ive tried something abt code indent in vscode

#

to convert my beautiful python code

neon leaf
#

ig imma try it

solemn latch
#

I mean.

boreal iron
solemn latch
#

You can convert on the fly back to spaces too

stable eagle
solemn latch
#

ye

dry imp
#

yea i think thats it

stable eagle
#

never knew

neon leaf
#

is that for every file in the workspace?

solemn latch
#

Use tabs always, it means you and another coder can see it differently even though its the same file

#

You can change it for all of vsc, but that will change it just for that workspace iirc.

earnest phoenix
solemn latch
#

The button on the bottom opens that too

earnest phoenix
#

Yeah probably, I just prefer to just do Ctrl+K and then whatever I want

#

Find everything with that

#

Instead of searching for the button(s)

neon leaf
#

do I need to do that for every file manually?

#

or is there something to do that to all?

quartz kindle
#

its not the same thing, but you can do this

terse bone
#

How to get "no of servers bot is in". In discord.js v14

boreal iron
#

What?

onyx palm
#

how can i make a bot?

boreal iron
#

You gonna choose your favorite language and coding

#

Maybe reading some docs and guidelines, maybe not depending on your skills

onyx palm
#

uh

quartz kindle
terse bone
#

Thanks

boreal iron
#

lol tf

quartz kindle
boreal iron
#

How did you understand this

quartz kindle
terse bone
#

Do you know how to check if user has a permI updated from v12 to v14 today lol
That's why iam getting soo many errors

neon leaf
#

no = number

boreal iron
solemn latch
#

its covered on the docs

boreal iron
onyx palm
#

i did it but idk how o add at my sv

neon leaf
#

🥸

boreal iron
#

Breaking anything again

onyx palm
#

uh

earnest phoenix
#

"In this release we renamed literally everything, for consistency with the API"

solemn latch
#

pog

#

I love renaming every property

onyx palm
#

i created the bot but how do i add?

earnest phoenix
onyx palm
#

ok

#

i did itt

#

tysm!!!

earnest phoenix
#

You're welcome

onyx palm
#

now i need to do the cmds

#

but it is hard

neon leaf
#

whats a regex that matches
a-z A-Z 0-9?

earnest phoenix
neon leaf
#

ranges

earnest phoenix
#

/[a-zA-Z0-9]/

neon leaf
#

thanks

#

how can I use that regex in javascript so it returns true if the string only has those chars?

earnest phoenix
#

And the regex should be like this if you want to check that the string only and only contains those ranges: /^[a-zA-Z0-9]+$/

neon leaf
#

thanks!

thorn spruce
#

Hey , I wonder if having multiple replace like that, is a bad things ? Note: I can't know before the result of sp. If it is bad how i can do ?

                        this.jsonLang.tower.quest[sp["commands"]][sp["type"]]
                            .replace("%command", sp["commands"])
                            .replaceAll("%nb", sp["value"] )
                            .replace("%MyNb", DataQuest[key].value)
                            .replace("%floor", this.FloorData.floor_max)
                            .replace("%nameBoss", sp["targetId"] >= 1 ? MaxFloorInformation["boss"][sp["focusId"]][this.playerLang+"_name"] : " ")
                            .replace("%targetId", this.jsonLang.stats[sp["focusId"]] ?? sp["focusId"])
                            .replace("%lootbox", Items[sp["focusId"]]?.[this.playerLang+"_name"])
                            .replace("%skillsName", SkillsDatas[sp["focusId"]]?.["language"]?.[this.playerLang+"_name"] || "")
lyric mountain
#

not a "bad thing" per se, but it could be replaced with a map + loop

#

while not faster, it'll at least be more readable

sharp geyser
#

I can make bot with botghost

boreal iron
#

Misteey nub

thorn spruce
earnest phoenix
#

stop using discord.js

#

quartz kindle
quartz kindle
sharp geyser
#

untrue

#

I make bot myself all the time

sharp geyser
#

Wouldn't those replaces end up doing nothing cause it can't find it and in turn end up causing a slight performance hit?

boreal iron
sterile brook
#

i am cursed dev btw

sharp geyser
quartz kindle
#

string.indexOf() is stupid fast

compact pier
#

more code execution, but a lots faster

sharp geyser
#

more code != slow

lyric mountain
limber siren
#

anyone know why this isnt working

spark flint
#

What error are you getting

limber siren
#

no error but the number is not right

#

it cant be 600

lyric mountain
#

it'll be time in seconds

limber siren
#

that gives me loads of stuff that i don't want

#

Mon Aug 08 2022 23:41:22 GMT+0000 (Coordinated Universal Time)

#

thats what it comes out as

#

I want it to be neater

solemn latch
#

Createdtimestamp is just a number

lyric mountain
quartz kindle
#

not all other parts

sharp geyser
#

Why do people not make use of the discord stuff

#

<t:1670795480129:R>

#

<t:1670795557432:R>

#

Yea I think it might be broken

lyric mountain
#

ur using ms

#

it has to be seconds

sharp geyser
#

It can be a timestamp

#

<t:1099720595:R>

#

It takes a UNIX timestamp

#

which is in seconds

#

Youre right

#

I remembered wrong

#

:p

sterile brook
#

Bruh

lyric mountain
sterile brook
quartz kindle
#

bruv

#

kek

#

OwO

sterile brook
#

Hewwo Tim

sharp geyser
#

<t:1099641600000:R>

#

Yea I guess I can't do it properly

#

but whatever

sterile brook
#

I'd like to see what will be in 34793 years

#

From now

sharp geyser
#

Hell

#

Earth will end up looking like Wall-E and so will the humans

sterile brook
#

Mb mb

#

But there is happy end in Wall-E

sharp geyser
#

Sure

#

or is there?

quartz kindle
#

long live the god emperor

sharp geyser
#

Games in 34798 years will be so immersive you could die playing them

#

but its fine cause you're already uploaded to the cloud so you are immortal

shadow frigate
#

Got this code that uses Discords.com API to check for votes but it's coming up with an error..
https://pastebin.com/Zpx7BSv2

This is the error and it's coming from the if(memberDB.isPremium === false && !todaysVoters) line.

P:\MYDIRECTORY\v1.3.0\node_modules\@sapphire\shapeshift\dist\index.js:40
    throw this.error;
    ^

CombinedPropertyError: Received one or more errors
#

The code works as soon as I remove !todaysVoters from the IF statement

lyric mountain
#

memberDB.isPremium === false 💀

minor olive
#

Not really sure if this is the correct place to ask this, but in top.gg, I have a bot page that I'm working on. However, I'm getting really annoyed because when I make an edit in my testing cite and bring it over to top.gg, everything is different because of top.gg's css styles.

Is there any way to just overide every single one of those styles? I tried all: initial; or all: unset; but nothing seems to work. Can anyone help me?

lyric mountain
opaque acorn
lyric mountain
#

topgg uses a lot of variables in their styles, you can edit their values

minor olive
#

okay. Thank you. I'll see if I can.

opaque acorn
#

somebody knows a online api creator other than aws?

lament rock
#

Your text editor

opaque acorn
#

seriously

lament rock
#

its not that hard to make your own api. seriously.

opaque acorn
lyric mountain
#

unless u have unlimited bank balance

sharp geyser
#

aws is insanely expensive

#

especially if you don't know how to read their extremely vague price charts

boreal iron
#

You all are just insanely poor

sharp geyser
#

Shut up you still use a flip phone

#

old man

boreal iron
opaque acorn
sharp geyser
#

ofc

boreal iron
#

How do you know that

#

Ffs

sharp geyser
#

Cause I heard your nokia flip phone ringing in the vc

opaque acorn
#

xd

boreal iron
#

Damn

#

You got me

lyric mountain
#

one day you're using azure, the next day you're living on the streets because u forgot to make the api go idle

#

but well, apis are nothing more than normal programs listening to outside requests

#

it's the very same as making a bot, but without the discord calls

sharp geyser
#

or I could just outright get a object storage plan from contabo

dry imp
sharp geyser
#

@lyric mountain does this seem reasonable for 4000GB

#

ssd btw

#

or hdd

lyric mountain
sharp geyser
#

I didn't say I would use it

lament rock
#

a panorama that can barely fit your mom

sharp geyser
#

I was just asking

#

They allow you to go up to 25TB as a baseline

#

if you want more you gotta email them for more

boreal iron
#

For that price probably just a common database ssd without nvme

#

They somehow need to get rid of all the stock I guess

#

So... offering cheap prices

woeful pike
#

wasabi charges half that but it's probably half as reliable

radiant kraken
#

hi xet

minor olive
#

Does anyone know how to disable this extra gap between elements in html (in top.gg)? I have attached two pictures. They both have the same code, but the first is from top.gg and the second one is on a private testing cite. Top.gg adds an extra space between these elements and I don't know why / how to disable it. Does anyone know?

boreal iron
#

Because topgg has predefined css values for most elements already your site doesn't have

#

Just edit the appropriate css properties which are most likely padding and/or margin

minor olive
#

exactly. I have, and it still does it.

#

Do I need to do it for every object? Because right now, I just have it being done to a parent div

boreal iron
#

Add !important to the rules as topgg will overwrite them

minor olive
#

okay. I'll try that

boreal iron
#

Like padding: 0 20px !important;

sage bobcat
minor olive
#

Am I doing this right? Because I'm getting red squiggles. I know I've done this before, but it was a while ago.

#

Sorry, just realized. Goes after it.

#

Nope. Still happens.

boreal iron
boreal iron
#

Try to save it and see the live result

minor olive
#

yeah, I did. I edited the code in top.gg and reloaded the page. Do I need to do something more?

sage bobcat
boreal iron
#

Yeah after saving it use the browser inspect tool to figure out which element you have to adjust

#

That's the easiest way

#

It will also show which parameters are inherited

minor olive
#

yeah, so I was looking at that. There are like 1 million values. I can look through them, but do you have a general idea of which one it would be?

boreal iron
#

You navigate straight to your element the issue happens

#

And then if not found parent ones

minor olive
#

okay. I'm looking

#

I really don't see any values that would change it. I even tried changing some of the values, and (other than messing up top.gg) it didn't fix the spacing.

boreal iron
#

What element is it?

minor olive
#

That I'm checking?

boreal iron
#

The list

#

ul and li?

minor olive
#

No, it's not actually something like that. This is the code.

minor olive
#

Mine, yeah, it's private. Long story

stiff spire
#

oh alright

boreal iron
#

Add a style attribute to class gray-text with: style="margin-bottom: 0 !important; padding-bottom: 0 !important;"

#

Also remove the spaces between the attributes and = and "

#

This isn't a valid html syntax

#

Anyways I'm sleeping now

#

Will head to you later if needed

minor olive
#

Okay. Thank you for your help. It still doesn't work, but I'll keep working on it.

boreal iron
#

Show me what u did

minor olive
boreal iron
#

Err

#

You added it to the wrong element

#

<p class="gray-text" style="...">...</p>

#

Line 5 in your ss

minor olive
#

Oh, you wanted me to do it there. Gotcha. One Sec

boreal iron
#

And remove the spaces

#

It's no valid html syntax

#

Remove it anywhere

#

Then after saving make sure to clear your browser cache when reloading

minor olive
#

Same thing...

#

Thank you though

#

Oh

#

I'll try it on gray-text

#

sorry

#

Same thing

boreal iron
#

Show again to make sure you choosed the right element freerealestate

minor olive
boreal iron
#

Dude

#

Last time

minor olive
#

I did it on gray-text

boreal iron
#

<p class="gray-text" style="...">...</p>

#

Line 5 in your ss

minor olive
#

so instead of <span>

boreal iron
#

There's just one paragraph element in your entire screenshot

#

<p>

#

Add it there

minor olive
#

I see

boreal iron
#

Line 5

#

Then after saving make sure to clear your browser cache when reloading

minor olive
boreal iron
#

Remove the br below it

#

It might have a weird line height

#

Keep everything else and remove the spaces

minor olive
#

It reduces the space, but it doesn't solve my overall problem. Extra padding, if you will, is being added to every element. The check list, the text, everything.

boreal iron
#

Yee can't go on without inspect tool to see it's css properties

#

So ping me if you can't solve and I will head to you later

#

Unfortunately I need to sleep for a few hours until life begins

minor olive
#

For anyone who cares, this was due to top.gg's white-space:break-spaces attribute. It's under the css-18r9pyf style sheet.

I couldn't overwrite the attribute though. I think I need to be more specific in my style sheet. I'll try again tomorrow.

Some help would be appreciated though

sterile brook
earnest phoenix
tulip ledge
#

Anyone knows how this effect is called and how its made?
I suppose with position absolute but that won't rlly make it responsive right?

#

nvm managed to make it but anyone knows how it's called? does it have a specific term?

raw nest
#

What are disadvantages of bitwise operations?

spark flint
earnest phoenix
earnest phoenix
raw nest
earnest phoenix
#

The disadvantage you're talking about are of the databases who have no way to hold such data in it's pure form

raw nest
earnest phoenix
#

I love bitwise gigachad

raw nest
#

same, it's awesome xD

radiant kraken
#

with bitwise you can compress lots of data in just a byte or two

eternal osprey
#

hey is anyone here

#

familiar with race conditions?

earnest phoenix
eternal osprey
#

okii

#

so i've received a question on my assignment about this code snippet. It's clearly a race condition. They ask us how to mitigate this race condition. I answered with: "
To mitigate the race condition, we must make sure that the operations don't have gaps between each other, so that
one operation can take in the place of the other and therefore ruin the perfect sequence.
In this code we can see that the last time.sleep(1) only has 1 ms of timeout. This is not enough for both transactions to go through, due to
the sleep(0.2). We must make sure that we remove all gaps, so we should remove all the time.sleeps, so it becomes one glued system,
and becomes an atomic operation where the operations run after each other(first operation deduct 1100, then operation deduct 100, then the print operation)
this is because it's a function that locks your whole system while the rest of the code still runs.
By removing the time.sleeps, both operations belonging to the registerdeduction can complete before the print operation gets initialized." Would this be correct?

lyric mountain
#

to fix a race condition all you need to do is synchronize the code

#

also "this is a function that locks your whole system" would be a phrase that'd void the entire answer in my books

#

sleep only freezes the runtime, not the system

quartz kindle
#

the sleeps are there to simulate real life delays, they are not meant to be removed

#

race conditions are fixed with mutexes, semaphores and versioning

sterile brook
#

Just await it ezgebloblul

raw nest
#

How are bitwise operations used for the communication over ports/sockets?

eternal osprey
#

but we would have to remove all the sleep functions right to synchronize it?

#

I ran it without the sleeps and it worked

lyric mountain
#

read the comment right in front of it

eternal osprey
#

time.sleep()

lyric mountain
#

**read the comment right in front of it
**

eternal osprey
#

simulating some possible extra works?

#

oowh bruhf

#

huh

lyric mountain
eternal osprey
#

but what would the problem with this function then be?

#

Like how would we be able to synchronize it?

lyric mountain
#

that's what ur supposed to research

#

u can't simply ask for the answer here, you're supposed to research and find a solution yourself

#

I already gave u a word to search for

eternal osprey
#

shared data usage!

#

should synchronize it

lyric mountain
#

u need to synchronize whatever function needs to be thread-safe

eternal osprey
#

got it!

#

Thanks

eternal osprey
#

the last sleep DOES exist doesn;t it?

lyric mountain
#

yes

#

but it doesn't really matter

eternal osprey
#

Yeah so i think that we could use shared variables and data structures, so that the operations get synchronized. It's because when one shared variable is used by one operator, the other ones basically 'queue' up.

#

This would remove the whole race condition right>

lyric mountain
#

any form of synchronization will solve it

eternal osprey
#

okay thanks!

neon leaf
#

is this safe?

    const key = crypto.createHash('sha256').update(String(json.key)).digest('base64').substring(0, 32)
    const algorithm = json.algorithm || 'aes-256-cbc'
    const iv = Buffer.alloc(16, 0)

    const cipher = crypto.createCipheriv(algorithm, key, iv)

    let encryptedData = cipher.update(json.text)
    encryptedData = Buffer.concat([encryptedData, cipher.final()])

    return encryptedData.toString('hex')
}```
stiff spire
lyric mountain
#

Ah nvm

#

Well, define "safe"

#

Ur probably thinking too much, u just need a random salt to encrypt your data, no need for all that huge stuff u did

neon leaf
lyric mountain
#

That's true for all encryption algorithms

#

That's like, the whole point of encryption

#

Unless ur storing state secrets, just go with a decent and not so slow algorithm

#

Nobody will try to crack some rando info like that

neon leaf
#

well its for storing passwords so I hope

lyric mountain
#

U don't store passwords to begin with

#

U store their hashes

neon leaf
#

🧐

lyric mountain
#

The second line in ur code, use that to hash the password

#

And store whatever you comes out of it

#

Whenever u need to check if the password is correct just compare the hashes

neon leaf
#

ah

#

makes sense

lyric mountain
#

Hashes are irreversible, so ur safe from cracking

#

Just make sure not to use a weak hash like md5 or sha1

#

Else u might get collisions

neon leaf
#

it sha512 & sha256 not safe?

lyric mountain
#

especially 512

#

256 is guaranteed to never collide during sun lifetime

#

512 is guaranteed to never collide until heat death of universe

neon leaf
#

isnt 512 faster then 256 on 64bit?

#

what would be better?

lyric mountain
#

256 is industry standard

#

512 is by far overkill

neon leaf
lyric mountain
#

hard to say, but I don't think so

neon leaf
lyric mountain
#

we're talking about nanoseconds of difference

terse bone
#

The event when bot left a server is guildDelete ri8?
V14
Or is it changed

lyric mountain
#

you're using js anyway, don't worry too much micro-optimizing

#

if u really want to squeeze every possible performance u need to use a language that properly supports threads and low level features

neon leaf
#

whats the benefit to sha256 if spped doesnt matter? is the output smaller?

lyric mountain
#

anyway, use the constants instead of strings

terse bone
lyric mountain
neon leaf
#

it always has the same length, correct?

lyric mountain
#

yes

#

always exactly 32 chars

neon leaf
#

so I should do varchar(32)?

lyric mountain
#

just char(32)

neon leaf
#

what does that change?

lyric mountain
#

varchar is variable length (up to the limit)

neon leaf
#

ahh

lyric mountain
#

if u know the exact size always go with char

#

u can also drop the char entirely and simply save the bytes

#

it'll be more efficient since u dont need to convert to hex beforehand

#

hashes are supposed to be saved as bytes anyway

neon leaf
#

you mean this?

lyric mountain
#

no, ur still hashing to string

#

hash to bytes directly

neon leaf
#

I have this, shouldnt that do it already?

lyric mountain
#

just this

#

also u shouldn't substring a hash

#

Buffer is what u want

neon leaf
lyric mountain
#

.digest()

#

u can reduce that to a single line

#

just allow it to pass undefined as encoding

neon leaf
#

How do I store that in my db?

lyric mountain
#

as a binary field

#

know what, just go back to what u were doing

#

not worth the extra hassle

#

store as char(32)

queen sable
#

https://srcb.in/BprmqDl0Zm here is my CommandAbstract file now i just want yo execture await commandAbstract.command_context(message, command) when
commandAbstract.CheckPermissions(message, command)) won't return any err but it returns missing permissions which i am handling .. it crashes my bot.. so i just want it to return missing perms message but not crash the bot ..

lyric mountain
#

under no circunstances you'll ever need something like this

#

but well, show what's inside CheckPermissions

#

and please, use a single casing, either go PascalCase or snake_case

#

also new SomethingAbstract() is literally the antithesis of what it's supposed to be (abstract classes are never instantiated, they're molds for other classes to inherit from)

queen sable
lyric mountain
#

just remove that

queen sable
lyric mountain
#

if it returns true or false that's already the condition

lyric mountain
#

abstract is something that'll be inherited, not instantiated

#

u can name it like that ofc, but it's non-standard

queen sable
# lyric mountain abstract is something that'll be inherited, not instantiated

then ig i am not wrong here ..

const CommandAbstract = require('../Structures/CommandAbstract');
const commandAbstract = new CommandAbstract(this.client);
      if((await commandAbstract.CheckPermissions(message, command))) { 
        await commandAbstract.command_context(message, command) 
      }
```  so running it like this is not correct ?
lyric mountain
#

class Something extends SmthAbstract {

lyric mountain
#

also never do

if (...) return true;
else return false;
#

just do return ...;

queen sable
neon leaf
#

no,
return (userPerm && clientPerm)

#

KuuHaKu how can I transfer my varchar() column (which has the new values that work with char()) to char()? postgres

lyric mountain
lyric mountain
#

u dont need to do 1% of all that

#

just check if bot has permission in channel

lyric mountain
frosty gale
queen sable
neon leaf
lyric mountain
#

channel perms already account for all levels

frosty gale
#

do a backup if you wanna be double sure

lyric mountain
#

some databases dont allow doing that tho, never tried with postgres

frosty gale
#

or even better a transaction:)

neon leaf
#

well its in their docs so I assume it does

lyric mountain
#

varchar -> char I mean

neon leaf
#

according to docs it tries to auto convert if not valid

queen sable
lyric mountain
#

your code is at best unreadable

#

it'll take someone like waffle or tim to find the error there

queen sable
lyric mountain
#

that's not how debugging works

#

anyway, try logging the values on each step, see if anything looks off

#

or if you know how, use a debugger

neon leaf
lyric mountain
#

🫡 good luck

wheat mesa
#

👋

lyric mountain
#

/s

queen sable
neon leaf
#

it seems to be 64 chars

lyric mountain
#

64 is sha512

neon leaf
#

which it shouldnt be

lyric mountain
#

32 * 8 = 256

#

oh wait, nvm

#

sha256 is indeed 64 (when using hex)

#

I mistook with something else

#

it's only 32 when stored as binary

#

also 💀

#

this reminds me of bae

neon leaf
#

holy crap
waiting ping when using encrypt / decrypt -> 80ms
waiting ping when using hashes -> 18ms

neon leaf
lyric mountain
lyric mountain
neon leaf
#

sounds like me

#

I think you actually called me that before lmao

lyric mountain
#

lul perhaps

neon leaf
boreal iron
#

Me?

#

I can't remember

#

I don't click that link, probably scam link

#

So many cryptic numbers

#

Report is out!

wheat zealot
#

a

plain coral
#

Help lol.

solemn latch
#

with?

plain coral
#
            <ul>
                 <li class="nav-link scrollto"><a href="/profile.php">Profile</a></li>
              <li class="nav-link scrollto"><a href="includes/logout.php">Logout</a></li>```
#

for php

#

Look there Benzitczologin but need only benzitczo to change login name

#

example: if (isset($_SESSION['user'])) { // Set username } else { // set login }

#

but my think complicated.d

boreal iron
#

An example for you to understand:

if (!empty($_SESSION['user']))
{
   echo "<li>{$_SESSION['username']}</li>"
   . "<a href=\"{$someurl}\">Logout</a>";
} 
else
{
   echo "<a href=\"{$loginurl}\">Login</a>";
}```
#

Depending on your backend check if a session exists or not you have to show the html elements you want

#

Nowadays if you don't like to escape your chars inside the string literals you can also use heredoc which I really like

#
echo <<<MENU
<ul>
   <li>$_SESSION['username']</li>
   <li><a href="$logout_url">Logout</a></li>
</ul>
MENU;
#

which keeps the embedding and code hierarchy

plain coral
#

@boreal iron ok thanks.

#

Okay found solution and also fake thanks.

earnest phoenix
earnest phoenix
sterile brook
#

Just type on keyboard? MegaThonk

earnest phoenix
spark flint
#
like this?```
earnest phoenix
#

yea

spark flint
#

its ``` text inside of these symbols ```

#

text inside of these symbols

earnest phoenix
#

oooohlua

#

ty

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
spark flint
#

lol

plain coral
#

lol

spark flint
#

they're banned now anyways

#

still, BDFD isn't a bad tool

plain coral
#

rip banned

spark flint
#

i wouldn't discourage it at all

spark flint
plain coral
#

try reload discord.

minor olive
spark flint
#

shrug not for everyone

#

one bad experience for you shouldn't mean you discourage others from using it

plain coral
#

think 22 agust 2022

#

is new discord account.

minor olive
plain coral
#

relaxgood.

#

hmm center?

#

think profile?

boreal iron
#

margin: 0 auto;
If the parent element has 100% width, it will be centered

minor olive
#

Looks good. Purely my opinion, but from a UI design standpoint, I would have added Icons for the "Home" and "Projects" Menus, and maybe given your description a dark gray color, but purely my opinion.

#

Maybe instead of a hyperlink a button?

#

Honestly, it looks fine

somber gyro
#

Anyone know what's rich presence invite image?

dry imp
#

might be just me but the rounded corners looks funky af

#

its too round on the navbar i think

minor olive
long sail
wheat mesa
#

I want to make something with websockets

#

Can't think of any good ideas tho

lyric mountain
#

Canvas game

#

Idk, a robot

wheat mesa
#

Chat application

#

ChatGPT is my savior for ideas

lyric mountain
#

Lmao

wheat mesa
#

ngl it's actually pretty good for coming up with ideas

plain coral
#

xd

sudden geyser
somber gyro
craggy pine
#

?

minor olive
somber gyro
radiant kraken
sharp geyser
wheat mesa
#

I was going to do typescript but I’m going to make it in C# now

#

Just the websocket backend

#

Maybe I’ll make a frontend for it with ts

sharp geyser
#

Sounds fun

#

I love websocket stuff

sharp geyser
#

I feel you'd like it

stiff dust
#

Any one know whats this err about?

lament rock
#

duplicate json entry

#

most likely

stiff dust
sharp geyser
#

I have no idea what else could be a path collision

#

Are you 100% certain no duplicate keys

stiff dust
#

duplicate key?

sharp geyser
#

as in channelId or whatever being put in twice

stiff dust
#

you mean these ids ?

sharp geyser
#

no

stiff dust
sharp geyser
#

Well are you trying to export your db file to json?

stiff dust
#

the errors are came from these two

sharp geyser
#

Then there is your issue

#

your db will likely have multiple entries with feature_welcome_channel.channelid

#

json cannot have duplicate keys

stiff dust
#

hmmm

#

well

#

if I try to select all outputs

#

I will get that err

#

buttttttt

#

if I don't select all of these it will successfully export and in json file I have both of them

sharp geyser
#

its fine to have the same child keys

#

but the parent keys cannot be duplicated

stiff dust
#

so when I want to export I have to de select childs?

sharp geyser
#

Well no, cause children keys can be duplicated

#

but you can't have multiple feature_welcome_channel keys

stiff dust
#

so I have to de select parents ?

sharp geyser
#

that shouldn't be valid json

earnest phoenix
#

Hey

#

How long does it usually take for a bot to be accepted?

#

Up to 2 weeks

earnest phoenix
#

Really?

#

How many bots are there currently to review?

plain coral
earnest phoenix
earnest phoenix
#

So you cannot disclose the amount of bots that are currently pending review?

#

Exactly, as said above

quartz kindle
earnest phoenix
#

Ok its not active anymore

#

It has been removed because we got hit by a high bill

#

Hence, it's private information

#

I remember when one of my bots was removed from topgg (after being verified) because I accidentally sent a discord invite to one of the mods or someone that has power over accepting and deleting bots

#

abuse of power imo

spark flint
#

not abuse of power

#

its called DM advertising

#

(which is not allowed)

earnest phoenix
#

I didnt dm him out of the blue, we had been talking before.

#

One day I was inviting everyone on my friends list to my server using the invite feature and had accidentally sent them an invite (which I deleted immediately) and they removed my bot instantly

#

lol

#

thats out of the blue

#

you invited them from nowhere