#development

1 messages · Page 844 of 1

valid frigate
#

nothing too beefy like under 1gb

charred jetty
#
client.guilds.forEach(ch => 

ch.channels.find(ch =>
 ch.name.includes('automeme')? `${ch.send({embed: memeEmbed})}` : ``)  

)```
Can i make it easier to find the channel?
dreamy breach
#

I don't think so.

earnest phoenix
#

No u can't

#

That's the smallest way

charred jetty
#

Ohk

dreamy breach
#

@valid frigate Ovh is a good choice but expensive if you don't need a powerful ip.

valid frigate
#

actually ive heard about ovh

dreamy breach
#

I'm usually using contabo but it's german server so maybe the ping will be very bad.

valid frigate
#

nah contabo was on my list of "yeah this seems cool"

earnest phoenix
#

Ahhh German servers

charred jetty
#

Anyone know how to stop it?

at Map.find (/rbd/pnpm-volume/04d2b97d-b6b0-4096-bd33-46a980d362e6/node_modules/discord.js/src/util/Collection.js:506:11)

valid frigate
#

don't mind bad ping too much since well discord datacenters are everywhere

#

can you post the whole error

dreamy breach
#

Contabo prices are very cheap, but the quality is there ^

valid frigate
#

hmm ok i will take a look

charred jetty
#

It's coming from the given code

valid frigate
#

the problem is that we can't see the given code

valid frigate
#

oh

earnest phoenix
charred jetty
#

It's working but the error is restarting the bot

valid frigate
#

bruv that means you can't use ch.channels.find

#

or something is happening there

charred jetty
#

Why?

dreamy breach
#

Maybe some guilds don't have any channels?

copper cradle
#

that's not the error

valid frigate
#

no it wouldn't be like that

charred jetty
#

Can i use forEach instead of find

#

?

copper cradle
#

they didn't send the error

charred jetty
valid frigate
#

this

copper cradle
#

you sent part of the stack trace

#

that's not the error

valid frigate
#
ch.channels.find(ch => ch.name.includes('automeme')? `${ch.send({embed: memeEmbed})}` : ``))
#

im too tired to tell if this is valid code or not but it might be?

copper cradle
#

ppl should learn to do console.error(err.message) so it's easier to find the errors

valid frigate
#

maybe the ternary operator is in the wrong place

earnest phoenix
#

msg.guild.channels.find(channel => channel.name === "automeme").send(embed1)

valid frigate
#

or

#

.filter also works

dreamy breach
#

The ternary operator is in the wrong place I think

valid frigate
#

yeah that was my suspicion

copper cradle
#

I mean

charred jetty
#

Le

valid frigate
#

i think your best bet is .find since you're looking for one channel in every guild

copper cradle
#

they don't actually have a ternary operator

valid frigate
#

how is that not a ternary operator

dreamy breach
#

This works perfectly for me:
ch.channels.find(ch => ch.name.includes('gg'))? `${ch.send({embed: memeEmbed})}` : ``)

charred jetty
#

@dreamy breachyes

earnest phoenix
#

just tested it

#

that works

dreamy breach
#

Isn't this a discord.js package error?

earnest phoenix
#

hmmm might be

#

k time for me too slumber

copper cradle
#

oh shit

#

didn't see the ?

#

add a fucking space smh

#

I'm on mobile

earnest phoenix
#

Hmmm

#

Oh

#

Same I am on mobile

#

Lol

copper cradle
#

lul

charred jetty
#

@valid frigate now im trying .filter

valid frigate
#

no need

earnest phoenix
#

Pff lol

pale vessel
#

are you on v11 or v12

high bough
#

Anyone know what this is?

(node:9526) UnhandledPromiseRejectionWarning: TypeError: Discord.RichEmbed is not a constructor
```?
tight plinth
#

u switched to v12

#

now its MessageEmbed, not RichEmbed

#

just a name change

spare goblet
#

new Discord.MessageEmbed()

high bough
#

oh ok

#

thanks guys

tight plinth
#

another solution : read the docs

#

always works

#

shuffle is a function who shuffles a list

spare goblet
#

does shuffle return an array

tight plinth
#

ye

spare goblet
#

pretty sure you need a spread operator if you're returning an array

valid frigate
#

bruh

spare goblet
#

const thing = [ array[0], ...anotherArray ]

tight plinth
#

oof

pale vessel
#

...servlist

tight plinth
#

k

#

thx

high bough
#

Does

client.guilds.map

still work?

pallid marsh
#

client.guilds.cache.map

#

in v12

#

in v11 its the same

high bough
#

Oh ok thanks

astral yoke
#

hi

#

so

#

how would i make

#

a suggestions command

#

that sends the suggestion

#

to a webhook

#

so its sorta like

#

it runs the webhook when you run the suggestion command

tight plinth
#

whats the best highWaterMark settings for ytdl? I see ppl using 1024*1024*10, others usingg 600...

pallid marsh
#

i tried 600

#

and it working pretty well

tight plinth
#

and if I use 600 I almost always got my song stopped by ytdl while playing

#

and 1024*1024*10 is laggy af

#

its annoying af

high bough
#

umm can someone explain again to me what does this mean?

client.guilds has been changed from a Collection to a Manager.
I read it in the update notes.

edgy heron
#

hey guys

#

what will be the eval command (js) to remove a role (role name) from a user (user id)

high bough
#

Also, can someone give me a list of what i should change when I update to Discord.js 12.1.1?

#

