#development

1 messages Β· Page 1654 of 1

lyric mountain
#

nosql is actually good for everything that doesn't have relationships

woeful pike
#

reddit has a very good article on how they used redis to make r/place work smoothly. Sometimes u get perfect use cases like that it's pretty cool

quartz kindle
#

redis is a very interesting piece of software, precisely because it makes your data design matter even more than it normally does

#

it forces you to design your structures yourself

opal plank
#

thats precisely why i said keydb is overkill

#

redis is already amazing

quartz kindle
#

keydb is nothing more than a multithreaded redis

opal plank
#

basically yeah

#

but the performance gain is absurd

quartz kindle
#

wont do shit if you dont have the cpu cores to back it

opal plank
#

well yeah of course

modest maple
#

Redis can already scale to millions of ops a sec dont see why you necessarily need another system for it

opal plank
#

but the assumption is: if you scaling to have a need for this, you should already have a decent server to run it

modest maple
#

Unless KeyDB makes scaling and load balancing easier and drop in replacement shrug

opal plank
#

im having to use it for my current job

#

its insanely fast

#

though i dont think it'll ever need that, its more future proofing

modest maple
#

The only issue i have with redis is that it needs to be scaled like a full multi cluster system from the very start to be performant

#

atleast in my experience getting decent performance from it without treating it like your reddit can be pretty poop

desert hazel
opal plank
#

opus is deprecated a long ass time iirc

desert hazel
#

oh

#

whats the new alternative

modest maple
#

you mean opusnpm?

desert hazel
#

yeah

#

the npm opus

opal plank
#

isnt node-opus the new one?

modest maple
#

not opus the encoder itself πŸ˜…

desert hazel
#

idk the one discord js uses

opal plank
#

this?

desert hazel
#

idek

#

it just used to work now it dont lol

opal plank
#

check it then

#

looks deprecated to me

desert hazel
#

damn lol

opal plank
#

check the one i sent instead

#

or find a fork of it

#

if you arent using discord.js

#

prism should be an alternative too

desert hazel
#

that is new error

#

npm node-opus

#

ill try taht

#

nope

#

tells me to use discordjs/opus

modest maple
#

it's likely something todo with your build tools

#

cuz i can install it fine

desert hazel
#

FUCK BUILD TOOLS

#

I DONT UNDERSTNAD THEMMMMMMMMM

modest maple
#

What OS are you on?

desert hazel
#

how do i install them again?

#

debian

modest maple
#

what architecture?

desert hazel
#

10

#

debian 10

modest maple
#

thats not the architecture...

desert hazel
#

oh

#

node -v?

modest maple
#

what is the os architecture

#

e.g

desert hazel
#

ohhh

#

erm

modest maple
#

AMD x64

desert hazel
#

lemme check ovh

modest maple
#

32x86

#

ARm

desert hazel
#

RISE-1 - Intel Xeon E3-1230v6 - RAM 32GB LEG - 2x HDD SATA 2TB Enterprise Class Soft RAID

#

@modest maple

modest maple
#

run

#

uname -r

#

and send the result

desert hazel
modest maple
#

hmm okay so the deps should be fine

#

what node version r u on?

desert hazel
#

15.8.0

modest maple
#

hmmm, we idk then cant help you much more than that

desert hazel
#

am i on a too uptodate version

unreal estuary
#

what easy things do you find in javascript that need a long amount of code

#

lol

#

anything else

#

im making my first npm package but idk what to add lmao

modest maple
#

if you dont know what to add then dont make an npm package

#

the eco system's already choked to death with useless packages doesnt need anymore

unreal estuary
#

i need something to do

#

am i harming the eco system by making a package

#

i apologise

#

guess ill just not do anything and continue my depression

solemn latch
#

or just do anything else? πŸ‘€

unreal estuary
#

nope

#

continue my depression

#

(:

quartz kindle
#

make github packages instead

#

they dont hurt anyone, and they make your github profile look more interesting, with many repositories and projects

unreal estuary
#

what's a github package?

#

also how do npm packages harm ppl im not aware

quartz kindle
#

simply make a github repository and put your code there

#

if you want people to use it, they can install it directly from there

#

for example npm install githubusername/packagename

unreal estuary
#

ohh ok

#

ill do that

quartz kindle
#

the problem with polluting npm is that there are millions of useless packages in there

#

and when you're working on serious projects, its difficult to find useful packages because of that, so its better to only put stuff on npm if they are actually useful and have a purpose

unreal estuary
#

how do i delete my package?

quartz kindle
unreal estuary
#

thanks

simple zodiac
#

anyone know how bots like mee6, carl bot, dyno, etc have like,, interactive dashboards on their websites? I want to add one to mine (if its somewhat easy) but i have honestly no idea how they would. thx

earnest phoenix
simple zodiac
modest maple
#

might have a hard time then bloblul

simple zodiac
modest maple
#

never a bad time to learn though

earnest phoenix
modest maple
#

Pycharm has died sad

quartz kindle
#

dieded

simple zodiac
#

if you know of a way though (maybe a tutorial?) do send it because i have a friend in the same situation (they have a bot & want to make a dashboard & stuff like that) that DOES know web dev

quartz kindle
#

first decide on one of two paths:
shared database or direct access

earnest phoenix
#

they can be fairly easy to add, you just need to have a little know how

quartz kindle
#

with a shared database, you have a bot with a database, then a website with the same database. the bot and the website do not talk to each other

simple zodiac
#

what would be better

quartz kindle
#

with a direct access, you have a website and a bot running together, so the website has direct access to the bot's variables

earnest phoenix
#

then you would need to think about the auth part so users can login ect

modest maple
#

or just use a gateway, but thats a lil more complicated to setup bloblul

quartz kindle
#

a shared database is safer and prevents downtime, direct access is easier, faster but will die if your bot dies

simple zodiac
#

mhm ok

modest maple
#

I think it's twilight crashing pycharm

#

how fucking big is this repo

quartz kindle
#

you can also use a shared database with a rest api for direct access, depending on what you need, essentially getting the best of both

unreal estuary
#

also u spelt explore wrong if u didnt see it

quartz kindle
simple zodiac
earnest phoenix
#

πŸ˜‚

boreal iron
#

@quartz kindle What would you consider as bridge between a njs app (without webserver) and events I sent from another njs project, PHP etc.

modest maple
#

this is why it's still in development blob_salute

unreal estuary
quartz kindle
#

one way, two way?

boreal iron
#

Yeah one way

quartz kindle
#

does the app need to be in a separate process?

boreal iron
#

Well a response (two way) would be the next step after

modest maple
#

how are you planning to serve your php files without a webserver exactly...

boreal iron
#

It’s a separate process, yeah

quartz kindle
#

if it needs to be a separate process, then your only options are a webserver for rest api or tcp/websocket

#

if both processes are on the same machine, you can use unix sockets

#

thats the fastest you can get

boreal iron
#

Hmm expected this answer already, darn

#

Is there any non-webserver/socket solution?

quartz kindle
#

write file, read file

#

lmao

boreal iron
modest maple
#

why are you so intent on not using a web server

quartz kindle
#

why not unix socket tho?

modest maple
#

you litterally need one to serve the site

quartz kindle
#

unix socket is pretty much a file stream, it doesnt even go through the network stack

#

aka ipc

#

well another option is a pub/sub database, like redis

boreal iron
#

Hmm the app is listening to rcon events it gets from gameservers.
Additionally to that it has to send requests to the opened connections whenever a user input in needed.
Multiple sockets...

quartz kindle
#

run the app in a child process or a worker thread and use the built-in ipc

boreal iron
#

These user inputs simply call a function with args the main app will process if the sockets to the gameservers are alive

supple shale
#

hello

sudden geyser
#

why hello there

boreal iron
#

Hmm will take a look into it

supple shale
#

idk

boreal iron
#

Ty will be back to you once it’s happening πŸ‘€

#

I guess it will take a while until the proper framework is done

low moat
#

I absolutely scuffed up my command handler and forgot how to do it. Anyone here that can help?

solemn latch
#

πŸ‘€ are you not using git to revert, or see your old code?

low moat
#

ThonkEyes no.

#

don't judge me okay i'm new sadboi

solemn latch
#

might want to start doing that.

final tinsel
#

i don't think you will get any help here only trolls and people that judge you are on this channel

low moat
#

been to like 7 discords and this is my last resort before i delete the bot and start again lol

solemn latch
#

I mean, its kind of a troll question.
if he set up a command handler before, he should be able to do it again

#

if you have a specific question about an issue I might be able to help, or someone else might be able to, but "i broke x, help!" isnt a properly formed dev question.

low moat
#

well then

final tinsel
#

se

fallen roost
#

what was it?

final tinsel
#

only people that judge

fallen roost
#

link*

low moat
#

like i need to start from scratch with a command handler

#

a completely new one

solemn latch
#

what library πŸ‘€

#

whats not working? whats your errors?

final tinsel
#

libary?

solemn latch
#

all the other ones

low moat
solemn latch
#

what part of the command handler isnt working?

low moat
#

everything

#

everything to do with it

solemn latch
#

okay, upload index.js to like, pastebin.
or grab the relevant code and post it here(no tokens plox)

fallen roost
#

@low moat bruh i fail to understand what's going on

#

show ut code

low moat
fallen roost
#

computers doing exactly what we tell them is both a curse and a boon

#

smh

low moat
# solemn latch okay, upload index.js to like, pastebin. or grab the relevant code and post it h...

wait before i do. When I start up the bot it seems to say this:

[nodemon] restarting due to changes...
[nodemon] starting node ./src/bot.js
(node:21024) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)
Nonay Is Now Doing It's Thing

