#development

1 messages ยท Page 1320 of 1

faint prism
#

Because that's what I'm about to do

#

"how do I get a substring from a string in javascript"

#

But tbh there is probably a trim or slice or something

cinder sandal
#

what's the diffrence between evaluate() and eval()

cinder sandal
#

so

#

evaluate() is for math?

#

like evaluate(1+1)

solemn latch
#

if you read what i linked, it would tell you

faint prism
#

evaluate is for web

cinder sandal
#

but how to make math

#

without using evaluate()

faint prism
#

make math functions is one, another is use a lib

#

maybe mathjs

#

idk what you js guys do

trim saddle
#

@cinder sandal regex math mmLol

solemn latch
#

i feel like someone said dont use eval, so you googled eval and evaluate came up as another suggestion.
no idea why youd presume evaluate would be better than eval

#

๐Ÿค”

indigo folio
#

in djs is there a way to broadcastEval or something similar inside the sharding manager or something so that not every single shard posts to dbl?

trim saddle
#

setup a seperate project to do the posting

restive furnace
#

get guild count for each, post the guild count and shard count into the api inside of the shardingmanager, not the shard

indigo folio
#

yeah i just found the method im looking for

#

am new to sharding

woven sundial
#

Heya, I'm trying to check if user's id is in my json file. I would like to check if my user is admin or subuser.

  if(message.author.id !== serverData.admin)return message.channel.send(WelcomeToDemo);

That's my line to check if user is admin

will```js
if(message.author.id !== serverData.admin)||(message.author.id !== serverData.subuser)return message.channel.send(WelcomeToDemo);

earnest phoenix
#

It should work but that's incorrect syntax

#

)||( => ||

woven sundial
#

oh okayyy

#
if(message.author.id !== serverData.admin||message.author.id !== serverData.subuser)return message.channel.send(WelcomeToDemo);```like that ?
earnest phoenix
#

Yes

woven sundial
#

okay, thanks !

heavy marsh
earnest phoenix
#

Fetch the link and turn convert it into buffer

#

If available it's a viewable image

#

hello! in my html I am trying to create a contact form the the input value isnt showing up

#

this is my content code

faint prism
heavy marsh
#

I get the link as https://radiostationusa.fm/assets/image/radio/180/100.3 Kiss FM.png from the package I use

earnest phoenix
#

so I have to label it?

faint prism
ionic dawn
#

label for the text and input for the input forms

dense nest
#

What should I use to cound how many users my bot has. I use len(client.users) and it returns 1

#

In python

faint prism
#

math.floor(random())

dense nest
#

Huh

faint prism
#

What you were doing is fine

#

Unless you have more than 1

dense nest
#

I have more than 1

#

Lmaooo

#

Its in a over 900 member server

#

Bruh

faint prism
#

Its in a over 900 member server
@dense nest might need to make sure your cache is up to date then. Try downloading all the users

#

How can I do it (8ball command in discord.js) var x = getRandomIn(0, 20);
@sand dune why don't you check if x is greater than 10 and give a good thing, and if less than return a bad thing MegaThonk

dense nest
#

Or just randomly choose a response shibepopcorn

faint prism
dense nest
#

@sand dune mine has 12 lol

faint prism
#

then randomly pick between 6... instead of 20

#

You can't anymore

#

because people made stupid bots just for the badge, and ruined it for everyone

#

I'm not joking

#

Yeah

#

Why, are you trying to do the same thing?

#

They discontinued the badge

#

That's all I know

#

np

#

How the hell do you get verified bot dev
@earnest phoenix wait are you talking about the badge or the role in DBL?

earnest phoenix
#

are you calling looper()?
@faint prism how do i call looper()?

#

this is the code, you may have forgot:

import asyncio
import schedule
import time

def new_day():
  print('new day')

    
schedule.every().day.at("10:04").do(new_day)

async def looper():
  while 1:
    schedule.run_pending()
    print('yo')
    await asyncio.sleep(1)
solemn latch
#

looper()

slender thistle
#

Ah dear god

#

Use asyncio.run

drifting wedge
#

how can i get like each letter from a string? python

slender thistle
#

in a list? wanna simply iterate over the string characters?

drifting wedge
#

so like each letter becames its own var

#

so like i want to forexample

sudden geyser
#

So you want a list of every character in the string

slender thistle
#

I uh

#

wat

#
a = "a"
b = "b"```?
drifting wedge
#

input a string, and it returns each letter as a var

earnest phoenix
#

for char in โ€œstringโ€:
print(char)

drifting wedge
#

so forexample i input i like cheese

#

and each character becomes a var

solemn latch
#

xy problem?

drifting wedge
#

its for a command what makes the input ๐Ÿ‡บ ๐Ÿ‡พ

sudden geyser
#

When you say you want it to become a variable, it sounds like you want a = "a", b = "b"

#

Which is not possible.

drifting wedge
#

so like itll make your input

#

into emojis

solemn latch
#

yeah, xy problem indeed

drifting wedge
#

so like i put in hi and it gives back ๐Ÿ‡ญ ๐Ÿ‡ฎ

earnest phoenix
#

Can i make a bot called โ€œralphs roblox island giveawaysโ€

drifting wedge
#

ok so i have an idea

#

so can i get each individual char?

solemn latch
#

google would probably tell you

drifting wedge
#

alr rt

#

ty

slender thistle
#

@drifting wedge use a dictionary

drifting wedge
#

wdym

solemn latch
#

kinda like a look up table.
I have the letter X whats the right emoji

slender thistle
#
{'a': ':regional_indicator_a:', 'b': ':regional_indicator_b:', 'c': ':regional_indicator_c:', 'd': ':regional_indicator_d:', 'e': ':regional_indicator_e:', 'f': ':regional_indicator_f:', 'h': ':regional_indicator_h:', 'i': ':regional_indicator_i:', 'j': ':regional_indicator_j:', 'k': ':regional_indicator_k:', 'l': ':regional_indicator_l:', 'm': ':regional_indicator_m:', 'n': ':regional_indicator_n:', 'o': ':regional_indicator_o:', 'p': ':regional_indicator_p:', 'q': ':regional_indicator_q:', 'r': ':regional_indicator_r:', 's': ':regional_indicator_s:', 't': ':regional_indicator_t:', 'u': ':regional_indicator_u:', 'v': ':regional_indicator_v:', 'w': ':regional_indicator_w:', 'x': ':regional_indicator_x:', 'y': ':regional_indicator_y:', 'z': ':regional_indicator_z:'}
``` just have this stored in a dictionary
silent thicket
#