Can```js
client.guilds.size

```js
client.members.size
```still be used?
calm saddle
#

i was gonna ask that same question

high bough
#

Yeah xd

finite bough
high bough
#

I read, it didn't help at all

pale vessel
#

it should

#

no shiemi shhh

noble pike
#

I need help: how to config the Member Count on discord server

finite bough
#

ask what u didnt understand

#

i will help

#

members.size

#

and ofc u have to define members and stuff

noble pike
#

It's in my server but how do i put it so it starts working

earnest phoenix
#

client.guilds.cache.size

finite bough
#

thats server count

#

@noble pike what discord.js version are u using

pale vessel
#

Guild#memberCount

noble pike
#

Good question i think the last one idk

finite bough
#

12v?

noble pike
#

Were can i see what v i have on my cellphone?

high bough
#

client.guilds.cache.size
@earnest phoenix client.members.cache.size?

finite bough
#

in package.json

wide ridge
#

how do I wait for my shards to fully spawn? I'm trying to do it manually but not sure how to approach it

pale vessel
wide ridge
#

yeah that seems like a good workaround, although people were saying there would be a better way to approach it in V12 hmm

high bough
#

v12 had me destroy my entire folder and start from scratch xd

#

It was hard getting adjusted again

twilit rapids
#

It's not that many changes imo, but I guess that worked

wide ridge
#

yeah I upgrade to v12, didn't take that long for me to change my embed's around

prime cliff
#

There is a docs page about migrating to v12 too

#

If only people knew LULW

earnest phoenix
noble pike
#

14.0v is what i have

prime cliff
#

client.guilds.reduce is not a function

wide ridge
#

^

earnest phoenix
#

how to fix

wide ridge
#

basically what the error says

#

lol

earnest phoenix
#

oh i fix ty

prime cliff
noble pike
#

@finite bough 14.0v

finite bough
#

can u check again

#

and send a screen shot

noble pike
#

@finite bough om

#

Ok

regal saddle
#

he do be kinda using win 7 pogey

pale vessel
#

kinda

dreamy breach
#

Windows 7 is the best

finite bough
#

wait sendMessage was a function in 11v?

dreamy breach
#

I don't think so

high bough
#

wait sendMessage was a function in 11v?
@finite bough It's message.channel.send?

finite bough
#

._.

dreamy breach
#

x)

finite bough
#

wait

#

sendMessage does work

earnest phoenix
#

no discord.js v12 sendMessage doesnt work

finite bough
#

in 11v i meant

earnest phoenix
#

tes v11 does work

finite bough
#

i couldnt see sendMessage function in the docs so i was kinda curious

delicate zephyr
#

@finite bough because its deprecated

#

it was moved to .send

spare goblet
#

are you on the right version

#

not stable, you need to go find the v11 docs :')

delicate zephyr
#

yea

#

v12 is stable now

finite bough
#

lel ik

#

what does roles.hoist do

spare goblet
#

hoist on the sidebar

finite bough
#

hmm

#

oki

high bough
#

if i use ```js
message.author.tag

zenith terrace
#

.username

finite bough
#

^

high bough
#

oh ok tanks

tight plinth
#

hi

#
const db = require('quick.db')
var economy = new db.table('economy')
module.exports = {
    name: 'work',
    category: 'economy',
    aliases: ['w'],
    description: 'Gains money',
    usage: 'pichu work',
    async execute(client,message) {
        if(!economy.get(message.author.id+'.bal')) economy.set(message.author.id+'.bal', 0)
        //economy.push(message.author.id+'.bal', 500)
        //cooldown
        if (economy.get(message.author.id+'.workCooldown')) {
        cooldown = economy.get(message.author.id+'.workCooldown')-Date.now()
        if (cooldown<43200000) {
            let totalSeconds = (cooldown / 1000);
let hours = Math.floor(totalSeconds / 3600);
hours %= 24;
totalSeconds %= 3600;
let minutes = Math.floor(totalSeconds / 60);
let seconds = totalSeconds % 60;

           return message.channel.send(`This command has a 12 hour cooldown! You can work again in **${hours}h, ${minutes}m and ${seconds}s**`)
        } else {
            economy.push(message.author.id+'.bal', 500)
            economy.push(message.author.id+'.workCooldown', Date.now()+43200000)
            return message.channel.send('Added $500 to your balance!')
        }
    } else { 
        economy.push(message.author.id+'.bal', 500)
        economy.set(message.author.id+'.workCooldown', Date.now()+43200000)
        message.channel.send('Added $500 to your balance!')
    }
        
    }
}
```it gives me an error 'Target is not an array', but my log is stupid and I cant find where
#

line 30

velvet cradle
#

point at line 30

#

so just arrow it

tight plinth
#

sec

velvet cradle
#

its add

tight plinth
#

add?

velvet cradle
#

not push

tight plinth
#

oh

velvet cradle
#

push is basically adding something as an item

#

add is basically doing what its suppose to do

tight plinth
#

okeh

high bough
#

how do i fetch someon's id?

finite bough
zenith terrace
#

right click their pfp and it should say copy id at the bottom 👀

high bough
#

I don't think this works ```js
var user = message.mentions.users.first()

${user.id}
```
#

Using a bot -_-

pale vessel
#

bruh

finite bough
#

define member

pale vessel
#

members?

#

you mean message?

high bough
#

yeah, sorry, typo

#

severe typo

zenith terrace
#

@high bough

user.user.id```
astral yoke
#

db!eval message.channel.send("test")

#

ERROR

#

me cry

zenith terrace
#

Oof

finite bough
#

@astral yoke what error

pale vessel
#

no mario

high bough
#

@high bough

