#development

1 messages · Page 862 of 1

clever storm
#

You can only fetch chyannels you can see

#

pretty sure

crimson vapor
#

you can delete the .git folder iirc

valid gyro
#

i want to keep the files locally tho

quartz kindle
#

@clever storm anyway, you said the shard wouldnt read user from the promise, was it throwing a user is not defined error? if so, it was because of that console.log

clever storm
#

No its nopt lmao

#

the console log is ireelevent

crimson vapor
#

ok C0bra why are you boadcasting it when you can just fetch the channel?

quartz kindle
#

its not irrelevant

clever storm
#

i added that just now, was throwing before

#

yes it is lmao

#

the error is in the description

quartz kindle
#

now you say it?

clever storm
#

where i used user

#

I said this before lmao

quartz kindle
#

you showed a piece of code, i looked at the piece of code, and told you whats wrong with it

valid gyro
#

would i use rm -rf .git

quartz kindle
#

if you neither specified exactly what the error was, nor provided the correct piece of code, thats not my fault

valid gyro
#

in the directory im working with

clever storm
#

I did provide what and where it was lmao

#

right here

#

Either way its literally the same thing

crimson vapor
#

Cobra why are you not just fetching the channel?

clever storm
#

the var isnt defined in either place

#

@crimson vapor Do you know how brodcast eval works?

crimson vapor
#

yes.

clever storm
#

you cant send to a channel off shard

low wasp
#

ur not even defining user in the broadcastEval

tulip wave
#

^

clever storm
#

im aware

low wasp
#

then define it

clever storm
#

Lmfao this is my ENTIRE question

crimson vapor
#

what?

clever storm
#

if the promise is outside the eval, user isnt defined inside the eval. If my promise is inside the eval, it care read vote

#

So one of the values is always undefined in the evaled code

crimson vapor
#

ok I am confused atm, why are you even evaling?

tulip wave
#

May I suggest using async and await

#

That way you can await the values and get both things to be defined inside the eval

crimson vapor
#
dbl.webhook.on('vote', async vote => {
    const user = await client.users.fetch(`${vote.user}`);
    const voteLogs = await client.channels.fetch("693204858068664491");

    const embed = new Discord.MessageEmbed()
        .setAuthor('New Vote!', client.user.avatarURL())
        .setDescription(`\`${user.username}#${user.discriminator}\``)
        .setColor(0x2F3136)
        .setTimestamp().toJSON();

    if (voteLogs) voteLogs.send(embed);
});``` iirc this code should work the exact same way
#

or should do the same thing*

clever storm
#

You cant send msgs to channels off shard

#

That's the whole purpose of brocastEval here

barren swallow
#

What doe this mean?
(node:7102) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 guildMembersChunk listeners added. Use emitter.setMaxListeners() to increase limit

bot wont start

clever storm
#

@barren swallow LMAO

knotty steeple
#

do you have 11 guildmember events

low wasp
#

Use a webhook then

knotty steeple
barren swallow
#

@clever storm what?

clever storm
#

Just funny were here at the same time

barren swallow
#

😄

quartz kindle
#
client.users.fetch(vote.user).then((user) => {
    client.shard.broadcastEval(`
        const user = "${user.tag}"
        const voteLogs = this.channels.cache.get('693204858068664491')
        if (voteLogs) {
            let embed = new Discord.MessageEmbed()
                .setAuthor('New Vote!', client.user.avatarURL())
                .setDescription(user)
                .setColor(0x2F3136)
                .setTimestamp()
            voteLogs.send(embed)
        }
    `)
})
``` i would do it like this
barren swallow
#

my bot will not start

tulip wave
#

@clever storm try using a webhook that way you won't have issues sending a message off shard

clever storm
#

That an option, not ideal however

#

but definetly an option

clever storm
#

@quartz kindle This seems like it would work, lemme try

tulip wave
#

@barren swallow you got a possible memory leak

barren swallow
#

how do I fix?

tulip wave
#

You gotta check your code

quartz kindle
#

@barren swallow are you using guild.fetchMembers / guild.members.fetch() anywhere?

barren swallow
#

ye

quartz kindle
#

whats your discord.js version?

barren swallow
#

v12

quartz kindle
#

show your code

barren swallow
#
 client.guilds.cache.map(async (guild) => {
    await client.checkGuild(guild);
    await guild.members.fetch();
  });
#

ready.js

quartz kindle
#

no

#

dont do that

barren swallow
#

ok 😄

quartz kindle
#

if you have 500 guilds, that code is creating guild.members.fetch() 500 times at once

crimson vapor
#

doesnt discord.js already do that?

tulip wave
#

d.js does cache all the guilds

crimson vapor
#

but not the users?

quartz kindle
#

if you want to fetch all members, use the client option instead

tulip wave
#

although that's not recommended

quartz kindle
#

new Discord.Client({fetchAllMembers: true})

barren swallow
#

i dont really need it anyway

tulip wave
#

@crimson vapor if it caches online users / users who send messages as far as I'm aware

barren swallow
#

bot still wont start

quartz kindle
#

any error?

crimson vapor
#

oh

spice pier
#

Discord is dying so if your bot can't connect wait a couple of minutes and try again

barren swallow
#

it started

#

nvm just took awhile

tulip wave
#

Oh yeah discord is dying rn some servers are having an outage rn

barren swallow
#

oh k

quartz kindle
#

when does discord not die

tulip wave
#

True

valid gyro
#

got it up on heroku, only for it to crash 10 mins later, can anyone help me understand these errors?

#

2020-04-10T23:01:11.989353+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=dragon-aid.herokuapp.com request_id=4f87dc23-e1df-4511-8e33-109bf2018eab fwd="99.50.195.102" dyno= connect= service= status=503 bytes= protocol=https
2020-04-10T23:01:12.400368+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=dragon-aid.herokuapp.com request_id=7e491281-92a7-4dd9-97d2-19e127a22421 fwd="99.50.195.102" dyno= connect= service= status=503 bytes= protocol=https

quartz kindle
#

that log doesnt contain any relevant information

hoary elm
#

Status 503 is unavailable isn't it?

quartz kindle
#

ye

hoary elm
#

So that's a site issue

amber fractal
#

It's because heroku was made for websites

#

not bots

valid gyro
#

so not my fault

quartz kindle
#

but that error is refering to itself, its own status

amber fractal
#

You use them don't you? Use services for what they're made for

hoary elm
#

Oh, makes sense

valid gyro
#

so do i just push it again?

quartz kindle
#

you need to find the relevant logs

#

the actual error that crashed the bot is not there

valid gyro
#

thats the only 2 things that came up in the logs

#

after the state change messge

quartz kindle
#

what about before the state change

valid gyro
#

just the bot logging in succesfully

#

the entire log off the app

#