that's a bad way to do it imo

slender thistle
#

and for each character in the string, get the character as the dictionary's key

solemn latch
#

whats a better way ๐Ÿค”

slender thistle
#

Feel free to suggest other ways, this is one I use because I cba to think of another solution catshrug

silent thicket
#

I personally would make a dictionary of special characters, but for the letters loop over them and add "regional_indicator_" and ": " and then add those those to a string

#

less code

slender thistle
#

essentially what I did to get that dict in the first place

l = "abcdefhijklmnopqrstuvwxyz"
d = {}
for i in l:
    d[i] = f":regional_indicator_{i}:"
d
#

I hate Discord's copy-pasting

silent thicket
#

ahh, ok

slender thistle
#

I mean, both work and are performant enough catshrug

silent thicket
#

yeah

sudden geyser
#

You could take it a step further and: ```py
import string

for letter in string.ascii_lowercase:
...```

slender thistle
#

True

drifting wedge
#

is asking for admin on bot join ok?

#

or more ppl wont allow it?

slender thistle
#

Why ask for admin

drifting wedge
#

Why ask for admin
@slender thistle just ask for all others?

slender thistle
#

Yes

#

It's a good practice to require and ask only for individual permissions

woeful pike
#
import string
indicators = { key: f":regional_indicator_{key}:" for key in string.ascii_lowercase }
slender thistle
#

I keep forgetting dict comprehensions are a thing

woeful pike
#

it's the only good thing about python KEKW

slender thistle
#

list comps are life

woeful pike
#

elixir comprehensions are still better tho dabby

slender thistle
#

Try me

#

No I'm about to yell at Xetera

woeful pike
#
indicators = for key <- ?a..?z, into: %{}, do: {key, ":regional_indicator_#{key}"}
#

dabby

#

oh wait no you have to cast the key from a codepoint to string

#

sadge

slender thistle
#

Oh my

drifting wedge
#

whats the manage_guild permission?

sudden geyser
drifting wedge
#

the id

sudden geyser
#

You can do some more with the permission, such as adding integrations

drifting wedge
#

manage_server?

sudden geyser
#

You'll refer to it as manage_guild

drifting wedge
#

ty

drifting wedge
#

i made my domain host point to cloudflare

#

but how do i make sure that my website gets pointed to from cloudflare?

#

its a subdomain hosted by my friend, so it has the same ip as his website

gritty bolt
#
let militime = setMilliseconds(Date.now()) + 1000```
```ReferenceError: setMilliseconds is not defined```
anyone know how to fix this
misty sigil
#

setMilliseconds is not defined

#

define it

gritty bolt
#

how

#

it's a function

#

like a node one

misty sigil
#

u sure?

gritty bolt
#

yea

misty sigil
#

Date.now() returns ms anyways

gritty bolt
#

it does?

misty sigil
#

Date.setMilliseconds() then

gritty bolt
#

then how do I turn it into a regular epoch?

misty sigil
#

Iโ€™m fairly sure it returns epoch

#

ms since 1st Jan 1970

gritty bolt
#

no like

#

into seconds

#

like a normal unix

misty sigil
#

Just divide it by 1000?

gritty bolt
#

ok issue here

#

it doesnt seem like node scheduler is actually running functions

#
core.nodeSchedule(bot);```
#

is how I run it

#
//Reminder Function
    async function remindUser(data, bot) {
        try {
            console.log(data.user);
            const userId = data.user.replace(/\D/g,"")
            const dmChannel = await bot.users.fetch(userId)
            console.log(dmChannel);
            let reminderEmbed = new discord.MessageEmbed()
                    .setTitle(data.messageLink)
                    .setDescription("text")
                    .setColor("#FF0000");
                    await dmChannel.send(reminderEmbed)
                    data.remove();
        } catch (err) {
            console.log(err);
    }}
nodeSchedule: async function scheduler(bot) {
    try {
        (await messageReminderModel.find({})).forEach(data => {
            let currentUnix = Date.now()
            if(data.time <= currentUnix) remindUser(data, bot)
            schedule.scheduleJob(data.time, remindUser(data, bot));
        console.log("Scheduled a reminder.");
    });
    } catch (err) {
        console.log(err);
    }
},``` is the code
#

can anyone help?

earnest phoenix
#

Use asyncio.run
@slender thistle wait so do i do asyncio.run(looper())

#

nvm i figured it out

solemn latch
#

I'm kind of confused
is your function
nodeSchedule or scheduler
I've seen
nodeSchedule: () = {}
as the syntax and
function remindUser(){}
but not both combined

gritty bolt
#

uh

#

ones for my index file

#

wait no

#

nodeSchedule is supposed to schedule the remindUser task

#

@solemn latch

solemn latch
#

i mean the syntax

#

you named the function two things

#

nodeSchedule and scheduler

#

and im not sure how that works

urban holly
#

I need help with actually everything with my bot lol

gritty bolt
#

nodeSchedule and scheduler
@solemn latch one is for my index

#

im not sure why they're different actually

#

ok lemme change that

#

and see what happens

sudden geyser
#

Quack explain the issue, preferably the one that matters.

urban holly
sudden geyser
#

Can you paste the client ID here

urban holly
#

765730158203895828

sudden geyser
#

You sure that account exists, because I couldn't find it either. You may want to double-check.

urban holly
#

Okay

sudden geyser
#

click the bot tab

urban holly
#

Okay

#

Done

sudden geyser
#

Is the ID the same on both tabs.

urban holly
#

Hm let me check

gritty bolt
#
ReferenceError: scheduleCheck is not defined
    at Object.<anonymous> (C:\Users\Samst\Desktop\RemindMe\index.js:97:1)```
```js
async function scheduleCheck(bot) {
    try {
        (await messageReminderModel.find({})).forEach(data => {
            let currentUnix = Date.now()
            if(data.time <= currentUnix) remindUser(data, bot)
        console.log("Reminded a user.");
    });
    } catch (err) {
        console.log(err);
    }
}} catch(err) {
    catchError()
}
setInterval(scheduleCheck(bot), 60000);```
#

ii dont get it

urban holly
#

Mobile struggles

sudden geyser
#

The error is 99% likely the result of your scoping.

#

Like that }} at the end. The first one closes the scheduleCheck body, but another scope as there's a second one..

urban holly
#

It's my first time doing this bot stuff ;-;

#

I understand nothing

sudden geyser
#