user.user.id```

@zenith terrace Threw me this error

(node:1071) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
astral yoke
#

db!eval message.channel.send("test")

pale vessel
#

it's .id

zenith terrace
#

no u

astral yoke
#

wait hold up thats a differnet error i had a minute ago

pale vessel
#

it's already grabbing users

finite bough
astral yoke
#

db!eval message.channel.send("hello");

pale vessel
#

yes

#

not here

finite bough
#

:/

pale vessel
#

are you high

zenith terrace
#

yes

astral yoke
#

oh

pale vessel
#

i meant scltxn

zenith terrace
#

oh

finite bough
#

i am high

pale vessel
#

i am low

charred jetty
earnest phoenix
#

can someone help me with dblapi?

#

i use discord.js

astral yoke
finite bough
earnest phoenix
#

ok

finite bough
#

@charred jetty d.js v?

round ridge
#

I need a bit help with discord.js@11
Code:

client.on("messageReactionAdd", async (reaction, user) => {
  module.exports.connectss.query(`SELECT * FROM orderst WHERE message_id = '694104440411652167'`, function (err, result) {
    if (err) throw err;
    let record = result[0]
  console.log(reaction.member.roles.has(record['role']))
  })
})

Error:

(node:13877) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'roles' of undefined
finite bough
#

nvm

earnest phoenix
pale vessel
#

you probably need to resolve user to member and then check the roles

#

message.guild.member(user)
(might be incorrect)

round ridge
#

okay

#

@pale vessel i did it and i get error member is undefined

pale vessel
#

did you define member?

round ridge
#

how? if i am getting guild members

#

reaction.guild.members.get(user).roles.has(record['role'])

spare goblet
#

user needs to be a snowflake, is it a snowflake @round ridge

round ridge
#

@spare goblet if you mean i need to get user id i did that to did not work too

spare goblet
#

@round ridge I'm asking what the variable user is defined as.

round ridge
#

User is just user who reacted

#

it wil reply info about that user

#

@spare goblet

spare goblet
#

@round ridge Members returns a collection mapped by id
Do user.id instead

#

Or members.fetch(user)

#

In case it ain't cached

round ridge
#

@\

#

@spare goblet

#

(node:15054) UnhandledPromiseRejectionWarning: TypeError: client.fetchUsers is not a function

#
  let member = await client.fetchUsers(user.id)
  console.log(member)
spare goblet
#

@round ridge stop. tagging. me. someone. will. respond. asap.

#

i didn't tell you to do that

round ridge
#

okay sorry

spare goblet
#

also pretty sure it's client.users.fetch(user.id)

#

if you're on v12 / stable

round ridge
#

i om on v11

#

am

split hazel
#

Then it's fetchUser

spare goblet
#

^

split hazel
#

You cant fetch multiple users with the discord API

spare goblet
#

Also you're trying to fetch MEMBER

#

const member = <guild>.members.fetch(user)

#

shuold be like this

dreamy breach
#

Or: const member = guild.members.find(member => member.id == user.id);

round ridge
#

ah

spare goblet
#

@dreamy breach that fetches from cache. if the user ISN'T IN CACHE somehow (e.g. user prolonged on offline) then it wouln't be in cache :')

#

and idk why you would do that when the collection is mapped with snowflakes, aka you could just do guild.members.get(user.id)

#

but you do you

dreamy breach
#

Oh okay, didn't know that. Thanks for noticing me ^^

spare goblet
#

members.fetch() fetches the user directly from the api

dreamy breach
#

But the guild object isn't fetched every minute?

spare goblet
#

not all members are cached

#

especially for servers with like 800-1000 members or above

dreamy breach
#

oh okay ty

spare goblet
#

np

split hazel
#

The cache updates based on presence updates, joins, leaves etc etc

#

And other factors such as Messages

round ridge
#

i did what you sauid Dorian but i get error that guild is undefined

dreamy breach
#

Try message.guild

#

You need to get the guild object

spare goblet
#

^

dreamy breach
#

So depending on your situation

round ridge
#

i better to reactions as message is message that user react

spare goblet
#

from what i can see

#

yours is messageReactionAdd

dreamy breach
#

What's ur event?

spare goblet
#

so whwat i'd do is

#

const { guild } = reaction.message;

#

if(!guild) return; // failsafe in case it's not a guild

dreamy breach
#

const { guild } = reaction.message.guild; ?

spare goblet
#

(e.g. is in a dm)

#

no,

if(!guild) return; // failsafe in case it's not a guild

#

same as
const guild = reaction.message.guild

#

same thing

#

i just prefer shorter code lul

dreamy breach
#

oh yeah, really need to learn nodejs deeper. x)

round ridge
#

oh now its outputing user whole info

sour summit
#
h3 {
  color: #e2e2e2
}
#

why doesn't this work in markdown for top.gg bot desc

modest maple
#

whats your long dsec atml

#

atm*

#

trying to mix atm + html together is

#

interesting xD

sour summit
#
### my discord bot name
modest maple
#

if you're going to use CSS to colour your Markdown text you'll need to wrap it in some sort of DIV or somthing to make it easier

sour summit
#

ooof

prime cliff
#

You forgot the ; at the end of color

sour summit
#

ffffffff

#

bruh it's called strong

golden condor
dreamy breach
#

Is var "video" the right type for the handle function?

golden condor
#

It works with normal songs

#

Also is this right

#

client.user.setPresence({activity:c!help | ${client.guilds.cache.size} servers | ${value.toLocaleString()} users})

earnest phoenix
#

What's the issue here?...

spare goblet
#

why are you coding on a phone tho..

earnest phoenix
#

Bruh you guys realize not everyone has a desktop or a pc?
(TRIGGERED NOISES)

spare goblet
#

the issue is because you're trying to check if useri is included in the string (message.content)

#

useri is an object (from user class)

#

you can't have an object within a string.

earnest phoenix
#

So how can i fix that?

spare goblet
#

it should be,

if(useri){
}

#

rather than,

if(message.content.includes(useri)){
}

#

Better yet, don't have repeated code

#

a lot of that code could be improved but ye

earnest phoenix
#

I don't need to include the:
message.content.includes()
?

spare goblet
#

yes, because if there are no VALID MENTIONS, then useri would be false / null.

earnest phoenix
#

Oh ok... Imma try that... Thx for the help...

spare goblet
#

np.

languid dragon
#

cool tip, dont code on a phone

#

another cool tip, dont complain if coding on a phone is hard™️

#

an even cooler tip, dont pogey

golden condor
#

(node:5936) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'videoId' of undefined

split hazel
#

i swear everyone uses the same queue code

languid dragon
#

video is undefined, define it

golden condor
#

It is tho

languid dragon
#

well, no it's not

#

otherwise your code wouldn't fuck up POGGY

hoary elm
#

lol it is though

#

var video = videos[videoIndex - 1]

^^^

golden condor
#

for (const video of videos) await handleVideo(video, message, voiceChannel, playlist)

#

And that too

hoary elm
#

and that ^^

languid dragon
golden condor
#

For playlists is the only time it doens't worko

languid dragon
#

then whatever you're doing is wrong, because 'video' is NOT defined

#

also you don't need to await the slice function

#

the entire command is a mess and maybe if you cleaned it up and tabbed it properly, you might just be able to understand what's wrong with it in the first place and be able to read back on your errors

golden condor
#

It's the playlist bit I have issues with

#

the normal videos are fine

languid dragon
#

people might be able to help if they can read it™️

golden condor
languid dragon
golden condor
#

Ik

languid dragon
#

then clean up your code and figure out why video is undefined by console logging a bit

golden condor
#

You think I haven't tried

languid dragon
#

it's not rocket science

#

you're going to have a lot less problems if your code is cleaner

golden condor
#

Look, I am not looking for snarky comments about cleaning up my code, I asked for some help. If you can't help me, then stop looking for things to complain about

#

It doesn't help in any way

#

What good does it do to any one?

languid dragon
#

well i can't help you because your code is a mess, if you cleaned up your code you wouldn't need to ask for help in the first place, at least if you asked for help, people would be able to read your code and help properly

golden condor
#

What can;t you read bout my code??

languid dragon
#

all of it, the tabbing is horrendous

#

at least this is slightly cleaner

golden condor
#

I will clean it up then

tidal parrot
#

ken toxic

languid dragon
#

also you should declare your functions before using them, they should be above the code you're running them with

  1. you shouldn't use var and you definitely shouldn't declare a var inside a try,catch (there is probably issues with that)
  2. you are setting a videoIndex of 1 and then selecting your video as videoIndex -1, just set it to 0 if you want the first result
  3. console.log playlist, videos, url.split('list=1')[1] and actually debug your issue a bit
spare goblet
#

mm, the code is quite messy / hard to read, there's some stuff you could definitely improve on ^^ ken is trying to be constructive with his comments altho a bit critical

languid dragon
#
  1. you're setting song = {} like it's a global variable, you should probably set it as a let or const, tbh the handleVideo function doesn't entirely make sense
#

all requires should go at the top of the document

#

you could just change the variable name 'message' to 'msg' instead of making a new const variable

#

okay, here's your issue

golden condor
languid dragon
#

you need to put this in an if else statement

#

you're setting song = {} IF the playlist exists
and then right after you're trying to set it again with video.videoId
it makes no sense

golden condor
#

Still didn't work

languid dragon
#

also you didn't make the code any cleaner, you just put most of the lines of code on the same tabbing

golden condor
#

What???

languid dragon
golden condor
#

I just spent ages cleaning it up

languid dragon
#

okay well i had already cleaned it up and all i did was paste it into my editor

golden condor
#

ok

languid dragon
golden condor
#

I don't get the issue

languid dragon
#

this works fine, because it's not throwing errors

#

it should be if (playlist) {} else {}

#

you're just setting your global variable of "song" to something twice

golden condor
#

No use

#

I tried

languid dragon
#

what's the error? uhm

golden condor
#

(node:5936) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'videoId' of undefined

languid dragon
#

what did you change

golden condor
#

Even with the if(playlist)

#
if(playlist){
                    song = {
                        id: video.id,
                            title: video.title,
                            url: `https://www.youtube.com/watch?v=${video.id}`,
                        author: video.author.name,
                        request: msg.author,
                        thumbnail: video.thumbnail,
                        duration: video.duration
                        };
                    }
                 else {song = {
                        id: video.videoId,
                            title: video.title,
                            url: `https://www.youtube.com/watch?v=${video.videoId}`,
                        author: video.author.name,
                        request: msg.author,
                        thumbnail: video.thumbnail,
                        duration: video.duration.timestamp
                        };
                    }```
languid dragon
#

how long have you been coding for

golden condor
#

Since December™️

dreamy breach
languid dragon
#

give me a minute

golden condor
#

You tryna help

#

?

#

If so tysm

languid dragon
west spoke
#

kyoyu

#

is that a spoonfeed I smell

languid dragon
#

shut mouf

west spoke
golden condor
#

It's not spoonfeed

#

I gave the code

#

He just fixed the errors

short siren
#

Lmao

languid dragon
#

well it kinda is spoonfeeding

west spoke
#

literally a spoonfeed

#

smh

languid dragon
#

stop crying

west spoke
#

I'm not, im just disappointed

quartz kindle
golden condor
#

It isn't a spoonfeed

dreamy breach
#

It's a spoonfeed x)

golden condor
#

I gave code

languid dragon
#

you don't know how spoonfeeding works

short siren
#

🥄

languid dragon
#

you might have given the answer but i basically did the hardwork for you

golden condor
#

He helped fix a few errors

dreamy breach
#

Isn't this a github code at first?

languid dragon
#

because i know you're not capable of fixing it

golden condor
#

Well thanks

west spoke
#

yeah because I dont understand langs other than c# or python

golden condor
#

testing the code now

#

says cannot read name of undefined

#

@languid dragon js (node:8484) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'name' of undefined at handleVideo (C:\Users\t\Documents\app\commands\play.js:26:25) at Object.run (C:\Users\t\Documents\app\commands\play.js:141:11) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:8484) 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: 4)

dreamy breach
#

Try to find the issue, it's pretty self explained.

languid dragon
#

you have all the tools you need to find the issue yourself

#

video is not defined, console log it and find out why its not defined

#

video.author is also not defined

#

the reason that error is happening is because video is now set to an object by default

#

so video.author = undefined, but now you will get an error if you try to fetch a variable from something that is undefined, aka = video.author

#

and if video.author is undefined, clearly video isn't properly filling the data.

golden condor
#

ok

#

thx

split hazel
#

and try not to copy and paste code, then complain it doesn't work

dreamy breach
#

I'm pretty sure this code is taken from github, already saw it x)

golden condor
#

It isn't

dreamy breach
#

Async function

languid dragon
#

it's time for me to actually do work so please stop pinging for me and try use your head for these trivial issues

golden condor
#

Yeah I'm tryna but it doens't work

quartz kindle
#

this means video is optional

golden condor
#

I am so confused

quartz kindle
#

so if no video is passed, or a video is not found, the function will still run and assume video is an empty object

golden condor
#

O

quartz kindle
#

then you try get video.author.name, but video is empty object and video.author is undefined

#

you need to check if a video is valid and exists

tight plinth
#

^

golden condor
#

Like this

#

if(!video == {}) return msg.channel.send("No results");

tight plinth
#

===

golden condor
#

if(video === {}) return;

dreamy breach
#

I don't think it's exactly the problem because he is entering a parameter in the function. I think it must checks if the supplied parameter "video" is really a video object as he wants and not null/undefined or just a string.

golden condor
#

AAAA

#

I am very confused

#

Pls help someone

tight plinth
#

@earnest phoenix seriously

dreamy breach
#

@earnest phoenix There is no bot parameter on the message command. You need to collect the bot directly. So instead of:
Math.round(message.bot.ping)
put Math.round(bot.ping)

tight plinth
#

^

dreamy breach
#

:p

tight plinth
#

@golden condor I cant figure what is the problem

golden condor
#

Me either

dreamy breach
#

Can you show the log of video: for (const video of videos) <- This line

golden condor
#

Ok

#

What should I log

earnest phoenix
#

who can help me

golden condor
#

video?

dreamy breach
#

Just console.log(video)

#

@earnest phoenix what's ur issue?

golden condor
#

No log?

earnest phoenix
#

the word he wrote during the period he was active

#

code

dreamy breach
#

@golden condor Just can you print the result. To see what's the video object.

golden condor
#

It didn't log anything

dreamy breach
#

Can you log videos so?

golden condor
dreamy breach
#

You have no log when you use the playlist command ?

golden condor
#

For some reason, the search command works but this doesn't

dreamy breach
#

@earnest phoenix I don't understand ur problem.

golden condor
#

Just the play command

#

search works

#

But not play

dreamy breach
#

Did you make both commands?

golden condor
#

Yes

#

I can play songs fine I need help with playlists

dreamy breach
#

Here:

            const playlist = await ytpl(url.split('list=')[1])
            const videos = playlist.items
            
            for (const video of videos) await handleVideo(video, msg, voiceChannel, playlist, queue)
        } else {```
