#development

1 messages · Page 1563 of 1

opal plank
#

i smell burn, is it my charcoals?

quartz kindle
#

its a burn to devs who publish 20 shit pckages

#

:^)

opal plank
#

it feels really sad to see i only have that few public repos

#

most of mine are private

quartz kindle
#

most of mine are unfinished

#

xD

opal plank
sage bobcat
#

One message removed from a suspended account.

solemn latch
#

who finishes projects? ew

sage bobcat
#

One message removed from a suspended account.

quartz kindle
opal plank
#

i already finished quite a few projects, most of them private requests for jobs

quartz kindle
#

i dont hve fancy emojis

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

i only ever did one private job

opal plank
#

i did a bunch, so i've got those, but i dont list since they're pirvate

quartz kindle
opal plank
#

i dont think i have a single repo without at least 2k lines written

#

actually, no, 1.5k

#

iirc a bot that was requested as midly complicated, but was easy to do

quartz kindle
opal plank
#

that one probably doesnt hit the 1.5k mark

opal plank
#

you're overestimating a legally lazy person

quartz kindle
#

xD

#

i'll challenge you for the legally lazy status

opal plank
#

challenge accfepted

quartz kindle
#

how many lines of code have you written today

opal plank
#

0

quartz kindle
#

same

#

xD

opal plank
#

yesterday?

quartz kindle
#

eh

#

like 3-4 i think?

opal plank
#

i probably typed a couple when you asked me some questions

#

but thats about it

#

do we count those?

quartz kindle
#

yes

#

i mean

#

do we count the code i type when i spoon feed people here?

opal plank
#

hmmmm

quartz kindle
#

but thats not actual work

#

so probably not

opal plank
#

fair

#

then 0

quartz kindle
#

what was the longest you went without coding?

opal plank
#

hmmm thats a tough one, prob 2 weeks

quartz kindle
#

in the past 1-2 years

opal plank
#

yeah, around 2 weeks maxz

quartz kindle
#

i dont remember for me

#

but i think over a month

#

lmao

opal plank
#

fuck, you win then

#

i hereby crown you as the laziest

quartz kindle
#

too lazy to pick it up, you can keep it

opal plank
quartz kindle
#

:^)

#

you wanna know something stupid i do

opal plank
#

be here? me too

quartz kindle
#

besides that

opal plank
#

wusup

quartz kindle
#

i sometimes review parts of my bot's code

#

change some things here and there

#

save it and push it to the server

#

and dont restart the bot

#

then i forget what i changed

opal plank
#

see, i do the same

quartz kindle
#

then discord does what discord does

crimson vapor
#

this conversation is amazing

quartz kindle
#

my bot disconnects or whatever

#

and when it reconnects, it's suddenly not working

opal plank
#

mostly because i got a reload command, but sometimes i forget that i actually edited shit that cant be re-required, so i end up trying to find bugs that dont exist

quartz kindle
#

and i go see and it was some mistake i did when i changed its code 1 month ago

#

and didnt test

#

xDD

delicate zephyr
#

Like ive prepped for growth that im gonna get from auctions

#

since like, I got my verified bot renamed so I wont have to worry about the 100 server cap

#

lmfao

crimson vapor
#

sharding in one process isn't possible to have restarts like that

delicate zephyr
#

rebranding is fun

crimson vapor
#

well its harder

opal plank
#

i usually test my changes quite throughly in private channels, but i've done that multiple times of not restarting the bot and just reloading command

delicate zephyr
#

lol

crimson vapor
#

@quartz kindle confirm

quartz kindle
#

it is

crimson vapor
#

o

delicate zephyr
#

lmfao

quartz kindle
#

i mean

#

its quite easy

opal plank
#

and watch shit break, because i have a 400IQ idea of sleeping after i finish updates, since its usually 6 or 7 AM by the time i finish them, so prod stays broken until i wake up and realise the shit i've done

crimson vapor
#

and the rolling restart can edit the "index.js" and still have changes done?

quartz kindle
#

save gateway sessions in a file or a db, restart the process, put the session back, reconnect

crimson vapor
#

oh

#

seems like cheating to me

delicate zephyr
#

its not cheating

#

its called being smort

quartz kindle
#

^

crimson vapor
#

idk man

delicate zephyr
#

Half the shit you tell me your doing MILLION makes me wanna slam my head into a brick wall so hard that I go back in time so you havent told me

#

because you half arse shit so much

#

like im not angry about it

quartz kindle
#

Lol

delicate zephyr
#

just sometimes its too much

crimson vapor
#

lol

quartz kindle
#

i have to keep remining myself to never push updates at night

opal plank
#

see, thats where you lose in lazyness to me

#

i just push it and go sleep

crimson vapor
#

idk tho, seems kinda cheating to call it a "rolling restart" if you are restarting the process and just saving the connection

opal plank
quartz kindle
#

lmao

#

ok you win

crimson vapor
#

do you guys have aliases for your ssh to your vps?

opal plank
#

i do

quartz kindle
#

aliases? like where?

opal plank
#

you can setup host names

crimson vapor
#

well

opal plank
#

ontop of your user

crimson vapor
#

I use wsl for everything

delicate zephyr
#

who needs aliases when you have instant login

