#development

1 messages · Page 1357 of 1

little meteor
#

not working
@earnest phoenix what's your discord.py version?

earnest phoenix
#

@little meteor 1.5.1

little meteor
#

do you have intents?

#

if I am not wrong on that version you need to enable guild and members intents

earnest phoenix
#

nope

little meteor
#

check the link

earnest phoenix
#

lemme check

little meteor
quick ridge
pale vessel
#

try removing data, from setImage()

carmine summit
#

How do I deal with:

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
pale vessel
#

what did you do

carmine summit
#

uh

pale vessel
#

usually that happens when you .toString() an object

carmine summit
#

i didnt

#

i swear

pale vessel
#

you can try showing your code

#

maybe we can see the issue

carmine summit
#
      let requests = []
      let pages = (await axios(`https://api.hypixel.net/skyblock/auctions`)).data.totalPages
      for (i=0; i<pages; i++){
        requests.push(axios(`https://api.hypixel.net/skyblock/auctions?page=${i}`))
      }
      let done = await Promise.all(requests)
      console.log(done)
      fs.writeFile('./request.txt', done)
earnest phoenix
#

You're pushing an object to the array

carmine summit
#

?

earnest phoenix
#

axios returns a Promise object

carmine summit
#

ok..........

earnest phoenix
#

actually no i got it wrong

pale vessel
#

they resolved them

earnest phoenix
#

@pale vessel imma head out explain em what this does

carmine summit
#

nah

#

at the conole

earnest phoenix
#

try console.log(done);

carmine summit
#

it did not go object objct

#

only at the

#

fs

pale vessel
#

do you want to get the response

carmine summit
#

writeFile

earnest phoenix
#

Because the console can display the stuff inside it

pale vessel
#

(from axios)

earnest phoenix
#

fs takes a string

quick ridge
#

try removing data, from setImage()
@pale vessel its not working

carmine summit
#

fs takes string

#

wtf

earnest phoenix
#

when it tries to convert it to a string the object Object occurs

#

fs takes string
wtf
@carmine summit do you think you'll write objects to a text file

carmine summit
#

omg

#

wait

earnest phoenix
#

@little meteor btw i cant use intents if my bot is in less than 100 servers?

#

You can

#

But after 100 servers you need verification to use them

#

oh ok

carmine summit
#

@carmine summit do you think you'll write objects to a text file
@earnest phoenix I made it to .json, it still outputs as [Object object]

earnest phoenix
#

bruh

#

the actual file data is a string

carmine summit
#

?

earnest phoenix
#

the file extension can be anything but the data you WRITE to the file has to be string

carmine summit
#

so i have to make the object into a string

#

before i have to

earnest phoenix
#

the file can STORE objects in JSON but the JSON data you pass to fs to WRITE to the file must be JSON

#

so i have to make the object into a string
@carmine summit yes

#

JSON.stringify

carmine summit
#

Error: Converting circular structure to JSON
--> starting at object with constructor 'ClientRequest'
| property 'socket' -> object with constructor 'TLSSocket'
--- property '_httpMessage' closes the circle

earnest phoenix
#

@quartz kindle

grizzled raven
#

call me tim

#

@green kestrel

carmine summit
#

Also, I want it so that it will push the auctions array,
So instead of

requests.push(axios(`https://api.hypixel.net/skyblock/auctions?page=${i}`))

I wanted something like:

let response = axios(`https://api.hypixel.net/skyblock/auctions?page=${i}`)
requests.push(response.data.auctions)

But it always returns undefined

#

@weak parrot

#

ads

grizzled raven
#

i pinged brain but eh he didn't respond

#

also what's undefined @carmine summit

carmine summit
#

when i pushed them into the array

#

because it is not await

#

and im not allowed to await it because it needs to be concurrent

grizzled raven
#

you could make a promise object that awaits the request

#

but i still don't see where the undefined is

carmine summit
#

you can see my code above

#

@weak parrot ADS

grizzled raven
#

oh hm

#

well isn't auctions part of the result of the request?

carmine summit
#

@coral trellis ads

grizzled raven
#

someone will come eventually, i don't really recommend pinging multiple mods for this one ad mmLol

carmine summit
#

at mods

pale vessel
#

@carmine summit map the responses to their data

#

since the resolved data is an array of axios responses

#

responses.map(x => x.data)

#

that would be an array of string

carmine summit
#

Once I hear the word map, me: Holy **** this is gonna be confusing

pale vessel
#

nahhh

#

after that you can just JSON.stringify() the mapped data and use fs to save it

#

#development message
so add done = done.map(x => x.data); after defining it and change done to JSON.stringify(data) in writeFile()

coral trellis
#

Wat

pale vessel
#

what

carmine summit
#

eh?

#

ads

unkempt marsh
#

.map() return Array.

carmine summit
#

over there

pale vessel
#

.map() return Array.
@unkempt marsh yes

carmine summit
#

Things that make me scared:

  1. Export/Import
  2. Maps
  3. Collections
  4. Promises
  5. Mongoose
sudden geyser
#

The first four are easy to get over

#

The 5th one 🚪 🚶‍♂️

carmine summit
#

this however

#

700kb worth of [Object object]

pale vessel
#

show code

carmine summit
#

wait

#

wait

#
      let requests = []
      let pages = (await axios(`https://api.hypixel.net/skyblock/auctions`)).data.totalPages
      for (i=0; i<pages; i++){
        requests.push(axios(`https://api.hypixel.net/skyblock/auctions?page=${i}`))
      }
      let done = await Promise.all(requests)
      done = done.map(x => x.data.auctions);
      console.log(done)
      fs.writeFile('./request.json', JSON.stringify(done))
pale vessel
#

what does it show up as in console?

earnest phoenix
#

how do i like get cmds from commands/{folders}
like
i can make categories in my commands folder
so cmds folder can have moderation, utility, fun, etc

#

ewewe

quick ridge
#

or
What do you suggest instead of canvacord

carmine summit
#

so I have something like:

[
{
"Seller": "Guy A",
"Price": 4
}
{
"Seller": "Guy B",
"Price": 10
}
{
"Seller": "Guy C",
"Price": 3
}
]
```I wanted to get the lowest price, and return `Guy C` and `3`
#

I know how to do it but its gonna be long / bulky / spaghetti code

latent ocean
#

not work et no error

boreal iron
#

Just sort the array by it’s object property price

#

They return new array.first()

#

Or last... depending on sorting it ASC or DESC

carmine summit
#

Just sort the array by it’s object property price
@boreal iron How exctly can I do that

#

array.sort

pale vessel
#

map xd

carmine summit
#

map

pale vessel
#

sort and map

solemn latch
pale vessel
#

sort by price, map it by seller and price

#

you can even use reduce() and don't even need .map()

#

like array.reduce((x, y) => y.Price > x.Price ? y : x).Seller

carmine summit
#

wtf

crimson vapor
#

the ? and : is gonna confuse someone

pale vessel
crimson vapor
#

reduce is a bit more efficient than sort right

boreal iron
#

@carmine summit Easy example:

let test = [{seller: "Guy A",price: 4},{seller: "Guy B",price: 10},{seller: "Guy C",price: 3}];

test.sort(function(a, b)
{
  if (a.price < b.price) return -1;
  if (a.price > b.price) return 1;

  return 0;
});

result => [ { seller: 'Guy C', price: 3 },
  { seller: 'Guy A', price: 4 },
  { seller: 'Guy B', price: 10 } ]```
solemn latch
#

Ternary operators are important to understand

crimson vapor
#

yeah

#

fun to use tbh

#

annoying to figure out what a long variable is sometimes tho

pale vessel
crimson vapor
#

test which is faster

carmine summit
#

wtf

crimson vapor
#

the reduce should be faster because it doesnt have 2 if statements, only 1

viral spade
#

Hi,
my bot project has 3 node programs, running on different vps. that is 1. the bot 2. the backend and 3. the website. I update the code to the servers via git.

is it ok to have all three programs in separate git repositories? or should i put it in the same repository? Make a branch per program? What is best practice in such a case?

boreal iron
#

@carmine summit Mines will return the <whole> sorted array. Sorting ASC in my example. test[0] will be the "smallest" val of obj.price

solemn latch
#

Project vs solution kinda?

crimson vapor
#

different vps? I would use different repos, I can't say I know which is the best practice

#

especially since they have different functionalty

solemn latch
#

Right now, I have two seperare programs and they are in diffrent repos

#

For the one bot

#

But the major versions are always the same to make sure they work together.

carmine summit
#
test.sort((a,b) => a.price < b.price ? return -1 : return 1))
solemn latch
#

Honestly would have been easier to put them in one repo, and just consider them multiple projects in one solution

boreal iron
#

@carmine summit Nope, a.price and b.price can be equal, too

pale vessel
#

@carmine summit you can just use (a,b) => b.Price - a.Price

crimson vapor
#

if they are equal just pick a random one

#

ez

pale vessel
carmine summit
#

wut

boreal iron
#

test.sort(function(a, b) { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? -1 : 1)); });
test.sort((a, b) => { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? -1 : 1)); });

#

if they are equal just pick a random one

We don't pick an item, we sort the array

carmine summit
#

javascript is harder than i expected

solemn latch
#

Nah, just a lot of basic concepts

crimson vapor
#

nah javascript is english but with .s and ()

faint prism
#

I don't like non-typed languages tbh

#

oop all the way

crimson vapor
#

it makes it easier to learn tho

faint prism
#

I disagree with that opinion

#

I think it leads to more runtime and logic errors

#

especially for beginners

boreal iron
#

btw. just had one extra ) ... typo

crimson vapor
#

from what I can tell the most issues people have are from not reading errors and just asking other people

solemn latch
#

Runtime errors are part of the fun

faint prism
#

Runtime errors are part of the fun
@solemn latch Pure evil lol

#

from what I can tell the most issues people have are from not reading errors and just asking other people
@crimson vapor Types allow the compiler to warn you primitively before it becomes a runtime error So it doesn't crash and burn mid execution

boreal iron
#

@carmine summit u got it? array.sort((a, b) => { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? -1 : 1)); });

carmine summit
#

yes

#

thanks

boreal iron
#

ok

carmine summit
#

even if i dont understand how it works

boreal iron
#

can be in DESC order also, switching -1 and 1

carmine summit
#

im kinda curious about this one tho (a,b) => b.Price - a.Price

delicate shore
#

Bot isn't responding

#

And responds after 20 mins

#

And said this

feral aspen
#

Hi

boreal iron
#

ASC test.sort((a, b) => { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? -1 : 1)); });
DESC test.sort((a, b) => { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? 1 : -1)); });

carmine summit
#

thanks

crimson vapor
#

I don't see a mention

feral aspen
#

Nevermind..

#

I messed up in args.slice

#

soz

carmine summit
#

[],[],[],[],[],[],

#

why this tho

crimson vapor
#

wdym

solemn latch
#

An array of arrays?

faint prism
#

super jagged

crimson vapor
#

no thats not quite an array

pale vessel
#

2d array

faint prism
#

it's not just 2d

carmine summit
#

im very well confused on how it

faint prism
#

it's 6d

carmine summit
#

ended up ther

crimson vapor
#

how is it 6d?

boreal iron
#

An array of arrays?

Would be [[], [], []]

faint prism
#

good luck conceptualizing that jagged array

crimson vapor
#

how do you make a 3d array?

quartz kindle
#

With blender

faint prism
#

[],[],[]

pale vessel
#

LMAO

boreal iron
#

welcome to JS where associative arrays doesn't exist

crimson vapor
#

ok

pale vessel
#

tim lmao

boreal iron
#

just bc it's trash

crimson vapor
#

why do you hate JS lmao @boreal iron

quartz kindle
#

Associative arrays are basically objects

boreal iron
#

aye, but not associative arrays

latent ocean
#

help me plz

crimson vapor
#

whats the issue lol

latent ocean
#

no error

#

not work

crimson vapor
#

and that gets called?

#

is it posting?

latent ocean
#

?

quartz kindle
#

Does it log "webhook runnibg at..."?

carmine summit
#