Can you console.log(videos) ?
#

And playlist too

#

And send me the result

golden condor
#

Ok

#

ATM neither are working

#

It didn't log

#

@dreamy breach

tight plinth
#

return console.log

dreamy breach
#

Are u sure ytpl is working?

golden condor
#

Idk

tight plinth
#

it is, coz it works for me

#

lemme check real quick

golden condor
#

Lumap can u hel

dreamy breach
#

I'm pretty sure you didn't make that code @golden condor, It's very strange that you know how to make a play command with audio system and you can't fix a small issue :/

tight plinth
golden condor
#

I made the code but that code is the edited version

tight plinth
golden condor
#

[] This is what video returned as

west spoke
#

lumap, that's such a large flex

dreamy breach
#

What's the playlist object and each video object?

tight plinth
#

?

golden condor
#

The search command works

#

So I will remake music using the search

#

And implement playlists

dreamy breach
#

Can you show the result of playlist.items ? ^^

tight plinth
#

wait no

golden condor
#

Yeah but playlists are different

tight plinth
#

wrong screenshot

#

found the good one

dreamy breach
#

A solution is to take the url of each song of the playlist and do the same as default play command:

            const video = results.videos.slice(0, 1)```
tight plinth
#

like calling the queue function for every video?

dreamy breach
#

Do the same process as one video for all videos of the playlist.

#

Because he is saying that when you type one video and not a playlist, it works

golden condor
#

{
id: 'PLlqiW6siyh8qnRuKraWx3yNgrvB6VEtwf',
url: 'https://www.youtube.com/playlist?list=PLlqiW6siyh8qnRuKraWx3yNgrvB6VEtwf',
title: 'MODERN FRENCH MUSIC PLAYLIST',
visibility: 'everyone',
description: 'Because french music is not only about Edith Piaf and Paris.',
total_items: 176,
views: 14622716,
last_updated: 'Last updated on May 27, 2016',
author: {
id: 'UCN8psZeZG7uMVrQOjlksTQg',
name: 'nowhere',
avatar: 'https://yt3.ggpht.com/a/AATXAJyn4j5znOC-fKcMBBTMIWHXVN2TOJbZfVDZzQ=s100-c-k-c0xffffffff-no-rj-mo',
user: 'ACiDDxHiME',
channel_url: 'https://www.youtube.com/channel/UCN8psZeZG7uMVrQOjlksTQg',
user_url: 'https://www.youtube.com/user/ACiDDxHiME'
},
items: [

#

This is an example of a video

#

an item

#

@dreamy breach

tight plinth
#

remove embeds

#

plz

golden condor
#

OK

tight plinth
#

thx

#

adapt

dreamy breach
#

Change that:
for (const video of videos) await handleVideo(video, msg, voiceChannel, playlist, queue)
to:

    const results = await yts(video.url) || { videos: [] }
    const finalVideo = results.videos.slice(0, 1)
    await handleVideo(finalVideo, msg, voiceChannel, playlist, queue)
}```
#

