#development

1 messages · Page 934 of 1

tepid hedge
#

or do I need to do client.users.cache.get

quartz kindle
#

you dont need any of that

#
thisIsACollectionOfMembers = {
  47593875983 => GuildMember
  92798728034 => GuildMember
  29749497264 => GuildMember
  ...
}

for(let entry of thisIsACollectionOfMembers) {
    console.log(entry) // [92749276497,GuildMember]
}

for(let [a,b] of thisIsACollectionOfMembers) {
  console.log(a) // 27364972649
  console.log(b) // GuildMember
}

for(let [id,member] of thisIsACollectionOfMembers) {
  console.log(id) // 7928749827
  console.log(member) // GuildMember
  console.log(member.id) // 7928749827
  console.log(member.user.username) // someusername
}
tepid hedge
#

I have everything working, all I don't know how to do is set an interval correctly, when I did it it would just end up looping, how do I set it to wait the interval before sending the next message?

quartz kindle
#

how long do you want to wait?

#

you dont need to use an interval

tepid hedge
#

1 second

quartz kindle
#

is this code inside an async function?

tepid hedge
#

Yes

quartz kindle
#

you can use the await keyword, combined with a promise and a timeout

#

to define an arbitrary amount of waiting

#

for example

#

await new Promise(resolve => setTimeout(() => resolve(),1000))

tepid hedge
#

haven't used await before, where do I put the console.log in?

quartz kindle
#

what do you want to log?

tepid hedge
#

console.log(id)

quartz kindle
#

anywhere in the loop

tepid hedge
#
        await new Promise(resolve => setTimeout(() => resolve(),1000)) {
        client.users.cache.get(id).send("test")
        console.log(id) // 7928749827
#

so like this?

quartz kindle
#

yes

#

but as i said before, you dont need to use client.users.get

tepid hedge
#

I need to send a DM to the person

quartz kindle
#

you have the entire member object, you can send directly to it

tepid hedge
#

Oh

#

So then how would I do it if I already have the id?
(id).send?

quartz kindle
#

member.send

#

and you did your promise wrong, its not a function you put things inside

tepid hedge
#

It worked, thank you!

queen needle
quartz kindle
#

where user is the mentioned user

#

and your message.reply mentions the user

#

so it keeps mentioning the user, which keeps collecting

tight forum
#

^

queen needle
#

Well i didnt know what to do so i just copied the way it accepts it and copied and pasted and change it for declinding

earnest phoenix
#

hey quick question, does anybody know how long the verification on top.gg takes? heard it's about 1-4 weeks

quartz kindle
#

there are a ton of things in there that could be done in a better way, but your problem will most likely go away if you simply fix your filters

#

what you want is for the filter to check if the message author matches the mentioned user, not if the mentioned user matches itself, which just makes it match all messages

tight forum
#

hey quick question, does anybody know how long the verification on top.gg takes? heard it's about 1-4 weeks
@earnest phoenix yeah its true

#

but wrong channel

earnest phoenix
#

thanks for confirming and sorry

quartz kindle
#

1-2 weeks usually

tight forum
#

np

earnest phoenix
#

guess it's a good time to write documentation on github

#

while waiting

queen needle
#

@quartz kindle so it would be for both filters const filter2 = m => m.content.includes('decline') && message.author.id === user.id

quartz kindle
#

yes

#

but not message.author

#

m.author

queen needle
#

oh

quartz kindle
#

because m is the message that the collector will collect

#

so if the author of the collected message matches the mentioned user

queen needle
#

then do this

upper hinge
#

wait

chilly bison
#

@upper hinge try referencing the thing

#

the class list

upper hinge
#

wdym

#

._.

#

havent really used html&css that much

quartz kindle
#

@upper hinge your bot description is injected into the existing top.gg website, it is not a standalone page

#

so you have to account for all the existing html and css that the website already has

#

use the element inspector / dev tools in your browser, to check the existing css rules of your bot page

#

and modify them in your style tags

upper hinge
#

So it's part of the class content. How would I modify. I tried ```html
content {
background-color: blue;
}

queen needle
#

Try

#

.content

upper hinge
#

nope

queen needle
#

Is it defined anywhere else?

#

What are you trying to make blue

upper hinge
#

nvm

earnest phoenix
#

.

earnest phoenix
#

Well, more context please, can you show us the code?

rain jacinth
#

I did

#

Press the sourcebin

rough walrus
#

you need a module.exports help = { name: "your name here" }

rain jacinth
#

Check this one

rough walrus
#

at the bottom

#

still not working? how

rain jacinth
#

It came with another error

rough walrus
#

what is it

hardy vector
rain jacinth
sudden geyser
#

For example, message.member.voiceChannel is now message.member.voice.channel

#

It shouldn't be a challenge to just find whats changed with some control + f

rough walrus
#

@rain jacinth I don't know, I'm kinda new to discord.js so...

sudden geyser
#

@rain jacinth you're inside a function body. You can't have key/values like that unless you're doing it for an object.

rain jacinth
#

So i need to remove category?

sudden geyser
#

No, you need to place it where it should be. I don't know what your intentions are for each key.

#

You should be able to export an object easily but you don't seem to be doing that and instead mixing it in the function body.

rain jacinth
sudden geyser
#

what

rain jacinth
#

like that?

sudden geyser
#

did you change anything? It doesn't look any different nor does it look like it'll work.

rain jacinth
#

I took off the comma after the description

sudden geyser
#

Do you have well knowledge on JavaScript?

rain jacinth
#

Not really

sudden geyser
#

Then you should learn more JS then attempt it again.

clear wraith
#

I have a question...

#

So Tim told me to type enable-pnpm in my terminal.

#

Does it need "npm" in front of it?

wild mist
rain jacinth
#

@wild mist is thaf heroku?

#

That

tight forum
#

Does it need "npm" in front of it?
@clear wraith just try

summer torrent
#

Does it need "npm" in front of it?
@clear wraith no

wild mist
#

Yes @rain jacinth

rain jacinth
#

Are you trying to host your bot?@wild mist

wild mist
#

Iam trying to host lavalink node

digital ibex
#

hi, does anyone know why i'm getting ```js
(node:12008) UnhandledPromiseRejectionWarning: DiscordRESTError [50035]: Invalid Form Body
embed.fields.1.value: This field is required

#

code: ```js
{
name: 'Mods',
value: ${mods},
inline: true
}

#

and mods is ```js
message.channel.guild.members
.filter((e) =>
e.roles.includes(
guild.mod.roles
.map((e) => message.channel.guild.roles.get(e))
.sort((a, b) => b.position - a.position)
.map((e) => e.id)
.join(' ')
)
)
.map((e) => e.mention);

summer torrent
#

is this d.js?

digital ibex
#

no, eris

hardy vector
#

does anyone have any good tutorials on how to setup ur bot on a vps

high bough
#

Uhh, I might be an idiot for asking this, but how exactly do bots use animated emojis?

#

Like :reeee: only returns :reeee: like a user

#

Ugh, I mean with <a:[emojiname]:[emojiid]>

digital ibex
#

<a:name:id>

high bough
#

it returns only the enojiname

#

like :reeee:

digital ibex
#

then ur bot ain't in the server which the emoji came from

high bough
#

It is, since it's a custom server bot

#

It's my bot in my server

#

with my emojis

digital ibex
#

chill

#

just show how u r doing it

high bough
#

Nvm, I fixed it, sorry for not chilling, I've been trying to do it for an hour without asking my dev team first.

#

Turns out they have a better idea than me^^

digital ibex
#

ok

hardy vector
#

does anyone have any good tutorials on how to setup ur bot on a vps

digital ibex
#

u can ask here, i don't think there r tutorials on how to set it vps up

hardy vector
#

oh

#

cos im thinking of getting a digital ocean vps

earnest phoenix
#

There are better options....

#

Digital ocean is kinda over hyped

#

how do i have mutliple if statements in 1 line

#

@clear.error async def clear_error(ctx, error): if isinstance(error, commands.MissingRequiredArgument): await ctx.send('Please Specify The Number Of Messages You Want To Clear Example: +clear 10``')

if isinstance(error, commands.CheckFailure):
    await ctx.send("You are not allowed to kick people")``
#

Else if?

#

hum

#

retype the code for me?

#

lol

#

No thx

#

ok ill do it myself thanks for your help

#

Unm ok

tacit flume
#

bruh

earnest phoenix
#

how do i make a role

#

like with my bot

#

as if i have a mute command

#

Check the docs

#

mkay

tacit flume
#

spoonnnnnn

earnest phoenix
#

you're not helping so dont even answer @earnest phoenix

#

Well I'm

#

You expecting to get spoon fed isnt gonna happen

#

if i wanted to create a role with my bot how would i do it? my current code is @client.command() @commands.has_permissions(administrator=True) async def mute(ctx, member: discord.Member): role = discord.utils.get(ctx.guild.roles, name="Muted") await member.add_roles(role) await ctx.send(f'{member.mention} Has Been Muted')

#

shush

#

Make me :)

