#development

1 messages · Page 978 of 1

lyric mountain
#

Then increase the message count for that day

#

Like, store a tuple of date | count

#

With an ID, obviously

zinc condor
#

thats a good plan but i still wonder how i would combine it

lyric mountain
#

Each day would have its count

#

All you'd need to do is select the desired period

zinc condor
#

to combine total messages for the past 7 days for each user into a single for EVERY user which has messaged in the past 7 days

#

then make a leaderboard which sorts top 10

lyric mountain
#

That'd be possible with this example I gave

#

Each user would have its "daily count"

#

So instead of having N entries per day per user, you'd have only 1 entry per day per user

earnest phoenix
#
2020-06-18T01:53:56.000000+00:00 app[api]: Build started by user mygmail@gmail.com
2020-06-18T01:54:05.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/..........................................................................
#

help

lyric mountain
#

Check your build output for actual error

zinc condor
#

also stackoverflow probably has more information

#

on that error

zinc condor
#

you dont have permission

#

if your on windows use admin

#

if on linux/mac use sudo

earnest phoenix
#

me?

zinc condor
#

yes

earnest phoenix
#

what

#

i dont understand

zinc condor
#

look at your error

#

instead of going here for every tiny issue with node

#

clearly says permission denied

earnest phoenix
#

so, how i fix that?

#

@Riku

zinc condor
#

google it

earnest phoenix
#

.-.xd

#

admin npm i canvas?

#

don't work :c

summer torrent
#

admin Thonk

#

what is your OS

earnest phoenix
#

OS?

summer torrent
#

Windows, Linux, etc

earnest phoenix
#

Windows

summer torrent
#

wait you are using heroku

earnest phoenix
#

yes

#

:c

#

Using discord.py how can I have my bot join and speak on multiple servers?

self.voice_chat = None
 async def play_joke_audio(self, joke, voice):
        filename, player = await YTDLSource.from_url(joke.audio)
        if self.voice_chat is None:
            self.voice_chat = await voice.channel.connect()
        self.voice_chat.play(player, after=lambda e: os.remove(filename))
#

Voice chat seems to only work with one server at a time

#

@zinc condor nothing dont work

steel drum
#
export interface Constructable<T> {
    new(prefix: String, arg: String, message: Discord.Message) : T;
}

const cmd =  new (command as Constructable<Command>)(prefix, arg, message);
#

i keep receiving this error:

Conversion of type 'Command' to type 'Constructable<Command>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.

Type 'Command' provides no match for the signature 'new (prefix: String, arg: String, message: Message): Command'.

31 const cmd = new (command as Constructable<Command>)(prefix, arg, message);

#
protected constructor (prefix: String, arg: String, message: Discord.Message) {
}
#

the constructor w/o the body

#

any ideas on how to fix this ?

#

this is typescript btw

earnest phoenix
#

@slender thistle dm check sir

earnest phoenix
#

How would one make an uptime command?

earnest phoenix
#

step 1) write code
step 2) profit

soft wind
#

is it possible to use MySql database with dsharpplus it refuses to run my mysql commands.. do i need to run them in a sepereate void?

earnest phoenix
#

use ef core

soft wind
#

ef core?

twilit prairie
#

can someone help me make a stats page connect to my code

acoustic kiln
#

hi

#

a small help please

#
const db = require("quick.db")
module.exports={
    name: "spawnarceus",
    category: "NA",
    description: "spawning pokemon: arceus",
    run: async(bot, message, args) => {
        const Embed = new MessageEmbed()
        .setTitle(`A Wild Pokemon appeared type  to catch it!`)
        .setColor(`RED`)
        .setFooter(`HMM U CANT CATCH IT`)
         .setImage('https://cdn.bulbagarden.net/upload/thumb/f/fc/493Arceus.png/1200px-493Arceus.png')
        db.set(`pokemon_${message.guild.id}`, "ARCEUS")
      if(message.content.startsWith("Arceus")){
        message.channel.send("YAY U CAUGHT A LEGEND")
      }

       message.channel.send(Embed)
    }
}```

**How To Make It Auto spawn and Catch It**
summer torrent
#

you can use setInterval for automated things

acoustic kiln
#

how

summer torrent
acoustic kiln
#

oh thanks

#

how to catch it

summer torrent
#

wdym

acoustic kiln
#

if it spawns how to catch it

summer torrent
#

make a command for it?

dusky marsh
#

Learn to code :)

summer torrent
#

^

acoustic kiln
#

i asked what is the command bro

#

where to fix that

dusky marsh
#

its your bot, how would we know what the command is

astral yoke
#
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).```
#

whaat do i do

summer torrent
#

what is your node js version

astral yoke
#

10

summer torrent
astral yoke
#

10.15.3

summer torrent
#

update it

sharp hinge
#

error:ReferenceError: Cannot access 'client' before initialization
code:```const { Client, Collection, MessageEmbed } = require("discord.js");
const Discord = require('discord.js');
const DBL = require("dblapi.js");
const dbl = new DBL('MY API TOKEN', client);
dbl.on('posted', () => {
console.log('Server count posted!');
})

dbl.on('error', e => {
console.log(Oops! ${e});
})```

astral yoke
#

uh

dusky marsh
#

client should be an instance of discord.js's Client, hence you need a definition for client somewhere above your instantiation of dbl

tight plinth
#

You need to initialize the client before initializing dbl stuff

#

Read the error plz

summer torrent
sharp hinge
#

i mean

#

saw my code? client is way up

dusky marsh
#

no its not

sharp hinge
#

litterly the first line

dusky marsh
#

Client != client

#

it is not

sharp hinge
#

OH

summer torrent
#

where is your client

sharp hinge
#

nvm nvm im stupid

#

thanks

earnest phoenix
#

How to make a leaderboard command in quick.db

sacred oyster
#

all my bots in heroku are down

#

theres this error

#

helpppppppppppppppppppp

sacred oyster
#

i fixed it

#

i deactivate the reactivated the dynos

sick cloud
#

i have a very dumb question, how do you remove an array element if you only know the position/index

sacred wraith
#

JS? Use Array.splice(index, 1)

sick cloud
#

cool, that works, thanks

woeful pollen
#

How to delete webhook?

#

.delete only deletes the message sent by the webhook I think

restive furnace
#

i dont think you can unless you do it manully

steel drum
woeful pollen
#

Yes I've seen that thanks

#

It just didn't seem to work when I did it

steel drum
#

you're probably calling delete on the wrong object / property

#

is my guess

ocean grove
#

где руские

wheat jolt
#

hex

tulip wave
#

#fffff

wheat jolt
#

wow it looks cool

#

thanks

#

xd

sick cloud
#

use a darker tone of the sidebar's background

#

#21252b might work

hasty sparrow
#

Take your background colour, lighten/darken it by x% and use that

wheat jolt
#

thanks

spark breach
#

can you show the code?

#

@earnest phoenix

restive furnace
#

no such file or diretory

#

if not code, then just show whole error, cause usually theres more than that

spark breach
#

i dont think so code is need cuz
it vscode error i think
It is probably code that is messing up

