#development

1 messages · Page 1347 of 1

viscid gale
#

explaination ^

earnest phoenix
#
function reverseString(str) {
  return str.split("").reverse().join("");
}
     
message.channel.send(reverseString(args))

str.split is not a function

misty sigil
#

isn't args an array?

#

console.log the args

earnest phoenix
#

yeah

misty sigil
#

well you can't use an array as a string

#

and you can't use string methods on the array

earnest phoenix
#

thx

#

loading Xetera is typing...

#

thonkconga what are you typing so long

woeful pike
#

@viscid gale An interesting way to think about the N queens problem is to find a different way to represent the board. Because no 2 queens can be on the same row, instead of using a 2d grid you can collapse it into a one dimensional array where each index represents a new row. So you can have [1, 3, 0, 2] that represents the solution

.Q..
...Q
Q...
..Q.

and from there you can pre-fill a single index of that array and create a backtracking algorithm that will ignore a position you pass in when checking different solutions

viscid gale
#

k im back and... hmm reading

vale garden
#

aaaa

viscid gale
#

i was indeed thinking of changing my approach but the number example was VERY HELPFUL

#

this is gonna take a bit to sink in fully

vale garden
#

cool i cant save my hastebin now

#

now im getting this when i download quick.db

#

help plz

earnest phoenix
#

cool i cant save my hastebin now
@vale garden I'm jealous of you man

vale garden
#

a

#

wat

viscid gale
#

@woeful pike thanks :}
i got church soon but after i would implement that idea.. appreciated

woeful pike
#

yeah no worries, this problem took me a long time to figure out even when I fully understood the solution lol

viscid gale
#

so ur one of the 43 who solved it huh.. nice

ionic dawn
#

@vale garden npm install node-pre-gyp

viscid gale
#

by this afternoon hopefully it gonna be 44 :}

earnest phoenix
#
Error: HTTP Error: 400, Billing account for project '505255374849' is not found. Billing must be enabled for activation of service(s) 'cloudbuild.googleapis.com,containerregistry.googleapis.com' to proceed.

I can't deploy to firebase functions smh

tardy hornet
#

how do i make that if it is

#

it will return a message in the channel

#

idk how to return that

vale garden
#

k ill try

earnest phoenix
#
embed.fields[3].value.length
tardy hornet
#

k ty

#

then

earnest phoenix
#

it will return the length

tardy hornet
#

if (embed.fields[3].value.length) return

#

?

earnest phoenix
#

if it's larger than 1024 send a message in the channel

ionic dawn
#

@vale garden also, the error is on better-sqlite

earnest phoenix
#

you know how to do math in JS right?

tardy hornet
#

not very good

ionic dawn
#

If you read the error is a problem when installing that pckage

quartz kindle
#

repl.it doesnt support building sqlite

#

the build takes too long, and gets killed

#

you have to ask the maintainer to release a prebuilt version for repl.it's node version

tardy hornet
#

@earnest phoenix

if (embed.fields[3].value.length(1024)) return message.channel.send('if you dont see anything that means that you got more roles then i can list.` Must be 1024 or fewer in length.` ')```
#

now?

quartz kindle
#

no

#

length is a property, not a function

earnest phoenix
#

developer of a verified discord bot doesn't know how to do math smh

quartz kindle
#

@tardy hornet do you know how to check if a number is bigger or smaller than another number?

earnest phoenix
#

number > othernumber

tardy hornet
#

o wait

#

then

#
if (message.length > 1024) return message.channel.send('if you dont see anything that means that you got more roles then i can list.` Must be 1024 or fewer in length.` ')```
earnest phoenix
#

no

#

it's not message.length

tardy hornet
#

fixed that ty

vale garden
#

@ionic dawn

#

when i reload

#

i get all this yet again

quartz kindle
next flax
#

``` let enabled = db.get(24/7_${message.guild.id}) {
if(enabled) return
player.playing = false
} else {
player.destroy()

}```

#

why isnt this working

vale garden
#

repl.it doesnt support building sqlite
@quartz kindle it works on my other bot on repl.it tho

quartz kindle
#

what version?

vale garden
#

7.1.1

quartz kindle
#

on the other one too?

vale garden
#

well no the latest version is 7.1.3

#

but i guessed it would load up 7.1.1 if i changed it in the package.json

#

and that didnt do anything

quartz kindle
#

latest version for better-sqlite3 is 7.1.1

next flax
#

lol

vale garden
#

what

#

im talking about quick.db not better-sqlite3

quartz kindle
#

@vale garden quick.db is built on top of better-sqlite3

vale garden
next flax
#

``` let enabled = db.get(24/7_${message.guild.id}) {
if(enabled) return
player.playing = false
} else {
player.destroy()

}```
:/

vale garden
#

its 7.1.3 here tho

quartz kindle
#

i dont use mongo, but you should be caching prefixes, not fetch them on every single message

#

@vale garden thats quick.db version, not better-sqlite3 version

next flax
#

hey tim

vale garden
#

im talking about quick.db not better-sqlite3
@vale garden

#

lol

next flax
#

u know why it is givin error?

quartz kindle
vale garden
#

ok i am confused now

#

im talking about the quick.db version tho

quartz kindle
#

quickdb 7.1.3 uses better-sqlite3 7.1.1

#

thats what i wanted to know

vale garden
#

oh kk

quartz kindle
#

does your other bot which works also use the same versions?

vale garden
#

oh

#

thats why

#

my bot uses 6.0.1

earnest phoenix
#

how do you send HTTP requests through browser javascript?

vale garden
#

wait so can i download previous versions of better-sqlite3

quartz kindle
#

@vale garden there were changes on v7 that makes better-sqlite3 take longer to install, and repl.it doesnt like that it takes too long

vale garden
#

ok so can i download 6.0.1

#

and how do i

next flax
#

hey code

earnest phoenix
#

repl.it doesnt like that it takes too long
can't i just do require("child_process").exec("npm install quick.db") in index.js and run it? repl can't kill the process for that

#
  let enabled = db.get(`24/7_${message.guild.id}`) {
    if(enabled) return
  player.playing = false
     } else {
    player.destroy()
  
}

why are there random braces on line 98 and 104

#

@next flax

next flax
#

hmm

earnest phoenix
#

those curly brackets shouldn't be there

next flax
#

ok

earnest phoenix
#

actually no

next flax
#

but

#

they are specifeing the process

earnest phoenix
#

@earnest phoenix use axios

#