2020-04-10T22:55:47.333018+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-10T22:55:47.336241+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-10T22:55:52.340267+00:00 app[web.1]:
2020-04-10T22:55:52.340282+00:00 app[web.1]: > thegreatdiscorddanddbotproject@1.0.0 start /app
2020-04-10T22:55:52.340283+00:00 app[web.1]: > node index.js
2020-04-10T22:55:52.340283+00:00 app[web.1]:
2020-04-10T22:55:53.037829+00:00 app[web.1]: Logged in as Dragon Aid#3458!
2020-04-10T22:56:50.900834+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-10T23:01:11.989353+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=dragon-aid.herokuapp.com request_id=4f87dc23-e1df-4511-8e33-109bf2018eab fwd="99.50.195.102" dyno= connect= service= status=503 bytes= protocol=https
2020-04-10T23:01:12.400368+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=dragon-aid.herokuapp.com request_id=7e491281-92a7-4dd9-97d2-19e127a22421 fwd="99.50.195.102" dyno= connect= service= status=503 bytes= protocol=https

spice pier
#

Show your procfile

valid gyro
spice pier
#

app[web.1]:

#

you did something wrong

#

¯_(ツ)_/¯

heavy marsh
#

In discord.js v11 how can I check if there is a catagory with this name logs?

valid gyro
#

Wouldnt it have crashed befor starting if it was something in my code

amber fractal
#

Yes, category is a channel type

valid gyro
#

there were no inputs while it was up either

quartz kindle
#

.find(channel => channel.name === "logs" && channel.type === "category")

#

@valid gyro show your code

amber fractal
#

is it not all in the github?

valid gyro
#

its all on the github

quartz kindle
#

i didnt even check his github lmao nvm

valid gyro
#

except for the .env file ofc

#

and before i heroku'd it, it was running perfectly locally

spice pier
#

can you try running heroku local and see if it runs locally

valid gyro
#

yup

#

runs locally

spice pier
#

Do you have the buildpack set to nodejs on the dashboard?

quartz kindle
#

try removing the dependencies you dont use, such as git, node-fetch and axios, also try downgrading node to v12 in engines and remove npm from there

#

and do what noctember said

valid gyro
#

@spice pier yes

#

Just remove them from the package?

#

yeah those are there from when i was trying different api modules

#

alright after changing that it logged itself in again,

#

o

#

crashed again!

#

like every time i say it starts workin it decides to crash

#

@quartz kindle if i downgrade node versions wont i have to change a bunch of syntax?

#

no errors for this crash yet, is there a site like heroku thats specifically or discord bots?

#

i think ill try glitch and see if that works any better

elder vine
#

What's the issue?

valid gyro
#

heroku was being dumb

#

in the short at least

zinc condor
#

how do i get all guilds the bot is in

#

and all users combined that the bot can see in all guilds

#

on discord.js

elder vine
#

What?

earnest phoenix
#

Nani

elder vine
#

djs version?

zinc condor
#

12

elder vine
#

client.guilds.cache.size

#

I think

earnest phoenix
#

@zinc condor u want to know how to get all the server your bot is in

#

If so then it's what leny32 said

zinc condor
#

i need to get all the members in all the guilds as a count combined too

earnest phoenix
#

client.guilds.cache.uses.size I think

quartz kindle
#

client.guilds.cache.reduce((a,b) => a + b.memberCount, 0)

earnest phoenix
#

Check the discord js guide

elder vine
#

and all users combined:

you should use:
let count = 0;
client.guilds.cache.forEach(guild => {
count += guild.memberCount
});
return count;

#

I don't know if I did it correctly, but you can go over it.

zinc condor
#

alright

#

thanks

elder vine
#

No problem :)

#

Oh, right - you should use Tim's code :P

earnest phoenix
#
bot.guilds.cache.forEach(guild => {
      console.log(" - " + guild.name);
    });
#

that will make it more cleaner

#

for the name of guilds

obtuse wind
#

can someone help me revert back to node.js / discord.js 11.0.0

#

12.0.0 is not working out for me

tulip wave
#

Define not working for u?

obtuse wind
#

like

#

messageEmbed is not gonna work for me

#

ever

elder vine
#

Alright

obtuse wind
#

like everytime I start my bot (normally) even with cache added to all the required lines, etc, "RichEmbed is not a constructor" and everytime I make it "MessageEmbed" with or without .type, it says "fields.flat is not a function", whilst I do not have fields.flat in my programming

elder vine
#

You can use npm install discord.js@11.0.0

tulip wave
#

@obtuse wind that's a nodejs issue

#

Update nodejs

obtuse wind
#

my nodejs is not updating from 10.9.0

#

even with nvm installed

tulip wave
#

You need at least nodejs 12 I think

elder vine
#

Weird.

obtuse wind
#

its not finding any node 12.0.0 or higher

tulip wave
#

nvm install 13

#

?

#

Or 12

elder vine
#

npm install npm@latest -g

tulip wave
#

@elder vine not npm

obtuse wind
#

lets see if that works then

copper cradle
#

when you update node change the bin location and re-add to path

obtuse wind
#

(your nvm line)

copper cradle
#

fucking fixed

tulip wave
#

It's nvm
Node version manager

elder vine
#

I can use npm -v etc. to see node version (I think) lemme check

obtuse wind
#

it says installing so I'll wait for that to finish

tulip wave
#

Ok

#

You'll also have to set the wanted node version to defualt

#

With nvm version

obtuse wind
#

will I need to restart my PC

tulip wave
#

I think

elder vine
#

You can use both nvm and npm

tulip wave
#

I don't think you will

#

On my Linux server node just installs

#

Then I can use it right away

obtuse wind
elder vine
#

What...

tulip wave
#

@obtuse wind set the version now

#

With nvm

#

I think it's nvm version 13.12.0

elder vine
#

13.12.0 is current but 12.16.2 is recommended for most users.

obtuse wind
#

i just downloaded the latest version of node

#

13.12 should work

#

but it keeps saying 10.9.0 when I do node -v

#

unless I need to restart my windows 10 desktop

#

it installed the latest NPM but not node .-.

valid gyro
#

got my bot up, should be good now. Thanks to everyone who helped me

elder vine
#

You shouldn't need to restart.

tulip wave
#

@elder vine problem is that toxic can't get nice to change versions

elder vine
#

nice?

obtuse wind
#

I did cls but clearly doesnt want to update node

earnest phoenix
#

did you restart cmd

obtuse wind
#

negative.

earnest phoenix
#

lol

obtuse wind
#

should I restart cmd

earnest phoenix
#

yes

#

whenever some changes happen to the PATH variable, the process utilizing it needs to restart to see applied changes

tulip wave
#

Oh yes windows

obtuse wind
#

still the same maybe I should restart my PC

earnest phoenix
#

uninstall your old node version

#

or change the PATH variable to include your new node version

#

restarting your PC does nothing

