#development

1 messages · Page 1019 of 1

weary anchor
#

Provide all possible information so people know what's up. Just saying "I get an error" doesn't give us enough information on your problem.
From the channel topic @delicate shore

delicate shore
#

From the channel topic @delicate shore
@weary anchor it's not logging anything

#

what should i tell

weary anchor
#

does it unban?

still merlin
#

because your logging nothing 🧠

tight plinth
#

^

weary anchor
#

oh right

#

you're logging an empty line

still merlin
#

console.log() logs nothing

tight plinth
#

^

weary anchor
#

an empty line*

tight plinth
#

Do you even know how to use try/catch?

delicate shore
#

no it doesnt unban

#

this is what i get

pure saddle
#

message.guild.members.unban -.-

delicate shore
#

no

pure saddle
#

bruh

tight plinth
#

You forgot to put message before .guild

#

Smh

delicate shore
#

oh

weary anchor
#

reply.guild? lol

#

I didn't even notice

#

Because of the code not being formatted properly

tight plinth
#

Yea that's a problem tpo

#

Format your code

still merlin
#

read the docs

#

its message.reply or msg.reply

delicate shore
#

yes

weary anchor
spare mirage
#

@delicate shore to unbansomeone
message.guild.members.unban()
U need more im not feeding

still merlin
#

and you unban like this,

guild.members.unban('84484653687267328')
.then(user => console.log(Unbanned ${user.username} from ${guild.name}))
.catch(console.error);

#

but change it

spare mirage
#

U neeed to fetch the bans in the guild

delicate shore
#

reply.guild? lol
@weary anchor where

weary anchor
#

I was saying that your code had reply(...).guild

restive pebble
#

wut

weary anchor
#

it should be message.guild

restive pebble
#

lol

pure saddle
spare mirage
#