#

simple as a block

#

lmao

#

glee

tacit flume
#

when you blocked someone bc they won't give you a code

#

while you haven't read the rules

earnest phoenix
#

Dont worry @tacit flume

#

Just e enjoying good drama show

tacit flume
#

lol

earnest phoenix
#

Plus I dont code in python

tacit flume
#

lmao

#

me 2

earnest phoenix
tacit flume
#

waiting for player number 2 to respond

clear wraith
#

How would i get my bot to delete the message it sent after a specific amount of time?

pale vessel
#

timeout option in v12

clear wraith
#

Would I do a .then(m => m.delete(amount));

pale vessel
#

that's v11

clear wraith
#

Ok

pale vessel
clear wraith
#

Ill check it out

pale vessel
#

for v12

summer torrent
#

delete({timeout:...})

clear wraith
#

I did the timeout option

#

But... It deleted the message I sent. Not the message It sent

earnest phoenix
#

Are you calling it on the right message?

clear wraith
#

Well u did this...

#
message.delete(m => m.delete({ timeout: 5000 })```
earnest phoenix
#

Oof

clear wraith
#

Is that not right?

#

Hmm

earnest phoenix
#

Store the message the bot sends in a const

#

And call the delete on that

clear wraith
#

Ok

earnest phoenix
#

But I think you can just do message.delete(time)

#

how to track who invited someone to my server using bot

#

@sudden geyser any guide ?

sudden geyser
#

Read that wrong sorry

earnest phoenix
#

@earnest phoenix

#

Try this

#

@earnest phoenix already tried and check issues of this project at top my name

pale vessel
#

outdated

#

don't follow that

earnest phoenix
#

please help

#

Stop spamming

#

did i spam ?

#

See if you can get some help from this

#

*old

#

Well you should get the idea of the basic logic needed

sudden geyser
#

If you want to track what invite a member used to join the server (I assume this is what you're asking for), keep a collection of all the invites in a guild and find the one where the usage count has increased. You'll also need to manage how you can access the old/new collection as well as updating it

tacit flume
#

@clear wraith if you still having the problem, you could just make let msg = await message.channel.send("whatever is in here")
then just do msg.delete

clear wraith
#

Ohhhh

#

That makes more sense

#

Thanks

tacit flume
#

np

#

let me know if it works

clear wraith
#

Ok

earnest phoenix
#

Didnt you need a timeout?

tacit flume
#

just use
msg.delete(option.timeout)
reading the docs

#

im still new

hardy bough
#

that's not how it works..

pale vessel
#

options is an object

#

so if it's options.timeout then it's object.timeout, which is { timeout: 3000 }

tacit flume
#

yeah

#

im still new

ancient comet
#

how do i make a listener for votes is js?

earnest phoenix
#

Reaction collector?

ancient comet
#

like client.on('message'

#

basically how do i give the rewards fo boting

earnest phoenix
#

Wait

#

Are you talking about nitro boosts

ancient comet
#

kyu

#

no

#

vote

#

in

#

the websiye

#

website

spice smelt
#

he’s talking about dbl votes

earnest phoenix
#

Oh

ancient comet
#

yes

earnest phoenix
#

The api

spice smelt
earnest phoenix
#

I would help but I'm on mobile.... plus I'm reading.....

ancient comet
#

qwq

#

i will go nom the github

spice smelt
#

ok thanks anyway

fast trench
#

is there a way to purge DMs from a bot?

#

I've been testing with this account for some stupid reason and now it's just filled with unneeded messages in DMs

earnest phoenix
ancient comet
#

i was reading it uwu

earnest phoenix
#

I defined a channel, in v12 how can i get that channel ?

#

Huh

#

like i have

let chx = db.get(`welchannel_${member.guild.id}`); 

and i want to get this channel, like member.channel.get but this doesn't work

#

What is db?

digital ibex
#

it doesn't matter the db

zealous urchin
#
    def __init__(self, bot):
        self.index = 0
        self.bot = bot
        self.update.start()

    def cog_unload(self):
        self.update.cancel()

    @tasks.loop(seconds=60.0)
    async def update(self):
        await self.bot.change_presence(
            activity=discord.Activity(application_id=686460052982464522,
                                      name='something',
                                      type=discord.ActivityType.playing)
        )
        self.index += 1```
(discord.py 1.3.3)

I wrote this code for my bot to change presence, but sometimes it stops working and outputs this error.
#
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\tasks\__init__.py", line 73, in _loop
    await self.coro(*args, **kwargs)
  File "C:\Users\USER\Desktop\MaruBot\Cogs\BotUpdater.py", line 39, in update
    await self.bot.change_presence(
  File "C:\Users\USER\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 943, in change_presence
    await self.ws.change_presence(activity=activity, status=status, afk=afk)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\gateway.py", line 512, in change_presence
    await self.send(sent)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\gateway.py", line 482, in send
    await super().send(data)
  File "C:\Users\USER\AppData\Local\Programs\Python\Python38\lib\site-packages\websockets\protocol.py", line 555, in send
    await self.ensure_open()
  File "C:\Users\USER\AppData\Local\Programs\Python\Python38\lib\site-packages\websockets\protocol.py", line 803, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason

I tried setting logging level to DEBUG, but it outputs so much error text that I'm not able to realize what is wrong.
How do I fix this :(

digital ibex
#

member.guild.channel @earnest phoenix

earnest phoenix
#

without get ?

#

Ok nvm I'm out

#

Idk python

digital ibex
#

wdym sabin?

earnest phoenix
#

nvm

modest maple
#

You just dont fix that error lol

#

1006 is discord closed the ws on you

zealous urchin
#

Then do I just have to reconnect if that error happens?

nocturne grove
#

If a guild is unavailable and you do guild.owner.send(), will you get Cannot read property 'send' of null?

digital ibex
#

probably,

nocturne grove
#

not everything is executed in a 'message' event @earnest phoenix, so is this piece of code

digital ibex
#

thats what he's doign

modest maple
#

Normally doesn't rlly matter d.py should reconnect again

digital ibex
#

k

zealous urchin
#

I should try it thanks

nocturne grove
#

Angelo, it normally works but now it didn't. I got that error so I want to know what caused it

digital ibex
#

the guild ur trying to access is either unavailable or the owner isn't cached

nocturne grove
digital ibex
#

no

nocturne grove
#

oh okay

digital ibex
#

use get

nocturne grove
#

ow with a cache in between ofc, for me

#

thanks 🙂

digital ibex
#

'guild' isn't a collection

#

so, message.guild.get

#

is incorrect

nocturne grove
#

message.guild.members.get() would work, or with a cache in between

digital ibex
#

yes

#

try it, i don't use d.js, but afaik it should work

nocturne grove
#

oh that's not the problem tho

digital ibex
#

wha

nocturne grove
#

the syntax

digital ibex
#

what r u trying for the syntax to be incorrect?

candid granite
earnest phoenix
#

How did you manage that?

#

How many apps are you running?

#

i host a bot

turbid bough
#

Do not. use a free hosting site

earnest phoenix
#

and a staticman (github app)

serene wind
#

It also says 550 hours, which means you haven't verified your heroku account by adding a debit card

earnest phoenix
#

they work good

serene wind
#

If you add one, you get 1000 hours a month

digital ibex
#

heroku bad, don't use it

#

and not all free hosts are bad

earnest phoenix
#

my bot will stop on 20 May

turbid bough
#

yes they are

earnest phoenix
#

IMO glich are bad :c

serene wind
#

Why do you say Heroku is bad? Plenty of people use it without any issues

earnest phoenix
#

Not all people can afford vps

#

i use glich for tests

#

Let's not say free hosting is bad

turbid bough
#

Cause you have an issue right now lol?

digital ibex
#

no i don't, my host works prefectly fine

#

& its free

earnest phoenix
#

Local hosting

#

Xd

nocturne grove
#

what r u trying for the syntax to be incorrect?
@digital ibex you said you don't exactly know how to code it to get a member. I said that I know that so that's not the problem
Thanks for your help as you said what the solution should be

serene wind
#

lmfao

digital ibex
#

there has only been two major downtimes since the start of this year

earnest phoenix
turbid bough
#

What do you use?

digital ibex
#

and one of them was the guy running it forgot to pay his bills

#

lol

turbid bough
#

soo, its not free?

digital ibex
#

no, its free

turbid bough
#

you are just leeching of somebody else

serene wind
#

Lmfaooo

digital ibex
#

wh

#

no

#

someone has to pay for the host in the end, am i correct?

earnest phoenix
#

So leaching

#

Lol

digital ibex
#

no

turbid bough
#

If the hosting website can barely pay their bills lol

#

thats a big problem

serene wind
#

^

digital ibex
#

no, but sure

serene wind
#

So what happens if they decide they don't want to keep paying for it?

turbid bough
#

bot dies

serene wind
#

Do you have a back up option ?

earnest phoenix
#

@candid granite just add a credit card on your account to verify it and you can get more hours

digital ibex
#

then what happens if ur host stops paying for it?

#

bot dies

candid granite
#

@candid granite just add a credit card on your account to verify it and you can get more hours
@earnest phoenix wait that’s all I need to do?

earnest phoenix
#

Yea lol

#

You get more hours

candid granite
#

Perhaps I should have read the email

sudden geyser
#

The host has to keep its lights on somehow.

candid granite
#

Haha

#

Thanks

turbid bough
#

lol yeah thats why i dont want to get a "free hosting site"

sudden geyser
#

@rain jacinth have you tried defining it.

digital ibex
#

exact same thing, idk y ur saying it as a host u host ur bot on doesn't pay their billings

turbid bough
#

where your bot can be destroyed at any time

digital ibex
#

ok, please

earnest phoenix
#

Let people choose their hosting lol

#

No need to dis others hosting

#

Everyone got circumstances

turbid bough
#

nah, im dissing free hosting

earnest phoenix
#

Well don't

#

Cuz some people cant afford vps

digital ibex
#

please

turbid bough
#

you could use an aws server? that uses a free trial

digital ibex
#

if any bot cuts the main power, what happens?

#

anything hosted on that is?

earnest phoenix
#

Free trials require credit card

turbid bough
#

get a burner credit card then

serene wind
#

uh lol

earnest phoenix
#

Not everyone has one

#

Lol

turbid bough
#

ok, then get a credit card

earnest phoenix
#

Not everyone has one.....

#

Not everyone here is a working man or women

#

So are kids

turbid bough
#

i dont have a job either

earnest phoenix
#

I dont either

digital ibex
#

@turbid bough hi hello, define a good host 2 host ur bot on plz

earnest phoenix
#

Lol

turbid bough
#

uh, anything that is official and is not expensive, and has 100% uptime with full support

#

aws google or whatever im using rn

#

digitalocean

sudden geyser
earnest phoenix
#

Dont use digital ocean lol

sudden geyser
#

Was sent almost a year ago.

earnest phoenix
#

Overhyped af

digital ibex
#

dg is overrated

serene wind
#

Google Cloud tbh is a great choice in my opinion. The trial is $500 for an entire year

turbid bough
#

idk digitalocean works fine?

earnest phoenix
#

Galaxy gate is good

digital ibex
#

if u like dg, may aswell use heroku since ur bot dies like, after a few days

earnest phoenix
#

They have good pricing

cinder oxide
#

Not all free hosts are bad.
There are some like heroku that many bots use.
A host is a host after all, ain't any different from the rest. Some extra perks, maybe yeah.
The main difference is that paid hosts are more reliable and might have some extra perks.
Beginner developers would choose free hosts, and that's not a bad thing. They're only starting off so that's fine.
Advanced programmers might choose paid ones over free ones because they're more reliable and most of the paid ones have extra perks that catch our eyes.
After all, it's just a user preference, it's an opinion so I won't say "All free hosts are good".
People can view things differently so whatever it is, a host is a host, unlike any others, with either less or more perks.

digital ibex
#

gg is good when it works

earnest phoenix
#

Thx for the summary

serene wind
#

@digital ibex What are you talking about with bots dying in a couple of days? lol

#

Specifically in terms of heroku

earnest phoenix
#

I had my bot running on heroku for 5 months

digital ibex
#

r u like

earnest phoenix
#

No problem

#

Like 0

#

Move Iran out of hours

sudden geyser
#

Honestly this convo about free hosting vs. paid hosting always goes no where. if you want to use free hosting do so but know what you're getting

earnest phoenix
#

Damm mobile auto correct

turbid bough
#

you could use paid hosting whilst you have the free credits too

#

oh wait, you need a credit card riiight

earnest phoenix
#

Lol

digital ibex
#

costs go up as you scale dynos vertically, adds more ram cpu, and those costs increases like A LOT as ur ram & cpu increase since most web apps can't run on a single dyno, the rapid price increase is something almost all heroku users have to face at some point

#

(literally copied into my own words from google)

turbid bough
#

oh btw, if you have the github education pack, you get one free hobby duno for 2 years

earnest phoenix
#

not all free hosts are bad
yes, they are

#

Ye

digital ibex
#

no they're not

earnest phoenix
#

especially if you choose to host a bot

turbid bough
#

aws you get like 100$

earnest phoenix
#

165$ I think

#

I still have my credit lol

digital ibex
#

what is a good free host?

earnest phoenix
#

there is none

#

Whichever runs your bot

#

you cannot have good shit for free

turbid bough
#

github is free 👀

#

and thats good shit

digital ibex
#

ok, for ur host, what do u look for?

balmy knoll
#

TypeError: fields.flat is not a function Why do i get this error?

sudden geyser
#

Simo what Node.js version are you using.

earnest phoenix
#

whatever is free means either YOU'RE the product, or the free product has so many limitations it isn't even worth it

#

What do you want people to do? Sell their kidneys or some?

#

And not use free hosting

turbid bough
#

???

earnest phoenix
#

what do you even mean

turbid bough
#

sell kidneys for 5$ a month??

earnest phoenix
#

If they cant afford paid hosting

#

a vps is like 3 bucks a month

#

Let them use free hosting

#

Stop saying it's bad

#

it's not that deep

digital ibex
#

what is a good limit for a bots ram?

earnest phoenix
#

IT IS bad though

#

Not everyone has 3$ everymonth to spare

#

you cannot argue that it isn't because it's proven it is

#

You might

turbid bough
#

everyone has 3$

earnest phoenix
#

Not everyone

#

I sure as hell dont

#

if you don't have 3 bucks a month to spare you should look into maybe not hanging out on discord making a bot...?

#

Unless you work or get your parents to pay for it

grizzled raven
#

how long is this convo gonna last

turbid bough
#

yeah parents, they dont have any money do they

#

cant spare 3 dollars

digital ibex
#

what is a good ram limit tho

serene wind
#

Not all parents are that generous

turbid bough
#

3 dollar is GENEROUS?

balmy knoll
#

Simo what Node.js version are you using.
@sudden geyser v10.15.3

digital ibex
#

which u'd expect for $3

sudden geyser
#

Upgrade to Node.js v12.

grizzled raven
#

no matter how bad you say free hosting is, people are still going to use it and you cant change that

earnest phoenix
#

keep in mind, that is MONTHLY and not WEEKLY

#

Lol your parents might give you money

digital ibex
#

🗿

turbid bough
#

if you eat dinner with your familiy you should be more generous than asking for 3 dollars

earnest phoenix
#

Not others

balmy knoll
#

Upgrade to Node.js v12.
@sudden geyser How can i upgrade it?

modest maple
#

You can just mow your neighbors lawn lol

earnest phoenix
#

Dont assume others are in the same situation as you

sudden geyser
#

Alright time to see how this shitshow ends.

turbid bough
#

i think you have a money problem then if you cant afford 3 dollars

slender thistle
#

You might want to end this conversation here since it's not getting anywhere

earnest phoenix
#

I think you are ungrateful for those 3$

#

Every month lol

#

if you're complaining about not having 3 dollars to spend a month, uhm, maybe find a temp job?? help out your neighbours

turbid bough
#

3$ a month is what i spend as a student, is nothing

earnest phoenix
#

i worked in retail for 4 months because i didnt want to leech off my parents money anymore

#

Some families work differently

#

it's not that deep

modest maple
#

Retail is oof

turbid bough
#

do your family earn 3$ an hour?

earnest phoenix
#

My dad doesnt give me money as a student

modest maple
#

Then work for it

earnest phoenix
#

Doesnt mean I can make bots

#

Cant*

turbid bough
#

how'd you get your laptop/pc?

#

if they cant lend you 3 dollars

digital ibex
earnest phoenix
#

Some people make compromises lol

#

the problem is that you want to invest into your bot but not do the giving money part of investing lol

#

Investment doesnt have to be money lol

modest maple
#

I don't see what's stopping you from doing odd jobs

#

And it kinda does

#

You gotta have good hosting

turbid bough
#

I doubt you can make something great for absolutely 0$

earnest phoenix
#

Ok just to be clear I have a paid host

#
let target = message.mentions.users.first() || message.author;

.addField("Roluri:", `${target.roles.filter(r => r.id !== message.guild.id).map(roles => `\`${roles.name}\``).join(" **|** ") || " No Roles"}`, true)

error

Cannot read property 'filter' of undefined

#

We ain't talking about me

#

We talking about other people

#

why are u guys doing off topic in here ?

digital ibex
#

we're talkin' bout me 🙂

earnest phoenix
#

Ye

#

Him

sudden geyser
#

it's still about development kinda

digital ibex
#

i mean

earnest phoenix
#

not at all

turbid bough
#

Take a one month job and you can host a bot for 2 years or more

earnest phoenix
#

If the minds dont stop us

#

We good

#

Mods*

#

What if he cant work?

turbid bough
#

Then he is fucked in life

earnest phoenix
#

Not really lol

#

Or maybe he is disabled 😛

turbid bough
#

disabled people can still work

earnest phoenix
#

That's not nice

modest maple
#

Disabled people can still work

frail ocean
#

You might want to end this conversation here since it's not getting anywhere

  • shivaco

Please keep this for development issues only, and continue this somewhere else.

earnest phoenix
#

@modest maple this depends

#

Shit

digital ibex
#

i got a good host, works perfectly fine for me, no issues with it, i got enough memory and storage is perfectly fine for me

#

so

modest maple
#

im not gonna get into that with you lol

digital ibex
#

anyways, yeah. imma stop talking about this

earnest phoenix
#

I told you guys you are doing off topic

digital ibex
#

this whole thing started just cuz i said my free host is gud lmao

earnest phoenix
#

So, can somenone help me please?

digital ibex
#

hm?

earnest phoenix
#

It's good for your circumstances

#

So dont worry

turbid bough
#

@earnest phoenix roles are undefined

sudden geyser
#

Sabin an instance of User does not have the property .roles

#

You're probably looking for a GuildMember

earnest phoenix
#

is for a userinfo command 😛

#

i don't think

#

that guild member

#

is a sollution

turbid bough
#

it is

#

to get user guild information, you need GuildMember, not User

nocturne grove
#

yes

#

A user is everyone of us, everywhere, and in this server we are guildMembers

turbid bough
#

User is just a generic "id, name and icon"

earnest phoenix
#

User isnt part of a guild

sudden geyser
#

You can get the guild member object then get the user object.

nocturne grove
#

and that's why guild.users and client.members don't exist, while client.users and guild.members do

earnest phoenix
#

uhm, ok

turbid bough
#

message.guild.members?

nocturne grove
#

yes that exists

#

that is every user in this server, with properties belonging to this guild (roles, permissions)

turbid bough
#

ah nvm, message.guild.members.cache

nocturne grove
#

no, message.guild.members.cache (in v12)

turbid bough
#

yeah

nocturne grove
#

nvm xd

tight plinth
#

with discordjs, how to know the number of ppl connected into a vc? I tried looking at message.guild.me.voice.channel when the bot is connected to a vc, but cant find anything related to that

valid frigate
#

that voice channel should also include a list of members in that channel

earnest phoenix
valid frigate
#

pretty much

tight plinth
#

hm

earnest phoenix
tight plinth
#

ye it is

#

well

#

thx!

earnest phoenix
#

probably because members is a getter

#

Why this is not working

#

I want the bot image to move

#
  img.vert-move {
    -webkit-animation: mover 1s infinite  alternate;
    animation: mover 1s infinite  alternate;
}
img.vert-move {
    -webkit-animation: mover 1s infinite  alternate;
    animation: mover 1s infinite  alternate;
}
@-webkit-keyframes mover {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}
@keyframes mover {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}
#

Is anyone here?

earnest phoenix
#

I do not understand JavaScript

pale vessel
#

that is not javascript

earnest phoenix
#

I don’t know much what languages libraries are.

pale vessel
#

That's okay. You can always learn.

sick cloud
#
this.activeConnections[conn.id].lastPing = Date.now();

            if (this.activeConnections[conn.id].timeout) clearTimeout(this.activeConnections[conn.id].timeout);
            else this.activeConnections[conn.id].timeout = setTimeout(() => {
                conn.close(4991);
                this.activeConnections[conn.id] = undefined;
            }, (50 * 1000))

so this is my server side sort of thing for heartbeats, will this work

#

the interval is 45s so every 45s a client sends a ping

honest perch
sick cloud
#

it's a hard thing to try smfh

pale vessel
#

trial and error

lean turret
#

Is it here to ask for help ?

turbid bough
white anvil
#

yes

#

exactly the same thing

#

just with await import(path).then(f => f.default)

lean turret
#

I have issues creating and assigning a role with the same command

white anvil
#

whats your code

lean turret
#

Hang on

turbid bough
lean turret
#
if (command == 'setcolor') {
    if(message.channel.guild == client.guilds.cache.get('600516863688048640')) {
        var eenGuild = message.channel.guild.channels;
        console.log(args[0]);
        if(args[0].length == 6){ 
            goodHex = 1;
            console.log("testing");
            eenGuild.roles.create({
                data: {
                  name: args[0].toUpperCase(),
                  color: args[0].toLowerCase(),
                }
            });
            message.member.roles.add(message.member.guild.roles.cache.find(role => role.name == args[0].toUpperCase()));
        }else{
            message.reply("The color you specified is invalid !");
        }
    }
}
#

It's a color role, and I'm trying to create it with the supplied hex, and assign it to the member that entered the command

digital ibex
#

ur doing if(guild === guild.id)

#

so it'd return false

lean turret
#

Well, the issue I have is that it doesn't assign the role

#

It creates it, but it fails to assign it

digital ibex
#

what errors r u getting?

#

if any

lean turret
#

UnhandledPromiseRejectionWarning

#

TYPEERROR

digital ibex
#

whats a bit after?

lean turret
digital ibex
#

ok well

white anvil
#

you need to await

lean turret
#

For the Promise ?

white anvil
#

yes

#

just do

#
let createdRole = await eenGuild.roles.create({
                data: {
                  name: args[0].toUpperCase(),
                  color: args[0].toLowerCase(),
                }
            });
await message.member.roles.add(createdRole);
lean turret
#

Alrighty

#

Thank you AuriHug

digital ibex
#

but it wouldn't even get there

arctic juniper
#

In here have anyone whoes are best music bot maker??

digital ibex
#

as ur doing if(message.channel.guild === id)

lean turret
#

No I'm doing with two equals

#

Not three

arctic juniper
#

In here have anyone whoes are best music bot maker??
@arctic juniper ??

digital ibex
#

ok, same thing

lean turret
#

It does work though

digital ibex
#

kinda, but doesn't change anything

white anvil
#

the cache stores guilds not ids

lean turret
#

Yeah

#

I use the Guild Object

white anvil
#

u should really use ===

lean turret
#

Can do

white anvil
#

== is bad practice

#

type checking should always be enforced

digital ibex
#

so

#

i'm just a bit confused, how, js message.channel.guild = Guild message.channel.guild.id = GuildID and ur checking Guild === GuildID

#

or am i dumb, idk, i don't use d.js

honest perch
#

read the docs

lean turret
#

I do if(message.channel.guild === client.guilds.cache.get('600516863688048640'))

#

Which is basically Guild === Guild

digital ibex
#

oh, 🤦‍♂️ i'm dumb lmao

#

yeah, ur right

lean turret
#

Works, thank you all AuriHug

turbid bough
#

@white anvil would that import just work on just .js files? or does it also work if the commands are in ts?

white anvil
#

for the path just omit the file extension

#

like i do this

#
files.forEach(async (file) => {
          if (file.includes('template') || file.includes('category_info')) return;
          const command: any = await import(`../commands/${folder}/${file}`).then((v: any) => v.default);
#

and it works fine

#

with ts files

turbid bough
#

aight

still merlin
#

Hi. I decided to learn javascript and I wanted to test something i learned yesterday out on my existing bot so I changed the log in to

var BotOn = `Logged in as ${client.user.tag} with a uptime of ` + client.uptime;
client.on("ready", () => {
  console.log(BotOn);
});

TypeError: Cannot read property of 'tag' null

#

I'm new to programming so if this is basic stuff I'm sorry

pale vessel
#

what version of discord.js?

still merlin
#

12.2

glass crag
#

Hey guys, quick question. Do you also experience what seems to be memory leaks with Discord.js?

turbid bough
tight plinth
#

try node 14

#

or 13

#

or 11

turbid bough
#

i managed to fix it

quartz kindle
#

@glass crag they are not memory leaks, they are just how discord.js is designed to work

#

it caches everything it can to be able to provide all the functionality it offers

#

using intents and cache sweeping can help control a big part of it

white anvil
#

@turbid bough use NodeJS.Timer

quaint vigil
#

I DBScript

turbid bough
#

@white anvil Its from discord.js tho

white anvil
#

update typescript?

#

did you install node types

turbid bough
#

nah, it was nodejs

#

yeah it was that what was wrong

quaint vigil
#

You Russian?

turbid bough
#

but i think i should just not use typescript anymore

#

js you have like everything working
and with typescript everything breaks lol

quartz kindle
#

pretty much lmao

turbid bough
#

like it is its own language trying to make a wrapper, but that wrapper requires some weird ass setup

white anvil
#

the Object is possibly 'null/undefined' errors are usually very useful

turbid bough
#

yeah as a message, not as an error

#

though thats beacuse of strict mode i think

white anvil
#

stops you from calling properties on undefined values

#

having it strict actually forces you to exhibit good code practices

turbid bough
#

ok wtf i fixed it

#

it works

#

it actually launched

#

hmm, but it cant find the .ts file

earnest phoenix
turbid bough
#

though, the thing i like with typescript atleast, that it has nice autocomplete

tight plinth
earnest phoenix
still merlin
#

@earnest phoenix ^^

turbid bough
#

@white anvil so, ive tried your import function for those files, and it does not seem to want to import it.
Or is there something missing on the ts file that might hinder it to compile?

white anvil
#

do you have a default export in the file you are importing

turbid bough
#

i dont think so

white anvil
#

you need a default export

#
const myThingThatIWantToExport = {};
export default myThingThatIWantToExport;
tight plinth
#

ts sucks

white anvil
#

this isnt even ts

#

this is esm

quartz kindle
#

esm is weird as well, i mean, isnt require perfectly fine? what is the need for having a complicated esm system?

white anvil
#

esm uses static importing and throws errors that it finds when parsing instead of at runtime

turbid bough
#

@white anvil so, something like this:

import { Message } from 'discord.js';
import { Command } from '../app';

export class PingCommand implements Command {
    execute(message: Message, args: string[]) {
        message.reply('pong');
    }
}

const command = new PingCommand();
export default command;```
white anvil
#

no

#

export default PingCommand

#

you should instantiate it when importing

turbid bough
#

oh right lol

#

yeah that was dumb ok

white anvil
#

in fact u can just do

#
import { Message } from 'discord.js';
import { Command } from '../app';

export default class PingCommand implements Command {
    execute(message: Message, args: string[]) {
        message.reply('pong');
    }
}
turbid bough
#

aight

white anvil
#

then then when u import

#

const commandFile = await import('path to file').then(i => i.default);
const command = new commandFile()

quartz kindle
#

wait, import returns a promise?

white anvil
#

non lexical import does

#

i forgot await in that code 5head

turbid bough
#

ok, so im still getting the same error message

#

"Error: Cannot find module 'commands/ping.ts'"

white anvil
#

i think you need ./

#

if commands is in the cwd anyway

turbid bough
#

hey, it loaded

#

now i got an another error though

#

"unexpected token"

#

very nice

white anvil
#

u have a syntax error then

turbid bough
white anvil
#

that doesnt give me very much info

turbid bough
#

ah wait

#

full stacktracke

white anvil
#

huh

#

how are you running this

turbid bough
#

i press start

white anvil
#

wait

mossy vine
#

you are trying to run a typescript file with node?

white anvil
#

i think start transpiles it for you

#

in visual studio

#

can you show app.js

tight plinth
#

dont use typescript smh

turbid bough
#

you mean app.ts?

white anvil
#

thank you for your useful and valid input Lumap

#

yeah

white anvil
#

what does your typescript config look like?

turbid bough
#

i took it from the discord.js config

white anvil
#

it seems that it is transpiling into an esm module

turbid bough
#
{
  "compilerOptions": {
    "strict": false,
    "moduleResolution": "node",
    "declaration": false,
    "removeComments": false,
    "alwaysStrict": false,
    "pretty": false,
    "module": "commonjs",
    "target": "es2019",
    "lib": [
      "esnext",
      "esnext.array",
      "esnext.asynciterable",
      "esnext.intl",
      "esnext.symbol"
    ],
    "sourceMap": false,
    "skipDefaultLibCheck": true
  }
}```
white anvil
#

yeah thats a weird one lol

turbid bough
#

or idk i cant remember where i took it from

mossy vine
#

i still think youre just trying to execute typescript code with node

white anvil
#

the stack trace has app.js in it

turbid bough
#

probably compiles to a .js?

mossy vine
white anvil
#

could be tbh

mossy vine
#

ping.ts does not get compiled

#

and node shits itself when trying to run it

turbid bough
#

probably has source and build on the same folder?

#

ill try and see if it is able to search for js files

white anvil
#

can you try compiling this from cli and using node to run it

turbid bough
#

so, it managed to find ping.js

mossy vine
#

where are you hosting your bot

#

thats the problem

#

no im not even joking

#

its an issue with glitch

#

ip ban iirc

#

literally anything else

turbid bough
#

welp, i cant even use the debugger

#

"generated code not found"

mossy vine
turbid bough
#

ok, so it definetly does compile the ping.ts file

#

soo, the js file looks like this:

#
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class PingCommand {
    constructor() {
        this.guildOnly = false;
        this.args = [];
        this.name = "ping";
    }
    execute(message, args) {
        console.log("Command Executed: Pong");
        message.reply('pong');
    }
}
exports.default = PingCommand;
mossy vine
#

okay but does app.js import that file

turbid bough
#

yes

#

just, i have to search for .js files, not .ts files

mossy vine
#

fun fact, no it doesnt

const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.ts'));

#

also please get a build directory

turbid bough
#

tell that to visual studio who made it default that way

mossy vine
#

you can edit your tsconfig wearyfire

turbid bough
#

oh

#

what is the config name?

#

nvmvnm

#

got it the build folder now

lime lichen
#

how to get user custom status?

#

discord.js

mossy vine
lime lichen
#

._.

quartz kindle
#

somewhere in user..presence.activities

vivid crescent
#

Probably need the precense intent as well

quartz kindle
#

yup

nocturne grove
#

Hey. Is any of these better?
str.split(/ +/)
str.split(' ')

turbid bough
#

is there a way to include files to build with tsconfig?

#

docs says str.split(/ +/) is better

nocturne grove
#

ow okay thanks

quartz kindle
#

@nocturne grove the first one will treat any number of consecutive spaces as one

#

the second one will treat each space independently

nocturne grove
#

oh that's useful. Thanks

#

that's why the first one always was in my index for splitting message.content to arguments

quartz kindle
#

yup

#

alternatively you can also use \s

#

to match any kind of space-like character, not only regular spaces

nocturne grove
#

oh well I think nobody would use that in their Discord message

quartz kindle
#

probably not

grizzled raven
quartz kindle
#

thats the cache size

#

the cache only contains users that you receive data for, ie: online users, users that interact with discord, send messages, etc

#

whenever a user "shows up", your bot will receive information about it and put it in the cache

#

so your cache grows over time as users come and go

pale vessel
#

this can be enabled in client options

vivid crescent
#

part of the guild_members intent right?

pure lion
#

im getting error "fn is not a function"

#

hrlp

#

help

#

please

#

refkdngansfdkagnofag

turbid bough
#

stop

pale vessel
#

give context

#

oh never mind

#

read the error

pure lion
#

if (fn(val, key, this))
^

TypeError: fn is not a function

turbid bough
#

👀

glad charm
#

It's probably not a function then.

#

🙂

pure lion
#

h e l p f u l

#

i didnt write it

glad charm
#

Classic.

turbid bough
#

then don't copy it

#

ask the one you copied it from

#

not here

pure lion
#

uh

#

this was really helpful thank you all so much

turbid bough
#

no problem

#

have a better luck next time

pure lion
#

its a problem with the discord.js node

pale vessel
#

and don't copy paste blindly

pure lion
#

I DIDNT COPY PASTE

turbid bough
#

never heard of fn in discord.js

glad charm
#

I mean they can name the function however they want.

#
const fn = () => {}```
pure lion
#

C:\Users(name)\Desktop\qBot\node_modules@discordjs\collection\dist\index.js

#

thats a file path if it helps

glad charm
#

Why would that help

turbid bough
#

not much

pure lion
#

u g h

turbid bough
#

send the whole code file

pale vessel
#

what node.js version?

pure lion
#

uh

#

where doi find this info

turbid bough
#

node --version

pure lion
#

also code file in a sec

#

ok thx

pale vessel
#

and discord.js version while you're at it

pure lion
#

12.16.3 (node ver)

#

how do i get the discord.js ver

glad charm
#

Your package.json

pure lion
#

12.2.0

pale vessel
#

and now the whole code

turbid bough
#

sure you havent read the stacktrace upside down?

pure lion
#

the entire file?

#

w d y m

turbid bough
#

yes, entire file

#

in gist, or pastebin

pale vessel
#

uh

#

thaun

turbid bough
#

yeah?

pale vessel
#

p-pastebin?

turbid bough
#

hastebin*

pale vessel
#

oh you're funny

#

that got me actually

pure lion
#

h

turbid bough
#

posted the first letter of hastebin

#

means that he person is sending small bytes of the link after time

#

must be lagging

earnest phoenix
#

help

#

me

pale vessel
#

did you create an event for every command

pure lion
#

@earnest phoenix process.setmaxlisteners(12);

amber fractal
#

You do client.on("message", ...) 11 times

#

@pure lion no

pure lion
#

why not

amber fractal
#

It's an error for a reason

turbid bough
#

cause you should never have multiple on messages

pale vessel
#

yikes

amber fractal
#

It prevents memory leaks

pure lion
#

wait so my bot can only have 11 commands?

#

epiccccccccc

turbid bough
#

??

amber fractal
#

What the fuck

white anvil
turbid bough
#

why are you adding an eventlistener to each command lol

amber fractal
#

You only need 1 listener

pure lion
#

how else do i use it

amber fractal
#

I have 1 listener and 20 commands...

turbid bough
#

do you read the docs lol

amber fractal
#

Make a command handler

pure lion
#

siuhfiusahguishgui\

#

FINE

white anvil
#

this has nothing to do with docs

#

this is just basic programming knowledge

turbid bough
#

The docs shows you how to make a commandhandler is what i meant

pure lion
#

u g h

pale vessel
#

pepega fucking clap

white anvil
#
client.on('message', (message) => {
  if(message.content === 'ayy') {
    message.reply('lmao');
  } else if(message.content === 'bruh') {
    message.reply('moment');
  }
});
#

there is 2 commands in 1 listener

turbid bough
#

daym only one eventhandler

white anvil
#

big brain i know

turbid bough
#

btw, im kinda struggling with this class command here

#

and im trying to give it values

#

but it just returns undefined

earnest phoenix
#

@earnest phoenix process.setmaxlisteners(12);
@pure lion hmm

turbid bough
#

app.ts

export interface Command {
    default: Command;
    command: string;
    guildOnly?: boolean;
    args?: string[];
    usage?: string;
    aliases?: string[];
    cooldown?: number;
    execute(message: Message, args: string[]);
}

const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

commandFiles.forEach(async (file) => {
    if (file.includes('template') || file.includes('category_info')) return;
    console.log("Loading Command: " + file);
    const command: Command = await import(`./commands/${file}`).then((v: Command) => v);
    commands.set(command.command, command);
});```
ping.ts
```ts
import { Message } from 'discord.js';
import { Command } from '../app';

export default class PingCommand implements Command {
    default: PingCommand;
    cooldown: 2;
    command = "ping";
    execute(message: Message, args: string[]) {
        console.log("Command Executed: Pong");
        message.reply('pong');
    }
}
#

or is it like i need to create a new object for it to work?

white anvil
#

you need v.default in the import

turbid bough
#

yeah, but same result.

white anvil
#

the actual import itself isnt PingCommand

#

its an esmodule

earnest phoenix
#

@earnest phoenix process.setmaxlisteners(12);
@pure lion heyy ```(node:1090) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit

white anvil
#

@earnest phoenix dont do this bruh

earnest phoenix
#

again failed

white anvil
#

you have 11 message listeners

#

you need 1

#

why do you have 11

turbid bough
#

he has 11 commands, thats why

pale vessel
#

makes sense

earnest phoenix
#

@white anvil 106 command

#

There are 106 commands

white anvil
#

do you have mutliple .on('message') statements

feral pivot
#

Where do the dbl events go?

#

I am using a command handler

#

They are client based if im not mistaken and cause I have two folders, one for client one for guild

earnest phoenix
#

do you have mutliple .on('message') statements
@white anvil no

white anvil
#

wel lyou have 11 message listeners defined somewhere

#

do you have one nested in something

earnest phoenix
#
    if (perms < cmd.conf.permLevel) return;
    cmd.run(client, message, params, perms);
   client.setMaxListeners(100);
  }```
feral pivot
#

Nesting issues make code harder to read and slow your code down generally...

white anvil
#

@earnest phoenix where is your message listener

earnest phoenix
#

Help

white anvil
#

@feral pivot deeply nested code isnt usually slower its just ugly

#

@earnest phoenix update node

feral pivot
#

I mean

#

Js reads code line by line so

earnest phoenix
#

Tq

feral pivot
#

anyhow, how does dbl events work, do they work when the bot comes online or like seperate events?

white anvil
#

dbl events have no relation to discord bot clients

feral pivot
#

so they are seperate events then?

white anvil
#

yes

earnest phoenix
#

@earnest phoenix where is your message listener
@white anvil events/message.js

white anvil
#

show

feral pivot
#

thanks

#

i do know tho however

#

they are client events so thanks

turbid bough
#

Jacher, i understand now. I can feel my brain melting of my stupidity like "what am i doing wrong".
i found my answer, it is now stuck in my brain.
now, can eslint not be more annoying? https://img.thaun.dev/8jri2.png

white anvil
#

just eslint-ignore that

#

you can define it more strict but its annoying

turbid bough
#

yeah, strict is kinda too strict for me

waxen current
#

looking for a web developer. dm me pls (:

turbid bough
slender thistle
#

-needdev @waxen current

gilded plankBOT
#

@waxen current

DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.

still merlin
#

whats the code??

#

we cant help without code

turbid bough
#

fixd

vivid crescent
#

you don't use phpstorm?

turbid bough
#

php?

pale vessel
#

webstorm?

vivid crescent
#

Yeah my bad, webstorm

turbid bough
#

No, webstorm is from intellij, i usually use visual studio community

vivid crescent
#

Do you prefer it over webstorm?

turbid bough
#

and i feel like every intellij is like always its own program, not like "all in one"

#

well, i use vs community the most, and i havent used webstorm at all

vivid crescent
#

I just use phpstorm for anything related to js, node & web dev (since it has support for them)

#

A bit overkill but I feel like it helps me write better code ngl ¯\_(ツ)_/¯

#

I'm not a bot I swear

turbid bough
#

I don't know, dont you also have to pay for it yearly?

vivid crescent
#

Yeah you do; I have Jetbrains student license though

#

It's pretty expensive >.> But it does have a lot of good features

dire obsidian
#

hey guys i have a question, what version of discord.js use ffmpeg-static?

earnest phoenix
#

so, my music bot works fine using links however when I send my response to try to get a video the bot would wait for the 10 seconds to be up and then time out

#
          let response;
          try {
            response = await message.channel.awaitMessages(msg => 0 < msg.content && msg.content < videos.length + 1 && msg.author.id == message.author.id, {
              maxMatches: 1,
              time: 10000,
              errors: ['time']
            });
          } catch(e) {
            const noselection = new Discord.MessageEmbed()
            .setColor('#de0000')
            .setTitle("![sc1](https://cdn.discordapp.com/emojis/702658223206826034.webp?size=128 "sc1") Video selection timed out.")
            return message.channel.send (noselection)
          }
          const videoIndex = parseInt(response.first().content)
          video = await ytdl.getBasicInfo(videos[videoIndex - 1].videoId)      ```
#

for reference

dire obsidian
#

hmmm

magic jackal
#

Why does this not output my results? Any MongoDB guys know how to properly do this? This just returns parent process info and the collection of guilds

client.database.collection('guilds').find().sort({
                fcount:-1,
                limit: 3
            })```
quartz kindle
#

@earnest phoenix v11 or v12? v12 uses max instead of maxMatches

earnest phoenix
#

v12

pale vessel
#

use max in favor of maxMatches like Tim said

earnest phoenix
#

thanks tim and Flaz

turbid bough
#

ever since i started using visual studio + typescript, im beginning to vision that im writing c# again

whole raptor
#

someone who will help my FIveM is set in Japanese I tried reinstal again it is the same

pale vessel
#

ask dream to change it for you

digital ibex
#

hi

#
message.channel.guild.members.filter((e) => e.roles.includes(guild.mod.roles.map((e) => message.channel.guild.roles.get(e))
.sort((a, b) => b.position - a.position).map((e) => e.mention)))
``` anyone have any ideas its getting the last role? so it'd return
#
[ '<@&1234235678678>', '<@&123456787653>' ]
``` but it only return the second values properties in the array, any idea why's that?
#

i'm trying to access both

quartz kindle
#

what the heck

earnest phoenix
#

i dont even know what that code does

digital ibex
#

well

quartz kindle
#

why are you double mapping plus sorting inside a filter function?

digital ibex
#

i have two arrays, ```js
[ 'id1', 'id2' ];
// and
[ '1id', '2id' ];