supple pasture
#

what do you mean

#

@autumn dust

digital ibex
restive furnace
#

wat

slender thistle
#

???

digital ibex
#

if the d.js server is helping people with js, when the server is only for the library not the language, why is it telling people to show people how to fix simple js errors

hasty sparrow
#

The d.js server no longer helps people with js

slender thistle
#

Because apparently it's a common error for d.js users and d.js server members got sick of saying the same thing over and over

quartz kindle
#

because d.js is primarily used by noobs beginners who never coded in their lives

earnest phoenix
#

because d.js is primarily used by noobs beginners who never coded in their lives
ur not wrong...

digital ibex
#

yeah, thats my point. which is why i think it needs to be removed

quartz kindle
#

its not a reason for removal lol, its even more reason for it to exist

#

noobs are a highly valuable market

earnest phoenix
#

How i add shards to my bot?

#

noobs are a highly valuable market
110% I've made very simple bots that took like 5 minutes to make for like $15 in d.js as the owner's request...

#

d.js as the owner's request...

restive furnace
#

oh yea im blind sry

earnest phoenix
#

smh

#

Why do some bots rank "Common Prefix"?

digital ibex
#

so they don't spam

stable grail
#

is it possible to do a custom link button in python?

modest maple
#

what? @stable grail

stable grail
#

a custom link

#

in python

hasty sparrow
#

You mean a markdown link?

stable grail
#

yeah

modest maple
#

what do you mean by custom link

#

oh markdown

#

thats just markdown

hasty sparrow
#

[Link name](actual link)

modest maple
stable grail
#

but in python?

modest maple
#

python makes no diffrence

#

its just markdown

stable grail
#

oh ok

#

thanks a lot

#

python makes no diffrence
@modest maple could u show me an example?

#

im not sure if im doing it right

modest maple
#

they're just markdown hyper links

earnest phoenix
#

markdown for hyperlinks can only be used in embed descriptions and field values

modest maple
earnest phoenix
#

if you attempt to use it outside of that, it'll render as is

slender thistle
modest maple
#

unless its a webhook

stable grail
#

yeah im using it in a embed

#

oh

#

yay it works

#

ty shivaco

digital ibex
#

how can i start caching in js? assuming thats going to reduce memory

#

i googled it but it shows stuff about web dev

robust moth
digital ibex
#

you can't send screenshots and expect people to know and help....

#

whta line in 29

cinder patio
#

Caching does not reduce memory

#

Caching is saving objects into memory, so you don't have to fetch them from an API / database multiple times

quartz kindle
#

caching increases memory to make things faster

woeful pollen
#

Ah I see

digital ibex
#

oh

earnest phoenix
#
const db = require("quick.db");
        let chx = db.get(`LeaveChannel_${member.guild.id}`);  //here
           let leavechannel = member.guild.channels.cache.get(chx);

    if (!leavechannel || !chx) return;

    if(chx === null) { 
      return;
    }```
#

help ?

honest perch
earnest phoenix
#

if (!member.guild) return;

#

@earnest phoenix ty

#

np

digital ibex
#

in eris, how can i remove intents?

acoustic kiln
#
const Discord = require("discord.js")
const db = require("quick.db")
module.exports = {
  name: "balance",
  category: "N/A",
  description: "Currency",
  run: async (bot, message, args) => {
let user = message.mentions.users.first() || message.author;
    
    let credits = db.fetch(`credits_${message.guild.id}_${user.id}`)

  if (credits === null) credits = 0;

  let bank = await db.fetch(`bank_${message.guild.id}_${user.id}`)
  if (bank === null) bank = 0;
    
    
    let greedymoney = new Discord.MessageEmbed()
    .setColor(`#FFFFFF`)
      .setDescription(`**${user}'s Balance**\n\nCredits: ${credits}\nBank: ${bank}`);
      message.channel.send(greedymoney)
  }
};
#

how do i make generate credits for myself

#

i mean dev

#

someone please say

summer torrent
#

use db.add()

acoustic kiln
#

in which line

#

sep one??

lyric mountain
#

I'm here

acoustic kiln
#

@lyric mountain the above one bro

#

how do the developer add credits for theirself and where should it be pasted

lyric mountain
#

if you want to add to yourself just manually edit the db

#

no need to use code for that

#

btw, why do you have both "bank" and "credits"?

#

and you aren't waiting for credits value

acoustic kiln
#

i too have that

#

but not names

#

only countt

#

is it client.user.setActivity(`${client.guilds.size} servers`)

earnest phoenix
#

V12?

#

So, it should be client.guilds.cache.size

#

Np

#

No

#

What's name?

#

Why

#

@earnest phoenix
<client>.guilds.cache.map(g => g.name).join("\n")

#

^

#

I see

plush fractal
#

lol

digital ibex
#

how can i change the colour of the writing?

#

in css

lyric mountain
#
.nameoftheclass {
  color: '#000000'
}
digital ibex
#

oki, thanks

plush fractal
#

l

spark breach
#

I have a question,
I am making a user-info command and I want to display the game that they are playing, but if I test it it keeps saying "Not playing a game"
Could someone tell me what I did wrong and what I need to change?

The code:

    if(message.content.startsWith("Beaver user-info")) {
        let user = message.mentions.users.first() || message.author;

        let userinfo = {};
        userinfo.avatar = user.displayAvatarURL();
        userinfo.name = user.username;
        userinfo.discrm = user.discriminator;
        userinfo.status = user.presence.status;


        const embedUserInfo = new MessageEmbed()
        .setAuthor(user.tag, userinfo.avatar)
        .setThumbnail(userinfo.avatar)
        .addField('Username', userinfo.name, true)
        .addField('Tag', userinfo.discrm, true)
        .addField('Status', userinfo.status, true)
        .addField('Playing', user.presence.game || 'Not playing a game')

        .setColor(0xff0000)

        return message.channel.send(embedUserInfo);
    }
})```
lyric mountain
spark breach
#

oof

lyric mountain
spark breach
#

oh oki, ty

toxic jolt
grand violet
#

wut

plush fractal
#

do node.js install -save

grand violet
#

show your code

toxic jolt
#

okay

plush fractal
#

and if that doesn't work then do: node.js show -save

toxic jolt
#

var bc = require('base-convert');

plush fractal
#

or
var bc = require('base-convert');

toxic jolt
#

okay

#

i change

plush fractal
#

kk

#

im makingsecond bot

toxic jolt
#

i dont fixed 😦

#
/rbd/pnpm-volume/ea5960bb-7e6b-4bc2-a042-a647b75566b8/node_modules/.registry.npmjs.org/bindings/1.2.1/node_modules/bindings/bindings.js:91
  throw err
  ^
Error: Could not locate the bindings file. Tried:```
grand violet
#

Check line 91

#

uh wait

vale garden
#

hlo

lyric mountain
#

that's an internal node error

vale garden
#

can someone tell me what you call this type of command

grand violet
#

node error waitWhat

toxic jolt
#

its my code

vale garden
#

whats this type of command called

plush fractal
#

it's good

