#development

1 messages ยท Page 1623 of 1

river panther
#

umm, its not quick.db

earnest phoenix
#

quick.db is based on sqlite3

river panther
#

oh

#

so let me download better-sqlite3 first

#

yes

#

got many erros

#

i need to download python

#

oh no

#

D:

earnest phoenix
#

KEKW guess who is laughing

latent heron
#

wumpus is laughing

#

that's my guess, was i right?

river panther
#

i feel abused, i don't want python

#

but i have to

#

fml

#

downloaded quick db

#

nice

#

wait

#

i downloaded the wrong thing

#

idk wtf i did

#

whatever i did took lot of space

#

and i got no result

#

now i am finding where i installed python

#

to delete it

earnest phoenix
#

uhhhhhh

gentle mango
#

Hope

#

I have a question

#

Is it east

rustic nova
#

Hm

gentle mango
#

Easy

#

To make rest-api

#

In java

rustic nova
#

Well depends

gentle mango
#

Like requesting user level in a guild

#

Levels are cached

earnest phoenix
#

Not that hard

rustic nova
#

You mean through a dashboard for example?

#

Making a request and get the data?

gentle mango
gentle mango
rustic nova
#

Yeah possible

earnest phoenix
#

I have make one before.

gentle mango
#

Dashboard for bot in java is so hard

#

๐Ÿ˜ฅ

rustic nova
#

Writing a dashboard purely in java is pain, so don't

misty sigil
#

I will

rustic nova
#

I tried that lmao

gentle mango
#

Yes but i have anything else to do

#

My bot is in java

latent heron
#

now imagine how Notch must've felt when coding the GUI of Minecraft kappa

rustic nova
#

Notch moment

gentle mango
#

No it was easy

earnest phoenix
#

Do dashboard in js and api in java

gentle mango
#

Im sure

rustic nova
gentle mango
misty sigil
#

isnโ€™t Java just JavaScript without the script

gentle mango
#

Dashboard access password

rustic nova
#

JavaScript, also known as Java

misty sigil
#

ofc

earnest phoenix
#

I know, thats what you have to figure it out

#

Frontend is hard af for me

rustic nova
#

Mfw i actually made a html template and just fuckin replaced something like {USERNAME_PLACEHOLDER}

cinder patio
#

server-side rendering in a nutshell

rustic nova
#

It did work, then realized I'm stupid WeirdChamp

cinder patio
#

nah it's not stupid

rustic nova
#

I mean, java but bad (also phone rn)

#

Still can't figure out what 4am me did there

latent heron
#

alright

summer acorn
#

why does member.user.presence display the status as "offline" even though I am on Do Not Disturb

latent heron
#

i've been debugging this code for days now

#

@slender thistle i legit can't fucking figure out why my on_message stuff keeps looping

slender thistle
latent heron
#

so like

#

i've been debugging this to the smallest shit

#

what i understand is that:

  1. the bot loops but not on its own message
  2. there is some weird internal loop happening within a conditional statement for on_message
  3. the loop does not involve checking the role or webhook incorrectly
slender thistle
#

Interesting

latent heron
#

the final block of code that basically sets everything in motion

#

what I think might be causing it

#

is i'm checking if there is an autoDE role on the member's message, right?

#

i wonder if it's still being cached and the bot is convinced to keep doing it

#

because when the bot sends the webhook response

#

it has to somehow be reading my information still when it shouldn't

#

i'll try removing the role as soon as it's ran to see if it repeats still

#

lol nope that didn't do shit

#

this is driving me fucking crazy

river panther
#

what langiage?

latent heron
#

english

#

the only other way is scrapping all of the code i wrote

#

and trying again

river panther
#

what computering language?

latent heron
#

python

#

it's complicated

#

the issue that is

river panther
#

python geh

latent heron
#

the only way that this code could be looping is with the role variable

#

but i have a break statement for it which won't allow it to loop

#

that's what bothers me the most

earnest phoenix
#

Why getting the member object using name?

slender thistle
#

The break shouldn't be necessary there even

latent heron
#

i can't accurately grab the ID if it's used in multiple servers as a role name

#

yeah

#

i added it just now

earnest phoenix
#

And afaik, if it's in a guild, author is already a Member object?

latent heron
#

the return should work as well

#

it's a user object

#

the on_message listener event passes a discord.User object instead

slender thistle
#

message.guild existing, message.author used in the same context

latent heron
#

so you have to convert it over

slender thistle
latent heron
#

right

#

because i'm dealing with a user obj

#

not member

earnest phoenix
#

Uh I doubt

latent heron
#

that's how it is lmao

slender thistle
#

But wouldn't message.guild in that case be None if it was a User?

latent heron
#

i know that because it gave me an error trying it the easy route

slender thistle
#

Interesting

latent heron
#

no

#

user shares it

#

it's really stupid

earnest phoenix
#

Does it have something to do with intent?

#

But I'm fairly sure they send member object in message create event

latent heron
#

nope

#

that's just how Danny wrote it

#

probably due to fetching reasons

#

that's not the point anyhow

#

my point is that this loop shouldn't happen

#

regardless of how i'm getting the role data

#

the loop is being ended with the return call

#

it quite literally should not be looping if it's looping from where i think it is

earnest phoenix
#

Your break isn't even reachable because you already return it, kinda redundant. Also why are you getting the role again when you already get the role object

latent heron
#

you're not really helping

earnest phoenix
#

Well

latent heron
#

i've already told you why

#

it's pretty dumb to repeat it

#

i'll figure this out myself

slender thistle
#

Not sure what the cause is tbh

latent heron
#

like i can show you the whole script

#

and you still prob wouldn't understand why because it shouldn't be happening at all

#

it's driven me crazy for the past few days

earnest phoenix
latent heron
#

get just passes you down the object for direct reference

#

that's the point of get

slender thistle
#

Some stuff could be edited to be cleaner, yeah

#

You can return role though

latent heron
#

i don't care about it being clean right now

#

i can't

#

i literally

#

cannot

#

the object wont let me

earnest phoenix
#

If that's really the case, I'd use find instead, something like discord.utils.find(lambda r: "auto" in r.name, member.roles)

latent heron
#

that practically does

#

the exact same thing

#

i'll give it a try though

earnest phoenix
#

I've mentioned it may not be related to your issue, but you're basically just doing 2 times loop

latent heron
#

it doesn't make a difference

slender thistle
#

Putting unnecessary weird fuckery with loops aside