This should work for sure, but you can think of a more optimized way by directly getting the video with the ytpl.

golden condor
#

It didn't work

#

(node:3280) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'name' of undefined
at handleVideo (C:\Users\t\Documents\app\commands\play.js:65:26)

dreamy breach
#

There is no name attribute on line 65.

golden condor
#

Video says it = []

earnest phoenix
#

Y’all need help?

dreamy breach
#

.addField("Author", song.author)

golden condor
#

I changed iy

#

The layout

#

It's like line 15

#

It says video equals []

dreamy breach
#

Maybe one author of a video doesn't have a name

golden condor
#

No the entire video object

#

Is blank

dreamy breach
#

so check if the video is different than []

golden condor
#

undefined is what video equals now

#

if (url.includes("list=")) {
const playlist = await ytpl(url.split("list=")[1])
const videos = playlist.items;
for (const video of videos){
const results = await yts(video.id)
const finalVideo = results[0]
console.log(finalVideo)
await handleVideo(finalVideo, msg, voiceChannel, playlist, queue)
}
}

#
{
  type: 'video',
  title: 'Angèle - Balance Ton Quoi [CLIP OFFICIEL]',
  description: '"Brol la suite", inclus 7 titres inédits, écoutez-les maintenant : https://lnk.to/BrolLaSuiteYD Instagram ...',
  url: 'https://youtube.com/watch?v=Hi7Rx3En7-k',
  videoId: 'Hi7Rx3En7-k',
  seconds: 266,
  timestamp: '4:26',
  duration: { toString: [Function: toString], seconds: 266, timestamp: '4:26' },
  views: 69119899,
  thumbnail: 'https://i.ytimg.com/vi/Hi7Rx3En7-k/default.jpg',
  image: 'https://i.ytimg.com/vi/Hi7Rx3En7-k/hqdefault.jpg',
  ago: '11 months ago',
  author: {
    name: 'Angèle',
    id: 'UCiP2tOO8zRo47GFd5rc8rkA',
    url: '/channel/UCiP2tOO8zRo47GFd5rc8rkA',
    userId: '',
    userName: '',
    userUrl: '',
    channelId: 'UCiP2tOO8zRo47GFd5rc8rkA',
    channelUrl: '/channel/UCiP2tOO8zRo47GFd5rc8rkA',
    channelName: 'Angèle'
  }
}```
 This is a normal video object
#

But using the code of yours Dorian, nothing comes up

#

Should I try search for the title?

quartz kindle
#

all you really need is basically if(!finalVideo) return message.channel.send("video not found or invalid")

#

before using handleVideo

dreamy breach
#

Or, if(finalVideo === []) continue;

golden condor
#

Ideally needs to be out of the loop

dreamy breach
#

Why?

golden condor
#

So it doesn't spam

quartz kindle
#

you cant do X === []

#

arrays are not directly comparable

dreamy breach
#

Is !finalVideo the same as finalVideo = [] ?

quartz kindle
#

im assuming results is the array

#

and finalVideo is an item of the array

earnest phoenix
#

You can only check the length of the array to know if it is empty or not

golden condor
#

if (url.includes("list=")) {
const playlist = await ytpl(url.split("list=")[1])
const videos = playlist.items;
for (const video of videos){
const results = await yts(video.id)
const finalVideo = results[0]
console.log(finalVideo)
if(finalVideo === []) continue;
await handleVideo(finalVideo, msg, voiceChannel, playlist, queue)
}
} This returned undefined in logs

quartz kindle
#

if results[0] doesnt exist, then finalVideo will be undefined, not []

golden condor
#

finalVideo = undefined

quartz kindle
#

yes

#

if its undefined, then do if(!finalVideo)

#

doing !something works for undefined, false, null, 0 and ""

golden condor
#

It didn't show an error

#

Bur the playlists didn't load

quartz kindle
#

did all videos show undefined? or only a few?

golden condor
#

Only one

#

And then it exited the loop

#

Playlists are killing me

quartz kindle
#

if only one was undefined, the others should work

#

if they dont, then theres something wrong with your handleVideo function

golden condor
#

Doesn't return end the loop

quartz kindle
#

try console.logging some stuff inside it

golden condor
#

There is nothing wrong with the handleVideo

#

As it plays songs fine

#

like

quartz kindle
#

return ends the loop, yes, where are you using return?

golden condor
#

c-p <song name> works

#

if(!finalSong) return;

#

The playlist stuff worked when using simple-youtube-api

quartz kindle
#

thats not in the code you showed

golden condor
#

But I don't wanna go back to that

#

I got rid of that

#

Because of heavy rate limits

#

if(!finalVideo){} Should I do this

quartz kindle
#

you didnt show where you put the return

#

so i dont know what you're talking about

golden condor
#

if (url.includes("list=")) {
const playlist = await ytpl(url.split("list=")[1])
const videos = playlist.items;
for (const video of videos){
const results = await yts(video.id)
const finalVideo = results[0]
console.log(finalVideo)
if(!finalVideo) return;
await handleVideo(finalVideo, msg, voiceChannel, playlist, queue)
}
}

quartz kindle
#

didnt you put continue before?

zenith terrace
#

This been going on for over 2 hours 👀

golden condor
#

2 days

#

actually

quartz kindle
#

this has been going for several days

zenith terrace
#

Well today only then

#

has been 2 hours

golden condor
#

I am very stressed

quartz kindle
#

why did you remove continue?

golden condor
#

It continued with the handlevideo function

quartz kindle
#

continue skips the current loop

golden condor
#

O

quartz kindle
#

if(!finalVideo) continue means if there is no video, skip this loop and continue with the next video

golden condor
#

undefined
undefined

#

Is what finalVideo equals in the first two loops

#

This bot is killing me

quartz kindle
#

how many videos does that playlist have?

golden condor
#

176

#

but is trimmed to 100 with ytpl

quartz kindle
#

and only 1 video is being added?

golden condor
#

no videos

#

That was an already queued video

quartz kindle
#

show your full code as you have it now

golden condor
#

ok

#

hastebin?

quartz kindle
#

it would help if you properly indented your code lol

golden condor
#

IK

#

i've been told

#

Not at the top of my priority list

crimson vapor
#

you know you can make it format on save

golden condor
#

Can u?

crimson vapor
#

VSC

golden condor
#

o

#

where is that seeting?

crimson vapor
#

search format

golden condor
quartz kindle
#

ok so first

#

are you sure you're using yts correctly?

golden condor
#

Yes

#

In play

#

Someone gave me that code and told me to use it with playlist

quartz kindle
#

im going over their docs, and it says yts("something") to search for a video and yts({videoId:"id"}) to get a video by ID

golden condor
#

OHHH

#

SHIT

#

Thanks

quartz kindle
#

also, it says yts also supports playlists

golden condor
#

Didn't say that on npm docs

quartz kindle
#

have you tried it?

#

it does

golden condor
#

I tried playlists yes

#

that didn't work

#

I mean i could try again

#

But idk

crimson vapor
#

Cxllm just some suggestions, only use brackets for multi lines and try combining if statements with &&

#

its all personal preference though

quartz kindle
#

i prefer brackets even for single lines

golden condor
#

const results = await yts({ videoId: video.id }) ?

crimson vapor
#

ye its all preference

quartz kindle
#

according to their docs yes

golden condor
#

undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
Returned undefined

pseudo whale
quartz kindle
#

because now there is no results[0]

#

because its not a search

#

use the video directly

#
let video = yts(...);
if(!video) continue;
handleVideo(video,...)```
golden condor
#