crimson vapor
#

so I can just add aliases

crimson vapor
quartz kindle
crimson vapor
#

oh you use a real client

delicate zephyr
#

I dont need an alias for something ive memorized

crimson vapor
#

shorter tho

opal plank
#

hahahhaha found ur ip luke, 192.168.0.12

quartz kindle
#

yeah i dont use barebones ssh

crimson vapor
#

ssh 10.0.1.8 localdedi

quartz kindle
#

i use termins because its sexy af

opal plank
#

i use powerhsell

crimson vapor
#

oh

opal plank
#

jk, i use putty

crimson vapor
#

ok ok good

opal plank
#

like a good well behaved boi

#

though, legit, i use powershell sometimes with opnssh

crimson vapor
#

whats the point of using powershell?

delicate zephyr
crimson vapor
#

bruh

delicate zephyr
#

I have ssh homesrv at home

#

I dont on my laptop

#

cba to edit the hosts file

crimson vapor
#

lmao

blissful coral
#

Now to figure out how to create more logins on ubuntu sad

delicate zephyr
blissful coral
#

yea ik

quartz kindle
#

just use root for everything :^)

delicate zephyr
opal plank
#

sudo apt install

quartz kindle
#

who needs sudo

#

i am root

opal plank
#

sudo everything

solemn latch
#

make sure to sudo npm install too

quartz kindle
#

xD

opal plank
#

sudo cd Desktop

#

sudo ls

#

sudo sudo

quartz kindle
#

sudowoodo

solemn latch
#

sudowoodo eat

opal plank
#

im...

#

speechless

quartz kindle
#

speechless, speechless
That's how you make me feel
Though I'm with you I am far away
And nothing is for real

opal plank
#

never gonna give you up
never gonna let you down

quartz kindle
crimson vapor
#

the fuck?

delicate zephyr
#

what the fuck happened here

quartz kindle
#

stuff

delicate zephyr
#

this is the reason Million grinds my gears

#

this man I swear

#

knows exactly what to say

quartz kindle
#

lmao

crimson vapor
#

idk man I don't work there

delicate zephyr
hybrid mica
#

If y’all could recommend a bot creation service other then botghost, what would y’all recommend? Because I’m trying to get away from botghost.

crimson vapor
#

its more beneficial to learn nodejs or python that it is to use a creation service

#

and people will shit on you

delicate zephyr
#

bingo

umbral zealot
#

Step 1) learn a programming language
Step 2) Find a discord library for it
Step 3) ???
Step 4) Profit!

crimson vapor
#

@delicate zephyr you got 5 across on your #development bingo?

delicate zephyr
#

25 across

#

actually

crimson vapor
#

ah

delicate zephyr
#

5 is too small

#

you'd complete it instantly

crimson vapor
#

youve been watching for about an hour now have you?

delicate zephyr
#

since 9am this morning

crimson vapor
#

o

delicate zephyr
crimson vapor
#

you don't actually have a bingo do you?

delicate zephyr
#

Yes

crimson vapor
#

wtf send

delicate zephyr
#

Its been a long fucking day

#

No

#

its a mess

#

plus I wanna make a pre-generated one soon

crimson vapor
#

did you use ms paint or something?

delicate zephyr
#

Yes

crimson vapor
#

can I see it?

delicate zephyr
#

I scribbled it together while drunk

#

and no

#

because it breaks discord and everyones tos

crimson vapor
delicate zephyr
crimson vapor
#

upload to pyro

delicate zephyr
#

NO

#

Hell no

crimson vapor
#

pyro has no tos

delicate zephyr
#

fucking jesus christ no

#

and I still have to abide by OVH's tos

#

my guy

crimson vapor
#

what is on your bingo board that is against tos? porn or something

delicate zephyr
#

mhm

#

its a bingo across like 3 servers

crimson vapor
#

ah

delicate zephyr
#

the 3 im active in anyway

oak cliff
#

this doesnt seem like its development related sus

#

also

#

great server name

delicate zephyr
#

Xiuh

oak cliff
delicate zephyr
#

If you havent noticed

#

9 times out of ten

#

this is the developers chill hangout

#

Also it was a development bingo thingy

crimson vapor
#

as long as we are talking about something related to tim we are fine because tim is #development

delicate zephyr
#

lmfao

oak cliff
#

lmao

crimson vapor
#

can't prove me wrong

#

ill ping tim

delicate zephyr
#

that deserves it

#

it just does

crimson vapor
#

he'll fuck you up

delicate zephyr
#

But tim isnt the development god /s

delicate zephyr
#

he isnt

#

Ping him

#

I'll just give him a cookie

crimson vapor
#

he is too humble

#

he will deny it

delicate zephyr
#

@woven prairie you alright bud? need some help?

crimson vapor
#

wait luke did you take pictures of the thing that gave you a point?

delicate zephyr
#

no

blissful coral
crimson vapor
#

so the english on the picture breaks tos?

delicate zephyr
#

Im invested but im not that invested

blissful coral
delicate zephyr
#

so uh

#

reddit was a factor

blissful coral
#

ah yes

delicate zephyr
crimson vapor
#

idk I don't use reddit much

delicate zephyr
#

why was that even a question

#

lmfao

#

@crimson vapor hold on