#

we're not in 1999 anymore

elder vine
#

Can't you just download from https://nodejs.org ?

tulip wave
#

@obtuse wind you might just need to manually install with the download

obtuse wind
#

I did download with that download 13.12.0

#

but its not updating the 10..9.0

elder vine
#

Uninstall node.js before you download?

obtuse wind
#

i did that too.

tulip wave
#

@earnest phoenix also restarting sometimes is required

#

Especially with node on windows

obtuse wind
#

here I think I know what to do

elder vine
#

You can try and do a restart.

obtuse wind
#

because my computer is actually a remote desktop

earnest phoenix
#

i've never had to restart my pc when installing a devkit/runtime/any program since 2014 lol

obtuse wind
#

I'll try going to my other PCs and doing all the same code

earnest phoenix
#

the only exceptions are drivers

elder vine
#

I've had multiple needed restarts because of such, but maybe because I download lots of shit

obtuse wind
#

I'll just restart real quick

elder vine
#

Yea, do that.

still lily
#
    if (message.content === '!new ticket'){
        message.channel.send(message.author.username + ' created a ticket.')
        message.guild.channels.create(message.author.username + ' ticket.' , {
            permissionOverwrites: [
                {
                    id: message.author.id,
                    allow: ["VIEW_CHANNEL"],

                    role: everyone,
                    deny: ["VIEW_CHANNEL"],
                }
            ],
        })
    }
});
#

im making a ticket feature

#

how do i make it so everyone cant see channel

#

discord.js btw

#

java script

elder vine
#

v?

still lily
#

?

elder vine
#

version?

#

v12?

still lily
#

i think so

#

latest one

#

idk

#

how do i find out

#

@elder vine most resent

#

v12 i think

elder vine
#

Alright

#

Let me find the docs

obtuse wind
#

it appears my restart did not work.

still lily
#

oof

elder vine
#

What?

obtuse wind
#

Its still saying 10.9.0

elder vine
#

Weird

still lily
#

@elder vine did u find doc

obtuse wind
#

i just want to update omg do I need to reset my entire goddamn computer

elder vine
#

SEND_MESSAGES: false,
READ_MESSAGES: false

still lily
#

but what about the id

#

of everyone

#

how do i get that

#

role: everyone,
deny: ["VIEW_CHANNEL"],

#

like that ^

elder vine
#
channel.overwritePermissions(role everyone, {
SEND_MESSAGES: false,
READ_MESSAGES: false
});
still lily
#

ok ill try

#

thats what i was doing tho

elder vine
#

Wait, that might have changed in v12

#

Well, I gtg - good night

still lily
#

gn

obtuse wind
#

i dont get it

#

on c:/program files/nodejs

#

it says is 13 and so does the loader but on my bot file its still 10.9.0

obtuse wind
#

and I think I forgot the way to download node 13.12.0 to my bot file .-.

fleet chasm
visual sandal
#

I need help with the widget embed.. it shows up like this on discord, but when i click on the link it shows 105 (the actual number of servers)

earnest phoenix
#

stale cache

#

add a cache breaker

#

https://url.tld?v=anything you want here

visual sandal
#

ok

obtuse wind
#

show your code @visual sandal

visual sandal
#
const sourceEmbed = send.embed()
        .setTitle(`${config.client_name}'s Source`)
        .setThumbnail(`https://i.imgur.com/oqhqt65.jpg`)
        .setImage(`https://top.gg/api/widget/662517805983334416.png`)
earnest phoenix
#

the code is irrelevant

#

it's just client cache

tulip wave
#

The web browser is saving the embed

still lily
#

so no one can view

#

but the one guy

#

its a ticket bot

#

thing

fleet chasm
#

just view the docs

obtuse wind
#

message.guild.cache.members maybe? ignore thats irrelavent.

still lily
#

@fleet chasm its not in there

elder vine
#

Kurasad are you using BetterDiscord?

earnest phoenix
#

nobody cares

elder vine
#

Against tos

visual sandal
#

no

earnest phoenix
#

again, nobody cares

tulip wave
#

@elder vine. No one cares about it

still lily
#

@obtuse wind Cannot read property 'members' of undefined

#

oof

#

why isnt this in the docs

obtuse wind
#

I said its irrelevant

#
      let role = rows[0].roleID
            await channel.permissionOverwrites.forEach(async (role) => {
                console.log(role)
                await channel.updateOverwrite(role, { VIEW_CHANNEL: false });
            })
            await channel.updateOverwrite(role, { VIEW_CHANNEL: false });