latent heron
#

well

#

the find didn't work so

#

that means the role variable isn't the issue

#

now i'm flabbergasted because the only way it can be getting triggered now is a direct message

slender thistle
#

Can you just start printing every role object in the loop?

latent heron
#

yeah, hold on.

#
@@everyone (799685484313968670)
@autoDE (815111340719865877)
[DEEPLAPI] Translation request is being attempted now...
#

here is what i'm getting

slender thistle
#

So retrieve isn't the issue by itself

latent heron
#

no

#

there are two self-functions

#

retrieve and check. retrieve is to get the role object, and check is to check if the webhook already exists

#

if it does, it deletes it and re-creates it to be used for that channel you just spoke in

#

neither of them are problems from all of the testing i've done on them strenuously

#

Let me break this code down:
https://i.imgur.com/PzLJiQK.png

target - just a variable i'm doing to get the last 2 letters of the language i translated, i'm plugging it into an embed field title, nothing else.
hook - this is how i'm creating that new hook. this could be a potential issue but i see nothing triggering it.

translation - this is my DeepL API request to send the contents for translation.
msg - this is me grabbing the author's message to delete it so the bot can "replace" you by imitating your chat appearance.

#

now

#

i mentioned the only other way the bug can be caused is by a direct message event

#

the only variable i can think of being a potential bug is msg but mentally speaking, it looks like it's proper and wouldn't be affected by webhooks.

slender thistle
#

check creates a webhook if one isn't already created, right?

latent heron
#

correct

#

all the await check() function does is just deletes the webhook if it existed

#

a new one will be created regardless, all the time

#

although i plan to change this in the future, this is just for testing for now

desert root
#

emm

#

i have a problem

#

i added the bot to my server

#

and it dosnt show on the page

little kelp
#

h

slender thistle
#

Oh, just deletes

latent heron
#

correct

#

now

#

what i fear the most

#

is that the msg variable is copying the webhook message ID

#

and this is why my fear is really into belief of this

slender thistle
#

Why are you re-fetching the message btw?

latent heron
#

that was in the span of 5 seconds

#

oh

#

i forgot

#

you can just do message.delete()

#

that's a stupidly old coding habit back during async days

#

let's see what happens if i remove it

#

okay the bug still exists

#

now i'm scared

slender thistle
#

I forgot why you can't just re-use one webhook for each channel instead of re-creating them

Can you show what check does?

latent heron
#

yeah

#

i remember talking about my anger about how discord handles webhooks and how d.py does it even worse

slender thistle
#

Can just do self.bot.get_guild(message.guild.id) btw for better performance

latent heron
#

i guess if it saves me a few ms

slender thistle
#

It doesn't return anything from what I see

latent heron
#

it's just a call

#

i'm not looking for a response from it, just having it do a job in the background

earnest phoenix
#

But still faster because it's O(1)

little kelp
#

mfw

latent heron
#

i'm going to try something that might work

#

but i doubt it will

earnest phoenix
#

It's just an improvement, not really a solve

slender thistle
#

Yeah

latent heron
#

i tried seeing if the bot was calling upon the webhook message itself

#

so thankfully that's not a problem

#

yeah i'll consider improvements

slender thistle
#

Do you think you could slap prints everywhere in your code and see where it starts looping?

latent heron
#

my plan is cleaning the code once it just works lmao

#

yeah sure

slender thistle
#

P.S. literally what I do always when I have issues with stuff like this

latent heron
#

that's what i tried yesterday

#

putting them everywhere and seeing where

#
@@everyone (799685484313968670)
m@autoDE (815111340719865877)
mligma role found
found my hook <3
now in the role condition
made the webhook
ok we ain't da bot for sure.
[DEEPLAPI] Translation request is being attempted now...
message length is in limit for translating
baby got sent off and deleted.
#

so this is what the structure would appear as

#

the loop seems to be basically when a message is seen

earnest phoenix
#

Maybe try to check if the author discrim is 0000

latent heron
#

fair point

slender thistle
#

if message.author.discriminator: KEKW

earnest phoenix
#

but '0000' isn't falsy, is it?

slender thistle
#

Oh yeah right, it's string

little kelp
#

yeah nimodo

slender thistle
#

if int(message.author.discriminator): gang

earnest phoenix
#

that's pog

charred nimbus
#

is there any way i can keep my heroku app from ideling

#

?

slender thistle
#

and just to be extra, message.author.discriminator.count("0") == 4

earnest phoenix
#

But because of the zen of python, I'd rather return if it's 0000 for less nesting lol

charred nimbus
#

is there any way i can keep my heroku app from ideling
?

slender thistle
earnest phoenix
#

by keep making request to it ig?

#

uptimerobot or something

little kelp
#

uptimerobot tho trollyikes

#

heroku tho trollyikes

charred nimbus
#

yes my bot gose offline when i close chrome.

latent heron
#

well

#

interestingly enough, the bug stops

#

but the message is not being converted

slender thistle
#

Mm, yes

#

One bug fixed, another occurs

earnest phoenix
#

Well I suppose because it's processing the webhook message

latent heron
#

yeah

#

the trick would now be uhh

#

finding the correct placement

earnest phoenix
#

Also if you use this as shiv has suggested, it'd reduce the requests ig

latent heron
#

not now

#

i need it to function without a side effect before i optimize the code

slender thistle
#

True KEKW

little kelp
#

XD

fallen juniper
#

Sa

modest maple
#

@slender thistle you dont by any chance remember how to link an attachment as a image url?

#

im lolkms close

slender thistle
#

I think there was some tag in d.py server for it

#

local image embed or something along those lines

modest maple
#

thats what im trying to find blobpain

slender thistle
#

sec

little kelp
#

attachment://link or something like that

#

gg

modest maple
#

@slender thistle got it

slender thistle
#

Oh it's in the FAQ

modest maple
#

love you lots

slender thistle
#

I was still scrolling around my server list to find the d.py one

modest maple
#

well i was close

slender thistle
little kelp
#

xdd

latent heron
#

HOILY FUCK

#

I DID IT

#

@slender thistle pogger

#

fuck my life in so many ways

#

i am never touching webhooks again

slender thistle
#

LMFAO

zenith terrace
#

lol

latent heron
#

next time i do this shit

#

i'm deleting the fucking bot

latent heron
#

This is finally what I wanted

lament rock
#

Pretty cool

pallid quail
#

oh wow ๐Ÿ˜ฎ

