#development

1 messages · Page 842 of 1

narrow kettle
#

always a step of 1

earnest phoenix
#

ya

#

just for loop imo

solemn harness
#

hi

#

my bot has passed 190 server's

#

on discord

#

but it's starting cause a problem

#

since it's a giveaway bot

#

it's not handling to much server's

earnest phoenix
#

?

solemn harness
#

lol

#

¯_(ツ)_/¯

spare goblet
#

wdym it has passed 190 servers and not handling "to much server's"

narrow kettle
#

cuz not all 190 servers are using it at all times

#

because its just for giveaways

slender thistle
#

@narrow kettle iterate over range(0, len(your_list)), access an element under index x and compare it to element x + 1

earnest phoenix
#

@slender thistle iterate over zip(list, list[1:])

#

smarter 😛

#

also after u sort it ofc

narrow kettle
#

thanks

golden condor
#
if (url.includes("list=")) {
          const playlist = await ytpl(url.split("list=")[1])
          const videos = playlist.items;
                if(!playlist) return message.channel.send("Playlist not found")
          for (const video of videos) await handleVideo(video, msg, voiceChannel)
      const embed = new Discord.MessageEmbed()
      .setTitle("Playlist Added to Queue")
      .setDescription(`${playlist.title} has been added to the queue. It has ${playlist.videoCount} songs`)
       .setColor("#00aaff")
      msg.channel.send(embed);

        }``` Having errors with this code and 
```js
    let song;


        song = {
            id: video.id || video.videoId,
                title: video.title,
                url: video.url || `https://www.youtube.com/watch?v=${video.videoId}`,
            author: video.author.name,
            request: msg.author.toString(),
            thumbnail: video.thumbnail,
            duration: video.duration || video.duration.timestamp
            }``` With the error:
```js
Cannot read videoId of undefined //basically tha video is undefined
``` I have no idea how to fix. Please help. Thanks in advance
earnest phoenix
#

undefined

#

generally that's a typo

#

or something you haven't set

#

also oof that indentation

pale vessel
#

or video is undefined

earnest phoenix
#

yes that

#

video is undefined

#

hmmmmm

golden condor
#

I literally put that

earnest phoenix
#

where is the variable video set

golden condor
#

The first code block

earnest phoenix
#

u don't set video there

golden condor
#

for(const video of videos)

earnest phoenix
#

only a thing inside the for loop

#

of course

golden condor
#

So

#

const video = video?

earnest phoenix
#

what

#

u have more than 1 video

golden condor
#

Yes4

#

It's a playlist manager

earnest phoenix
#

so u can't just video

#

which video

golden condor
#

The loop

#

for (const video of videos) await handleVideo(video, msg, voiceChannel)

earnest phoenix
#

or more like

#

the second snippet

#

where's that from

golden condor
#

The handleVideo function

earnest phoenix
#

ok right makes a lot more sense now

#

whats the signature like

#

function handleVideo(/* what's here? */)

spare goblet
#

uhm its obviously video, msg, voiceChannel

#

function functionName(params){

}

golden condor
#

My messagess aren't sending

tight plinth
#

show ur handleVideo function

golden condor
#

The code block won't send

tight plinth
#

it should

#

wait

spare goblet
#

its discord being whack, separate the code

tight plinth
#

this is the "blocked in dm" errro

golden condor
#

Ye ik

tight plinth
#

discord is trash

spare goblet
#

its usually cuz your message too longum

tight plinth
#

retry

golden condor
#

It is less the 2000 characters

#

I'll upload to hastebin

tight plinth
#

if message is too long discord automaticly create a txt with your message content

#

normally

golden condor
tight plinth
#
1|pichu  | 12:27:10 PM worker.1 |  Error: input stream: This video contains content from UMG, who has blocked it on copyright grounds.
1|pichu  | 12:27:10 PM worker.1 |      at /home/lumap/PichuRewrite/node_modules/ytdl-core/lib/info.js:47:25
1|pichu  | 12:27:10 PM worker.1 |      at PassThrough.<anonymous> (/home/lumap/PichuRewrite/node_modules/miniget/dist/index.js:196:32)
1|pichu  | 12:27:10 PM worker.1 |      at PassThrough.emit (events.js:316:20)
1|pichu  | 12:27:10 PM worker.1 |      at endReadableNT (_stream_readable.js:1201:12)
1|pichu  | 12:27:10 PM worker.1 |      at processTicksAndRejections (internal/process/task_queues.js:84:21)
1|pichu  | 12:47:32 PM worker.1 |  Error: input stream: This video is no longer available because the YouTube account associated with this video has been terminated.
1|pichu  | 12:47:32 PM worker.1 |      at /home/lumap/PichuRewrite/node_modules/ytdl-core/lib/info.js:47:25
1|pichu  | 12:47:32 PM worker.1 |      at PassThrough.<anonymous> (/home/lumap/PichuRewrite/node_modules/miniget/dist/index.js:196:32)
1|pichu  | 12:47:32 PM worker.1 |      at PassThrough.emit (events.js:316:20)
1|pichu  | 12:47:32 PM worker.1 |      at endReadableNT (_stream_readable.js:1201:12)
1|pichu  | 12:47:32 PM worker.1 |      at processTicksAndRejections (internal/process/task_queues.js:84:21)```how can I handle these errors with ytdl
golden condor
#

@tight plinth did you see if there is any errors with my handle video?

tight plinth
#

I dont see any

#

this

golden condor
#

What is the problem with that

high bough
#

Umm, does anyone know how to make a specific command usable by only the owner of a bot?

#

I have config.ownerId

#

I tried

if (message.author.id !== config.ownerID)

I didn't think it worked

golden condor
#

Should work

finite bough
#

it should work

golden condor
#

This is mine for the eval command

finite bough
#

if it doesnt and no errors

golden condor
high bough
#

hmm....

finite bough
golden condor
high bough
#

This is what I'm using it for

 if (command === "restart") {
    const embed = new Discord.RichEmbed().setDescription(
      `Restarted in: **${Math.round(client.ping)}**ms`
    );

    if (message.author.id !== config.ownerID) {
      const NotAllowedEmbed = new Discord.RichEmbed().setDescription(
        `Not enough permission, you cannot Restart ${client.user.tag}!`
      );
      message.channel.send(NotAllowedEmbed);
    }
    message.channel
      .send(embed)
      .then(() => client.destroy())
      .then(() => client.login(config.token));
  }
finite bough
#

cx is ur videoID defined

golden condor
#

Yes

finite bough
#

check using console

golden condor
#

It works on a singular song

#

But not on playlists

finite bough
#

probably coz playlist is an array