there should be a { after the if statement and no { after db.get(...)

#

@earnest phoenix use axios
@earnest phoenix i can do that in node but i wanna do it on browser

#

Use axios the client side version

#

ok

#

link me the website for that

#

Its shown in the axios repo

next flax
#

let enabled = db.get(`24/7_${message.guild.id}`) if(enabled) return { player.playing = false } else { player.destroy() }

earnest phoenix
#

the brace should be before the return statement mate

#

and there should be no line break after the return statement

next flax
#

u mean

#

let enabled = db.get(`24/7_${message.guild.id}`) { if(enabled) return player.playing = false } else { player.destroy() }

earnest phoenix
next flax
#

i m kinda

#

confusied

earnest phoenix
#

does that look valid JS syntax to you

next flax
#

-_-

#

no

#

but still

earnest phoenix
#

the brace should be before the return statement NOT at the start of the whole if statement

next flax
#

let enabled = db.get(`24/7_${message.guild.id}`) if(enabled) { return player.playing = false } else { player.destroy() }

earnest phoenix
#

finally

next flax
#

ye

earnest phoenix
#

and why is there a line break after return

next flax
#

ok

#

done

#

ty

quartz kindle
#

why even return, what are you returning?

next flax
#

that

#

is for my

#

24/7 vc cmd

#

its the queue end event

solid snow
#

Does anyone know why this only updates my database after ive updated it twice and then it updates to the version ive updated to the first time

client.on('guildUpdate', async guildData => {
    db.collection('guilds').doc(guildData.id).update({
        'guildID' : guildData.id,
        'guildName' : guildData.name,
        'guildOwner' : guildData.owner.user.username,
        'guildOwnerID' : guildData.owner.id,
        'guildMemberCount' : guildData.memberCount,
    });
});
next flax
#

if the db isnt seted so it will disconnect

quartz kindle
#

yes but why return

next flax
#

its like

#

if the db is set it will stay in vc and if it isnt

#

disconnect

quartz kindle
#

yes, but why return

solid snow
#

yo anyone please?

pure lion
#

@solid snow why do you need to store this info?

#

Just fetch and get when you need the data

solid snow
#

well i wanted to use it for prefixes and other things but i just followed a tutorial so far

pure lion
#

Oh, is that mongodb?

solid snow
#

its firebase

pure lion
#

Oh

#

Either way it's being overcomplicated

#

All you need to store is the guild ID and the prefix for the guild

solid snow
#

probably

#

yeah but my problem is still that it only updates after i update the guild for the second time and then it stores the info from the time i updated it for the first time

#

so if my server name is 1

pure lion
#

When the command to edit the prefix is used, create a new doc with the guild ID and the prefix

solid snow
#

and i update it to 2

#

it doesnt change until i set it to 3 and then it sets it to 2

#

well updating the prefix works

pure lion
#

There is no need to store any of the stuff

#

Why do you need the guild update info?

solid snow
#

well i want the guild name to be changed in the database if they decide to update it

pure lion
#

No need

#

The guild ID will always be the same

solid snow
#

even if i used it for something else my problem is that it only updates after the second time and then it still uses the version from my first update

#

so if my server name is 1 and i update it to 2 it doesnt change until i set it to 3 and then it sets it to 2

pure lion
#

Don't need to use the guild update event at all

#

Don't have to store any strings other than the ID and the prefix

solid snow
#

but what if i want to use it

#

-.o

quartz kindle
#

how are you checking this?

earnest phoenix
#

just fetch it using the ID

pure lion
#

It's unnecessary as all hell

solid snow
#

is that less unnecessary?

client.on('guildUpdate', async gData => {
    db.collection('guilds').doc(gData.id).update({
        'guildMemberCount' : gData.memberCount,
    });
});
#

what if i wanted to do this lol

#

please dont kill me

pure lion
#

Why do you need to store the membercount tho?

solid snow
#

ARGH

pure lion
#

Just get it when you need it

solid snow
#

WHAT IF i juts want to because my soul is possesed by a demon

pure lion
#

IF

#

Then

solid snow
#

IF thats what i want to do then WHY is it not working

pure lion
#

If you wanted to store the shit on guild update

#

Then do it

earnest phoenix
#

because my soul is possesed by a demon
aka you're dumb enough to install discord

solid snow
#

yes

#

but i still want to know why it only updated my database after the second time i updated the guild

earnest phoenix
#

🤦

solid snow
#

ok then

earnest phoenix
#

please

#

just don't do it

quartz kindle
#

@solid snow how are you checking that it only updates on the second call?

solid snow
#

well i look at my database

earnest phoenix
#

you'll need the ID anyways to get ANYTHING at all

quartz kindle
#

you edit your guild, then you check the database on firebase's website? and you refresh and all that and still nothing?

solid snow
#

well it WORKS BUT only after the second time i update the guild

#

only after i update it for a second time but then the db gets updated with the name from the first update

#

so like name starts out with 1, i set it to 2 - nothing, i set it to 3, database updates it to 2

quartz kindle
#

what library are you using for firebase?

earnest phoenix
#

firebase-tools probably

solid snow
#

yeah

#

idk ive never done anything with databases before i just followed a tutorial

earnest phoenix
#

aaaaaaa youtube tutorials!?

solid snow
#

well sorry ive never worked with databases before

#

sooo.....

#

yeah

next flax
#

``` let enabled = db.get(24/7_${guild.id})
^

TypeError: Cannot read property 'id' of undefined
at Manager.<anonymous> (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\server.js:98:38)
at Manager.emit (events.js:315:20)
at Node.trackEnd (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\erela.js\dist\structures\Node.js:208:30)
at Node.handleEvent (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\erela.js\dist\structures\Node.js:167:18)
at Node.message (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\erela.js\dist\structures\Node.js:147:22)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\ws\lib\websocket.js:797:20)
at Receiver.emit (events.js:315:20)
at Receiver.dataMessage (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\ws\lib\receiver.js:437:14)
at Receiver.getData (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\ws\lib\receiver.js:367:17)```

#

why

quartz kindle
#

@solid snow what if you do ```js
client.on('guildUpdate', async gData => {
await db.collection('guilds').doc(gData.id).update({
'guildMemberCount' : gData.memberCount,
});
console.log(await db.collection('guilds').doc(gData.id).get())
});

solid snow
#

let me try thanks for actually helping lol

quartz kindle
#

well, with name, not with membercount

next flax
#

why their is that error

quartz kindle
#

guild is not defined

next flax
#

i did define it in the functions part

quartz kindle
#

show it

next flax
#

i guess this will work

quartz kindle
#

well, what is player supposed to be?

next flax
#
  client.channels.cache.get(player.textChannel)
  .send({
    embed: {
      color: "#FF0000",
      title: "Queue Ended",
  thumbnail: {
    url: "https://images-ext-1.discordapp.net/external/0347DCDXRHB7-aBKxz3JdU2-gFOXggZKkIWBcome1rc/https/media.discordapp.net/attachments/726369370888077327/729881766160105582/83.audio_visualizer_perspective_3d2.gif",
  },
      description: `🎵 | Music Queue Ended`
     }
  })
  let guild = player.guild()
  let enabled = db.get(`24/7_${guild.id}`) 
     if(enabled) { return player.playing = false
  } else {
    player.destroy()
  }

});```
earnest phoenix
#

Oo

solid snow
#

@quartz kindle still the same

quartz kindle
#

@solid snow then idk, never used firebase before, i dont like it either

solid snow
#

hm thats ok thank you for actually trying to help i appreciate it

next flax
#

u know something? @quartz kindle

rocky hearth
#

how much traffic can firebase handle?

quartz kindle
next flax
#

well, what is player supposed to be?
@quartz kindle its the audio based manager i m using to play music

quartz kindle
#

@next flax you made it yourself, or is it from a library? is there a documentation to confirm that player.guild exists?

next flax
#

no

#

i tried

#

it doesnt

quartz kindle
#

thats why im asking, what is it? where it came from?

rocky hearth
#

Yes I know, but I want to know, if I have more than 1M active users. should I still use firebase?

quartz kindle
#

if you know what player is made of, then you know what it can and cant do, what it has and doesnt have

#

is there a documentation for this player?

next flax
#

yep

quartz kindle
#

who made this? is it from a library?

next flax
#

its a package

quartz kindle
#

then check the package's readme

next flax
#

it is

#

a

#

lavalink

#

client

quartz kindle
#

@next flax so according to the docs, player does have a guild

next flax
#

well

quartz kindle
#

its a property of type string

next flax
#

its working now

#

Thanks tim for Your Time

quartz kindle
#

so you use it as player.guild and it should give you a guild id

next flax
quartz kindle
#

for example db.get(`24/7_${player.guild}`)

next flax
#

hmm

rocky hearth
#

Hey Rexxy do u know some other packages other than erela??

next flax
#

about what?

#

purpose

rocky hearth
#

music bot

next flax
#

discord-player

dawn coyote
#

Does anyone know how i can code a playing in ..... servers stats

lost stone
#

hey\

#

who is here

#

............

still merlin
#

After a period of time the bot will leave, despite me and others being in the call.

lost stone
#

[] {} () <>

#

what is diffrent between them?

dawn coyote
#

what is diffrent between them?
@lost stone its difrent

still merlin
#

{ is curly brackets
( is a normal bracket
[ is square brackets
< this is a arrow

lost stone
#

in coding i mean

dawn coyote
#

😂

still merlin
#

well idk

#

did you google it?

pale vessel
#

( is a parenthesis

next flax
#
const discord = require("discord.js")

module.exports = {
  name: "24/7",

  run: async (client, message, args) => {
    
    //ARGUMEN
let guild = message.guild;
   db.set(`24/7_${guild.id}`)
   await message.channel.send("24/7 ")
    
  }
}```
#

why doesnt this work

#
    at Object.set (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\quick.db\src\index.js:64:19)
    at Object.run (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\commands\music\247.js:13:7)
    at Client.<anonymous> (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\server.js:166:17)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\Pujya Kumar\Desktop\ThunderUpdated\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)```
earnest phoenix
#

i made my own paste service

sudden geyser
#

good job

earnest phoenix
next flax
#

how

sudden geyser
#

programming

earnest phoenix
#

spent a fuckton of time making it

next flax
#

u are op

still merlin
#

I've been trying to make a radio command for a day now and it still doesn't work, My bot joins the voice channel, And is silent for 3 seconds with no green ring, then a green ring appears but no music, i'm pretty sure the green ring is a talking bar.

the code is

module.exports = {
    name: 'radio',
    description: 'The bot will join the voice channel and play some nice pop music',
    async execute(client, message, args) {
        const broadcast = client.voice.createBroadcast();
        const dispatcher = broadcast.play('https://radio.dual.pw/stream.mp3');
        if (!message.guild) return;
        if (message.member.voice.channel) {
            const connection = await message.member.voice.channel.join();
            connection.play(broadcast).then(
                message => { (message.channel.send('Playing the <https://dual.pw> radio!')); },
            );

            if (!message.member.voiceChannel) return message.channel.send('**error** You need to be in a voice channel to play the radio');
        }
    },
};
``` and the error is https://hastebin.com/ivitohuxob
earnest phoenix
#

u are op
@next flax no i am programmer

next flax
#

we couldnt reach u

#

error

fathom creek
#

.

sudden geyser
#

@still merlin connection.play() doesn't return a Message instance.

earnest phoenix
#

thonk

sudden geyser
#

You get a StreamDispatcher.

#

And that if condition after is not valid as .voiceChannel is not a valid property on a GuildMember. You don't even need it since you already check if the user is in a voice channel in your parent if condition.

earnest phoenix
#

i think i accidentally broke the website 😅

next flax
#

lol

earnest phoenix
#

brb

#

why you should always do CSS last

vale garden
#

hi

#
message.channel.send(`Congratulations! Charmander is your first Pokémon!`)
      db.set(`userinfo_${message.author.id}`, { bal: 0 })
      db.push(`userinfo_${message.author.id}`,  { party: ['Charmander'] })
#

so i have this

#

and for some reason i am getting this err

#
UnhandledPromiseRejectionWarning: TypeError: Target is not an array.
pale vessel
#

have you tried reading the error

vale garden
#

it is an array

#

right?

pale vessel
#

that looks like an object

#

{ bal: 0 }

earnest phoenix
#

website is fixed but CSS is fucked

vale garden
#

um wat

#

oh no im talking about the 3rd line

#

lol

rocky hearth
#

what is a lavalink

earnest phoenix
#

an HTTP server thingy for Java iirc

pale vessel
#

it's an object

#

you're trying to push something into an object

rocky hearth
#

code913 to me??

earnest phoenix
#

yes

pale vessel
#

you need to use js db.push(`userinfo_${message.author.id}.party`, 'Charmander')

rocky hearth
#

what is it used for

fresh matrix
#

hello @earnest phoenix

vale garden
#

oh shit

earnest phoenix
#

yo

vale garden
#

lmao

sudden geyser
#

wdym

earnest phoenix
#

helper role?

#

some servers have that

#

not us

sudden geyser
#

help out with what though

pale vessel
#

helper roles are useless

earnest phoenix
#

we don't get rewarded roles for helping

pale vessel
#

why do you care so much for a role

sudden geyser
#

You don't need a special role to help someone.

pale vessel
#

yeah

earnest phoenix
#

it's bad because people sometimes ignore people without that role and only ask for help from people with the role

#

which is bad

#

and also if you have helper role it looks like it's your literal job to help

#

@next flax website should be working now

#

fixed the CSS

earnest phoenix
rocky hearth
#

What is lavalink used for? Can somebody tell me?

next flax
#

@rocky hearth music

#

@earnest phoenix Yep

#

which database should i use

#

for my 24/7 cmd

#

🤔

earnest phoenix
#

share my website with your friends and make me a popular rich guy overnight

next flax
#

ok

#

i will use this

#

from now

#

😄

rocky hearth
#

just only music?

next flax
#

if u use that u can play from sound cloud ,vimeo,twitch

#

nd add a plugin to play spotify

rocky hearth
#

can we record audio from this?

pale vessel
#

you can record audio without it

#

(i'm assuming you meant record VCs)

next flax
#

can we record audio from this?
@rocky hearth idk

#

@pale vessel hey flaze which db should i use to store 24/7 vc

restive furnace
#

depends

next flax
#

um

#

i need a ez one

restive furnace
#

if you do db calls like 1 million calls / sec then go with postgres

#

if not -> mongodb

rocky hearth
#

flaze aah yes, sorry

next flax
#

@restive furnace is mongodb easy to setup

restive furnace
#

yes

earnest phoenix
#

Yo

#

I have a problem

#

I tried to make a rob command but it says user does not exist

#

Is there anything wrong ?


#

$nomention
$onlyIf[$getUserVar[money;$mentioned[1]]>799;Not worth Robbing this user bro.]
$onlyIf[$getUserVar[money]>499;you need 500$ to rob]
$description[
You just robbed <@$memtioned[1]>? WTF,and got $random[0;$getUserVar[money;$mentioned[1]]]]
$sum[$getUserVar[money;$authorID];$random[0;$mentioned[1]];$authorID]
$random[0;$getUserVar[money;$mentioned[1]]]]]
$setUserVar[money;$Sum[$getUserVar[money];$random[0;$mentioned[1]]]]

next flax
#

@earnest phoenix we dont use discord bot maker

#

here

#

oops

earnest phoenix
#

Brah

next flax
#

@earnest phoenix hey codee

#

u know quick.db?

earnest phoenix
#

It is Bot designer

next flax
#

thou

restive furnace
#

@next flax db.set, db.get is all what you need.

earnest phoenix
#

how can i ping a user when they join my server? i found some amazing code from stackloverflow but it didd't work bot.on('guildMemberAdd', member => { member.guild.channels.get('channelID').send("Welcome"); });

restive furnace
#

dont ctrl + c and ctrl k v

gentle lynx
#

what's this error?

#

here is line 37

tired gate
#

@earnest phoenix member.guild.channels.cache.get

#

I think

#

That code you had is v11

earnest phoenix
#

yes

ocean mango
#

Yeah it's .cache.get now

tired gate
#

Lmk if that works

restive furnace
#

why event use get at all

#

what if the channel is uncached

#

then ur screwed

next flax
#

@next flax db.set, db.get is all what you need.
@restive furnace hmm i wanted to make a

#

24/7 vc enable

#

disable cmd

#

the code for what it will be used

#

is ready

weak crag
#
 mars.on("disconnect", () => console.log("An error occurred, trying to reconnect!"));
mars.on("reconnecting", () => console.log("I am reconnecting now..."));
mars.on("message", async msg => { // eslint-disable-line
    if (msg.author.bot) return undefined;
    if (!msg.content.startsWith(PREFIX)) return undefined;

    const args = msg.content.split(" ");
    const searchString = args.slice(1).join(" ");
    const url = args[1] ? args[1].replace(/<(.+)>/g, "$d&") : "";
    const serverQueue = queue.get(msg.guild.id);

    let command = msg.content.toLowerCase().split(" ")[0];
    command = command.slice(PREFIX.length);

  if (command === "_shelp" || command == "&h") {
        const helpembed = new Discord.RichEmbed()
            .setColor("#7289DA")
        .setImage("https://cdn.discordapp.comddd/attachments/734068759157014662/734073650768117760/2Dn3.gif")
            .setAuthor(mars.user.tag, mars.user.displayAvatarURL)
            .setDescription(`  **bot information**

〔 & 〕⇰ 『 perfix bot 』
===================================
〔 play or p 〕⇰ 『 play for song 』
===================================
〔 stop 〕⇰ 『 stop for song 』
===================================
〔 skip 〕⇰ 『 skip for song 』
===================================
〔 volume 〕⇰ 『 volume for song 』
===================================
〔 about 〕⇰ 『 about bot  』
===================================
〔 invite 〕⇰ 『 invite bot to server 』
===================================

**•𝐁𝐘 MARS•**`);
}

can someone tell me why this gives me a erorr

pale vessel
#

you never told us what the error was

next flax
#

lol

weak crag
#

} this gives me a error

pale vessel
#

we're not robots 😩

next flax
#

why

#

are u

#

using v11

weak crag
pale vessel
#

bismillah

next flax
#

lmao

weak crag
#

huh?

next flax
#

u know js ? @weak crag

sudden geyser
#

CeZo do you know what an error is

weak crag
#

yea

#

i can send a screen

sudden geyser
#

Then you should be able to give us the error message & stacktrace

weak crag
#

Parsing error: Unexpected Token

sudden geyser
#

Then you have an unexpected } somewhere as you said.

weak crag
#

so what should i put

next flax
#

let enabled = db.get(`24/7`, player.guild.id) if(enabled) { return player.playing = false } else { player.destroy() }
This doesnt work
bot stays in the vc

#

why dead :/

viral timber
#

Hi, how can i create an invite to a server using discord.js?

pale vessel
#

@steel heath someone did that already

steel heath
#

hi developnmet

pale vessel
#

fuck

earnest phoenix
#
const {
    MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');

module.exports = class extends Command {

    constructor(...args) {
        super(...args, {
            aliases: ['play, p'],
            description: 'Play music',
            usage: 't!play <song>',
            category: 'Music :musical_note:'
        });
    }

    // eslint-disable-next-line
    async run(message, args) {
        const voiceChannel = message.member.voice.channel;
        if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
        const permissions = voiceChannel.permissionsFor(message.client.user)
        if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
        if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!")

        try {
            var connection = await voiceChannel.join();
        } catch (error) {
            console.log(`There was an error connecting to the voice channel: ${error}`)
            message.channel.send(`There was an error connecting to the voice channel: ${error}`)
        }

        const dispatcher = connection.play(ytdl(args.join(" ")))
            .on('finish', () => {
                voiceChannel.leave()
                message.channel.send("I left the voice channel cause the music end!")
            })
            .on('error', error => {
                console.log(error);
            })
        dispatcher.setVolumeLogarithmic(5 / 5)

    }



};```
#

Error: No video id found: never gonna give you up

pale vessel
#

exactly what it means

#

it expects an id

viral timber
#

Hi, how can i create an invite to a server using discord.js?
Still asking...

pale vessel
#

not a query

earnest phoenix
#

so

pale vessel
#

you need to handle queries in a different way

earnest phoenix
#

hmm

pale vessel
#

by using another package for example

earnest phoenix
#

how can i do then?

waxen tinsel
#

@viral timber check docs

pale vessel
waxen tinsel
#

Would be faster

sudden geyser
earnest phoenix
#

ty

viral timber
#

ty

plucky plover
#

"client.elevation is not a function" anyone can help?

sudden geyser
#

it's not a function

#

what is it supposed to be?

ionic dawn
plucky plover
#
let talkedRecently = new Set();
module.exports = message => {
  if (talkedRecently.has(message.author.id)) {
    return;
  }
  talkedRecently.add(message.author.id);
    setTimeout(() => {
    talkedRecently.delete(message.author.id);
  }, 2500);
  let client = message.client;
  if (message.author.bot) return;
  if (!message.content.startsWith(ayarlar.prefix)) return;
  let command = message.content.split(' ')[0].slice(ayarlar.prefix.length);
  let params = message.content.split(' ').slice(1);
  let perms = client.elevation(message);
  let cmd;
  if (client.commands.has(command)) {
    cmd = client.commands.get(command);
  } else if (client.aliases.has(command)) {
    cmd = client.commands.get(client.aliases.get(command));
  }
  if (cmd) {
    if (perms < cmd.conf.permLevel) return;
    cmd.run(client, message, params, perms);
  }

};```
earnest phoenix
#

is there a way to get the ping with cluster?

sudden geyser
#

ufuG that still doesn't tell me what it's supposed to do.

plucky plover
#

when i used a command

earnest phoenix
#

"client.elevation is not a function" anyone can help?
@plucky plover its not a function...

plucky plover
#

there is a error like that

earnest phoenix
#

lmao

sudden geyser
#

Then you need to make one.

earnest phoenix
#

how do i get the query?

sudden geyser
#

Either extend the class and add a method called elevation, or create the client instance and add a property called elevation with the value of a function to it.

#

It's your source code. You'll need to fill in the puzzle pieces.

plucky plover
#

oki thx

earnest phoenix
#

@pale vessel can you help?

pale vessel
#

sorry, can't

#

gtg soon

earnest phoenix
#

ohh cmonnn

#
const {
    MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
const yts = require('yt-search')



module.exports = class extends Command {

    constructor(...args) {
        super(...args, {
            aliases: ['play, p'],
            description: 'Play music',
            usage: 't!play <song>',
            category: 'Music :musical_note:'
        });
    }

    // eslint-disable-next-line
    async run(message) {

        const args = message.content.slice(prefix.length).trim().split(/ +/g);
        const r = yts(args.join(" "))
        const voiceChannel = message.member.voice.channel;
        if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
        const permissions = voiceChannel.permissionsFor(message.client.user)
        if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
        if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!")

        try {
            var connection = await voiceChannel.join();
        } catch (error) {
            console.log(`There was an error connecting to the voice channel: ${error}`)
            message.channel.send(`There was an error connecting to the voice channel: ${error}`)
        }

        const dispatcher = connection.play(ytdl(r))
            .on('finish', () => {
                voiceChannel.leave()
                message.channel.send("I left the voice channel cause the music end!")
            })
            .on('error', error => {
                console.log(error);
            })
        dispatcher.setVolumeLogarithmic(5 / 5)

    }



};




#

ReferenceError: args is not defined

sudden geyser
#

What line is the error coming from?

earnest phoenix
#

sorry i've made some changes

trim saddle
#

args came up as undefined

earnest phoenix
#
const {
    MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
const yts = require('yt-search')



module.exports = class extends Command {

    constructor(...args) {
        super(...args, {
            aliases: ['play, p'],
            description: 'Play music',
            usage: 't!play <song>',
            category: 'Music :musical_note:'
        });
    }

    // eslint-disable-next-line
    async run(message, args) {

        const r = yts("superman theme");
        const voiceChannel = message.member.voice.channel;
        if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
        const permissions = voiceChannel.permissionsFor(message.client.user)
        if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
        if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!")

        try {
            var connection = await voiceChannel.join();
        } catch (error) {
            console.log(`There was an error connecting to the voice channel: ${error}`)
            message.channel.send(`There was an error connecting to the voice channel: ${error}`)
        }

        const dispatcher = connection.play(ytdl(r))
            .on('finish', () => {
                voiceChannel.leave()
                message.channel.send("I left the voice channel cause the music end!")
            })
            .on('error', error => {
                console.log(error);
            })
        dispatcher.setVolumeLogarithmic(5 / 5)

    }



};




#

ReferenceError: args is not defined

#

6:15

trim saddle
#

there's no variable named args

earnest phoenix
#

async run(message, args)

#

i've got it in the constractor

trim saddle
#

did args ever get defined on run

earnest phoenix
#

yes

#

I will define them agan

#

si you can see its the same

#
const {
    MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
const yts = require('yt-search')



module.exports = class extends Command {

    constructor(...args) {
        super(...args, {
            aliases: ['play, p'],
            description: 'Play music',
            usage: 't!play <song>',
            category: 'Music :musical_note:'
        });
    }

    // eslint-disable-next-line
    async run(message, args) {
        const args = message.content.slice(prefix.length).trim().split(/ +/g);
        const r = yts("superman theme");
        const voiceChannel = message.member.voice.channel;
        if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
        const permissions = voiceChannel.permissionsFor(message.client.user)
        if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
        if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!")

        try {
            var connection = await voiceChannel.join();
        } catch (error) {
            console.log(`There was an error connecting to the voice channel: ${error}`)
            message.channel.send(`There was an error connecting to the voice channel: ${error}`)
        }

        const dispatcher = connection.play(ytdl(r))
            .on('finish', () => {
                voiceChannel.leave()
                message.channel.send("I left the voice channel cause the music end!")
            })
            .on('error', error => {
                console.log(error);
            })
        dispatcher.setVolumeLogarithmic(5 / 5)

    }



};




#

Identifier 'args' has already been declared

#

see?

#
const {
    MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');
const yts = require('yt-search')



module.exports = class extends Command {

    constructor(...args) {
        super(...args, {
            aliases: ['play, p'],
            description: 'Play music',
            usage: 't!play <song>',
            category: 'Music :musical_note:'
        });
    }

    // eslint-disable-next-line
    async run(message, args) {

        const r = yts("superman theme");
        const voiceChannel = message.member.voice.channel;
        if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
        const permissions = voiceChannel.permissionsFor(message.client.user)
        if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
        if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!")

        try {
            var connection = await voiceChannel.join();
        } catch (error) {
            console.log(`There was an error connecting to the voice channel: ${error}`)
            message.channel.send(`There was an error connecting to the voice channel: ${error}`)
        }

        const dispatcher = connection.play(ytdl(r))
            .on('finish', () => {
                voiceChannel.leave()
                message.channel.send("I left the voice channel cause the music end!")
            })
            .on('error', error => {
                console.log(error);
            })
        dispatcher.setVolumeLogarithmic(5 / 5)

    }



};




copper cradle
#

dude

earnest phoenix
#

so what do i do here?

copper cradle
#

const args

#

,X

#

you have the following

#

run(something, args) {
const args...

#

do you see it now

earnest phoenix
#

Dude

#

I know that

copper cradle
#

then

earnest phoenix
#

I just want to prov

#

e

#

to skullbite

#

that if I declare it

copper cradle
#

ah

next flax
#

let enabled = db.get(`24/7`, player.guild.id) if(enabled) { return player.playing = false } else { player.destroy() }
This doesnt work
bot stays in the vc

earnest phoenix
#

its says it already it is

#

can someoine help?

prime glacier
#

need help in setinterval() function

client.on("message", async member => {
  setInterval(() => {
  const channel = member.guild.channels.cache.find(ch => ch.id === '753657673383149688')
  if(!channel) return;;
}, 1000);
})```
#

👀

pale vessel
#

cursed code

earnest phoenix
#

dude

#

my head hurts

pale vessel
#

message event
calls it member
set an interval on every message

prime glacier
#

😅 trying interval first time

earnest phoenix
#

help

#
const {
    MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');

module.exports = class extends Command {

    constructor(...args) {
        super(...args, {
            aliases: ['play, p'],
            description: 'Play music',
            usage: 't!play <song>',
            category: 'Music :musical_note:'
        });
    }
    // eslint-disable-next-line
    async run(message, args) {
        const voiceChannel = message.member.voice.channel;
        if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
        const permissions = voiceChannel.permissionsFor(message.client.user)
        if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
        if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!");

        try {
            var connection = await voiceChannel.join();
        } catch (error) {
            console.log(`There was an error connecting to the voice channel: ${error}`);
            message.channel.send(`There was an error connecting to the voice channel: ${error}`);
        }

        const dispatcher = connection.play(ytdl(args[0]))
        n('finish', () => {
            voiceChannel.leave();
            message.channel.send("I left the voice channel cause the music end!")
        })
            .on('error', error => {
                console.log(error);
            })
        dispatcher.setVolumeLogarithmic(5 / 5);

    }
};```
#

ic\play.js:43
}

SyntaxError: Unexpected end of input

hollow sedge
#

ytdl does not work anymore

#

It was taken down

pale vessel
#

no that's youtube-dl

earnest phoenix
#

CMONN

pale vessel
#

they're entirely different

hollow sedge
#

no that's youtube-dl
@pale vessel oops

#

Wait no?

earnest phoenix
#

It's a syntax errir

#

error

hollow sedge
#

On GitHub it says youtube-dl was taken down @pale vessel

vale garden
#

heyo

pale vessel
#

bruh

hollow sedge
#

Are you messing with me

vale garden
#

does anyone know how this embed

pale vessel
#

yes, it was youtube-dl, not ytdl

boreal iron
#

@earnest phoenix Take a look at the last line.

vale garden
#

has fields with no value

willow mirage
#

@vale garden using description

earnest phoenix
#

OK

vale garden
#

you can have more then one desc?

willow mirage
#

ye

earnest phoenix
#

if i remove it

willow mirage
#

by ending lines

vale garden
#

oh lol

earnest phoenix
#

It's still the same error

vale garden
#

o

willow mirage
#

breaking lines

boreal iron
#

}; what could be wrong?

hollow sedge
#

Oh I see

willow mirage
#

@vale garden use \n to break lines

earnest phoenix
#

I get this error

willow mirage
#

@boreal iron maybe try })

#

idk

#

u have to show code

dreamy thistle
#

Hey guys! I need some help sending an embed when an user joins a guild (as greeting) may someone help me? I think its easy but I've been stuck for 30min trying to make it work

earnest phoenix
#

I showed it

boreal iron
#

} not };

willow mirage
#

show code

sudden geyser
#

What part are you stuck on (when the user joins, sending the embed, etc.)? What library are you using?

earnest phoenix
#
const {
    MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');

module.exports = class extends Command {

    constructor(...args) {
        super(...args, {
            aliases: ['play, p'],
            description: 'Play music',
            usage: 't!play <song>',
            category: 'Music :musical_note:'
        });
    }
    // eslint-disable-next-line
    async run(message, args) {
        const voiceChannel = message.member.voice.channel;
        if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
        const permissions = voiceChannel.permissionsFor(message.client.user)
        if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
        if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!");

        try {
            var connection = await voiceChannel.join();
        } catch (error) {
            console.log(`There was an error connecting to the voice channel: ${error}`);
            message.channel.send(`There was an error connecting to the voice channel: ${error}`);
        }

        const dispatcher = connection.play(ytdl(args[0]))
        n('finish', () => {
            voiceChannel.leave();
            message.channel.send("I left the voice channel cause the music end!")
        })
            .on('error', error => {
                console.log(error);
            })
        dispatcher.setVolumeLogarithmic(5 / 5);

    }
dreamy thistle
#

To be exact, i know how to send a message when an user joins, but not an embed

willow mirage
#

not u

boreal iron
#

} not };
@earnest phoenix

willow mirage
#

i ment Fake

#

ah

sudden geyser
#

What library are you using then

willow mirage
#

@earnest phoenix which line ?

earnest phoenix
#

wee

willow mirage
#

where is taht ?

earnest phoenix
#

what error

#

cause i have 2

#

The Syntax one?

#

44

boreal iron
#

@earnest phoenix dude you removed }; a few seconds ago, close the class with a } and not a };

willow mirage
#

@earnest phoenix where is that

boreal iron
#

can be so difficult

earnest phoenix
willow mirage
#

in discord doesn't show lines

#

WHERE THE FUCK IS THAT

#

dude

leaden rover
#

To be honest, since YTDL has been taken down by the US RIAA, I feel like I can't make a music cog anymore, but is there a good GitHub code file for wavelink? I just well, need to use wavelink instead :/

willow mirage
#

COPY ONLY THAT LINE

earnest phoenix
#
const {
    MessageEmbed
} = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');

module.exports = class extends Command {

    constructor(...args) {
        super(...args, {
            aliases: ['play, p'],
            description: 'Play music',
            usage: 't!play <song>',
            category: 'Music :musical_note:'
        });
    }
    // eslint-disable-next-line
    async run(message, args) {
        const voiceChannel = message.member.voice.channel;
        if (!voiceChannel) return message.channel.send("You must be in a voice channel to run this command!");
        const permissions = voiceChannel.permissionsFor(message.client.user)
        if (!permissions.has("CONNECT")) return message.channel.send("I don\'t have permissions to conenct to the voice channel!")
        if (!permissions.has("SPEAK")) return message.channel.send("I don\'t have permission to play the video!");

        try {
            var connection = await voiceChannel.join();
        } catch (error) {
            console.log(`There was an error connecting to the voice channel: ${error}`);
            message.channel.send(`There was an error connecting to the voice channel: ${error}`);
        }

        const dispatcher = connection.play(ytdl(args[0]))
        n('finish', () => {
            voiceChannel.leave();
            message.channel.send("I left the voice channel cause the music end!")
        })
            .on('error', error => {
                console.log(error);
            })
        dispatcher.setVolumeLogarithmic(5 / 5);

    }
}```
willow mirage
#

OMG

earnest phoenix
#

ReferenceError: args is not defined

#

lmao

willow mirage
#

run(client, message, args)

prisma oriole
#

my brain

earnest phoenix
#

kk

willow mirage
#

@earnest phoenix so ?

earnest phoenix
#
                }
                 

SyntaxError: Unexpected end of input```
#

same fucking error

willow mirage
#

show line 46

earnest phoenix
willow mirage
#

u kidding meh

earnest phoenix
#

SAME

#

I WANT TO SUICIDE

#

FUCKING CODING

willow mirage
#

add a } before async run()

earnest phoenix
#

I'M SO BBAD AT FORMATTING

willow mirage
#

wait no

#

that is wrong

earnest phoenix
#

WHY

#

WHEN I SAVE THE FIRST LETTER OF EVERY LINE

#

IT'S

#

GONE

willow mirage
#

Show from line 40 to 46

earnest phoenix
willow mirage
#

press ctrl + shift + p and then type format document

earnest phoenix
#

ok

willow mirage
#

or ctrl + shift + i

earnest phoenix
#

Unexpected token 'async'

#

code

#

?

willow mirage
#

what line is async

#
constructor(...args) {
        super(...args, {
            aliases: ['play, p'],
            description: 'Play music',
            usage: 't!play <song>',
            category: 'Music :musical_note:'
        });
    }---> , <---- // THIS ONE IS IMPORTAIN
    // eslint-disable-next-line
    async run(message, args) {
earnest phoenix
#

19

prisma oriole
#

@earnest phoenix

earnest phoenix
#

yes

#

oh

#

i've put it now

prisma oriole
#

what was it suppose to be

willow mirage
#

a function

#

or just replace n with .

prisma oriole
#

i assume its a cb from connection.play?

willow mirage
#

oh

#

replace n with dispatcher

#

i guess

prisma oriole
#

dispatch.on

#

dispatcher*

earnest phoenix
#

wat

#

ok

prisma oriole
#

whats wrong with your code, i have no errors when i pasted it into my editor

#
const Command = require('../../Structures/Command');
const { MessageEmbed } = require('discord.js');
const ytdl = require('ytdl-core');
const ytsr = require('ytsr');

module.exports = class extends Command {
    constructor(...args) {
        super(...args, {
            aliases: ['play, p'],
            description: 'Play music',
            usage: 't!play <song>',
            category: 'Music :musical_note:',
        });
    }
    // eslint-disable-next-line
    async run(message, args) {
        const voiceChannel = message.member.voice.channel;
        if (!voiceChannel)
            return message.channel.send(
                'You must be in a voice channel to run this command!'
            );
        const permissions = voiceChannel.permissionsFor(message.client.user);
        if (!permissions.has('CONNECT'))
            return message.channel.send(
                "I don't have permissions to conenct to the voice channel!"
            );
        if (!permissions.has('SPEAK'))
            return message.channel.send(
                "I don't have permission to play the video!"
            );

        try {
            var connection = await voiceChannel.join();
        } catch (error) {
            console.log(
                `There was an error connecting to the voice channel: ${error}`
            );
            message.channel.send(
                `There was an error connecting to the voice channel: ${error}`
            );
        }

        const dispatcher = connection.play(ytdl(args[0]));
        dispatcher.on('finish', () => {
            voiceChannel.leave();
            message.channel.send(
                'I left the voice channel cause the music end!'
            );
        }).on('error', (error) => {
            console.log(error);
        });
        dispatcher.setVolumeLogarithmic(5 / 5);
    }
};

#

besides the nn

#

n*

earnest phoenix
willow mirage
#

@earnest phoenix i think you gotta learn javascript from new

earnest phoenix
#

why

willow mirage
#

cuz u don't even know how brackets works

earnest phoenix
#

I know

#

how

willow mirage
#

THEN FIX IT BY UR OWN

earnest phoenix
#

I can not

#

if i put brackets

#

if i close them

willow mirage
#

TRY TO FIGURE OUT WHY IT HAS ERROR

earnest phoenix
#

i have other 100 errors

willow mirage
#

omg

earnest phoenix
#

and if i return back

#

other 300 errors

prisma oriole
#

bro what

hollow sedge
#

@willow mirage chill

prisma oriole
#

lmao

willow mirage
#

im done

#

he don't even read his code

earnest phoenix
#

so now

prisma oriole
#

its a support channel you should expect this

#

...

earnest phoenix
#

I closed all of it

#

all of the brackets

#

that need to be closed

willow mirage
#

nvm im done, imma leave

#

this conversation

#

bye

earnest phoenix
#

same

#

bye

vale garden
#

hi

#
let arr = db.get(`userinfo_${message.author.id}.party`)

    let desc = "" 
    console.log(desc)

    let i = 0;  

    do {
      desc =+ db.get(`userinfo_${message.author.id}.party[${i}]`) + "\n"
      i++;
    }

    while (i < arr.length) {

      console.log(i)

      const embed = new Discord.MessageEmbed()
    .setTitle("Your pokémon")
    .setDescription(desc)
    .setColor("ORANGE")
    .setFooter(`Showing 1–20 out of ${arr.length}`)
    .setTimestamp()

    message.channel.send(embed)

    }
#

here for some reason when i log i im getting 3

#

even tho arr.length is also 3

#

plz help

#

if i do i === (arr.length - 1), i becomes 1 for some reason

#

and it also becomes 1 when i === arr.length

hollow sedge
#

I don't think that's how do while loops work

vale garden
#

why whats wrong

hollow sedge
vale garden
#

oh wait ncm

#

nvm

#

i did =+ instead of +=

#

thats why

#

lol

#

im dumb

west crow
#

W

hollow sedge
#

?

#

This is development not advertisement

faint prism
#

@scenic kelp it would seem a random botum has appeared

west crow
#

Opps

hollow sedge
#

@vale garden what's the purpose of the do{} in your code

#

And does it work?

#

I'm asking because I'm confused now

hasty mulch
#

@west crow You posted it in #general and now here?

#

@sinful belfry

faint prism
#

Uh I already pinged a mod

west crow
#

Sorry:(

sinful belfry
#

@west crow don't send bot invite links please

sonic lodge
#

if your bot has nsfw features it should be limited to nsfw channels only

coarse oyster
#

yes, it was

#

but DBL doesnt allow nekos life endpoints

placid iron
#

😩 just dot have nsfw, just link to reddit/hentai

hollow sedge
#

I really don't understand why people would use a discord bot for nsfw stuff

earnest phoenix
#

mommy blocked pornhub

placid iron
#

PepeHands ||vpn||

dreamy thistle
#

member.guild.displayAvatarURL is not a function

#

:((

earnest phoenix
#

member.guild.iconURL()

#

member.guild.iconURL()
@earnest phoenix member?

#

He literally showed that in his code

hollow sedge
#

"Yo man how many numbers?"

earnest phoenix
#

lol yeah

#

i don't think it should be member it probably should be message

hollow sedge
#

@earnest phoenix you should try improving it by using a generator

earnest phoenix
#

The hell is that supposed to do, code913

#

generate Fibonacci sequence numbers within a specified range

#

also it works in node only

#

I don't speak "Fibonacci", tf is that

hollow sedge
#

It's a mathematical sequence

#

The next number is equal to the last two numbers added up

earnest phoenix
#

I see

#

Some "golden ratio" stuff too

hollow sedge
#

It's supposed to represent a pattern in nature

#

Yeah

dreamy thistle
#

@earnest phoenix member?
@earnest phoenix yes, its a welcomer

earnest phoenix
#

I came across it on a repl talk post

#

how would i for example, take a message i received on one client, and respond on another

dreamy thistle
#

but it sends the guild icon instead of the ppl who joins

earnest phoenix
#

how would i for example, take a message i received on one client, and respond on another
@earnest phoenix send an http request from one client to the other through a middle server

#

fun, ty

hollow sedge
#

but it sends the guild icon instead of the ppl who joins
@dreamy thistle member.avatarURL

earnest phoenix
#

@dreamy thistle You should use
member.user.displayAvatarURL()

dreamy thistle
#

gonna try

earnest phoenix
#

@earnest phoenix I'd recommend using socket.io for that

dreamy thistle
#

worked

#

thank you guys

#

i've being doing this 2hours or something

sweet ruin
#

So I am trying to create these two teams:

const newTeamScores = new mongoose.Schema({

    teamDawn: {Number, default: 0},
    
    teamDusk: {Number, default: 0},
    
})

module.exports.model = new mongoose.model('teamScores', newTeamScores)

I've written code to get the teams

const teams = await this.model.findOne({ name: 'teamscores' });```

but when I try to save things to it 
```js
teams.teamDawn = points
await teams.save()

but it gives me this error

(node:3200) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'teamDawn' of null
    at Client.<anonymous> (C:\Users\djkol\Desktop\testtestbot\index.js:74:19)```
#

please help :3

dreamy thistle
earnest phoenix
#

what is the difference between module.exports and exports?

sweet ruin
#

honestly i got no clue code913

earnest phoenix
#

@dreamy thistle rename member number to member count because it looks better

dreamy thistle
#

XD

#

ok

sweet ruin
#

yeah @earnest phoenix absolutely nothing is different between those two

earnest phoenix
#

module is probably a global variable hence i can access exports without putting module.

sweet ruin
#

mhm

earnest phoenix
#

@sweet ruin wtf is that bot name

sweet ruin
#

but this is a bot that is all in index.js

#

its just some random test bot i made

#

not my main bot obvs xD

earnest phoenix
#

but this is a bot that is all in index.js
@sweet ruin angryfrogspin

sweet ruin
#

WUTTT

earnest phoenix
#

THAT'S ILLEGAL

sweet ruin
#

no x3

#

its quite common

#

im just trying to figure out why it keeps giving this error

proven lantern
#

module is probably a global variable hence i can access exports without putting module.
@earnest phoenix if i create a global variable x and define it as {exportssss:true}, exportsss would not be defined

#

globally

earnest phoenix
#

@sweet ruin Well that would return that if it didn't find any documents with the name matching teamscores, did you save a document with this property?

sweet ruin
#

well its all in the index file

earnest phoenix
#

It's not even related to the index file LULW

sweet ruin
#

here

#

that should make it easier to understand

rugged cobalt
#

My boy's currency system at the moment is kind of like dank member's currency system but with some changes but I plan on making it a lot different. Would this be reason to reject my bot in top.gg website

earnest phoenix
#

You have to insert a document to even edit it @sweet ruin

#

You don't have any

sweet ruin
#

wait wut

proven lantern
#

@rugged cobalt that should be fine, just dont copy it exactly

earnest phoenix
#

Log this

let getDocuments = await this.model.find().toArray();

console.log(getDocuments);``` Creepa
rugged cobalt
#

Yeah it isn't

sweet ruin
earnest phoenix
#

Tf

#
let getDocuments = await this.model.find();

console.log(getDocuments);``` try this maybe
sweet ruin
#

it logging nothing

#

just an empty array

earnest phoenix
#

Yea, that's why

#

You don't have any documents

#
this.model.insertOne({
teamDawn: <whatever here>
<Other properties>
}) <No need to save>```
sweet ruin
#

but like i already did in the schematic?

earnest phoenix
#

That's the Scheme of how the things should be inputed

#

Not a document

#
const newTeamScores = new mongoose.Schema({
teamDawn: Object,
teamDusk: Object
});``` this is a correct schema for example
sweet ruin
#

but thats what I did

earnest phoenix
#

No, you put the actual object, you have to put the constructors, after that, make a document

sweet ruin
#

:/

earnest phoenix
#

Schema:

{
teamDawn: Object,
teamDusk: Object
}```

Document:
```js
teamDawn: {
Number,
default: 0
},
teamDusk: {
Number,
default: 0
}```
#

If you didn't know, schemas in mongoose are just document templates

zenith knoll
#

whats a good crash course or article for Learning MYSQL

#

thanks :)

restive furnace
#

why MySQL

#

it's not safe

#

use MariaDB instead if you still wan't to use MySQL

earnest phoenix
zenith knoll
#

@earnest phoenix client.elevation() isnt a thng

restive furnace
#

this seems copy pasted code, please don't. stopitgetsomehelp

zenith knoll
#

@earnest phoenix message.client isnt a thing

#

afaik

restive furnace
#

it is

earnest phoenix
#

I understand I'll try by deleting

zenith knoll
#

reeeeeeeeeeeee what db should i learn

stoic hull
#
            if (!message.context.startsWith(PREFIX) || message.author.bot) return;
        const args = message.content.slice(PREFIX.length).trim().split(/ =/);
        const command = args.shift().toLowerCase();```

@earnest phoenix context -> content.

#

yes.

hollow sedge
#

reeeeeeeeeeeee what db should i learn
@zenith knoll whichever one is best for your needs

zenith knoll
#

out of 10 is mongodb good for storing strings and numbers and objects

#

?

earnest phoenix
#

My boy's currency system at the moment is kind of like dank member's currency system but with some changes but I plan on making it a lot different. Would this be reason to reject my bot in top.gg website
@rugged cobalt your boy's currency system?

zenith knoll
#

Prefix + 6???

#

what??

#

well thats not a thing

#

lmao its not a thingggggg

hollow sedge
#

uh

#

also let deletehowmuchiwant = "message.content.slice(Prefix + 6)"

#

its a string

zenith knoll
#

you dont need deletehowmuchiwant

#

yea

#

just do

#

if(command == "command name" )

#

is that copy pasted code? because you seem like you dont know what it does yourself

hollow sedge
#

its probably not copy and pasted

tame kestrel
#

Guys, he came here yesterday. Just let him know that he needs to have a foundation knowing javascript before attempting to make a node bot.

hollow sedge
#

no one would ever name a variable deletehowmuchiwant

zenith knoll
#

Well you dont need that, you can just check if the "cmd" var is equal; to the cmd name

earnest phoenix
#

no one would ever name a variable deletehowmuchiwant
@hollow sedge umm i have variables with 20+ character names so

hollow sedge
#

thats not what i was saying

#

deletehowmuchiwant could be simpler and more descriptive

zenith knoll
#

heres some code if(command == "purge") { let amt = args[0] message.channel.bulkDelete(amt) } if you did my format

#

prob not but work around it

earnest phoenix
#

@earnest phoenix do you know how javascript works?

tame kestrel
#

@earnest phoenix

Please don't ignore all the advice everyone gave you yesterday. This channel is for bot development questions, not basic javascript syntax errors.

zenith knoll
#

typescript

#

o

earnest phoenix
#

if you don't know how to code it probably won't be a good idea to get into bot development so early

tame kestrel
#

It's not that you can't ask for help here, but you've had a pattern of just ignoring the advice you've gotten

zenith knoll
earnest phoenix
#

This channel is for bot development questions, not basic javascript syntax errors.
@tame kestrel since i asked do many vanilla js relatef questions am i a criminal?

tame kestrel
#

@tame kestrel since i asked do many vanilla js relatef questions am i a criminal?
@earnest phoenix probably pog pog pogu

hollow sedge
#

since i asked do many vanilla js relatef questions am i a criminal?
@earnest phoenix i think its more like when people ask basic questions

zenith knoll
#

i made 2 commands but purges dontwork
@earnest phoenix who taught u it

#

or did you just guess the code? (no offense, just asking)

#

yes

tame kestrel
#

i made 2 commands but purges dontwork
@earnest phoenix you do you then, but please don't have the members here code it for you.

zenith knoll
#

like is whoever taught u it a dbot coder that makes sure it worked

#

you cant copy code or make it similar like that

#

cause it wont work if u have a diff formatr

#

format not language

#

like if he has a channel obj alr defined and you dont it wornt work

restive furnace
#

i wish js had variable shadowing (not including vars)

blissful coral
#

hm

tame kestrel
#

i wish js had variable shadowing (not including vars)
@restive furnace like... different scopes?

restive furnace
#

well yes

tame kestrel
#

JS does allow same named variables in different scopes

neat harness
#

Guys, I've been wondering, is there an efficient way to construct an embed based on a json file? I'm kinda confused, the best i could come up with was making if statements for each of them, makes it unneat. This is about how my json file looked like:

{
  "color": [0,0,0],
  "title": "",
  "url": "",
  "author": {
    "name": "",
    "icon_url": "",
    "url": ""
  },
  "description": "",
  "thumbnail": {
    "url": ""
  },
  "fields": [
    {
      "name": "",
      "value": ""
    }
  ],
  "image": {
    "url": ""
  },
  "footer": {
    "text": "",
    "icon_url": ""
  }
}
tame kestrel
#

are you saying from json to embed?

neat harness
#

Or maybe if I could use the embed constructor as the json file itself?

#

are you saying from json to embed?
@tame kestrel Yes

#

Smlt

tame kestrel
#

can't you just take the partial embed data and stick it into the constructor

neat harness
#

I've been wondering about that, it doesn't seem to work tho, hang on I'll test in on a local server

tame kestrel
#

Looks like you can

#

Here's the interface for the optional-options

coarse oyster
#

does anyone know another nsfw endpoint instead nekos.life?
cuz I use nekos.life for my nsfw command and i see the DBL doesnt allow it.
btw, im use an filtered list to nekos.life
🙂

tame kestrel
#

Try using reddit

neat harness
#

does anyone know another nsfw endpoint instead nekos.life?
cuz I use nekos.life for my nsfw command and i see the DBL doesnt allow it.
btw, im use an filtered list to nekos.life
🙂
@coarse oyster If it's limited to NSFW only channels, should be okay, I think?

tame kestrel
neat harness
#

Wew

#

RIP

coarse oyster
#

D:

neat harness
#
  "dependencies": {
    "dblapi.js": "^2.4.0",
    "discord.js": "^12.3.1",
    "mongoose": "^5.9.26",
    "node-fetch": "^2.6.0",
    "nodemon": "^2.0.3",
    "body-parser": "^1.19.0",
    "patreon": "^0.4.1",
    "nekos.life": "^2.0.7",
    "safe-eval": "^0.4.1",
    "akaneko": "^3.3.0",
    "neko-love.js": "^1.0.4"
  }
#

Lel

coarse oyster
#

neko-love is good?

#

kekw

neat harness
#

Idk

rugged cobalt
#

@rugged cobalt your boy's currency system?
@earnest phoenix I meant bot, I was typing on my really small phone keyboard

neat harness
#

neko-love is good?
@coarse oyster AkaNeko is better I think

#

Say farewell to this server my bot lmao

coarse oyster
#

@coarse oyster AkaNeko is better I think
@neat harness ill try to add AkaNeko.

neat harness
#

Kk

coarse oyster
#

nekos.life is banned on top.gg
@tame kestrel btw SFW nekos.life is banned too?

#

like hug, kiss etc

neat harness
#

@tame kestrel btw SFW nekos.life is banned too?
@coarse oyster Especially that

tame kestrel
#

like nekos life, in all is banned. I think it's cause the sfw endpoints still show heavy ecchi and even nsfw photos

coarse oyster
#

lol, thats sad...

neat harness
#

Yeah f for my bot gettinng rejected twice bcz of Nekos.Life

#

I mean it lives in another bot listing site

coarse oyster
#

@neat harness same

#

Im using nekos life in sfw and nsfw commands, lol

neat harness
#

ode:12568) UnhandledPromiseRejectionWarning: TypeError: "channel".bulkDelete is not a function
@earnest phoenix Probaably misdefined channel

coarse oyster
#

try await msg.channel.bulkDelete(messages, true);

neat harness
#

You need to check that the channel property is a channel property

coarse oyster
#

in messages fetch the limit

neat harness
#

Just use message.channel.bulkDelete()

coarse oyster
#

@neat harness did you use only discord.js?

neat harness
#

Yes

coarse oyster
#

im using klasa

#

is better and easy...

neat harness
#

Im using nekos life in sfw and nsfw commands, lol
@coarse oyster 60% of my bot's commands are NSFW lmao

#

Hmm

coarse oyster
#

@neat harness looks at tnai

neat harness
#

Thats what im doing
@earnest phoenix Wait, srsly, lemme check docs for a sec

coarse oyster
#

its an good endpoint i guess

neat harness
#

Kk

coarse oyster
#

have an good hentai list too

neat harness
#

See if that fixes it

sudden geyser
#

like nekos life, in all is banned. I think it's cause the sfw endpoints still show heavy ecchi and even nsfw photos
@tame kestrel what about nekos.moe

neat harness
#

TypeError [MESSAGE_BULK_DELETE_TYPE]: The messages must be an Array, Collection, or number.
@earnest phoenix Hmm... did you add how many messages to delete from what was fetched, e.g. 6?

#

Kk

#

Np

zenith knoll
#

i finished eating

#

what did i miss

neat harness
#

I'm getting trashed by MongoDB

ValidationError: exp: Cast to Number failed for value "NaN" at path "exp", coins: Cast to Number failed for value "NaN" at path "coins"
zenith knoll
#

Oh, nice!

earnest phoenix
#

Is there anyway i can sync the file requirements? So like it waits until module 1 is done and than executes the module2.

neat harness
#

Is there anyway i can sync the file requirements? So like it waits until module 1 is done and than executes the module2.
@earnest phoenix Async/Await?

#

Hey so how do I make it so it does e!purge 1 or e!purge 2?
@earnest phoenix Wdym?

#

@earnest phoenix Async/Await?
@neat harness I take that back it doesn't work before load I think

#

Maybe you'll have to require it after the client is ready?

#

I'm not quite sure

earnest phoenix
#

no i have like auto mod and i want to require different files(modules)

#

but i need them to go one by one

#

not all instantly

neat harness
#

Hmm, sorry I can't help you @earnest phoenix

earnest phoenix
#

k

neat harness
#

Unknown message means it didn't find the message by the id 770009066448879637 in the channel 741335432750694532 @earnest phoenix

#

I'm not sure of what's the cause though

#

No offense, I don't understand a single thing in that ss

#

I mean, I got confused

proven lantern
#

args.shift().toLowerCase() => args.shift().join(" ").toLowerCase()

restive furnace
#

uh strings check deletehowmuchiwant variable again

neat harness
restive furnace
#

betterdiscord detected

neat harness
#

lmao

earnest phoenix
#

ban

neat harness
#

betterdiscord detected
@restive furnace I had to CSS it

restive furnace
#

you don't have to

neat harness
#

What is let deletehowmuchiwant for?

earnest phoenix
#

How about u learn js basics first

#

@earnest phoenix

neat harness
#

I don't do videos

#

And JS is just some ez logic

tired nimbus
#

nice. I didnt know discord.js is a js guide

earnest phoenix
#

lol

neat harness
#

nice. I didnt know discord.js is a js guide
@tired nimbus I was talking about the discord.js guide not js

#

Who needs a guide for JS lmao

earnest phoenix
#

he asked for js

tired nimbus
#

why are you giving a discord.js guide

neat harness
neat harness
#

There

quiet arch
#

how do i do like that it checks if channel is nsfw so yes send an immage so no say 'this is a sfw chan goto a nsfw chan' dont ask me why tho

zenith knoll
#

oh lol
@earnest phoenix so ur making thre cmd called "Message.content.slice"?

neat harness
#

how do i do like that it checks if channel is nsfw so yes send an immage so no say 'this is a sfw chan goto a nsfw chan' dont ask me why tho
@quiet arch message.channel.nsfw returns true if it is, and false if it isn't

tired nimbus
#

The docs are so easy but no one cares

#

that should be the first thing they use or learn

neat harness
#

that should be the first thing they use or learn
@tired nimbus True

quiet arch
#
else if (command = 'pp') {
        if (message.channel.nsfw) {
        let pp = new Discord.MessageAttachment('./pepepp.jpg')
        message.channel.send('lick lick *suck*')
        message.channel.send(pp)
    } else {
        message.channel.send('no this is not a nsfw channel u dumb fugcc goto [#741679617374552114](/guild/264445053596991498/channel/741679617374552114/) ||else i wont lick my dick for u|| ')```
> @quiet arch `message.channel.nsfw` returns true if it is, and false if it isn't
@neat harness but how bc this gives me a typing err
tired nimbus
#

also about your message.channel.nsfw

#

is that discord.js?

quiet arch
#

yessssssssssssssssssssssss

#

ye

#

it is

#

its just a pic of a pepe licking his pepe dont worrie

tired nimbus
neat harness
#

Uhh yeah that above

#

@zenith knoll so like I said my friend was helping and he said to put that
@earnest phoenix I think it's absurd, but I won't judge

tired nimbus
#

oh shoot wrng link

neat harness
#

i don't think you want to use message.content.slice as the command

#

Btw, you're not even using it

#

*properly

#

and what does message.content.slice do?
@earnest phoenix as a string, it's a string

#

as a property, it slices and is a function message.content.slice()

#

so that piece of code is useless?
@earnest phoenix Not exactly, but could be way better

quiet arch
#

so like this is my err

(node:80060) UnhandledPromiseRejectionWarning: TypeError: Assignment to constant variable.
at Client.<anonymous> (D:\github\pepe-bot\index.js:98:23)
at Client.emit (events.js:314:20)
at MessageCreateAction.handle (D:\github\pepe-bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (D:\github\pepe-bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (D:\github\pepe-bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (D:\github\pepe-bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (D:\github\pepe-bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (D:\github\pepe-bot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (D:\github\pepe-bot\node_modules\ws\lib\websocket.js:797:20)
(node:80060) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:80060) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

#

and this my code

}else if (command = 'pp') {
        if (message.channel.nsfw) {
        let pp = new Discord.MessageAttachment('./pepepp.jpg')
        message.channel.send('lick lick *suck*')
        message.channel.send(pp)
    } else {
        message.channel.send('no this is not a nsfw channel u dumb fugcc goto [#741679617374552114](/guild/264445053596991498/channel/741679617374552114/) ||else i wont lick my dick for u|| ')
    }```
tired nimbus
#

so you assigned to a constant