onyx hare
#

how do i log a commands output to a txt file? i know there's a way i think?

umbral zealot
#

probably just fs.appendFile ?

opal plank
river panther
opal plank
#

slash commands

river panther
#

i mean, they aren't working well in v12

#

ik about slash commands bruh

opal plank
#

then?

river panther
#

also, do you have the docs open everytime?

opal plank
#

it takes less than 5 seconds to open it

river panther
#

every dev sends the docs in a few seconds

#

0.0

opal plank
#

but yes, i had the api docs open

river panther
#

oh

opal plank
#

not this one specifically tho

river panther
#

how to open the dosc quickly?

opal plank
#

also

#

idk what you mean with v12 btw

#

theres no v12

river panther
#

v12 is the version of node.js

latent heron
#

only v8

river panther
#

what do you program in?

opal plank
#

doesnt matter with node version

river panther
#

python or something?

latent heron
#

v12 is a pseudonym of the dev branch for d.js

#

v8 is the official latest Discord API version

#

yes, it's in python

opal plank
#

i code in typescript

latent heron
#

I will be migrating my bot into DiscordPHP soon

river panther
#

i do js

latent heron
#

so that my brain can function properly

river panther
opal plank
#

anway, like flow mentioned, theres no v12

#

d.js latest version(and mostly used here) is v12

#

api only goes to v8

latent heron
#

slash commands kinda smelly doe ๐Ÿ˜ณ

river panther
#

oh, ok ok

#

yes, slash commands don't work for me

#

:(

umbral zealot
#

C'mon Erwin you've been here long enough to know they either mean d.js 12.x or nodejs 12.x ๐Ÿ˜›

opal plank
#

well they were mentioning slash commands

umbral zealot
#

and probably d.js because who would care about the node version

opal plank
#

and then mentioned v12

#

i know for a fact node version doesnt matter

#

nor does v12 d.js

#

cuz they dont support it

river panther
opal plank
#

so i have no heads for tails what he was on about hind

latent heron
#

no i found it on the side of the road

river panther
#

bruh

latent heron
#

it was homeless so i fed it food

#

i adopted it

river panther
#

-.-

latent heron
#

it's now a family member

slender thistle
#

Telling your bot that it's adopted...

river panther
#

same, my bot is like my child

#

;-;

river panther
latent heron
umbral zealot
# opal plank nor does v12 d.js

He did specifically say i mean, they aren't working well in v12 so I thought that was pretty clearly d.js v12. Maybe I'm just a better noob interpreter.

slender thistle
#

My bots are my test subjects. I don't care about their feelings and I use them whenever and however I want to

opal plank
#

my bot is the same as an emo teenager girl going through puberty and throwing tantrums everytime i even look at her in a weird manner

latent heron
#

that just sounds like basically every teen girl who went through a rebellious phase

opal plank
river panther
#

i was

#

referring to discord.js

opal plank
#

you said node afterwards

opal plank
latent heron
#

i mean

#

most of the time

#

emo moms are sadly a thing

#

and they scare me

river panther
#

oh no

#

oh yes

#

idk

umbral zealot
#

lol, people confusing themselves ๐Ÿ™‚

opal plank
#

ikr!

latent heron
#

emo gf cringe ๐Ÿคข
big titty goth gif amazing ๐Ÿ˜

opal plank
#

i just went past the point of no return btw

latent heron
#

my gf is unironically big tiddy goth so it works out for me

hasty mulch
slender thistle
#

reassuring bf and needy emo gf

opal plank
latent heron
#

no

opal plank
#

cant undo sharding anymore

hasty mulch
#

Where do I put the SQLite binary files after I downloaded them onto my Raspberry Pi?

latent heron
slender thistle
#

You tell me ๐Ÿ˜›

latent heron
#

the most common duo i've seen is the introverted, nerdy guy with the passionate, outgoing girl

#

it's really something to see

#

it's like gender swapping their relationship roles

slender thistle
#

This is the kind of development we need here

latent heron
#

lmao

slender thistle
#

Hey, if it helps people be happier... why not?

latent heron
#

mood

sinful belfry
latent heron
#

uh oh mod

#

ok so uhh

#

how do i code a girlfriend

slender thistle
#

You don't

#

Girlfriends aren't coded. They create themselves without any knowledge on how to code, which evolves into constant bugs like mood swings and unstable behavior.

river panther
river panther
river panther
#

funni

#

idk ruspberi

slender thistle
opal plank
#

step one: choose a famous character
step 2: create a bot named after that
step 3: add the pfp of that character
step 4: copy some random ass repo to make it a bot
step 5: ...
step 6: profit, you now have a waifu gf

hasty mulch
river panther
#

well, my main and test bot, i haven't kept a gender for them

opal plank
#

i need to check some repos speaking of which

sinful belfry
#

can we at least attempt to keep this channel on-topic zoomeyes

latent heron
river panther
opal plank
#

click meh status ๐Ÿ‘€

latent heron
#

thats the joke

little kelp
slender thistle
little kelp
#

h

sinful belfry
river panther
#

oh, ok ok

hasty mulch
latent heron
#

its ok

#

starman aint wavy like us

slender thistle
#

I mean, you just create a file and then... connect to it and create your tables?

latent heron
#

he hasn't coded a gf bot

river panther
#

wait, who delete my message?

sinful belfry
#

is talking about 'horniinstagramgirls' relevant to development?

river panther
#

umm, ok, let me reply to it in general

opal plank
#

dont ping me

river panther
#

ofc i will

#

xD

latent heron
#

salutations and goodbye

opal plank
#

fml

#

literally just said

river panther
#

exdi

opal plank
latent heron
#

your mom

river panther
#

exdi

#

guys, its off topic

pale vessel
#

just encodeURIComponent() the text @stark abyss

stark abyss
#

what does that mean

stark abyss
#

so this could probably be where I query the database right?

pale vessel
#

Query the db? what db do you use

stark abyss
#

postgres

pale vessel
#

I don't think that's got to do anything with your error

stark abyss
#

hmm NephehR

#

I think I need to reread the error, but I got the idea ty

pale vessel
#

the error came from a http request lib

#

check your API calls

stark abyss
#

oh

opal plank
feral skiff
#

Does anyone know a bot that can make a message deleted log channel and include images?

stark abyss
#

Well I got an error, and i had no clue what exactly caused it. I posted it for one sec, and deleted it because I thought I could figure it out. He managed to see it in one sec AHWeirdChamp

opal plank
stark abyss
#

I am not dealing with it, I have no clue what the error is I just thought it was with database because there was a command which wasn't working

opal plank
stark abyss
#

I don't think so NephehR

opal plank
stark abyss
#

Just ignore me man ๐Ÿ˜”

opal plank
#

okay, was trying to help

#

specially cuz i use postgres

stark abyss
#

Thank you but I can't get back to coding right now. It would be better if I could go read the error again, and then ask for help so I am not giving half ass information

opal plank
#

fair

waxen snow
#

I need to link my gdps account to my gdps bot

crimson vapor
#

ok

waxen snow
#

& btw how do I put a custom status to my bot?

crimson vapor
#

language?

knotty stirrup
waxen snow
#

Like this

#

The playing status

knotty stirrup
#

yes but what language? py, js?

crimson vapor
#

yes what language?

waxen snow
#

English

stark abyss
knotty stirrup
#

no what coding language

waxen snow
#

Here

knotty stirrup
#

are you using js or py

waxen snow
#

I'm using glitch

knotty stirrup
#

im asking what language you are using

waxen snow
#

Ok wait

#

discord.js

knotty stirrup
#

ok

lusty quest
#

i wonder how many people just went in here and facepalmed really hard

narrow fractal
#

owo

waxen snow
#

It says discord.js

cinder patio
#

๐Ÿ‘๏ธ ๐Ÿ‘„ ๐Ÿ‘๏ธ

waxen snow
#

If your on android

knotty stirrup
cinder patio
#

What do you mean by access? Like, read them?

narrow fractal
#

ah js

crimson vapor
narrow fractal
#

lmao

cinder patio
#

What language are you using? If you are using js you can read them programically via fs.readFile

knotty stirrup
narrow fractal
#

....

cinder patio
#

I don't think there's a difference

waxen snow
cinder patio
#

yeah

#

You're hosting on glitch, right?

#

Then you should whitelist all ips in your mognodb atlas admin panel

#

Glitch apis rotate very often

#

So it's better to just allow all IPs

#

But make sure set a strong username and password in that case

#

mongodb atlas

#

search it up

#

You have the current IP, but that IP will change very soon, and you'll have to get the new IP and then whitelist it

earnest phoenix
#

Hey, I have a error:
TypeError: event.bind is not a function
at /app/index.js:17:41
at Array.forEach (<anonymous>)
at /app/index.js:15:40
at Array.forEach (<anonymous>)
at Object.<anonymous> (/app/index.js:14:28)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)