It never mentions anything to do with Index.js starting up. Could this be the fact that I need to start Index.js up instead of bot.js? (Bot.js is where ALL of my code is and Index.js is just there for command handling. I feel like that is VERY wrong)

solemn latch
#

πŸ‘€ thats an error message btw

low moat
#

glad to hear

solemn latch
#

the issue is you are probably making a new event listener for EVERY command

#

you only need one event listener for commands.

#

client.on("message", message => {})
^ this is an event listener

#

you only need one.

low moat
#

wait let me check

opal plank
#

imagine only having 1 event listener

fallen roost
#

did u loop it or something?

low moat
solemn latch
#

πŸ‘€

fallen roost
#

bruuuuuuuh

opal plank
low moat
#

I have 10973 lines of code in one file because of my command handler messing up as well as 6 million event listeners

solemn latch
#

what in the world are you doing in your bot πŸ‘€

opal plank
#

this is why we said you shouldnt code without learning the foundation first

low moat
quaint wasp
solemn latch
#

honestly πŸ‘€ dont know how to help with that

quaint wasp
#

how do I.. Define cleint. I think its defined correctly..

opal plank
#

imagine doing this

quaint wasp
#

..

low moat
quaint wasp
#

bruh

final tinsel
opal plank
#

instead of this

solemn latch
#

looks like your error is unsupported client, not client defined incorrectly

opal plank
opal plank
quaint wasp
#

what?

#

what does that mean

crimson vapor
#

erwin is cringe

opal plank
#

writing your own command handler bad tho lol

crimson vapor
#

ads for detritus

solemn latch
opal plank
#

should i hit them with the advertisement?

quaint wasp
solemn latch
#

im ready for the ad erwin

quaint wasp
#

..

low moat
crimson vapor
opal plank
#

im just bitching cuz you need to write your own handler, detritus has one that automatically pulls all commands for you, just tell it the folder you got your commands in

quaint wasp
slim heart
#

moment

opal plank
#
  client.addMultipleIn('../src/commands', { subdirectories: true })```
done, imported all commands
fallen roost
quaint wasp
#

?

slim heart
#

erwin, lazy at code?

#

pog

opal plank
#

i wrote my own handler before, mind you i used d.js before detritus

slim heart
#

yeah but what's so wrong with just loading the commands urself

fallen roost
#

that if else freaked out

quaint wasp
crimson vapor
#

@earnest phoenix blocked by erwin gang

slim heart
#

@opal plank million asked if u could unblock him

opal plank
#

no thanks

low moat
crimson vapor
#

pog

earnest phoenix
opal plank
#

@quaint wasp ^^

quaint wasp
#

ya im looking.

#

..

slim heart
#

seems a bit too much tbh

#

could be bloated

opal plank
#

that comes built in with the lib

quaint wasp
#

dang I cant send just a dot now.

opal plank
#

could

quaint wasp
#

It got deleted like 12 times now.

#

.

opal plank
#

try it first, then talk shit

quaint wasp
#

yet

slim heart
#

i did try it lol

opal plank
#

you couldnt even get it to work last time you said

slim heart
#

might be the reason that it runs like 2GB while rose runs 1.3GB

#

mmlol

#

i got it to work

#

by basically copy and pasting notabot

quaint wasp
opal plank
#

rode is too crude imo

opal plank
#

i use it, but im not the one who wrote it

quaint wasp
#

.

#

oh

#

ye

opal plank
#

that comes with the library for YOU to use it

quaint wasp
#

oh, well, I still have the error.. of unopported client

slim heart
#

i did it with the exact same caching settings too

low moat
#
  throw err;
  ^

Error: Cannot find module './config.json'
Require stack:
- C:\Users\User\nbot\src\bot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (C:\Users\User\nbot\src\bot.js:8:16)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'C:\\Users\\User\\nbot\\src\\bot.js' ]
}
[nodemon] app crashed - waiting for file changes before starting...```

I think dead on the inside is a bit of an understatement at this point
quaint wasp
#

idk how to fix it tho

slim heart
#

idk

quaint wasp
slim heart
#

im sick of the detritus vs my lib cuz it feels bitchy since i made my lib, but it just seems legitimately weirdly off

opal plank
#

you would probably better off talk to cake, but i sent you the invite over 50 times and not once you joined to talk with the dev, i assume its pride getting in the way to ask them about stuff rather than assuming im probably doing this right instead of asking them

quaint wasp
#

and then create folder in the folder that code is.

low moat
quaint wasp
#

welcome.

#

πŸ™‚ im not useless.

opal plank
slim heart
#

my issue is that its not something im actively pursuing and i've heard bad things of cake before especially in these types of situations so idk if it's something i really want to get into

opal plank
#

