#development

1 messages Β· Page 1003 of 1

pure lion
#

:node_exhale:

restive pebble
#

uh

#

oh oh

#

wait

pure lion
#

oh dear

restive pebble
#

u have to again call it

pure lion
#

where?

restive pebble
#

after setting

#

wait

pure lion
#

buT WhEEEEEEEEEeeeeeeeeeeEEEEEEEEEEre

spare mirage
#

do u need apis for a musci bot?

pure lion
#

im pretty sure i do tho

#

do u need apis for a musci bot?
@spare mirage YES YOU DO DONT MAKE MY MISTAKE

restive pebble
#
        const queueContruct = {
          textChannel: msg.channel,
          voiceChannel: voiceChannel,
          connection: null,
          songs: [],
          volume: 5,
          playing: true
        }
        queue.set(msg.guild.id, queueContruct)
let anything = queue.get(id)
anything.songs.push(song)
#

u are running in same code

spare mirage
#

okok

pure lion
#

so just those 2 lines?

restive pebble
#

yes

pure lion
#

okkkk ty

#

oh btw this was in too

#
        queueContruct.songs.push(song)
restive pebble
#

change it to anything.songs.push

pure lion
#

ok

livid rivet
#

uh

#

is there a workaround for too long lyrics? because I stumbled upon that quite a few times

restive pebble
#

embeds?

livid rivet
#

yeah but the songs are still too long sometimes

restive pebble
#

2048 limit

livid rivet
#

I tried it with quite some songs

restive pebble
#

u can slice

livid rivet
#

yeah FeelsBadMan

#

hmm maybe Thonk

pure lion
#
TypeError: anything.songs.push(...) is not a function
#

balls

#

baked in a cake

#

then fried

restive pebble
#

if(lyrics.length <2048)lyrics.slice(0,2047)

pure lion
#

twice

restive pebble
#

send the code again

livid rivet
#

I see

pure lion
#

@restive pebble

restive pebble
#

ill take a look

pure lion
#

its play, pause and stop

#

and the function shit

earnest phoenix
#

@restive pebble One last question, I have a help command, but, It is not hidden and It is not in my files, So how can I edit it?

restive pebble
#

oh my god

earnest phoenix
#

I can use the help command.

restive pebble
#

so easy

earnest phoenix
#

but

pure lion
#

what your god

earnest phoenix
#

Can't see the file

restive pebble
#

anything.queueConstruct.songs.push

#

try it

pure lion
#

w h e r e

earnest phoenix
#

O_o

restive pebble
#

anything.songs.push

#

replace that

#

anything.queueConstruct.songs.push

earnest phoenix
#

OO_OO

restive pebble
#

@restive pebble One last question, I have a help command, but, It is not hidden and It is not in my files, So how can I edit it?
@earnest phoenix its hidden

#

?

earnest phoenix
#

It's not.

restive pebble
#

u cant see it?

earnest phoenix
#

Nope.

restive pebble
#

so

#

?

earnest phoenix
#

Idk

#

lol

#

It's gone

#

.but

#

people can use the command

restive pebble
#

thats glitch issue

#

they are fucked up every moment

#

u have to wait until they fix the issue

earnest phoenix
#

Bruhhh

#

Fk glitch

restive pebble
#

yes

#

u can download the file

earnest phoenix
#

Then will it show?

restive pebble
#

yes

earnest phoenix
#

Ight

#

Ty

pure lion
#

@restive pebble

TypeError: Cannot read property 'songs' of undefined
    at C:\Users\james\Desktop\qBot\index.js:948:32
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:8816) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'dispatcher' of null
restive pebble
#

did u fix the spelling?

pure lion
#

maybe

#

did u fix the spelling?
@restive pebble everything is spelled correctly :/

#

hm

#

h m

#

h m

#

h m

#

imlooking

#

are you sure everything is defined/assigned properly?

#

im not the best person to ask about this, not sure how it works

warm marsh
#

Maybe if it were spelt correctly?

#

permissionOverwrites

delicate shore
#