#

i'll send you a pic of the front page of my reddit

crimson vapor
#

ok

delicate zephyr
#

he should understand now

crimson vapor
#

luke is more fucked up than I had previously thought

delicate zephyr
oak cliff
#

even tho im a mod here im a noob dev so forgive me

#

is making an event handler the same kinda system as a command handler?

#

d.js btw

ripe prairie
#

@fickle basin what's up

fickle basin
#

So, I made a bot and when I coded it, it says async def is an invalid syntax.. I am not sure why considering you should be able to run multiple syntaxes of async def.

#

Idk what exactly to do.. Kind of stuck on it tbh.. It will not register my other async def syntaxes, just my first one.

ripe prairie
#

can i see the code?

fickle basin
#

Of course, lemme snap a photo of it

#

It greys out my other syntaxes

earnest phoenix
#

it's not the line itself

#

but what above that

ancient pewter
#

You haven't ended the paranthesis

earnest phoenix
#

`@client.command(pass_context=True)
@commands.has_permissions(manage_roles=True)
async def role(ctx, user: discord.Member, role: discord.Role):
try:
if user have the role
await user.remove_roles(role)
await ctx.send(f"Successfully Removed {role.name} role from {user.name}")

else:
await user.add_roles(role)
await ctx.send(f"Successfully Added **{role.name}** role to {user.name}")`

i got error
if user have the {role.name} ^ SyntaxError: invalid syntax

#

what to change ?

ripe prairie
#

@fickle basin yeah what they said

#

in the bot.event

#

there's an unclosed parenthesis

ancient pewter
#

In your activity statement

ripe prairie
#

to find if the user has the role

#

not just

#

pseudocode it

fickle basin
#

Oh... I feel really dumb rn xD

ancient pewter
#

Also, I don't think you need pass_context =True if you're using the rewrite

ripe prairie
#

^

#

context is automatically passed

#

in rewrite

earnest phoenix
#

it should be rewrite though, there's no point in using async branch kekw

ripe prairie
#

async too old

#

sadge

fickle basin
#

Yeah. I really appreciate you all.

ripe prairie
#

was good while it lasted though

ancient pewter
#

Yeah

fickle basin
#

So you think I should use rewrite instead of async?

ripe prairie
#

yeah

fickle basin
#

I have always used async and never has issues lmao

earnest phoenix
#

you already do

#

not that async we're talking about

ripe prairie
#

well the problem is that you haven't had any issues with async (even though you're not using it atm)

fickle basin
#

Oh..

ripe prairie
#

the problem is what happens when you're using async and you actually DO run into an issue

fickle basin
#

You meant the client

#

My mistake.

#

Yeah rewrite has been really good.

ripe prairie
#

how to tell async vs rewrite

#async
bot.say("a")