umbral zealot
#

you're trying to bind to something that's not a function

earnest phoenix
#

My index:

const fs = require('fs');
const Discord = require('discord.js');
const client = new Discord.Client({ partials: ['MESSAGE', 'REACTION'] });
Discord.Constants.DefaultOptions.ws.properties.$browser = "Discord Android"

client.commands = new Discord.Collection();
fs.readdirSync('./Commands').forEach(folder => {
  fs.readdirSync(`./Commands/${folder}`).forEach(file => {
    const command = require(`./Commands/${folder}/${file}`);
    client.commands.set(command.name, command);
  });
});

fs.readdirSync('./Events').forEach(folder => {
  fs.readdirSync(`./Events/${folder}`).forEach(file => {
    const event = require(`./Events/${folder}/${file}`);
    client.on(file.split('.')[0], event.bind(null, client));
  });
});

client.login(process.env.token);
umbral zealot
#

one of your event files is not like the others

earnest phoenix
#

yes

#

I create a event guild logs

#

but after this, error

umbral zealot
#

"guild logs"?

cinder patio
#

It most likely doesn't export a function

umbral zealot
#

what is the file name, and can you show us the contents?

earnest phoenix
cinder patio
#

show us the code inside the file

umbral zealot
#

So you mean guildCreate

earnest phoenix
#

I don't finished but wait

#

yes

waxen snow
#

Now I can do custom status :D

earnest phoenix
#
const Discord = require('discord.js');
const { MessageEmbed } = require('discord.js');
const client = new Discord.Client();
const logsChannel = '815953311614107709';

client.on('guildCreate', (guild) => {
  client.channels.cache.get(logsChannel).send(
  new MessageEmbed()
    .setTitle(`Omg, chuis arrivรฉ sur un nouveau serveur !`)
    .addField(`Serveur`, `${guild.name}`)
    .addField(`C`)
  )
})




client.on('guildDelete', (guild) => {
  
})
#

its my guildlogs.js

#

I put this in events message

#

with message.js

cinder patio
#

you don't export a function

waxen snow
#

This how I do my custom status

client.on("ready", () =>{
console.log(Logged in as ${client.user.tag}!);
client.user.setPresence({
status: "online", //You can show online, idle....
game: {
name: "Using !help", //The message shown
type: "STREAMING" //PLAYING: WATCHING: LISTENING: STREAMING:
}
});
});

cinder patio
#

looks like you don't understand how your own command handler works

umbral zealot
waxen snow
#

Going to add more Commands

#

For the bot

umbral zealot
#

This is a "one of these things is not like the others" sort of deal. you can't just invent a new bot inside a file, you need to follow the structure you yourself defined in your own command handler.

earnest phoenix
#

oh

#

its good

#

i added module exports and done

umbral zealot
#

ok but oyu can't just add module.exports

#

the format needs to be the same

#

you can't create a new client in here

old cliff
#

can you show us any of your other events ?

#

or just make that event like the others

#

I hope you know how those work

waxen snow
#

Now this is coding

umbral zealot
#

That's nice, dear.

misty sigil
#

thatโ€™s cool

old cliff
#

nice I can already imagine your token getting leaked

#

storing tokens in a .json file on glitch

misty sigil
#

its prob a private thing

old cliff
#

nah I am 95% sure its public

umbral zealot
#

glitch doesn't have private code unless you pay for it

misty sigil
#

oh wait

old cliff
#

yes

misty sigil
#

thatโ€™s a change

umbral zealot
#

and no one is stupid enough to pay for glitch

misty sigil
#

I know a few people...

umbral zealot
#

That would pay for glitch instead of just buying a full VPS?

misty sigil
#

yes

umbral zealot
#

sad.

misty sigil
#

someone said they pay for glitch in this channel

#

I remember that

old cliff
#

weird

misty sigil
#

how much is glitch per month

umbral zealot
#

Isn't it like $17USD/month

umbral zealot
#

something horribly expensive and definitely not worth it for such a crappy service.