toxic jolt
#

i how to fix pls :/

vale garden
#

can someone help me plz\

#

lol

plush fractal
vale garden
#

what

lyric mountain
#

@vale garden be patient dude

lusty quest
#

@vale garden use await message

vale garden
#

are we allowed to send links like this

lyric mountain
#

@plush fractal no ads

vale garden
#

kkk

lusty quest
#

or a message collector

vale garden
#

ok

toxic jolt
#

omg

lyric mountain
#

ah, claro

toxic jolt
#

i dont fixed

lyric mountain
#

um br

toxic jolt
#

:/

hushed jungle
#

Is there any benefit to using async/await over .then?

plush fractal
#

Im not advertizing im just saying my bot

hushed jungle
#

I am using .then now for async stuff.

lyric mountain
#

.then is easier semantically

#

await is useful if you want to return a value from an async function mostly

plush fractal
#

my code:

hushed jungle
#

In this case it's fetching a page so I want to get the body

#

But I have an entire function within a .then section and it looks a little bit weird

lyric mountain
#

stick with .then

grand violet
#

I need to make emoji to original image bot

lyric mountain
#

await is very error-prone when used frequently

#

also .then has that sweet .catch

#

which is shorter than conventional try-catch

hushed jungle
#

That is pretty nice yeah.

lyric mountain
#

also, .then allows u to chain events without locking the thread

hushed jungle
#

Locking the thread? Could you elaborate on that?

lyric mountain
#

Locking the thread? Could you elaborate on that?
@hushed jungle there's a thing called "thread safety"

vale garden
#

ik im at that page already @earnest phoenix

lyric mountain
#

for example, if you await a fetch that for some reason doesn't return a response, your will enter a deadlock state if you used await in the main method

#

this will prevent further execution of the code, and hang it there until the fetch returns something to the await

#

since js is mono-threadded this is EXTREMELY dangerous

hushed jungle
#

Yikes.

lyric mountain
#

so it's recommended to also have some lib that adds a timeout to vanilla fetch (which doesn't have one)

#

if you don't use await, the deadlock will only affect the post-fetch code (the one inside .then), not the main code

#

this is called asynchronism

hushed jungle
#

Thanks for explaining ❤️

earnest phoenix
#

How to make leaderboard command

#

in quck.db

lyric mountain
#

here's a lib I recommend

#

saved me a lot when I was programming my dashboard

vale garden
#

hi

hushed jungle
#

I will bookmark it

vale garden
#

i made a message collector command

#

and it works

#

but im getting this error

#
UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied options is not an object.
#

but the commands still work

#

what does this mean

vale garden
#

oh dude

#

i have the same problem

#

lol

earnest phoenix
#

lol

vale garden
#

i got the command but all the names say undefined

#

anyways

#

wat does my error mean

hasty sparrow
#

Please show your code

vale garden
#
module.exports = {
    name: 'test',
    description: "test command",
    execute(message, args) {
      const filter = m => m.author.id === message.author.id;
      message.channel.send("ayooo homie wassup boii").then(r => r.delete(5000))
      message.channel.awaitMessages(filter, {
        max: 1,
        time: 5000
      }).then(collected => {

        args[0];

      message.channel.send("sup lol")

      })

    }
}
earnest phoenix
#

.....

vale garden
#

what

lyric mountain
#

what a messy indentation

vale garden
#

did i mess up something badly

#

lol

#

idk how its like that

#

but it is

#

for some reason

#

what does my error mena

#

mean

earnest phoenix
#

this is used for message collector ``` let filter = m => m.author.id === message.author.id

  const collector = msg.channel.createMessageCollector(filter, { time: 30000 })
  
  collector.on("collect", m => {```
#

@vale garden

vale garden
#

my collector works perfectly fine

#

lol

#

i said i cant do it too

#

lol

#

do you know how to make a transfer money command

earnest phoenix
#

yea

#

Decrease money from author and add money in mentioned user

vale garden
#

but it isnt working

#

i mean a buy command

#

lol

#

i said transfer money by mistake

#

lol

#
const Discord = require("discord.js");
const client = new Discord.Client();
const Eco = require("quick.eco")
const eco = new Eco.Manager()
let shop = new Eco.ShopManager()

module.exports = {
    name: 'buy',
    description: "for buying items in the shop",
    execute: (message, args) => {

      let water_bottle = args[0];

      let add = shop.getItem(message.author.id, "water_bottle");
      let subtract = eco.removeMoney(message.author.id, 750);

      if (!args)
      return message.reply("Please enter an item to be bought like this for example:\n2t!buy water_bottle")

      if (args[0])

      return message.reply(`You have bought a ${getItem.item.Name} for ${removeMoney.amount}`)



    }
}
#

my code btw

#

wait

hasty sparrow
#

What "isn't working"?

vale garden
#

im pretty sure i need a shop command first

#

wait no nvm

#

nothing

vale garden
#

how do i

#

delete a previous message

#

in a collector

earnest phoenix
#

m.delete

vale garden
#

ok

north hollow
#

i need help how to make a warn bot

restive furnace
earnest phoenix
restive furnace
#

with api

earnest phoenix
#

Google assistant api?

#

and canvas library

#

yes

restive furnace
#

^

vale garden
#

hello im back

#

how do i define

earnest phoenix
#

then ?

vale garden
#

like

#

when a message hasnt been collected

#
collector.on('collect', m => {});
#

like this is for when a message is collected

#

how do i do one for when it isnt within the given time

vale garden
#

help me

long yew
#

someone help me start a new bot with command handlers pls ty

earnest phoenix
long yew
#

it doesn't work

vale garden
#

SOMEONE HELP ME PLS

#

lol

long yew
#

lol

vale garden
#

how long are you typing for @grand violet

vale garden
#

help me

#

help me

slender thistle
#

Calm down

earnest phoenix
#

@earnest phoenix can u be serious

#

i am serious

grand violet
#

how long are you typing for @grand violet
@vale garden wut

earnest phoenix
#

you aren't

#

i really need help

grand violet
#

earnest phoenix
#

oh rlly now

#

if u need help then state your issue

vale garden
#

@vale garden wut
@grand violet it said you are typing

#

for like 5 mins

#

straight

earnest phoenix
#

keep following links

#

no i won't

vale garden
#

what?

#

@earnest phoenix

grand violet
#

uh... I didnt typing any messages

grand violet
#

😳

vale garden
#

it said you were typing lol

#

ok

earnest phoenix
#

@earnest phoenix no spoonfeed

#

wdmy ?

vale garden
#

can someone tell me

earnest phoenix
#

tell u what

vale garden
#

how i can define it when the message isnt collected

#
collector.on('collect', m => {});
#

like this is how its defined

#

when the message is collected

quartz kindle
#

wdym "isnt collected"

vale garden
#

like i mean

#

when the message isnt sent

#

when it is sent its gets collected

#

so how do i define it if it isnt sent and isnt collected

quartz kindle
#

define a time limit on the collector

#

and listen to collector.on("end")

vale garden
#

ok

#

thx

#
collector.on('end', collected => {});
#