instead of doing js for(...) { result = await axios(...) ... } you do something like this ```js
let requests = [];
for(...) {
requests.push(axios(...))
}
let done = await Promise.all(requests)
...

@quartz kindle This.... Is not concurrent I think.

latent ocean
#

@quartz kindle yes

pale vessel
#

yes

crimson vapor
#

ah yes

#

questioning tim

latent ocean
quartz kindle
#

It is concurrent

carmine summit
#

it spent the same time

crimson vapor
#

isn't it supposed to say 0.0.0.0?

carmine summit
#

as if it were not concurrent

crimson vapor
#

oh nvh

carmine summit
#

9 seconds

crimson vapor
#

thats hardcoded

solemn latch
#

0.0.0.0 is hard-coded too

quartz kindle
#

@latent ocean did you configure the webhook in top.gg edit page?

latent ocean
crimson vapor
#

no that won't change anything since I didn't realize you had it hardcoded

latent ocean
crimson vapor
#

and that is the public ip of your vps?

#

and the vps also has the port open

latent ocean
#

@crimson vapor its my vps

crimson vapor
#

ok

#

thats as far as I know how to help

latent ocean
#

:/

quartz kindle
#

@carmine summit do axios(...).then(r => {console.log(i); return r})

#

Where i is the number the for loop is increasing

#

You should see the differencr in how they load in the logs

delicate shore
solemn latch
#

Is the port 2727 allowed through your firewall @latent ocean

earnest phoenix
#

Is there someone in charge

delicate shore
#

What is the error pls tell

#

How can I fix it

faint prism
#

Is there someone in charge
@earnest phoenix what

crimson vapor
#

yes and no

latent ocean
#

IDK

crimson vapor
#

@delicate shore what version of d.js are you on?

delicate shore
#

12

crimson vapor
#

ok

#

nah thats all I know on that issue

solemn latch
#

Error is the error isn't found?

#

Lmao

quartz kindle
#

12 dot what?

latent ocean
#

@solemn latch NO ERROR

solemn latch
#

I was talking about pgamers error

#

Did you let 2727 through your vps's firewall @latent ocean

delicate shore
#

12 dot what?
@quartz kindle
Idk I can't login to my vps
But I remember installing discord.js yesterday as I shifted my bot on new vps

crimson vapor
#

just eval it

quartz kindle
#

What command caused the error? Jail?

lethal grail
#

my intel xeon is ultrafast

drifting leaf
#

Im Bots Server Add Dm Please ?

quartz kindle
#

Wat

crimson vapor
#

lol

boreal iron
#

lmao... I'm tree - water me please

umbral zealot
#

He's a bots server? omg it's the singularity the bots are finally awake!

#

Quick, call John Connor!

quartz kindle
#

Call john cena

crimson vapor
#

I don't get the joke

delicate shore
#

What command caused the error? Jail?
@quartz kindle
Every command

crimson vapor
#

pls explain

boreal iron
#

vine memes incoming

delicate shore
#

None of the command except help is working

umbral zealot
#

@crimson vapor go watch Terminator.

crimson vapor
#

oh

#

nah maybe in a few years

quartz kindle
#

@delicate shore do all commands send an embed? Do all embeds set an image or author avatar?

crimson vapor
#

oh that makes sense

delicate shore
#

Almost

#

Oh wait

latent ocean
#

its open

delicate shore
#

Ban command which is without embed is working

#

All commands without embed and images are working

crimson vapor
delicate shore
#

Huh

quartz kindle
#

Your embeds are trying to set an invalid image

delicate shore
#

Wait what

latent ocean
#

@solemn latch its open

quartz kindle
#

No cdn.discordapp wont go away

delicate shore
#

It was working today morning

#

Suddenly how ?

#

Did they change something in intents

#

Like getting user of

#

Pfp*

#

Is it an privileged intent now ?

crimson vapor
#

nah pfp should be static unless you are fetching a user

quartz kindle
#

No, but if youre trying to get a user from the cache it might not be cached anymore

delicate shore
#

I don't get it

quartz kindle
#

Show your embed code

delicate shore
#

I can't login

#

Oh wait

crimson vapor
#

is it on github?

delicate shore
#

I have it in local

#

Lemme get it

#

is it on github?
@crimson vapor
No Windows vps

crimson vapor
#

ok

solemn latch
#

Windows vps ah

carmine summit
#

@boreal iron So what happens is, If it has the same price, It turns into an array,

solemn latch
#

Spooky stuff

carmine summit
#

[[[][][]][][]]

crimson vapor
#

is windows server more efficient in ram than windows 10?

carmine summit
#

but what i am expecting is

#

[[][][][][][]]

crimson vapor
#

because I could not imagine running a vps on windows

solemn latch
#

Most sites restrict windows vps's to 4GB+ just for windows

#

Crazy ram usage still afaik

delicate shore
#
let member = msg.mentions.members.first() || msg.member,
      user = member.user;
    let avatar = user.displayAvatarURL({ dynamic: false, format: "png" });
    let image = await canvacord.Canvas.jail(avatar);
    let attachment = new Discord.MessageAttachment(image, "jail.png");
    return msg.channel.send(attachment);```
#

my code

#

for jail command

boreal iron
#

Gimme a second, Cwickks

quartz kindle
#

@delicate shore console.log avatar

delicate shore
#

my bot went off

carmine summit
delicate shore
#

I am shifting back to Galaxy Gate

#

I don't like this company

solemn latch
#

Lel

carmine summit
#

console avatar

#

console image also

crimson vapor
#

oh

#

canvacord

delicate shore
#

ye

restive furnace
#

no pls no

#

learn canvas instead

delicate shore
#

No pls canvacord is easy

restive furnace
#

so is canvas

solemn latch
#

Isnt canvacord based on canvas anyway?

crimson vapor
#

yes

#

its just a wrapper with functions iirc

restive furnace
#

yeah, but still

crimson vapor
#

imo its better to create your own functions

#

unless they need to be heavily optimized

solemn latch
#

Sure just make a discord bot without a wrapper

restive furnace
#

Sure just make a discord bot without a wrapper
@solemn latch easy ngl

solemn latch
#

But mostly no one does it

restive furnace
#

yeah

#

but more people use canvas than canvacord though

crimson vapor
#

I was trying to get a canvas function to rotate an image pi/2 radians and I could not figure it out

#

tbh

#

so I see why people don't like canvas

boreal iron
#

@carmine summit

let array = [{seller: "Guy A",price: 4},{seller: "Guy B",price: 10},{seller: "Guy C",price: 3},{seller: "Guy D",price: 10}];