misty sigil
pale vessel
#

I remember

old cliff
#

this

misty sigil
#

I pay less than that for a vps infinitely better than glitch

umbral zealot
#

I remember paying $3.50/month on OVH and I had enough power for 4 bots and 2 websites on there kekface

old cliff
#

great

cinder patio
umbral zealot
#

it is, and it's free.

cinder patio
#

glitch is fine for small utility sites

static trench
solemn latch
#

honestly, repl has some good upgrade routes for paid options

#

I think a pretty large bot(non music ofc) could be on repl for a ton of servers.

#

this is english only

worldly heron
#

And bot that doesnโ€™t do any weird processing you donโ€™t need a lot of power

umbral zealot
#

this is a channel for programming

worldly heron
#

For many servers

umbral zealot
#

go somewhere else if you want to learn to speak

#

maybe go read that for situational awareness.

blissful coral
#

Ok

marble juniper
#

oh and I applied for github student so if I get accepted I will get 6 months ontop of that

#

lol

#

I don't have a vps atm

#

at least not any server I own

#

so

#

yeah

#

lol

#

but please never pay for something like glitch its stupid and a waste of money (not directly directed to u)

#

I think there is a list of some good hosting providers somewhere in here

restive furnace
#

pins

tawny cosmos
#

Of course not I'm on the phone with Google that I've been hacked prior previously now today and due to our issues that we are currently having on the platform here recently is out of retaliation of honesty so I'm on the phone with Motorola regarding my phone because it's majorly tripping and I'm on the phone with Google as well letting them know that they need to do a major research on this situation with the cyber bullying and hacking because it has basically affected the platform on aggressive level and my devices costing me money and no one has done anything I mean I was the only one that was getting punished and it was like favoritism was given to him gratefully so I got approach this on another level excuse my pronunciation or what not but this is for the safety of staff and the well-being of others on this platform including mines so I will be online here maintaining my position and doing my best to get through with Motorola regarding my phone Samsung and Google so we can get to the other platforms communication this is a major issue

static trench
#

i have heard a lot about "github hosting" is it hosting your code or is it just making sure there are no errors?

umbral zealot
copper cradle
#

cuz it does

umbral zealot
umbral zealot
#

Github Pages = static html page hosting

#

Github = code hosting and versioning

static trench
#

ya

umbral zealot
#

Github Actions: CI/CD automation for code checking and testing.

static trench
#

thay makes sense

haughty mirage
#

long story short, github doesnt provide hosting services for running scripts?

static trench
#

ya

#

that was my question

#

thanks

umbral zealot
#

github isn't a VPS, no.

marble juniper
#

github does not compute your code
it only stores it

#

essentially

#

lol

static trench
#

ya

#

and thank god for that

#

i have had a few close calls lol

marble juniper
#

my problem with hosting providers often is just the fact it has too little ram to run my bot

#

lol

#

most just provide too little ram for "too much"

#

my bot takes up a gigabyte at least even when optimized and digital ocean for example gives 1gb ram at 5$

#

pain

cinder patio
#

DigitalOcean is expensive

marble juniper
#

true

#

but like

#

aaa

#

other hosting providers don't give much ram either you know

solemn latch
#

$3 1gb, or 2gb at $5 gg ;p

marble juniper
#

I need at least 2gb and 4gb for it to be somewhat future proof

#

lol

solemn latch
#

4gb is what $8

#

yeah

marble juniper
#

lol

#

yeh

#

im happy a certain friend lets me use thier dedicated server with like more than 64gb ram for my bot available lol

#

ngl

lusty quest
#

just get a proper server that is not a vps. sure they are a bit more expensive, but if you get a decent host you have a way better price / performance than a VPS with the same specs

earnest phoenix
#

$help

solemn latch
marble juniper
#

yeah atm I can use a dedi of a certain friend

#

for free

#

which is kinda pog

solemn latch
#

leeching not pog

marble juniper
#

but yeah

misty sigil
#

ravys dedis go brr

solemn latch
#

wrong channel

marble juniper
#

lol

marble juniper
#

bruh

#

only gonna make it a stove in the data center

#

actually im not gonna buy a vps anytime soon

#

im getting a raspberry pi 4 atm

lusty quest
#

here as comparison: Digital Ocean compute optimized VPS with 2Cores and 4GB ram goes for 40โ‚ฌ/Month, for 55โ‚ฌ/Month i can get a Root Server with 6 Cores / 12 Threads and 64GB ram

marble juniper
#

the 8gb model

#

lol

solemn latch
#

๐Ÿ‘€

marble juniper
#

should be enough ig

solemn latch
#

digitalocean overcharges

marble juniper
#

the raspberry pi 4 has not so fast cpu speeds

#

buuuut

#

it works ig

lusty quest
#

you can overclock the RPI but you should use an Active cooler

#

i saw people running it at 1.4Ghz

marble juniper
#

lol

marble juniper
#

I mean if I used the raspberry pi 4 then probably not for my kind of bot

#

maybe just a casual bot

#

like idk simple moderation bot or something

lusty quest
#

to be fair they have better pricing than Google and Amazon, they have such a stupid pricing model that will cause people go bancrupt

cosmic forum
#

Hi, I'm trying to get the value from a json object.

{
  "id" : "b2732392fae140c3b836a066c6debd8f",
  "name" : "Minecraft",
  "properties" : [ {
    "name" : "textures",
    "value" : "ewogICJ0aW1lc3RhbXAiIDogMTYxNDYxNDkwOTEyMywKICAicHJvZmlsZUlkIiA6ICJiMjczMjM5MmZhZTE0MGMzYjgzNmEwNjZjNmRlYmQ4ZiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNaW5lY3JhZnQiLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzZhYzIzNDZmMjM0YWE4MjRmMzU1NjhiYTZhN2U2NWE4ZWU0ODk4MmFmZmE2MWIwYTE2YTkyZWE0ZTA0MzRlYiIKICAgIH0sCiAgICAiQ0FQRSIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTUzY2FjOGI3NzlmZTQxMzgzZTY3NWVlMmI4NjA3MWE3MTY1OGYyMTgwZjU2ZmJjZThhYTMxNWVhNzBlMmVkNiIKICAgIH0KICB9Cn0="
  } ]
}

I tried to get it using jsonfile.properties.value, but it shows up as undefined. What am I doing wrong?

marble juniper
#

because

#

properties is an array

lusty quest
#