i found this

#

is it like this

jaunty frigate
summer torrent
#

why?

#

use sftp

wet iron
#

Can someone help me?

#

I want to make my bot send a message to my support server when it joins a server

#

and I dont know how to do that

earnest phoenix
#

ok

wet iron
#

easiest part for me is to send the message

earnest phoenix
wet iron
#

I dont mean that

#

I alredy created that

#

I mean like when my bot joins the server

honest perch
#

on guild create

wet iron
#

hm

#

lemme try

deft condor
unique nimbus
#
vagrant cedar
#

how can i run the bot 24/7 on my ubuntu 20.04 server without having putty open

#

pm2 says my bot is online but it isnt

restive furnace
#

by using docker, like dokku or smh

vagrant cedar
#

how does docker work

vagrant cedar
#

and is it possible to paste in putty

#

because CTRL+V

#

does not work

restive furnace
#

putty is just ssh software

#

it does, you need to ctrl + v and right click

#

just literally right click on putty window, nothing else

vagrant cedar
#

thanks

vale garden
#

hi

#
module.exports = {
    name: 'test',
    description: "test command",
    execute(message, args) {
      const filter = m => m.author.id === message.author.id;
      message.channel.send("ayooo homie wassup boii")
      const collector = message.channel.createMessageCollector(filter, { time: 5000})
      
      collector.on("collect", m => {

        message.channel.send("5678")

      })

      collector.on('end', collected => {

        message.channel.send("lopl")

});

    }
}
#

ik the indenting kinda sucks but this is my command

#

so when i type something after it it says 5678

#

but if i type something or not it always says lopl it the end

#

wait it was supposed to be lol

#

ok nvm

#

how do i make it say lopl only when a message isnt sent after the command

#

@earnest phoenix pls help lo

#

lol

vagrant cedar
quartz kindle
#

you dont need docker, pm2 should work

#

type pm2 log

pure lion
#

Can I have some help with writing a snipe command?

quartz kindle
#

@vale garden when the collector ends, you need to check how many things were collected

#

and only send it if there was nothing collected

vagrant cedar
#

you dont need docker, pm2 should work
@quartz kindle it says online when i start it with pm2 but the bot isnt online on discord

quartz kindle
#

you need to check the pm2 logs to see whats going on

vagrant cedar
#

PM2 | 2020-06-18T17:49:51: PM2 log: App [bot:0] starting in -fork mode-
PM2 | 2020-06-18T17:49:51: PM2 log: App [bot:0] online
PM2 | 2020-06-18T17:52:15: PM2 log: App [bot:1] starting in -fork mode-
PM2 | 2020-06-18T17:52:15: PM2 log: App [bot:1] online

PM2 | 2020-06-18T17:52:15: PM2 log: App [bot:1] online
PM2 | 2020-06-18T17:54:19: PM2 log: Stopping app:bot id:0
PM2 | 2020-06-18T17:54:19: PM2 log: App [bot:0] exited with code [0] via signal [SIGINT]
PM2 | 2020-06-18T17:54:19: PM2 log: pid=3709 msg=process killed
PM2 | 2020-06-18T17:54:24: PM2 log: Stopping app:bot id:1
PM2 | 2020-06-18T17:54:24: PM2 log: App [bot:1] exited with code [0] via signal [SIGINT]
PM2 | 2020-06-18T17:54:24: PM2 log: pid=3821 msg=process killed

vale garden
#

how do i do that

#

srsly lot of this stuff isnt given in guides

#

ok maybe not a lot

#

but this isnt

quartz kindle
#

@vagrant cedar that means your bot is stuck in a restart loop

vagrant cedar
#

how do i fix that @quartz kindle

quartz kindle
#

how many processes do you have in pm2? pm2 ls

vagrant cedar
#

│ id │ name │ mode │ ↺ │ status │ cpu │ memory │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 0 │ bot │ fork │ 0 │ stopped │ 0% │ 0b │
│ 1 │ bot │ fork │ 0 │ stopped │ 0% │ 0b

quartz kindle
#

@vale garden should be something like this: .on("end", collected => { if(!collected.size) { nothing collected } })

vale garden
#

kk thx

quartz kindle
#

@vagrant cedar you have two copies of it with the same name

#

try deleting them both

#

and start a fresh one

vagrant cedar
#

how do i do that

quartz kindle
#

pm2 delete bot

vagrant cedar
#

and now: pm2 run bot.js ?

quartz kindle
#

do pm2 ls again just to make sure there's nothing else left

vagrant cedar
#

id │ name │ mode │ ↺ │ status │ cpu │ memory

#

nothing else is left

quartz kindle
#

ok, now you can do this pm2 start bot.js && pm2 log

#

that should start it and immediatelly open the logs

vale garden
#

tysm

#

it worked

quartz kindle
#

so you can see whats going on

vale garden
#

noicee

vagrant cedar
#

PM2 | 2020-06-18T17:49:51: PM2 log: App [bot:0] starting in -fork mode-
PM2 | 2020-06-18T17:49:51: PM2 log: App [bot:0] online
PM2 | 2020-06-18T17:52:15: PM2 log: App [bot:1] starting in -fork mode-
PM2 | 2020-06-18T17:52:15: PM2 log: App [bot:1] online
PM2 | 2020-06-18T17:54:19: PM2 log: Stopping app:bot id:0
PM2 | 2020-06-18T17:54:19: PM2 log: App [bot:0] exited with code [0] via signal [SIGINT]
PM2 | 2020-06-18T17:54:19: PM2 log: pid=3709 msg=process killed
PM2 | 2020-06-18T17:54:24: PM2 log: Stopping app:bot id:1
PM2 | 2020-06-18T17:54:24: PM2 log: App [bot:1] exited with code [0] via signal [SIGINT]
PM2 | 2020-06-18T17:54:24: PM2 log: pid=3821 msg=process killed
PM2 | 2020-06-18T18:20:07: PM2 log: App [bot:0] starting in -fork mode-
PM2 | 2020-06-18T18:20:07: PM2 log: App [bot:0] online

quartz kindle
#

why is it starting 2 bots?

vagrant cedar
#

i dont know

#

│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ bot │ default │ 1.2.9 │ fork │ 12377 │ 52s │ 0 │ online │ 0.1% │ 49.8mb │ root │ disabled │
└─────┴────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘

#

it shows just one

vale garden
#

i just have one more question

#

how do i collect certain messages

#

only

quartz kindle
#

ah those logs were from before

#

now it looks good, it says its online for 52 seconds

molten yarrow
vale garden
#

kk

vagrant cedar
#

now it looks good, it says its online for 52 seconds
@quartz kindle but now its offline

quartz kindle
#

@vale garden add the condition to the filter

#

for example m.author.id === message.author.id && m.content === "whatever"

#

@vagrant cedar and the logs say nothing?

vagrant cedar
#

no

vale garden
#

ok ok thx

quartz kindle
#

then theres something wrong with your code

#

show your bot.js file

vagrant cedar
#

but why does it start when i use node

#

1 sec

vale garden
#

thnxxx a lot