It only loads 12 songs

#

(node:10024) UnhandledPromiseRejectionWarning: video unavailable

earnest phoenix
#

It's because of an limite

golden condor
#

Oh

earnest phoenix
#

thonkku though Playlist works differently

quartz kindle
#

video unavailable

#

catch the error on yts

golden condor
quartz kindle
#

like you do in single songs

golden condor
#

How

quartz kindle
golden condor
#

try {
const results = await yts({ videoId: video.id })
const finalVideo = results
if (!finalVideo) continue;
await handleVideo(finalVideo, msg, voiceChannel, playlist, queue)
}catch(e){}

#

Like this?

quartz kindle
#

yes

#

this should ignore errors and continue the loop

golden condor
#

for (const video of videos) {
try {
const results = await yts({ videoId: video.id })
const finalVideo = results
if (!finalVideo) continue;
await handleVideo(finalVideo, msg, voiceChannel, playlist, queue)
} catch (e) { continue;}
}

quartz kindle
#

no need for continue there since its implied as there is nothing else to do

#

you can put a console.log there for example

#

to log errors

#

without interrupting the loop

sullen patrol
golden condor
#

It just says some videos are unavailable

#

which was a ytdl error anywya

#

Basically it stops there being errors with ytdl

modest maple
#

your client / bot object in what ever language should have a cached user and guild pool

sullen patrol
#

Really?

modest maple
#

depending on lang how you access it depends

sullen patrol
#

I use node.js

#

And discord.js

golden condor
#

That's so helpful thanks

#

@sullen patrol you tryna post to top.gg?

sullen patrol
#

No

modest maple
#

hes just tryna log his stats

sullen patrol
#

Yes

golden condor
#

oh