like someone wrote a Webpage to calculate what a google will cost you

cosmic forum
slender thistle
#

properties[0].value

cosmic forum
#

ah ok

#

thx

marble juniper
#

this

#

lol

solemn latch
#

is the DO compute optimized VPS

#

the whole core

marble juniper
#

I mean

solemn latch
#

or is it shared still

marble juniper
#

its perfect for me to use a raspberry pi 4

#

I have gigabit ethernet

#

lol

marble juniper
solemn latch
#

its still against most ISP's to do server stuff from home internet sad

marble juniper
#

rly

#

I mean if I get the internet then why can't I use it

#

to its fullest

#

lol

solemn latch
#

they have business plans for that

restive furnace
solemn latch
#

when you pay for a home plan its just for home stuff ๐Ÿ‘€

marble juniper
#

it shouldn't be a problem to just run a raspberry pi 4 on ethernet the whole time

#

isn't it

solemn latch
#

i mean they wont do anything

lusty quest
marble juniper
#

yeah

#

they wont

lusty quest
#

and its not shared

marble juniper
#

lol

restive furnace
#

so it's dedicated but it can be shared but its dedicated?

lusty quest
#

?

restive furnace
#

according to you

lusty quest
#

you miss some context i guess

restive furnace
#

yes i do

#

as always

solemn latch
#

like galaxygate, when you get a compute plan its not shared, you can max it 24/7 and they wont complain.

#

other plans its you can max it for a day or two before they will even consider complaining

lusty quest
#

ive talked earlyer about it and said out of my own experience that DO offers a Compute Optimized VPS for 40โ‚ฌ/Month ( 2 Cores/ 4GB Ram) and a dedicated root server goes for about 55โ‚ฌ/month (6c/12T 64GB Ram)

#

and the compute optimized VPS is still shared

#

the only difference between a normal and a Compute optimized VPS is the clockspeed i guess

solemn latch
#

I hate the way this is being compared ๐Ÿ‘€

lusty quest
#

i know that the normal VPS ive got there where running at 1.6GHz

solemn latch
#

ghz means almost nothing in server hardware imo

lusty quest
#

my root server got a 3.6Ghz base clock and 4.2GHz boost.
also it does for certain stuff, like rendering and Tensorflow

#

and other stuff that is Compute Intense

marble juniper
#

lol

lusty quest
#

like there are 2 ways to solve a compute bottleneck

  1. Throw a shitton of cores on it
  2. have fewer but faster cores
    Most datacenters go for more cores bcs of more efficent use of the space they have
#

like they can provision way more stuff running on a single machine if you have a ton of cores

solemn latch
#

nice

#

so, got a development question?

fast nacelle
#

@everyone

solemn latch
#

you know it doesnt tag

earnest phoenix
#

She post that in every channel

lyric mountain
#

fun-fact: it does for some people

solemn latch
#

lol

#

everyone tag is disabled, only way itll tag is if you enable tag for every message right?

#

๐Ÿ‘€

lyric mountain
#

idk, it's a weird thing about discord

#

some people do get tagged, some not

solemn latch
#

interesting.

lyric mountain
#

it's discord after all

earnest phoenix
#

Hey

#

I made a event from when my bot joins a server, I have informations to the server in channel, but not works and I have any errors in the console

#

My code:

const Discord = require('discord.js');
const { MessageEmbed } = require('discord.js');
const client = require('../../index')
const logsChannel = '815953311614107709';

module.exports = async (client, args, message) => {
  console.log('b')
client.on('guildCreate', (guild) => {
  client.channels.cache.get(logsChannel).send(
  new MessageEmbed()
    .setTitle(`Omg, je suis arrivรฉ sur un nouveau serveur !`)
    .addField(`Serveur`, `${guild.name}`)
    .addField(`Fondateur`, `${guild.owner}`)
    .addField(`Nombre de membres`, `${guild.memberCount} membres`)
    .setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
    .setTimestamp()
    .setColor('GREEN')
  )
})




client.on('guildDelete', (guild) => {
  client.channels.cache.get(logsChannel).send(
  new MessageEmbed()
    .setTitle(`Oh nan, je viens de quitter un serveur :/`)
    .addField(`Serveur`, `${guild.name}`)
    .addField(`Fondateur`, `${guild.owner}`)
    .addField(`Nombre de membres`, `${guild.memberCount} membres`)
    .setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
    .setTimestamp()
    .setColor('RED')
  )
})
}
umbral zealot
#

that's still not valid

#

I guess we were talking to a wall earlier

#

when we said you shouldn't create a new client

#

or have client.on() lines inside an event

#

Or that you should look at other events and see how they're built, and use the same format

earnest phoenix
#

okay, I will test

umbral zealot
#

guildCreate.js and guildDelete.js will be the 2 files you need to create.

#

because they're separate events. you can't combine them

crimson vapor
earnest phoenix
#

oh

opal plank
#

this is obviously a joke

umbral zealot
#

guildCrate

opal plank
#

yes

#

crates

misty sigil
#

bro

#

what about guildUncrate

solemn leaf
#

checked the gateway

#

not an event sorry

cinder patio
#

I'm so fucking confused

#

ALL other endpoints work except this one

umbral zealot
#

are you sure you're not within an existing path like /api already

#

can you show other methods vs this one?

cinder patio
#

ok

#

This is my only other get route, and the difference between this one and the other one is that the path is deeper

umbral zealot
#

"deeper"?

#

You're drop-feeding us here, we need more context

#

can you widen the lens on these screenshots so we see more useful context

cinder patio
#

/api/forms/me and /api/verify

umbral zealot
#

yeah ok but what about /api/forms/create , does that work?

cinder patio
#

yup

umbral zealot
#

Is that in the same file as /api/forms/me ?

cinder patio
#

nope

umbral zealot
#

so, back to my theory: it's probably a sub-route to something else

#

but you're being extremely stingy with your context so I can't say for sure

cinder patio
#
const endpoint = require(filePath).default as IApiEndpoint;
console.log(`[Express] Route [${endpoint.method}] [${endpoint.path}] loaded!`);
app[endpoint.method](endpoint.path, endpoint.exec.bind(undefined, db, config));

This is how I load them

#

I never send a 404 status in the exec function, either

umbral zealot
#

are you... sure it's even loaded

#

like, you saved and restarted and all that jazz

cinder patio
#

definitely

#

hmm.. where exactly are all routes stored in express? I could console log that

umbral zealot
#

apparently, app._router.stack