```
what about something like this maybe?~~~
#

idk i don't know how to program channel permissions with bots I do that manually

#

@still lily

still lily
#

that wont work

#

it doesnt*

obtuse wind
#

well then I cannot help you, again I do things manually with permissions

still lily
#

ok

obtuse wind
#

or maybe it needs the cache

#

because I didn't put cache before the forEach

still lily
#

message.guild.members

zinc condor
#

eyyy

#

just submitted it

still lily
#

does message.guild.members work

obtuse wind
#

it depends on what kind of version you are on jake

still lily
#

im v12

obtuse wind
#

no it wont

still lily
#

ooof

obtuse wind
#

message.guild.cache.members

#

try that

knotty steeple
#

most things are under

obtuse wind
#

otherwise try my code but put .cache before my forEach

knotty steeple
#

"managers"

#

now

#

or

obtuse wind
#

yeah because of that

knotty steeple
#

whatever the fuck its called

obtuse wind
#

I cannot get node v12 on my goddamn BOT FOLDER

#

🤦‍♂️

knotty steeple
#

why do u need node 12

#

just use lts

obtuse wind
#

I have discord.js

#

im on windows

knotty steeple
#

yea lts works

tulip wave
#

d.jsV12 requires node12

knotty steeple
#

does it not

#

gay

still lily
#

TypeError: Cannot read property 'members' of undefined

#

oooof

obtuse wind
#

yes it wont work

tulip wave
#

Because of the embed constructor

obtuse wind
#

how do I put node v13.12.0 my recently downloaded version into my bot folder?

knotty steeple
#

you cant install to a specific dir

obtuse wind
#

cause I tried

npm i c:/useres/administrator/onedrive/desktop/discord_bot/node_modules/node 

which that line did work but it didn't update the damn node

earnest phoenix
#

lol

knotty steeple
#

oh

#

my

#

god

#

no

earnest phoenix
obtuse wind
#

it said successfully installed node 13.12.0 and guess what I do node -v and it said::::::::: 10.9.0

grizzled raven
#

array.flat exists in some node v11 versions lmao

knotty steeple
#

yea do what cry said

obtuse wind
#

IM NOT IGNORING IT

#

ITS NOT WORKING

earnest phoenix
#

yes it is

obtuse wind
#

NVM doesn't work on installing that I tried that already

earnest phoenix
#

if it didn't work for you, you didn't do it correctly

#

that's not what i said to do

#

read the message again

knotty steeple
#

i said use nvm

#

before

earnest phoenix
#

and then after that, read it again

#

and then after reading it again, read it again

obtuse wind
#

I changed the damn path 🤦

grizzled raven
#

do you think he knows what a PATH var is?

obtuse wind
#

Why is everyone calling me a he omg

knotty steeple
#

node_modules/node

grizzled raven
#

oh surprise surprise puppy surprise

knotty steeple
grizzled raven
#

im sorry, they

knotty steeple
#

thing

#

it

tulip wave
#

Everyone be nice

earnest phoenix
#

gender neutral pronouns ayy

grizzled raven
#

wait what

obtuse wind
#

here let me just do

tulip wave
#

@obtuse wind also most of the discord userbase are guys do it's kinda normal

obtuse wind
#

npm uninstall node

grizzled raven
#

wdym be nice

#

im gonna regret adding raw events

#

but

knotty steeple
#

no you cant install node with npm Thonk

earnest phoenix
#

toxic, you should backtrack a bit and first learn how to work with node.js and npm in the first place, and then after learning how the language works and how the runtime works, start making a discord bot

knotty steeple
#

huh

grizzled raven
#

hah thats not what i did

earnest phoenix
#

we been knew 💅

obtuse wind
#

what do mean start making a discord bot I have 16 applications that I host

earnest phoenix
#

ok and

obtuse wind
#

I know how it works its not working what you guys are telling me

earnest phoenix
#

Bet

knotty steeple
#

if you cant install node.js then something is wrong

grizzled raven
#

try googling it worked for me

earnest phoenix
#

this is my 6th time telling you to change the PATH variable to include your new node version

obtuse wind
#

ok in my program files in my c: drive, its 13.12.0, in my bot folder, its 10.9.0

#

your PATH variable is not working I tried that

#

I'll try it again and send you screenshots

earnest phoenix
#

what did you try

crimson vapor
#

im confused

#

to start a bot, you cd into the dir and do node .

#

right?

grizzled raven
#
Object.defineProperty(node, "PATH", {
  value: "13.12.0"
})
earnest phoenix
#

lol

grizzled raven
#

my socket keeps hanging up

#

being bad

earnest phoenix
#

bad gateway

grizzled raven
#

now i have to use raw events to make everything worse until i rewrite to djs12 and get partials

earnest phoenix
grizzled raven
#

what causes a bad gateway

#

what too many requests?

earnest phoenix
#

nah

#

it's a server side error

grizzled raven
#

or just bias

#

dd

#

xd

crimson vapor
#

obv you need to buy a new router

#

what else?

grizzled raven
#

well it happens way too often for me, possibly meaning i should start sharding but /shrug

crimson vapor
#

how many servers?

knotty steeple
#

i shard my 2 server bot

grizzled raven
#

yeah ih

knotty steeple
#

😎

grizzled raven
#

uh

#

cough

crimson vapor
#

dont u have 2.4k

grizzled raven
#

1.8k

crimson vapor
#

oh

#

ye u should

grizzled raven
#

i should

knotty steeple
#

pls start

grizzled raven
#

my mind's telling me noo

#

but my body

knotty steeple
#

internal sharding

grizzled raven
#

my body's also telling me no

knotty steeple
#

do it

#

™️

grizzled raven
#

i will

#

but i need to REWRIte

obtuse wind
#

my program folder for node VS my bot folde,r again I tried the path option.

knotty steeple
#

wait

#

is that node as a dependency

#

l m f a o

#

what are u doing

obtuse wind
#

idfk anymore

#

im so close to throwing my desktop out of my second floor window

earnest phoenix
#

what exactly did you do when you were changing the PATH variable

obtuse wind
#

I'm not gonna even answer that its just dumb

knotty steeple
#

what

earnest phoenix
#

ergo you didn't do it

knotty steeple
#

also dont get node with npm

#

lul

obtuse wind
#

I did but its useless

earnest phoenix
#

it's not

#

again

obtuse wind
#

I didnt get node with npm i installed it from the site

earnest phoenix
#

what exactly did you do when changing the PATH variable

obtuse wind
#

change program files folder to discord_bot folder

earnest phoenix
#

and obviously

#

you did not do the right thing

obtuse wind
#

It didnt work

#

Yes of course it didnt work

earnest phoenix
#

ignore the cmder part

#

it explains how to edit your PATH variable

obtuse wind
#

my PC does not have user variables or system variables

Sidenote: I changed Path, nothing worked.
Other sidenote: I completely reinstalled discord.js and node into my bot folder
Other sidenote; I deleted my entire node_modules folder, and reinstalled discord.js and node; it says installed 12.1.0, 13.12.0 and guess whattttt: node -v === 10.9.0

zinc condor
#

how do i get permissions for my bot

#

need to check if the bot has permissions for stuff

obtuse wind
#

@zinc condor what version are you on

zinc condor
#

12

obtuse wind
#

I think its bot.Permissions(checkAdmin) but I'm probably incorrect.

#

no idk documentation is weird now

earnest phoenix
#

pogey Dark reader too?

obtuse wind
#

I have always used dark theme.

bright meadow
#

dark for everything

earnest phoenix
#

light is gay

#

that's not true

#

i'm in the dark and i'm still gay :(

#

okay

regal saddle
#

Whats going on here?

gray quarry
#

Whenever I try to get to my bots page it always says 403 forbidden

regal saddle
obtuse wind
#

I was able to revert to discord v11 and now it says "setActivity(<activity in quotes/or this ` `>)" is not a function was that deprecated
.setPresence was the solution

copper cradle
#

obvs you're doing it wrong

#

but like

#

without seeing what you're doing I can't actually help

#

nor do I have enough time tho

#

I'm working on something rn

wide ridge
#

is there anything I can do to reduce the caching of d.js?

#

Would appreciate some direction!

sudden geyser
#

I mean, you can go and change some of the options here: https://discord.js.org/#/docs/main/v11/typedef/ClientOptions

#

Not everything, but some.

grizzled raven
#

a-

#

why?

#

i think i know why but its better coming from someone else

#

no i do know why but why does it happen

copper cradle
#

bc node is gay

#

there

grizzled raven
#

wait

#

i got an idea

#

not big brain, im still

sudden geyser
#

It has to do with its prototype/this and how it was called. You lose its reference when you do that.

rugged hatch
#

where do I put JSON-params in a http request using node.js

scenic nest
#

hmm

wet apex
#

hey

#

i want to make a bot for my server and idk how make my idea come true

#

so can anyone help?

scenic nest
#

hmm someone?

#

that help me?

#

hello?

sudden geyser
#

where do I put JSON-params in a http request using node.js
@rugged hatch What library are you using for HTTP requests?

i want to make a bot for my server and idk how make my idea come true
so can anyone help?
@wet apex most things are possible. What exactly do you want to make?

scenic nest
#

still remeber me?

sudden geyser
#

Nevan what do you need help with?

scenic nest
#

im finding

#

i forget hes name

#

like hes name is new vortex

#

or something like that

#

how to make verified bot?

sudden geyser
#

What? What do you mean?

scenic nest
#

some bot has verified

#

like

#

dank memer

#

and groovy

#

how to make like that?

#

do i need to go to discord office?

sudden geyser
wet apex
#

@sudden geyser well i want to make a introduction bot. i have its blueprint ready in my mind but it need database and idk much about database

earnest phoenix
#

there's a first time for everything

#

and docs

#

you have billions of learning resources online

#

if you want to learn it, do research on the subject

wet apex
#

you're right bro

#

it seems like you're a very experienced bot developer

#

which bot you have developed? @earnest phoenix

crimson vapor
#

cry took down their bot

wet apex
#

ooh why?

crimson vapor
#

I dont know

#

never asked

wet apex
#

okay

#

wby? do you have a bot?

crimson vapor
#

yes, I do

rugged hatch
#

@sudden geyser I already got it. But thx though!

earnest phoenix
#

How do I make the bot react to the message, not command.
V11

#

Not command trigger

valid gyro
#

Like having a user input?

#

If ur in node you can do that with a simple arguement script

earnest phoenix
#

It's a suggestion command

sudden geyser
#

Send the message and get the message that's sent. For example:

message.channel.send(...).then((msg) => {
  // `msg` is the new message.
})```
pale vessel
#