#

it worked

#

nice

vagrant cedar
#
 * Discord Bot Builder Bot
 * Version 1.2.0
 * Robert Borghese
 */

const Files = require(require('path').join(__dirname, 'js', 'Main.js')).Files;

if(!process.send) {

Files.initStandalone();

} else {

process.on('message', function(content) {
    Files.initBotTest(content);
});

}```
@quartz kindle
pale vessel
restive furnace
#

Main.js show it

#

w/out token ofc

digital ibex
#

im trying to make a save button on my dashboard, how can i save the stuff in the backend?

#

in js

vagrant cedar
#

it doesnt even have the token in it

#
    DiscordJS:  require('discord.js'),
    JIMP:         require('jimp'),
    Bot:         require('./Bot.js'),
    Events:     require('./Events.js'),
    Actions:     require('./Actions.js'),
    Images:     require('./Images.js'),
    Files:         require('./Files.js'),
    Overwrites: require('./Overwrites.js')
};

module.exports = DBM.Bot.DBM = DBM.Events.DBM = DBM.Actions.DBM = DBM.Images.DBM = DBM.Files.DBM = DBM.Overwrites.DBM = DBM;```
#

i think the token is in the bot.js in the js folder

quartz kindle
#

add some logging to it, to see if it shows in pm2 logs

restive furnace
#

also u can try nohup node <yourmainfile>.js &

#

and yes that & end of it

vagrant cedar
#

what does nohup do

restive furnace
#

it means it puts it running it in background

vagrant cedar
#

and how do i stop it when its started in the background

restive furnace
#

kill pid

vagrant cedar
#

pid means

quartz kindle
#

you should be able to see it if you type jobs

restive furnace
#

pid = process id

vagrant cedar
#

root@vps64552:~/bots/channel_lab# nohup node bot.js &
[1] 12782
root@vps64552:~/bots/channel_lab# nohup: ignoring input and appending output to 'nohup.out'

#

now its online

restive furnace
#

now oress ctrl + c

vagrant cedar
#

yes

restive furnace
#

and now u can disconnect from vps

vagrant cedar
#

and how do i find the pid

restive furnace
#

its 12782 as it said on that [1] thingy

vagrant cedar
#

so

#

kill 12782

restive furnace
#

ye

#

then it should go off in few seconds

vagrant cedar
#

okay thanks very much @quartz kindle & @restive furnace

quartz kindle
#

thats basically a replacement for pm2

#

but of course, getting pm2 to work would be better

restive furnace
#

np and yeah, but easier one

vagrant cedar
#

it doesnt work anymore ._.

#

on the moment

#

i closed the console

vale garden
#

this might look dumb

#

but someone pls tell me

#

where i messed up here

#

im getting these kinda responses

restive furnace
#

@vagrant cedar how do you do close the console?

#

F6 is prefered way

pure lion
#

How do I clear the content of a json?

vagrant cedar
#

i just click on the x

#

i try it with f6

pure lion
#

No I mean

restive furnace
#

yeah always close with f6

vale garden
#

can someone help me plz

restive furnace
#

or it basically "shut downs" the vps

#

with x

quartz kindle
#

@pure lion redeclare it

pure lion
#

If I'm making a snipe function, and I want it to clear the file after a period of time

#

Aight

vale garden
#

can someone plz help me in this

vagrant cedar
#
on f6 it does this @restive furnace
#

i use putty

quartz kindle
#

should be aaaa[a] + aaa[a]

#

same with b

vale garden
#

yea i expected something to be wrong there

#

yea but

#

but

restive furnace
#

@vagrant cedar wdym

vale garden
#

i need the values to be added

#

oh wait

#

i have an idea

restive furnace
#

did you do nohup node mainfile.js & and ctrl + c and f6? @vagrant cedar

restive furnace
#

you use bash?

vagrant cedar
#

i dont know xd

restive furnace
#

is that the gui version of putty

vagrant cedar
#

i open putty

#

click on connect

#

it asks for username and password

#

sorry for my english :/

restive furnace
#

PuTTy.exe?

vagrant cedar
#

i think

restive furnace
#

try writing bash in putty

ocean atlas
#

ok its been a long time since ive made a bot

#

and im pissed

#

discordjs changed

#

like

#

everything

restive furnace
#

@vagrant cedar what it says when you logon?

vagrant cedar
#

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Thu 18 Jun 2020 06:35:43 PM CEST

  System load:              0.05
  Usage of /:               8.2% of 31.44GB
  Memory usage:             17%
  Swap usage:               0%
  Processes:                93
  Users logged in:          

 * Ubuntu 20.04 LTS is out, raising the bar on performance, security,
   and optimisation for Intel, AMD, Nvidia, ARM64 and Z15 as well as
   AWS, Azure and Google Cloud.

     https://ubuntu.com/blog/ubuntu-20-04-lts-arrives


49 updates can be installed immediately.
26 of these updates are security updates.
To see these additional updates run: apt list --upgradable``` @restive furnace
restive furnace
#

k

pale vessel
#

ssh moment

restive furnace
#

mehh i dont rly know how you close it, since on fedora 32 you close it with f6 sry

ocean atlas
#

can someone tell me why the fuck this line errors out? according to discord.js documentation its perfect, and my previous knowledge of discord.js doesnt work anymore because FUCKING HELL THEY CHANGED IT TOO MUCH
message.mentions.members.roles.add(message.mentions.members.roles.add(role => role.name === "RF"), 'Given by: ' + message.member.name)

#

even adding in .first() doesnt work

pale vessel
#

wtf

restive furnace
#

bcs its array i think, so first is [0]

pale vessel
#

what did you do

vagrant cedar
#

does any one no how do i close putty without to stop nohup

pale vessel
#

i use screen xd

vagrant cedar
#

what is screen xD

ocean atlas
#

documentation says it returns a collection OR guildmember depending on members mentioned, and .first() would still pull the first mention in a collection

#

and no matter what i try nothing is working

#

why the fuck did they change discord.js

restive furnace
#

i use screen xd
windows or just manually installed?

pale vessel
#

it's a package

#

apt install screen

vagrant cedar
#

so when i installed it

#

what do i have to do

#

Reading state information... Done
screen is already the newest version (4.8.0-1).
0 upgraded, 0 newly installed, 0 to remove and 51 not upgraded.

#

how can i start my bot

#

with screen

#

@pale vessel

pale vessel
#

type screen

#

it should launch a new instance

#

you can start your bot there

vagrant cedar
#

just type node or

pale vessel
#

well, navigate to your bot folder

quartz kindle
#

he already tried pm2 and background process and neither worked, something is wrong somewhere

pale vessel
#

weird

quartz kindle
#

i mean, yeah, maybe screen or tmux will work, but i would look into wtf is going on lmao

pale vessel
#

something must be wrong with the bot code

vagrant cedar
#

but it works if i do

#

node.js

pale vessel
#

if neither of them works

vagrant cedar
#

node bot.js

#

works

pale vessel
#

try screen i guess

vagrant cedar
#

it says

#

press space

#

or return

#

smth

pale vessel
#

press space

vagrant cedar
#

now its empty

#

so

#

i just see

pale vessel
#

launch your bot like normal when the terminal pops up

vagrant cedar
#

root@:~# screen
root@:~# cd bots/channel_lab/
root@:~/bots/channel_lab# node bot.js
Bot is ready!

#

what now

pale vessel
#

now

#

remember this: ctrl+a ctrl+d

vagrant cedar
#

why

#

what i have to do now

pale vessel
#

press Ctrl a and then Ctrl d

vagrant cedar
#

detached

pale vessel
#

it should minimize the screen

#

that's great

#

you can now close your ssh and your bot will continue working

vagrant cedar
#

yes it works

#

thanks

#

very much

pale vessel
#

if you want to go back to the screen, run screen -r

ocean atlas
#

i found my problem

#

fuck the new discordjs tho

pale vessel
#

you tried to add a role to a member by adding a new role

#

you missed first() for the first one and you should've went with .find for the function's first parameter (instead of add)

#

not sure if what i explained make any sense

#
message.mentions.members.**first()**.roles.add(message.**guild.roles.cache.find**(role => role.name === "Hello"), 'Given by: ' + message.member.name)``` would probably work though i'm not sure since i barely touched the new update
#