#

Assuming it's express() and not express.Router()

cinder patio
#

Actually I think I know what's wrong...

#

I have a /api/forms/me route.... and a /api/forms/:id route... ๐Ÿคฆ

#

Sorry for wasting your time with my stupidity lmao

woven plume
#

i add a bot

#

and he isnt in the thing to invite

olive roost
#

hey im using discord.py and i was wondering how to add a currency system (like dank memer has dank memer coins). how would i do this?

slender thistle
#

A database + caching system attached to the bot object

olive roost
#

maybe a link?

slender thistle
#

Give me a minute

olive roost
#

ok

#

thanks

slender thistle
#

Oh fuck it there's nothing on Google

lusty quest
#

wait someone who not instantly ask for code for such stuff. i have hope into humanity again (atleast for the next 40 Minutes)

olive roost
#

also i have a question more specifically directed to the mods: i want to get my bot approved by top.gg, but my mom blocks my computer 2 hours after school so i cant keep it online enough to get it tested by the mods. what do i do?

slender thistle
#

I'll try to break the general idea down

slender thistle
#

@sinful belfry slurs

misty sigil
#

wtf did they say

slender thistle
#

In multiple channels also

#

if you need help with translations please tell me I'll be writing a paragraph in the meantime

olive roost
#

hold on let me put that in google translate

misty sigil
#

sHIIV WHAT DID THEY SAAY

cinder patio
#

You can translate it yourself

sinful belfry
misty sigil
#

but that takes work

olive roost
misty sigil
#

and might not be accurate

lyric mountain
#

I expected worse ngl

slender thistle
#

"Your chat is shit" is the implication

#

nah it gets worse in their previous messages

lyric mountain
#

Fuke?

misty sigil
#

i wanna know now

lusty quest
#

well he is gone together with the messages

rocky hearth
#

for tsconfig, I want to include src but exclude src/engine. How do I do that?

#

Its not working

lusty quest
#

add a wildcard?

rocky hearth
#

how?

lusty quest
cinder patio
#

hmmm that should work though

lusty quest
#

restart the IDE

#

helps sometimes

cinder patio
#

yea

olive roost
#

@slender thistle i looked it up on google but all i can find are people telling me to use json, but i dont know where to get json

rocky hearth
#

I did, but still, I'm getting type suggestions, auto imports from engine folder

lusty quest
#

learn how to use a database like: Mysql, SQLite, Postgres, Mongodb. there are many more but these are some of the more popular ones

cinder patio
#

Stry ./src/engine

cinder patio
#

thought I doubt that would do anything

olive roost
#

but SQlite needed a download and i dont have the parental access code

lusty quest
lusty quest
#

MongoDB Atlas is offering a free Database

olive roost
#

ok i'll look into mongodb

slender thistle
#

@olive roost
First question:
The best and probably most efficient way to create a currency system is by using some sort of a database (like PostgreSQL or MongoDB). On top of that, you'd want to keep user currency in your memory, like a dictionary attached to your bot/client object. There are two ways to go about this:

  1. If you want to keep currency per-guild, you need to have a dictionary that has guild ID as the key and in its value, there will be another dictionary. Now, that dictionary will be similar to a format like user_id: currency;
  2. If you just generally want to keep the currency global, having a dictionary that follows a format of user_id: currency is enough to work with.

Once that's in place, you now need to handle stuff like user not being in the dictionary, and making sure that proper calculations are done in your commands. You very possibly want to keep your database as up-to-date as possible, so on each command usage, you need to work with the cache system AND editing the user's data in your database.

grizzled raven
lusty quest
#

also listen to what Shivaco say, he knows what he does

olive roost
#

ok im looking into mongo

rocky hearth
olive roost
#

@slender thistle im gonna dm you for future reference if i need help

#

ok i need help

slender thistle
#

A simple example if you want to do a global currency system:

bot.currency = {}

@bot.command()
async def some_gambling_command(ctx, ...):
    user_currency = bot.currency.get(ctx.author.id) # gets the user's currency OR returns None by default
    if user_currency is None:
        # set user_currency to 0 and add ctx.author.id to the bot.currency dictionary
    # command stuff

    # after the command is done, you now basically save the user's currency in a database, or edit it if there's an existing entry for ctx.author.id already
olive roost
#

whats a "cluster"

#

?

slender thistle
#

Under what context?

olive roost
#

like on mongodb

lusty quest
#

a MongoDB cluster are 3 Servers that hold the data in parity

olive roost
#

i clicked the only free option

lusty quest
#

if one server goes down you wont loose access to your database

olive roost
#

and it came up with "cluster"

#

ok

lusty quest
#

yea thats normal

olive roost
#

so what do i do now

lusty quest
#

by default you get a Replicaset

olive roost
#

?

lusty quest
#

i guess read the docs

slender thistle
#

Atlas, eh

lusty quest
#

or find some good tutorial in how to use it

lusty quest
#

also they are quite Expensive

slender thistle
#

I mean, I started with a self-hosted database right away so I'm not familiar with Atlas KEKW

lusty quest
#

like the Paid tier that gives you access to all MongoDB querys cost 60$/month

lusty quest
slender thistle
#

How was it?

lusty quest
#

well ive needed access to check if entries are older than x, looked up what tier i need, and noticed after 3 weeks that they will charge me 40$ after 3 weeks

#

so ive rented a 5$ VPS and run my Database on there

slender thistle
#

Geez

#

Guess that's their own way of telling people to host their own stuff

lusty quest
#

funny is they just use Azure, AWS or Google for hosting the DBs

slender thistle
lusty quest
#

and since they give you a replica set of 3 Servers you have to pay for 3

slender thistle
#

oof

#

Yeah, makes sense though

lusty quest
#

i think about running a replica set in 3 docker container for having some better I/O Distibution

earnest phoenix
#

lmao i just use a lot of json files stored in folders named with the guild ids

lusty quest
#

have fun with corrupted files

severe pike
earnest phoenix
severe pike
#

how do i put something in this gap? i tried :

<h2 class="styles__StyledDiv-sc-1qvyf7s-0 bqAvgD vm-placement ad-placement" HELLO EVERYONE<h2>
slender thistle
#

You can't really put anything there via HTML

severe pike
slender thistle
#

You can go the hacky wacky way probably with CSS but that's gonna be a pain to accomplish

earnest phoenix
lyric mountain
#

CSS + negative margin

lusty quest
earnest phoenix
severe pike
earnest phoenix
slender thistle
#