you can also use async if you want a cleaner code

copper cradle
#

using async and await you can keep everything inside a single scope

golden condor
#

Why does pm2 keep making two instances it's so anniying

#

It only restarts knce

pine bear
#

damn, we use the same prefix

#

actually surprised that this works! it's amazing!

const Discord = require('discord.js');

module.exports = {
    name: 'guide',
    description: 'pong!',
    execute(message, args){
        if (message.author.id !== '622694560501596161') return;
        const Aembed = new Discord.RichEmbed()

        .setColor('yellow')
        .setTitle('꧁ৡৢۜ͜ ༺**STAFF GUIDE**༻ৡৢۜ͜꧂')
        .setDescription('꧁ৡৢۜ͜ ༺**HELPERS**༻ৡৢۜ͜꧂\nMust report to Mods if a user breaks a rule\nWarn members when they break rules\n\n꧁ৡৢۜ͜ ༺**MODS**༻ৡৢۜ͜꧂\nMust moderate chat\nTempmute members when they break rules multiple times\nMust do helper jobs\n\n꧁ৡৢۜ͜ ༺**SERVER DEVELOPERS**༻ৡৢۜ͜꧂\nkick members who haven\'t verified themselves in 1 week\nMust do MODS jobs, and helper\'s job\nhelps set up/edit the server\nMust do all staff jobs when asked\n\n--[**ALL STAFF**]--\nhelp out members\nBump our bots\nKeep chat active\nhelp support the server')
        message.channel.send(Aembed)

        const Bembed = new Discord.RichEmbed()
        .setColor('yellow')
        .setTitle('꧁ৡৢۜ͜ ༺**RULES**༻ৡৢۜ͜꧂')
        .setDescription('DO NOT BREAK SERVER RULES!\nMust follow staff guide\nMust not abuse your power\n Must be a good rolemodel\n Please don\'t unnecessary pin messages')
        message.channel.send(Bembed)

        const Cembed = new Discord.RichEmbed()
        .setColor('cyan')
        .setTitle('꧁ৡৢۜ͜ ༺**PUNISHMENTS**༻ৡৢۜ͜꧂')
        .setDescription('Any rules broken or not abiding by the staff guide will result in demotion and ultimately removal from the staff team, you will be notified if you are going to be demoted/removed from the staff team, you cannot reapply as staff once you are demoted.\n\n\n Remember, Teamwork makes the dreamwork!')
        message.channel.send(Cembed)
    }
}
#

the only problem is that the embeds are the wrong color.

queen needle
#

what color are they

golden condor
#

Why does pm2 keep spawning two instances!

#

Please help me

queen needle
#

whata

wet apex
#

@crimson vapor what is the name of your bot?

pine bear
#

black

#

and gray

queen needle
#

try using color codes

pine bear
#

probably a good idea

#

I think I could create a color.json file and just paste in color codes in there ig.

queen needle
#

yeah

#

or in config

pine bear
#

yea

#

I'll do it tomorrow ig.

queen needle
#

yeah

golden condor
#

How to stop pm2 spawning two instaces

barren swallow
#

How do you update channels d.js v12

#

nvm found it on docs

cinder patio
#

Cxllm, did you try pm2 start <yourserverscript.js> -i 1. Found it in the first link on google

tight plinth
#

@pine bear try using CAPS for embed color

#

like cyan --> CYAN

pine bear
#

Eh, ok? but how will that work?

tight plinth
#

it will work

#

just

#

it will work

pine bear
#

I'm like 70% sure it will not work

#

as I see

tight plinth
#

im like 100

pine bear
#

nope

tight plinth
#

some colors are not supported, some are

pine bear
#

nost likely using CYAN is most likely undefined and sends something else

#

or yes

#

not supported

#

you probably added something to your bot files to make it supported.

tight plinth
#

editing discord.js messageembed file

#

sec

pine bear
tight plinth
#

d.js code

#

its discord api dependant

pine bear
#

Hm,