yeah that definitely did not make any sense why did i even try to explain lol

earnest phoenix
#

That's how I updated my code ^

restive furnace
#

RichEmbed... its v11

earnest phoenix
#

exactly bruh

#

try at least read the rest....

sand thicket
#

Exactly why he said CTRL F.. too easily replace small changes like that.

I made a 1.4k line code bot v11 -> v12 in less than hour using CTRL F and a bit of brain power

earnest phoenix
#

yep

ocean atlas
#

@earnest phoenix im using the official documentation

earnest phoenix
#

good for u ig

pale vessel
#

that's the official migrating guide

earnest phoenix
#

yeah

pale vessel
#

you should read that too

green kestrel
restive furnace
#

lmao

green kestrel
#

This is me earlier

pale vessel
#

shitpost probably

vagrant cedar
#

root@vps64552:~/bots/channel_lab# node bot.js
Bot is ready!
stop
^M

v
^M

ocean atlas
#

can someone please tell me why the fuck this is happening now

vagrant cedar
#

how can

ocean atlas
#
    at Function.normalizeFields (C:\Users\Lenovo E531\node_modules\discord.js\src\structures\MessageEmbed.js:443:8)
    at MessageEmbed.addFields (C:\Users\Lenovo E531\node_modules\discord.js\src\structures\MessageEmbed.js:259:42)
    at MessageEmbed.addField (C:\Users\Lenovo E531\node_modules\discord.js\src\structures\MessageEmbed.js:250:17)
    at Client.client.on (C:\Users\Lenovo E531\Desktop\DiscordRbot\bot.js:46:4)
    at Client.emit (events.js:198:13)
    at WebSocketManager.triggerClientReady (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketManager.js:433:17)
    at WebSocketManager.checkShardsReady (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketManager.js:417:10)
    at WebSocketShard.shard.on.unavailableGuilds (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketManager.js:199:14)
    at WebSocketShard.emit (events.js:198:13)
    at WebSocketShard.checkReady (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketShard.js:467:12)
(node:10132) 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(). (rejection id: 1)```
vagrant cedar
#

i stop my bot

#
Bot is ready!
stop
^M

v
^M






pale vessel
#

Ctrl z

#

root 👀

#

@ocean atlas upgrade node to v12 minimum

vagrant cedar
#

and how can i stop screen

ocean atlas
#

it is v12

#

is it not

pale vessel
#

Ctrl a Ctrl d

ocean atlas
#

oh node

vagrant cedar
#

Ctrl a Ctrl d
@pale vessel stop not close

pale vessel
#

Ctrl z

#

it stops the process the screen is running

vagrant cedar
#

There are several suitable screens on:
13333.pts-0.vps64552 (06/18/2020 06:50:18 PM) (Detached)
13199.pts-0.vps64552 (06/18/2020 06:49:20 PM) (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.

#

i want

ocean atlas
#

@pale vessel its v14.4.0 for node and v12.2.0 for discord.js - why is this bugging

pale vessel
#

ah

#

ic

vagrant cedar
#

to delete them out of there

ocean atlas
#

its still bugging

#

same thing

pale vessel
#

do screen -ls

vagrant cedar
#
        13333.pts-0.vps64552    (06/18/2020 06:50:17 PM)        (Attached)
        13199.pts-0.vps64552    (06/18/2020 06:49:19 PM)        (Attached)
2 Sockets in /run/screen/S-root.
pale vessel
#

which one do you want to delete?

vagrant cedar
#

both

pale vessel
#

do screen -r 13333

#

and then type exit

vagrant cedar
#

root@vps64552:~/bots/channel_lab# screen -r 13333
There is a screen on:
13333.pts-0.vps64552 (06/18/2020 06:50:18 PM) (Attached)
There is no screen to be resumed matching 13333.
root@vps64552:~/bots/channel_lab#

pale vessel
#

do screen -ls again

#

ah

#

wait

vagrant cedar
#

root@vps64552:~/bots/channel_lab# screen -ls
There are screens on:
13333.pts-0.vps64552 (06/18/2020 06:50:18 PM) (Attached)
13199.pts-0.vps64552 (06/18/2020 06:49:20 PM) (Attached)
2 Sockets in /run/screen/S-root.

pale vessel
#

it's attached

vagrant cedar
#

i have to put something

#

behind

pale vessel
#

try running exit

vagrant cedar
#

There is a screen on:
13333.pts-0.vps64552 (06/18/2020 06:50:17 PM) (Attached)
1 Socket in /run/screen/S-root.

#

i stopped on

pale vessel
#

oh

#

type exit

vagrant cedar
#

root@vps64552:~/bots/channel_lab# screen -ls
There is a screen on:
13333.pts-0.vps64552 (06/18/2020 06:50:18 PM) (Attached)
1 Socket in /run/screen/S-root.

#

i want to stop this one

#

ups

#

i did exit 2 times

#

now putty is closed

pale vessel
#

reopen

#

after that check screen -ls again

vagrant cedar
#

no screens are open

#

thanks

pale vessel
#

if you want to close a screen, attach it and run exit

#

if there are multiple screens available, you can attach to one by using screen -r ID. then, you can exit

#

if you want to just close all screen, simply run pkill screen

wet iron
#
2020-06-18T17:26:16.633343+00:00 app[worker.1]: /app/bot.js:33
2020-06-18T17:26:16.633356+00:00 app[worker.1]: const welcome = member.guild.channels.cache.find(channel => channel.name === guildData[member.guild.id].wlcchannel)
2020-06-18T17:26:16.633358+00:00 app[worker.1]:                                                                                                         ^
2020-06-18T17:26:16.633359+00:00 app[worker.1]: 
2020-06-18T17:26:16.633359+00:00 app[worker.1]: TypeError: Cannot read property 'wlcchannel' of undefined
2020-06-18T17:26:16.633360+00:00 app[worker.1]:     at /app/bot.js:33:105
2020-06-18T17:26:16.633361+00:00 app[worker.1]:     at Map.find (/app/node_modules/@discordjs/collection/dist/index.js:160:17)
2020-06-18T17:26:16.633362+00:00 app[worker.1]:     at Client.<anonymous> (/app/bot.js:33:45)
2020-06-18T17:26:16.633363+00:00 app[worker.1]:     at Client.emit (events.js:315:20)
2020-06-18T17:26:16.633363+00:00 app[worker.1]:     at Object.module.exports [as GUILD_MEMBER_ADD] (/app/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js:16:14)
2020-06-18T17:26:16.633364+00:00 app[worker.1]:     at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
2020-06-18T17:26:16.633364+00:00 app[worker.1]:     at WebSocketShard.onPacket (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
2020-06-18T17:26:16.633365+00:00 app[worker.1]:     at WebSocketShard.onMessage (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
2020-06-18T17:26:16.633365+00:00 app[worker.1]:     at WebSocket.onMessage (/app/node_modules/ws/lib/event-target.js:125:16)
2020-06-18T17:26:16.633365+00:00 app[worker.1]:     at WebSocket.emit (events.js:315:20)
``` I get this error
#