All you need to do is click on the bot tab then check if the two IDs are the same.

#

Also you shouldn't start by submitting your bot to DBL, as I assume your bot is not complete.

urban holly
#

Okay

#

I'll just finish the bot tomorrow I'm too tired at the moment

vernal rivet
#

What scope is the scheduleCheck under @gritty bolt

gritty bolt
#

wdym

vernal rivet
#

Do you know what scopes are?

#

I am taking that as a no

gritty bolt
#

nope\

#

ima be totally honest

#

im tired rn

#

so i might just be being dumb

#

but could you explain it to me

vernal rivet
#

Ok, first thing, learn what scopes are. They are really important to know. Second scopes is referring to the curly braces. At the end you have a brace that leads to something that isn't shown. The }} what I am referring to.

gritty bolt
#

ohh

vernal rivet
#

I am going to guess a function or a class

gritty bolt
#

yes

vernal rivet
#

Which one

gritty bolt
#

function

vernal rivet
#

Your problem is that your function is not reachable

gritty bolt
#

so how do I fix that

vernal rivet
#

Move the function outside that function

gritty bolt
#

oh wait

#

are you talking about my js try{?

#

i have that

#

cause its not inside a function

vernal rivet
#

Hold on let me get my food first and sit down

gritty bolt
#

at this point i might need to just use pastebin to get the whole structure in

#

okay

drifting wedge
#

how can i toggle a css property with a switch with flask?

slender thistle
#

A what

lean dune
#

Hey Bro How to Get a Role This Servers

drifting wedge
#

like darkmode

#

with a switch

#

using flask

#

like how can i make a switch do shit in flask

vernal rivet
#

Ok I am back

slender thistle
#

Either frontend JS or a redirect with different setting in local storage or cookies

drifting wedge
#

Either frontend JS or a redirect with different setting in local storage or cookies
@slender thistle alr the page is html so i can use js?

vernal rivet
#

So is the scheduleCheck function in a try catch or a function?

drifting wedge
#

its made by my team and i

slender thistle
#

HTML does support the script tag, but it's interpreted by your browser, so yeah

drifting wedge
#

HTML does support the script tag, but it's interpreted by your browser, so yeah
@slender thistle alr rty

slender thistle
#

I'll give you my non-b.s. assessment on the thing once the image has loaded for me

drifting wedge
#

lmao

#

ok

#

its not dark mode tho

vernal rivet
#

@gritty bolt

drifting wedge
#

yet anyways

gritty bolt
#

ok hi

#

try catch

#

it covers the whole file

#

here i'll paste it all into a pastebin

vernal rivet
#

PandaSouless please tell me your joking

gritty bolt
#

ok

#

im not gonna do that

#

thats a stupid idea

#

so the try catch goes over the whole file

vernal rivet
#

Why?

gritty bolt
#

its catching errors in the whole thing

opal plank
#

can i slap you?

gritty bolt
#

yes

opal plank
#

handle your shit properly

vernal rivet
#

But your invoking a try catch that doesn't need to be there. If your call is in a try catch, then it will be in a try catch. But any ways. Your problem is still the same. Your referencing something that doesn't exist in the current scope. You have to move the function out of the try catch and put it in the scope you need to call it from

opal plank
#

what even IS the issue here?

gritty bolt
#

OH

#

i just

vernal rivet
#

Scope problems

gritty bolt
#

did i really

#

wow i guess that slap worked

#

im such an idiot

#

that shouldn't have been an issue

#

it works now

#

jesus

opal plank
#

wtf is this half cut code dude?

#

you got an extra catch there

#

wtf

gritty bolt
#

yea

opal plank
#

1 try and 2 catches to match

gritty bolt
#

i took that out too

#

this is old code

opal plank
#

then show an updated snippet

gritty bolt
#

im fixing it all up

vernal rivet
#

It's a big problem. Not knowing scopes makes it harder

opal plank
gritty bolt
#

well i know scopes now

#

im honestly dead rn

#

maybe its not the best idea to be doing this

opal plank
#

booze is the answer for me

#

though i highly dont recommend others doing this

vernal rivet
#

So it's a watch you do it, and don't try thing

opal plank
#

do what i say, dont do what i do kind of thing

#

actually

vernal rivet
#

Ok, then

opal plank
#

speaking of functions

#

do functions declared in variables get hoisted?

gritty bolt
#

can unix times have decimals

#

ex: 1602638814.658

#

or is that gonna be really bad

#

im using really exact times

opal plank
#

unix is in ms iirc

#

do you REALLY need that precision?

vernal rivet
#

Honestly at this point I don't even know what is does half the time. It's all over the place

#

J's*

opal plank
#

just wondering cuz if it does, you should bring in parameters

#

for local context

vernal rivet
#

What world uses decimal as measure of time?

solemn latch
#

the decimal time place

vernal rivet
#

Oh wait are you talking about where the function is located matters, or some other shit?

opal plank
#

do you know hoisting in js?

vernal rivet
#

At this point I am just small brain, educate us

opal plank
#

well, to put it simply, when your compiler runs, it hoists functions and variables before the code is even run, so they are the first things that run on your script

#

though declaration and assignment are two different steps

#

the variables are declared, as well as the functions, but variables dont have a value until they are assigned

gritty bolt
#

i swear i dont think node-schedule is actually scheduling anything

opal plank
#

that follows the code syncronously

warped jasper
#

??

#

hola

vernal rivet
#

I mean I would assume so if declaration comes first, then initialization would follow

opal plank
#

though when you declare a variable, its declared, but its value isnt assigned yet, though functions get hoisted

gritty bolt
#

it's not

warped jasper
#

??

gritty bolt
#

does anyone know why node-schedule wouldn't be scheduling my tasks?

opal plank
#

so by logic, function variables declarations would run in sync

#

and not hoisted

#

though i dont have a phisable way of testing this

#

therefore im asking

warped jasper
#

A(?)

vernal rivet
#

Cause Task is a return type FLdogekek

#

Jk

#

That's only true in c#

faint prism
#

I smell C#

opal plank
#

anyway, hoisting in js is messy and complicated

#

if anyone know the answer, please do tell me

vernal rivet
#

Dude c# is great

faint prism
#

I agree 100%

frail birch
#

hi can someone help me please? I won nitro as a gift in a good draw, then he disappeared and didn't pay, please reactivate my account so I can show the evidence if possible

faint prism
#

wat

opal plank
#

@frail birch not the server for that

vernal rivet
#

Finally someone agrees with me

opal plank
#

report that to discord or whatever

faint prism
#

this Discord server isn't related to Discord company at all

frail birch
#

I reported

faint prism
#

This is just a 3rd party bot listing website

opal plank
#

then wait for their response, this server has nothing to do with that,much less this channel

frail birch
#

ok thanks

opal plank
#

what a poorly cropped image

#

yikes

boreal iron
#

Shame on u, Erwin just because u donโ€™t handle Discordโ€™s issues..

vernal rivet
#

I mean I am just blind so it is poory crop either way

opal plank
#

im not discord staff

faint prism
#

||Erwin works for Discord, don't listen to him||

opal plank
#

||dont expose me angerystar ||

boreal iron
#

Aye heโ€™s undercover.

vernal rivet
#

What's your opinion on programming in cpp?

faint prism
#

Too low-ish level (for my taste), light weight, good for high performance, bad for security (manual memory mangement)

vernal rivet
#

That actually describes it pretty well tbh

faint prism
#

C# core 5.0 should rival C++'s performance

#

Or was it C# v9

vernal rivet
#

Doesn't net.core have a faster run step than cpp?

earnest phoenix
#

Hi how are you

#

E L P E PE

#

Ete sech

vernal rivet
#

Good batman, how is the bat?

earnest phoenix
#

do you peak espanish

faint prism
#

@vernal rivet I watched the benchmark comparisons for a lot of the fundamental functions. And core 5 is insane

vernal rivet
#

When it actually doesn't ping but you see it

faint prism
#

way more comparisons in that

vernal rivet
#

Yea Net.core is a great framework

faint prism
#

even compares asm output

vernal rivet
#

Those that say c# is trash, should feel the wrath of the NET.core 5.0

faint prism
#

Cross-platform af too

vernal rivet
#

Mhm

opal plank
#

C# who?

#

never heard of

#

Scratch is the true king of programming

vernal rivet
#

No

#

Don't fill the kids with such lies, obviously glass is the superior one

opal plank
#

lmao

#

okay maybe i was mistaken

vernal rivet
#

happy_boy people say py is superior, but HAHA, glass is cooler than snakes

quartz kindle
#

yes py is superior

#

:^)