array.sort(function(a, b) { return ((a.price == b.price) ? 0 : ((a.price < b.price) ? -1 : 1)); });```
It doesn't add priceses `10` to an array
Result is 
```js
[ { seller: 'Guy C', price: 3 },
  { seller: 'Guy A', price: 4 },
  { seller: 'Guy B', price: 10 },
  { seller: 'Guy D', price: 10 } ]```
indigo flax
#

why isnt this working

pale vessel
#

my goodness you're still on about this

crimson vapor
#

what is it logging?

#

oh shit

carmine summit
#

missing )

pale vessel
#

))

solemn latch
#

Your missing a )

crimson vapor
#

)

#

yep

indigo flax
#

oh

solemn latch
#

Lmao

pale vessel
crimson vapor
#

did vsc not get mad at you for that?

solemn latch
#

Okay too many cooks, ima actually do work

crimson vapor
#

I forget a semicolon and vsc kills me

boreal iron
#

@carmine summit It sort the array array

#

not more, not less, ASC or DESC as u like to

carmine summit
#

Im confused on what changes you have made

boreal iron
#

no change

wise umbra
#

i've been trying to get the ping for the mongodb, but i can't really figure out the right way. i tried this but it would only return it's status

mongoose.connection.db.admin().ping

would return { ok: 1}. Is there something that i'm missing? ThinKenobi

boreal iron
#

just copied my message I sent u 10 mins ago

crimson vapor
#

you are using mongoose?

wise umbra
#

yes

carmine summit
#

those two arrays

#

have the same price value

boreal iron
#

yeah and the first one found in your original array, will be on top of the sorted array

#

like in my example, both have a price of 10, will be at the end of the array (DESC)

#

u probably didn't send the correct array/obj pattern to me, hmm?

wise umbra
#

i've been trying to get the ping for the mongodb, but i can't really figure out the right way. i tried this but it would only return it's status

mongoose.connection.db.admin().ping

would return { ok: 1}. Is there something that i'm missing? ThinKenobi
Any help would be appreciated. thanks yupfrog

carmine summit
#

Hmmm

crimson vapor
#

its likely that all it shows is the status

#

I could not find the docs on admin().ping

quartz kindle
#

I dont think there is a built in way to get ping, but you can easily measure it yourself

crimson vapor
#

most people just measure the time it takes to do a findOne() iirc

carmine summit
#

Yes define somthing as Date.now() then ping the service with an await then subtract

wise umbra
#

Ah got it. will try ty

crimson vapor
#

iirc you need to use microseconds because ms is too big

#

but it really depends on how you have your db setup

carmine summit
#

Microseconds....

boreal iron
#

@carmine summit Send me an example of the array ure using for real instead of a placeholder and tell me what's wrong again

faint prism
#

Lmao

crimson vapor
#

Lmao
about what?

faint prism
#

Microseconds is a bit smaller than a milisecond

crimson vapor
#

yes

faint prism
#

Latency is typically measures in miliseconds

#

Almost universally

#

But it's whatever

crimson vapor
#

yeah but date.now only does 1ms so if your db takes 1.5 ms it will either round up to 2 or down to 1, which isnt really representing much

#

that would be like 1.5 seconds might be 1 sec might be 2 sec

#

but ik what you mean

late scaffold
#

How do I say which servers is the bot in? All the servers it's in!

crimson vapor
#

what do you mean ^

faint prism
#

Use floating numbers to represent then

late scaffold
#

To say which servers it is in

crimson vapor
#

well what language, lib, and intents

late scaffold
#

I speak Romanian but I use translation on google

faint prism
#

Programming language

#

Programming library

earnest phoenix
#

How would I check if a user (fetched from a specific ID) shares a server with my bot without using the user cache?
(discord.js, no intents)

boreal iron
#

yeah but date.now only does 1ms so if your db takes 1.5 ms it will either round up to 2 or down to 1, which isnt really representing much
Assuming he tried to say, use performance.now() instead of date.now()

crimson vapor
#

tbh probably don't need intents

#

umm

latent ocean
#

ahhhh

crimson vapor
#

password wrong

#

probably

faint prism
#

token

crimson vapor
#

for dbl?

#

oh right

#

yes

faint prism
#

perhaps. I'm not keeping up with the convo

crimson vapor
#

no I was backwards

faint prism
#

401 usually means the Authentication header is incorrect

crimson vapor
#

yeah and I was backwards thinking that was the password in dbl settings that was wrong

#

but that would make no sense

latent ocean
late scaffold
#

How do I see how many members the server has? $?????

latent ocean
#

not work on click test

earnest phoenix
#

@late scaffold you're not specifying what library you're using

crimson vapor
#

someone answer his question in d.py pls

faint prism
#

How do I see how many members the server has? $?????
@late scaffold privileged intents

crimson vapor
#

wait what

#

since when

faint prism
#

since this month

crimson vapor
#

thats dumb

faint prism
#

broke a lotta bots

late scaffold
#

I'm use discord. Bot list

crimson vapor
#

I too have my bot on dbl

#

ok ima assume you use d.js

late scaffold
#

I have bot on dbl

crimson vapor
#

iirc its message.guild.memberCount

late scaffold
#

I'm use dbl

#

Not djs

faint prism
#

Google Translate is weak with this one

earnest phoenix
#

yeah lol

crimson vapor
#

anyone know how to make a discord bot on scratch?

tired nimbus
#

uh

faint prism
#

huehue

crimson vapor
#

please

#

I want to know

boreal iron
#

simply use a JS websocket

#

simply manage ur actions based on the response (OP Codes)

#

that's it already

pale vessel
#

simply 5head

boreal iron
#

well it's easy but of course a few lines more code than just including a library

#

could show u an example

pale vessel
#

could show u an example
@boreal iron made one already trollpixel

#

it's not hard at all, yes

#

just cba to maintain it

boreal iron
#

just cba to maintain it

Errr... no? Nothing u need to edit due a lib update or anything related

pale vessel
#

no thanks

crimson vapor
#

imagine

pale vessel
#

good for you, you do you

crimson vapor
#

using a scratch user to host your discord bot

pale vessel
#

"oh, i do this, you should too, it's not hard at all"

boreal iron
#

huh

#

I'm just anwsering the question

#

anyone know how to make a discord bot on scratch?

crimson vapor
#

does anyone have a project that already has the code written?

boreal iron
#

idc what ever u do or how, just saying, yes it's possible and very easy and easy to maintain, instead of a lib

#

does anyone have a project that already has the code written?

Can show an example if u like to

crimson vapor
#

which ide is that?

pale vessel
#

dude

faint prism
#

spooky highlighting

pale vessel
#

scratch

#

wait

boreal iron
#

The Discord docs will explain how to deal with OPcodes and the responses at all

pale vessel
#

i thought million meant that "scratch "

crimson vapor
#

no I did

pale vessel
#

oh lmao

crimson vapor
#

I mean

pale vessel
#

yeah he's focused on what he did

#

i get what you mean

boreal iron
#

lel still notepad++

crimson vapor
#

oof

#

never used it

pale vessel
#

it's good

crimson vapor
#

always used vsc

boreal iron
#

aye it's just pure hardcore

pale vessel
boreal iron
#

not much difference then coding with the Windows editor but works well

pale vessel
#

i use the portable one

boreal iron
#

i thought million meant that "scratch "

May I missunderstood him, thought he meant building a bot from scratch (without a lib)

crimson vapor
#

oh

#

nah I meant scratch the site LOL

#

I see the misunderstanding

#

its fine

boreal iron
#

it's not that bad

Aye it's good enough, comes will a hella lot of settings, but the default mode is just... eww like the Windows editor, purly nothing

pale vessel
#

i'm used to it

#

i never used vsc for coding

#

i literally only used npp

#

some people were mad at me for that

#

but eh

#

¯_(ツ)_/¯

#

and npp's verbose backup is cool

boreal iron
#

aye, made fun me, too, but I wanna say it's for experienced coders, just like hardcore :P

pale vessel
#

i'm used to using command line

boreal iron
#

and npp's verbose backup is cool

aye

crystal wigeon
#

hey

#

guys

pale vessel
#

idk why people care about what editor others use

crystal wigeon
#

does anyone know

#

how do i get the event for when a reaction is added to a bot message? message.awaitReactions wont work and if i wanna use the "messageReactionAdd" event how do i get it work only for that particular message with a timeout?

#

?

#

i wanna trigger an event when user reacts to my bot replies

pale vessel
#

message.awaitReactions wont work
why not

boreal iron
#

idk why people care about what editor others use

hmm I'm with u

crystal wigeon
#

but for some reason its not triggering the events

#

message.awaitReactions wont work on a bot message

pale vessel
#

hmm?

#

get the sent message

#

await the .send() method or use .then()

crystal wigeon
#

yeah

#

hang on

#
const filter = (reaction, user) => {
  console.log(user.bot)
  return ['👍', '👎'].includes(reaction.emoji.name) && (!user.bot);
};
message.channel.send("hello").then(message => {
  message.react('👍').then(r => {
    message.react('👎');
  });
})```
#