#rewrite
ctx.send("a")```
fickle basin
#

I just haven't been on my "A" game today and have just been messing up today lol

#

Just one of those days

earnest phoenix
#

I haven't looked into it though, how does it refer to the right channel?

ripe prairie
#

happens to the best of us

#

uhh

#

ctx stores channel

#

that cmd was run in

earnest phoenix
#

no, I mean, when you're using bot.say

ripe prairie
#

oh

#

you have to specify channel

#

iirc

#

in an arg

#

that was just a bad example lol

earnest phoenix
#

By seeing the example in the repo, it doesn't take any arg other than the content

fickle basin
#

Thank you all for helping. Lmao. I am a dev, but today I feel like a student xD

earnest phoenix
#

oh, it's getting the channel from frame records, good thing they rewrote it so it made more senselol

timber frost
#

just me or I'm unaable to recieve some audit events or some events like 'guildBanAdd', 'guildBanRemove', 'guildMemberAdd' , 'guildMemberRemove' and a few others

blissful coral
#

Anyone know how I can emit a event over all shards at one time?

foggy robin
#

how do I add a second owner id to config?

zenith terrace
#

@foggy robin like into a config file you have?

foggy robin
#

yes

zenith terrace
#

if you have a config.json file, this should work 'owners': ['ownerID1', 'ownerID2']

foggy robin
#

ok thank you

blissful coral
#

Actually

#

@delicate zephyr boop

#

Do you know anything about djs shardingManager

delicate zephyr
#

sup

#

Not really, haven't used it in donkeys

blissful coral
#

ok so

zenith terrace
#

very helpful

blissful coral
#

Well any sharding manager that works with djs

#

I am looking for a better solution anyway

#

But I am trying to emit a event over multiple shards

#

Possible?

delicate zephyr
#

Kurasata

blissful coral
#

GH link?

delicate zephyr
#

its made by Yukine

blissful coral
#

👀

delicate zephyr
#

I spelt it wrong

#

oof

blissful coral
#

Thanks

delicate zephyr
#

np

blissful coral
#

So how would I do that then

blissful coral
#

Would I just do it on the master process and it will send out to the child processes

delicate zephyr
#

He's asleep rn

#

and im dealing with Chip's outage rn

blissful coral
#

oh damn have fun with that

delicate zephyr
#

i am

#

slowly recovering

blissful coral
#

I bet

delicate zephyr
#

😩

blissful coral
#

No fun

delicate zephyr
#

I didnt notice it was down

#

like

#

you'd think

blissful coral
#

someone would say smth

delicate zephyr
#

a 110k bot would have enough people to tell us

#

but NOPE

blissful coral
#

yeah

delicate zephyr
#

its been down for a solid 10 mintues

#

god this is gonna take

#

fucking forever

#

128 shards

#

to watch spawn

blissful coral
#

5 seconds per shard

#

fuckkkk

zenith terrace
blissful coral
#

Lets see

foggy robin
#

I think I fixed it

#

thank you

zenith terrace
#

np

sacred trout
#

I need help with my code

#

it stores in the db as well but doesn't send it 😦

zenith knoll
#

Can you do
<Channel>.send('some string' + SomeEmbed)?

warm marsh
#

Not like that.

summer torrent
#

send(string, embed)

earnest phoenix
#

@client.event async def on_command_error(ctx, error): if isinstance(error,command.MissingPermissions): await ctx.send("You can't use that :watching_you:") elif isinstance(error,commands.MissingRequiredArgument): await ctx.send("Please enter all the required arguments") else: raise error

this is not working !?

line 193, in on_command_error if isinstance(error,command.MissingPermissions): NameError: name 'command' is not defined

#

s

#

well there's no command variable

#

oh

#

how do you expect it to know what command is

#

we need to write command name ??

#

like kick

#

🤷‍♂️

#

is that copy pasta lol

#

both the error and the solve are pretty self-explanatory

daring prawn
#

Hey I get an error saying an error has occured while validating your input only PNG and JPG images can be used
That i got for the custom background and this is my image--> https://imgur.com/oxVe3nF and it is a png

#

But I still get error

#
https://imgur.com/oxVe3nF
earnest phoenix
#

it isn't an image

#

that's a link to the whole site

daring prawn
#

It is

earnest phoenix
#

no, it is not

#

that url will return html

daring prawn
#

@earnest phoenix they told I should upload imgur pic

earnest phoenix
#

sure

#

you need the direct url

abstract sparrow
#

If I want to play a song, what should I write before its name?

earnest phoenix
#

not the site url

daring prawn
#

Oh

pale vessel
earnest phoenix
near plover
#

anyone happen to have a good suggestion as to how I can redirect people to use a more updated version of my bot, which has been renamed

earnest phoenix
#

why not just

#

rename your application

near plover
#

can't rename verified bots

earnest phoenix
#

oh

#

yikes

#

i guess you can deny any command execution and tell them to use your other bot

pale vessel
daring prawn
pale vessel
#

They probably won't respond though lmao

near plover
earnest phoenix
#

i love how discord takes pride in their ticket team and the fact that they cleared out all applications... but they don't even read the ticket and redirect you to a bot instead

near plover
#

they've been rather good with my ticket(so far) at least

pale vessel
#

If you know an employee like Mason they could change it for you xd

near plover
#

I follow Mason on Twitter but sadly don't "know" him

urban swan
#

Anyone from Asia?

near plover
#

do you think it'd be against TOS to write some code that DMs guild owners advising them after a specific date to invite the new bot?

earnest phoenix
#

yes

#

it's unsolicited dms

tribal siren
#

lolmao i just found out that dank memer's top.gg page is a vanity url

earnest phoenix
#

you should only ever interact with your users as a response to their interaction with your bot

tribal siren
#

so what's the talk about

#

hi cry

#

how are you

near plover
#

I would opt for disabling command input, but the bot does it's core functionality automatically which is where i'm struggling lol

earnest phoenix
tribal siren
earnest phoenix
pale vessel
#

Time to @everyone if you do

tribal siren
#

omg they pinged the bot.guilds.cache.get('264445053596991498').roles.everyone

pale vessel
#

That's the role

near plover
earnest phoenix
#

<@&264445053596991498>

pale vessel
#

<@&264445053596991498>

#

AA

earnest phoenix
#

L

pale vessel
#

cry shut

earnest phoenix
tribal siren
#

what's the id

pale vessel
#

¯_(ツ)_/¯

daring prawn
tribal siren
near plover
tribal siren
#

if it didn't dank memer would have 1b votes or something

daring prawn
#

Oh rip 60votes

trim saddle
#

@pale vessel you.

#

say i had an interface full of events

#

aside from naming it after the eventemitter, how would i get them to apply

foggy robin
trim saddle
#

doing what? sending a message?

earnest phoenix
#

How to get the member.size

#

client.users.cache.size shows 10

#

and i have members intent

trim saddle
#

guild member size?

foggy robin
#

no its putting the channel I tag

trim saddle
#

@foggy robin you have the channel in the description?

earnest phoenix
trim saddle
#

yes.

foggy robin
trim saddle
#

the message content contains the channel and the message

#

you didn't cut out the channel

foggy robin
#

oh so how would I fix it

trim saddle
#

slicing once more?

foggy robin
#

Im still learning this stuff

earnest phoenix
foggy robin
#

?

trim saddle
foggy robin
#

ok

trim saddle
#

@earnest phoenix is there a guild in your message?

earnest phoenix
#

i want size off all members

trim saddle
#

for all guilds?

earnest phoenix
#

yes

foggy robin
#

thank you but why is it on separate lines

trim saddle
#

add all your members together

foggy robin
earnest phoenix
trim saddle
#

@foggy robin your text variable seems like it's being joined with \n

#

which newlines every word

foggy robin
#

ok ill look into that

#

yeah found the problem thanks you so much

tired panther
#

guild.membercount , join them

hazy shale
#

and run it where

tired panther
earnest phoenix
#

how to get bot hosted for free?

pure lion
#

Check pins

#

I just told you to check the pins

#

Is it really that hard to just check the pins

earnest phoenix
#

how

#

wow

pure lion
#

There's literally a button with a pin, underlined by the word "Pins"

earnest phoenix
#

scams

pure lion
#

Yes they're all scams

earnest phoenix
#

sorry

pure lion
#

Pay for hosting

#

Or don't host at all

earnest phoenix
#

i could of gotten my music bot hacked

tired panther
earnest phoenix
#

that would be bad

#

im not good with coding

viscid thistle
#

I use heroku

#

Its good

#

You would need it online 24/7

golden condor
#

You can localhost if you can't pay

pure lion
#

@viscid thistle @tired panther heroku and repl are not for discord bot hosting and you should not use them for discord bot hosting ever

pure lion
#

Like callum said, localhost is the best free option

slender thistle
#

Repl is "fine" for Discord bots if you can use it appropriately

earnest phoenix
#

i could host it by using my pc

slender thistle
#

Same with Heroku technically, but good luck with serverless databases

pure lion
golden condor
#

repl makes your bot public code, heroku has limits, glitch doesn't stay online for more than 5 minutes

tired panther
earnest phoenix
#

its usually on all day

pure lion
viscid thistle
golden condor
pure lion
#

That must be such a hassle

golden condor
pure lion
#

Glitch is even worse

viscid thistle
#

New acc

slender thistle
#

Repl was not meant to be used as a VPS but they allow it

#

¯\_(ツ)_/¯

pure lion
#

However the hardware you get is trash

golden condor
#

And all code is publicly available

pure lion
#

Repl is just a repl for your code

golden condor
#

You have to get premium to make it private

slender thistle
#

I mean, is it really that much of a problem to have your code be open-source

tired panther
#

your code is not opensource on replit

golden condor
#

It is

pure lion
golden condor
#

If your bot is already foss/oss then you shouldn't care

slender thistle
#

Repls are public by default and you can't make them private without buying their premium subscription

tired panther
pure lion
#

So you paid for repl?

golden condor
viscid thistle
#

What is the best bot hosting option

pure lion
#

Vps

#

It's the most efficient

slender thistle
#

A VPS or a VDS

golden condor
#

Imagine paying for repl when you could buy a vps

viscid thistle
#

But without keeping a device online 24/7

golden condor
#

VPS

viscid thistle
#

Oh ok

tired panther
pure lion
#

Some people who have massive bots use dedicated servers

golden condor
viscid thistle
#

But vps is paid?

pure lion
#

Yeah

golden condor
#

Yes

pure lion
#

There's some really cheap ones

viscid thistle
#

Cuz Im underage so i cant pay

pure lion
#

Like £3.59

slender thistle
#

Yes because hardware isn't free

golden condor
#

Many VPS providers offer services for under 18s

pure lion
slender thistle
#

SkySilk have cheap stuff

#

PayPal is 18+ isn't it

pure lion
#

Oxide has cheap stuff too

viscid thistle
golden condor
#

Oxide, skysilk, galaxygate

pure lion
golden condor
#

That's optional

pure lion
#

You can still have money transferred to you

viscid thistle
#

From who? No one

pure lion
#

So if you discuss it with a parent you could probably get the money for it

viscid thistle
#

Yea

#

But

#

I dont want to

golden condor
#

Or ask your parents to pay

pure lion
#

The choice is yours

golden condor
viscid thistle
#

I can pay with skrill only

cobalt spruce
#

is there a way to return message when args are null?

viscid thistle
golden condor
#

Ok

cobalt spruce
pure lion
#

Do you know how if statements work?

cobalt spruce
viscid thistle
#

Oof

pure lion
#

Show me what you know

rocky hearth
#

for react: How do I achieve similiar effect of shouldComponentUpdate for FC?

pure lion
#

What's fc

cobalt spruce
#
    if (!text) return message.channel.send(embed2);


if (isBase64Valid) {
    // true if base64 formate
return message.channel.send(embed)
} else {
    // false if not in base64 formate
    return message.channel.send(embed3)
}
#

Dice

rocky hearth
#

Functional Component. I don't want to render again when a props changes, rather I want to style it, with animaiton

cobalt spruce
#

i learn BASIC

cobalt spruce
earnest phoenix
cobalt spruce
#

empty message is null

#

Right?

pure lion
#

The ! operator accounts for null and undefined

cobalt spruce
#

i didnt understand a shit

#

empty message is null
answer should be yes / no

#

lol

#

if its no so its undefined

earnest phoenix
cobalt spruce
#

tryied to do that

pure lion
#
let thing1 = null;
let thing2 = undefined;

if (!thing1) {
    // this code will execute because thing1 is null
}

if (!thing2) {
    // this code will execute too because thing2 is undefined
}```
cobalt spruce
#