vernal rivet
#

But glass my dude

#

Also FLdogekek

opal plank
#

@quartz kindle wait js better than py?

vernal rivet
#

I mean hey numbers aren't wrong

opal plank
#

@slender thistle the lord has spoken, come to the dark side, we got typed objects, hookers and a lot of garbage collectors

quartz kindle
#

lmao

vernal rivet
quartz kindle
#

these benchmarks are so funny

opal plank
#

i doubt its that big of a difference tbh

#

i would assume py and js would have a similar performance

quartz kindle
opal plank
#

wait py foster

vernal rivet
#

Lmao

opal plank
#

wooot mote

quartz kindle
opal plank
#

i assume lower = better

vernal rivet
#

So you are saying glass is better good

quartz kindle
#

these tests sound like they have no idea what they are doing

opal plank
#

actually

#

tim

#

got a question for ya

#

do you know about hoisting?

quartz kindle
#

in js?

opal plank
#

yup

vernal rivet
#

Tim knows all

quartz kindle
#

ye

opal plank
#

so, to put it bluntly, is variable declared functions hoisted?

#

cuz assignment runs after declaration, and functions are hoisted by default, but im unsure about how its assigned if its within a variable

quartz kindle
#

function expressions are not hoisted afaik

#

only function declarations

opal plank
#

hmmm thats interesting then

#

i would assume they'd be hoisted as well, but only assigned after

#

bruh js hoisting is confusing as fuck holy shit

#

who the fuck made this?

quartz kindle
#

lmao

#

variables are not hoisted, so it makes sense that whatever you give is also not hoisted

opal plank
#

they though thou

vernal rivet
#

Js is just confusing

opal plank
#

iirc vars are hoisted

#

its only the assignment of the value that happens sync

#

i may be wrong about that but im fairly certain thats the case

#

its been a while fucking with hoisting

quartz kindle
#

ye declaration is hoisted, but not assignment

opal plank
#

thats what bugs me

#

vars and functions should be hoisted, should the function inside the var also be hoisted and once it passes on the var again afterwards assign the function?

quartz kindle
#

it counts as an assignment, not as a declaration

opal plank
#

hmmmm

#

i think i get it now

#

its still weird

quartz kindle
#

welcome to js

slender thistle
#

@opal plank oh no my snake case

quartz kindle
#

btw, typescript bad

#

:^)

sonic lodge
#

what exactly is being tested?

quartz kindle
#

some very cpu instensive algorithms

opal plank
#

thats 100% bs btw

#

ts transpiles in js

quartz kindle
#

The fannkuch benchmark is defined by programs in Performing Lisp Analysis of the FANNKUCH Benchmark, Kenneth R. Anderson and Duane Rettig. FANNKUCH is an abbreviation for the German word Pfannkuchen, or pancakes, in analogy to flipping pancakes. The conjecture is that the maximum count is approximated by n*log(n) when n goes to infinity.

opal plank
#

therefore you should count it as js

#

wtf lmao

quartz kindle
opal plank
#

wait what

#

if its infinity

#

it shouldnt stop

slender thistle
#

Python's timeit gave up on a 1k elements list

quartz kindle
#

look at the top scores for this one

#

now look at the bottom scores for the same test

#

xDDD

solemn latch
#

5 min

slender thistle
#

What the fuck

drifting wedge
#

Where would I go if I wanted to find more devs for a project?

quartz kindle
#

and you thought 5 minutes was bad

drifting wedge
#

Wits this?

distant bramble
#

Hello

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

what is the command to know in status how many servers in it

#

pls help someone

prisma oriole
#

what library are you using?

strange wadi
#

so @prisma oriole what does ur bot do?

earnest phoenix
#

@prisma oriole discord.js

strange wadi
#

jesus my bot is so much easier to create then using python or js or anything like that lmfao

pearl trail
strange wadi
#

Damn

#

RIP

pearl trail
#

f

strange wadi
#

whats ur bot do XD

#

for it to use that much memory

pearl trail
#

idk, i think i coded it wrongly

#

lemme check again

strange wadi
#

lmfao I dont even use like js or python or anything I use a app with simplifide codes so its easier and I dont have to run it at all and its totally free keeps my bot running 24/7 lmfao

pearl trail
#

is it right?
var usedMemory = os.totalmem() -os.freemem(), totalMemory = os.totalmem();

strange wadi
#

umm one sec