ive been talking to cake and evan quite often, they are always actively helping, personally im quite fond of them since they're always trying to aid new users

slim heart
#

never talked to them just what i've heard

opal plank
#

not my fault if you entrust rumors rather than talking to them yourself

#

Β―_(ツ)_/Β―

#

ive done my part

#

sent you to their server

#

their docs

#

and their code

#

if you didnt join, not my problem

slim heart
#

ikik

opal plank
#

just pls, dont complain about me comparing detritus to your lib, partially thats your own fault since you're actively the one comparing it, alongside with million

slim heart
#

i rarely even go in this channel so

quartz kindle
#

all your libs are belong to us

slim heart
#

its urs tim

#

transfering ownership rn

crimson vapor
#

wait what in the fuck

quartz kindle
#

lmao

crimson vapor
#

I wanted to do memory tests on detritus

#

commands don't work without roles cache

low moat
#

right. Can someone explain to me what the 'aliases' is...thank u.

solemn latch
#

other names for the command

#

!ping
and
!p

#

for example

slim heart
low moat
#

so if this is the code and i'm getting an error message like this:

No Command Found!

What in the world am i doing wrong...

crimson vapor
#

sending a message without a command

final tinsel
crimson vapor
low moat
#

sending a message without a command

#

alright

#

my window do be looking kinda hot today

final tinsel
low moat
crimson vapor
#

you included the prefix in it

low moat
solemn latch
#

in both usage and aliases

low moat
solemn latch
#

is your command file being saved?

#

is it in the right folder?

low moat
#

i think so

#

yeah

solemn latch
sour flame
#
const{  MessageEmbed, Client, Collection } = require('discord.js');
class ModmailClient extends Client {
    constructor(){
        super();
        /*
        Dependencies
        */
       this.path = require('path')
       this.discord = require('discord.js')
       this.fs = require('fs')
       /*
       Collections
       */
      this.commands = new Collection();
      this.threads = new Collection();
      /*
      Constants
      */
     this.prefix = "m!";
    }
    commandHandler(path) {
        this.fs.readdirSync(this.path.normalize(path)).map((f) => {
            const File = require(this.path.join(__dirname, `..`, path, f))
            this.commands.set(File.name, File);
        });
    }
    getCommand(cmd) {
        return this.commands.has(cmd) ? this.commands.get(cmd) : false;
    }
    start(token, path){
        this.commandHandler(path);
        this.login(token);
        this.on('ready', () => {
            console.log("I'm now  online")
        });
        this.on('message', async(message) => {
            if(message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(this.prefix)) return;
            const args = message.contect.slice(this.prefix.lenght).time().spilt(/ +/g);
            const cmd = args.shift().toLowerCase();
            const command = this.getCommand(cmd);
            if(command) return command.run(this, message, args).catch(console.error);
        })
    };
    embed(data, message) {
        return new MessageEmbed(data).setFooter(message.author.tag, message.author.displayAvatarURL({ dynamic: true, format: "png" }));
    }
}
module.exports = ModmailClient
``` Did I go somewhere wrong with cofing here?
#

*coding

low moat
earnest phoenix
#

is there a way to send a message when my bot goes offline?

low moat
# solemn latch op, found it. you have no categories added
Require stack:
- C:\Users\User\nbot\src\bot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at C:\Users\User\nbot\src\bot.js:21:23
    at Array.forEach (<anonymous>)
    at C:\Users\User\nbot\src\bot.js:19:13
    at FSReqCallback.oncomplete (node:fs:190:23) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'C:\\Users\\User\\nbot\\src\\bot.js' ]
}
[nodemon] app crashed - waiting for file changes before starting...```
#

this is the message i get

solemn latch
#

'./commands/misc/test.js'
is your test.js in this location?

solemn latch
#

can you show me?

low moat
solemn latch
#

and this is happening in index.js?

low moat
#

that is where everything is

sacred aurora
#

../ then

sour flame
#

Yo when your coding modmail bot do you need to have a config.json?

solemn latch
#

../ moves up one directory

low moat
#

so i set it to this

solemn latch
#

yep, should be it

low moat
#

and now my PC wants to kill me and i want to kill it

[nodemon] starting `node ./src/bot.js`
(node:23460) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
C:\Users\User\nbot\src\bot.js:18
      if (error) throw new Error(`Error In Command - Command Handler\n${error}`);
                       ^

Error: Error In Command - Command Handler
Error: ENOENT: no such file or directory, scandir 'C:\Users\User\commands\misc'
    at C:\Users\User\nbot\src\bot.js:18:24
    at FSReqCallback.oncomplete (node:fs:190:23)
[nodemon] app crashed - waiting for file changes before starting...```
#

error message again smh

cunning gorge
#

I am trying to access my json file with a variable:
Type arena.warrior works however, a variable that has a string "warrior" when appended to arena such as:
arena.className where const className = "warrior"; returns undefined?

quaint wasp
#

imagine coding like this:

Discord.on('ready', () => {
      console.log(`Logged in as ${Discord.user.tag}!`);
});

Discord.on(    'guildMemberAdd'    , function        (member) {
        for (var i = 0; i < 10; i++) {
                                                member
                    .client
            .guilds
                                                    .get(member.guild.id)
                    .members
                                    .get(member.id)
                            
        .send('Welcome in ' + member.guild.name + '!');
}
});```
cunning gorge
#

wdym exactly

low moat
cunning gorge
#

arena.className

#

that returns undefined

final tinsel
cunning gorge
#

arena.warrior is fine

solemn latch
#

πŸ‘€

cunning gorge
#

Oh

#

const arena = require('./arena.json');

#

here

#

my bad

solemn latch
cunning gorge
#

Yea I had that

final tinsel
#

i do not now good english and coding is bad for me

cunning gorge
#

By directory you mean? Sorry πŸ˜…

#

code and what it logged

#

is this it?

#

So as you can see className logs warrior

#

and is type string

#

?

#

that's what is logged on terminal after code being ran

low moat
#

Okay let me restart, I am trying to make a command handler, if someone is willing to help me out please DM me as it is easier. πŸ˜„ I will send you all of the screenshots you need etc. as i have been getting error message after error message

[nodemon] starting `node ./src/bot.js`
(node:23460) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
C:\Users\User\nbot\src\bot.js:18
      if (error) throw new Error(`Error In Command - Command Handler\n${error}`);
                       ^

Error: Error In Command - Command Handler
Error: ENOENT: no such file or directory, scandir 'C:\Users\User\commands\misc'
    at C:\Users\User\nbot\src\bot.js:18:24
    at FSReqCallback.oncomplete (node:fs:190:23)
[nodemon] app crashed - waiting for file changes before starting...```
^^ Error message
sour flame
#
const{  MessageEmbed, Client, Collection } = require('discord.js');
class ModmailClient extends Client {
    constructor(){
        super();
        /*
        Dependencies
        */
       this.path = require('path')
       this.discord = require('discord.js')
       this.fs = require('fs')
       /*
       Collections
       */
      this.commands = new Collection();
      this.threads = new Collection();
      /*
      Constants
      */
     this.prefix = "m!";
    }
``` My modmail bot constructor
cunning gorge
#

the className simply holds a string called "warrior"