so this part

#

sends the message and adds the reaction

#

this is my "bot sent message"

#

now when i react to this

#

its not getting triggered on message.waitReactions

#

with await

pale vessel
#

can you show your awaitReactions code?

#

there's only message.react() in that code

crystal wigeon
#
  .then(collected => {
      const reaction = collected.first();
    console.log("INSIDE REACTION")
      if (reaction.emoji.name === '👍') {
          message.reply('you reacted with a thumbs up.');
      }
      else {
          message.reply('you reacted with a thumbs down.');
      }
  })
  .catch(collected => {
      console.log(`After a minute, only ${collected.size} out of 4 reacted.`);
      message.reply('you didn\'t react with neither a thumbs up, nor a thumbs down.');
  });```
#

this never triggers if i react on a bot sent message

pale vessel
#

also, you should change message to something else

#

maybe sentMessage

#

since it will only confuse you with the original message

crystal wigeon
#

yeah you can ignore the first part. all i need is the second part where i get the reactions on a bot message

#

sent message?

earnest phoenix
#

how i do status to bot?

crystal wigeon
#

can we like get on a voice channel or something?

pale vessel
#

yeah?

crystal wigeon
#
    activity: {
      name: `s`,
    },
  });``` @earnest phoenix you can do something like this
#

sure

#

im joining the general

#

vc

earnest phoenix
#

thank you

pale vessel
#

oh, nah i can't do vcs

crystal wigeon
#

flaze

#

i mean

#

lemme explain

#

my problem

#

tho

#

hear me?

pale vessel
#

you should simplify your code first

crystal wigeon
#

yeah i know

pale vessel
#

there's a lot of unnecessary code that you can clean up

crystal wigeon
#

but for now im trying to get it work

#

yep

#

all i want it to do for now is when i react to a bot message

#

it needs to trigger

#

the event

pale vessel
#

so basically INSIDE REACTION never goes inside the console?

crystal wigeon
#

yeah

earnest phoenix
boreal iron
#

because client is never defined

crystal wigeon
#

@earnest phoenix you need to first const client = Discord.Client()

earnest phoenix
#

ok

pale vessel
#

can you show the whole code?

boreal iron
#

and the example doesn't work anyways

crimson vapor
#

new

crystal wigeon
#

@pale vessel that would be easier if i shared my screen and showed you

earnest phoenix
crimson vapor
#

client = new Discord.Client() iirc

pale vessel
#

right

crystal wigeon
#

the message events are triggered properly

pale vessel
#

non bot devs can't stream

faint prism
#

Didn't we agree glitch was a bad place to host bots?

crystal wigeon
#

ik

#

just watch my stream

crimson vapor
#

can't tell you since I use object desctuctoring

faint prism
#

You aren't streaming?

hollow sedge
#

I might be wrong but are you supposed to include the await before message.awaitReactions

crystal wigeon
#

in general vc

#

tahts right here

#

im waiting

#

haha

hollow sedge
#

@crystal wigeon

faint prism
tired panther
#

how to change the name of voice channel?

pale vessel
#

lmao yeah

#

i told you

crystal wigeon
#

haha

earnest phoenix
#

client = new Discord.Client() iirc
@crimson vapor i need do it?

crystal wigeon
#

can i share my server link here?

pale vessel
#

nope

crystal wigeon
#

okay lemme share some screen shots

sick fable
#

Can we make group variables like I make on type of group and it has all the values of which I type in it?

#

Python

pale vessel
#

what are you trying to do

earnest phoenix
#

ok

sick fable
#

I am basically making a fitness bot rn

earnest phoenix
crystal wigeon
crimson vapor
#

im not sure

earnest phoenix
#

im not sure
@crimson vapor ok

hollow sedge
#

@earnest phoenix dude, require discord

crystal wigeon
#

ignore most of the code part for now i'll clean up later

pale vessel
crystal wigeon
#

but basically, when i react to the "thumbs up" on the bot

#

it doesnt trigger anything

earnest phoenix
#

@earnest phoenix dude, require discord
@hollow sedge oh

crystal wigeon
#

but when i react to a user message

#

thats when

#

it triggers

#

but not when reacted to a bot message

pale vessel
#

that's from the messageReactionAdd event

earnest phoenix
boreal iron
#

That's required if u don't include the status.js in a different location where require discord is defined already

pale vessel
#

you should remove that, it's not what you want

#

you should focus on awaitReactions()

crystal wigeon
#

@pale vessel yeah i forgot to comment that out

#

yep

earnest phoenix
#

That's required if u don't include the status.js in a different location where require discord is defined already
@boreal iron sure?

pale vessel
#

also, you didn't put the message.awaitReactions() inside the .then()

hollow sedge
#

@earnest phoenix why are you putting them on the same line?

pale vessel
#

so it's listening for reactions for the original message

earnest phoenix
#

@hollow sedge no same line?

crystal wigeon
#

Ah

pale vessel
#

which is your message

crystal wigeon
#

yes

hollow sedge
crystal wigeon
#

that makes sense

pale vessel
#

you can remove the await too, you're using .then() (for awaitReactions())

boreal iron
#

@earnest phoenix idk ur code, if u just include the status.js inside an index.js for example and included Discord.js already, no u don't need to include the lib again

earnest phoenix
#

@boreal iron tank you

#

OH MON DIEU!!! LA MAMIE DE PANINI A ETE TROUVEE!!!! BLOQUAGE EN COURT!!!!

#

:x: | Vous devez mentionner un utilisateur

crystal wigeon
#

so what should i do here?

crimson vapor
#

ah yes french?

crystal wigeon
#

do i move the message outside?

boreal iron
#