but the wlcchannel is defined in json file

#

Can someone help?

pale vessel
wet iron
#

oh

#

but i cant put in msg

pale vessel
#

what do you mean?

wet iron
#

because its guildMemberAdd

pale vessel
#

it's the guildData

wet iron
#

yes

pale vessel
#

make sure that guild id is a property

#

check your json file

wet iron
#

I checked it multiple times

#

and even cleared it

#

but nothing

#

it worked until i uploaded it on heroku

pale vessel
#

why did you clear it?

wet iron
#

I cleared all data

#

and put in {}

#

and it didnt work

#

that was before

pale vessel
#

json "database" on heroku is not possible

#

it will reset once your bot restarts

wet iron
#

well fric

#

I dont have a bot hosting

pale vessel
#

unfortunately

wet iron
#

cause glitch.com doesnt support uptime robot anymore

#

and i tried heroku

#

but

#

nothing

pale vessel
#

people have been saying status cake works

#

not sure though

#

you can either try that or get a remote database

wet iron
#

Im going to try

earnest phoenix
#

how can i see which channel someone left

#

a voice channel?

#

i tried oldMember.channelID but that returns undefined

#

don't make your own properties up lol

#

read the docs

ocean atlas
#

can someone please help me with this? discord.js is 12.2.0 and node is 14.4.0 so idk whats causing this error.

(node:4148) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
    at Function.normalizeFields (C:\Users\Lenovo E531\node_modules\discord.js\src\structures\MessageEmbed.js:443:8)
    at MessageEmbed.addFields (C:\Users\Lenovo E531\node_modules\discord.js\src\structures\MessageEmbed.js:259:42)
    at MessageEmbed.addField (C:\Users\Lenovo E531\node_modules\discord.js\src\structures\MessageEmbed.js:250:17)
    at Client.client.on (C:\Users\Lenovo E531\Desktop\DiscordRbot\bot.js:46:4)
    at Client.emit (events.js:198:13)
    at WebSocketManager.triggerClientReady (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketManager.js:433:17)
    at WebSocketManager.checkShardsReady (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketManager.js:417:10)
    at WebSocketShard.shard.on.unavailableGuilds (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketManager.js:199:14)
    at WebSocketShard.emit (events.js:198:13)
    at WebSocketShard.checkReady (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketShard.js:467:12)
(node:4148) 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(). (rejection id: 1)```
earnest phoenix
#

a voice channel?
@earnest phoenix yes

#

don't make your own properties up lol
@earnest phoenix i know, but it used to work

pale vessel
#

someone left the server or VC?

earnest phoenix
#

left voice channel

pale vessel
#

ah, so the voiceState event

earnest phoenix
#

yes!

pale vessel
#

check the properties

timber linden
pale vessel
#

do you need some kind of help?

earnest phoenix
#

VoiceState#channelID

timber linden
#

Yes

pale vessel
#

okay, what is it?

#

@earnest phoenix it's undefined?

earnest phoenix
#

i tried oldMember.channelID but that returns undefined

timber linden
#

I need help with role management.id=dhhshshshdhdhdh

tepid canyon
#

oldState & newState are the properties

pale vessel
#

it's oldState

tepid canyon
#

not oldMember

pale vessel
#

it's not a member

#

but still, it shouldn't change anything

#

they're just variables

earnest phoenix
#

so

#

oldState.channelID

ocean atlas
#

CAN SOMEONE PLEASE TELL ME WHY DISCORD.JS V12 IS BUGGING OUT WITH MESSAGEEMBEDS?

pale vessel
#

can you show the code?

earnest phoenix
#

me?

pale vessel
#

@ocean atlas relax

tepid canyon
#

what is bugging out about it?

pale vessel
#

yeah

timber linden
#

.

ocean atlas
#

I SENT THE ERROR 3 TIMES NOW

timber linden
#

No spamming.🤡 Develop

ocean atlas
#
(node:4148) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
    at Function.normalizeFields (C:\Users\Lenovo E531\node_modules\discord.js\src\structures\MessageEmbed.js:443:8)
    at MessageEmbed.addFields (C:\Users\Lenovo E531\node_modules\discord.js\src\structures\MessageEmbed.js:259:42)
    at MessageEmbed.addField (C:\Users\Lenovo E531\node_modules\discord.js\src\structures\MessageEmbed.js:250:17)
    at Client.client.on (C:\Users\Lenovo E531\Desktop\DiscordRbot\bot.js:46:4)
    at Client.emit (events.js:198:13)
    at WebSocketManager.triggerClientReady (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketManager.js:433:17)
    at WebSocketManager.checkShardsReady (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketManager.js:417:10)
    at WebSocketShard.shard.on.unavailableGuilds (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketManager.js:199:14)
    at WebSocketShard.emit (events.js:198:13)
    at WebSocketShard.checkReady (C:\Users\Lenovo E531\node_modules\discord.js\src\client\websocket\WebSocketShard.js:467:12)
(node:4148) 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(). (rejection id: 1)```
slender thistle
#

Calm down with the caps