pearl trail
#

same, my bot run 24/7

#

okay

strange wadi
#

I believe thats right

#

but I dont really use code that much...

pearl trail
prisma oriole
#

@earnest phoenix use client.guilds.cache.size to get the number of servers

mystic bison
#

ะšั‚ะพ ั€ัƒััะบะธะน

prisma oriole
#

@strange wadi my bots a security bot

marble geode
#

@prisma oriole but that only show online user

sonic lodge
#

that's the amount of cached guilds, not users

marble geode
#

oh i forgot

#

sorry i dont see that

#

:v

muted fiber
#

Hello bros is there any bot which gives twitter feeds without premium

marble geode
#

${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0).toLocaleString()}
use this to show all users of your bots

prisma oriole
#

no?

#

you can just do client.users.cache.size

faint prism
#

lmfao I dont even use like js or python or anything I use a app with simplifide codes so its easier and I dont have to run it at all and its totally free keeps my bot running 24/7 lmfao
@strange wadi but how do you implement complex behavior or logic

delicate zephyr
#

no you cant because that only works if you have fetched all members

#

his code doesnt even separate dupes either

#

meaning the number is bloated also

mild flower
strange wadi
#

@strange wadi but how do you implement complex behavior or logic
@faint prism I dont lmfao thats why I have odly specific commands

#

XD

faint prism
#

Hm. Whatever floats your boat I guess

strange wadi
#

yea but I seen some one send me just their bots stauts code and I have mad respect for the ppl that hand code them

faint prism
#

sends me their bot's code
Ah, I'm getting a better picture

strange wadi
#

lol

faint prism
#

Do you know any programming languages?

strange wadi
#

me?

faint prism
#

Yeah

strange wadi
#

rip not really I use tools that simplify the code so its easier I havent done classes or anything yet as im only 15

#

and covid

faint prism
#

So how would you simplify:

let n = 5+1
console.log(n)
strange wadi
#

bruh

#

My app gives me a list of options and Its nothing like them lemme get screen shot

#

I got mad respect for who every used real code

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

strange wadi
#

Lmfaao

#

Told u

sage bobcat
#

One message removed from a suspended account.

strange wadi
#

RIP

#

Yes why?

sage bobcat
#

One message removed from a suspended account.

strange wadi
#

Rip

obtuse pasture
#

This is a easy app to start the developement

strange wadi
#

Exposed

sage bobcat
#

One message removed from a suspended account.

strange wadi
#

Yea I know hes roasting me

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

obtuse pasture
#

I have a bot in bot designer for discord

sage bobcat
#

One message removed from a suspended account.

obtuse pasture
#

Is easy

sage bobcat
#

One message removed from a suspended account.

mild flower
#

is there any npm for detecting 18+ youtube videos

obtuse pasture
#

I don't speak English

sage bobcat
#

One message removed from a suspended account.

strange wadi
#

plus I can have my bot running 24/7 with out my pc having a heat stroke

obtuse pasture
#

:'v

strange wadi
#

rip

#

Hablo poco espanol?

obtuse pasture
#

O que bien

strange wadi
#

gracias

obtuse pasture
#

Me siento solo :'v

mild flower
strange wadi
#

:'v

#

idk

sage bobcat
#

One message removed from a suspended account.

mild flower
#

stop it

strange wadi
#

ty

obtuse pasture
#

Gracias

#

@strange wadi maรฑana te explico lo de ticket

strange wadi
#

what ticket?

#

ok just tag me in general

obtuse pasture
#

La imagen de arriba

#

Okok

sage bobcat
#

One message removed from a suspended account.

strange wadi
#

Lmfao he left

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#
import asyncio
import schedule

def new_day():
  print('new day')

    
schedule.every().day.at("00:39").do(new_day)

async def looper():
  while 1:
    schedule.run_pending()
    await asyncio.sleep(5)

asyncio.run(looper())

print('hi')

It never prints hi. I made it asynchronous, but why does it not work now?

slender thistle
#

Is that how it's supposed to be used

#

Actually

#

I want to murder you

#

Why are you using asyncio in the first place

earnest phoenix
#

because

#

i want it to be asynchronous

slender thistle
#

That's not how async works though

earnest phoenix
#

then how does it work

#

hello

slender thistle
#

Can't say how exactly async works in Python, I suggest you dig up a few articles for it. As for your project, you're better off either scrapping the schedule package as a whole and searching for an async alternative, or create one yourself

earnest phoenix
#

oh ok

#

schedule seems nice and easy though

slender thistle
#

or just don't make it async if you don't really care

earnest phoenix
#

i am planning to use this as part of my bot

#

so it has to be async

slender thistle
#

Mmm

#

Well your most viable option is to make it async yourself catshrug

earnest phoenix
#

how

slender thistle
#

yes

earnest phoenix
#

?

#

is there a link you can send for that]

#

cant seem to find anything online

#

abt that

slender thistle
#

Take a look at aioschedule pakcage

earnest phoenix
#

kk

#

thx

sage bobcat
#

One message removed from a suspended account.

tardy hornet
#

I have a glitch

#

It looks like that in my phone:

#

So i cant see how amny servers my bot is in

#

Can someone help me?

solar bramble
#

anyone know how to get righteous bot or jafbot in a discord?

gentle lynx
#

hmmm. I'm not sure if I can ask mathematical questions... but let's say we have these variables: ally damage, enemy defense
how can i make it so the total damage will be, ally damage divided by the percentage of the enemy defense?

#

making it like ally damage/enemy defense isnt helpful

silver lintel
#

ally dmg / percent of enemy dmg

gentle lynx
#

so for example if ally damage is 100, defense is 5, it will be
the ally's damage will be 80 (100 - 20)

#

but isn't that too much though?

#

do you recommend me to use another calculation?

silver lintel
#

why cant you just do ally dmg / percent of enemy defense

gentle lynx
#

uhh

#

what would I do to the enemy defense then?

silver lintel
#

whats the enermy defense?

#

sorry im still confused

#

making it like ally damage/enemy defense isnt helpful
@gentle lynx why isnt it helpful

gentle lynx
#

because you recommended me to use the enemy damage instead of their defense

#

hold on

silver lintel
#

oops

#

i mean defense

gentle lynx
#

oh

#

ok

tardy hornet
#

whats wrong with that?

#

its not letting me to put "true"

gentle lynx
#

are those fields?

tardy hornet
#

no

gentle lynx
#

then what

#

you have to put something before the true

#

probs inline: true

delicate shore
#