tight plinth
#
exports.Colors = {
  DEFAULT: 0x000000,
  WHITE: 0xffffff,
  AQUA: 0x1abc9c,
  GREEN: 0x2ecc71,
  BLUE: 0x3498db,
  YELLOW: 0xffff00,
  PURPLE: 0x9b59b6,
  LUMINOUS_VIVID_PINK: 0xe91e63,
  GOLD: 0xf1c40f,
  ORANGE: 0xe67e22,
  RED: 0xe74c3c,
  GREY: 0x95a5a6,
  NAVY: 0x34495e,
  DARK_AQUA: 0x11806a,
  DARK_GREEN: 0x1f8b4c,
  DARK_BLUE: 0x206694,
  DARK_PURPLE: 0x71368a,
  DARK_VIVID_PINK: 0xad1457,
  DARK_GOLD: 0xc27c0e,
  DARK_ORANGE: 0xa84300,
  DARK_RED: 0x992d22,
  DARK_GREY: 0x979c9f,
  DARKER_GREY: 0x7f8c8d,
  LIGHT_GREY: 0xbcc0c0,
  DARK_NAVY: 0x2c3e50,
  BLURPLE: 0x7289da,
  GREYPLE: 0x99aab5,
  DARK_BUT_NOT_BLACK: 0x2c2f33,
  NOT_QUITE_BLACK: 0x23272a,
};```
#

here is a list of all supported colors with discord.js

pine bear
#

ok thank you so much.

tight plinth
#

node_modules/discord.js/util/Constants.js

#

line 447

#

just edit this to add a new one

#

np

upbeat vapor
#

algun devolper español ?

viral rivet
#

How can I appear my bot to be online at top.gg

#

it is online and working

tight plinth
#

it needs to be approved + in this server

summer torrent
#

is it kicked from this server

tight plinth
#

whats ur bot id

#

-bots @viral rivet

gilded plankBOT
tight plinth
#

659384484491165697

viral rivet
#

That

#

lol

summer torrent
#

Ask a moderator

tight plinth
#

fix it and ask a mod to invite it back

viral rivet
#

strange though as it is allowed by discord

#

it is even encouraged

tight plinth
#

but not here

#

read rules s m h

finite bough
#

what does dms on join mean

#

like welcomes

viral rivet
#

yeah, but that means being a verified developer by discord

finite bough
#

or bot invite

viral rivet
#

yes indeed @finite bough

#

no welcome

finite bough
#

ah

tight plinth
#

u joins - bot dms you witn welcome message

finite bough
#

u should have a system to turn it off tbh

viral rivet
#

and if you get verified by discord it is in their 10 things to do

tight plinth
#

if you get verified you cant change bot name lol

#

at all

finite bough
#

yea

viral rivet
#

i wasn't talking about chaging botname

#

changing

finite bough
#

pretty sure no one is gonna give a damn about the bot after they get their verified

tight plinth
#

at least changing the avatar is still possible

finite bough
#

client.user.setAvatar()

earnest phoenix
#

client.user *?

finite bough
#

yea

pale vessel
#

@golden condor thank god i didn't verify corynth

viral rivet
#

But i do think it is strange that DBL is doing things different then discord verified

finite bough
#

XD

viral rivet
#

but I will adapt

golden condor
#

@pale vessel why?

golden condor
#

Oh good

tight plinth
#

@pale vessel it can be transfered during verification

pale vessel
#

no thanks

golden condor
#

I can add u to the team if you want the badge tho

rotund cobalt
#

Why do I need to code for a webhook cant I just select the webhook and write with it?

tight plinth
rotund cobalt
#

Why do I need to code for a webhook cant I just select the webhook and write with it?

tight plinth
#

@rotund cobalt library?

#

what do you use to code your bot

golden condor
#

@tight plinthjust getting on my pv

rotund cobalt
#

Oh webhooks create bots?

tight plinth
#

I got my bot verification process to work

#

no they dont

#

Why do I need to code for a webhook cant I just select the webhook and write with it?
@rotund cobalt no you cant

rotund cobalt
tight plinth
#

erm no

#

what you're reading is an example of using webhooks to get notified for updates on a github repo

rotund cobalt
#

Oh

#

What website do I need to go onto to create a webhook

tight plinth
#

you can't

#

you need a discord bot to be able to use webhooks

rotund cobalt
#

I have mee6

tight plinth
#

you need YOUR discord bot

#

you need to be able to code one

#

if you try to create a webhook and getting orking like that it will not work at all

rotund cobalt
#

Is there no pre maid bot i can use for webhooks?

pale vessel
#

no

rotund cobalt
#

Ok

pale vessel
#

yes

tight plinth
#

github tm

rotund cobalt
#

What, can I get that on the github page

earnest phoenix
#

btw why do you want to make a webhook

#

you don't have a bot so why are you making one

rotund cobalt
#

I want to be able to write down anoucements with my discord server logo

viral rivet
#

Can I just ask a mod or should I ask the mote who kicked the bot, since I have edited the part of the DM out?

#

mote = mod

tight plinth
#

ask a mod

scenic nest
#

..

cinder oxide
#

Ight I have a question. Using Eris's <channel>.editPermission(), how would I set a permission for a role to Neutral?

#

("Send Messages", specifically)

wet apex
#

have anyone saw ChillCorner bot?

earnest phoenix
#

Why do table change their bacckground color when I hover over them on top.gg even if I set it with tr:hover {background-color: #33363d} What do I need to change?

slender thistle
#

background-color

earnest phoenix
#

Spell mistake in here

#

still not working

#

I can change the cell im hovering over atm but the other row cell si still changing its color wrong

viral rivet
sick cloud
#
{
a: 'aaa',
b: 'bbb'
}

how would i map that into a string, ie: a=aaa,b=bbb

pale vessel
#

you can use a loop

#

i want to spoonfeed so bad

finite bough
#

spoon food for beginners tony is hella good so i think u can

earnest phoenix
#

Why do table change their bacckground color when I hover over them on top.gg even if I set it with tr:hover {background-color: #33363d} What do I need to change?
My problem is still there....

tulip wave
#

@finite bough then other ppl have that code

#

@sick cloud also thx for the idea I was actually looking for that solution to my problem lol

finite bough
#

dms

tulip wave
#

True

#

But still spoonfeeding bad

finite bough
#

forkfeed then bloblul

pale vessel
#
for (const name of Object.keys(object))```
#

so you can do `${name}=${object[name]}`

#

push that into an array and join them by ,

#

might not be the most efficient way but it should work

tulip wave
#

Or a forEach()

pale vessel
#

forEach is slow

#

that's why I prefer for loops

tulip wave
#

Rly depends what ur using it for

#

Sometimes forEach is okay

pale vessel
#

yeah

tulip wave
#

If it's rly big then yeah loops but if it's a small enough thing to loop through forEach is just handy

pale vessel
#

wow

#

cool

scenic nest
#

i need help

agile orchid
#

You should give information about your problem

#

we can't read your mind

elder vine
#

How can I catch this error? (discord.js v12.1.1)

1|v3bot  | (node:32684) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
1|v3bot  | user_id: Value "test" is not snowflake.
1|v3bot  |     at RequestHandler.execute (/root/dbotv3/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
1|v3bot  |     at processTicksAndRejections (internal/process/task_queues.js:97:5)
1|v3bot  | (node:32684) 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: 13)

from:

    let id;
    if (message.mentions.members.first()) {
        id = message.mentions.members.first().id;
    } else if (args[0] && message.guild.members.cache.find(member => member.user.username.toLowerCase() === args[0].toLowerCase())) {
        id = message.guild.members.cache.find(member => member.user.username.toLowerCase() === args[0].toLowerCase()).user.id; // I don't know how to catch this error (when not typing a real username)
    } else if (args[0] && await client.users.fetch(args[0])) {
        id = args[0];
    } else {
        return client.throw(message, "Wrong Usage", `${config.wrongUsage} \`${guild.prefix}${this.help.usage}\``)
    };
agile orchid
#

use try and catch

elder vine
#

I did, and it wouldn't work

agile orchid
#

hmm

#

It says test is not a snowflake