but running the status.js as standalone file, u will have to require the lib again if u wanna access it, of course

pale vessel
#

nah

#

you put the whole awaitReactions() code inside the send().then(message => { here })

crystal wigeon
#

Ahh

pale vessel
#

again, i recommend changing message to another variable since you'll get confused with the original message

#

it's a good practice

crystal wigeon
#

indeed

#

haha i did pay the price for it

#

right now xD

#

thanks a lot man

earnest phoenix
#

:x: | Vous devez mentionner un utilisateur

crystal wigeon
#

that worked!!

crimson vapor
#

wait

crystal wigeon
#

it worked haha

crimson vapor
#

is that

#

thank

crystal wigeon
#

i had been scratch my head for 6 hours

crimson vapor
#

?

earnest phoenix
#

?

crystal wigeon
#

"why is this shit not working" 😂

crimson vapor
#

❌ | Vous devez mentionner un utilisateur
@earnest phoenix ????

#

selfbot?

earnest phoenix
#

"why is this shit not working" 😂
@crystal wigeon idk!

crystal wigeon
#

@pale vessel thanks a lot mate!

earnest phoenix
#

LOL

crystal wigeon
#

❤️ flaze

boreal iron
#

@earnest phoenix dude, u need to include discord.js >>>>>>>>> B E F O R E <<<<<<<<<< USING IT

pale vessel
#

all good mate

earnest phoenix
#

i want fuck glitch

crimson vapor
#

wait im so confused

#

is that a selfbot?

earnest phoenix
#

@earnest phoenix dude, u need to include discord.js B E F O R E USING IT
@boreal iron ok

crystal wigeon
#

mega hunter watch some tutorials 😂 @earnest phoenix

crimson vapor
#

or just somene pasting an error

kindred river
#

yes or no?

crimson vapor
kindred river
#

Does this look good
@kindred river

pale vessel
#

looks decent

hollow sedge
#

@kindred river yes

earnest phoenix
pale vessel
#

it might look funky once you start adding commands though

kindred river
#

A

#

it might look funky once you start adding commands though
@pale vessel i do have them.

crimson vapor
#

what are you trying to do @earnest phoenix

pale vessel
#

well, sure

#

good enough for now

earnest phoenix
#

now Fake want kill me

hollow sedge
#

they seem to be separating them into different help commands

boreal iron
#

@kindred river I would use fields with the command as title and the description as value

kindred river
#

^

crimson vapor
#

if that is a command why are you creating a new client

#

tf

kindred river
#

oh okay

pale vessel
#

if that is a command why are you creating a new client
@crimson vapor trollpixel

earnest phoenix
#

what are you trying to do @earnest phoenix
@crimson vapor idk \

#

i want status to my bot

crimson vapor
#

is it a command

earnest phoenix
#

and this not work

crimson vapor
#

and what does it do?

hollow sedge
#

@kindred river I would use fields with the command as title and the description as value
@boreal iron you could do that, but keep in mind that there's a limit of 25 fields

earnest phoenix
#

i want do status to my bot

digital ibex
#

if a message has been deleted, is there any way i can get it back?

earnest phoenix
#

who can help me

digital ibex
#

depends on what language and librar you're using

earnest phoenix
#

@crimson vapor you want help me

#

?

boreal iron
#

@hollow sedge aye but looks better especially on mobile

crimson vapor
#

im not sure how you are planning to accomplish what you are doing

hollow sedge
#

@hollow sedge aye but looks better especially on mobile
@boreal iron embeds look trash on android either way

sonic lodge
#

@earnest phoenix perhaps you should learn the basics of javascript first

boreal iron
#

Since the title is BOLD but not on mobile

#

That's ur own fault using android

hollow sedge
#

😦

boreal iron
earnest phoenix
#

@sonic lodge i dont have power

digital ibex
#

any ideas?

sonic lodge
#

you don't need power to learn something

earnest phoenix
#

ok

pale vessel
#

you need DETERMINATION

earnest phoenix
#

who hear Hadar Hashuh?

boreal iron
#

@hollow sedge but however, since there's a larger line-spacing between title -> value and title again, it looks a little better in my opinion

#

doesn't mean ur opinion is the same

earnest phoenix
#

who hear Hadar Hashuah

#

?

hollow sedge
#

@hollow sedge but however, since there's a larger line-spacing between title -> value and title again, it looks a little better in my opinion
@boreal iron yeah, i agree with you

boreal iron
kindred river
pale vessel
#

cool

earnest phoenix
#

</>

boreal iron
#

Use code tags for example on the commands

hollow sedge
#

^

boreal iron
#

+hackban description looks better in my option

kindred river
#

?

hollow sedge
#

definitely

kindred river
#

oh yh

sonic lodge
#

ban someone not on the server?

kindred river
#

Like this

#

?

hollow sedge
#

if you separated them using fields, you wouldnt have to do that

boreal iron
#

Easier to see the difference between cmd and description

hollow sedge
#

you could just put the command name in the title

kindred river
#

ok

sonic lodge
#

we're not gonna talk about how someone has the power to ban someone they don't know

kindred river
#

I just started code

#

My age is 17 so yh

digital ibex
#

anyone have any ideas about my question?

kindred river
#

still learning 😂

sick fable
#

Anyone knows how to group a bunch of variables under a same name?
Language - Python

boreal iron
#

I just started code

@kindred river U can use markdown like in Discord

digital ibex
#

you cant, sloth

kindred river
#

yh

hollow sedge
#

Anyone knows how to group a bunch of variables under a same name?
Language - Python
@sick fable search up lists

boreal iron
#

For embded and messages etc.

digital ibex
#

wut?

sick fable
#

My age is 17 so yh
@kindred river lmao mine is 13.8 yo

#

I am learning coding very late

#

Those teachers taught me html. Still dumb in that shit

digital ibex
#

you cant define two different things with the same name

boreal iron
#

god damn, html is no coding language

#

my eyes hurt

hollow sedge
earnest phoenix
#

async def on_ready():
#starting the loop
status_change.start()
#changing the status of the bot and activity
await client.change_presence(status= discord.Status.online,activity=discord.Game("BEING CODED BY A GOD"))
print ('the bot is online')
(this for status?)

#

?

#

anything?

digital ibex
#

no one said html was a coding language O_O

sonic lodge
#

you're coding in javascript and that's python

digital ibex
#

lol

pale vessel
#

anyone have any ideas about my question?
@digital ibex which?

boreal iron
#

the actual status object needs a type

earnest phoenix
#

ok

pale vessel
#

can't see

sonic lodge
#

my homie pls learn javascript

pale vessel
#

what happened to OOPLED

digital ibex
#

if i can get a message after its been deleted @pale vessel

earnest phoenix
#