! means not

#

u trying to say if is not undefined

#

il just try it

pure lion
bitter plover
#

how much time takes getting verified

pure lion
#

if the if statement doesn't receive a true or a false, it goes off of null and undefined

bitter plover
#

I will wait

earnest phoenix
#

everytime you ask you have to wait an extra week mmLol

pure lion
#

Yeah over lockdown it got really bad

#

I waited for a month

#

Asked too many questions sadkittya

earnest phoenix
#

the if statement only takes in booleans, however null | undefined are type converted to booleans and are treated as false

bitter plover
#

cry you have Early badge

golden condor
#

Wait for it

pure lion
golden condor
#

First comes the friend requests

#

Then comes the friendly greetings

golden condor
#

Then they crack down on you

earnest phoenix
#

you're implying i accept friend rq's in the first place mmLol

golden condor
#

Lol

#

I should turn of friend reqs

earnest phoenix
cobalt spruce
golden condor
#

Yes

cobalt spruce
#

ama fix it

#

thanks

#

boys

pure lion
golden condor
#

I made a test to see how long it takes JSON to corrupt

viscid thistle
#

How did you corrupt it?

golden condor
#

Writing to it

pure lion
#

When i was using a JSON db (don't.) it took a couple days

cobalt spruce
golden condor
#

I'm writing as many times as possible

pure lion
#

if (!variable)

earnest phoenix
#

isn't that test kind of... invalid?

golden condor
#

It just keeps going

#

And writes

#

Until it corrupts

earnest phoenix
#

in a real world application the frequency of r/w isn't constant

cobalt spruce
pure lion
#

The ! means "not"

golden condor
#

I'm not measuring time I'm measuring writes it takes

earnest phoenix
#

i know

#

corruption happens when a race condition occurs, two methods trying to access the same file at once because they're not aware of each other

#

so a lock fixes it?

earnest phoenix
#

or rather, prevents

#

but you're going to have slow access then

#

Reasonable

#

anyway, this is why the test is invalid

#

the frequency of r/w is an important factor

cobalt spruce
# pure lion The ! means "not"
let thing1 = null;
let thing2 = undefined;

if (!thing1) {
   return message.channel.send(embed3)
}
if (!thing2) {
    return message.channel.send(embed3)
} else {
    return message.channel.send(embed)
}```when i change thing1 or thing 2 the var it says its already delared
earnest phoenix
#

learn javascript

cobalt spruce
#

better

earnest phoenix
#

why are you linking me that

#

lol

#

also you included your trackers in the url

cobalt spruce
#

?

#

when

#

how

earnest phoenix
#

lol

cobalt spruce
# earnest phoenix lol
if(messageConverted == undefined) { message.channel.send(embed3)
 }else{
    return message.channel.send(embed1)
 }```
THE LOG SAYS ITS UNDEFINED BUT IT DOESNT SEND THE MF EMBED3
but it sends embed1
#

why when i need help people die

#

lol

cinder patio
#

console.log typeof messageConverted. Are you sure it's actually undefined and not a string or something

pure lion
#

null is an object zoomeyes

cobalt spruce
#

is i tryied

#

undefined

#

null

#

but both not working

pure lion
#

console log messageConverted === null

cinder patio
cobalt spruce
#

its acualy defiened

#

lol

#

the command is converting morse codes to text

#

and i wanted to check if code is not a normal text

#

by using the converting function

#

the resual of converting function

cinder patio
#

console.log messageConverted and screenshot your console

cobalt spruce
cinder patio
#

...

#

it's an ARRAY, and undefined is inside the array

cobalt spruce
#

...

cobalt spruce
cinder patio
#

The result is the first element in the array, so you have to get it

earnest phoenix
cinder patio
#

Don't give him the answer directly

cobalt spruce
cinder patio
#

Just get the first element from the array.

cobalt spruce
cinder patio
#

okay, but to check if there is no result, get the first element in the array and check if it's undefined

cobalt spruce
#

did not understand

#
    var messageConverted = [];
    
    text.split("   ").map(function (word) {
        word.split(" ").map(function (letter) {
            messageConverted.push(alphabet[letter]);
        });```
this is converted message
cinder patio
#

okay, get the first element in it... and compare it to undefined

cobalt spruce
#

i just split it so it can convert it to text using a alphabet var

cinder patio
#

What was your question again??

cobalt spruce
#

i wanted to check if the messageConverted is nothing and then reply by a message

near stratus
cinder patio
#

message.author is already a User

near stratus
#

Lemme try

earnest phoenix
#

AttributeError: 'NoneType' object has no attribute 'change_presence' help

near stratus
#

@cinder patio thanks it works
||All this time I was thinking the error was with user2 variable||
||Feel free to kill me||

cobalt spruce
near stratus
earnest phoenix
#

oh

#

i need to add wait until ready

near stratus
#
  • StackOverFlow lol
#

I don't Cody python anyway

cobalt spruce
#

i hate when google start having sex with my pc

near stratus
near stratus
cobalt spruce
#

proccesor is 100% used by google

earnest phoenix
#

alright

#

thanks working

cobalt spruce
near stratus
#

I had to take that command down then

earnest phoenix
#

what was the command?

near stratus
earnest phoenix
#

ok

dark thorn
#

Any way to delete message by ID?

tidal jackal
#

Anyone else running into an issue where users get invalid-user displayed instead of a ping?

#

well a fake ping, only seems to occur if allowed_mentions are specified

#

seems to be android-specific

dark thorn
#

Quite sure that's a discord bug

#

For example, this sometimes says invalid-name instead of the normal tag

earnest phoenix
#

I'm getting the error : fields.flat is not a function
What do they mean

zenith terrace
#

update node

earnest phoenix
#

K

#

Erm its updated alrdy

tidal jackal
dark thorn
# dark thorn Any way to delete message by ID?

I'm using quick.db to store the ID's:

const db = requiere('quick.db';
message.channel.send(embed).then(msg => {
    let id = msg
    db.set('t-message', { msgid: `${id}`})
});

And this is how I'm trying to delete it:

        setTimeout(function(){ 
            const ticketmessage = db.get('t-message.msgid')
        ticketmessage.delete(); 
          let embed = new Discord.MessageEmbed() 
          .setDescription("**Ticket creation time finished**")
          .setColor('BLUE')
            message.channel.send({embed}); 
}, 15000);
#

The error says is not a function:

TypeError: ticketmessage.delete is not a function
zenith terrace
#

db.delete('t-message.msgid')

dark thorn
#

db is the caller for quick.db

earnest phoenix
zenith terrace
#

I told you to update node

earnest phoenix
#

I did

#

It's updates

#

Already

zenith terrace
#

to what version

earnest phoenix
#

Lemme check

#

V.10.19.0

zenith terrace
#

no...you are nowhere near the current version

cinder patio
#

you need 12+

earnest phoenix
#

Oh nvm

#

I'm dumb

dark thorn
zenith terrace
#

because its how you delete with quick.db

dark thorn
#

Ye but I'm not trying to delete the message data stored on the database, I'm trying to delete the message on the channel

earnest phoenix
#

Is it bad to log every command usage, guild join/leave to a mongo db?

#

Ping me with answer ❤️

slender thistle
#

Not bad per se

#

But it depends on your bot's usage

earnest phoenix
#

Commands get used a lot

slender thistle
#

Every command usage is... a bit extreme, yeah

earnest phoenix
#

At least one command per 5 seconds or so

near stratus
umbral zealot
#

Why are you logging them then

earnest phoenix
#

That's why i'm asking...

#

Is it bad

#

So i'm assuming yes

slender thistle
#

Bad enough, yeah 😂

umbral zealot
#

It really depends on the reason you're doing it

near stratus
umbral zealot
#

if it's just to log, then yeah, it's bad.

#

IF you're doing stats, it's less bad, but there are better ways to count stats

earnest phoenix
#

Alright cheers

#

i'll just log command usage to console, and log guild joins / leaves to mongo

umbral zealot
#

Or just do like every good mod bot and log it to a join-log channel instead 😉

#

no effort, very useful, no cost 😛

earnest phoenix
#

I do that already, but the webhooks don't keep up 😂

near stratus
umbral zealot
#

Webhooks? Thonk

#

I meant... log in every individual guild

earnest phoenix
#

Currently, I do use webhooks to log command usage to a channel

umbral zealot
#

not in a central place

#

There's very little use to centralising a log, that's extremely pointless.

near stratus
#

otherwise it seems like you're spying on them

umbral zealot
#

yeah basically what I Was going to say

earnest phoenix
#

fair enough, well thanks for the ops 😂

umbral zealot
#

Nobody using your bot needs you to be doing surveillance on their guild. it's not your place to do so.

near stratus
#

actually if you don't mention it in description and someone finds out he can file a lawsuit

#

just jk

earnest phoenix
#

It's specified in my support server

slender thistle
#

Technically that is correct

earnest phoenix
#

Would that be enough or would it have to be on the desc?

umbral zealot
#

No but seriously Why though. What do you do with this information?

slender thistle
#

You could probably put it in the long description at the top somewhere so that users have more chances of reading it

near stratus
earnest phoenix
#

I do it because it helps with premium purchase issues, if someone buys premium and redeems it on their server but doesn't work, I can check logs.

#

And any other issues regarding purchases

umbral zealot
#

Then you should be logging only premium purchases.

#

not "every command"

near stratus
#

as Evie said

earnest phoenix
#

What about guild joins and leaves?

near stratus
umbral zealot
#

I've always logged them to console and I have commands to search and such

near stratus
#

but not E V E R Y command

umbral zealot
#

they're available in caches usually so not sure why I'd need to log them to a database

#

also I have a dashboard so there's that ¯_(ツ)_/¯

earnest phoenix
#

Fancy 😂

#

Check u out 😂

near stratus
#

also you can just use a .txt or .JSON file for that (easier)

earnest phoenix
#

uh

#

thats horrible

#

I wouldn't trust json

umbral zealot
#

yeah that is horrible

earnest phoenix
#

mongo is fine 😂

near stratus
#

no need of a database which is made to handle 1000000 units of data

earnest phoenix
#

oh

umbral zealot
earnest phoenix
#

u mean for commands?

#

mb mb

umbral zealot
#

Basically, just log useful things that help you

near stratus
#

maybe SQLite max
nothing bigger than that is unnecessary

umbral zealot
#

if you want stats, use datadog or something like that instead

#

If you're logging for support, log only the things you need

#

Don't overextend yourself to the point where you're essentially spying on every guild you're in

earnest phoenix
#

Right, okay, thank you

near stratus
pale vessel
near stratus
#

dafaq

umbral zealot
cinder patio
#

👁️ 👄 👁️

#

I only log join/leave events in a discord channel

near stratus
#

Thanks for the idea
I'll log the joins too from now on

earnest phoenix
#

tfw logging command uses but nothing is logged

tribal siren
pale vessel
#

that was user input

#

someone used an ascii art

earnest phoenix
#

lol

#

they knew u were watching and sent u that 😉

rocky hearth
#

How can I transition an element in react. I want a smooth animation, when I translate it

frosty valve
kind thicket
#

You can use Math.ceil(Math.random) to generate a random number and use that

earnest phoenix
#

that's always going to return 1

#

🤔

pure lion
#

Math.floor(Math.random() * number)

earnest phoenix
#

unless random decides to give you a pure 0

quartz kindle
#

Math.floor(Math.random() * (max - min)) + min

pure lion
#

wait that min makes sense

rocky hearth
#

Math.random() * (max - min) + min | 0

frosty valve
#

thanks!

earnest phoenix
#

how can i react faster on message or chage the offset

#

you can't react faster

#

there's no bypassing ratelimits

earnest phoenix
#

what

#

maybe Tim knows it i will ask him later

pale vessel
#

change restTimeOffset to 0 in ClientOptions ig

cobalt spruce
#

ayo

earnest phoenix
hazy shale
earnest phoenix
cobalt spruce
#

how do i check if array is undefiend , log: js [ undefined ]

cinder patio
cobalt spruce
#

GOOGLE TELL ME HOW

cinder patio
#

I told you 1000 times

cobalt spruce
#

woops

#

caps was lock

sacred trout
#

how to i make value blank

cinder patio
sacred trout
#

in embeds ofcc

modest maple
sacred trout
#

thanks

topaz plover
cobalt spruce
tired panther
#

then use replit

topaz plover
earnest phoenix
cobalt spruce
#

mozila is gud

earnest phoenix
#

or w3schools

cobalt spruce
rugged cobalt
#

Would it make sense to have one kind of main table where you store user information like first command etc. and then extend the rest of the tables from that if the tables are to do with the user

#

I don't know if that makes sense

#

but basically as opposed to having seperate tables which store user id's and x

#

you just make a table that 'extends' the user info table so that this specific table only has a column for x

earnest phoenix
cobalt spruce
#

Error

var currentPrice =  XMLHttpRequest();
error:
(node:3718) UnhandledPromiseRejectionWarning: ReferenceError: XMLHttpRequest is not defined
cobalt spruce
cinder patio
#

There's no XMLHttpRequest in node.js

#

only in the browser

earnest phoenix
#

only in js html

cobalt spruce
#

currentPrice.open('GET', 'api', true);

rugged cobalt
#

with CurrencyStats being a table extension

earnest phoenix
#

Hello

#

Please Help Me

rugged cobalt
earnest phoenix
earnest phoenix
rugged cobalt
#

oh

quartz kindle
#

@rugged cobalt what database are you using?

rugged cobalt
#

PostgreSQL

quartz kindle
#

i havent heard of table extensions before in any SQL database

#

whats the exact query/function you're running to create it?

rugged cobalt
#

well

#

not sure

#

I only know the basics

#

and I use the UI to make tables, not sql queries

quartz kindle
#

hmm

#

i know pg has a lot of advanced features, but i havent heard of a feature like that

rugged cobalt
#

I watched a video ages

quartz kindle
#

with SQL you usually create separate tables linked by ids

rugged cobalt
#

so it could just be me mixing it up with something else

quartz kindle
#

not sure what you're trying to accomplish

rugged cobalt
#

So when you call on the user table, the other stuff kinda goes with it

#

if there are currency stats

quartz kindle
#

the usual setup is like this

#
table users {
  id, command, etc...
}

table currency {
  id, wallet, etc...
}
rugged cobalt
#

yeah

quartz kindle
#

and then you use JOIN to select the data with the same id from both tables

rugged cobalt
#

oh

#

that's probably what I was trying to refer to

#

I just used extensions as like a metaphor as to what you would do with classes

quartz kindle
#

yeah but they dont work like that, they are completely separate objects

#

its basically doing let data = Object.assign(users[userid], currency[userid]) if the tables were js objects

lyric mountain
#

man, java Annotations are so useful

#

my 756 line command manager became a 109 line file

#

idk how I lived before Annotations + Reflection

restive furnace
lyric mountain
#

not doing, done

restive furnace
#

huh

#

cool

#

what lib btw

rugged cobalt
#

Is it just like if I import UserInformation it will show all including the info and then for CurrencyStats it would just show that scope

lyric mountain
restive furnace
#

nice

crystal wigeon
#

hey guys

#

i was wondering, why it takes up to 3 secs for a message embed to be sent?

#

does it have something to do with server computations?

#

also i have few questions, discord itself is in the US and my VM is also in the US, but the "servers" on discord the region is kinda asia, does it have something to do with lag and stuff?

quartz kindle
hazy shale