earnest phoenix
#
module.exports = async (bot, oldMember, newMember) => {
console.log(oldMember)
//..
pale vessel
#

upgrade node

ocean atlas
#

I did

timber linden
#

Well might have to copy that script hmm.

ocean atlas
#

its the most updated version there is

#

to my knowledge

pale vessel
#

i'm assuming you're using an event handler

#

with client and args passed

timber linden
#

No I'm not gonna chill

ocean atlas
#

its npm's top version

timber linden
#

Can someone help me with my raid bot?

earnest phoenix
#

I do use a command handler yes

tepid canyon
#

not sure what fields.flat is supposed to do?

pale vessel
#

it's a node thing

timber linden
#

It's called Raid servers bot.

slender thistle
#

... raid bot?

timber linden
#

So people know

pale vessel
#

usually it requires node 12 or above but they said they upgraded to 14

#

which is weird

ocean atlas
#

@pale vessel if your talking about my stuff that error is coming from an embed it sends on launch to me that lists all kinds of important stuff

pale vessel
#

@earnest phoenix an event handler

ocean atlas
#

it used to work just fine on richembed but now its messageembed

amber fractal
#

@ocean atlas just the error wont help, we'll need some code too

earnest phoenix
#

@earnest phoenix an event handler
@pale vessel yes

#

but how to define oldState

ocean atlas
#

@amber fractal the error isnt from my code

#

its from discordjs code

amber fractal
#

Yes, but your code will allow me to look at d.js's source code

smoky spire
#

just the error is fine, he just needs to update his node version to 12 or above

pale vessel
#

change the word Member to State. this shouldn't matter but you should do it for now to avoid confusion

amber fractal
#

and that

timber linden
#

Oh

amber fractal
#

run node -v in your console @ocean atlas

timber linden
#

Kk

pale vessel
#

after that, try console.log(oldState)

earnest phoenix
#

thanks

ocean atlas
#

ok

#

this is it

#
        .setColor('#0099ff')
        .setTitle('Reboot Logs:')
        .setURL()
        .setAuthor('Made by Brotality Gaming#9287', 'https://i.imgur.com/Fz1U2K6.png')
        .setDescription('Rbot has restarted. Here is some info on that:')
        .setThumbnail('https://i.imgur.com/K56dllh.png')
        .addField('​', '​')
        .addField('***Started in:***', `**${launchsecond}` + `**ms`, true)```
#

and its just set to send that on ready

smoky spire
#

@ocean atlas update ur node

earnest phoenix
#

😄

ocean atlas
#

WHY IS EVERYONE TELLING ME TO UPDATE NODE

pale vessel
#

run the command

ocean atlas
#

ITS UP TO DATE

amber fractal
#

Calm down my man

smoky spire
#

Because that's what causing ur error fam

amber fractal
#

tell me what node -v outputs

pale vessel
#

yeah but still, wouldn't hurt to run the command

amber fractal
#

and we can be sure

timber linden
#

Bru what type of bot are u making?

pale vessel
#

^

ocean atlas
#

i just did flaze

#

its up to date

timber linden
#

Bru what type of bot are u making?

ocean atlas
#

and its still erroring

amber fractal
#

Up to date doesnt help

pale vessel
#

show us the output

amber fractal
#

what does it output

timber linden
#

Bru what type of bot are u making?

earnest phoenix
#

but

#

console.log(oldState.channelID)

#

returns undefined now

tepid canyon
#

just log oldState

pale vessel
#

log the base object first

earnest phoenix
#

i did

pale vessel
#

what does it return?

ocean atlas
earnest phoenix
#

a lot of data

#

but cant find the channel

amber fractal
#

npm install node is not how you update node

earnest phoenix
#

anywhere

amber fractal
#

nor is that the version of node

ocean atlas
opaque seal
ocean atlas
#

then how do you update node

tepid canyon
#

displayHexColor is their name colour in chat

amber fractal
#

Depends, do you use node version manager or did you use apt

#

or if on windows

pale vessel
#

that's weird

ocean atlas
#

windows

amber fractal
#

well obviously windows

opaque seal
#

@tepid canyon Doesn't seem to work, my bot has a green color and it logs that the hexColor is #000000

amber fractal
pale vessel
#

channelID should be a property for a member that left a VC (oldState)

#

i'm not sure with this one

earnest phoenix
#

idk

tepid canyon
#

hmmm

inner spruce
#

Anyone here knows how to display for example CPU usage / RAM usage with using PM2?

ocean atlas
#

pm2 damn i havent used that in a while

earnest phoenix
#
module.exports = async (bot, oldState, newState) => {

console.log(oldState.channelID)
// returns undefined ??
opaque seal
#

OldState is the left channel

earnest phoenix
#

I know

pale vessel
#

yeah

earnest phoenix
#

i know

amber fractal
#

pm2 list shows the mem and cpu usage

opaque seal
#

Actually no, even if someone mutes himself, the state cahnges

earnest phoenix
#

but that still return undefined even if i leave a voice channel or anything like that

pale vessel
#

can you send the result in hastebin?

inner spruce
#

pm2 list shows the mem and cpu usage
@amber fractal I mean, I want to display those usages for example in a message

pale vessel
#

the oldState

earnest phoenix
#

me?

ocean atlas
#

doesnt pm2 view show specific application's stats

pale vessel
#

yeah

amber fractal
#

Oh, ram usage isnt that difficult iirc, but cpu usage is very difficult per process

ocean atlas
#

idk its been months since i last did any coding in javascript

inner spruce
#

I have done this before but I have no idea how. I want to access those info and display them in a message (PM2, has this info)

earnest phoenix
#

of oldState @pale vessel

shut swan
#

🔫

pale vessel
#

yeah

ocean atlas
#

my old bot got completely corrupted to updates and i just stopped doing anything with bots since then

pale vessel
#

by the way, newState should be undefined

#

since the member left

#

make sure that's the case too

earnest phoenix
#

I just need to get the channel the use rleft

#

nvm sorry for wasting your time

#

i passed some other variables through i didnt use

#

sorry

long yew
#

who is able to help me with handlers?

pale vessel
#

that's okay

earnest phoenix
#

🙏

pale vessel
#

glad you got it sorted out

earnest phoenix
#

yes

#

i passed a database variable through which i added a few days ago

#

thats why it didnt work

#

because that needed to be after client

#

so oldState was pretty much that variable which doesn't have those properties

#

but thank you for the help.

quartz kindle
#

@inner spruce you can either get info from top/pm2 using a child_process call, or you can gather information from process.cpuUsage() but the latter is not that simple

inner spruce
#

@quartz kindle thanks, but I think that I have found the answer 😄

compact igloo
#

anyone know a good cheap (1 - 2gb ram) vps to 24/7 host my DISCORD.NET bot?

ocean atlas
#

what do i do for bulk deletes

#

discord.js doesnt support bulkDelete methods anymore

stable grail
#

how do i make an error which only should error on a command like !test and it says
please use !test (name)
(in python)
if someone uses only !test

cinder patio
#

check if there are no arguments

stable grail
#

im not sure how to do it

#

i was thinking about
if
code
else:
error message

cinder patio
#

that sounds about right

stable grail
#

im not sure how to check it with if

earnest phoenix
#
    let muteTime = args[args.length - 1];
    if(parseInt(muteTime) == null) return muteTime = ??;

How i can delete the muteTime

cinder patio
#

set it to undefined or null, though I don' see a point sine you return, muteTime won't be used further

restive furnace
#

muteTime = parseInt(muteTime) : parseInt(muteTime) ? "??"

long yew
#

can someone help me make a simple poll command?

quartz kindle
earnest phoenix
#

yes

#

i wont return it

#

but

#

so i have to set it undefiened ?

stable grail
#

can someone help me about my problem?

earnest phoenix
#

How can i learn members size of all voice channels from all servers!?