@sonic lodge give me video

sonic lodge
#

lol it's a long story

kindred river
#

@kindred river lmao mine is 13.8 yo
@sick fable o

earnest phoenix
#

in eabrw

digital ibex
#

good video trust me

boreal iron
earnest phoenix
#

you liar

digital ibex
#

?

earnest phoenix
#

it song

#

LOL

digital ibex
#

its a javascript beginner crash course

earnest phoenix
#

i want seminar

#

its a javascript beginner crash course
@digital ibex no it no

pale vessel
#

if i can get a message after its been deleted @pale vessel
@digital ibex probably not

digital ibex
#

oof oka

#

ty

pale vessel
#

you can only catch it being deleted, which i don't think is what you want

earnest phoenix
#

@digital ibex i right?

#

?

#

lol

sharp thicket
#

hello

#

INTERACTIONS ENDPOINT URL
You can optionally configure an interactions endpoint to receive interactions via HTTP POSTs rather than over Gateway with a bot user.

#

what does this mean?

pale vessel
#

members can directly trigger your endpoint without going through discord's gateway

#

i guess

sharp thicket
#

What endpoint tho?

#

like

boreal iron
#

An endpoint u can define

pale vessel
#

your api endpoint, just anything

sharp thicket
pale vessel
#

nah

sharp thicket
#

oh

#

where does that show up?

boreal iron
#

Like an endpoint u can set up for the DBL webhook

pale vessel
#

where does that show up?
@sharp thicket through a POST request

sharp thicket
#

oh

#

wait im stupid

#

ok thx

boreal iron
#

when ever ur endpoint been requested, check if( isset( $_POST['what_ever_the_field_is'] ) ) ...

#

sry PHP flashback

earnest phoenix
#

how i do status to bot?

harsh reef
#

Hey when will top.gg indexing issue be fixed?

pale vessel
boreal iron
#

how i do status to bot?
Your question got answered already

tepid gate
#

What would be the best way to get ranks from a database and sort them into a leaderboard embed?

boreal iron
#

u mean a connector like mariadb (for example)?

tepid gate
#

I'm using sequelize

dreamy thistle
#

how to make a non caps sensitive string in javascript?

boreal iron
#

string.toLowerCase() == "lower string"

wheat mesa
#
  if(command == 'shutdown') {            //shutdown
    if(!message.member.hasPermission('ADMINISTRATOR')) {return message.reply('This command can only be used by admins!')}
    else {
      console.log(`Shutdown initiated by ${PersonWritingCommand.tag}. Terminating bot.`)
      message.channel.send(`Shutdown initiated by <@${PersonWritingCommand.id}>. Terminating in 5 seconds...`)
      const serverGuild = message.member.guild
      const CHANNEL = serverGuild.channels.cache.find(x => x.name === "log") 
      if(!CHANNEL) {return}
      const shutdownEmbed = new Discord.MessageEmbed()
      .setColor('1AE5C3')
      .setAuthor(`${PersonWritingCommand.tag}`, PersonWritingCommand.displayAvatarURL())
      .setThumbnail(PersonWritingCommand.displayAvatarURL())
      .setTitle('A Shutdown was Initiated!')
      .setDescription(`A Shutdown was Initiated by <@${PersonWritingCommand.id}> in ${message.channel}!`)
      .setField('')
     await CHANNEL.send({embed:shutdownEmbed})
      setTimeout(() => {
      client.destroy()}, 5000)
      }
    }
``` this is probably inefficient but it works for my purposes so whatever. I'm having a problem all of a sudden (I didn't change any of the code in this section) where it says (node:2712) UnhandledPromiseRejectionWarning: TypeError: (intermediate value).setColor(...).setAuthor(...).setThumbnail(...).setTitle(...).setDescription(...).setField is not a function

EDIT: Found the issue, had a blank field in .setField(' ')
duh
dreamy thistle
#

how to make a non caps sensitive string in javascript?
@dreamy thistle

refeared to for example use !HELP !hElP !hElp

boreal iron
#

string.toLowerCase() == "!help"

quoting myself

dreamy thistle
#

thank you

dapper dagger
#

Anyone know how to make a bot page backround just 1 color?

boreal iron
#

talking about the description?

dapper dagger
#

The entire page

boreal iron
#

huh... nah u can style the description only afaik

dapper dagger
#

Then how do people-

pale vessel
#

you can style the whole page

weak parrot
#

You can style the whole page

boreal iron
#

huh

dapper dagger
#

Yeah I am just tryna figure that out lol

#

I don't really know css

pale vessel
#

ctrl shift c and find the selectors that you need

boreal iron
#

u should have told me that earlier

weak parrot
#

You're just not allowed to remove: ads, navigation elements, and important buttons/info (like the report button)

pale vessel
#

you need basic html and css knowledge though

willow mirage
#

what is importain RAM/CORE ?
for bot vps

pale vessel
#

both

crimson vapor
#

depends on how optimized your code is

dapper dagger
#

Yeah I just want to change the colors

willow mirage
#

so for example 2ram 2 core is good ?

crimson vapor
#

and what language you use

willow mirage
#

or 1 ram 4 core

pale vessel
#

2gb?

willow mirage
#

ye

crimson vapor
#

for just a discord bot yes

pale vessel
#

1gb is enough if you have a small bot

willow mirage
#

but it will grow up

crimson vapor
#

well bots only need about 500mb max

#

but os takes some

willow mirage
#

@pale vessel when should i move to 2gb

#

how many servers

crimson vapor
#

unless your bot uses more than 1 shard

willow mirage
#

so ram is not importain for new bots ?

crimson vapor
#

well it depends on your code but for mine, no

willow mirage
#

one time made 3ms for bot messages

#

that is fucking op

#

maybe i got screenshot

boreal iron
#

You can style the whole page

lol u really can, thanks for the tip

#

why didn't I discover that earlier lel

#

@pale vessel that's ur fault u didn't tell me that! shame on u

pale vessel
#

sorry my man

boreal iron
#

@weak parrot #details div.longdescription can't be changed, hmm? the theme overwrites my value

#

speaking about a background-color

slender thistle
#

!important

boreal iron
#

lmao ik

#

the theme overwrites my value

#

@slender thistle Test it yourself #details div.longdescription { background-color: #ffff00 !important; }

slender thistle
#

Man can I enjoy my Arma 3 time

#

Sec

boreal iron
#

Man can I enjoy my Arma 3 time
haha lol... King of the Hill?

slender thistle
#

@boreal iron try to edit .longdescription .content

#

And nah I'm more into milsim

#

KOTH can go kiss my fifth place atm. Maybe someday

boreal iron
#

try to edit .longdescription .content

nope, still being overwritten by the theme

#

tried any element already

slender thistle
#

Well that's fun

#

I'm having no issues using that

boreal iron
#

hmm probably a browser issue

#

gonna clear the cache and test again later

#

aye... working now, my bad I forgot to clean the cache

safe burrow
#

@slender thistle sorry 4 ping but is arma good? i have 2 on steam but never played it

slender thistle
#

#general

safe burrow
#

i didn't see mb

boreal iron
#

Well since I'm not using a library I'm gonna replace the Others a element with No library

#

Hopefully that should break any rules...

tired panther
#

how to fetch the status of a user?

restive furnace
#

@tired panther intents

#

since you don't need to fetch it

tired panther
#

of a single user , I mean if online or offline

restive furnace
#

yeah

#

u need intents

tired panther
#

the user is a bot xD

restive furnace
#

then client.user.presence.activities[0].status iirc (i assume u on js since u didnt say which)

#

djs speficically

tired panther
#

djs yes

#

then client.user.presence.activities[0].status iirc (i assume u on js since u didnt say which)
@restive furnace I mean , my beta bot will fetch the status if online or offline for the alpha bot and then will send a message if the alpha bot is offline

sudden geyser
#

[Visual Studio Code] In vscode/, I have my launch.json script. Running my app works as expected, but re-running my app keeps the output from the last session in the integrated terminal. How could I clear the terminal beforehand?

restive furnace
#

cls

#

cls

tired panther
#

@restive furnace any idea? or do u need for that process intent

restive furnace
#

track presence updates

tepid gate
#
const users = await Users.findAll();

await users.forEach(u => userList.set(u.user_id, { osu_name: u.osu_name, rank: u.std_rank }));

console.log(userList);

message.channel.send(
    userList.sort((a, b) => b.rank - a.rank)
    .first(10)
    .map((user, position) => `${position + 1} ${user.osu_name}: ${user.rank}`)
    .join('\n'),
    { code: true },
);
#

Anyone got an idea why it isn't sorting?

sudden geyser
#

What isn't working about it.

tepid gate
#

It isn't sorting the ranks

sudden geyser
#

It's correctly sorted if those are the only two entries.

#

If you want it ascending, swap b.rank - a.rank for a.rank - b.rank

tepid gate
#

Oh owoGiggle

#

Thanks lite

sudden geyser
#

np

tepid gate
#

Now to turn it into an embed and dress it up lol

drifting wedge
#

how does trening work?

#

my bot had 28 votes

#

and it got added today

tired panther
#
let botself = message.guild.members.fetch('735147814878969968');
botself.presence.status```
#