@earnest phoenix hey there buddy !!
I have another question with npm package
How can I make it like poeple don't have to put their token 2 times

#

Like in my package user has to do
const discord = require ('discord.js')
const ticket = require('djs-tickets')
const client = new Discord.Client()
ticket.token("bot token")
client.login("bot token")

fast trench
#

why won't this stop the code when currentSticky is undefined? It continues into the else statement for some reasonjs if (currentSticky === undefined) { return; } else { const newSticky = await message.channel.send(currentSticky[0][0].messageContent) const newMsgID = newSticky.id const newMsgCh = newSticky.channel.id const newMsgGuild = newSticky.channel.guild.id const newestSticky = await StateManager.connection.query(`INSERT INTO stickynotes (messageID, messageChannel, messageGuild, messageContent) VALUES ('${newMsgID}', '${newMsgCh}', '${newMsgGuild}', '${newSticky.content}')`); await StateManager.connection.query(`DELETE FROM stickynotes WHERE messageChannel = ${message.channel.id} AND messageID = ${currentSticky[0][0].messageID}`); await message.channel.messages.fetch(currentSticky[0][0].messageID).then(m => m.delete()); }

silver lintel
#

log currentsticky

fast trench
#

I fixed it...I forgot the [0][0] after currentSticky lol I always do that

gentle lynx
#

of course

fast trench
#

yeah...just do an eval command lmao

tardy hornet
#
 case 'meme':
  fetch( 'https://meme-api.herokuapp.com/gimme' )
  .then( async response => {
    const meme = await response.json();
    const embedf = new Discord.MessageEmbed()
      .setColor( '#EFFF00' )
      .setTitle( meme.title )
      .setURL( meme.url )
      .setImage( meme.url );

    message.channel.send( embedf );
  } );
break;
#

ReferenceError: fetch is not defined

fast trench
#

then define fetch...

ivory seal
#

is it possible to have multiple collectors in one command?

steep rock
#

Oh yes, but they would have to all be one part of a separate command. What were you after?

gentle lynx
#

how can I write this in code?

allyDamage - (enemyDefense % of allyDamage)

for example, allyDamage is 200, enemyDefense is 10
10 is 5% of 200, so it will be
200 - 5 = 195

steep rock
#

What language?

gentle lynx
#

node.js

steep rock
#

Alright.

#

It seems like there are no defined variables there, is that the whole code? Or just part?

gentle lynx
#

just that part

steep rock
#

Can you send the defined parts? Just so I can work with that?

gentle lynx
#

I didn't do anything yet, just want the calculation

steep rock
#

Well you can't get the calculation in code unless there are defined variables you can add to that part, I'm sorry, but I cannot help.

gentle lynx
#

just assume the variables are defined

fickle sapphire
#

Yes it would be able to do

steep rock
#

I can't because that would mess up the code you are writing and you would have to define them all over again.

#

Yes it would be able to do
@fickle sapphire
He knows that now, he just needs to define the variables.

gentle lynx
#

ok let's say that allyDamage is 100 and enemyDefense is 20

fickle sapphire
#

It doesnโ€™t matter what you make the numbers, as long as you have them as numbers

gentle lynx
#

yes...

fickle sapphire
#

like: var allyDamage = 100; var enemyDefense = 20; var result = allyDamage - enemyDefense

next flax
#

how can i fetch

#

number of files in my cmds folder

gentle lynx
#

uhm, i dont want to subtract them

steep rock
#

like: var allyDamage = 100; var enemyDefense = 20; var result = allyDamage - enemyDefense
@fickle sapphire

yes, like that. but I was asking him what the variables were, because there may be a bug where u can bypass the damage variable. it would not be good to do it like you did.

next flax
#

how can i fetch

number of files in my cmds folder

fickle sapphire
#

did you make a collection?

#

Of all the files in your cmds folder

next flax
#

Yes

#

i did @fickle sapphire

fickle sapphire
#

Then: commandFiles.size (asuming that commandFiles is the name of your collection)

next flax
#

i have this in my main file ```client.commands = new discord.Collection()

#

@fickle sapphire

fickle sapphire
#

client.commands.size

next flax
#

k

fickle sapphire
#

console.log(client.commands.size) first to make sure it returns a number

earnest phoenix
#

yo

next flax
#

ye

#

i did that only

#

added that in

#

ready event

#

@earnest phoenix Whats Up

gentle lynx
#

yes duh

next flax
#

how

vale garden
#

hi

#
case 'claim':
      if (autoMineStart.has(`m_${message.guild.id}_${message.author.id}`))
      {
        let rand = Math.floor(Math.random() * 950 + 500)
        let val = rand*inter;
        message.channel.send(`You have earned ${val} coins from that mining session.. re-starting up the mine now`)
        inter = 1;
        setInterval(() => {
          inter++;
        }, 1.8e+6)
      }
      else {
        message.channel.send("You haven't started up your mine.. starting it now!")
        autoMineStart.add(`m_${message.guild.id}_${message.author.id}`)
        inter = 10;
        setInterval(() => {
          inter++;
        }, 1.8e+6)
      }
      break;
#

i have this command

#

where i define inter below where it is used

#

so in the if block it says inter is not defined

gentle lynx
#

do a for loop in the commands collection and add every command to a string

vale garden
#

what do i do

next flax
#

thats already done

#

in my cmd handler

#

@fickle sapphire u there?

silver lintel
#

how do i get a file in the same folder? is it require("/file.js");?

next flax
#

nope

fickle sapphire
#

@fickle sapphire u there?
@next flax ye

next flax
#

require("/folder/file.js")

#

@fickle sapphire how can i do this type of thing

opal plank
#

./ is same working dir

fickle sapphire
#

With the for loop I quess

opal plank
#

or filter em

next flax
#

how can i loop then

opal plank
#

readDirSync()

#

then filter()

next flax
#
        // Filter so we only have .js command files
        const commands = readdirSync(`./commands/${dir}/`)```
#

?

#

will this work

opal plank
#

work? maybe

#

but thats bad af

#