golden condor
#

But look at the loop

#

I've tested with eval

finite bough
#

@high bough have u tried the code?

#

brb

golden condor
high bough
#

@high bough have u tried the code?
@finite bough I'll give another line of my code, cuz IDK if it really works or not, but this one practically doesn't work.

if (command === "suc") {
    if (message.author.id !== config.ownerID) {
      const NLembed = new Discord.RichEmbed()
        .setAuthor(
          "Mineko",
          "https://cdn.discordapp.com/avatars/683597011693469698/d9733c732d874e5137a9738b21d54acd.png"
        )
        .setColor([173, 216, 230])
        .setDesription("Cannot show `Dev-Special` Commands")
        .setFooter(
          "©Mineko | v1.5.2 Beta | 12 Total Commands",
          "https://cdn.discordapp.com/avatars/683597011693469698/d9733c732d874e5137a9738b21d54acd.png"
        );
      message.channel.send({ NLembed });
    } else {
      const embed = new Discord.RichEmbed()
        .setAuthor(
          "Mineko",
          "https://cdn.discordapp.com/avatars/683597011693469698/d9733c732d874e5137a9738b21d54acd.png"
        )
        .setColor([173, 216, 230])
        .addField("**Unlisted Commands**", "`restart`, `botping`, `listservers`")
        .setFooter(
          "©Mineko | v1.5.2 Beta | 12 Total Commands",
          "https://cdn.discordapp.com/avatars/683597011693469698/d9733c732d874e5137a9738b21d54acd.png"
        );
      message.channel.send({ embed });
    }
  }
golden condor
#

if (message.author.id != config.ownerid) return message.channel.send("You cannot use this!");

#

That's what I got

#

What is your config.ownerId defined as in config.json

high bough
#

Yes

#

It's

#

683577627948351512

#

But even with my friend's acc, I can still use the command

#

With the one i specified above, I can't use the command, but it doesn't show anything, even though i set it to embed

golden condor
#

Use my one

#

see if that works

#

discord.js?

finite bough
#

@high bough have u logged config.ownerID?

high bough
#

Yes

golden condor
#

@woven sundial you have defined invites twice, once in your loop so the code is confused

#

Try this

#
invites.forEach(function(invite) {
        possibleinvites.push(`${invite.inviter.username} ||  ${invite.uses}`)
    })```
finite bough
#

@high bough what are u trying to do

golden condor
#

@woven sundial I get it

#
invites.forEach(function(invite) {
        possibleinvites.push(`${invite.inviter.user.username} ||  ${invite.uses}`)
    })```
#

I just checked the docs

#

That's what you are supposed to do

#

I think

quartz kindle
#

inviter is undefined

#

you should console.log(invite)

golden condor
#

inviter is a user type

finite bough
#

^

golden condor
#

You could get their id and find the user via the guild

#

Log invite

#

console.log(invite)

#

Entire error?

finite bough
#

12v?

golden condor
#

Yeah u v12?

finite bough
#

waits

golden condor
#

Exactly

#

inviter.User.username

finite bough
#

wut

#

yes

#

User

golden condor
#

Yes

#

invite.inviter.User.username

high bough
#

@high bough what are u trying to do
@finite bough Sorrt, I was eating, anyway, I was trying to make the command

const embed = new Discord.RichEmbed()
        .setAuthor(
          "Mineko",
          "https://cdn.discordapp.com/avatars/683597011693469698/d9733c732d874e5137a9738b21d54acd.png"
        )
        .setColor([173, 216, 230])
        .addField("**Unlisted Commands**", "`restart`, `botping`, `listservers`")
        .setFooter(
          "©Mineko | v1.5.2 Beta | 12 Total Commands",
          "https://cdn.discordapp.com/avatars/683597011693469698/d9733c732d874e5137a9738b21d54acd.png"
        );
      message.channel.send({ embed });
```run if i was the owner, and
```js
const NLembed = new Discord.RichEmbed()
        .setAuthor(
          "Mineko",
          "https://cdn.discordapp.com/avatars/683597011693469698/d9733c732d874e5137a9738b21d54acd.png"
        )
        .setColor([173, 216, 230])
        .setDesription("Cannot show `Dev-Special` Commands")
        .setFooter(
          "©Mineko | v1.5.2 Beta | 12 Total Commands",
          "https://cdn.discordapp.com/avatars/683597011693469698/d9733c732d874e5137a9738b21d54acd.png"
        );
      message.channel.send({ NLembed });
```run if otherwise.
golden condor
#

Log invite.inviter

finite bough
#

icero

#

what version

golden condor
#

Log invite.inviter

finite bough
#

d.js

golden condor
#

Fuck

earnest phoenix
#

how can i get attachment url from collector?

high bough
quartz kindle
#

@woven sundial one of the invites has no user

#

this means the field is nullable, which means it doesnt always return a user

#

there are invites without users

#

so you need to check if the invite has a user before trying to get his username

tight plinth
#

so ytdl stops playing 90% of my songs when they hit 2-3 min, forced to skip. why

high bough
#

If I'm using ```js
if (message.author.id !== config.ownerID)

```js
{
   "ownerID": "683577627948351512", "4324234234242342", "2342342423424234243"
}
```?
#

how...

#

Yes

narrow kettle
#

[python] I got an error in this code(a bot that checks it tells me) but i have no idea what is the problem?

def who_is_missing(file_name):
  fille = open(file_name, 'r')
  my_list = [line.split(',') for line in fille.readlines()]
  my_list.sort()
  count = 0
  for x in my_list:
    if (count - x) != 1:
      x = len(my_list)
    count += 1
  my_list.append(count)
  my_list.sort()
  return count

path = input("Please Enter a File Path: ")
high bough
#

Oh I see, thanks

#

Oh ok

narrow kettle
#

hey so, i have a list, how an i take that list and write it into a new text file? (python)

modest maple
#

if they all have \n in each text element

#

you can jsut do file.writelines(list)

narrow kettle
#

they dont have \n in each one

#

but i can just add it in a loop i guess

#

for x in my_list:
if x == x:
break

#

ops

#

does that break the for loop?

cursive dagger
#

You could use json there

#

Yeah

narrow kettle
#

oki thanks

opaque kite
#

so ytdl stops playing 90% of my songs when they hit 2-3 min, forced to skip. why @tight plinth is that bug?

tight plinth
#

yes

fresh hatch
#

could someone pls help me make a ping command with latency and api with d.js ?

opaque kite
#

Cause it's also happened to me 🤮

tight plinth
#

oof

fresh hatch
#

someone pls help me

opaque kite
#

@fresh hatch

fresh hatch
#