will this work?

sudden geyser
#

Did you try it?

#

If you try it, you should get an error like Cannot read property X of Y because .fetch(...) returns a promise.

tired panther
#
let botself = client.guilds.cache.get("734707332163829780").members.cache.get('735147814878969968');
botself.presence.status
``` made this ==> giving a error : Cannot read property 'presence' of undefined
#

@sudden geyser

sudden geyser
#

the member wasn't found in the cache

fiery canyon
#

do you need server members intent for .fetch()?

pale vessel
#

members.fetch() fetches all members from the server, so yes

#

you can specify a query which doesn't need the intent

solemn jolt
#

I don't have a file by this name

sudden geyser
#

make sure you're using Node.js v12

solemn jolt
#

@sudden geyser i need to change it in packaje?

tired panther
#

u forgot

sudden geyser
#

no

tired panther
#

}catch (error){

sudden geyser
#

go to package.json and change the Node.js engine browser

#

Meister it's a library's source code.

#

You need Node.js v12 to use Discord.js

tired panther
#

You need Node.js v12 to use Discord.js
@sudden geyser yes

#

}catch (error){
@tired panther had one day ago the same problem , in my bot.js file

solemn jolt
#

I change Nude.js to Nude.js v12

earnest phoenix
#

how can i find the last hello word of 1024 length.

solemn jolt
#
  "name": "Reva",
  "version": "3.0.0",
  "description": "-_-",
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "dependencies": {
    "canvas": "^1.6.10",
    "discord.js": "^12.4.0",
    "ascii-table": "0.0.9",
    "discord.js-musicbot-addon": "^1.10.3",
    "moment-timezone": "^0.5.31",
    "math-expression-evaluator": "^1.2.17",
    "google-translate-api": "^2.3.0",
    "discord-anti-spam": "^1.1.2",
    "express": "^4.16.3",
    "simple-youtube-api": "^5.2.1",
    "finalhandler": "^1.1.1",
    "fortnite": "^3.0.0",
    "ytdl-core": "^0.20.2",
    "fs": "^0.0.2",
    "get-youtube-id": "^1.0.0",
    "superagent": "^3.8.3",
    "jimp": "^0.2.28",
    "moment": "^2.22.1",
    "ms": "^2.1.1",
    "node-opus": "^0.2.7",
    "opusscript": "0.0.6",
    "python": "0.0.4",
    "request": "^2.85.0",
    "great": "^0.0.4",
    "router": "^1.3.2",
    "snekfetch": "^3.6.4",
    "sqlite": "^2.9.1",
    "youtube-info": "^1.2.0",
    "js-beautify": "^1.13.0",
    "node-cmd": "^3.0.0",
    "util": "^0.12.3",
    "common-tags": "^1.8.0",
    "mongoose": "^5.9.25"
  },
  "engines": {
    "node": "8.x"
  }
}```@tired panther
#

I use this package

tired panther
#

xD

solemn jolt
#

@tired panther what i need to change ?

tired panther
#

show me client.js

hollow sedge
#

How is Python a dependency

solemn jolt
#

@tired panther i don't have a file by client.js

tired panther
solemn jolt
#

@tired panther yup

tired panther
#

engines": {
"node": "8.x"
}
} ur node version is to old

#

it must be higher then 10

#

@solemn jolt

solemn jolt
#

@tired panther i need change to 11?

tired panther
#

yes

#

npm install node js @solemn jolt

solemn jolt
#

@tired panther ok

#

@tired panther working thank you👍

boreal iron
#

how can i find the last hello word of 1024 length.
@earnest phoenix

var string = "what the fuck am I doing here, hello?";
var idx = string.lastIndexOf("hello"); ```
Will return the posititon `hello` starts
tired panther
#

@solemn jolt no problem

earnest phoenix
#

I didn't mean it.

#

@boreal iron

var string = "ahah xjxjx qlkl d hello kasdksk";
#

like

#

not the last word in the paragraph.

boreal iron
#

wut?

tired panther
#
var string = "what the fuck am I doing here, hello?";
var idx = string.lastIndexOf("hello"); ```
Will return the posititon `hello` starts

@boreal iron U could use regex

#

or split it

pale vessel
#

you want the last hello within 1024 length?