dont use forEach(0 loops

#

they are inefficient as fuck

next flax
#

and how can we use canvacord

#

api

opal plank
#

read the docs

fickle sapphire
#
var array = Array.from(client.commands.keys()).splice(0).join(" ");

embed.setDescription(`${array}`)
#

This would work too

opal plank
#

why you splicing at index 0?

fickle sapphire
#

Because I like that

#

:p

next flax
opal plank
#

so many things wrong in that code my dude

fickle sapphire
#

Just leave the splice then xd

opal plank
#
embed.setDescription([...client.commands.keys()].join(' '))

one liner

#

:p

next flax
#

pro

opal plank
#

var is bad

#

embed builder bad

fickle sapphire
#

oof

opal plank
#

template bad

#

splice() uncecsarry

fickle sapphire
#

I just wanna define it in a var xd

opal plank
#

dont use vars

fickle sapphire
#

let

opal plank
#

use let/const

#

vars have their uses, and this aint one

#

rule of the thumb, dont use var

#

unless you need

next flax
#

how is this

#

i just saw this

real sierra
#

hey guys... i'm new at making bot in Discord and i have a problem in running the code just to make the Bot active... can you guys help me out???

opal plank
#

time to go read more ecchi light novels

next flax
#

have u added? client.login("Your Amazing Token")

#

@real sierra

real sierra
#

For some reason the "node ." aint work

node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • node .
  •   + CategoryInfo          : ObjectNotFound: (node:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
next flax
#

install node

real sierra
#

already installed

opal plank
#

do node index.js

#

or bot.js

#

whatever your main file is

real sierra
#

already... still aint work

opal plank
#

idk why people bother with node .

#

show me ur folder

real sierra
#

i'll just show you the code

#

and the filder

next flax
#

show package.json

#

too

opal plank
#

i need the file name

#

no need for package

next flax
#

um 9k

opal plank
#

node can run single files just fine

granite tendon
#

I wanna make a bot, but im bad at coding

opal plank
#

we all started knowing nothing

#

just put commitment and keep doing it and you'll get there evntually

real sierra
opal plank
#

show me your terminal

granite tendon
#

thanks @opal plank

#

...

opal plank
#

i assume you arent on the right folder

granite tendon
#

@.@

opal plank
gentle lynx
#

kind of dumb question, is node.js an oop?

#

prob not

opal plank
#

js is an oop, yes

granite tendon
#

:0

gentle lynx
#

but can you create classes like in Java and C#?

opal plank
#

yup

real sierra
gentle lynx
#

:o

next flax
#

which is the best canvas wrapper?

#

like amethyse api

opal plank
#

you did not install node rey

#

at least not globally

real sierra
#

owh?? really>>

opal plank
#

yup

next flax
#

which is the best canvas wrapper?
like amethyse api

real sierra
#

man.. ive installed it...

#

should i run it now??

next flax
#

install again

#

OK

#

run

opal plank
#

@real sierra yeah

#

okay, NOW for real, im out

#

got LN's to read[

granite tendon
#

I can't find the dev portal

real sierra
#

lmao.. bye man fo cultured XD

granite tendon
#

where is the application page to create a bot

#

im a noob ;-;

rose warren
#

Google it?

granite tendon
#

I tried

next flax
#

will i have to make it manually

granite tendon
#

I have no idea

#

How do I create a bot

rose warren
real sierra
#

I have no idea
@granite tendon i just follow youtube tutorial

next flax
granite tendon
#

:'>

real sierra
#

im actually making Paimon bot for Genshin server

granite tendon
#

this is so helpful

sullen thunder
#

bhai dream 11 ki team milega kya

rose warren
#

Create the application then under the application create the bot

sullen thunder
#

aaj ka

next flax
#

@sullen thunder not here

rose warren
#

Then Google the rest ๐Ÿ˜‚

next flax
#

only english here no hindi

real sierra
#

yo... my code still doesnt wanna run

#

๐Ÿ˜ฉ

#

opps wrong emo

granite tendon
#

oof

#

I found something good

rose warren
#

Make sure you're looking at tutorials for discord.js V12 if you're using javascript

granite tendon
#

I don't know any form of coding ;-;

rose warren
#

Use this @granite tendon it's a good start to learning https://anidiots.guide/

granite tendon
#

I will make an actual robot first

#

I think thats a good idea lol

pale vessel
granite tendon
#

How do I authorize my robot?

earnest phoenix
#

Use this @granite tendon it's a good start to learning https://anidiots.guide/
@rose warren (the site might seem toxic btw)

granite tendon
#

done

hazy sparrow
#

how can i make my bot's "custom status" refresh every 15 seconds?

real sierra
#

how on earth everyone doesnt have an error on their code...

#

while im stuck with the node that doesnt work

earnest phoenix
#

how on earth everyone doesnt have an error on their code...
@real sierra because we don't sit and whine about not knowing how to do programming.
Instead, we try to figure what in the actual heck is causing the error.

hazy sparrow
#

you'll get there eventually

#

see my first messages in dis server

#

i was stuck in the npm init -y part

real sierra
#

@real sierra because we don't sit and whine about not knowing how to do programming.
Instead, we try to figure what in the actual heck is causing the error.
@earnest phoenix im doing the same thing while having a class

earnest phoenix
#

see my first messages in dis server
@hazy sparrow you advertising your bot KEKW

hazy sparrow
earnest phoenix
#

@earnest phoenix im doing the same thing while having a class
@real sierra coding classes will not get you anywhere
programming is not a skill that you need a teacher to tell you
it's something everyone here learnt on their own

static wraith
#

how can i make my bot's "custom status" refresh every 15 seconds?
@hazy sparrow Good question i have the same someone answer

hazy sparrow
#

i'd 100% not recommend getting classes they take months to teach sometime which takes days

earnest phoenix
#

use a setInterval

real sierra
#

@real sierra coding classes will not get you anywhere
programming is not a skill that you need a teacher to tell you
it's something everyone here learnt on their own
@earnest phoenix what i mean in im coding the bot while having my regular class in collage

#

not having a programmer class

earnest phoenix
#

Same goes for normal school computer classes

delicate shore
#

Wot

granite tendon
#

Im actually trying to make a robot

#

Ive been doing well

#

How rude

real sierra
#

Im actually trying to make a robot
@granite tendon owh... using arduino??

earnest phoenix
#

My school literally tells me an excel workbook is stored inside a worksheet

static wraith
#

coding is a real job

#

who ever says it isnt

#

is delusional

granite tendon
#

@granite tendon owh... using arduino??
@real sierra I don't know what that is,

#

I only learned about discord bots today

earnest phoenix
#

coding is a real job
who ever says it isnt
is delusional
@static wraith Time to execute server-side XSS on top.gg to ban you :)

real sierra
#

wait... we are not talking about the same robot arent we?? XD

@real sierra I don't know what that is,
@granite tendon

granite tendon
#

oof lol

static wraith
#

@static wraith Time to execute server-side XSS on top.gg to ban you :)
@earnest phoenix i dont even get what that means