elder vine
#

Yea

agile orchid
#

where does it get that "test" value

elder vine
#

I tried using the cmd upvote test (being args[0])

#

then if it test couldnt be found it should have a catch

agile orchid
#

oh

#

make a seperate error handler event

#

give me a sec

pale vessel
#

if it's a promise, you'd use .catch

elder vine
#

Hmm

scenic nest
#

@agile orchid how to connect visual studio code to discord bot?

agile orchid
elder vine
#

Download Visual Studio Code and Node.js

scenic nest
#

alaredy

agile orchid
#

run npm install --save discord.js

elder vine
#

Make a folder, and put the bot's files there

scenic nest
#

k k

true ravine
grizzled raven
#

@elder vine its this thing lol

} else if (args[0] && await client.users.fetch(args[0])) {
elder vine
#

no

#

That thing works

#

oh....

#

Wait.. it might be

earnest phoenix
#

Why does the table change its background color when I hover over them on https://top.gg/bot/673545677791297566 ? Even if I set it with: tr:hover, th:hover, td:hover, table:hover {background-color: #33363d} Whats wrong and how do I change it?

#

Can someone give me welcome command discord.js please

modest maple
#

we dont give code

#

no spoonfeed

quartz kindle
#

you have hover in a bunch of different places

#

@earnest phoenix

earnest phoenix
#

I had it in twice but it still doesnt work and it only shows this whitesmoke

quartz kindle
#

if the whitesmoke rule is not yours, then its top.gg's rule, and you need to replace it by creating a rule with equal or higher specificity

#

ie: more specific targeting

#

the original rule target has 3 levels of specificity

slender thistle
#

you mean abusing !important isn't an option?

quartz kindle
#

nope

earnest phoenix
#

whats more specific targeting?

quartz kindle
#

important is for n00bs

earnest phoenix
#

just a class?

quartz kindle
#

for example

#

#id .class - more specific
.class - less specific

#

.content table tr - more specific
table tr - less specific
tr - much less specific

#

basically just make your rule the same as the original

#

if the original is .content table tr, yours should be equal or more specific, but equal is enough

grizzled raven
#

but !important saves time and effort K_vPensiveBread

slender thistle
#

wdym important is for noobs, I'll let you know I use borders for padding

grizzled raven
#

damn ur cool

nocturne grove
#

Hey. Do you recommend me (and many others) to upgrade to Discord v12?

tight plinth
#

its ur choice

#

if you want to try, yes

#

if you dont want, no

earnest phoenix
#

how do you even which discord to install?

nocturne grove
#

@tight plinth but it contains less bugs, right?

quartz kindle
#

some things are better yes, but most things are the same, just different

nocturne grove
#

the .cache thing will be the most annoying part for me

quartz kindle
#

you should upgrade to v12 if you're ready to do a full refactor/revision of your bot's code

tight plinth
#

v11 is still supported

#

v12 has more features

slender thistle
#

regex replace gang

quartz kindle
#

@earnest phoenix you can install v11 by doing npm install discord.js@11.6.4

earnest phoenix
#

oh discord.js

nocturne grove
#

but I mean: now my bot is relatively small, so it'd be better to upgrade now

slender thistle
#

Good mindset

elder vine
#

Yep

earnest phoenix
#

but didn’t he said Discord and not d.js? 🤔

quartz kindle
#

yes he did, but he meant discord.js

tight plinth
#
exports.WSEvents = keyMirror([
  'READY',
  'RESUMED',
  'GUILD_CREATE',
  'GUILD_DELETE',
  'GUILD_UPDATE',
  'INVITE_CREATE',
  'INVITE_DELETE',
  'GUILD_MEMBER_ADD',
  'GUILD_MEMBER_REMOVE',
  'GUILD_MEMBER_UPDATE',
  'GUILD_MEMBERS_CHUNK',
  'GUILD_INTEGRATIONS_UPDATE',
  'GUILD_ROLE_CREATE',
  'GUILD_ROLE_DELETE',
  'GUILD_ROLE_UPDATE',
  'GUILD_BAN_ADD',
  'GUILD_BAN_REMOVE',
  'GUILD_EMOJIS_UPDATE',
  'CHANNEL_CREATE',
  'CHANNEL_DELETE',
  'CHANNEL_UPDATE',
  'CHANNEL_PINS_UPDATE',
  'MESSAGE_CREATE',
  'MESSAGE_DELETE',
  'MESSAGE_UPDATE',
  'MESSAGE_DELETE_BULK',
  'MESSAGE_REACTION_ADD',
  'MESSAGE_REACTION_REMOVE',
  'MESSAGE_REACTION_REMOVE_ALL',
  'MESSAGE_REACTION_REMOVE_EMOJI',
  'USER_UPDATE',
  'PRESENCE_UPDATE',
  'TYPING_START',
  'VOICE_STATE_UPDATE',
  'VOICE_SERVER_UPDATE',
  'WEBHOOKS_UPDATE',
]);```
#

I'm discovering things

earnest phoenix
#

oh ok thanks

elder vine
#

Is this the new event names?

tight plinth
#

these are all client events

nocturne grove
#

lol I wanted to ask that too ^

tight plinth
#

according to d.js v12 files

elder vine
#

:o

grizzled raven
#

well its nothing new but

quartz kindle
#

these are discord API events, not discord.js events

nocturne grove
#

so guildDelete is no more

tight plinth
#

oof

nocturne grove
#

ohw

tight plinth
#

guildDelete is

grizzled raven
#

GUILD_CREATE',
'GUILD_DELETE',
'GUILD_UPDATE',

quartz kindle
#

discord.js takes these events, processes them for you, and gives you the discord.js version of them

grizzled raven
#

its like the fourth event there

earnest phoenix
#

I wonder if I will get ratelimited if I played silence like every second in a VC 🤔

nocturne grove
#

ohh okay interesting

tight plinth
#

found better

elder vine
#

I hate downloading these xD - they should find a better way of displaying "longer" messages.

nocturne grove
#

^

grizzled raven
#

view in browser gang

nocturne grove
#

thanks though

tight plinth
#

giving u better guys

#

THE file

elder vine
#

What?

tight plinth
nocturne grove
#

I can't find anything about guildDelete/guild_delete in the changelog. So the bug about random detecting a leave is not fixed?

elder vine
#

I don't need no file

tight plinth
#

I never got it

#

using v12.0.0

grizzled raven
#

its when a guiod is unavailabe

quartz kindle
#

the problem is, that when guilds become unavailable, the API sends you GUILD_DELETE events and then GUILD_CREATE events they they become available again, or when your bot reconnects

nocturne grove
#

oh oof

quartz kindle
#

afaik discord.js correctly processes these, so there shouldnt be a bug like that

grizzled raven
#

including djs11?

#

because that did happen to me during outages

quartz kindle
#

yes, v11 should also process these correctly

#

v12 might be better at doing it tho

nocturne grove
#
if (client.guilds.get(guild.id)) return console.log('Stopped a fake guildDelete event');``` this doesn't fix 'the bug' I'm experiencing?
grizzled raven
#

in the guildCreate event will the guild always be available?

nocturne grove
#

that line is in the guildDelete event

tight plinth
#

u dont have to fix it

sick cloud
#

@pale vessel for loop isn't es6

grizzled raven
#

nvm

tight plinth
#

just try to not get big big guilds

nocturne grove
#

I had that once and that wasn't a big guild

#

not even 100 members

#

why did they choose to do it like this? I mean: people like me and I guess many others just want to detect a guild leave

tight plinth
#

they do

nocturne grove
#

not a connection error or something

tight plinth
#

internal desicion I guess

nocturne grove
#

and there's not an option to really detect a guild leave? Really weird in my opinion

quartz kindle
#

discord.js should correctly detect it

#

Guild Delete
Sent when a guild becomes unavailable during a guild outage, or when the user leaves or is removed from a guild. The inner payload is an unavailable guild object. If the unavailable field is not set, the user was removed from the guild.

#

this is how discord.js v12 handles it

#

this is how v11 handles it

#

as you can see, both v11 and v12 correctly handle those cases, so i dont see how the guildDelete event would wrongly fire

#

what version of discord.js v11 were you running on?

nocturne grove
#

hmm that's weird

#

I will find my version

#

6.12.0

#

wow isn't that really old

#

😳

quartz kindle
#

thats likely the wrong thing

#

do npm ls discord.js

nocturne grove
#

oh hm I did npm -v discord.js

#

ahh. 11.5.1

quartz kindle
#

yeah thats basically the same as npm -v

#

let me see

finite bough
#
%eval let a = message.guild.members.get('430964083160776705');
message.channel.send(a.username)
``` is this wrong?
nocturne grove
#

something like that can't be caused by the hosting?

earnest phoenix
#

Hey
Whenever i restart my bot on glitch, some of the data isn't being saved (as usual, like channel updates etc)
Anyone know how can it be saved ?

finite bough
#

json itay?

nocturne grove
#

@finite bough hey. I don't recognise your whole code but what discord.js version are you using?

finite bough
#

11v

earnest phoenix
#

what did you ask ?

finite bough
#

like are u saving them in json files

earnest phoenix
#

I thought about using quick.db
Way better than json

nocturne grove
#

@finite bough you should use a.user.username in the second line I see. a is a member object

finite bough
#

oof

#

json doesnt work on glitch

#

so yea

quartz kindle
#

@nocturne grove seems like the file that handles guildDelete in v11 hasnt been changed since 2018

#

so im really not sure

nocturne grove
#

oh huh really strange

#

well thanks for looking at it

finite bough
#

i think for logs 12v is the best

#

there are a lot of issues with logs in 11v

#

like random errors

nocturne grove
#

but my js if (!client.guilds.get(guild.id)) return; does not work? @quartz kindle

#

in a 'fake' case

quartz kindle
#

i mean, if the event is ever wrongfully fired, that will work yes

nocturne grove
#

okay nice, great to hear!

#

I am logging that thing so if it's ever happening again I can look closer into it

golden condor
#

Discord.js

#

will not set my bot to dnd or idle ever

#

no matter how many times i restart

glad leaf
#

is there a way I can make it so a role gets removed when receiving a different role?

You get role Test1
Role Test2 gets removed

earnest phoenix
#

I need help to do Autorole Script

nocturne grove
#

@glad leaf yes definitely

earnest phoenix
#

It's the thing i can not do ; _ ;

#

@golden condor if im not wrong you need to make the bot offline first by making a mistake in the code until it shuts down and then start it again

#

it will change after that

elder vine
#

Where are you stuck?

golden condor
#

@earnest phoenix ok

earnest phoenix
#

Where are you stuck?
@elder vine me?

slender thistle
#

you need to make the bot offline first by making a mistake in the code
huh?

elder vine
#

Yes

earnest phoenix
#

In evrything

#

I see youtube tutorials

elder vine
#

Show the code you got so far

earnest phoenix
#

@slender thistle making a mistake in the code will eventually make the bot go offline

#

wait

slender thistle
#

Can't you just... turn the bot off...

earnest phoenix
#

i use glitch ...

elder vine
#

Alright

earnest phoenix
#

i used it and it worked so why not

tight plinth
#

is there any way with yt-search (the js lib) to get more than 100 songs per playlist?

earnest phoenix
#

hello $username welcome to my server
$giveRole[$authorID;roleID]

#

In that ._.

golden condor
#

No

#

There isn't

elder vine
#

Are you using python?

tight plinth
#

oof

earnest phoenix
#

nah

elder vine
#

js?

golden condor
#

@earnest phoenix I tried it

earnest phoenix
#

bot designer begging

elder vine
#

Ehhh...

earnest phoenix
#

I guess it didn't work/

#

?

#

yh

elder vine
#

What is bot designer?

tight plinth
#

a app to make discord bots

earnest phoenix
#

phone app

#

yh

elder vine
#

Well I can't help you then...

earnest phoenix
#

Why

elder vine
#

Not you.

earnest phoenix
#

Ik but why using an app on the phone

#

Is it writing a code or like an auto-bot builder?

elder vine
earnest phoenix
#

yh

elder vine
#

I don't understand this codin, so yea

earnest phoenix
#

np ^^

#

Same here, I would like to help you if I understand that way of coding.

golden condor
#

Why does pm2 keep spawning two instances

#

Is it pm2

#

or my code

#

For handling events

#

I will send

#

My index.js

#
//do not execute
fs.readdir("./commands/", (err, files) => {
  for (let i = 0; i < client.categories.length; i++) {
    var commandFiles = fs
      .readdirSync(`./commands/${client.categories[i]}`)
      .filter(file => file.endsWith('.js'));
    for (var file of commandFiles) {
      var command = require(`./commands/${client.categories[i]}/${file}`);
      client.commands.set(command.name, command);
      if (command.aliases && Array.isArray(command.aliases)) command.aliases.forEach(alias => client.aliases.set(alias, command.name));
    }
  }
  if (err) return console.log(err);
});
//Events "handler"

fs.readdir("./events/", (err, files) => {
  if (err) console.log(err);
  files.forEach(file => {
    let eventFunc = require(`./events/${file}`);
    let eventName = file.split(".")[0];
    client.on(eventName, (...args) => eventFunc.run(client, ...args));
  });
});```
elder vine
#

What does your package.json look like?

earnest phoenix
#

so, does someone have a java autorole script

marble juniper
#

do you use a config file for pm2

static trench
#

@elder vine I’ve used that app. You dont get unlimited hosting

elder vine
#

Why use that app then?