Pls anoyne help :(

#
if(command === "purge") {

const deleteCount = Number(args[0]);

if(!msg.member.hasPermission("MANAGE_MESSAGES"))
return msg.channel.send("No");

if(!deleteCount || deleteCount < 2   || deleteCount > 100)
return msg.reply("Please provide a number between 2 and 100 for the number of messages to delete");


msg.channel.bulkDelete(deleteCount)
.catch(error => msg.reply("Couldn't delete messages because of: ${error}"));
};```
#

What is incorrect here

#

I am fucking tired

restive pebble
#

Uh wait

warm marsh
#

Spell it correctly

delicate shore
#

Spell it correctly
@warm marsh ?

warm marsh
#

@delicate shore what's args defined as

toxic forum
#

Morning everyone

delicate shore
#

Which one ?

warm marsh
#

In your code.

delicate shore
#

Args isn't defined

warm marsh
#

the variable "args"

delicate shore
#

Args is argument

warm marsh
#

I know what it's supposed to be.

#

I'm asking where you defined it and what it's equal to.

toxic forum
#

Where is args coming from?

restive pebble
#

Oh wait big mistake @pure lion

#

Sorry

delicate shore
#

Oh

#

Wait

restive pebble
#

remove those 2 lines

delicate shore
#

One min

pure lion
#

remove those 2 lines
@restive pebble mkay

restive pebble
#

Now send ur code

#

Brain.exe has stopped working

#

Now it's functional

pure lion
delicate shore
#

Args is defined ^

pure lion
#

πŸ‘οΈ

delicate shore
restive pebble
#
queueContruct.songs.push(song)```
pure lion
#

:O

restive pebble
#

Do this

#

Yes

earnest phoenix
#

Uhm

delicate shore
#

Pls help me also

pure lion
#

replace the original queueConstruct?

earnest phoenix
#

@restive pebble , I am stupid. So it is not a command, It generates it from all the commands in index.json

client.registry
  .registerDefaultTypes()
  .registerGroups([
    ['music', 'Music Command Group'],
    ['gifs', 'Gif Command Group'],
    ['other', 'random types of commands group'],
    ['guild', 'guild related commands']
  ])
  .registerDefaultGroups()
  .registerDefaultCommands({
    eval: false,
    prefix: false,
    commandState: false
  })```
warm marsh
#

Try console.log args inside the command.

restive pebble
#

No

#

Keep it as it is

pure lion
#

add?

restive pebble
#

Ues

#

Yes

pure lion
#

ok

restive pebble
#

Add the last line

#

Only

pure lion
#

o h

toxic forum
#

It's not a good idea to host your bot on glitch if I recall correctly. Itll not be garuanteed to run 24/7

restive pebble
#

@restive pebble , I am stupid. So it is not a command, It generates it from all the commands in index.json

client.registry
  .registerDefaultTypes()
  .registerGroups([
    ['music', 'Music Command Group'],
    ['gifs', 'Gif Command Group'],
    ['other', 'random types of commands group'],
    ['guild', 'guild related commands']
  ])
  .registerDefaultGroups()
  .registerDefaultCommands({
    eval: false,
    prefix: false,
    commandState: false
  })```

@earnest phoenix oh

#

Args is defined ^
@delicate shore what is ur problem

#

Send msg link if I missed

delicate shore
restive pebble
#

Args?

pure lion
#

TypeError: queueContruct.songs.push(...) is not a function

#

TypeError: queueContruct.songs.push(...) is not a function

restive pebble
#

Oh fuck

pure lion
#

sjsjsjsjsjsjsjsjsj

earnest phoenix
#

@restive pebble Yeah, Just my small brain.

warm marsh
#

PGamer did you try console.log(args) inside the command?

pure lion
#

i just wanted to change the search method smH

delicate shore
#

PGamer did you try console.log(args) inside the command?
@warm marsh no?

warm marsh
#

Try that see what args is equal to.

delicate shore
#

How ?

#

At end ?

warm marsh
#

Nah

delicate shore
#

console.log(args);

restive pebble
#

const messageArray = message.content.split(' ')
let args = messageArray.splice(1)

warm marsh
#

Yeah

plucky harness
warm marsh
#

Yikes

restive pebble
#

Yes

pure lion
#

\😒

plucky harness
#

thnx

restive pebble
#

Β―\_(ツ)_/Β―

warm marsh
#
const args = message.content.substr(message.content.indexOf(prefix) + prefix.length).trim().split(/\s+/);
delicate shore
#

?

warm marsh
#

@plucky harness any VPS provider with subpar specs will be fine.

quartz kindle
#

why are you doing that lol

plucky harness
#

i see

pure lion
#

aaaaaaaaaaaaaa

warm marsh
#

Python is the primary reason it's like that.

pure lion
#

TypeError: queueContruct.songs.push(...) is not a function

restive pebble
#

Dice

pure lion
#

pspspsppssp

#

yes?

restive pebble
#

U did what I said

#

Send link

#

To hastebin

warm marsh
#

But PGamer console.log args above deleteCount

pure lion
#

ok

restive pebble
#

It's 1000000000000% correct

pure lion
#

why doesnt it work then-

bold dock
#

Because it's incorrect.

pure lion
#

a?

bold dock
#

You're creating the variable queueContruct in the if-statement, so it's not available in the else-statement

#

a?

pure lion
#

aaaaaaaaaaa

restive pebble
#

Lmao

pure lion
#

o shit you're right

restive pebble
#

U missing bracket

pure lion
#

whaere

restive pebble
#

Oh sorry

#

I didn't slept

#

Yes remove from else

pure lion
#

okie

restive pebble
#

I wonder why didn't I saw ur whole code

#

@pure lion

#

Pls tell the exact line

pure lion
#

ok

#
      (async () => { try {
#

i need to pass in serverQueue through the params?

restive pebble
#

yes

#

Or

pure lion
#

ok

#

or

restive pebble
#

Not needed

pure lion
#

how so?

restive pebble
#

Pls tell line no.

pure lion
#

ok

#

949

restive pebble
#

Ok

pure lion
#

wai

#

t

#

thats in my index brb

restive pebble
#

Wtf

#

Yes

pure lion
#

66

restive pebble
#

Ok

#

Thts a different error

pure lion
#

ye

restive pebble
#

What is the error

pure lion
#

(node:5136) UnhandledPromiseRejectionWarning: TypeError: queueContruct.songs.push(...) is not a function

restive pebble
#

How can that error move to 66

quartz kindle
#

execute order 66

pure lion
#

:o?

restive pebble
#

And also that play is wrong

#

it should be connection.play(song)

pure lion
#

aekdghsfbfsblgaushdg

#

in the play func?

restive pebble
#
connection.play(queueContruct.songs[0]) }```
^^^^^^^^^^^
pure lion
#

alright

#

(node:1348) UnhandledPromiseRejectionWarning: TypeError: queueContruct.songs.push(...) is not a function

#

@restive pebble

#

same line

#

:pain:

restive pebble
#

Idk

golden condor
#

@pure lion it's not an array

#

then

pure lion
#

but it is

earnest phoenix
#

de b u g

pure lion
earnest phoenix
#

log the type

pure lion
#

i ca nt

#

ok

#

brb

earnest phoenix
#

yes you can

pure lion
#

im retumbted

earnest phoenix
#

debugging is a skill you should have regardless, you should always do that first before coming to ask questions here

restive pebble
#

I can send my code

pale vessel
#

no

restive pebble
#

U can look

#

Take a look

#

And try to debug

#

I am sure that line is correct

#

Β―\_(ツ)_/Β―

earnest phoenix
#

you should avoid using the username/nickname in files

restive pebble
earnest phoenix
#

mainly because people are retarded and have retarded ass unicode names

long yew
#

how do i define message?

earnest phoenix
#

you don't

restive pebble
#

Oh my god

long yew
#

lol

restive pebble
earnest phoenix
#

you never create discord entities yourself, you get them from either REST or ws

long yew
#

me?

earnest phoenix
#

yes

restive pebble
#

import {Message} from 'discord.js'

#

Typescript

#

Dice you can take a look at my code

#

It's not full

#

But it has bracket errors

earnest phoenix
#

so can someone help?

restive pebble
#

Yes

earnest phoenix
#

Ok..

tender helm
#

does any one have fanfic rec bot

pure lion
#

ugh im just gonna delete the music functions

#

sdghlsjhdg

restive pebble
#

Uh

#

Derlu

earnest phoenix
#

So how can i fix it?

devout phoenix
#

hello. I'm trying to add a translation command to my bot, does anyone know a free translation API?

restive pebble
#

@earnest phoenix

#

Explain

#

hello. I'm trying to add a translation command to my bot, does anyone know a free translation API?
@devout phoenix

#

Yes

earnest phoenix
#

Wdym?

devout phoenix
#

can I have its name?

spare mirage
#

what do u need to fi

#

x

restive pebble
#

Send the error and cde

pure lion
#

uh

#

u h

earnest phoenix
#

Send the error and cde
@restive pebble i did

restive pebble
#

@devout phoenix can u wait 2 mins

pure lion
#

i think i know whats wrong

devout phoenix
#

sure, I'll be waiting here

#

thanks

restive pebble
#

"@k3rn31p4nic/google-translate-api

pure lion
#

dispatcher is undefined

restive pebble
#

This thing

#

"@k3rn31p4nic/google-translate-api
@restive pebble

devout phoenix
#

well, can I use it in python? xd

pale vessel
#

boeing smh

devout phoenix
#

ugh I doubt I can

pale vessel
pure lion
#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#

@pale vessel can you help me w/ my music features

pale vessel
#

no sorry

pure lion
#

h

golden condor
earnest phoenix
#

??

pure lion
#

no

golden condor
#

youtubeπŸ‘exists

pure lion
#

n o

golden condor
#

we aren't gonna give u code

pure lion
#

i just wanna fix it man

earnest phoenix
#

somone just help please

restive pebble
#

Uh

#

Derku

earnest phoenix
#

yes

restive pebble
#

Send the link to message

earnest phoenix
#

?

restive pebble
#

Where u defined ur problem

earnest phoenix
restive pebble
#

Ok

#

Allow 2 mins

pure lion
#

is there a way i can pass async into something without the consts being inaccessible elsewhere?

earnest phoenix
#

Allow 2 mins
@restive pebble Sure

restive pebble
#

Seems correct

#

It shows none?

earnest phoenix
#

Yeah

pure lion
#

it was working before, but then i changed the search method to that

earnest phoenix
#

de-profile

long yew
pure lion
#

from yt-search to simple-youtube-api

#

@long yew code

earnest phoenix
#

@restive pebble so do you know the answer?

restive pebble
#

Thinking

plucky harness
#

how do i download the updated files from vps to my pc

earnest phoenix
#

Thinking
@restive pebble Ok

plucky harness
#

any simple software for that?

quartz kindle
#

any ftp/sftp software

restive pebble
#

@earnest phoenix above the let fuckoff line

quartz kindle
#

for example filezilla

earnest phoenix
#

@earnest phoenix above the let fuckoff line
@restive pebble lol yeah carry on

restive pebble
#

ctx.fillStyle = 'white'

#

Try

earnest phoenix
#

ok

long yew
#

idk how message isn't defined

pure lion
#

send code

long yew
#

i'll dm u it

pure lion
#

oki

restive pebble
#

Did that thing happened after adding the croptext feature?

#

@earnest phoenix

earnest phoenix
#

?

restive pebble
#

Did that thing happened after adding the croptext feature?
@restive pebble

#

That ...

earnest phoenix
#

croptext like the ... thing

restive pebble
#

Yes

earnest phoenix
#

no

restive pebble
#

Oh

earnest phoenix
#

it only hapend when doing the ac

#

thing

#

arc

restive pebble
#

Arc

earnest phoenix
#

yeah

restive pebble
#

I see u did ctx.clip

earnest phoenix
#

yeah

#

because

#

to make it round

restive pebble
#

Ok

#

U did closePath

earnest phoenix
#

?

#

oh yes

restive pebble
earnest phoenix
#

what a m i looking at

#

am

#

@restive pebble

restive pebble
#

yea

#

Replace that

#

Code

earnest phoenix
#

huh

#

looks exact same

restive pebble
#

I added just one lonw

#

Line

earnest phoenix
#

ok

#

lol

restive pebble
#

After close path no changes can be made

earnest phoenix
#

oh really?

#

i didnt know that

#

lol

#

sorry im dumb

pure lion
#

imma rewrite the music bot

earnest phoenix
#

k

devout phoenix
#

can someone help me understand wait_for? I'm trying to use it inside a command but I don'y really get it. --- python

restive pebble
#

Yes

#

I was about to ask tht

long yew
#

pls

sinful belfry
#

message is not defined

pure lion
#

:o

long yew
#

wait

#

so

pure saddle
long yew
#

line 192 is my error at

pure lion
#

Why my bot is gay?
@delicate shore por que the pardon

tight plinth
#

was that a selfstar

pure lion
#

nope

sinful belfry
#

please keep this channel on-topic

delicate shore
#

why the pardon

#

Ok

sinful belfry
#

@long yew what value did you put into that function?

long yew
#

so can anyone help me?

green kestrel
#

anyone else getting frustrated with github atm

long yew
#

um

golden condor
#

yep

green kestrel
#

theyre in the middle of an outage

golden condor
#

it'sworking for me it seems

green kestrel
#

just been given commit access to help out with a discord library, and i cant merge in peoples PRs lol

long yew
#

starman i put js function spawnMon(message) {

#

for the function

sinful belfry
#

can u send the line of code where you triggered the function?

green kestrel
#
spawnMon("in my pocket"); // ?```
long yew
#

ok

#
 message.channel.send({ embed });
 message.channel.send(`Type \`${pConfig.prefix} catch\` to attempt to catch it!\n*(Catch Chance: ${(currentMon.catchChance * 100).toFixed(2)}%)*`);```
#

them

sinful belfry
#

i mean, the bit where you did spawnMon()

#

what did u put in the brackets?

earnest phoenix
#

anyone else getting frustrated with github atm
@green kestrel yup was fucking editing code then boom SERVER ERROR

long yew
#

i never wrote spawnMon

#

after the function

sinful belfry
#

how have u triggered that function then?

long yew
#

i haven't

#

ima go and try fix that

#

thanks for the help

#

i can't figure out where it is needed

sinful belfry
#

where have u defined message?

#

before the function

pure saddle
#

i have client status issue

long yew
#
client.on('message', message => {```
#

starman

sinful belfry
#

-ask2ask @pure saddle

gilded plankBOT
#

@pure saddle

Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.

Please read https://dontasktoask.com/ for an explanation on why this is an issue.

long yew
#

starman u know what is wrong?

golden condor
#

@pure saddle use === not =

long yew
#

someone help me pls

#

because it seems like you are using code someone made for you

quartz kindle
#

clientStatus returns an object

#

you have to get the property you want to compare

#

for example user.presence.clientStatus.web === "online"

long yew
#

Tim can you help me?

pale vessel
#

he helped you

long yew
#

i get that

quartz kindle
#

message is not defined

pale vessel
#

message is undefined

long yew
#

but

#

at the top line

#

i defined it

#

with function

quartz kindle
#

how do you call the function?

long yew
#

i haven't called it

#

idk where i should

quartz kindle
#

you're calling it from somewhere

#

else it wouldnt be giving you an error

#

since it wouldnt be executed

#

by calling the function i mean doing spawnMon()

long yew
#

yeah

#

i have that no where

#

actually

quartz kindle
#

you have to have that somewhere, else that function would never even run

#

there, see

long yew
#

i have it near the top

#

of my code

quartz kindle
#

so you have to give it message as an argument

#

functions are basically senders and receivers, when you call a function, you send some data to it, and where you declare the function, is where you receive data from it

#

for example

#
function bla(received) {
  console.log(received) // received === 10
}

bla(10) // send 10 to the function bla
#

you're doing spawnMon() whicih means you're not sending anything to the function. but in your function you are expecting to receive a message

#

so message is undefined because you never sent anything

long yew
#

ohhh

#

do i put 1 in spawnmon()

#

?

quartz kindle
#

you need to send the message

#

so that the function can receive the message

long yew
#

what message should be sent?

quartz kindle
#

the message object

#

message

long yew
#

oh so js spawnmon(message)

quartz kindle
#

yes

long yew
#

ok thanks

#

i'll try that

#

WOW

#

it WORKS

#

thanks so much

#

aaaaa i got another error for my .catch command

pure lion
#

send

#

sendsensnnes

long yew
worn niche
#

Hi, I have problem with "detecting" people what have status: do not disturb. Anyone knows what is (idk how to name it) const for that? Here's my actual code:

const totalDND = fetchedMembers.filter(member => member.presence.status === 'do-not-disturb');
cinder patio
#

dnd

lusty quest
#

@long yew channels

pale vessel
#

@worn niche

lusty quest
#

ohh wait nvm

#

its wrong

worn niche
#

@worn niche
@pale vessel k thx

#

very thanks

#

@pale vessel

#

❀️

quartz kindle
#

@long yew channel.messages.fetch()

livid rivet
#

@earnest phoenix try to loop over member.activities

long yew
#

do i put that instead?

#

@quartz kindle so is this correct? js channel.messages.fetch(sentId).then(function (got) {

livid rivet
#

and if the activity is a custom one (aka discord.CustomActivity) you can grab the text and emoji

#

np πŸ‘Œ

long yew
quartz kindle
#

use your brains

#

dont literally copy paste code

#

compare what you had before to what i said and find the difference

long yew
#

ok

#
messages```
#

needs defining

#

thanks @long yew

#

lol np

earnest phoenix
#

I would like when someone notifies my bot the bot replies a message, please help me

carmine parrot
#

as in the bot replies to a command and you want to read the reply from the user after that?

rose warren
#

@earnest phoenix log your errors. Does the bot have the correct permissions?

earnest phoenix
#

Give me credits please guys I need helpπŸ˜”

#

I would like when someone notifies my bot the bot replies a message, please help me πŸ‘€

#

Fuck all

#

ok lmao

junior bobcat
#

quick question:
what's better to use ?
setInterval() or client.setInterval() ?
and why ?

cinder patio
#

As far as I know, client.setInterval stops when the client disconnects

#

so if you are running anything else that would keep your process running, you might want to use client.setInterval

junior bobcat
#

but setInterval will stops too if the script is stopped

lunar mason
#

hi, are there any recomended websites which offer both hosting+vps postgresql database hosting and can be paid using a debit card?

cinder patio
#

when client is disconnected / destroyed, not when the script is stopped

junior bobcat
#

indeed

#

thanks

obtuse jolt
#

can someone help me with this

#

im trying to use a pastebin API like this

const fetch = require('node-fetch')

fetch('https://paste.vurighosting.com/api/create', {method: 'post',body: text='testing',headers: {'text': 'test' },}).then(res => console.log(res))```
#

and I get this

Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_readableState: [ReadableState],
readable: true,
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: true,
_transformState: [Object],
[Symbol(kCapture)]: false
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://paste.vurighosting.com/api/create',
status: 200,
statusText: 'OK',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0```
bitter sundial
#

yeah's that's a response object

obtuse jolt
#

but what does it mean

bitter sundial
#

its just a bunch of data

obtuse jolt
#

its supposed to return a link

#

to the paste

bitter sundial
#

if you want the response body you can use functions like res.text(), res.json() based on what kind of response you're expecting

obtuse jolt
#

json doesnt work

#

it broke

bitter sundial
#

then try just raw text

obtuse jolt
bitter sundial
#

then try just raw text

obtuse jolt
#

Error: Missing paste text

#

epic

#

but how do i do that

bitter sundial
#

your body rn is just true

#

you're assigning "testing" to a variable called text in js

cinder patio
#

It's actually "testing"

#

but still, you're not really supposed to do that, just put "testing"

bitter sundial
#

the body should probably be urlencoded

long yew
#

help

bitter sundial
#

"text='your paste with special characters replaced with url encoding'"

long yew
#

i want it to catch the pokemon

#

not write there is no pokemon

obtuse jolt
#

yeah I have this so far but it still just says no paste text

const fetch = require('node-fetch')

fetch('https://paste.vurighosting.com/api/create', { method: 'POST', body: "text='testing'" })
.then(res => res.text())
.then(e => console.log(e))```
quartz kindle
#

is this api yours?

obtuse jolt
#

someone else made it

quartz kindle
#

does it have docs?

obtuse jolt
#

not very good ones

#

it just all says about cURL

honest perch
obtuse jolt
#

i just get this now

#

Error: Missing paste text

quartz kindle
#

thats how you post url-encoded params

obtuse jolt
#

do you have the link to the queue system?

#

still?

#

im gonna have to remake the command to add this so i may aswell add the queue system

long yew
#

anyone know the problem?

cinder patio
#

mon is a falsey value

#

how do you call the function?

long yew
#

which function?

cinder patio
#

the one in the picture

long yew
#

ok so

obtuse jolt
#

@quartz kindle

long yew
#

attempt catch there

cinder patio
#

mon will always be undefined because you don't provide a third parameter

stable nimbus
#

Are you able to use more than one library or will that just break everything?

vivid crescent
#

@cinder patio it will therefore be false

quartz kindle
long yew
#

mon will always be undefined because you don't provide a third parameter
@cinder patio so what do u suggest me doing?

vivid crescent
#

And skip the catch

cinder patio
#

provide a value

vivid crescent
#

Tim fast boi

long yew
#

wait

#

so#

quartz kindle
#

@obtuse jolt nop, dont have the link

long yew
#

i add messages?

#

to that

obtuse jolt
#

damn

long yew
#
if (command === "catch") {
            attemptCatch(message, messages, currentMon)
        }```
obtuse jolt
#

found it

hardy vector
#

https://stackoverflow.com/questions/19051041/cannot-overwrite-model-once-compiled-mongoose this thing lied to me
it told me instantiate the schema once, and then have a global object call it when it needs it.

const mongoose = require('mongoose')
var Schema = mongoose.Schema;
let warnsSchema = new Schema({
    Warns: Array,
    User: String,
    Guild: String
})
module.exports=mongoose.model("warns", warnsSchema)

which is what i did
but that still gives me the error its supposed to fix

obtuse jolt
#

holy crap this looks confusing af

long yew
quartz kindle
#

what is messages supposed to be?

cinder patio
#
quartz kindle
#

@hardy vector show code

long yew
#

ohh tim my code didn't save when i added the messages part in

cinder patio
#

doubt

hardy vector
#

ok

long yew
#

someone help me

#

i have though i thought

restive willow
#

did you define it outside of the function? i dont do js, but in python youd have to global it if you did

earnest phoenix
#

Hm I have seen to ran into a issue- From time to time the bot's ping will be 1000+ that is not ok I am aware of that 1 time it will show it's own latency is high the other time Discord's latency is high- Now I have not had this issue in a while but just since A few days I started to note that the bot was becoming slower to my commands-- It is on a VPS. Could it be on their end or is my bot just getting to big to be handled and should I upgrade my VPS.
https://cdn.discordapp.com/attachments/716641784553275432/727145689167167579/unknown.png
https://cdn.discordapp.com/attachments/716641784553275432/727145768229797938/unknown.png

long yew
#

can anyone help me?

balmy nimbus
#

guys I have a problem with running discord bot on glitch

earnest phoenix
#

What are you trying to do on glitch?

balmy nimbus
#

discord bot hosting

earnest phoenix
#

Unreliable, Glitch is getting rid of ping services.

lusty quest
#

nice finnaly got my Migration Tool for migrating MYSQL to MongoDB done

balmy nimbus
#

heroku

#

can i use that

#

instead

earnest phoenix
#

Probably.

#

You could try Repl.it and Uptimerobot.

balmy nimbus
#

ok tnx

long yew
#

anyone know my problem?

boreal latch
#

anyone know where should i start on using rethinkdb with my discord bot?

long yew
#

HALP, SOMEONE HELP ME xD

#

PLS

balmy nimbus
#

but Repl. it is public. it shows my code plublicly in their website. and private projects costs money πŸ˜‘

golden condor
#

anyone know where should i start on using rethinkdb with my discord bot?
@boreal latch what lang are you using?

earnest phoenix
#

Where can I host my discord bot?

boreal latch
#

javascript (discord.js) @golden condor

#

sorry for ping

#

didn't mean to do that

golden condor
#

it's fine

#

have a look at this guide to help u out

earnest phoenix
#

idk why its happening

topaz fjord
#

there is no variable named messages

nimble ore
long yew
#

there is no variable named messages
@topaz fjord what should messages = ?

topaz fjord
#

it's your function

#

it should be equal to whatever it needs to be

long yew
#
 channel.messages.fetch(sentId).then(function (got) {```
#

for e.g on that

#

what would it equal for that?

pure lion
#

@nimble ore thats the most complex ping command ive ever seen

nimble ore
#

its an automatic changing ping command

#

and uptime

#

so yes

#

i would say its complex

#

for ping and other stuff

#

but i just need it to update itself when -botoff is run

pure lion
#

oh

digital ibex
#

hi, how can i make a post request to discord api?

nimble ore
#

you got any ideas on how to fix?

digital ibex
#

with node.js

pure lion
#

you got any ideas on how to fix?
@nimble ore nope pandasad

nimble ore
#

rip

digital ibex
#

what are trying to do?

#

@nimble ore

nimble ore
#

im trying to edit my auto-updating status command when i do a command

#

so like

#

-botoff

#

changes my embed description

#

for the auto-updating status

lusty quest
#

@hardy vector did you call the init?

hardy vector
#

connect

#

?

digital ibex
#

r u getting any errrors?

hardy vector
#

yes

digital ibex
#

nerd that no one likes, its not lying to you.

#

and i wasn't talking to u

#

i was talking to @nimble ore

hardy vector
#

oh

nimble ore
#

nope

#

i am not getting a single error

lusty quest
#
  init: () => {
        const dbOptions = {
            useNewUrlParser: true,
            useUnifiedTopology: true,
            poolSize: 5,
            connectTimeoutMS: 10000,
            family: 4
        };
        
        mongoose.connect('mongodb://localhost/db', dbOptions);
        mongoose.set('useFindAndModify', false);
        mongoose.set('useCreateIndex', true);
        mongoose.Promise = global.Promise;
        
        mongoose.connection.on('connected', () => {
            console.log('[NOTICE] Mongoose connection successfully opened!');
        });
        
        mongoose.connection.on('err', err => {
            console.error(`[ERROR] Mongoose connection error: \n ${err.stack}`);
        });
        
        mongoose.connection.on('disconnected', () => {
            console.log('[NOTICE] Mongoose connection disconnected');
        });
    }

#

then i call in the mainfile mongoose.init()

digital ibex
#

you dont have to do that

lusty quest
#

(i export the entire thin)

digital ibex
#

@hardy vector how r u connecting to the db

sterile minnow
#

Hi

golden condor
#

you could do client.db

digital ibex
#

client.db isn't a default thing tho

sterile minnow
#

I hope some1 can help me:

client.user.setActivity("#blacklivematter | p*help")
client.user.setStatus("dnd")```

Does only this

https://i.imgur.com/EddUIyN.png
golden condor
#

so it is accesible everywhere

sterile minnow
#

has some1 a idea?

#

setPresence isnt working at all

pure lion
#

that happened to me too idk why

#

for some reason you cant change the status and the presence at the same time?

sterile minnow
#

yep

#

i mean it is there for a sec but then its changing to dnd and poof

earnest phoenix
#

So i was hosting on heroku and applied a puppeteer buldpack to it, but now i moved to a vps and moved the files from heroku to there... How can i remove a buildpack?

golden condor
#

you could delete the app

nimble ore
golden condor
#

whatever you are doing [0] of is undefined

earnest phoenix
#

@golden condor delete the app?

#

Huh

long yew
golden condor
#

the heroky app

#

dude

long yew
#

someone help

golden condor
#

can yu read

long yew
#

me

nimble ore
#

@golden condor check the code

golden condor
#

Read the error

nimble ore
#

idk how its undefined

cinder patio
#

Learn javascript, zSamPlayz

long yew
#

@golden condor i have

golden condor
#

@long yew there is an error telling you "messages is not defined", and it fairly obvious

solemn latch
#

I think messages is undefined

cinder patio
long yew
#

see this is the thing, u all act smug saying learn js and stuff but if you try you probably can't fix it, i already tried adding variables

solemn latch
#

Thats not the problem

golden condor
#

Dude this erorr is so obvious

#

defineπŸ‘messages

slender thistle
#

In a way saying "learn X" doesn't exactly help the case on point

long yew
#

i have on the function

golden condor
#

@nimble ore can you console.log embed

nimble ore
#

yup

golden condor
#

i have on the function
@long yew when you call the function, messages is not defined

#

ty

solemn latch
#

Where in the function is messages even being used tho

long yew
#
}
        channel.messages.fetch(sentId).then(function (got) {``` and other places
golden condor
#

smh

nimble ore
solemn latch
#

Channel already has that property

cinder patio
#

That's a property of the channel, not a local variable

solemn latch
#

We had this exact same conversation yesterday sam

long yew
#

no

solemn latch
#

You dont need to pass variables for properties

long yew
#

this is different

golden condor
#

can you console.log(embed.embeds) ?

nimble ore
#

ok

solemn latch
#

No its the same problem, just a different property

golden condor
#

ty

long yew
#

i've already tried so many things

golden condor
#

define

#

messages

long yew
#

:/

tulip ledge
#

whats the problem

golden condor
#
const messages = whatever```
tulip ledge
#

U wanna fetch messages?

solemn latch
#

That would solve the problem, but really you don't even need to pass on messages

nimble ore
solemn latch
#

since its already in channel

golden condor
#

huh

#

it's undefined

long yew
tulip ledge
#

channel.messages isn't defined due to channel niet being defined probably

golden condor
#

but it says it exists

nimble ore
#

yeah

long yew
nimble ore
#

its odd

tulip ledge
#

You wanna do message.channel.messages

golden condor
#

weird

nimble ore
#

yeah

tulip ledge
#

?

golden condor
#

ohhh

#

it's a promise

#

you need to do await

nimble ore
#

where do i put the await?

tulip ledge
#

await ..whatever you're doing

#

await message.channel.send(embed)

#

Or idk what u wanna do

golden condor
#

wait

earnest phoenix
#

a

nimble ore
#

await embed.edit(embed.embeds[0].setDescription(Uptime: \n \❌ Offline` \n Bot Status: `❌ Offline``))

golden condor
#

Can I just fix up some of your code here?

tulip ledge
#

Your function needs to be an async function

nimble ore
#

yeah

#

cxllm u can

golden condor
#

Your function needs to be an async function
@tulip ledge ^

long yew
quartz kindle
#

@long yew what is messages supposed to be?

golden condor
#
 async function editMessage() => { //now an async function
            if (!autostatus.embed.channel || !autostatus.embed.message) return;
            let embed = await client.channels.cache.get(autostatus.embed.channel).messages.fetch(autostatus.embed.message); //need to await the fetch
            embed.edit(embed.embeds[0].setDescription(`Uptime: \n \`:x: Offline\` \n Bot Status: \`:x: Offline\``))
    
    }```
#

@nimble ore ^

long yew
#

idk u told me to do messages before

solemn latch
#

You can get rid of the messages from the function

long yew
#

tim

nimble ore
#

ty

quartz kindle
#

you see, before writing any piece of code, you should think about what your code is supposed to do, what is the variable messages supposed to be? what do you use it for?

nimble ore
#

lemme try

golden condor
#

ok

quartz kindle
#

i am thinking you dont need messages at all

golden condor
#

^^^

nimble ore
quartz kindle
#

even more so if you cant explain why you need them

golden condor
#

oh get rid of that bit

nimble ore
#

kk

solemn latch
#

He thinks he needs to pass on the variable, when messages is a property of a channe

#

Channel

earnest phoenix
#

my eslint would be mad by now

golden condor
#

i screwed it up

#

sorry

nimble ore
#

@golden condor tysm man! it works after 5 hours of debugging

#

lmao

golden condor
#

np

quartz kindle
#

@long yew btw i didnt tell you do use messages anywhere

golden condor
#

happy to help

long yew
#

i am confusion

earnest phoenix
#

why

golden condor
#

smh

long yew
#

idk

golden condor
#

just get rid of messages

quartz kindle
#

you are confused because you dont know how the language works, which is why people keep telling you to go learn the language first

golden condor
#

you don't need it

long yew
#

:

quartz kindle
#

when you create a function, you give it arguments that its expecting to receive, for example function myfunction(something,somethingElse)

earnest phoenix
#

learn the language first

long yew
#

i already know js

earnest phoenix
#

doubt

quartz kindle
#

and when you call the function to execute it, you need to send it the data you want to send it myfunction(firstdata,seconddata)

long yew
#

so i don't need to

learn the language first
@earnest phoenix

golden condor
solemn latch
#

Whats a property then CBPikaThink

long yew
#

a property

solemn latch
#

What do they look like

#

Its the term for something specific

cinder patio
#

You clearly don't know basic concepts of the language, like functions with arguments and properties

long yew
#

aaaaaaaaaaa

#

i do

quartz kindle
#

assuming you want to access the messages of a channel, you dont need to define a messages variable anywhere, nor pass it anywhere. you simply get it from channel

#

every time

long yew
#

i don't know how to explain them

solemn latch
#

But you also don't understand how to do something when someone explains it CBPikaThink

long yew
#

wow how many people are typing

quartz kindle
#

when you pass a complex object to a function, for example myfunction(channel), the function has access to the full object, including all its properties and children

golden condor
#
var knowsjs: boolean = true
if(!knowswhatpropertyis) knowsjs = false
console.log(knowsjs ? "Knows JavaScript" : "Doesn't know JavaScript")```
#

Doesn't know JavaScript

cinder patio
#
long yew
golden condor
#

READ IT

#

READ THE ERROR

long yew
#

i have lol

golden condor
#

"Unknown Channel"

quartz kindle
#

unknown channel

golden condor
#

No you haven't read the error

long yew
#

oh it is because someone i my server keeps on deleting the channel

#

ima check audit log

#

brb

grizzled raven
#

huh

long yew
#

HELP

#

HELP

earnest phoenix
#

???

long yew
#

MY BOT HAS TURNED AGAINST ME

earnest phoenix
#

ok nice

long yew
#

he keeps on doing that

earnest phoenix
#

good job

#

@quartz kindle do you know how to remove a buildpack lol? I moved from heroku to a vps and the buildpack is still there

long yew
#

HALP

earnest phoenix
#

stop saying help

long yew
#

i need help thou

earnest phoenix
#

we can't see your code

#

we don't magically know your code

long yew
solemn latch
#

Message.channel.fetch
Fetches a channel

#

Then your doing got.delete()

#

So your deleting your channel

#

Also, why does a pokemon bot have perms to delete channels

digital ibex
#

you guys are being mean

earnest phoenix
#

no one is being mean

solemn latch
#

Hes had the same confusion between variables and properties for the past few days CBPikaThink

#

Even tho its been explained several times that properties don't need to be passed like variables

digital ibex
#

well thats just my opinion.

long yew
#

:c

earnest phoenix
digital ibex
#

im just saying that because i feel you guys are being a bit too harsh, its not nice, like i said, its just my opinion.

earnest phoenix
#

ok

solemn latch
#

I think the harshness is because someone who "knows js" is having these types of issues.

green kestrel
solemn latch
digital ibex
#

nice

green kestrel
#

you should all pass your js through codacy

digital ibex
#

whats the code quality thing? πŸ‘€

green kestrel
#

codacy quality report, it helps you write neater, faster and more secure code

solemn latch
#

Is it like automated code review?

green kestrel
#

yup

solemn latch
#

Oo

digital ibex
#

nice

obtuse jolt
solemn latch
#

I need that

digital ibex
#

can you send me a link to it πŸ‘€

green kestrel
#

its free btw

earnest phoenix
#

Endorsed by Brain

green kestrel
digital ibex
#

heccing cool

#

oh ok

green kestrel
#

someone else here showed it me a couple of months ago, its awesome

earnest phoenix
#

@green kestrel thanks brain, very cool

green kestrel
#

it even pokes holes in your markdown lol

earnest phoenix
digital ibex
#

this?

green kestrel
#

nah not self hosted, but that site yes

earnest phoenix
#

i'll sign up next year

digital ibex
#

oh right

green kestrel
digital ibex
#

so i go to cloud?

earnest phoenix
#

yes

green kestrel
#

yup

#

the free version doesnt have support for showing code quality of members of a team against each other

#

but dunno about you, i dont need that atm

cinder patio
#

that's super cool

digital ibex
#

ahh

solemn latch
#

while its doing that, ima make some coffee

#

if i get a D, ill consider myself passing

digital ibex
#

lmao

#

i'll be happy with a b+

green kestrel
#

i turned off checks in third party libs

#

go to settings and ignore list, and tick ignore on any third party code

#

it was checking a bunch of python in unit test scripts for ASIO and websocketpp etc for me

#

in the end theres nothing you can do about code quality of a third party lib, so might as well put it on ignore

#

my main checks are php, C++ and shellscript, i turned off python and markdown

#

it doesnt do perl by the way... found that out when i put it on one of my really old reps πŸ˜„

cinder patio
#

Most of my "issues" are missing semicolons after }'s

green kestrel
#

yeah, thats good then πŸ™‚

cinder patio
#

And also requiring child_process for some reason

#

ah it's a security issue

solemn latch
#

mines still running

green kestrel
#

i have codacy for code quality review, and circleci for continuous integration builds

#

circleci takes aaaaaaaaaages, but i like it more than jenkins

digital ibex
#

i dont have the node modules on the repo

#

will it still somehow search and review them?

quartz kindle
#

you shouldnt need to review other people's modules lol

plush oar
#

Hey

digital ibex
#

yeah!

opal plank
#

ads

pale vessel
#

thanks man

digital ibex
#

i wanna invite it

opal plank
plush oar
#

lol

#

erwin ur profile

digital ibex
#

thanks bro, saved me a lot of time NoobGuns

earnest phoenix
#

How's it possible to get an array's index inside an array?
For example

[
[<Something>],
[<Another thing>]
]``` 
How can i get the index of the `Another thing`?
digital ibex
#

[0][1] ?

opal plank
#

delete

solemn latch