modest maple
#

i dont do discord.js but im guessing its somthing like client.guilds.cache.size or somthing similar depending on v12 or not

golden condor
#

Ok

sullen patrol
#

I know client.guilds.size but I don’t know users and channels

#

Ok

golden condor
#

Which discord.js version you on?

sullen patrol
#

I will just log client and check

#

The newest

golden condor
#

Noooo

#

ok

#

Ok

#

users = client.users.cache.size

#

servers = client.guilds.cache.size

sullen patrol
#

Ok

golden condor
#

channels = client.channels.cache.size

#

Thank you so much @quartz kindle you are a real legend

quartz kindle
#

amen

golden condor
#

My best wishes for you, you explain everything so well and help as best you can ❤️

#

Stay safe :)

wheat jolt
#

Is there a way to forward the dispatcher's audio in d.js?

#

I mean, I want to make a forward command for my music bot

molten pewter
#

it would be cool to implement something that let you chain commands, unix-style

sullen patrol
#

Thanks guys

wheat jolt
#

;-;

raven urchin
#

How can I make the status refresh so it can update the guilds it's in

modest maple
#

what lib?

crimson vapor
#

if d.js, in the on ready event, you can set it to repeat setting its status to the number of guilds

raven urchin
#

D.js

#

How can I make it repeat?

crimson vapor
#

using a setInterval()

raven urchin
#

Okay, thank you

quartz kindle
#

dont make the interval too short

#

make it like at least 1 minute apart or so

crimson vapor
#

I think mine is 30 sec or 2 mins

#

im not sure

earnest phoenix
delicate zephyr
#

And post your server count

earnest phoenix
#

Thanks

slate oyster
#

How big is the src/ folder of most Java bots?

#

Mine is 5.29 MB

#

It's rather large

delicate zephyr
#

You've never seen node modules have you

slate oyster
#

I also have dependencies

#

but they are not included in that size calcaultion

delicate zephyr
#

I mean, it really isn't that big

#

So

slate oyster
#

How big are source folders normally

delicate zephyr
#

I wouldn't worry too much

slate oyster
#

for Discord bots?

delicate zephyr
#

There isn't a normal

#

Everyone's project is different

slate oyster
#

average

crimson vapor
#

node modules are like 80mb if you have a decent amount

slate oyster
#

wow

delicate zephyr
#

Yea

#

I have a node module folder with about 1.3GB

crimson vapor
#

the better written bots have smaller and smaller bots are smaller

#

generally

delicate zephyr
#

Not really

#

Just depends on how much code your write

#

Don't worry about the size of the folder

amber fractal
modest maple
slate oyster
#

@amber fractal I meant without dependencies

#

@modest maple wow

amber fractal
modest maple
#

you're using AI dungeon arnt u

slate oyster
#

Oh wow

amber fractal
#

But it's down right now

cinder umbra
#

Can anyone tell me when is the bot coming online?

modest maple
#

which bot

slate oyster
#

I couldn't ever write 5 GB of code all by myself

amber fractal
#

Takes way too much processing power that I don't currently have

modest maple
#

its not his

#

xD

cinder umbra
#

Member count bot

amber fractal
#

Well I had to rewrite a lot of it

modest maple
#

its massive because AI dungeon has some Massive tensors and datasets stored

amber fractal
#

it's mostly GPT-2 though

modest maple
#

and @cinder umbra wrong server my friend

slate oyster
#

That's like, working on my bot for 100x as long
It would take me 33 years

cinder umbra
#

Nope it is the right server

amber fractal
#

no

#

it's not

cinder umbra
#

At least it what showed me

amber fractal
#

@modest maple 1.5 billion parameters mmLol

modest maple
#

yeah

cinder umbra
#

Why is the member count bot offline?

modest maple
#

you need to click "join support server"

#

we are not the support server for member count

hearty jetty
#

in top.gg my bot's status is not changed. A guy said "Status will change tomorrow. Every day admins are updates site." but now still ??? help.

quartz kindle
#

status only changes when your bot is approved

#

if you already added your bot in top.gg, then wait for approval, which takes 1-2 weeks

cinder umbra
#

Got in here as soon as I clicked it

modest maple
#

that is the WRONG server

#

that is 1) to go to the discord server list 2) the Join discord takes you here

#

you need to click "join support server"
we are not the support server for member count

cinder umbra
#

Ok let me check again

#

Anyway Do you guys have any bots which supports rss feeds?

modest maple
#

probably be best to look it up on the site

quartz kindle
cinder umbra
#

Yea

slate oyster
#

@modest maple

azure tinsel
#

sql is gonna be so EZ now

modest maple
#

that file method is slow and inefficient af

azure tinsel
#

mhm

#

yep

slate oyster
#

Does MongoDB have nested collections?

azure tinsel
#

idk

slate oyster
#

@modest maple

azure tinsel
#

but i highly recommend sqlite

modest maple
#

you litterally wouldnt even need that

copper cradle
#

I highly recommend mongo

modest maple
#

you'd litterally have 1 db, 1 table with relative guild Ids, those tables can then pull off other tables

azure tinsel
#

mhm

#

you can link the ids to other tables

modest maple
#

literally the entire point of how you should use DBs

azure tinsel
#

i found mongodb very finnicky to me

slate oyster
#

Let's say I have a Guild
and it has data for multiple members
But I don't want to put the data for the members into the Guild-data document

modest maple
#

then have a table

#

called members

slate oyster
#

Because I don't necessarily need this data

#

When accessing the guild

modest maple
#

having a table with all members

#

will stop you

azure tinsel
#

yes

modest maple
#

having dupe members

#

or if you insist on having seprate things for each member

azure tinsel
#

have a table named after the guild ID

modest maple
#

use a sub table with each guild

slate oyster
#

Isn't MongoDB JSON-like?
How would I have tables?'

azure tinsel
#

idk

slate oyster
#

All I can think of are Objects and Arrays

quartz kindle
#

mongo has documents

azure tinsel
#

but sql is kinda similar to json

quartz kindle
#

each document is similar to a table, but also similar to a json object

modest maple
#

sql isnt rlly

slate oyster
#

Yes
I need sub-collections
to store individual documents in

modest maple
#

mongo uses bsons

slate oyster
#

@quartz kindle

quartz kindle
#

afaik mongo does support nested documents, but i dont use mongo so idk

modest maple
#

yh

#

still wouldnt need it in his case

#

but yh

#

one DB can support multiple docs