if(command === "unabn"){

still merlin
#

go and learn js pls

spare mirage
#

unabn

#

?

#

check ur code

weary anchor
#

lol

spare mirage
#

mannn

solemn latch
#

Sometimes its amazing you all have so many mistakes in one code snippet

still merlin
#

the fact you cant even do embeds properly

spare mirage
#

eyy stop

#

Don’t spoon-feed or attack beginners.

wanton dew
#

yes dont eat him

vernal vapor
#

Small question how long can a trending new bot be on trending new bot page for

#

Is there like a limit

spare mirage
vernal vapor
#

Ah sorry

spare mirage
#

U can double check ur code..

solemn latch
#

Mee6 has been on those lists for a long time

spare mirage
#

mee6 is spnsor

solemn latch
#

Yeah, all I'm saying is there's really no upper limit

spare mirage
#

dank memer is always there too

#

@delicate shore to unban someone in a guild you need to:
fetch the bans

delicate shore
#

So it will be

solemn latch
#

Anyway, when you add a line of code, check it for spelling errors, and that you understand what each property, method and everything does

spare mirage
#

u cant just unban someone without saying what guild there from

delicate shore
#

How

spare mirage
#

¯_(ツ)_/¯

solemn latch
#

Go to docs, search fetchban

spare mirage
#

read the docs

#

ur lucky

#

this unban/kick/ban stuff took me 12 hours

solemn latch
#

To be fair, you where sending your client as the messags

#

For most of those hours

ebon kelp
spare mirage
#

@solemn latch yes :/

#

I decided to learn js btw

#

:3

plucky harness
#

it says this in top.gg api Authentication is performed with the Authorization HTTP header in the format Authorization: TOKEN

#

how to actuallt do it?

ebon kelp
#

You need to use a token

plucky harness
#

actually

#

ik

#

but whats the url

pale vessel
#

plus the header

spare mirage
ebon kelp
#

const dbl = new DBL('Your top.gg token', client);

solemn latch
plucky harness
#

sry

#

ill ask there

solemn latch
#

@ebon kelp already gave you an answer

#

On how to use it

ebon kelp
#

what?

solemn latch
#

🤔

#

He moved channels when you already said how to use it

ebon kelp
#

Oh like that, was ready it differently

earnest phoenix
#

what......

ebon kelp
#

That's basic coding knowledge

spare mirage
#

Helps alot for begginers

#

xD

solemn latch
#

Honestly, bot development is a good 3rd or 4th project once you know all these

mild flower
#

I cant get the new line statement to work

solemn latch
#

Whatcha mean?

spare mirage
#

@solemn latch I bet after u code for like 1 -3 weeks u know them from head

mild flower
#

"/n" to creat a new line

ebon kelp
#

Use \n not /n

mild flower
#

hmm

spare mirage
#

\n

mild flower
#

ye ye i got it

spare mirage
#

xD

#

okok

mild flower
#

i was just derping again

spare mirage
#

I do that all the time

mild flower
#

I must have gone to 5+ sites withuot realising what I was doing wrong

spare mirage
#

:3

pure lion
#

Suuup

solemn latch
earnest phoenix
#

Someone can help

#

:((

surreal notch
#

Cannot read property 'includes' of undefined

#

Error?

#

how to solve it

earnest phoenix
#

😑

pure lion
#

Omg

ebon kelp
#

define it

pure lion
#

Nice

#

Reeeal nice

earnest phoenix
#

First mine help

solemn latch
#

Whatever your using
.includes on isnt defined

pure lion
#

Reeeeeeeal nice

earnest phoenix
#

:/

solemn latch
#

Yours is the same error, just for id @earnest phoenix

pure lion
#

@earnest phoenix did you read the error????

ebon kelp
#

Whatever your using
.includes on isnt defined
@solemn latch And if you still don't know what this is, go learn code

pure lion
#

It's the same deal lolll

#

Go learn code

#

..learnjs

surreal notch
#

using includes here - if(message.content.toLowerCase().split(" ")[0].slice(1) === i || commands[i].aliases.includes(message.content.toLowerCase().split(

pure lion
#

Oh boy

solemn latch
#

Is aliases defined in every command

surreal notch
#

ye

lethal pine
#

can i earn money from discord bot

#

?

surreal notch
#

lol

solemn latch
#

Are you sure

surreal notch
#

@lethal pine maybe

pure lion
#

can i earn money from discord bot
In what context

#

Does anyone want a moderation bot? DM me and it'll be £2

earnest phoenix
#

yes but they all require skill

summer torrent
#

@surreal notch is aliases array?

pure lion
#

Lololol bot easy

#

@summer torrent generally speaking yes, aliases is an array

ebon kelp
#

How does this guy have the "Bot Developer" role and I don't

earnest phoenix
#

@solemn latch id?

solemn latch
#

Your error says it can't read Id of defined

#

Undefined

pure lion
#

@ebon kelp because your bot wasn't verified ye-

summer torrent
#

.includes is string function

pure lion
#

String func-

solemn latch
#

Includes can be used on arrays

weary anchor
#

.includes is string function
@summer torrent it exists on arrays too

ebon kelp
#

<Me> because your bot wasn't verified ye-
@pure lion I know, but was a joke

past blade
#

Benim botumun prefixi: % ama !say <text> yazınca yazıyor

#

ama prefix im %

pure lion
#

Yooooo who even watches YT for tutorials just read the do-

earnest phoenix
#

a lot of "bot developers" aren't qualified enough to be called developers omegalul

solemn latch
#

Yeah

pure lion
#

Somehow i learnt enough

summer torrent
#

@past blade english only

solemn latch
#

Its scary how little the badge can mean

ebon kelp
#

role

past blade
#

@past blade english only
@summer torrent ok

solemn latch
#

Role and badge

amber fractal
#

the badge literally means nothing

ebon kelp
#

True

pure lion
#

The badge means you spammed your bot inv link in several servers for many months

amber fractal
#

you dont even need to put effort in to get it to that point

ebon kelp
#

Yesterday there was a guy who didn't knew what to answer on the discord bot verify form

solemn latch
#

LOL

pure lion
#

"do I have to put the js question answers here?"

solemn latch
#

There should be a test

pure lion
#

Yes

ebon kelp
#

Linkedin quiz

sudden geyser
#

the badge literally means nothing
@amber fractal yes it does. it means you can get random dms from people asking to buy your account

#

what a great badge

solemn latch
#

Oh I want it

amber fractal
solemn latch
#

For the attention

pure lion
#

Ikr

solemn latch
#

Yeah ill sell my account, but there's a 10 year verification process before I can sell it

#

Joke mods no ban plox

pure lion
earnest phoenix
#

is it possible to download a npm package with eval?

ebon kelp
#

Why would you

earnest phoenix
#

why not

ebon kelp
#

idk try it?

earnest phoenix
#

curious if its possible

pure lion
#

No

#

You gotta use exec

earnest phoenix
#

dont have exec either dang it

sudden geyser
#

You can use eval.

#

It's unnecessary, but you can.

pure lion
#

Execute an eval

#

Llolololol

sudden geyser
#

require the exec function from the child_process module and call it

pure lion
#

aa!eval exec(string)

#

Yeah include that too

earnest phoenix
#

that works?

#

-eval const { exec } = require('child_process'); exec('npm i @​caijs/python-eval') this did nothing lmao

sudden geyser
#

set the second argument as console.log and check your console after running it

restive pebble
#

why evaling

#

lol

#

u have to await till execution is complete

#

make a separate command

#

lol

earnest phoenix
#
npm ERR! code ENOLOCAL
npm ERR! Could not install from "@​caijs/python-eval" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/container/.npm/_logs/2020-07-03T16_00_44_540Z-debug.log
at ChildProcess.exithandler (child_process.js:303:12)
at ChildProcess.emit (events.js:310:20)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
killed: false,
code: 1,
signal: null,
cmd: 'npm i @​caijs/python-eval'
} npm ERR! code ENOLOCAL
npm ERR! Could not install from "@​caijs/python-eval" as it does not contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/container/.npm/_logs/2020-07-03T16_00_44_540Z-debug.log```
#

oof

restive pebble
#

lol

earnest phoenix
#

what kind of shitty package is that smh

restive pebble
#

make a separate command for exec

earnest phoenix
#

i cant do anything about this can I?

restive pebble
#

eval code will not await

earnest phoenix
#

The package doesnt have package.json

restive pebble
#

ok

earnest phoenix
#

rip

restive pebble
#

and its on npm

earnest phoenix
#

yea...

restive pebble
#

epic

earnest phoenix
#

i was able to install locally tho

#

hm

lusty quest
#

maybe you can build it from source

summer acorn
#

I am having a issue with memory, at like 300 servers. Pretty much, I want to check the database for every server, and if 24 hours have passed, according to the database, it will send a fact and then add 24 hours to the database. This is currently taking up like 180 mb of the memory. How can I make it not take so much memory? Here is the code,

quartz kindle
#

what exactly is taking 180mb, how are you measuring it

#

the entire process? are you using process.memoryUsage() to measure it?

summer acorn
#

I don't exactly know. Jade put it up on a VPS and told me it used 160 mb memory, then went up to 170 mb, then 180 mb

#

@tulip wave

#

I'd assume it is that part of the code though

unique nimbus
#

Why not eval it

summer acorn
#

Considering that is the only part I'd see that would use so much memory.

#

Does a eval use less memory?

#

or wait I am dumb

unique nimbus
#

I mean use eval so you can see how much ram is being used

summer acorn
#

I think I see what you mean

#

Yeah, ok hold on

unique nimbus
#

yes

quartz kindle
#

i doubt the problem is that code, however you can greatly improve it by now executing all guilds at once, and spacing them out instead

#

180mb sounds normal for a discord.js bot

#

even at idle

unique nimbus
#

my bot is using 300mb at idle

#

on idle

#

because python caches the loving god out of everything

tulip wave
#

its stabilised at 192mb

unique nimbus
#

send a screenshot

#

of the ram usage

#

I don't think this is good for 93 servers on idle

quartz kindle
#

lmao

opal plank
#

350mb what kind of shitty ilb you using?

quartz kindle
#

thats even worse than djs

unique nimbus
#

python

#

caches

#

EVERYTIH

opal plank
#

jesus christ thats so bloated

quartz kindle
#

i mean, so does djs

unique nimbus
#

I don't even think there is a way to "uncache" everything

tight plinth
#

Python is shit

quartz kindle
#

and eris

#

and most libs

unique nimbus
#

yes

opal plank
#

deno >

unique nimbus
#

but idk what is being cached the most

earnest phoenix
#

my 45 guild bot uses 50mb

unique nimbus
#

its amazing

tight plinth
#

99% of discord libs caches everything

slender thistle
#

Client.fetch_offline_members = False

unique nimbus
#

oh

earnest phoenix
#

lol

tulip wave
#

my 2.9k bot uses 400mb

quartz kindle
#

wait thats set to true by default in d.py?

unique nimbus
#

yes

quartz kindle
#

what the fuck

summer acorn
#

@tulip wave they wanted a screenshot of the ram usage

slender thistle
#

Also guild_subscriptions

tulip wave
quartz kindle
#

guild_subscriptions is superceeded by intents

#

but thats one way lol

opal plank
#

36k users and 200mb?

#

wtf is that

tulip wave
#

ikr

summer acorn
#

36k members isn't all either

quartz kindle
#

this server alone has 120k

summer acorn
#

that is just all that are cached when that gets logged

tulip wave
#

my bot has 360k members cached

slender thistle
#

I haven't seen d.py supporting intents directly so

summer acorn
#

so like, all the cached users upon startup

quartz kindle
#

caching in discord is dumb, thats why i hacked the shit out of djs to remove it

unique nimbus
#

or it did nothing

#

this is 10s of uptime

opal plank
unique nimbus
#

lmao

tight plinth
#

Both peter

unique nimbus
#

smh

opal plank
#

170k+ users and 99mb

quartz kindle
#

@opal plank log .rss

opal plank
#

which is still a bit high

quartz kindle
#

instead of heapused

#

also /1024/1024

#

not /1000000

tight plinth
#

I dunno how to optimize

summer acorn
#

Well like, I need a way to do it without it taking like a billion mb memory

tight plinth
#

Apparently my 35 guild bot uses 400mb according to pm2

quartz kindle
#

lmao

tulip wave
#

lol

tight plinth
#

*280mb

summer acorn
#

I mean like, imagine that bot in let's say 10k servers then

#

the memory is gonna explode

#

it will remember too much

quartz kindle
#

@summer acorn you cant, not using regular discord.js, either you modify it yourself, or use an existing modification, or use a library that allows you to customize caching

summer acorn
#

ah, well in that case

marble juniper
#

use tims discord.js mod

quartz kindle
#

my bot used to use 600mb ram at 3k servers before i modified it, now it uses 120mb

marble juniper
#

its good lol

summer acorn
#

hmm actually I was thinking

tight plinth
#

I'll try to edit discordjs to remove useless stuff & cache

summer acorn
#

Would using a json file and forEaching that instead, to get the guild id, use less memory?

marble juniper
#

just use this

#

and cache problem begone

quartz kindle
#

@tight plinth you can take a look at ^ as inspiration if you wanna do it yourself

tight plinth
#

Yea that was my idea

summer acorn
#

wouldn't that just be like v11 codewise?

marble juniper
#

no

quartz kindle
#

check both v2 and v3 repos, they approach the same problem in very different ways

summer acorn
#

oh, so you'd still have to use .cache?

quartz kindle
#

v2 disables all events and uses the raw event, v3 hacks the events themselves instead

marble juniper
#

it says v12

#

lol

summer acorn
#

ok

#

so then it is still like client.guilds.cache

quartz kindle
#

yes

marble juniper
#

yes

summer acorn
#

ok then

quartz kindle
#

but channels are not cached by default

#

so you have to use channels.fetch() instead of channels.cache.get()

marble juniper
#

its kinda useful

earnest phoenix
quartz kindle
#

i removed most of those in v3 lmao

earnest phoenix
#

is this good to use?

marble juniper
#

better would be to make it yourself imo

quartz kindle
#

looks alright quinten

tight plinth
#

Looks good

earnest phoenix
#

👍 imma use it

vale garden
#

hi i have a question

#

if you use that

#

what do you do in index.js

#

like do you just remove the whole

summer acorn
#

add -light after discord.js

#

I'd assume

vale garden
#

if (message.content === "cmd1")

#

and everything

#

following it

tight plinth
earnest phoenix
#

yes because it’s a command handler

lusty quest
#

@tight plinth did you run something like Enmap? had it using about 1GB ram with 10 guilds

earnest phoenix
#

@lumap/commandhandler

summer acorn
#

or wait, this is about command handlers and not discord.js-light

#

ok I'll slowly back out

earnest phoenix
marble juniper
#

I mean yes its a command handler

#

lol

tight plinth
#

My command handler only works for one folder (a command folder with all commands inside) , but you can re use the code to make it support subfolders

marble juniper
#

ok

vale garden
#

@summer acorn whats discord.js-light

summer acorn
#

scroll up

marble juniper
#

you can modifiy the package

frigid cave
#

Lumap check tester general again if u can lol

summer acorn
#

we were talking about it a couple minutes ago

earnest phoenix
#

We can't create economy bot on heroku

pure lion
#

:c

marble juniper
#

get a vps

earnest phoenix
#

I have

marble juniper
pure lion
#

Get a server boi

earnest phoenix
#

But heroku give best ping

marble juniper
#

well

#

then you have a bad location

earnest phoenix
#

I got a 4gb vps

marble juniper
#

4gb of what

#

storage

earnest phoenix
#

like 50km away from my house

#

ram

marble juniper
#

lol

#

4gb is kinda low

earnest phoenix
#

4gb isn’t low for a discord bot lol

pure lion
#

Smhe

tight plinth
#

my pc finally booted, time to try to make my own discord.js

quartz kindle
#

4gb is good, depending on the price

#

my vps is 1gb

pure lion
#

Your own discord.js?

earnest phoenix
#

4gb 4€

quartz kindle
#

thats good price

marble juniper
#

ur brain capacity will fill up trying to understand the code @tight plinth

tight plinth
#

i mean, i'll try to edit discord.js to make it better

pure lion
#

Oh ye good

tight plinth
#

my brain is empty lol

pure lion
#

I might do that too

quartz kindle
#

discord.js will make you go insane

#

as it did to me

marble juniper
#

or just you know you can use discord.js-light

pure lion
slender thistle
#

Explains why you are still active in this channel

quartz kindle
#

lmao

marble juniper
#

but I looked at the code and im too small brain to understand it

#

ngl

tight plinth
#

yeah

quartz kindle
#

i can explain if you have questions lmao

tight plinth
#

k

marble juniper
#

Im gonna have a lot of questions

#

if I would try

tight plinth
#

first thing to edit: the readme

lusty quest
#

wow i wish i knew about discord.js-light a week earlyer, then i had it used for a bot i recoded

quartz kindle
#

rip

lusty quest
#

i think i will add it anyways, it adds some stuff that seems pretty usefull

tight plinth
pure lion
#

What's the diff between js and js-light?

lusty quest
#

also the 5 bots on my VPS already use about 1GB ram

#

it changes the caching behavior

#

its somewhere between V11 and V12

quartz kindle
#

@tight plinth lmao

#

thats what happens when youre constantly moving things around

pure lion
#

But then npm prune doesn't work 😄

tight plinth
pure lion
#

THAT URL

earnest phoenix
#

should I switch to discord.js-light, I only got about 6 commands now

lyric mountain
#

THAT URL
first time?

pure lion
#

<80 commands>

#

Yes

lyric mountain
#

there's like a dozen of troll urls they created for the sake of the pun

pure lion
#

Funnnn

quartz kindle
#

@tight plinth fixed both lul

lusty quest
#

i add it now to a Private Bot i make for a Larger server im in. Lets see how it performs

tight plinth
#

noice

pure lion
#

CPU usage drops to negative 70

tight plinth
#

dats big code

earnest phoenix
#

is there any open source bot using light yet?

lusty quest
#

i guess the Ram usage will get less, Currently i have 5 bots running on the same machine and they use about 5% CPU

pure lion
#

Dibs on first :D

lusty quest
#

its more or less normal D.Js but with a few changes (atleast its what i get from the docs)

pure lion
#

Oh

quartz kindle
#

yes

#

btw v3 is not released yet, check the v2 branch for the current docs/readme

#

feel free to test v3 tho, its pretty much ready

pure lion
#

Oooo

lusty quest
#

i guess the one on npmjs are the current docs right?

quartz kindle
#

yes, the npm version is v2

pure lion
#

Okay I'll wait till v3

#

Then it's open source time

lusty quest
#

maybe i open the repo for the bot im coding rn

pure lion
#

:c

lusty quest
#

there is nothing special in it

pure lion
#

H m

earnest phoenix
#

I’ll have to make a new repo when I go open source

lusty quest
#

for now ive got a reminder command

earnest phoenix
#

accidentally pushed my .env sometime

lusty quest
#

but you can repeat it infinitely

pure lion
#

Js is cool :) uwu owo :DDDD X)

lusty quest
#

... i was wondering why the bot was not going online. Result: i forgot to connect to the VPN to get external access to the MongoDB

quartz kindle
#

mongoliaDB

pure lion
#

Yes

#

Wise Tim

lusty quest
#

nice discord.js-light works out of the box with the new bot.

pure lion
#

:o

quartz kindle
#

it will work as long as you dont use .cache.get() on anything that isnt guilds lmao

earnest phoenix
#

imma switch to light 😄

pure lion
#

Lol

#

I'm gonna make a new bot with light soooooon

Like 7 years

quartz kindle
#

Lol

earnest phoenix
#

I only have like 6 commands so it shouldn’t be a big deal

lusty quest
#

i throw it tomorrow on my bot with 40 commands and about 103 Guilds

blazing portal
#

about 103 ?

#

interesting estimate 😛

earnest phoenix
#

if you have it in 100 guilds

lusty quest
#

also the membercount is broken

earnest phoenix
#

did u apply for verified dev yet in discord

lusty quest
#

yes

#

but im now at week 3 for waiting

earnest phoenix
#

they just give the badge when u at 75 guilds if u apply until October or smth

quartz kindle
#

no

lusty quest
#

i apply now bcs in october they probably get a really long query

quartz kindle
#

october is for the 100 guild limit to start being applied

delicate shore
#

guys

lusty quest
#

they are now at almost 1 month

delicate shore
#

my bot keeps on saying member is not banned

#

but it's already banned

#

like

#

why

surreal sage
#

does anyone know how to get a .js file from another folder and require it at a certain part in a script

#

like:

earnest phoenix
#

require()

surreal sage
#

Does that require it at the SPOT

blazing portal
#

require('./folder/blabla.js');

delicate shore
#

^

quartz kindle
#

or ../folder/bla.js if you want to go to the previous folder

surreal sage
#

like put the content from in right below the code line of the require()?

#

i know

earnest phoenix
#

and then you can export the functions in your required file

surreal sage
#

ok wait wait

delicate shore
#
if (command === "unban") {
    let User = args[0];
    let Reason = args.slice(1).join(` `);
    if (!User) return msg.reply(`Who are we unbanning?`);
    if (!Reason) Reason = `Unbanned by ${msg.author.tag}`;

    if (msg.member.hasPermission("BAN_MEMBERS"))
      return msg.rely(
        "Only people with permission to ban members can use this"
      );

    msg.guild.fetchBans().then(bans => {
      if (bans.some(u => User.includes(u.username))) {
        let user = bans.find(user => user.username === User);

        msg.guild.unban(user.id, Reason);
      } else if (bans.some(u => User.includes(u.id))) {
        msg.guild.unban(User, Reason);
      } else {
        return msg.reply(`This person is not banned`);
      }
    });
  }```
#

my bot keeps on saying

#

member is not banned

surreal sage
#
//External File
console.log('haha yes')
//main file
console.log('The script in the external file would be executed below')
require("externalfile.js")
quartz kindle
#

yes

#

however

#

the external file will be executed, but any declared function or variable will be lost if not explicitly exported

willow river
quartz kindle
#

the required file is not injected into the current scope like it happens in browser js

surreal sage
#

so basicly

#

put the script in the external file

#

in a function

#

and require it and then run the function

quartz kindle
#

for example

earnest phoenix
#

@delicate shore you have a typo, and use lowerCamelCase

surreal sage
#

basicly a external module

quartz kindle
#
//a.js
var a = 10;

//b.js
var b = 10;
module.exports = b;

//main
console.log(require("./a.js")) // undefined
console.log(require("./b.js")) // 10
console.log(a) // undefined
console.log(b) // undefined
surreal sage
#

alr i get it

#

but

#

nvm

willow river
quartz kindle
#

loop over guild.roles.cache

blazing portal
#

loop through them

willow river
#
client.on("message", message => {
  if (message.content.startsWith(prefix + "serverroles")) {
    const List = message.guild.roles.cache(e => e.toString()).join(" ");

    const serverroles = new Discord.RichEmbed()
      .setTitle("➠ server roles")
      .setAuthor(message.guild.name, message.guild.iconURL)
      .setColor("RANDOM")
      .setDescription(List)
      .setFooter(message.guild.name);
    message.channel.send(serverroles);
  }
});
#

@quartz kindle like this

quartz kindle
#

cache is not a function, its a collection of roles

#

use .cache.map() to remap tem into a list of role names

#

and .name is probably better than .toString()

willow river
#
client.on("message", message => {
  if (message.content.startsWith(prefix + "serverroles")) {
    const List = message.guild.roles.cache.map(e => e.toString()).join(" ");

    const serverroles = new Discord.RichEmbed()
      .setTitle("➠ server roles")
      .setAuthor(message.guild.toString, message.guild.iconURL)
      .setColor("RANDOM")
      .setDescription(List)
      .setFooter(message.guild.toString);
    message.channel.send(serverroles);
  }
});

It is difficult, can you fix the mistake and send me the code please? @quartz kindle

digital ibex
#

he's not gonna do that lmaooo

earnest phoenix
#

I see an issue..

#

You are using both v12 and v11 syntax

#

which are you using

digital ibex
#

he already told u what to do

earnest phoenix
#

how does one play music from spotify
I am already playing music from youtube

digital ibex
#

bruh

lusty quest
#

there is a npm module i think

earnest phoenix
#

can ya link it

quartz kindle
#

look for either an api or libraries that do it

earnest phoenix
#

not sure which library i can use

quartz kindle
#

search for spotify on npm

earnest phoenix
#

found it

digital ibex
#

I have a website, and to login to it u need to provide the username and password, but if u dont want to do that u can do /users/userid how can I make it not do that because then anyone can log into anyones account just by knowing their id.. any ideas? im using expressjs btw

earnest phoenix
quartz kindle
#

search for others

earnest phoenix
#

@digital ibex Assign a cookie once someone logs in

digital ibex
#

im doing that

#

thats not gonna do anything tho

delicate shore
#

@delicate shore you have a typo, and use lowerCamelCase
@earnest phoenix what

#

where is typo?

cinder patio
#

check if the session (cookie) matches the ID of the user

delicate shore
#

how

#

sorry i am not so good

#

at coding

lusty quest
#

gg

#

its not for you

delicate shore
#

oh

digital ibex
#

so I can dojs if (req.headers.cookie === user.id) { } and that'd stop them from being able to do that?

delicate shore
#

btw pls help me

earnest phoenix
#

this is gonna be hard for me to implement spotify :/

cinder patio
#

It wouldn't as they can just set the cookie to the user ID

delicate shore
#
if (command === "unban") {
    let User = args[0];
    let Reason = args.slice(1).join(` `);
    if (!User) return msg.reply(`Who are we unbanning?`);
    if (!Reason) Reason = `Unbanned by ${msg.author.tag}`;

    if (msg.member.hasPermission("BAN_MEMBERS"))
      return msg.rely(
        "Only people with permission to ban members can use this"
      );

    msg.guild.fetchBans().then(bans => {
      if (bans.some(u => User.includes(u.username))) {
        let user = bans.find(user => user.username === User);

        msg.guild.unban(user.id, Reason);
      } else if (bans.some(u => User.includes(u.id))) {
        msg.guild.unban(User, Reason);
      } else {
        return msg.reply(`This person is not banned`);
      }
    });
  }```
#

this is my code

digital ibex
#

oh

delicate shore
#

my bot says member is not banned

cinder patio
#

you should create sessions for when somebody logs in and store them in a database, for example a session could look like this:

{sessionId: "SOME LONG UNIQUE STRING", userId: "some user ID"}
#

Then with the cookie you are gonna get the userId and compare em

digital ibex
#

hm, im confused now, the user id and the cookies aren't the same

#

the id is just numbers

cinder patio
#

You put the sessionId in a cookie

#

and get the userId via that cookie

delicate shore
#

hey guys

#

can anyoe helpme

#

help me

#

i posted thrice

#

thnx

digital ibex
#

hm, would I add session id's per visit or only use one?

cinder patio
#

You should create a session when a user logs in / registers

digital ibex
#

and everytime they do whatever, update the session id or add onto the session ids?

cinder patio
#

No, update the session ID only when they log out / login

digital ibex
#

oh

#

update it to what? nothing or

cinder patio
#

For example...

User A logs into the website, a session is created for them {sessionId: "12345", userId: "their id or whatever"}

Now, when they go to a certain page and you need their profile, you could easily get the user who's logged in:

const session = await myDatabase.sessions.findOne({sessionId: req.cookies.sessionId});
const userProfile = await myDatabase.users.findOne({id: session.userId});

When user A logs out, the session's destroyed and a new one will be created when they log back in. You could make it so sessions expire after a certain time (for example, 5 days)

digital ibex
#

oh

plucky harness
#

i have never used webhooks . how to use them with python any guide?

digital ibex
#

so then i just do:js if (session === userProfile) { } and then done?

delicate shore
#

anyone help me

spare mirage
#

@delicate shore dont unban people for reason doesnt make sense

delicate shore
#

?

cinder patio
#

no, lol, what are you trying to do again

delicate shore
#

what

strange trout
#

userProfile is the user that you fetch with the session user ID

spare mirage
#

why would u have a reason to unban

digital ibex
#

me?

strange trout
#

Why would you compare them

delicate shore
#

why would u have a reason to unban
@spare mirage It can act as kind of warning

#

that u sure u wanna ban that kid

#

so

#

he has to give reason

spare mirage
#

no

#

unban

#

is to unban

digital ibex
#

so other people cant log into other peoples account

spare mirage
#

lol

delicate shore
#

ok

#

so what shoukd be code

spare mirage
#

haha no

cinder patio
#

The snippets I gave you already do this... There's no way a user can get someone else's sessionId

delicate shore
#

session id?

#

i mean the

#

id

#

of

#

the person

cinder patio
#

I'm not talking to you

delicate shore
#

brvh

spare mirage
#

@delicate shore dont expect everyone to help u

delicate shore
#

😦

strange trout
#

You should look into making web apps and oauth flow instead of jumping straight into it

delicate shore
#

me?

strange trout
#

Last thing you want is an insecure site due to lack of knowledge

delicate shore
#

ok

spare mirage
#

I kind abroke my bot

delicate shore
#

pls help

#

with unban command

#

lol

#

🥺

spare mirage
#

bruh

strange trout
#

What's the issue

delicate shore
#

my bot says person i snot banned

#

is not*

strange trout
#

And what steps have you taken to resolve it

delicate shore
#

but he is

spare mirage
#

:/

#

its 5 lines of code

delicate shore
#

wot

#

@spare mirage my code is wrong?

#

then?

#

?

spare mirage
#

msg.guild.fetchBans().then(bans => {
if (bans.some(u => User.includes(u.username))) {
let user = bans.find(user => user.username === User); this is wrong

delicate shore
#

oh

strange trout
#

Is User an array?

spare mirage
#

no

delicate shore
#

nope

strange trout
#

Are you resolving the user by the name?

delicate shore
#

i always watch wrong tuotorials

spare mirage
#

ooof

#

NO TUTORIALS

#

DOCS

delicate shore
#

Are you resolving the user by the name?
@strange trout id / name#tag

spare mirage
#

userid

delicate shore
#

^

#

gg for me

#

ok

#

so.

spare mirage
#

so if u want to unban user ID ur command will be unban <@!userid>

strange trout
#

You should do it by ID

spare mirage
#

@delicate shore do u use something like
let NAME = args[0]

delicate shore
#

i-

spare mirage
#

?

delicate shore
#

if (command === "unban") {
let User = args[0];

#

i use this

spare mirage
#

COMMAND HANDLER

surreal notch
#

how to use inline field in discord.js v11 cmd handler

spare mirage
#

eww v11 update to v12

surreal notch
#

lol

delicate shore
#

COMMAND HANDLER
@spare mirage i don't use it

spare mirage
#

breh

surreal notch
#

it took time for me

#

to update

#

how to use inline field in discord.js v11 cmd handler
@surreal notch

delicate shore
#

because command handler difficult

#

imagine piging urself

spare mirage
#

after that u fetch the bans @delicate shore

surreal notch
#

lol

delicate shore
#

while quoting

#

yes?

tough hedge
#

N,ping

spare mirage
#

yes

tough hedge
#

-bots noembed

gilded plankBOT
#

Izzy#2929's bots:
@narrow orbit

delicate shore
#

umm

#

after that u fetch the bans
@spare mirage ?

spare mirage
#

yes

delicate shore
#

then

spare mirage
#

fetch the bans

#

did u do that?

delicate shore
#

i do

#
if (command === "unban") {
    let User = args[0];
    let Reason = args.slice(1).join(` `);
    if (!User) return msg.reply(`Who are we unbanning?`);
    if (!Reason) Reason = `Unbanned by ${msg.author.tag}`;

    if (msg.member.hasPermission("BAN_MEMBERS"))
      return msg.rely(
        "Only people with permission to ban members can use this"
      );

    msg.guild.fetchBans().then(bans => {
      if (bans.some(u => User.includes(u.username))) {
        let user = bans.find(user => user.username === User);

        msg.guild.unban(user.id, Reason);
      } else if (bans.some(u => User.includes(u.id))) {
        msg.guild.unban(User, Reason);
      } else {
        return msg.reply(`This person is not banned`);
      }
    });
  }```
#

see i fetch

#

bans

spare mirage
#

WHY A REASOn

delicate shore
#

becasue

#

why not

spare mirage
#

:/

#

why

#

makes it harder

delicate shore
#

ok

#

so now

#

should i remove reason

spare mirage
#

bruh

#

spam

#

yes

earnest phoenix
#

You tell to the member that you don't have permission if they have it

delicate shore
#

ok

#

so

#
if (command === "unban") {
    let User = args[0];
    let Reason = args.slice(1).join(` `);
    if (!User) return msg.reply(`Who are we unbanning?`);
    if (!Reason) Reason = `Unbanned by ${msg.author.tag}`;

    if (msg.member.hasPermission("BAN_MEMBERS"))
      return msg.rely(
        "Only people with permission to ban members can use this"
      );

    msg.guild.fetchBans().then(bans => {
      if (bans.some(u => User.includes(u.username))) {
        let user = bans.find(user => user.username === User);

        msg.guild.unban(user.id, Reason);
      } else if (bans.some(u => User.includes(u.id))) {
        msg.guild.unban(User);
      } else {
        return msg.reply(`This person is not banned`);
      }
    });
  }```
spare mirage
#

?

delicate shore
#

so

#

oh

#

wtf

earnest phoenix
#

Put a ! before msg.member.hasPermission("BAN_MEMBERS")

spare mirage
#

reply

#

message.reply

delicate shore
#
if (command === "unban") {
    let User = args[0];
    let Reason = args.slice(1).join(` `);
    if (!User) return msg.reply(`Who are we unbanning?`);
    if (!Reason) Reason = `Unbanned by ${msg.author.tag}`;

    if (!msg.member.hasPermission("BAN_MEMBERS"))
      return msg.rely(
        "Only people with permission to ban members can use this"
      );

    msg.guild.fetchBans().then(bans => {
      if (bans.some(u => User.includes(u.username))) {
        let user = bans.find(user => user.username === User);

        msg.guild.unban(user.id);
      } else if (bans.some(u => User.includes(u.id))) {
        msg.guild.unban(User);
      } else {
        return msg.reply(`This person is not banned`);
      }
    });
  }```
#

@spare mirage now?

#

but

#

like

#

i already have id

#

in user

earnest phoenix
#

Change msg.rely() to
msg.reply()

delicate shore
#

so do i need it

spare mirage
#
      return msg.reply("Only people with permission to ban members can use this"
      )};```
#

shouldnt it be this

delicate shore
#

so?

#

/\

#

@earnest phoenix wdym?

earnest phoenix
#

Just when you click on VOTE button on a bot, it will show a login hyperlink... Click on it then authorize

#

Screenshot?

delicate shore
#

I can't vote on a bot, it won't let me
@earnest phoenix
Login

#

With top right

#

If you on pc

#

Mobile sucks

spare mirage
#

@delicate shore if there are no bans u should return or it will break

so?

delicate shore
#

Oh

#

Lemme see

#

Wait a sec

earnest phoenix
#

Also are you trying to unban by ID or by username?

spare mirage
#

ID

earnest phoenix
#

Doesn't seems to be

spare mirage
#

dms

#

@earnest phoenix

earnest phoenix
#

"user.username === User"

#

"let User = args[0]"

spare mirage
#

and he gave up

#

¯_(ツ)_/¯

#

@earnest phoenix do u know why this is not workking?

bot.commands = new Discord.Collection(); 
bot.aliases = new Discord.Collection(); 
const modules = ['fun','moderation','others']; 
const fs = require('fs'); 

modules.forEach(c => {
fs.readdir(`./commands/${c}/`, (err, files) => { 
if (err) throw err; 
console.log(`[Commandlogs] Loaded ${files.length} commands of module ${c}`); 


files.forEach(f => { 
const props = require(`./commands/${c}/${f}`); 
console.log(props)
bot.commands.set(props.name, props); 
props.conf.aliases.forEach(alias => { 
bot.aliases.set(alias, props.name); 
});
});
});
});```
earnest phoenix
#

@spare mirage error?

quartz kindle
#

define "not working"

spare mirage
#

ok

distant talon
spare mirage
#

lemme chel

quartz kindle
#

you moved the require line outside of the forEach lol

spare mirage
proven lantern
#

@spare mirage Shift + Alt + F will format your code in visual studio code

spare mirage
#

?

#

nope

#

doesnt do anything

proven lantern
#

might need to highlight first

spare mirage
#

?

pure lion
#

Right click

#

Format

lyric mountain
proven lantern
#

yeah

quartz kindle
#

did you just leak your token lmao

lyric mountain
#

lul

placid iron
#

Ahahhaha

lyric mountain
spare mirage
#

regen

#

I leak it 24/7

#

xD

quartz kindle
#

also, one of your commands doesnt have a .conf property

spare mirage
#

?

quartz kindle
#

cannot read property aliases of undefined

#

meaning you're trying to read aliases from undefined, meaning conf is undefined

#

ie: prop.conf doesnt exist

spare mirage
#

uhh

#

its probs.config

earnest phoenix
#

help

quartz kindle
#

you need to open your commands and see

spare mirage
#

change it to 0

#

probably

quartz kindle
#

args is not defined

earnest phoenix
#

args[1] is not defiened

#

or args

spare mirage
#

props.conf.aliases.forEach(alias => { what do I change @quartz kindle

quartz kindle
#

cannot read 1 of undefined meaning you're trying to read 1 from undefined, meaning args is undefined

earnest phoenix
#

:0

quartz kindle
#

@spare mirage you need to open your commands and see

earnest phoenix
#

ok

spare mirage
#
const discord = require("discord.js");


module.exports = {
  name: "ban",
  category: "moderation",
  description: "Ban anyone with one shot whithout knowing anyone xD",
  usage: "ban <@user> <reason>",
  execute(bot, message, args) {
   
    if(!message.member.hasPermission("BAN_MEMBERS" || "ADMINISTARTOR")) {
      return message.channel.send(`**${message.author.username}**, You do not have perms to ban someone`)
    }
    
    if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, I am do not have perms to ban someone`)
    }
    
    const target = message.mentions.members.first();
    
    if(!target) {
      return message.channel.send(`**${message.author.username}**, Please mention the person who you want to ban.`)
    }
    
    if(target.id === message.author.id) {
      return message.channel.send(`**${message.author.username}**, You can not ban yourself!`)
    }
    
   
    
   if(!args[1]) {
     return message.channel.send(`**${message.author.username}**, Please Give Reason To ban Member`)
   }
    
    let embed = new discord.MessageEmbed()
    .setTitle("Action : Ban")
    .setDescription(`:white_check_mark: Banned ${target} (${target.id})`)
    .addField("Reason : " + args.splice(1).join(" "), `Good Job ${message.author.tag} u get a banana :banana:`, true)
    .setColor("#ff2050")
    .setThumbnail(target.avatarURL)
    .setFooter(`Banned by ${message.author.tag}`);
    
    message.channel.send(embed)
    target.ban(args[1])
    
    
    
  }
}``` is there something wrong here?
earnest phoenix
#

omfg

#

stop

#

dude

spare mirage
#

hastebin

#

sorry

#

:/

quartz kindle
earnest phoenix
#

u missed aliases

#

taht is

#

or maybe

#
config : {}
quartz kindle
#

you have name, category, description, usage and execute, but you dont have any conf

earnest phoenix
#

yes

spare mirage
#

so I make it conf:

quartz kindle
#

whatever you want

earnest phoenix
quartz kindle
#

prop is the required file, meaning prop contains those you write there

earnest phoenix
#

cuz i am using it in .then()

#

only m is defiened

quartz kindle
#

if you want to access prop.conf, you need to have a conf there to give it something to read

spare mirage
#

src = 'prop.conf' ?

quartz kindle
#

you dont need to pass arguments to setTimeout

earnest phoenix
#

oh

#

i fixed

quartz kindle
#

just do setTimeout(() => {

earnest phoenix
#

but i wanted to edit the message that i sended

tulip ledge
#

Anyone got some documentations/source code of a command handler working with classes? I want to try to learn it my friend told me classes is much better then objects

lusty quest
#

store the message you send in a value

quartz kindle
#

you already have the message

spare mirage
#

a command handler hurts my brain

earnest phoenix
#

oh

lusty quest
#

const message = channel.message.send()

quartz kindle
#

if you add arguments to the setTimeout you are overriding the variables you already have with the same name

#

with empty ones

#

so dont pass anything to setTimeout, and let it use the existing variables that exist outside

#

@spare mirage ```js
module.exports = {
bla:1,
bla2:2,
bla3:3
}

// main file
prop = require(path/to/file.js)
prop.bla // 1
prop.bla2 // 2
prop.bla3 // 3

solemn latch
tulip ledge
#

No one has documentions of a command handler working with classes?

quartz kindle
#

@solemn latch lmao

#

thats much better than mine, holy

spare mirage
#

nop

sterile minnow
#

Hi,

I'm currently tyring to use spotify-url-info and i wanted to ask how i get the things that it returns

quartz kindle
#

@tulip ledge honestly using classes for a command handler is a waste

spare mirage
#

module.exports = {
bla:1,
bla2:2,
bla3:3
}

// main file
prop = require(path/to/file.js)
prop.bla // 1
prop.bla2 // 2
prop.bla3 // 3
what does this even mean

quartz kindle
#

its to show you how it works lol

#

what dont you understand?

tulip ledge
#

Tim

#

Do you know anything about command hanlders with classes?

#

Oh u tagged me I see

quartz kindle
#

i wouldnt use classes for a command handler

spare mirage
#

@quartz kindle are there easier command handlers that automatically execute?

tulip ledge
#

My friend said it's way more efficient

quartz kindle
#

its not

#

unless you're reusing lots of stuff

tulip ledge
#

And you can apparently change stuff using bot commands like changing enabled to false without having to go into the files and change it yourself and restarting the bot

quartz kindle
#

like multiple commands that are very similar

earnest phoenix
tulip ledge
#

Yeah I don't need that

pure lion
#

That's not hard

#

But yes, vx sexc

quartz kindle
#

anyway if you wanna do it with classes, its not much different

#

you just do this

earnest phoenix
#

is that bot opensource

tulip ledge
#

I would like to learn more about classes tho

earnest phoenix
#

js classes?

tulip ledge
#

I only know how to construct them

#

Yes

pure lion
#

There's an npm wrapper

quartz kindle
#

you can do something like this for starters ```js
module.exports = class MyCommand {
execute(message) {
message.send("bla")
}
}

earnest phoenix
#

ik how to make http requests lmao

tulip ledge
#

Oh

#

And the handler is just the same

#

It's just the files that are changed?

#

If u get what I mean

quartz kindle
#

the difference is that you need to initialize it with the new keyword

earnest phoenix
#

I made a bot from my mobile

tulip ledge
#

Oh yeah

earnest phoenix
#

!!!

tulip ledge
#

Ok?

pure lion
#

Is class used for constructing constructors?

tulip ledge
#

But is there a way to like change values in the module.exports without needing classes?

quartz kindle
#

classes are good for creating a blueprint that gets reused every time

pure lion
#

Ah

tulip ledge
#

Since I want to be able to disable commands when I'm on my phone etc

#

Thats the main reason I wanted to use classes

earnest phoenix
#

@tulip ledge yea

spare mirage
#

module.exports = class MyCommand {
execute(message) {
message.send("bla")
}
}
@quartz kindle
wont u need
if
else if
else if
shit for that?

pure lion
#

N-

tulip ledge
#

???

#

Wut?

pure lion
#

What?

quartz kindle
#

you dont need if else walls for anything

solemn latch
#

you dont need that now with your command handler

quartz kindle
#

not even in without classes

solemn latch
#

you just do elseif for some reason

#

🤔

pure lion
#

Elif

#

Elif

#

Elif

solemn latch
#

elif

tulip ledge
#

Oh yeah elif exists

#

Lol

spare mirage
#

to execute the commandname.js files??!??!

pure lion
#

From py(?)

solemn latch
#

yeah

tulip ledge
#

No lol?

pure lion
#

Ok ok ok

solemn latch
#

get the command with the name(dynamically)

tulip ledge
#

You can just run the files when they're called?

solemn latch
#

then run them

tulip ledge
#

Like Woo said

pure lion
#

Wouldn't it be cool if

spare mirage
#

?

tulip ledge
#

But is there a way to like change values in the module.exports without needing classes?

pure lion
#

You had one handler statement

tulip ledge
#

So I can do like -disable <command>

pure lion
#

And it got args[0] and ran it?

tulip ledge
#

And it changed it

spare mirage
#

imma ge tback my old handler

quartz kindle
spare mirage
#
client.commands = new Discord.Collection();
 
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
    const command = require(`./commands/${file}`);
 
    client.commands.set(command.name, command);
}
 
 
client.once('ready', () => {
    console.log('Codelyon is online!');
});
 
client.on('message', message =>{
    if(!message.content.startsWith(prefix) || message.author.bot) return;
 
    const args = message.content.slice(prefix.length).split(/ +/);
    const command = args.shift().toLowerCase();
 
    if(command === 'ping'){
        client.commands.get('ping').execute(message, args);
    }
});``` how do I iprove this
pure lion
#

Learn js

spare mirage
#

bruh

pure lion
#

¯\_(ツ)_/¯

tulip ledge
#
  1. Get an event handler
  2. Fix your command handler
pure saddle
#

learn js

#

^^^^^

quartz kindle
#

@spare mirage i believe i told you before, that you can replace the entire if else wall of text wth a simple check if command exists

tulip ledge
spare mirage
#

"simple" is different

pure lion
#

Why can't we just do client.commands.get(args[0])

tulip ledge
#

You literally check if it exists

pure lion
#

Ultra dynamic

solemn latch
#

you can use client.commands.get(command)

#

🤔

#

and then execute it

tulip ledge
#

Some people splice their command from their args meaning args[0] would be the 2nd thing given in the message @pure lion

pure lion
#

Ah

solemn latch
#

which i think is the better way to do it

pure lion
#

Well I'm gonna go do that :D

tulip ledge
#

const command = args.shift().toLowerCase(); here he shifts it meaning the first index is removed from the original args array

spare mirage
#

client.commands.get(command) what?

tulip ledge
#

if(client.commands.get(command)) //code

solemn latch
#

you defined your command Name as command

spare mirage
#

HUH

#

my brain

#

bruh

#

this is not healthy

tulip ledge
#

@spare mirage Please just learn js

solemn latch
#

🤔

tulip ledge
#

It's really simple javascript

pure lion
#

Yeah

#

I can tell

tulip ledge
#

I even understand it so its BASIC javascript

#

Lol

solemn latch
#

ima go make lunch, gl

pure lion
#

I learned js in a relatively short period of time

spare mirage
#

ok

#

Ill make a deal

pure lion
#

No

#

Learn

#

No deals

spare mirage
#

after this FKN DUMBASS SHITTY command handler works

#

ill learn js

pure lion
#

No

tulip ledge
#

People who have coding in schools are so lucky we don't have any software development its so annoying

pure lion
#

Learn now

spare mirage
#

People who have coding in schools are so lucky we don't have any software development its so annoying
@tulip ledge ikr

tulip ledge
#

Then you can fix it

solemn latch
#

ive been using js for months now, and i dont consider myself very knowledgeable about it.

I still learn a small quirk or two a day

pure lion
#

People who have coding in schools are so lucky we don't have any software development its so annoying
I literally started coding 1/2 months ago :DddDddDDDdDdDDDDddDDDDD school is shit

quartz kindle
#

@spare mirage imagine yu have a list, like this [1,2,3,4,5,6,7,8,9]
you dont need to do if(list.includes(1)) { return 1 } else if(list.includes(2)) { return 2 } you can just do return list.find(1) directly

tulip ledge
#

I started learning it 4 years ago but haven't really done alot since like a year or 2 and I'm pretty bad at it

quartz kindle
#

its the same principle with commands

spare mirage
#

ok

pure lion
#

Can someone gimme a js test idk what "level" I'm at