i said not to reply with Pong!

#

and replay with latency and api ping

earnest phoenix
#

@fresh hatch with discord.js you said?

fresh hatch
#

making it to reply with pong is as easy as shit

client.on('message', message => {
    if (message.content.startsWith(`${prefix}ping`)) {
        message.channel.send("Pong~")
    }
})
#

yes

earnest phoenix
#

@fresh hatch lemme show ya

fresh hatch
#

thx

opaque kite
#

U mean "internet speed test" or something?

earnest phoenix
sterile minnow
#

wrong channel

#

sorry

fresh hatch
#

thx

earnest phoenix
#

Np

golden condor
fresh hatch
#

@earnest phoenix i'm using async not await

earnest phoenix
#

Lemme take a look at that for a second

#

@fresh hatch doesn't matter add an await before:
message.channel.send('🏓 Pinging...')
And you see that there's a line called (bot.ws.ping)?
Change the bot to Client

fresh hatch
#

ok

golden condor
#

Can anyone help me

#

client.on('message', async message => {

#

@fresh hatch

earnest phoenix
#

@fresh hatch put a async after that 'message',

#

Just like @golden condor said ↑

cinder patio
#

Also you should listen to the message event only once

golden condor
#

Pls someone help me

#

I have spent ages tryna digure this out

fresh hatch
cinder patio
#

you need to await the message

#

by putting await before the function call

fresh hatch
cinder patio
#

yes

earnest phoenix
#

@fresh hatch i found out the error

#

You see the Client you put in there?

fresh hatch
#

yes

earnest phoenix
#

Change it to client without a capitalized C

fresh hatch
#

shit im so dumb

earnest phoenix
#

Lmao

golden condor
#

c-p Balance ton porc chilla

fresh hatch
#

shit i cant declare values the right way

earnest phoenix
#

Wait it says NaN?

fresh hatch
#

the latency

cinder patio
#

It's createdTimestamp

earnest phoenix
#

@fresh hatch change the pmsg.createTimestamp - message.createTimestamp
create to created

fresh hatch
earnest phoenix
#

Np

golden condor
#

[DISCORD.JS V12] My playlist handler will not work, been tryna fix all day. Please help if you can. Thanks in advance
https://hastebin.com/alubojoham.js
Imma bout to lose my mind here

cinder patio
#

what is the error?

#

how can we help if we don't know what's wrong

fresh hatch
modest maple
#

you cant...

#

if you mean just not get the tag

fresh hatch
#

someone pls help

quartz kindle
#

read the error

#

args is not defined

fresh hatch
#

how do i define it?

quartz kindle
#

you create it

fresh hatch
#
const args = "what the value should be?"
quartz kindle
#

yes

fresh hatch
#

what the value should be?

quartz kindle
#

you're supposed to know, not me

#

did you copy that from somewhere?

fresh hatch
#

i learned from yt

cinder patio
#

are you sure you learnt

quartz kindle
#

watch again the part on how to create args

solemn quartz
#

@fresh hatch so ur trying to do the args?

#

@fresh hatch if you need args you can use this
"let args = message.content.substring(Prefix.length).split(" ");"

fresh hatch
quartz kindle
#

hes showing you how to use it as a exported command

#

on which his args are created before being passed to it

fresh hatch
modest maple
#

have you tried

#

finishing

#

the tutorial

#

before

quartz kindle
#

you cant copy paste code and expect it to work

solemn quartz
#

lol

modest maple
#

you actually jump into somthing which is quite advanced

solemn quartz
#

i started from yt too but now i do all myself

#

(too if sometimes i ask to you guys : D)

quartz kindle
#

programming is extremely strict, you have to make your own code, because other people's code was made specifically to fit their exact use case and it will not work for you if you dont at least adapt it to fit your code

modest maple
#

i just read the docs :P

solemn quartz
#

lol

#

me too sometimes

#

But the most of the times i just know what im doing

#

@fresh hatch did you do "const Prefix = '(your prefix)'" ?

#

if you dont do that my let args will not work

#

cuz he doesnt recognize "Prefix"

fresh hatch
#

i declared the prefix in config.json

solemn quartz
#

Nah

#

Do the const

#

its more easy

#

lol

earnest phoenix
#

@fresh hatch umm Prefix to prefix maybe?

solemn quartz
#

Can u send me a screen of how you writed "Prefix"?

#

Cuz if you writed "PREFIX" for exapmple, it will not work

fresh hatch
#

you will see my token

solemn quartz
#

Cover that

fresh hatch
#

ok..

quartz kindle
#

variable names are case sensitive. if you declared a variable called prefix you cannot use it as Prefix

solemn quartz
#

Yea

earnest phoenix
#

@fresh hatch did you write Prefix or prefix?

solemn quartz
#

lol

quartz kindle
#

exapmple

earnest phoenix
#

Lel

solemn quartz
fresh hatch
marble juniper
#

bruh

fresh hatch
#

i declared the prefix right now

solemn quartz
fresh hatch
earnest phoenix
#

@fresh hatch =>
discord.MessageEmbed()

solemn quartz
#

Do "const prefix = '.';"

#

like that

earnest phoenix
#

@solemn quartz it says in the console.error => discord.RichEmbed() is not a constructor

#

So it should be discord.MessageEmbed()

solemn quartz
#

oh

#

shit

#

nope

earnest phoenix
#

What...

solemn quartz
#

maybe he did "const Discord = bla bla bla"

fresh hatch
solemn quartz
#

and he did "new discord.RichEmbed()"

fresh hatch
solemn quartz
#

bro

#

from what yter did you see that?

earnest phoenix
#

@fresh hatch could you show us the code of the command 8ball?

fresh hatch
#

{TheSourceCode}

solemn quartz
#

i dont think it is the best youtuber ever but ok

quartz kindle
#

RichEmbed does not exist in discord.js v12

solemn quartz
#

For starting i used "CodeLyon"

#

it is really easy

earnest phoenix
#

@fresh hatch the reason you're messing up is because his tutorials are old

quartz kindle
#

which version of discord.js are you using?

solemn quartz
#

hmmmmmmmmmmm

#

say in console "node -v" @fresh hatch

fresh hatch
earnest phoenix
#

@solemn quartz we didn't meant the node module's version

quartz kindle
#

thats node version, not discord.js version

#

npm ls discord.js

solemn quartz
#

hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

fresh hatch
solemn quartz
#

and it is gud

quartz kindle
#

discord.js v12.1.1

#

so the correct is MessageEmbed()

earnest phoenix
#

Wait 12.1.1? I've never seen that before

fresh hatch
#

i downloaded it yerstday

#

because i reinstalled windows 10

earnest phoenix
#

Hmm mine is 12.0.2

quartz kindle
#

12.1.1 was released a couple days ago

earnest phoenix
#

@fresh hatch show us the code of the command 8ball

solemn quartz
#

hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

fresh hatch
solemn quartz
#

wait what

quartz kindle
#

@fresh hatch the reason your bot is spamming is because you dont do any check for what the message should start with

#

your bot is gonna reply to ALL messages

solemn quartz
#

is your pc's name "Web"?

fresh hatch
#

no

#

the folder is inside a folder

solemn quartz
fresh hatch
#

i forgot to move it

earnest phoenix
#

@fresh hatch wait a second... Why do you have (( in the Math code line?

fresh hatch
#

fixed it

earnest phoenix
#

Hmm... Is it working now?

fresh hatch
#

spams it with all the 3 answers

solemn quartz
#

where the fuck is the Math.floor code line?

fresh hatch
#

its math

#

lmao

#

i cant read

#

i read what is math.floor

earnest phoenix
#

@fresh hatch do you have a code called:
if (message.user.bot) return;
In the message event?

solemn quartz
#

THIS IS THE UGLIEST THING I EVER SEEN

earnest phoenix
#

And that should be =>
Math.floor(Math.random()*replies.length)

fresh hatch
#

where do i put it @earnest phoenix

#

?

earnest phoenix
#

@fresh hatch wait

solemn quartz
#

it is "const result = replies[Math.floor(Math.random() * replies.length)]"

#

i do that like this ^

earnest phoenix
#

Why are you Creating hundreds of message events?

fresh hatch
earnest phoenix
#

Only one is enough

#

Lemme show you something real quick...

solemn quartz
#

@fresh hatch try this const result = replies[Math.floor(Math.random() * replies.length)]

#

i messed it up last time

#

cuz i copied from my code and i forgot to edit a thing

#

so it didnt worked

quartz kindle
#

did he at least add a check for command name? otherwise his bot is gonna reply to ALL messages, regardless of commands

fresh hatch
quartz kindle
#

see?

#

you didnt add a check like i told you

fresh hatch
#

how do i add check

golden condor
#

(node:6380) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'end' of null
at Object.run (C:\Users\t\Documents\app\commands\skip.js:23:35)

solemn quartz
earnest phoenix
solemn quartz
#

so u could do "Client.login(token)"

quartz kindle
solemn quartz
#

who?

#

Infinity?

fresh hatch
#

self-hosting

earnest phoenix
#

Self-hosting is a pro gamer move

karmic viper
#
 dbl.getStats("id").then(stats => {
#

where is the my id

marble juniper
#

@fresh hatch you can use if staments

if (condition) //action after condition is met
quartz kindle
#

@karmic viper you mean your bot's id?

earnest phoenix
#

@karmic viper id = ur bots client id xD

karmic viper
#

shit

#

😄

solemn quartz
earnest phoenix
#

@fresh hatch and make sure to add:
if (message.author.bot) return;
Under the message event

solemn quartz
#

why?

#

oh right

#

nvm

earnest phoenix
#

Lol because the bot responds to itself

solemn quartz
#

yea ik

#

i forgot in that moment

earnest phoenix
#

It's ok lol

fresh hatch
#

look at the terminal

karmic viper
#
(node:1963) UnhandledPromiseRejectionWarning: Error: 404 Not Found
    at IncomingMessage.res.on (/rbd/pnpm-volume/1199ff33-6e23-4fde-89e5-eeb204fa56f1/node_modules/.registry.npmjs.org/dblapi.js/2.3.0/node_modules/dblapi.js/src/index.js:118:25)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:139:11)
    at process._tickCallback (internal/process/next_tick.js:181:9)
(node:1963) 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(). (rejection id: 4)
#

What is Problem bros

earnest phoenix
#

@fresh hatch you need to use:
if (message.author.bot) return;
Instead of that

golden condor
#

(node:6380) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'end' of null

pale vessel
#

what

golden condor
#

hep

pale vessel
#

no context

#

how the hell would we be able to help

golden condor
#

I was uplodaing to hastebin

fresh hatch
golden condor
#
serverQueue.connection.dispatcher.end('Skip command has been used!');``` Skip command causes error
#

Have tested with the search commn

#

and it works

#

It is only there with the play command

earnest phoenix
#

@fresh hatch np

golden condor
pale vessel
#

that's not the file

golden condor
pale vessel
#

there's no dispatcher.end in that file smh

golden condor
#

It's in skip

#

But it isn't skip that causes the erro

pale vessel
#

then send that one

#

hmm

golden condor
#

As skip works

fresh hatch
#

how do i run all files with nodejs?

#

someone pls help

earnest phoenix
#

@fresh hatch type in node .

fresh hatch
#

thx

earnest phoenix
#

Np

fresh hatch
#

it din't run my 8ball.js

karmic viper
#

help me pls

earnest phoenix
#

Huh does the console.log say anything? @fresh hatch

fresh hatch
#

only Ready from index.js

earnest phoenix
#

Hmm... Hmm lemme check

#

@fresh hatch does it run the help.js?

fresh hatch
#

nope

earnest phoenix
#

When you use 8ball command it doesn't work?

fresh hatch
#

yes

earnest phoenix
#

tf is that indentation

#

@fresh hatch that yes means it doesn't work or it does lol?

fresh hatch
#

i doesn't

earnest phoenix
#

Wait lemme check that brb

heavy anchor
#

do I have something wrong with this

console.log(`${bot.user.tag} is online in ${bot.guilds.size}`);

it says KnightBot#3056 is online in undefined

earnest phoenix
#

@heavy anchor bot.guilds.size needs to be =>
bot.guilds.cache.size

solemn quartz
#

is it in 0 guilds ( ͡° ͜ʖ ͡°) @heavy anchor

heavy anchor
#

no lol its in Several

solemn quartz
#

( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°)

earnest phoenix
#

@fresh hatch i have no idea why it doesn't work... I searched for that but no solution

golden condor
heavy anchor
#

ok that worked thx @earnest phoenix discord.js v12 must be different

golden condor
#

It is

earnest phoenix
#

@heavy anchor np

solemn quartz
#

( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°)
( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°) ( ͡° ͜ʖ ͡°)( ͡° ͜ʖ ͡°)

pale vessel
#

shitposts in off topic bruh

solemn quartz
#

|c

earnest phoenix
#

.urban lenny

quartz hill
#

When I mention someone, I want to write a command waiting for that person to reply. But I couldn't figure out how to wait for the second message. While doing this, I cannot mark the same person with this command twice. (discordjs)
Is there a short sample code?

earnest phoenix
#

MessageCollectors

#

but i wont spoonfeed code

#

you need to have 2 messagecollectors

#

not just 1

#

and a filter to make sure it's the same user that responded the first time

quartz kindle
#

one should be enough no? unless i didnt understand what he wants

quartz hill
#

It looks a bit complicated. hmm

quartz kindle
#

just needs a global state

earnest phoenix
quartz hill
#

but I use v11

earnest phoenix
#

hold on

quartz kindle
#

message collectors should be the same in v11

earnest phoenix
#

just change the v12 to v11 :p

quartz hill
#

ok 😄

#

thx

earnest phoenix
#

mhm

pale vessel
#

the options are different though

golden condor
earnest phoenix
#

i use v11 :p

#

what is your library

#

im just lazy

#

nvm

heavy anchor
#

Does this look right?

pale vessel
#

looks fine

earnest phoenix
#

looks fine

heavy anchor
#
var ping_time = Date.now()
         msg.channel.send('Pong!').then(m => {
m.edit('Pong! ' + (Date.now() - ping_time) + `ms 🏓`);
         });
#

lol

earnest phoenix
#

anything wrong with it when sending the msg, errors?

heavy anchor
#

no

earnest phoenix
#

then why are you asking-

pale vessel
#

ikr

#

like wht

earnest phoenix
#

also u should use `` for formatting

#

since it might send NaN

heavy anchor
#

bc idk if the time is Accurate

pale vessel
#

template literals

copper cradle
earnest phoenix
#

omg thats so hot

#

im using this all the time

#
var ping_time = Date.now()
         msg.channel.send('Pong!').then(m => {
m.edit(`Pong! ${(Date.now() - ping_time)}ms 🏓`);
});
#

@heavy anchor

#

as i said it might return NaN if you do it the way you did

#

(or just put it in an embed but yknow thats l a z y)

heavy anchor
#

it returns a number i just don't know if thats the most accurate way to do it

#

anyway no big deal

earnest phoenix
#

it does?

#

sorcery

#

my bot doesn't TohruShrug

heavy anchor
earnest phoenix
#

koolio

heavy anchor
#

lul

cinder patio
#

babel is one of the most annoying tools I've ever used

fresh hatch
#

does anyone know how do i run all the files in the same time with nodejs?

#

because node . doesn't work for me, it only executes index.js

quartz kindle
#

thats not what you want to achieve

#

if you run multiple files independently, they cannot talk to each other, it will be completely separate programs

#

what you probably want is load other files from your main file

#

you can achieve that using require and module.exports

fresh hatch
#

how do i do that?

quartz kindle
#
// main file
let something = require("./otherfile.js")

// otherfile.js
module.exports = something```
jovial nexus
#

how can i do that when i write a command the bot joins my voice chanel and reproduces an specific song?

earnest phoenix
#

It doesn't have one answer and takes time

#

But I think it has something to do with an NPM install

hearty jetty
#

How can i change my bot's status like dnd or online for top.gg?

earnest phoenix
#

now ???

#

you can put custom statuses like this

raven urchin
#

I need help on how to show the servers the bot is in on dbl

earnest phoenix
#

@hearty jetty


    client.user.setPresence({
        status: "online",
        game: {
            name:  `${client.guilds.size} Servers | /help`,
            type: "WATCHING"
        }
    }); 
});```
#

you can change the online to idle

#

and the name: is the custom status so for @gilded plank the name is Discord Bots

hearty jetty
earnest phoenix
#

OHHH

hearty jetty
#

i know this.

earnest phoenix
#

bruh

#

😐

hearty jetty
#

bruh

earnest phoenix
#

my bad

#

bruh momento

#

lmao

#

i misread that

hearty jetty
#

are u know?

earnest phoenix
#

ok

#

excuse me but for top.gg it should just import what your bot has

#

so if your bot is online it says online and if your bot's status is idle it should say idle

slender thistle
#

That's what it does

hearty jetty
#

but this is not updated for a long time.

slender thistle
#

If something on your bot page is not updating, try force editing

hearty jetty
#

My bot is online but for top.gg is: ???

slender thistle
#

Ah

earnest phoenix
#

Because your bot has not been accepted yet

slender thistle
#

Your bot's is not in this server

hearty jetty
#

bruh

#

How can i add the bot?

#

please help

slender thistle
hearty jetty
earnest phoenix
#

well then you must wait

raven urchin
#

I kinda need help on how to show how many servers the bot is in on top.gg

earnest phoenix
#

the web mods are reviewing applications everyday

#

@raven urchin do not take my word for this but it's either you must type the server id in or it automatically shows the DSL servers

slender thistle
#

What's your bot's library, ZeroNation?

modest maple
#

@earnest phoenix for bots they need the api

raven urchin
#

@shivaco#0001 d.js

#

@slender thistle

#

Nice ping I made.

slender thistle
#

You can use dblapi.js

earnest phoenix
#

I need help

#

When I go to the terminal in visual studio to see if i can turn on my bot

pale vessel
#

then say what you need help with

earnest phoenix
#

i type node .

#

and it gives me this

raven urchin
earnest phoenix
#

hello?

slender thistle
#

@raven urchin Did you pass your client to DBL constructor?

earnest phoenix
#
(node:16) UnhandledPromiseRejectionWarning: RangeError: Invalid permission string or number.
at Function.resolve (/home/container/node_modules/discord.js/src/util/Permissions.js:195:65)
at Permissions.has (/home/container/node_modules/discord.js/src/util/Permissions.js:62:35)
at Role.hasPermission (/home/container/node_modules/discord.js/src/structures/Role.js:171:46)
at /home/container/node_modules/discord.js/src/structures/GuildMember.js:321:35
at Map.some (/home/container/node_modules/discord.js/src/util/Collection.js:357:11)
at GuildMember.hasPermission (/home/container/node_modules/discord.js/src/structures/GuildMember.js:321:23)
at Object.execute (/home/container/commands/Moderation/tmute.js:12:19)
at Client.<anonymous> (/home/container/index.js:143:13)
at Client.emit (events.js:311:20)
at MessageCreateHandler.handle (/home/container/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
(node:16) 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:16) [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.

I tried understanding this error but i cant; can somebody tell me what line this is on?

#

and a bot just DM'd me

#

im scared

raven urchin
#

@slender thistle how do I do that?

slender thistle
#

@earnest phoenix node.js isn't installed it seems

earnest phoenix
#

i did

tight plinth
#

@earnest phoenix show the bot who dms u

earnest phoenix
#

i didnt even dm him p.p

slender thistle
mossy vine
#

@zinc sluice

earnest phoenix
#

i didnt ping em either

tight plinth
#

sec

earnest phoenix
#

@zinc sluice

raven urchin
#

I did that @slender thistle

tight plinth
#
test```
#

hm

earnest phoenix
#

i did XL

slender thistle
#

Is client in DBL arguments?

earnest phoenix
#
"hi"
#
node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a 
path was included, verify that the path is correct and try again.
At line:1 char:2
+  node .
+  ~~~~
    + CategoryInfo          : ObjectNotFound: (node:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

``` What did I do wrong?
tight plinth
#

going to repost ur message to saa

mossy vine
#

@earnest phoenix node is not installed

raven urchin
#

@slender thistle yeah

slender thistle
#

Then you're good

tight plinth
#

@earnest phoenix the node command doesnt exist for ur cmd

earnest phoenix
#

can somebody still tell me what line the error is on-

tight plinth
raven urchin
#

It just says NA

earnest phoenix
#

tx

#

how do i install node into visual studio?

#

did hasPermission() change in v11

tight plinth
#

u have to install it on ur pc

#

idk

earnest phoenix
#
if(person.hasPermission("MANGAGE_MESSAGES")) return message.reply("I can't mute that user!")
#

thats the error

#

hmm

tight plinth
#

MANGAGE_MESSAGES --> MANAGE_MESSAGES

#

typo error

earnest phoenix
#

oh

#

mb

#

im dumb

#

thx

tight plinth
#

it happens sometimes

#

np

earnest phoenix
#
node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a 
path was included, verify that the path is correct and try again.
At line:1 char:2
+  node .
+  ~~~~
    + CategoryInfo          : ObjectNotFound: (node:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException``` I have Node installed, but it says it cant find it
raven urchin
#

Just says NA even tho I have the server count part

tight plinth
#

@raven urchin wait for a update
@earnest phoenix well no

earnest phoenix
#

?

raven urchin
#

Yikes

tight plinth
#

its not installed

pale vessel
#

why did you censor the bot name?

earnest phoenix
#

i have it tho

tight plinth
#

launch ur bot from this cmd

raven urchin
#

Don't wanna promote the bot :/

pale vessel
#

they're just words

#

ok

tight plinth
#

if its not meant to be ad u can show bot name

pale vessel
#

here have a vote

raven urchin
#

Oh

#

Oh my

pale vessel
#

2 votes actually

raven urchin
tight plinth
#

wait

crimson vapor
#

umm

earnest phoenix
#

damn hosting from a phone

crimson vapor
#

no glitch

raven urchin
#

Don't bully....

tight plinth
#

u have to post dbl code into ur index.js

crimson vapor
#

^

raven urchin
#

@tight plinth ah okay, didn't know

tight plinth
#

not another file

crimson vapor
#

or use a module.exports like I do

tight plinth
#

index.js better

raven urchin
#

I use module.exports = { @crimson vapor

zenith terrace
#

I put it in my message event

crimson vapor
#

Why lol

#

oh

#

like that other kid

raven urchin
#

Oh my, where in the index.js do I put it?

tight plinth
#

where you want, outside of a event

crimson vapor
#

normally add it to just under the declaration of client or at the bottom

#

I think it needs to be under login

#

im not too sure since I use a modified client

raven urchin
#

This is the bottom of index

tight plinth
#

try to put it before client.login

raven urchin
#

So on top of it?

clever hollow
#

Hi guys, i want to create a Question-Answer bot for my channel. But, idk how can it possible ? So any1 can help me ?

crimson vapor
#

you could use an API like wolfram or something

tight plinth
#

everything is possible

#

So on top of it?
@raven urchin yep

pale vessel
#

isn't wolfram minecraft hack?

crimson vapor
#

umm

#

well yes but no

raven urchin
tight plinth
#

this should work,ye

raven urchin
#

It works! Thank you very much

tight plinth
#

np

raven urchin
#

Sorry if I was being too much

crimson vapor
#

you arent nearly as bad as some people

raven urchin
#

I'm just trying to learn you know

finite bough
#

let some_people = ["message.author.displayName", "x", "y"]

pale vessel
#

don't put it in quotes lol

tight plinth
#

whats the simplest way to do cooldowns?

finite bough
#

depends what the cooldown is for

tight plinth
#

server/user cooldown between commands

lucid pasture
#

can someone tell me how to intergrate a image search api into my bot?

tight plinth
#

can someone tell me how to intergrate a image search api into my bot?
@lucid pasture google

#

read api docs

pale vessel
#

make an object with servers maybe

lucid pasture
#

k

finite bough
#

@tight plinth set timeout i suppose

#

i found a code a long time ago

#

this might help u out

tight plinth
#

setinterval?

finite bough
#
const talkedRecently = new Set();

// -- This part of the code is covered up by the notepad window --

var prefix = config.prefix;

client.on("message", (message) => {
  if (talkedRecently.has(message.author.id)) {
    message.channel.send("Cooldown 20 sec");
    message.delete();
    return;
  }

  talkedRecently.add(message.author.id);
  setTimeout(() => {
    talkedRecently.delete(message.author.id);
  }, 20000);

  if (message.content.startsWith("-help")) {
    message.channel.send("-r33 (Nissan Skyline) [[Add the rest of the line here]]");
  }
})
tight plinth
#

I didnt know the estsietnce of Set()

#

whats dat

crimson vapor
#

kinda like array I think

finite bough
#

^

tight plinth
#

seems logic

#

'll try dat

finite bough
#

1% chance it will work

#

gl

#

xD

tight plinth
#

it will

finite bough
#

i said that coz

#

i think i found that on reddit

tight plinth
#

server cooldown or user cooldown

#

I got th idea

mossy vine
#

set is basically a list but no ordering

finite bough
#

u can order a set right?

earnest phoenix
#
(node:16) DeprecationWarning: Collection#find: pass a function instead

returns this error and it wont go forward or even mute the user if that makes sense

finite bough
#

it seems possible i mean

earnest phoenix
#

is that a fatal error

mossy vine
#

a set does not keep track of the items orders

finite bough
#

like when we are sending it

#

or logging it

#

we can arrange it

#

right?

mossy vine
#

oh wait what Set.entires() and .keys() is a thing wtf

#

aight nvm what i said

crimson vapor
#

@earnest phoenix show the code of your mute command

narrow kettle
#

[python] so i need to make a function that gets a text file with a name of a song, the name of the guy/band who made the song and the length of the song, and between each one there is a ;(there is a few lines, each one is a different song and different length(song writer can be the same). the function takes that file and makes a tuple which contains the longest song, number of songs and the band/singer who have the most songs on the file(its graunted there is one). i know how to do the number of songs, but no idea about the rest, ill send examples of the file and the function, srry for the long message

earnest phoenix
#

ok

narrow kettle
earnest phoenix
#
const ms = require('ms')
module.exports = {
    name: "tempmute",
    desc: "Temporarily mute someone.",
    usage: "<mention> <time>",
    cooldown: 5,
    execute: async (message, args) => {
        //.tempmute @user 1s/1m/1h/1d
        
        let person = message.mentions.members.first()
        if(!person) return message.reply("Couldn't find that user.")
        if(person.hasPermission("MANAGE_MESSAGES")) return message.reply("I can't mute that user!")
        let muterole = message.guild.roles.find(`name`, "muted")
        if(!muterole){
            //start of creating the role
            try{
                muterole = await message.guild.createRole({
                    name: "muted",
                    permissions: []
                })
                message.guild.channels.forEach(async (channel,id) =>{
                    await channel.overwritePermission(muterole,{
                        "SEND_MESSAGES": false,
                        "ADD_REACTIONS": false
                    })
                })
            }catch(e){
                console.log(e.stack)
            }
            //end of creating the role
            let mutetime = args[1];
            if(!mutetime) return message.reply("You didn't specify a time!")
            
            
            await person.addRole(muterole.id)
            message.reply(`<@${person.id}> has been muted for ${ms(mutetime)}`)
            setTimeout(function(){
                person.removeRole(muterole.id)
                message.channel.send(`<@${person.id}> has been unmuted after ${ms(mutetime)}.`)
            },ms(mutetime))
        }
        
    }
}

@crimson vapor

narrow kettle
#

that was way longer than i expected

crimson vapor
#

ye

earnest phoenix
#

also phantom bot sent me a DM again

#

3.3

crimson vapor
#

@earnest phoenix I see what you did, change let muterole = message.guild.roles.find("name", "muted") to `let muterole = message.guild.roles.find(m => m.name == "muted")

earnest phoenix
#

Ca Someone Help

tight plinth
#

guess what

earnest phoenix
#

oh oki thanks

tight plinth
#

it work

finite bough
#

LOL

#

@tight plinth highfive

tight plinth
#

:highfive:

finite bough
#

you dont have nitro, you can send animated emojies and server emojies in different servers, set animated profile pictures and custom tags and more, try out now!

tight plinth
#

coz

earnest phoenix
#

@crimson vapor

crimson vapor
#

ye

earnest phoenix
#

it just wont add the role

#

send the verification message

#

or send the unmuted verification message

#

no errors

#

and the muted role gets created

#

are you sure you have perms to add the role

#

mhm

#

and that you're respecting the hierarchy

crimson vapor
#

^

earnest phoenix
#

yes, bot is highest rank

#

who are you trying to mute

finite bough
#

not ur rank, bot rank*

earnest phoenix
#

ik

#

bot rank is under mine

#

a person with no roles

#

i can't tell you anything else but to debug

finite bough
#

a bot can add roles to anyone even the owner

earnest phoenix
#

however

#

my muted role is last in the role list

#

will that

#

do something p/.p

finite bough
#

yes

#

if a role has permission to send messages differently

#

it will overwrite the mute role's perms

#

but

#

if all roles are set to /

earnest phoenix
#

(the person has no rolez)

#

instead of guessing literally debug

#

go through your code

restive night
#

hey guys i need help.
i want this string hello. world splitted into array like this ['hello', '.', 'world'] what regex do i need in split function?

tight plinth
#

put the muted role at the top of the hierarchy

crimson vapor
#

well split at spaces is average so idk

tight plinth
#

hey guys i need help.
i want this string hello. world splitted into array like this ['hello', '.', 'world'] what regex do i need in split function?
@restive night can you?

#

u can do .split(' ') to get ['hello.','world']

earnest phoenix
#

putting it at top didnt work

finite bough
#

and .trim()

#

its always useful

restive night
#

but i want that . also include in array

tight plinth
#

hm

#

why

earnest phoenix
#

why do you keep avoiding the fact that i'm telling you to DEBUG, which if you had done, you would've identified your problem already

#

because im doing it

#

while doing other things

finite bough
#

hmm

earnest phoenix
#

ikikikiiik

earnest phoenix
#

it's quite literally putting a try catch on methods that can throw and logging through your closures

tight plinth
finite bough
#

read the errors bloblul

tight plinth
#

if aleready installed, uninstall & reinstall

finite bough
tight plinth
#

^

gritty frost
#

k

earnest phoenix
#

i have a try catch

#

re

#

only on role creation

#

i said to try catch on any method that can throw

#

or simply try catch the entire command

#

i did the whole command

#

no errors

#

just doesnt work

#

var person = message.mentions.members.first()

#
let mutetime = args[1];
                if(!mutetime) return message.reply("You didn't specify a time!")
                
                
                await person.addRole(muterole.id)
#

but i think its this part

copper cradle
#

what doesn't work

#

which part of it

#

or just plain does nothing

earnest phoenix
#

does nothing

#

but it awaits the added role then sends the verification message

#

and it isn't adding the role

turbid apex
#

How can I encode "Open Date" in the mute command

tight plinth
#

I HATE ytdl stopping songs after 1-3 minutes, is there any fix?

earnest phoenix
#

iirc it's got to do something on youtube's side and them closing the connection if you hang for too long

tight plinth
earnest phoenix
#

i went around that problem by buffering the content from the video into memory and then allowing my code to slowly consume the buffer and send it to discord

narrow kettle
#

the first index of a list in python is 0 right?

#

its not starting from one or something

slender thistle
#

All indexing starts from 0 in Python, yeah

earnest phoenix
#
let mutetime = args[1];
                if(!mutetime) return message.reply("You didn't specify a time!")
                
                
                await person.addRole(muterole.id)

@earnest phoenix

unborn steeple
#

How do people make their bots profile picture bounce up and down on top.gg

copper cradle
#

c s s

valid frigate
#

weird question but i'm back on discord.js to create a bot for someone else and basically i'm literally trying to send a message to a single channel after somebody joins on v12 but apparently there's no straightforward way to do it since apparently .get() no longer exists on Guild.channels

slender thistle
#

.fetch()?

valid frigate
#

nope .fetch() is out of the question as well

pale vessel
#

why not?

valid frigate
#

hpnestly don't know if that's because v12 is broken right now or some other reason

#

because it's not a function of Guild.channels

pale vessel
#

try resolve

valid frigate
#

yeah did that

pale vessel
#

rip

#

well last resort would be find

valid frigate
#

okay well i'll take a look into it more

#

the thing about .resolve() gives GuildChannel or null, so it should have a .send() function

#

ah well turns out it does, never mind lmao

pale vessel
#

nice

topaz fjord
#

<Guild>.channels.cache

valid frigate
#

god fucking dammit i hate discord.js for this one reason

finite bough
#

@earnest phoenix wouldnt buffer it from memory take a decent amount of time?

pale vessel
#

no turtle

valid frigate
#

no it's ok i got it thanks yall

topaz fjord
#

yes

#

Read the docs

pale vessel
#

smh

#

that's a slow way

valid frigate
#

you can't really gurantee a channel will be in the cache iirc

#

or maybe not

pale vessel
#

cry would know

#

or he would say read docs

finite bough
#

or he will keep on typing for 2 years

pale vessel
#

seriously though I need to know

#

i'm using cache

earnest phoenix
#

@earnest phoenix wouldnt buffer it from memory takes a decent amount of time?
yes if you do it sequentially, however i'm doing it in parallel, both downloading into buffer and sending from buffer to discord are simultaneous

finite bough
#

but if there is 1 error in buffering

valid frigate
#

oh turns out .send only exists on TextChannel now

#

so i casted GuildChannel to TextChannel and it worked

pale vessel
#

ah

earnest phoenix
#

it's handled by zero byte filling the buffer, shiemi

valid frigate
#

galaxy brain

#

so yeah this is how v12 is these days ig

this.client.on("guildMemberAdd", async(m: GuildMember) => {
    if (m.guild.id === process.env.SERVER_ID) {
        const channel = await m.guild.channels.resolve(process.env.SERVER_ID) as TextChannel;
        await channel.send(`hello`);
    }
});
pale vessel
#

for me I didn't need to convert it to a textchannel

#

btw you don't need async for resolve afaik

valid frigate
#

yep

#

i put it there out of habit lmao

#

also just run npm update unless you're already on the latest version of djs because it is what it is

sullen salmon
#

Yo I'm just starting out with discord.js

#

Wtf is a Cache?

#

Like it says it works like an array yet guild.members.length returns "undefined"

#

Instead of the length of the array

topaz fjord
#

In computing, a cache is a hardware or software component that stores data so that future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation or a copy of data stored elsewhere.

sullen salmon
#

That's not what a Cache is in discord.js @topaz fjord

topaz fjord
#

that's what cache is in general

sullen salmon
#

That wasn't my question @topaz fjord

pale vessel
#

wtf is that docs

topaz fjord
#
sullen salmon
#

That's what popped up when I looked up "discord js docs"

pale vessel
#

cry would not like that

sullen salmon
#

Is that the wrong docs?

topaz fjord
#

cry wouldn't like anything

pale vessel
#

yes

sullen salmon
#

Would explain a lot

#

Lmaoo

topaz fjord
#

That's not even the official docs

#

Ah yes

sullen salmon
#

Thx @pale vessel

topaz fjord
#

Those docs are still on v5

#

lmao

sullen patrol
#

I use discord.js. I have 2 versions of the bot. One developer version and one non-developer version. How do I make sure that the developer version doesn’t interfere with the stats of the public version?

sullen salmon
#

Yhea I was wondering why it said "server"

pale vessel
#

"/en/latest/"

topaz fjord
#

you make separate applications for each

#

@sullen patrol

marble juniper
#

@sullen patrol please don't copy paste your message into other channels

topaz fjord
#

is it mini mod time

marble juniper
#

I mean

pale vessel
#

it was in the wrong channel?

#

it makes sense for him to repost here?

sullen patrol
#

it makes sense for him to repost here?
@pale vessel yes

pale vessel
#

yes

limber saddle
#

Hi, I'm jsut asking with what .addrole is replaced in V12? Thanks.

pale vessel
#

roles.add

limber saddle
#

okay

#

thanks

topaz fjord
#

I love seeing this channel after v12 update

#

so much chaos

pale vessel
#

when you don't know how to use the docs

earnest phoenix
#

(i still use v11)

marble juniper
#

most things asked here could have been looked up in the docs

#

but no

pale vessel
#

and yet

#

how do I this how do I that

topaz fjord
#

you read the docs

#

I usually just post links to the docs whenever people ask

marble juniper
#

just check docs first and if you still dont understand THEN you ask here

pale vessel
marble juniper
#

thats how I would do it

pale vessel
#

no

#

sorry

#

i don't read files and spoonfeed

topaz fjord
#

reposting the question isn't gonna get people to help

pale vessel
#

debug

topaz fjord
#

give an error and we can help

#

also I recognize that code from crawl's d.js music bot series mmLol

marble juniper
#

not

topaz fjord
#

bot

earnest phoenix
#

bart

marble juniper
#

ever seen someone not github fork

pale vessel
#

me

narrow kettle
#

[python] so i got this function i did and all whats left is to make the list into the file(rewrite with the new list) how do i do it?

def my_mp4_playlist(file_path, new_song):
  fille = open(file_path, 'r')
  my_list = [line.split(';') for line in fille.readlines()]
  if len(my_list) >= 9:
    my_list[6] = new_song
  else:
    while(my_list.count('\n') < 2)
      my_list += '\n'
    my_list += new_song
  print
topaz fjord
#

no because I don't have an error to go off of

#

I'm not gonna run the code myself to see what's wrong

pale vessel
#

go ahead and ping everyone and ask for help

#

that's not how it works

royal portal
#

hey so

pale vessel
#

if you understand what you've coded, you'd immediately know the issue by debugging

#

hey blox

royal portal
#

if I want a command like !help and i say something after it like @royal portal then how do i make it so it will still work

#

so it ignores whats after the message

earnest phoenix
#

a command handler

royal portal
#

and it sitll works

earnest phoenix
#

startswith

#

or .find

royal portal
#

ah

pale vessel
#

yes. startsWith

earnest phoenix
#

look at le doocs

#

the ducks

pale vessel
#

not docs

#

js in general

earnest phoenix
#

fair

royal portal
#
const Discord = require("discord.js");
const client = new Discord.Client();
 
client.on("ready", () => {
  console.log("I am ready!");
});
 
client.on("message", (message) => {
  if (message.content.startsWith("ping")) {
    message.channel.send("pong!");
  }
});
 
client.login("ewadwarfawr2133213dawd");
pale vessel
royal portal
#

yes

#

i think i got it

#

yessir

#

:D

pale vessel
#

you didn't have to post the code

royal portal
#

oh

#

lol

pale vessel
#

xd

royal portal
#

well i did

#

and i wont delete it

#

just incase someone needs help

pale vessel
#

fair

royal portal
#

so they can scroll up