low moat
sacred aurora
#

Sure

cunning gorge
#
          const className = `${pages[page].title.charAt(0).toLowerCase() + pages[page].title.substring(1, pages[page].title.length)}`;

it's that but all it returns is "warrior" @gritty tartan

sacred aurora
#

Its seems upping the directory too much

cunning gorge
#

And the terminal ss shows that

low moat
solemn latch
sacred aurora
#

But the error is in line 18 @solemn latch

solemn latch
#

heck

sacred aurora
#

Oh

#

Yeah i guess :v

low moat
#
[nodemon] starting `node ./src/bot.js`
(node:10700) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
C:\Users\User\nbot\src\bot.js:18
      if (error) throw new Error(`Error In Command - Command Handler\n${error}`);
                       ^

Error: Error In Command - Command Handler
Error: ENOENT: no such file or directory, scandir 'C:\Users\User\commands\misc'
    at C:\Users\User\nbot\src\bot.js:18:24
    at FSReqCallback.oncomplete (node:fs:190:23)
[nodemon] app crashed - waiting for file changes before starting...```
#

a new error yipee

sacred aurora
#

Nah its the same

low moat
#

wt...

low moat
sacred aurora
#

Its the path bruh

low moat
#

the path? It needs changing to something?

magic orbit
#

Ω‡Ψ§ΩŠ

sacred aurora
#

From the error its seems to read
C:\Users\User\commands\misc

#

But it should be
C:\Users\User\nbot\commands\misc

#

?

#

Hmm

sour flame
#

nothing

low moat
#
Require stack:
- C:\Users\User\nbot\src\bot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at C:\Users\User\nbot\src\bot.js:21:23
    at Array.forEach (<anonymous>)
    at C:\Users\User\nbot\src\bot.js:19:13
    at FSReqCallback.oncomplete (node:fs:190:23) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'C:\\Users\\User\\nbot\\src\\bot.js' ]
}
[nodemon] app crashed - waiting for file changes before starting...```
#

typed in the new path i assume it needs 3 dots?

sacred aurora
#

Nope

solemn latch
#

just put all the dots πŸ‘€

#

............................../

sacred aurora
#

:v welp

solemn latch
#

im joking btw

sacred aurora
#

try just one

low moat
#

alr

#
(Use `node --trace-warnings ...` to show where the warning was created)
C:\Users\User\nbot\src\bot.js:18
      if (error) throw new Error(`Error In Command - Command Handler\n${error}`);
                       ^

Error: Error In Command - Command Handler
Error: ENOENT: no such file or directory, scandir 'C:\Users\User\nbot\nbot\commands\misc'
    at C:\Users\User\nbot\src\bot.js:18:24
    at FSReqCallback.oncomplete (node:fs:190:23)
[nodemon] app crashed - waiting for file changes before starting...```
we r getting somewhere now
#

sort of

sacred aurora
#

Tf

low moat
#

2 nbots?

#

why 2

#

this computer high

sacred aurora
#

and whats the path now

#

On your script

low moat
sacred aurora
#

Change the read dir to ../

#

And leave the command require like that

low moat
#
- C:\Users\User\nbot\src\bot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at C:\Users\User\nbot\src\bot.js:21:23
    at Array.forEach (<anonymous>)
    at C:\Users\User\nbot\src\bot.js:19:13
    at FSReqCallback.oncomplete (node:fs:190:23) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'C:\\Users\\User\\nbot\\src\\bot.js' ]
}
[nodemon] app crashed - waiting for file changes before starting...```
low moat
sacred aurora
#

Its not full

low moat
#
[nodemon] starting `node ./src/bot.js`
(node:1092) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/modules/cjs/loader:924
  const err = new Error(message);
              ^

Error: Cannot find module './nbot/commands/misc/test.js'
Require stack:
- C:\Users\User\nbot\src\bot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at C:\Users\User\nbot\src\bot.js:21:23
    at Array.forEach (<anonymous>)
    at C:\Users\User\nbot\src\bot.js:19:13
    at FSReqCallback.oncomplete (node:fs:190:23) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'C:\\Users\\User\\nbot\\src\\bot.js' ]
}
[nodemon] app crashed - waiting for file changes before starting...```
sour flame
#
      /*
      Constants
      */
     this.prefix = "m!";
    }
``` How I set my prefix and it isn't working
final tinsel
sacred aurora
#

change the require too then :v

sour flame
#

or Client.js

low moat
#
[nodemon] starting `node ./src/bot.js`
(node:4752) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
C:\Users\User\nbot\src\bot.js:21
        let command = then(`./nbot/commands/${Category}/${file}`);
                      ^

ReferenceError: then is not defined
    at C:\Users\User\nbot\src\bot.js:21:23
    at Array.forEach (<anonymous>)
    at C:\Users\User\nbot\src\bot.js:19:13
    at FSReqCallback.oncomplete (node:fs:190:23)
[nodemon] app crashed - waiting for file changes before starting...```
sacred aurora
#

Change it to ../

lyric mountain
#

If if if if if

#

Don't yancode

sour flame
#

@final tinsel want the whole code?

final tinsel
sour flame
#

here

low moat
# sacred aurora Change it to ../
[nodemon] starting `node ./src/bot.js`
(node:16444) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
C:\Users\User\nbot\src\bot.js:21
        let command = then(`../nbot/commands/${Category}/${file}`);
                      ^

ReferenceError: then is not defined
    at C:\Users\User\nbot\src\bot.js:21:23
    at Array.forEach (<anonymous>)
    at C:\Users\User\nbot\src\bot.js:19:13
    at FSReqCallback.oncomplete (node:fs:190:23)
[nodemon] app crashed - waiting for file changes before starting...```
sacred aurora
#

Wth

#

Not then

#

require

sour flame
#
const{  MessageEmbed, Client, Collection } = require('discord.js');
class ModmailClient extends Client {
    constructor(){
        super();
        /*
        Dependencies
        */
       this.path = require('path')
       this.discord = require('discord.js')
       this.fs = require('fs')
       /*
       Collections
       */
      this.commands = new Collection();
      this.threads = new Collection();
      /*
      Constants
      */
     this.prefix = "m!";
    }
    commandHandler(path) {
        this.fs.readdirSync(this.path.normalize(path)).map((f) => {
            const File = require(this.path.join(__dirname, `..`, path, f))
            this.commands.set(File.name, File);
        });
    }
    getCommand(cmd) {
        return this.commands.has(cmd) ? this.commands.get(cmd) : false;
    }
    start(token, path){
        this.commandHandler(path);
        this.login(token);
        this.on('ready', () => {
            console.log("I'm now  online")
        });
        this.on('message', async(message) => {
            if(message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(this.prefix)) return;
            const args = message.contect.slice(this.prefix.lenght).time().spilt(/ +/g);
            const cmd = args.shift().toLowerCase();
            const command = this.getCommand(cmd);
            if(command) return command.run(this, message, args).catch(console.error);
        })
    };
    embed(data, message) {
        return new MessageEmbed(data).setFooter(message.author.tag, message.author.displayAvatarURL({ dynamic: true, format: "png" }));
    }
}
module.exports = ModmailClient
``` here is the code @final tinsel
sacred aurora
#

Fuk how do i say that

lyric mountain
#

What's the error?

low moat
# sacred aurora require
[nodemon] starting `node ./src/bot.js`
[nodemon] restarting due to changes...
[nodemon] starting `node ./src/bot.js`
(node:19988) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/modules/cjs/loader:924
  const err = new Error(message);
              ^

Error: Cannot find module '../nbot/commands/misc/test.js'
Require stack:
- C:\Users\User\nbot\src\bot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at C:\Users\User\nbot\src\bot.js:21:23
    at Array.forEach (<anonymous>)
    at C:\Users\User\nbot\src\bot.js:19:13
    at FSReqCallback.oncomplete (node:fs:190:23) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'C:\\Users\\User\\nbot\\src\\bot.js' ]
}
[nodemon] app crashed - waiting for file changes before starting...```
sour flame
solemn latch
#