slate oyster
#

Yes
But I need nested collections

void mantle
#

mongo is pretty easy OwO

modest maple
#

you dont

slate oyster
#

Otherwise I get collections named "guilds-000-members"

modest maple
#

you've just set stuff up so weirdly

#

that its forced you todo that

azure tinsel
#

mhm

void mantle
#

would really recommend it

modest maple
#

because youre using json

#

and yh mongo pretty G

#

personally i use SQL but thats just cuz my backend supports it better

quartz kindle
#

discord is very suited for sql databases tho

void mantle
#

just use mongo atlas if you think your database wont be larger then 512mb

quartz kindle
#

its so easy to organize guilds and users into tables

void mantle
#

if you are lazy to set it up

azure tinsel
#

its so easy to organize guilds and users into tables

#

yep ^^

void mantle
#

same goes for mongodb 😛

slate oyster
#

Within the data for a given channel

quartz kindle
#

if you wanna go for json-like structures, mongo is more suited for you

modest maple
#

pretty much with mongo:

Database server
-> Database 1
-> collections abc
-> data
-> Database 2
-> collections abc

crimson vapor
#

mongo is really easy when migrating from JSON

azure tinsel
#

my bot is migrating from json to sql but it shouldn't be a big deal

modest maple
#

nah its pretty easy

slate oyster
#

I need

     ->  Database 1
            -> collections abc
                -> data
                   -> collections messages
                      ->data
                   -> collections users
                      ->data
modest maple
#

you dont tho

crimson vapor
#

why tho

modest maple
#

thats just how youve done it with json to make it work with json

slate oyster
#

But if I put it all in one document
It will load too much data into memory at once

crimson vapor
#

then dont

slate oyster
#

Then I need nested collections

crimson vapor
#

use many docs in one collections

modest maple
#

Converting from Json to a database: think of it like portal.

before you got the portal gun you had to take a walk 6 miles down the city

after you could put a portal at the start and at the end, and cut off 99% of the journey

What do you do, still take that 6 mile walk or use the portal?

azure tinsel
#

@modest maple what code editor do you use?

modest maple
#

i use Pycharm

#

for python stuff

#

Atom for most others, other than CPP

azure tinsel
#

i use atom too

quartz kindle
#

what they're trying to tell you is that unlike json storage, there is a lot of repeated data that doesnt need to be repeated, but instead it can be linked/shared/referenced

#

so you dont need to keep different copies of user data inside each guild document for instance

slate oyster
#

I really need nested collections though

Otherwise, my data will look like this:

Guild 000 DB: {
  prefix: "*",
  users: "myguild-000-users",
  messages: "Myguild-000-messages"
}

Or worse, like this (In which case it would run out of memory)

Guild 000 DB: {
  prefix: "*",
  users: {
    "000": {
      "xp": 1,
      //More data
    },
    "001": {
      "xp": 2,
      //More data
    }
  },
  messages: {
    "000": {
      "issb": false,
      "pairdID": "001",
    },
    "001": {
      "issb": true,
      "pairdID": "000",
    }
  }
}

Unless there exists another thing I don't know

azure tinsel
#

welp, time to go through the long process of converting my json oriented commands to sqlite

modest maple
#

its called sharing data from tables

#

ya need to start thinking with portals

slate oyster
#

Your portal analogy made no sense

quartz kindle
#

lmao

azure tinsel
#

*GLaDOS intensifies*

slate oyster
#

What does sharing data from tables mean?

modest maple
#

that analogy ment, rather than have repeated data that just doesnt need to be there

#

rather than having a seperate file for everything

#

through all that

#

you could just have a set of tables

#

one with members

#

one with guilds etc...

#

we query guild 12334, that guild has members [x, y, z]

slate oyster
#

Each user object is unique to the Guild object
Rather than each guild having the same data for each member
It can have different data per-member

modest maple
#

we go fetch those members we want

#

you dont want that tho

slate oyster
#

Yes I do

#

That way I can store seperate data per-user-per-guild

azure tinsel
#

can I explain my solution?

modest maple
#

then dont use that system

#

this is the issue with json

#

when using it as db it forces you into bad habbits

slate oyster
#

I also have global user objects
I have global user objects, and also user objects unique per-guild

modest maple
#

then just have another table...

quartz kindle
#

in SQL i would do it like this ```
table GUILDS
guildID,guildname,guildetc,whatever
guildID,guildname,guildetc,whatever
guildID,guildname,guildetc,whatever

table guild1Members
memberxp,memberdata,etc
memberxp,memberdata,etc
memberxp,memberdata,etc

table guild2Members
memberxp,memberdata,etc
memberxp,memberdata,etc
memberxp,memberdata,etc

table users
userdata,username,etc
userdata,username,etc
userdata,username,etc```

azure tinsel
#

@quartz kindle I'm doing exactly that

slate oyster
#

I don't use SQL

modest maple
#

WE KNOW

slate oyster
quartz kindle
#

you can do the same thing in other databases

slate oyster
#

But it's ugly

azure tinsel
#

YES

modest maple
#

we're trying to tell you

#

how

#

to use a db

quartz kindle
#

but you dont need to do that

slate oyster
#

I can emulate nested collections with naming
But it's ugly, and I would prefer actual nested collections

modest maple
#

you are tunnel visioning my dude

quartz kindle
#

because you dont need to access it like guild and guild.members.member.memberXP
you can access it like this guildmembers.member.memberXP and guilds.guildid and users.userID

#

ie: have them in completely different stores

slate oyster
#

you can access it like this guildmembers.member.memberXP
Where do I plug in the guild ID then?

#

So that I can have member data per-guild

quartz kindle
#

make it part of the store name/id

crimson vapor
#

wait are you moving to mongo?

quartz kindle
#

create a new storage for each guild members, but not inside the guild

#

make it a collection of guildmembers stores

slate oyster
#

Can I just call my collection guild.<id>.members

#

Are Mongo collections iterable btw?

quartz kindle
#

i mean, if you're using mongo, you can even do like this

modest maple
#

yess

#

mongo is litterally a database formatted json system

azure tinsel
#

this feels like a very heated argument

crimson vapor
#

mongo is super easy because you can just define a doc with guildID and userID defined and find one with the userID and guildID

#

no need to structure it like that

slate oyster
#

So that was basically my one idea
Just without the actual listing for the collection name within the guild object

modest maple
#

sigh

crimson vapor
#

you are thinking too much like a JSON