It's a small workaround but it might help

earnest phoenix
severe pike
#

okai

earnest phoenix
#

there i sent dm

lusty quest
# earnest phoenix hmmm idk it seems really fast but idk. ill change when i have issues

this is how you pay with your mental health, you will end up with your entire system breaking down bcs some crackhead on some random server found a way to cause your bot to just write and read with insane rates from the files, causing you to stay all night up, finding a quick and easy way to migrate ASAP to a proper Database. in the End you sit at 5 in the morning infront of your pc with a Mental breakdown bcs you lost 15000 Datasets with no way of bringing them back, since your bot will become probably unresponsive many people will kick the bot, causing it to rapidly decline in the userbase, this could end up with you getting frustrated and maybe in the end giving up on it.

so DONT use Json as a Database

lyric mountain
#

when you face issues, it's already too late

lusty quest
#

tbh i know a guy who probably would Brick the bot within a day

spring tartan
#

how do i mention the sender of the message with python?

slender thistle
#

Commands extension or on_message?

lusty quest
#

he managed to DDos my bot for fun, using a API my bot uses

lyric mountain
#

it's just a single wrong character, a dangling file terminator

lyric mountain
#

and all your data

#

is gone

#

forever, 0% retrieval

earnest phoenix
lyric mountain
#

you open your json database and face [object Object]

severe pike
#

We used to use text files, until the god himself smadger came along

#

database > txt files

slender thistle
#

JSON files = configuration

#

Databases = dynamic data

#

They don't exactly work well the other way around

earnest phoenix
#

lol whelp imma keep doing it the wrong way ๐Ÿ’…

lyric mountain
#

to each one their own

#

ยฏ_(ใƒ„)_/ยฏ

lusty quest
#

humans are stupid, they learn the fastest way with pain

tight nimbus
earnest phoenix
#

whelp ive done it all "wrong" so far and have had no issues

earnest phoenix
#

so to each his own

lusty quest
#

doing it wrong doesnt mean it wont work, it will just bite you into your own ass one day

lyric mountain
#

you can live a whole life with it

#

without noticing nothing wrong

#

then suddenly: you're ded

earnest phoenix
#

whelp to each his own

lyric mountain
#

spend a few hours now to save thousands later

earnest phoenix
#

now stfu outta my development when i never asked for help

cinder patio
severe pike
earnest phoenix
viral mortar
lusty quest
#

if he ever gets to work on a coporate system he will have fun, if he has to explain to his boss why he just lost the Data for all Customers, ongoing projects and other stuff

severe pike
viral mortar
#

oh...

cinder patio
lusty quest
#

afraid of getting its data corrupted

earnest phoenix
#

the .me object wasnt returning from a guild and it was fcking everything up

#

Hey, I have a error, someone can help me? ๐Ÿ˜„
My code:

const fs = require('fs');
const Discord = require('discord.js');
const client = new Discord.Client({ partials: ['MESSAGE', 'REACTION'] });
const logsChannel = client.channels.cache.find(channel => channel.id === 815953311614107709)
Discord.Constants.DefaultOptions.ws.properties.$browser = "Discord Android"

client.commands = new Discord.Collection();
fs.readdirSync('./Commands').forEach(folder => {
  fs.readdirSync(`./Commands/${folder}`).forEach(file => {
    const command = require(`./Commands/${folder}/${file}`);
    client.commands.set(command.name, command);
  });
});

fs.readdirSync('./Events').forEach(folder => {
  fs.readdirSync(`./Events/${folder}`).forEach(file => {
    const event = require(`./Events/${folder}/${file}`);
    client.on(file.split('.')[0], event.bind(null, client));
  });
});

client.on('guildCreate', guild => {
  console.log("Joined a new guild: " + guild.name);
const joinEmbed = new Discord.MessageEmbed()
    .setTitle(`Omg, je suis arrivรฉ sur un nouveau serveur !`)
    .addField(`Serveur`, `${guild.name}`)
    .addField(`Fondateur`, `${guild.owner}`)
    .addField(`Nombre de membres`, `${guild.memberCount} membres`)
    .setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
    .setTimestamp()
    .setColor('GREEN')
    logsChannel.send(joinEmbed);
})




client.on('guildDelete', guild => {
  console.log("Left a guild: " + guild.name);
const leaveEmbed = new Discord.MessageEmbed()
    .setTitle(`Oh nan, je viens de quitter un serveur :/`)
    .addField(`Serveur`, `${guild.name}`)
    .addField(`Fondateur`, `${guild.owner}`)
    .addField(`Nombre de membres`, `${guild.memberCount} membres`)
    .setFooter(`Je suis actuellement sur ${client.guilds.cache.size} serveurs !`)
    .setTimestamp()
    .setColor('RED')
    logsChannel.send(leaveEmbed);
})

client.login(process.env.token);
#
(node:3601) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
at Client.<anonymous> (/app/index.js:32:17)
    at Client.emit (events.js:315:20)
    at Object.module.exports [as GUILD_CREATE] (/app/node_modules/discord.js/src/client/websocket/handlers/GUILD_CREATE.js:33:14)
    at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/app/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage (/app/node_modules/ws/lib/websocket.js:825:20)
    at Receiver.emit (events.js:315:20)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3601) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3601) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

My error

umbral zealot
earnest phoenix
#

So I need to deplace it?

#

or replace const to let?

pallid quail
#

client.on('ready', ... tells you when the client is set up, don't read any properties from it until you get that event

earnest phoenix
#

its on my index.js

umbral zealot
#

I feel like you're not understanding the actual problem at hand here ,which is about scopes

earnest phoenix
#

I'm french I don't understand english at 100% O_O

umbral zealot
#

you really should have a decent understanding of javascript before trying to write bots. Youre knowledge is clearly... lacking.

earnest phoenix
#

:/

umbral zealot
#

your written and spoken language aren't the problem here.

earnest phoenix
#

but

#

...

#

I juste asked helping

#

no need to denigrate me :/

solemn latch
#

Thats not whats happening, the facts are you must spend time learning javascript before making a bot to do it properly.

earnest phoenix
#

I want to make a bot and learning time with time

#

:/

#

I know i'm not a pro

#

I'm a noob in js but I'm learning everyday

cinder patio
#

A discord bot is a project for people who already know javascript

#

If you really wanna learn, you should start working on small projects that tackle different programming concepts first - a calculator, a simple web form, a file reader