he meant change require to the same path

lyric mountain
#

Show that command's code

sour flame
#
const Client = require('../structures/Client');
const { Messege, ReactionUserManager } = require('discord.js');
module.exports = {
    name: `ping`, 

    /**
     * @param {Client} client
     * @param {Message} message
     * @param {String[]} args
     */
    run: async(client, message, args) => {
        const msg = await message.channel.send(`Pinging..`);
        await msg.edit(client.embed({
            title: `Pong!`, //Happens after the title of Pinging
            description: `WebSocket ping is ${client.ws.ping}MS!\nMessage edit ping is ${msg.createdAt}`
        }, message));
        await msg.edit("");
    }
}
``` The command code
lyric mountain
#

Do you get any error?

sour flame
#

no

#

it just insent working

lyric mountain
#

Btw, why that edit at the end?

#

You're clearing the message content

#

But anyway, put console.log("reached") at the first line inside that command

#

Right inside run

#

Before const msg

sour flame
#

kk

lyric mountain
#

Does it appear in the console?

sour flame
#

one sec

#

#Yes

#
(node:12420) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:12420) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'slice' of undefined
    at ModmailClient.<anonymous> (C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:38:42)
    at ModmailClient.emit (events.js:310:20)
    at MessageCreateAction.handle (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (events.js:310:20)
    at Receiver.receiverOnMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\ws\lib\websocket.js:825:20)
(node:12420) 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: 2)
``` The error
lyric mountain
#

So you had errors...

#

Cannot slice something undefined

#

Are you running tge right command?