granite tendon
#

im learning how to make the robot

static wraith
#

But yes it is a real job

granite tendon
#

gtg bye

real sierra
#

bye

earnest phoenix
#

programing is not necessarily a job

static wraith
#

A job that is expanding by the second

#

yes it is

#

everything is coded

earnest phoenix
#

necessarily

static wraith
#

everything has code

#

and we are advancing into a world of technoligy

earnest phoenix
#

everything has code
@static wraith but me has no money :(

static wraith
#

and more will be in demands

restive furnace
#

and have heard of anti-injection / injection protection @static wraith?

static wraith
#

Wtf free ๐Ÿคฃ

restive furnace
#

TOP.GG uses react (iirc) and it's impossible to make injection attacks to react applications.

static wraith
#

No stds in code ๐Ÿคฃ

#

oh

earnest phoenix
#

Programming is NOT necessarily a job
we do it for fun, we find something's not working, we fix that with our skill, the guy pays us, rinse and repeat

restive furnace
#

Programming is NOT necessarily a job
we do it for fun, we find something's not working, we fix that with our skill, the guy pays us, rinse and repeat
Well, everything is basically job when you get money from it.

static wraith
#

You in incredibly wrong...

hazy sparrow
#

use a setInterval
@earnest phoenix wait how does setInterval help?

#

aaa

earnest phoenix
#

if you do something only for money it's a job
if you do something for fun (basically newbie programmers) it's not a job

restive furnace
#

No stds in code ๐Ÿคฃ
std stands for standard (library).

static wraith
#

i Disagree in that massively

if you do something only for money it's a job
if you do something for fun (basically newbie programmers) it's not a job
@earnest phoenix

restive furnace
#

How?

static wraith
#

because if you do something for fun and get paid its just a enojoyable job

earnest phoenix
#

@static wraith goto r/unpopularopinion

static wraith
#

thats what you want to archieve

earnest phoenix
#

period

restive furnace
#

There is game studios which do games and they have programmers which they pay for programming their game.

#

Also, there is guys which only do it for fun on free tme.

static wraith
#

I just thing that coding and programmers are gonna get very high in demand soon.

earnest phoenix
#

I'm a programmer but I don't wanna make it my career because I do it for fun not for money

#

@static wraith goto r/unpopularopinion

static wraith
#

I mean if you make it a career you get $$$$

#

Like i mean ALOT

restive furnace
#

I just thing that coding and programmers are gonna get very high in demand soon.
Like they aren't already in high demand? Also coding and programming stands for same thing. Programming is more friendly word for to use instead of coding.

earnest phoenix
#

does anyone remember what the fuck started this discussion anyways

restive furnace
#

Clampy's XSS attacks

earnest phoenix
#

(mine)(it was a joke btw)

#

coding is a real job
who ever says it isnt
is delusional
@static wraith this is what started it

#

and if people only do it for money WHY THE FUCK DOES STUFF LIKE MOZILLA AND OPENJS AND D3.JS AND STUFF EXIST

gentle lynx
#

how can i calculate 25% of 20 ?

next flax
ionic dawn
#

Prob thats a stupid question but I have this:

  if (message.author.id !== "bla bla") return;

how can I make an array of a few ID and check if the author.id is in there

gentle lynx
#

if(!IDs.includes(message.author.id)) return;```
ionic dawn
#

arent you the guy from probot?

gentle lynx
#

yes

ionic dawn
restive furnace
#

and if people only do it for money WHY THE FUCK DOES STUFF LIKE MOZILLA AND OPENJS AND D3.JS AND STUFF EXIST
@earnest phoenix If you grow up, and need money and can't do anything else than program, where would you go?

#

Stay home?

gentle lynx
#

wait I remember you

tame kestrel
#

@gentle lynx multiply it by a decimal 20 * .25

next flax
#

yes
@gentle lynx u have probot premium

#

?

ionic dawn
#

thanks btw hehe

gentle lynx
#

@tame kestrel thanks!

tame kestrel
#

anytime

gentle lynx
#

@next flax no, I'm a ProBot support member

next flax
#

@gentle lynx um ok

tame kestrel
#

Does anyone know if Javascript maps/collections don't allow periods in the key?

pale vessel
#

aren't keys strings? they should be allowed then

tame kestrel
#

Yeah thats what I thought, for some reason I am having trouble with it

#

Just kidding, I think I found the problem

cinder patio
#

I'm pretty sure map keys can be of any value

#

Object keys can be only strings

tame kestrel
#

yeah haha... I just figured it out... I was setting some types in a file with a weird name, either fs or requiring the module didn't go smoothly

carmine summit
#

how do I edit a role?

pale vessel
carmine summit
#

bruh didn't see that

#

i was looking on roleManager

pale vessel
#

BRUH

real sierra
#

it is working.... phew

#

finally

carmine summit
#

nah .setPermissions work

earnest phoenix
#

Object keys can be only strings
@cinder patio what

cinder patio
#

yeah

earnest phoenix
next flax
earnest phoenix
#

fs.readdirSync

next flax
earnest phoenix
#

you're missing the fs

next flax
#

            embed.setFooter(`${message.guild.me.displayName} | Total Commands - ${client.commands.size - 1}`, client.user.displayAvatarURL());

            categories.forEach(category => {
                const dir = client.commands.filter(c => c.config.category === category)
                const capitalise = category.slice(0, 1).toUpperCase() + category.slice(1)
                try {
                    embed.addField(` ${capitalise} [${dir.size}] - `, dir.map(c => `\`${c.config.name}\``).join(" "))
                } catch (e) {
                    console.log(e)
                }
            })```
earnest phoenix
#

readdirSync is a property of fs

next flax
#

ik

earnest phoenix
#

so it should be fs.readdirSync

next flax
#

ok

#

btw

#

see this

earnest phoenix
#

oh ok

cinder patio
#

I think this explains it the best. All objects get turned to a string when you try to make them keys of an object. Map keys can be objects, object keys cannot be objects. @earnest phoenix

next flax
#

Ye

earnest phoenix
#

The code is correct

next flax
earnest phoenix
#

smh

next flax
#

i think client is not able to find

#

category

#

folder

#

commands

earnest phoenix
#

c.config is undefined

next flax
#

const categories = readdirSync("././commands/")

earnest phoenix
#

hence it cannot read the property category of it

next flax
#

its maybe because

#

bot cannot commands folder