sour flame
#
        this.on('message', async(message) => {
            if(message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(this.prefix)) return;
            const args = message.contect.slice(this.prefix.lenght).time().spilt(/ +/g);
            const cmd = args.shift().toLowerCase();
            const command = this.getCommand(cmd);
            if(command) return command.run(this, message, args).catch(console.error);
``` This in Client.js has slice. Only one
quartz kindle
#

message.contect

solemn latch
#

const args = message.contect.slice(this.prefix.lenght).time().spilt(/ +/g);
contect not content

#

i said it backwards but you get the point πŸ‘€

sour flame
#
(node:12420) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'slice' of undefined
    at ModmailClient.<anonymous> (C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:38:42)
    at ModmailClient.emit (events.js:310:20)
    at MessageCreateAction.handle (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (events.js:310:20)
    at Receiver.receiverOnMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\ws\lib\websocket.js:825:20)
(node:12420) 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: 3)
``` I use the command this happens
#

agian

solemn leaf
#

Can I get some help with .env in repl.it

sour flame
#
const{  MessageEmbed, Client, Collection } = require('discord.js');
class ModmailClient extends Client {
    constructor(){
        super();
        /*
        Dependencies
        */
       this.path = require('path')
       this.discord = require('discord.js')
       this.fs = require('fs')
       /*
       Collections
       */
      this.commands = new Collection();
      this.threads = new Collection();
      /*
      Constants
      */
     this.prefix = "m!";
    }
    commandHandler(path) {
        this.fs.readdirSync(this.path.normalize(path)).map((f) => {
            const File = require(this.path.join(__dirname, `..`, path, f))
            this.commands.set(File.name, File);
        });
    }
    getCommand(cmd) {
        return this.commands.has(cmd) ? this.commands.get(cmd) : false;
    }
    start(token, path){
        this.commandHandler(path);
        this.login(token);
        this.on('ready', () => {
            console.log("I'm now  online")
        });
        this.on('message', async(message) => {
            if(message.author.bot || !message.guild || !message.content.toLowerCase().startsWith(this.prefix)) return;
            const args = message.content.slice(this.prefix.lenght).time().spilt(/ +/g);
            const cmd = args.shift().toLowerCase();
            const command = this.getCommand(cmd);
            if(command) return command.run(this, message, args).catch(console.error);
        })
    };
    embed(data, message) {
        return new MessageEmbed(data).setFooter(message.author.tag, message.author.displayAvatarURL({ dynamic: true, format: "png" }));
    }
}
module.exports = ModmailClient
``` This is the code for Clientjs
solemn leaf
#

Nobody asked for you to spam

earnest phoenix
#

That formatting hurts

solemn leaf
#

and why do you do /* is it is only 1 line

earnest phoenix
solemn leaf
#

volt

earnest phoenix
#

aki

solemn leaf
#

.env

earnest phoenix
#

pepehmmNoBG ?

solemn leaf
#

I need help

earnest phoenix
solemn leaf
#

ye

earnest phoenix
#

What's wrong

solemn leaf
#

idfk

#

I have it as the examples in the docs

#

exactly

#

and it returns null

earnest phoenix
#

May you show us how you are using it?

solemn leaf
#
Config={
   "token": "",
   "prefix":"!",
   "ws": {
        "intents": [
            "GUILDS",
            "GUILD_MESSAGES"
        ]
    }
}
#

const conf = require(process.env.Config);

earnest phoenix
#

That's not how you access env...

solemn leaf
#

thats what the doc said

earnest phoenix
#

Just process.env.Config

sour flame
earnest phoenix
#

@sour flame What exactly is the problem in your code?

solemn leaf
#

still undefined

earnest phoenix
#

Install an npm package called dotenv and do require('dotenv').config()

earnest phoenix
sour flame
#

du=id that

#

did that

solemn leaf
#

still

sour flame
#

npm i dotenv right

earnest phoenix
earnest phoenix
sour flame
#

Installed

earnest phoenix
#

Not you

solemn leaf
#
require('dotenv').config()
const Discord = require("discord.js"), fs = require("fs"), walk = require("walk"), { resolve } = require("path");
const conf = process.env.config;
console.log(conf)
#
config={
   "token": "",
   "prefix":"!",
   "ws": {
        "intents": [
            "GUILDS",
            "GUILD_MESSAGES"
        ]
    }
}
earnest phoenix
#

Try logging process.env

solemn leaf
#

ok

lyric mountain
#

Is config really a function?

solemn leaf
#

nothing shows as my object

earnest phoenix
lyric mountain
#

Understandable, have a great day

earnest phoenix
sour flame
#
(node:19004) UnhandledPromiseRejectionWarning: TypeError: message.content.slice(...).time is not a function
    at ModmailClient.<anonymous> (C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:38:68)
    at ModmailClient.emit (events.js:310:20)
    at MessageCreateAction.handle (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)       
    at WebSocketShard.onPacket (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (events.js:310:20)
    at Receiver.receiverOnMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\ws\lib\websocket.js:825:20)
(node:19004) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:19004) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate 
the Node.js process with a non-zero exit code.
``` Still getting an error
solemn leaf
#

How would a string

#

have a functon

#

no thats an array

#

how would an array have a function for time

sour flame
#

Idk I can't find time in my code

solemn leaf
#

volt

earnest phoenix
#

Back to you

#

What did it exactly log

sour flame
#

lol

solemn leaf
#
ξΊ§ export bob=bobby
REPL2:1
export bob=bobby
^^^^^^

SyntaxError: Unexpected token 'export'
earnest phoenix
#

Umm

crimson vapor
#

show code

solemn leaf
#

thats console

crimson vapor
#

yea

#

show code

solemn leaf
#

no code?

crimson vapor
#

well if there is an error there is code

earnest phoenix
#

Show the code at the top of the file

solemn leaf
#

i did that in console

earnest phoenix
#

...

solemn leaf
#

I did export bob=bobby in console

#

to then do echo bob

#

but legit I couldnt even get past that point

sour flame
#
(node:2820) UnhandledPromiseRejectionWarning: TypeError: message.content.slice(...).trim(...).spilt is not a function
    at ModmailClient.<anonymous> (C:\Users\ravi_\Desktop\Discord Bots\Mail\structures\Client.js:38:75)
    at ModmailClient.emit (events.js:310:20)
    at MessageCreateAction.handle (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)       
    at WebSocketShard.onPacket (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (events.js:310:20)
    at Receiver.receiverOnMessage (C:\Users\ravi_\Desktop\Discord Bots\Mail\node_modules\ws\lib\websocket.js:825:20)
(node:2820) 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: 4)
``` What now (Were getting somewhere)
earnest phoenix
#

I told you to log process.env, not do command lines @solemn leaf

sacred aurora
#

not spilt

sour flame
#

kk

earnest phoenix
#

You had 7 typos so far

solemn leaf
#

I did log that

sacred aurora
#

lol

solemn leaf
#

it showed stuff about the repo and node

earnest phoenix
#

What did it exactly log... Can you show us?

sour flame
#

Now I'm not getting an error

solemn leaf
#
{
  NODE_VERSION: '12.21.0',
  HOSTNAME: '2307aad04c2b',
  YARN_VERSION: '1.22.5',
  HOME: '/home/runner',
  PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
  NODE_PATH: '/usr/local/lib/node_modules:/home/runner/node_modules',
  PWD: '/home/runner',
  REPLIT_DB_URL: '',
  REPL_IMAGE: 'gcr.io/marine-cycle-160323/nodejs:106552f39be5dd263f3ef62c4059203cff712fcb',
  REPL_PUBKEYS: '',
  REPL_ID: '',
  REPL_LANGUAGE: 'nodejs',
  REPL_SLUG: 'Testing',
  REPL_OWNER: 'Akiisqt',
  TERM: 'xterm-256color'
}
sour flame
#

and cmd not working

solemn leaf
#

tirm.split

sour flame
#
[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json  
[nodemon] starting `node index.js`
I'm now  online
#

All I got

earnest phoenix
#

8 typos so far

#

Read your code

solemn leaf
#

Can they read?

sour flame
#

I'm guessing its because of my terrible typing

earnest phoenix
#

@solemn leaf Put this in your .env file entirely and see what it logs again

config=Test```
solemn leaf
#

I have it logs undenifed

#

same both places

sour flame
#

gg boys

#

I did it

crimson vapor
#

pogging

sour flame
#

I don't got anymore typos

earnest phoenix
#

So what are you exactly logging?

solemn leaf
#

it doesnt show

#

Im not retard as some here please don't treat me like I am

#

config=test in the .env

#

then loggin process.env

#

shows that it isnt a thing

#

period

umbral zealot
#

did you try to login process.env.config

earnest phoenix
#

They did

#

I don't think .env files work correctly in repl.it

umbral zealot
#

They do, they should

#

even without dotenv

earnest phoenix
#

This is what it logged for process.env as i told them to log it

solemn leaf
#

yes it returned that

#

both times

umbral zealot
#

ok well

#

sorry to say

#

it works 100% for me

solemn leaf
#

doesnt for me

umbral zealot
#

Well you're doing something wrong then. This is a brand new fresh nodejs repl

#

can you screenshot your entire screen

sour flame
#

I got an error it is popping up twice

crimson vapor
#

did you stop the first process?

solemn leaf
#

I dont need to screenshotyou just need my code thats it

sour flame
#

no

umbral zealot
#

Well if you think you don't need a screenshot, then, I guess you know what your problem is and you can fix it on your own, right?

solemn leaf
#

Why the hell do you need a screen shot

#

I gave you my scope

#

thats enough

umbral zealot
#

Humor me

solemn leaf
#

and its exactly like yours

umbral zealot
#

Just do it

solemn leaf
#

Ill pass

sour flame
#

It fixed I changed what happened in console logs from reached to Ping!Pong! Used

umbral zealot
#

Here look I'll do mine.

sour flame
#
reached
[nodemon] restarting due to changes...
[nodemon] restarting due to changes...
[nodemon] starting `node index.js`
I'm now  online
Ping!Pong!Used
``` From above to top
solemn leaf
#

mine is exactly like that

umbral zealot
#

I'm going to say it's not. Just do it.

#

Show me. Prove it.

earnest phoenix
#

@sour flame Because you're running the client multiple times

solemn leaf
#

I dont need to prove shit

umbral zealot
#

Alright well, good luck with your problem then.

solemn leaf
#

Volt you hear this guy

umbral zealot
#

It's probably something really simple and stupid but you're too stubborn to actually let us help you because of some weird pride thing.

solemn leaf
#

Ive given everything but they need a screenshot

earnest phoenix
#

Uhh...

umbral zealot
#

Do you have any idea how many things can be broken because of some really small detail you might have overlooked?

solemn leaf
#

I have rewriten this like 10 times

#

Ive sent my code here

umbral zealot
#

Then maybe you rewrote it wrong 10 times, and showing us the entire thing would be helpful in helping you troubleshoot your issue that clearly you need our help with.

earnest phoenix
#

Just listen to hindsight, it might also be because of the dotenv package

umbral zealot
earnest phoenix
#

I know

umbral zealot
#

as I've shown, with a new fresh repl that doesn't use it

earnest phoenix
#

They're using it

umbral zealot
crimson vapor
#

great code 10/10

earnest phoenix
#

I mean like it might be overwriting the data the repl already wrote, since they're using dotenv at top

umbral zealot
#

it's perfect code to show that repl.it doesn't need anything to show the process.env correctly

#

adding dotenv doesn't break it, either. so that's fine.

earnest phoenix
#

Aki, can you screenshot your code?

umbral zealot
#

I don't want a code screenshot I want the full window screenshot with the files pane and the console pane

earnest phoenix
#

or that

solemn leaf
#

.env

config=test
umbral zealot
#

holy jesus christ.

#

hahahahahahahahahaa

solemn leaf
#

?

umbral zealot
#

THERE IS A SPACE

earnest phoenix
solemn leaf
#

it was config.env

#

still didnt work anyways

umbral zealot
#

The name of the file has to be exactly, precisely, .env

#

not <space>.env not config.env not blah.env. Literally, the name of the file, is .env

zenith terrace
#

yes

solemn leaf
#

wont let me make it .env

earnest phoenix
solemn leaf
#

quiet litterly

umbral zealot
#

This is because .env isn't a file extention. It's a file called env that is hidden, which by convention under linux starts with a dot

#

Delete it.

#

Delete it, create a new file, type .env and hit enter

solemn leaf
#

that makes no sense

umbral zealot
#

It does absolutely once you know what dot files actually are

solemn leaf
#

Why cant I rename it to .env

sour flame
#

How to put a subtitle?

umbral zealot
sour flame
#
const Client = require('../structures/Client');
const { Messege, ReactionUserManager } = require('discord.js');
module.exports = {
    name: `help`, 

    /**
     * @param {Client} client
     * @param {Message} message
     * @param {String[]} args
     */
    run: async(client, message, args) => {
        console.log("Help!Used")
        const msg = await message.channel.send(`Getting Commands`);
        await msg.edit(client.embed({
            title: `Commands`, 
            subtitle: `Fun Commands`, 
            description: `ping`
        }, message));
        await msg.edit("");
    }
}
``` How to put a subtitle
solemn leaf
#

see Im not retarded the site is

umbral zealot
#

You failed to create a file with a simple name. Sorry, that's not on repl.it

solemn leaf
#

it was .json

earnest phoenix
#

What do you even mean by "subtitle" to a command?

sour flame
umbral zealot
#

Well I hope you learned something new about operating systems.

#

.thing is not the same as file.something

earnest phoenix
sour flame
#

Like

umbral zealot
#

As an example, here's my /User/evie/ folder, or part of it. Notice the dot files in there, that's just how unix programs are used to operating.

earnest phoenix
#

.android pogging

umbral zealot
sour flame
#

when I type m!help I want
Commands
Fun
ping

#

Not just Commands to be in bold

umbral zealot
#

So look at the tutorial and see what you can put in embeds

#

You can also use markdown anywhere in here so you can make bold text as usual.

sour flame
#

kinda

umbral zealot
#

@solemn leaf all good now, you're up and running?

earnest phoenix
#

Why do embeds always display like this on mobile? With indentations...

#

What do you expect

#

Discord being discord

#

True that

#

No way to fix it? @earnest phoenix

#

Nope, discord maintainers should fix it, if you think that's a bug you can submit it here

#

Cheers

#

Nice

#

lmao

proven lantern
#

What's a good retention rate for bots? i'm seeing about 50% of guilds kicking my bot

earnest phoenix
#

Same for me lol

#

But I make people upvote my bot to use it πŸ™‚

#

Lmao

earnest phoenix
#

Yep

#

What’s wrong lol

#

It ain’t in this list

opal plank
#

that usually means:

  • your bot doesnt do what they were expecting(make sure to properly explain your bot in detail and clearly)
  • offline times
  • poor feedback(for example, not giving command outputs or the sort)
  • too many bugs
#

my retention is roughly 94% from what i calculated before

#

that was a while ago, but you should aim for 80%+

earnest phoenix
#

My bot joins and leaves so many servers per day lol

#

It’s awful when you see your bot being removed from a server

opal plank
#

you should be looking at a good retention rate

#

if people are removing the bot, its quite likely that one of the criterias i mention above were met

earnest phoenix
#

What bots that for

proven lantern
opal plank
#

quality is priority so that doesnt happen

opal plank
#

not gonna advertise it here

earnest phoenix
#

Fr shine

opal plank
earnest phoenix
#

Gendhin

#

Can’t spell for shit

proven lantern
#

the problem with my bot is that it doesn't really work until there are a lot of users

#

matchmaking needs lots of players

opal plank
#

the majority of servers you would be looking at a range of less than 100 users

earnest phoenix
#

Matchmaking?

proven lantern
#

video game matchmaking

opal plank
#

you might need to improve matchmaking between servers or add functionality that fits small servers

proven lantern
#

lfg

earnest phoenix
#

Oh

#

Lmao

proven lantern
#

i added a whole elo function too

opal plank
#

just keep in mind

proven lantern
#

leaderboards

earnest phoenix
#

What DB u use?

opal plank
#

you need to excel in quality for large servers to add it

proven lantern
#

elasticsearch and dynamodb

earnest phoenix
#

Never heard of those lol

proven lantern
#

the bot is more for many small servers

opal plank
#

thats the thing, if you're matchmaking in small servers, and small servers dont like your bot, theres clearly an issue there

proven lantern
#

the issue is that they cant find a hosted game or no one joins the game they host

#

maybe some sort of early adopter perks

opal plank
#

its quite hard to grow like that tbh

#

you know the loop you're in right? @proven lantern

#

no user = no users for matchmaking
no users for matchmaking = low retention
low retention = no users for matchmaking

proven lantern
#

i've gotten to 500 server in 2 months

#

once i hit some point i think the retention will be higher

opal plank
#

you might wanna explore other options to advertise or incentive users to use the bot somehow like giving them rewards for matchmaking every x matches

#

from what you're telling me its likely that your new servers are being left because of lack of matchmaking

#

so you need to somehow improve that

#

one way i check how servers are leaving is with my logs

#

so, check this

#

this is my weekly growth

#

not only that

#

i can query those left servers from my db to see the last commands issued on the guild that was left

#

so that gives me a pointer as to why they removed it

reef needle
#

Hey, I'm making a bot (@MusicCraft) that needs a MANAGE_MESSAGES perm so that he can flip pages between queue embed by me reacting ➑

proven lantern
reef needle
proven lantern
#

these are some of my google analytics stats

opal plank
# reef needle how?

wdym how, you DONT need it, period, you're reacting on adding or removing reactions

opal plank
reef needle
#

ok

proven lantern
opal plank
#

if i wanted to brag about stats i could screenshot my dashboard lul

#

what im saying is:
see which commands were last used on left servers

#

that gives you an indication of why they left

proven lantern
#

i wish there was a way to log the reason given when the bot is kicked

opal plank
#

why would anyone put a reason to kick the bot?

reef needle
#

....

proven lantern
#

for feedback

#

but we dont have access to that

opal plank
#

nobody gives a reason for kicking a user or bot

#

specially on small servers

proven lantern
#

i'm sure some do, but there isn't a way to know

opal plank
#

its unrealistic to expect users to tell you why they didnt like the bot

#

majority wont

#

95% wont even bother

#

thats why i said

#

log your commands

proven lantern
#

grafana burns my eyes

opal plank
#

and query the last used commands

#

i like making my own metrics

#

updated dropped and now theres a shitton of users playing

crimson vapor
#

pog bot

#

lib is eh tho

opal plank
#

getting tired of the blocked messages

#

@crimson vapor dont bother me again if i say im in a foul mood

crimson vapor
#

I won't

#

I regret my decision

#

was funny for like 30s then instant regret

opal plank
#

same for you too @earnest phoenix

#

dunno who else was caught in the mad erwin spree

crimson vapor
#

Link

earnest phoenix
#

K

opal plank
#

so that'll do for now

earnest phoenix
#

Pogging

stark abyss
crimson vapor
#

I have decided that tomorrow will be the day I setup grafana

earnest phoenix
#

Grafana is poggers

#

Perhaps even loggers?

crimson vapor
#

perhaps

#

im gonna use influxdb I think

stark abyss
#

I feel like I get dumber n dumber each day

const MovieDB = require('node-themoviedb');
const mdb = new MovieDB('api-key');
TypeError: MovieDB is not a constructor (14)```
I tried this in code hs ^ & in visual studio it was working idk if this is difference between js and node.js
crimson vapor
#

hmm

earnest phoenix
#

See what it returns

#

    catchError = new Discord.MessageEmbed()
    .setColor('RANDOM')
    .setTitle("Error #" + ErrorNumber)
    .setTimestamp()
    .addFields(
      { name: '**Message Author**', value: `<@${message.author}>`},
      { name: '**Command Preformed**', value: message},
      { name: '**Server Name**', value: message.guild.name},
      { name: '**Error**', value: error}
    )
    errorChannel.send(catchError)
    message.channel.send("Hey! I have gotten an error. To fix this ask for support on our `!support` server! (Ticket #" + ErrorNumber + ")")``` why is `send` in `errorChannel.send(catchError)` undefined?
stark abyss
#

oh

earnest phoenix
stark abyss
#

also there isn't a terminal here im trying to implement this to a react native app

earnest phoenix
#

Why does it say available is not defined? He is


 var available;


 const send = https.request(options, async res => {

        let data = '';
       
        if(res.statusCode == 400 || res.statusCode == 401) {
            available = 'Yes'
        } else {
            available = 'No'
        }



    }).on('error', e => {
        console.error(e);
    });




    send.write(data_send);
    send.end();

    console.log(available)
#

In which line?

#

the last one

#

with the console.log()

#

Can you show us the stacktrace of the error?

proven lantern
#

i'm guessing it's not initialized when you log it

earnest phoenix
#
(node:7184) UnhandledPromiseRejectionWarning: ReferenceError: available is not defined
    at checkAvailability (C:\Users\root\Desktop\SG\structures\functions.js:131:17)
#

Strange

crimson vapor
#

scopes

stark abyss
#

volt
const movieDB = require('node-themoviedb');
const db = require('util').inspect(movieDB)
TypeError: require(...).inspect is not a function (16)
i am gonna be honest I am lost with this.

earnest phoenix
#

You're defining the variable inside a specific scope and using it outside the scope

earnest phoenix
stark abyss
#

no

#

js

stark abyss
#

let doesn't let you do that

#

nor var i don't think

earnest phoenix
#

@earnest phoenix "The current context of execution. The context in which values and expressions are 'visible' or can be referenced.
If a variable or other expression is not 'in the current scope,' then it is unavailable for use."
More information: https://developer.mozilla.org/en-US/docs/Glossary/Scope

stark abyss
#

just declare it oustide of the inside stuff and update it when u need to

proven lantern
#

you can do this in js ```console.log(available)
var available;

#

best language

earnest phoenix
stark abyss
#

sad

earnest phoenix
#

Refer to the link

#

okay

#

ty

stark abyss
#

volt any new info 4 me?

earnest phoenix
#

Can you try logging the movieDB itself?

stark abyss
#

i be honest with you there isn't terminal/console in this because like i said trying to use it with react native.. and I think you use alert() for this so I will try that

earnest phoenix
#

Oh yea forgot, try that i guess

stark abyss
#

[object, Object]

#

what's stringify for js NephehR

earnest phoenix
#

Try movieDB.toString()

stark abyss
#

oh

#

alert(movieDB.toString())

#

stayed the same

earnest phoenix
#

I don't think the JSON object exists in vanilla JS

proven lantern
#

JS quiz. who knows why var works and let doesnt?

stark abyss
#

let has different scope

#

its built different

earnest phoenix
#

var is too old, it's used to bypass scopes and define variables before lookups are even triggered

proven lantern
stark abyss
#

alert(JSON.stringify(movieDB))
= {}
its empty NephehR

earnest phoenix
#

Node's first versions didn't have let or const so, that's why var is not recommended to be used now

earnest phoenix
stark abyss
#

alert(JSON.stringify(Object.getOwnPropertyNames(movieDB)))
= []
empty array?

proven lantern
#

try console.dir(movieDB) too

earnest phoenix
#

They don't have a console

earnest phoenix
stark abyss
#

is this something I should do more reading and research on?

proven lantern
#

oh, node. Star was using the browser

earnest phoenix
#

You can define the variable outside of it and reassign it's value

cunning gorge
#

I am trying to access my json file with a variable:
Type arena.warrior works however, a variable that has a string "warrior" when appended to arena such as:
arena.className where const className = "warrior"; returns undefined?

#

Can anyone help? I've been at this problem for a couple days and stuck

earnest phoenix
#

That's not how variable accessors work

#

arena[className]

stark abyss
#

are we out of ideas to try?

#

maybe it's not made for js

#

it does say node

earnest phoenix
stark abyss
#

okay

#

Uncaught TypeError: require.resolve is not a function (-5)

#

this is okay i can find one for js

earnest phoenix
#

Alright i guess

stark abyss
#

thank you for your help

#

really appreciate it

earnest phoenix
#

Np, i was thinking that you should also try the import() function

#

But that can only be used inside modules

#

.mjs files to be precise

stark abyss
#

interesting honestly i started learning js and node.js at kinda same time so sometimes i get confused understanding what is what and what would not work

earnest phoenix
#

Yea, vanilla JS and JS extended by Node.js is a lot different than each other, which makes it confusing

stark abyss
#

Yeah

final lynx
#

do any of you guys have a simple ban/kick script

#

i cant figure out how to make one

#

this was my old one, but it wont work

earnest phoenix
#

i got pinged from here

final lynx
#

?

cunning gorge
earnest phoenix
final lynx
#

im on VS code and i believe im using javascript

earnest phoenix
#

Thanks

final lynx
#

?

#

are you going to use it

#

because that doesnt work

earnest phoenix
#

I just wanted to know

final lynx
#

ok

#

do you have one for javascript that would work

earnest phoenix
earnest phoenix
final lynx
#

javascript

#

on VS code

earnest phoenix
#

JavaScript is a programming language, not a library

final lynx
#

im on visual studios code

earnest phoenix
#

I think he's asking about FrameWork

#

Are you using discord.js or eris or what?

final lynx
#

and i have discord.js

final lynx
earnest phoenix
#

You are very direct

earnest phoenix
#

mention.sendMessage is not a thing in discord.js

final lynx
#

that may be why its not working lol

#

it could be node.js

earnest phoenix
#

What's the issue exactly?

final lynx
#

the ban script

#

does nothing

earnest phoenix
#

Any errors?

final lynx
#

there are errors, but its for things that dont matter much

#

but

#

this is something i made

#

that does work

earnest phoenix
#

setActivity not setGame

final lynx
#

i cant see setGame

#

vm im blind

#

nvm*

#

but that command does work

earnest phoenix
#

Command?

final lynx
#

when i add it into a server

#

it works

earnest phoenix
#

Umm, but that isn't the issue