#development

1 messages · Page 970 of 1

empty owl
#

Can i put a class inside a class?
when I do

module.exports = class {
  constructor(apikey) {
    this.apikey = apikey
  }
  //functions
class OtherClass {
  
}
``` returns unexpected token
earnest phoenix
#
  const command = message.content.toLowerCase();
  if(command === Prefix + 'meme') {
    let msg = await message.channel.send("Fetching");
    fetch('https://meme-api.herokuapp.com/gimme')
        .then(res => res.json())
        .then(json => {
            let embed = new Discord.RichEmbed()
                .setTitle(json.title)
                .setImage(json.url)
                .setFooter(`Link: ${json.postLink} | Subreddit: ${json.subreddit}`)
            msg.edit(embed)
})  //this is for ending the .then code
} //this is for ending the if(command.... code
}); //this is for ending the client.on code...```
#

do i paste this?

#

yep

#

k , amma test

#

also thanks for the notes

#

u were missing }
and ) previously xd

empty owl
#

Can i put a class inside a class?
when I do

module.exports = class {
  constructor(apikey) {
    this.apikey = apikey
  }
  //functions
class OtherClass {
  
}
``` returns unexpected token

@empty owl

earnest phoenix
#

@earnest phoenix there seem to be something wrong can i inv you to see it ?

lyric mountain
#

You're missing a } there

earnest phoenix
#

it is editing the message and also adding [Object] [object] i suppose @earnest phoenix

#

??

#

nvm

#

what is the problem?

#

u can send ss

#

it just sends "fetching" and then does nothing 🤣

#

should i change the API?

#

ohk

#

got any errors in console?

#

no

#

the console is clean

#

o wait

#

hmm?

#

(node:3740) UnhandledPromiseRejectionWarning: TypeError: Discord.RichEmbed is not a constructor

#

after i send the command

#

ohk

#

which discord.js version you are using?

#

12

#

it should be

#

Discord.MessageEmbed()

#

not RichEmbed()

#

ohh

#

sorry

#

they changed it in v12...
and now i am lazy to edit like thousands of code in my bot to convert it to v12 xd
therefore, i am using v11 rn xd

#

OMG OMG I LUV U SO MUCH ITS WORKING !!!!!

#

TY

#

TY

#

TY

#

np xD

#

U ARE AMAZING

#

lol

#

lmao

#

that was me over reacting 🤣

#

yep xD

#

now i gtg... if u have any other probe, u can ping me tho i will come in like within 30min

#

LMAO

#

I AM SOOO HAPPY

#

okeeee

#

i want to hug u rn for making this work 😊

empty owl
#

uhh

#

if i have code liek this

#
module.exports = class {
  constructor(apikey) {
    this.apikey = apikey
  }
  //functions
}``` and I want to make a new class that you dont have to tell the apikey to again, how would I do that
#

something like

#
let api = new API("key")
api.otherapi.getSomething("something")
#

how would I make this "otherapi" thing

earnest phoenix
#

dog api

#

png file

empty owl
#

NVMmMm

earnest phoenix
#

i am not sure about it cuz i never tried doing so but u can create a new class outside of previous one i think. @empty owl

#

i might be wrong bout it for sure tho xd

astral raven
#

Does anyone know how to keep a bot running 24/7

#

?\

sick cloud
#

@earnest phoenix fyi you'll need to convert to v12 eventually

#

@astral raven buy a vps or server and run your bot on it

#

@empty owl 1, give your class a name pls

#

class MyThing { ...

#

as for that, pretty simple, in the constructor:

  constructor(apikey) {
    this.apikey = apikey

    // add this:
    this.otherapi = {
      getSomething: (something) => {
        return somethingElse;
      }
    }
  }```
earnest phoenix
#

@earnest phoenix fyi you'll need to convert to v12 eventually
@sick cloud no one said it is necessary to convert. What it says is that no support will be provided nor bugs will be fixed in v11 anymore... CC_ZeroShrug

#

as much as i remember . . .

sick cloud
#

it's necessary

#

in october your bot simply won't start

#

discord's making intents mandatory then and v11 won't get intents

earnest phoenix
#

oof

#

will update it asap then

lost rover
#

is the verified bot tag a public flag?

dusky yoke
#

And I don't understand this bug

#

I already did add the; But it did not

earnest phoenix
#

are you using winston? @dusky yoke

dusky yoke
#

yes

earnest phoenix
#

hmm
can you try this one?

client.logger.log("error", err.stack)
#

if it still shows error, send me your codee once

#

code*

dusky yoke
#

ok

earnest phoenix
#

ok

#

lemme see it

#

may i see where u have defined client.logger?
just send the code written here... dont send complete file xd

dusky yoke
#

no problem sending

topaz fjord
#

you never defined client.logger

dusky yoke
#

as well?

earnest phoenix
#

lemme send you code u must write in ur main file

#
const winston = require("winston");
const logger = winston.createLogger({
    transports: [
        new winston.transports.Console(),
    ],
    format: winston.format.printf(log => `[${log.level.toUpperCase()}] - ${log.message}`),
});

client.logger = logger

@dusky yoke

#

write this code in you main file (say, index.js)

dusky yoke
#

ok

restive shell
#

Has anyone ever run into this for their bot? I'm hosting it on EC2 instance
fatal error: ineffective mark-compacts near heap limit allocation failed - javascript heap out of memory
I use mongoose for mongoDB connection, seems to be a memory leak or something occuring?

valid frigate
#

yeah that's a memory leak

#

i have no fuckin clue if your db is at fault here; check to see that it doesnt forget to close/reconnect

restive shell
#

new to nodejs but when exactly would I close the DB? as I need it for almost all of my commands

earnest phoenix
#

i too use mongoose but i never ever faced this problem PepeHmm

restive shell
#

I've added .lean() to some of my selects and seems to have fixed memory rising fast

#

but the error only occurs after a couple of hours of running so ill keep an eye on it

restive shell
#

@earnest phoenix do you close your connection at any point?? My memory usage has only started rising on the server since breaking about 1k servrs

earnest phoenix
#

nope i dont close anywhere...
and my bot is also in 1k+ servers xD

restive shell
#

how much memory does your server have?

sick cloud
#

my bot uses mongo at 40k servers and i don't close the conn

#

but i don't use mongoose so maybe it's a break in their lib

#

try straight mongodb? /s

earnest phoenix
#

i just use it like this:

const Money = require("../models/coins.js") //Schema
Money.findOne({
userID: message.author.id
}, async(err, user) => {
CODE_GOES_HERE
})
restive shell
#

hmm might try mongodb

#

might mean I have a leak in something else

earnest phoenix
#

@earnest phoenix Let me know if u have any of this api(s)

Dog , PNG - gif
Cat , PNG - gif
Hug , PNG -gif
Cookie , PNG - gif

#

Hello how to disable everyone to discord.js

#

i am used {disableEveryone: true} not working

marble juniper
#

what version

earnest phoenix
#

V12

woeful pollen
#

I am making a website with html and css and i made buttons with css, the problem is when I click the button a square outline appears but my button is rounded

valid holly
#

This is only for bot development.

woeful pollen
#

oh oops

slender thistle
#

Not really

placid hazel
#

It is lol

earnest phoenix
#

Hello how to disable everyone to discord.js

#

i am used {disableEveryone: true} not working

placid hazel
#

I answered you @earnest phoenix

slender thistle
#

It's mainly for bot development

placid hazel
#

It's only for bot development.

slender thistle
#

General development is still allowed

winter basalt
#

you can ask about general development here, but yeah because this is a bot list server. most discussions are bot related

placid hazel
earnest phoenix
#

@placid hazel i am using lastest version v12.2.0

placid hazel
#

Hmm..

#

are you using python or js?

earnest phoenix
#
const Discord = require('discord.js');
const client = new Discord.Client({disableEveryone: true})
const fs = require('fs');
const db = require('quick.db');
const moment = require('moment');
client.ayar = db;
const ayarlar = require('./ayarlar.json')
const snekfetch = require("snekfetch")
//require('./util/eventLoader')(client);
const DBL = require("dblapi.js");
const dbl = new DBL(ayarlar.dbltoken, client);
const ms = require("parse-ms")
require('events').EventEmitter.defaultMaxListeners = 70;
require('events').defaultMaxListeners = 70;
require("ms")```
#

My bot.js

#

@placid hazel js

placid hazel
#

hmm wait .. no

#

1 sec

earnest phoenix
#

Ok

placid hazel
#

ok so first try

earnest phoenix
#

disableEveryone doesn't exist in v12

placid hazel
#

@earnest phoenix

#

it does

#

just wait

earnest phoenix
#

it does not

placid hazel
#

I have the solution.

earnest phoenix
placid hazel
#
const Client = require("discord.js");
const client = new Client({
    disableEveryone: true
});
earnest phoenix
#

disableeveryone does not exist in v12

#

you cannot use it if it doesn't exist

placid hazel
#

It works.

#

So it does.

earnest phoenix
#

you're using v11

placid hazel
#

nope

#

12

#

I have all the versions downloaded.

#

that's why

earnest phoenix
#

it can't work if it doesn't exist

placid hazel
#

🤦‍♂️

#

As I said

#

It works for me.

earnest phoenix
#

ok

#

stop playing dumb

#

Okey i will try it

placid hazel
#

Bruh??

#

I made disableEveryone possible in v12.

#

Because you say it's "impossible".

earnest phoenix
#

i never said that

#

i said

#

disableEveryone 👏 does 👏 not 👏 exist 👏 in 👏 v12 👏

placid hazel
#

well

placid hazel
#

disableEveryone - does - exist - in - v12

copper cradle
#

nbuther check your d.js version

earnest phoenix
#

it literally does not are you blind

#

click on the link above and you'll see no occurance of disableEveryone

copper cradle
#

disableEveryone was removed in v12

#

you're using an older version

placid hazel
#

@copper cradle I have all the versions installed at once.

#

As I said

slender thistle
#

And which one is actually used

copper cradle
#

🤦‍♂️

earnest phoenix
#

Smh.

copper cradle
#

imagine

placid hazel
#

every - single - version

slender thistle
#

Also, why

earnest phoenix
#

at this point they're either trolling or they're genuinely not smart

copper cradle
#

probably 13

slender thistle
#

I'm genuinely curious in the backstory behind such decision

placid hazel
#

You guys are just low IQ's right now. Let's just end this convo before drama is made.

earnest phoenix
#

yeah he's trolling

copper cradle
#

go to your main file

#

and do the following

#

console.log(require('discord. js').version)

placid hazel
#

I have a host.

copper cradle
#

and?

placid hazel
#

It cannot log things. Just errors.

copper cradle
#

you can

earnest phoenix
#

console.error

placid hazel
#

not

#

I'm using Heimsnet.

earnest phoenix
#

they're trolling, zsnails lol

copper cradle
#

Ik

placid hazel
#

@earnest phoenix How tf?

copper cradle
#

I'm just bored lmao

slender thistle
#

Send a message in a channel then

copper cradle
#

eval

#

you could do a lot of things, but hey, we're the low IQ ppl right

placid hazel
#

Trolling is when you're pretending to be dumb or pranking someone, when you're actually smart or know it etc.

slender thistle
#

Let's not cause more shit with unnecessary comments

#

Thank you

earnest phoenix
#

@earnest phoenix ```
rbd/pnpm-volume/3672d489-bc81-431f-946e-a054c7dc3828/node_modules/.registry.npmjs.org/discord.js/12.2.0/node_modules/discord.js/src/client/Client.js:4239:35 AM

throw new TypeError('CLIENT_INVALID_OPTION', 'disableMentions', 'a string');9:35 AM

^9:35 AM

9:35 AM

#

what's your code

slender thistle
#

That's not the full traceback, is it

earnest phoenix
#
const Discord = require('discord.js');
const client = new Discord.Client({disableMentions: true})
const fs = require('fs');
const db = require('quick.db');
const moment = require('moment');
client.ayar = db;
const ayarlar = require('./ayarlar.json')
const snekfetch = require("snekfetch")
//require('./util/eventLoader')(client);
const DBL = require("dblapi.js");
const dbl = new DBL(ayarlar.dbltoken, client);
const ms = require("parse-ms")
require('events').EventEmitter.defaultMaxListeners = 70;
require('events').defaultMaxListeners = 70;
require("ms")```
#

you're using the wrong type

placid hazel
#

disableMentions? wtf

earnest phoenix
#

@earnest phoenix you can fix it and send code please

#

no

slender thistle
#

We do not spoonfeed in this server

placid hazel
#

You have the "bot developer" role

earnest phoenix
#

{disableMentions: "all" }

#

True or false?

placid hazel
#

Who uses disableMentions? I mean ??

slender thistle
#

🙄

placid hazel
#

I just noticed shivæ is one of the mods.

earnest phoenix
#

image generator api

placid hazel
slender thistle
#

Nooo

earnest phoenix
#

bruv

haughty night
#

Cant even read channel descriptions

slender thistle
earnest phoenix
#

am confused

#

oh

placid hazel
#

same

#

hm

earnest phoenix
#

well

placid hazel
#

uh

earnest phoenix
#

image generator api pls

#

json get

placid hazel
#

what

earnest phoenix
#

nvm

#

ping?

#

i got a ping here

#

@earnest phoenix Let me know if u have any of this api(s)

Dog , PNG - gif
Cat , PNG - gif
Hug , PNG -gif
Cookie , PNG - gif
@earnest phoenix u got the answer or want it?

#

i still need it

#

ok gimme 2min i will send ya

#

ok ,tysm ✨

#

idk of cookie...

#

its ok

#

just send the ones u know

#

for others :
lemme copy them from my code xd me bad in remembering these stuffs xD

#

@earnest phoenix

#

oh

#

nice

#

amma try them

#

ty

#

np

#

is this right?

#

client.on("message", async(message) => {
  const command = message.content.toLowerCase();
  if(command === Prefix + 'cat') {
    let msg = await message.channel.send("Fetching");
    fetch('https://aws.random.cat/meow')
        .then(res => res.json())
        .then(json => {
            let embed = new Discord.MessageEmbed()
                .setTitle(json.title)
                .setImage(json.url)
            msg.edit(embed)
})  
} 
});
#

for some reason it sends fetching then it sends a embed with undefined

#

@earnest phoenix ?

#

just a sec

#

u need to edit it a bit

#

it is not having same json.title and json.url

#

replace json.title with some text
and replace json.url with json.file for cat image & json.message for dog image API

#

mhmmmm

#

oh ok

#

every API is not same...

#

i didint know

placid hazel
#

Woah ... right as I clicked your profile @earnest phoenix you started VSC.

earnest phoenix
#

lol i am in VSC for more than 3 hours xD

placid hazel
#

It started glitching and stuff. lol

#

No like, I think you opened a new file.

earnest phoenix
#

making a custom bot for a client...
btw, no chatting here xD

placid hazel
#

As I clicked. ohh yeah lol

earnest phoenix
#

i dont understand the reaction link

#

like for slap

#

and hug

placid hazel
#

meme command is the easiest

earnest phoenix
#

lemme tell for example, if u wanna send "slap" image:

#

?

placid hazel
#

Imgur API?

earnest phoenix
#

idk

#

she sent me a random api idk 🤣

#

https://nekos.life/api/v2/img/slap

#

oh

#

she

placid hazel
#

..

earnest phoenix
placid hazel
#

ok..

earnest phoenix
#

wait

#

r u a male?

#

yes

#

well shit

#

lmao

#

i didnt even know 🤣

#

sry

#

for hug cmd:
https://nekos.life/api/v2/img/hug

#

lol i dont really mind it xD

#

for this is it .setImage(json.file)?

sick cloud
#

imagine using client mods

earnest phoenix
#

just a sec... lemme check its api

sick cloud
#

@earnest phoenix don't use nekos.life

earnest phoenix
#

json.url

#

why?

#

y?

sick cloud
#
  1. your bot will get denied here
  2. it has nsfw images of younger chars (afaik)
earnest phoenix
#

lol we are not using nsfw tho xd
but i didn't know that

#

i dont want nsfw

#

although i used it in my custom bot xD

#

i am just making someone hug

#

also slap

sick cloud
#

the sfw endpoints have nsfw

#

because it's a bad api

earnest phoenix
#

idc if i dont use it 🤣

#

applied for weeb.sh about 3 months ago and yet no reply xd

sick cloud
#

¯_(ツ)_/¯

#

on a side note, is there any easy way in css to make an element opaque but not it's content

earnest phoenix
#

i am just a NOOB in website development... i just know basics for it so, idk about it xd

sick cloud
#

nvm got it

cinder dove
#

Happy b-day @bitter sundial

sick cloud
bitter sundial
cinder dove
#

oh i thought is general

#

mb

zealous urchin
#

@commands.has_permissions(manage_channels=True)
Why this decorator makes other commands stop?
When I add this code, The whole commands are affected

    @commands.command(name="name", usage="usage")
    @commands.has_permissions(manage_channels=True)
    async def _command_name(self, ctx: commands.Context):
        pass
haughty night
#

@sick cloud background: rgba(0,0,0,.5)

#

Oh shit, you already got it

#

Didnt read it

#

My bad

sick cloud
#

yea

#

@weak parrot ^

weak parrot
#

Let's just not (no matter if it's a lyric or not)

#

Also not the right channel to talk random bs in the first place

sick cloud
#

how do i fix that lol

#

i want the background to stay full screen and not move but let the content move fine

haughty night
#

background-size: cover

#

background-repeat: no-repeat

#

@sick cloud

sick cloud
#

err that stretches it

earnest phoenix
#

@earnest phoenix my bot is finally done , thanks for every single character u wrote , it helped me a lot , and if my bot gets famous i will give u credit , u are such an amazing coder ✨

and i think we should be friends!
(if u want)

✨ ⭐

sick cloud
#

yeah that looks wrong

#

basically i want the image to fill the page fine but not scroll or move

haughty night
#

Wait, you want that one pic to cover the whole body?

sick cloud
#

only the content can scroll

#

yea

earnest phoenix
#

@earnest phoenix my bot is finally done , thanks for every single character u wrote , it helped me a lot , and if my bot gets famous i will give u credit , u are such an amazing coder ✨

and i think we should be friends!
(if u want)

✨ ⭐
@earnest phoenix np it was great to help ya

#

wanna be friends?

haughty night
#

So why are there 2 pics? Or is that the one pic?

sick cloud
#

that's one

#

i have a div in the middle

earnest phoenix
#

ok i dont mind and also, no chatting here AkkoLaugh

sick cloud
#

i want the bg to stay like this fixed but let the content divs scroll fine

haughty night
#

So, it still moves even after background-repeat: no-repeat

sick cloud
#

yeah

haughty night
#

Aight wait a sec

sick cloud
#

it does

haughty night
#

Try this background-attachment: fixed;

#

That should stop it from moving

sick cloud
#

works perfectly, cheers

haughty night
#

No worries

sick cloud
#

one more question, is there an easy enough way to make a navbar that's fixed at the top of the page, disappears when you scroll down but appears when scrolling back up

#

currently my nav just stays at the top which is fine but you have to scroll up to change pages

haughty night
#

So, you want it to be always visible?

sick cloud
#

pretty much, but only disappear when you scroll down

#

if you've used chrome on android it does that with its header bar

haughty night
#

So, you want it visible the moment you scroll up?

sick cloud
#

yep

#

so while scrolling down and reading it hides, but when you scroll up at all it comes back

haughty night
#

Yae, then you'll have to use js

#

Thats the way i know at least

sick cloud
#

mmkay

haughty night
#

For reference

sick cloud
#

and also, web fonts, can i add my own custom ttf font files

#

ty

haughty night
#

Np

#

And yes, you can use costum ttf font files with @font-face iirc

sick cloud
#

cool

#

ty

near ether
#

how come i get crazy memory leaks whenever discord's api starts acting up?

#

is it something bc of djs and caching?

sick cloud
#

is there any way to make a border on a <p> extend the full content length

haughty night
#

Like in the pic above? @sick cloud

placid hazel
#

why is there a big I

#

||I||

sick cloud
#

yeah

#

the small border already there is only on the first line

#

but i drew how long it should be

haughty night
#

border-left: 1px solid black;

#

You can play with the px to make it bigger

sick cloud
#

already using it but it only puts a border on the first line

haughty night
#

on what element did you use the border-left: 1px solid black;?

sick cloud
#

the p

haughty night
#

Is all the text in the <p> tag?

sick cloud
#
<p class="quote">...</p>

p.quote
    border-left: 2px solid #140560
#

it all is

haughty night
#

hmmm, tbh i dont see why it doesnt work, only if you have an other <p> tag with <p>"to keep you"</p>

#

Could you send me the html code block?

sick cloud
#

that's it

#

just a <p>

earnest phoenix
#

This is probably gonna sound really dumb but how can I connect the vps IP to run my dashboard on a domain url

sick cloud
#

put the code on the vps and set an A record of the domain name to the server ip

haughty night
#

hmmm, maybe try this .quote{ border-left: 2px solid #140560; }

#

p.quote should have worked tho

earnest phoenix
#

put the code on the vps and set an A record of the domain name to the server ip
@sick cloud oh it's just an A Record

short idol
#

Whats wrong

honest perch
#

It cant find the module

#

Pretty obvious

short idol
#

I know but we don't download modüle its get error

honest perch
#

You need to install the module

short idol
#

We try but it always gets error

honest perch
#

What error

short idol
#

Modüle don't download

honest perch
#

Yes but what error

short idol
#

Wait

#

It always get this error

earnest phoenix
honest perch
#

@short idol the module "canjot find" doesn't exist

#

But you're trying to install it

earnest phoenix
#

How to check if a member has a specific word in name ? ( not nickname )

#

in what language and library

#

discord.js v12

#

Ok, thank you

gaunt blade
#

dbl auto post stats and vote event doesnt work

summer torrent
#

@short idol update ytdl

earnest phoenix
#

Hey how to do phone number verification in lbc
.. please

summer torrent
#

lbc?

gaunt blade
#

I made myself a custom version of the Client instance, can that be the issue?

earnest phoenix
#

Lbry

gaunt blade
#

@short idol update ytdl
@summer torrent ytdl works fine for me

earnest phoenix
#

Please someone

summer torrent
#

@earnest phoenix which library

earnest phoenix
#

I have lbry account...and I can't able to phone number verification in my region.....so tell me additional method

summer torrent
#

is this code related

earnest phoenix
#

Yes dude...

#

I have to receive cone through phn nbr

#

Code

summer torrent
#

I mean is this code/development related? Javascript, python, etc.

mossy vine
#

yeah youre definitely in the wrong place

summer torrent
#

Because this channel is for chatting about development

earnest phoenix
#

Where is the right place... suggest me please

summer torrent
earnest phoenix
#

Where I have to go for my problems

#

You are not using lbry...tell me as personally

summer torrent
#

what is lbry? Website?

earnest phoenix
#

Yes

#

Which site are you working....tell me dude.
Tell me best earning site

summer torrent
earnest phoenix
#

Yes

summer torrent
earnest phoenix
#

I directed to this page

#

White theme

#

Please help me to solve my blunder problem

golden condor
#

Hi, not sure if this is relevant, but I am having issues with Vs code live share and it asks me to sign in every time

earnest phoenix
#

So I'm trying to point my dashboard to my vps ip I have set the proxy but it says the website is down, now I made a, A record with the word guard as that is the beginning of the sub domain I want and pointed it to my vps ip with the port 80 open what have I done wrong here?

#

Its saying address already in use

honest perch
#

my bot is being stupid and slow again

astral remnant
#

Damn

honest perch
#

like its not a network issue as my other bot works fine

#

i dont have any error logs

earnest phoenix
#

just wondering if someone can help me

#

im getting require(...) is not a constructor

#

var http = require('http'),
httpProxy = require('http-proxy')

summer torrent
#

do you exporting that file blobthinking

#

show code

honest perch
#

const http = require('http');
const httpProxy = require('http-proxy');

earnest phoenix
#

const http = require('http');
const httpProxy = require('http-proxy');
@honest perch i tried that before and it said the same thing

tight plinth
#

did you installed http-proxy module

earnest phoenix
#

do you exporting that file :blobthinking:
@summer torrent yes it exports the whole command folder

#

did you installed http-proxy module
@tight plinth i did yes

tight plinth
#

What even is http-proxy

pale vessel
#

a proxy

still merlin
#

Anyone know why my bot isnt logging anything? my friend keeps leaving and joinng my server hoping it will work but it dosnt. the logging thing is

client.on("guildMemberAdd", (member) => {
  const channel = member.guild.channels.cache.find(
    (ch) => ch === serverlogchannel
  );
  if (!channel) return;
  let serverembed = new Discord.MessageEmbed()
    .setTitle("New Member")
    .setColor("#3f48cc")
    .addField(`User`, `${message.member}`)
    .addField(`Joined At``${message.member.joinedAt}`)
    .addField(`Total Members Now`, `${message.guild.memberCount}`)
    .setFooter(`👋 🤯`);

  return channel.send(serverembed);
});
``` set log command
#
client.on("message", (message) => {
  let args = message.content.substring(prefix.length).split(" ");

  switch (args[0]) {
    case "setlogchannel":
      if (!message.member.hasPermission(["ADMINISTRATOR", "MANAGE_CHANNELS"]))
        return message.channel.send(
          "**error** You need the manage channels or administrator permission to do this!"
        );

      if (!message.guild.me.hasPermission(["ADMINISTRATOR", "MANAGE_CHANNELS"]))
        return message.channel.send(
          "**error** I don't have the correct permission to do this, Please give me the manage channel's permission"
        );

      serverlogchannel = message.channel.id;

      const channel =
        message.channel.id +
        message.channel.send(`I have set this channel to the log channel!`);

      break;
  }
});```
pale vessel
#

perhaps you meant ch.id?

#

ch.id === serverlogchannel

still merlin
#

ok thanks!

pale vessel
#

.find would loop through the collection. treat it as an individual channel for the function

#

channels have the id property that you can compare

earnest phoenix
#

flaze are you any good with DNS Records at all

pale vessel
#

probably not but I have set an a record for my vps

earnest phoenix
#

im trying to forward my dashboard to a subdomain

#

ive set the a record name guard and the target is my vps ip

pale vessel
#

what webserver is your dashboard using?

still merlin
#

didn't work

pale vessel
#

well, did you define serverlogchannel in the event?

earnest phoenix
#

im using my localhost on the vps

pale vessel
#

how did you set up the dashboard?

earnest phoenix
#

@pale vessel i think i know why its saying the port is already in use

#

but it says that with any port i open in ubuntu

vernal vapor
#

What is the best database host to use

pale vessel
#

localhost

earnest phoenix
#

I dont understand why when I run my dashboard its saying port 80 already in use but when I run s netstat port 80 isnt even on there

mossy vine
#

@winter yacht advantage: rust, runtime safety, possibly extra runtime speed
disadvantage: compile times, serenity doesnt fully cover the api, memory bullshit

hasty sparrow
#

Apache/NGINX/other already using Port 80

mossy vine
#

also from my experience, serenity doesnt scale at all

#

couldnt get a bot with 600 servers running

restive furnace
#

Just say: some other application is already using the port

#

to Duke ^

mossy vine
#

dropped events, api requests not going through, etc.

white anvil
#

@mossy vine lifetimes are actually super useful

#

rust memory management makes memory leaks nearly impossible

hasty sparrow
#

If it's already known that port 80 is in use, why keep trying to use it?

mossy vine
#

@white anvil im not arguing that, im just saying that serenity often overcomplicates things

clever tree
#

I save my Data with setting[message.guild.id + message.author.id] i want to get the array of the guild with all members. How could i do that ?

golden condor
#

It isn't recommended to use a JSON db

#

As it corrupts easily

clever tree
#

I know. But i dont want to change this now xd
I have a command to set this option for a user. Its easier with JSON and i restart my bot alot times.

golden condor
#

Ok

#

Try for each

clever tree
#
 var levell = JSON.parse(fs.readFileSync("./rqs/level.json", "utf8"))

                var xp3 = levell[message.guild.id + message.author.id]

                const jsonAsArray = Object.keys(xp3).map(function (key) {
                    return xp3[key];
                  })
                  .sort(function (a, b) {
                    return b.xp - a.xp;
                  });
                  
                return console.log(jsonAsArray);

This is my Code.

astral remnant
#

It isn't recommended to use a JSON db
@golden condor Heard that, but still using it xD

pale vessel
#

uh-oh, better do something soon

golden condor
#

@clever tree try use forEach

restive furnace
#

Well, it depends. It isn't on some cases the worst, some cases it might be the best option.

#

Depends what data you save and fetch.

sudden geyser
#

i want to get the array of the guild with all members. How could i do that ?
Do you mean you want to get a list of users from said guild?

clever tree
#

@golden condor Could u give me an example for the forEacghh function i have to use to get every memberstats of that guild ? Im new to coding 😅

golden condor
#

Ok

restive furnace
#

dont use forEach, use for in or for of, if you cant understand them

golden condor
#

Actualt

#

You wanted an array of a guild with all members right?

clever tree
#

@sudden geyser I mean. I have my lvl in Json for every user+guild. Now I want to get all users from the guild and their lvl sorted from high to low for a leaderboard.

golden condor
#

How is it stored

pale vessel
#

doesn't sound so good with json (if)

golden condor
#

You should.probably store it per guild

#

Then users in the guild

clever tree
#

xp[message.guild.id + message.author.id] = { xp: 0, level: 1 }

sudden geyser
#

If the object is every user and you want to filter it by the guild, you can use .filter and check if the key starts with the guild ID, then do the rest of what you were doing. Although, you should reasonably be using something other than JSON, it's not going to be my issue if you have issues down the line.

cinder dove
#

Anyone here uses code-server able to help me with something?

lyric mountain
#

code-server?

cinder dove
#

yes

clever tree
#

@sudden geyser Json is better for me. I restart my bot allot of times. When i change that i will go to db or sth. But i cant figure out how to get all memberxp for the guild.id
I mean. I store everything as guild.id + user.id
So idk how to get only the guild id for the array. :/

lyric mountain
#

ah, it's a web vs code

cinder dove
#

yes

#

If i run it on older version, it works well but I have memory leaks (4gb memory almost). If I try a newer version, it won't work.

#

So I need help :c

lyric mountain
#

define "won't work"

#

does it give any error?

cinder dove
#

I need someone who uses it so I can speak privately with him in DMs

sudden geyser
#

Json is better for me. I restart my bot allot of times. When i change that i will go to db or sth.
Restarting your bot does not make any difference between JSON and a database like SQLite assuming you save it.

But i cant figure out how to get all memberxp for the guild.id
Like how you already have jsonAsArray, you got all the keys of the object. After that, you need to use .filter to check if key.startsWith(guildID). You'll then have an array of guildID + userID where all guildID will be a single guild.

lyric mountain
#

idk if there'll be someone, most people use actual IDEs

cinder dove
#

this is an actual ide.

clever tree
#

@sudden geyser Oh ok. To both. Thanks. I will try it out. Maybe I will get more into databases. But ... Its allot i gues xd

#

@sudden geyser I get an error when trying this : key.startsWith is not a function

var levell = JSON.parse(fs.readFileSync("./rqs/level.json", "utf8"))

                const jsonAsArray = Object.keys(levell).map(function (key) {
                    return levell[key];
                  })
                  .filter(function(key) {
                    return key.startsWith(message.guild.id);
                  })
                  .sort(function (a, b) {
                    return b.xp - a.xp;
                  });
                  
                return console.log(jsonAsArray);
sudden geyser
#

You should be filtering before you map.

clever tree
#

@sudden geyser Thank you <3 :)

lyric mountain
#

maybe the port is in use?

#

open task manager, resource monitor, click on network tab and see if any process is using port 8080

sudden geyser
#

Would it not say something like EADDRINUSE if it were already being used.

lyric mountain
#

is port 8080 allowed in firewall?

sinful belfry
#

maybe try one of those port checker websites, to see if that port is open or being blocked

clever tree
#

How could I map my function only from 1 to 10 ?

let rankindex = 0;

                    let embed2 = new Discord.RichEmbed() 
                    .setColor("BLUE") 
                    .setTitle(`${earthemoji} | **Top Global XP** | ${earthemoji}`)
                    .setDescription(`${jsonAsArray.map(rank => `**[${++rankindex}] -** **${rank.user}**: Level: ${rank.level} | XP: ${rank.xp}`).join('\n')}`);
earnest phoenix
#

do a for loop

#

through your json array

clever tree
#

What do u mean @earnest phoenix

earnest phoenix
#

i meant exactly what i said

clever tree
#

Ok. Then like this : Im new to coding so what do you mean with "for loop"

#

xd

earnest phoenix
#

...a for loop

clever tree
#

Yeah. But how does it work

earnest phoenix
clever tree
#

Thanks. I will try it out. xd
Sry for my stupidity

gaunt blade
#

dbl auto post stats and vote event doesnt work, I made myself a custom version of the Client instance, can that be the issue, and how do I resolve it?

earnest phoenix
#
const { MessageEmbed } = require("discord.js");
const db = require("quick.db");
const ms = require("ms");

module.exports = {
    name: "setup",
    run: async (bot, message, args) => {
        if(!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("**Nu ai permisia necesara sa faci asta!**");

        const filter = m => m.author.id === message.author.id;

        let tag;
        let role;

        message.channel.send("Specifica un tag! Ai timp 30 de secunde pentru a raspunde!")
        message.channel.awaitMessages(filter, {max: 1, time: 30000}).then(m1 => {
            if(m1.first()) {
                tag = m1.first().content;
                db.set(`ServerTag_${message.guild.id}`, tag)
                message.channel.send(`Tagul a fost setat la ${tag}`)
                message.channel.send("Ce rol vrei sa atribui membrilor care au acest rol ?");
                message.channel.awaitMessages(filter, {max: 1, time: 30000}).then(m2 => {
                    if(m2.first()) {
                        role = message.mentions.roles.first();
                        if(!role) message.channel.send("Specifica un rol valid!")
                        db.set(`ServerRole_${message.guild.id}`, role.id); //here
                        message.channel.send(`Rolul a fost setat la ${role}`)
                        message.channel.send("Setupul a fost finalizat cu succes !")
                    }
                })
            }
        })
    }
}

(node:4864) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined

#

help ?

#

debug your code

plucky harness
#

its showing that theres too many connections on my database. So what does it mean? does that mean i need a better host?

earnest phoenix
#

it means you literally spam your database with connections and data

#

basically dossing it

sand thicket
#

That's a broad term, it may be the fact that his database only has one user limits, or two. Which are perfectly reasonable.

Damian, based on your SQL hosting provider, you may need a different host or to host the SQL environment on a Server elsewhere. Google should be able to assist further with that

misty sigil
#

how to react to message after the bot has sent it?

slender thistle
#

mymsg = sendmessage("eeee")
mymsg.react

digital ibex
#

^ but await sending the message

plucky harness
#

thanks

devout wagon
#

thanks for the info, anyone else have some experience with rust compared to nodejs for a discord bot?
@winter yacht compared in what terms?

#

there's a huge difference between those two, that's for sure

#

well, do you know rust?

digital ibex
#

rust is much better for performance, if you're looking for good performance then i'd use rust as node.js is not a thing you'd be using if you're looking for performance

devout wagon
#

yes, but it's not necessarily suited for everything either, at least not if you don't have very good knowledge of it

#

So I wouldn't recommend "defaulting" or switching to Rust if you have little or no prior experience

#

but you can certainly use rust for discord bots, there's one bigger library for it, too

#

serenity it's called i think

cinder dove
#

Bumping my question:

Anyone using code-server 3.4.1 or 3.2.0+? I need some help with it.

indigo flax
#

how do u ban every member with eval?

#

discord.jk

#

js

sinful belfry
#

ur gonna get ratelimited if you don't put a cooldown on that btw

sudden geyser
#

I mean why do you want to do that

#

but it's a simple loop

sinful belfry
#

but just iterate through the member list

indigo flax
#

im testing eval commands

#

in a test server

gleaming glen
#

.forEach

indigo flax
#

theres only like 7 members

#

i invited 7 bots

silent berry
#

@indigo flax have you figured out how to grab/create a invite to another server the bot is in?

indigo flax
#

so i test

#

@silent berry yes

#

but i no use it

silent berry
#

what version of djs u use

indigo flax
#

um

#

it doesnt matter

#

right?

silent berry
#

sometimes it would

indigo flax
#

11.5.1

silent berry
#

i could modify that

indigo flax
#

do u know how to kick or ban every member

silent berry
#

i do not, i am new to js

cinder dove
#

just use forEach.

#

But I don't feel like you would ever need this for any reason (except harm). Also ratelimit is a thing.

topaz fjord
#

you got to delay the shit out of it tho

#

you'll hit rate limits pretty fast

marble juniper
#

make 2 second delay lel

restive furnace
#

just use forEach.
nonono... or actially yes or for in or for of oorrr for(func)

woeful pollen
#

Hmm this is suspicious

#

You wouldn't ever need to ban every member

marble juniper
#

why would you ever

#

there is like no reason to do so

plucky harness
#

what sites would u guys recommend for sql database hosting
hosts rather considering i have multiple user requests at the same time

devout wagon
#

Can't you host it on the same server as your bot?

mossy vine
#

the last part of the post is irrelevant

plucky harness
#

huh?

#

since i asked for best? sure

#

current host is showing too many connections on my database

devout wagon
#

Is it a public database or what

earnest phoenix
#

How to delete all data from mongodb ?

#

from a specific user?

torn ravine
#

how would I convert a map to a valid array so that paginaton can use it

#

serverQueue.songs.map(song => ++index + " - **" + song.title + "**" that's how I call for my queue list

earnest phoenix
#
${message.guild.owner.user.tag}(${message.guild.ownerID})```
TypeError: Cannot read property 'user' of null
#

my serverinfo command works in other servers except dbl

pale vessel
#

owner isn't cached so you have to fetch it first

earnest phoenix
#

you have to cache owner now?

pale vessel
#

await <Message>.guild.members.fetch(<Message>.guild.ownerID)

#

yeah

earnest phoenix
#

well

pale vessel
#

just add a line of code if owner is not defined

#

you don't have to fetch it every time

earnest phoenix
#

yh I was gonna do that

pale vessel
#

okchamp

earnest phoenix
#

yessir

#
const db = require("../../db");
const config = require("../../botconfig.json");
const prefix = config.prefix;

  let newPrefix = await db.get(`Prefix_${message.guild.id}`) ? await db.get(`Prefix_${message.guild.id}`) : prefix
#

help ?

ancient sand
#

@earnest phoenix

amber fractal
#

the message is in a dm

ancient sand
#

cannot read property id

amber fractal
#

make sure to check for dm messages

#

as message.guild in a dm is null

ancient sand
#

wait

#

i take little closer

#

whatever I put with } doesn't work

sudden geyser
#

Go to line 41. Are you missing a semicolon/color/etc.?

quaint hornet
#

i am not too good in glitch but i think is missing a , on line 40

tight plinth
#

or dont use glitch

still merlin
#

how do you create a role in discord.js

sudden geyser
#

what version

ancient sand
#

@quaint hornet same problem with line 40 when i put ,

sudden geyser
#

Remember that JSON is strict. There should be no trailing/dangling comma.

nocturne grove
#

Hello, I receive a lot of PROTOCOL_PACKETS_OUT_OF_ORDER errors with my mysql database. I asked the host to change max_allowed_packet to 500M, they said they changed it but I still receive a lot of those errors. I'm using mysql.createConnection() and am closing that connection after I did the query.

rose spire
#

I want to send content of the last 100 messages of a channel. My code work, but it send 100 times the content of the lastest message (only one). What's wrong?

channel.messages.fetch({ limit: 100 }).then(messages => {
  for (var i=0;i<100;i++) {
    var m = messages.first()
    var msg_embed = new Discord.MessageEmbed()
      .setColor("RANDOM")
      .setAuthor(m.author.tag, m.author.avatarURL())
      .setDescription(m.content)
      .setTimestamp(m.createdTimestamp)
    msg.channel.send(msg_embed)
  }
})```
And, I don't know why, but my bot isn't offline:
```js
bot.on('ready', () => {
  bot.user.setStatus("invisible")
})```
sudden geyser
#

You're only getting the first message? messages.first()

nocturne grove
#

@rose spire you are just getting messages.first() every time

sudden geyser
#

Also why do you want to do that in the first place. That's quite spammy.

rose spire
#

Oh, god

#

I'm so stupid

#

Thanks

nocturne grove
#

you can use an easier for loop like for (const m of messages.array())

rose spire
#

Yeah, thanks!

nocturne grove
#

no problem

rose spire
#

Doesn't work...

channel.messages.fetch({ limit: 100 }).then(messages => {
  for (const m of messages.array()) {
    var msg_embed = new Discord.MessageEmbed()
      .setColor("RANDOM")
      .setAuthor(messages.author.tag, messages.author.avatarURL())
      .setDescription(messages.content)
      .setTimestamp(messages.createdTimestamp)
    msg.channel.send(msg_embed)
  }
})```
#

There's no messages.forEach?

quartz kindle
#

... why do you want to fetch 100 messages and then re-send them all?

rose spire
#

For archive them

quartz kindle
#

thats not a very good idea, but oh well. You should use a for loop with async/await

quaint hornet
#

@ancient sand see the all file and verify than only the last element of each value have no , example : ```json
{
"name": "name",
"version": "0.0.1",
"dependencies": {
"express": "^4.17.1",
"discord.js": "^12.2.0"
},
"engines": {
"node": "12.x"
},
"license": "MIT"
}

quartz kindle
#

there is messages.forEach but dont use it

#
.then(async messages => {
  for(let [id,message] of messages) {
    let embed = bla
    await msg.channel.send(embed)
  }
})
rose spire
#

But, how do I have a variable that changes with each message?

quartz kindle
#

wdym

storm bluff
rose spire
#
channel.messages.fetch({ limit: 100 }).then(async messages => {
  for(let [id,message] of messages) {
    var msg_embed = new Discord.MessageEmbed()
      .setColor("RANDOM")
      .setAuthor(messages.author.tag, messages.author.avatarURL())
      .setDescription(messages.content)
      .setTimestamp(messages.createdTimestamp)
    msg.channel.send(msg_embed)
  }
})
``````diff
- TypeError: Cannot read property 'tag' of undefined```
quaint hornet
#

javascript out of memory

nocturne grove
#

But, how do I have a variable that changes with each message?
@rose spire for each interation of the loop, the m gets another value

sudden geyser
#

Luffy the keyword is: JavaScript heap out of memory

quartz kindle
#

@rose spire message not messages

storm bluff
#

@sudden geyser ?

#

i buy this vps today

#

12 ram

#

wt

#

f

rose spire
#

Oh, yeah, I see

nocturne grove
#

Hello, I receive a lot of PROTOCOL_PACKETS_OUT_OF_ORDER errors with my mysql database. I asked the host to change max_allowed_packet to 500M, they said they changed it but I still receive a lot of those errors. I'm using mysql.createConnection() and am closing that connection after I did the query.
@quartz kindle do you know anything about this?

quaint hornet
#

your bot is trying to do some heavy stuff

quartz kindle
#

its crashing on 2gb ram

strong tundra
#

is that 12mb or 12gb

storm bluff
#

gn

quaint hornet
#

your vps have 12 ram

storm bluff
#

gm

#

gb

strong tundra
#

oh i see lol

storm bluff
#

lol

quaint hornet
#

but how many you is putting to the javascript

storm bluff
#

idk

#

don't ask

quartz kindle
#

@storm bluff try node --max-old-space-size=4096 yourFile.js

strong tundra
#

it doesn't look like it's currently on the vps?

#

or is it a windows vps

storm bluff
#

yourFile.js == server.js
??

strong tundra
#

yeah

quartz kindle
#

yes, or whatever you use

storm bluff
#

oke

nocturne grove
#

your bot is trying to do some heavy stuff
@quaint hornet
its crashing on 2gb ram
@quartz kindle
Is that about my question?

rose spire
#

One last thing, if there is a image with a message, how can I get the link?

nocturne grove
#

sorry for all those mentions but I want to keep things clear 🙂

quartz kindle
#

message.attachments is a collection of attachments

#

each attachment has an url property

#

@rose spire

#

@nocturne grove it was for luffy

#

idk about that error, havent seen it before

nocturne grove
#

ohh I'm sorry didn't see that

storm bluff
#

@quartz kindle not work

nocturne grove
#

hmm okay

storm bluff
#

tim offline

#

OFFFFFFF

quartz kindle
#

@storm bluff ?

storm bluff
#

mongodb is laging so much why

#

@quartz kindle .

quartz kindle
#

idk i dont use mongo

#

are you getting the memory error again?

#

show error

storm bluff
#

no

#

but he is laging

quartz kindle
#

do you use pm2?

storm bluff
#

nope

#

nodemon

quartz kindle
#

do you track cpu/memory usage ?

clever wing
#

pm2 is best lmaooooooooooo

storm bluff
#

@quartz kindle mmmm

#

idk

#

no

quartz kindle
#

you never did anything to check how much cpu/ram your bot is using?

#

like task manager? or vps admin panel?

storm bluff
#

oke 1m

#

@quartz kindle

quartz kindle
#

go to details

#

show memory usage of your bot

storm bluff
#

oke

#

2 gb?\

#

wtf

#

why

strong tundra
#

oh it is a windows vps

clever wing
strong tundra
#

interesting

clever wing
#

this shit pissing me

earnest phoenix
#

imagine making a bot from mobile with "mobile ssh"

quartz kindle
#

@storm bluff i said go to details

#

and look for your bot's process

storm bluff
#

oke

quaint hornet
#

its like you bot is making something than he dont have a permission

#

in a server

#

like delete a message

clever wing
#

@earnest phoenix i have pc and i using pc for coding but

#

When im not home then i see if bot is ok or no

storm bluff
clever wing
#

logic

storm bluff
#

1GB

earnest phoenix
#

Ok, i understood sorry.

storm bluff
#

wow

#

@quartz kindle

earnest phoenix
#

@storm bluff ram?

storm bluff
#

yup

earnest phoenix
#

??

quartz kindle
#

@storm bluff so your bot is using 1.4gb ram right now

#

how many servers?

storm bluff
#

3

earnest phoenix
#

lol

storm bluff
#

this bot is a testing bot

quartz kindle
#

what

storm bluff
#

wtf

quartz kindle
#

your bot is on 3 servers?

quaint hornet
#

how

quartz kindle
#

then you have a severe memory leak

quaint hornet
#

3 servers are using 2 GB of ram

storm bluff
#

LOlo

quaint hornet
#

you are render videos or 8k images? for all at same time?

storm bluff
#

@quartz kindle testing bot 2 gb
what if i put the bot

#

LOL

#
  • 180
quartz kindle
#

your testing bot has a problem

storm bluff
#

servers

quartz kindle
#

you need to fix it

storm bluff
#

how

quartz kindle
#

i dont know, look in your code

storm bluff
#

i can show the problem

rose spire
#

undefined when there is an attachement?

if(message.attachments) {
  msg_embed.setThumbnail(message.attachments.url)
}```
slender thistle
#

someArray.url?

rose spire
#

What's wrong? 👀

slender thistle
#

You're trying to access a url property of something that doesn't have such property

storm bluff
#

@quartz kindle tim how i can show the err
idk how
use progrem or what???

quartz kindle
#

?

rose spire
storm bluff
#

how can i fix this problem @quartz kindle

quartz kindle
#

the problem is your code

#

i cant help you

#

you have a memory leak or an infinite loop somewhere

#

a bot on 3 servers cannot possible use 1.4gb ram

#

unless its on a server with like 500k members

#

so your code is doing something bad, you have to find it, you coded it

fresh cloak
#

hello: Is there a way I can send a join message and have an icon reaction in the middle of that message: example "Click the bell for access: 🛎️"

slender thistle
#

Where do you want to send the join message?

fresh cloak
#

when a new user joins the server, I want to send that message to a welcome channel. "welcome... blah blah.. click here for access: 🛎"

slender thistle
#

Oh, that's not possible with bot accounts. You can use reactions and tell the user to react with X emote, though

strong tundra
#

i mean, if it was an embed and the bell was a link

fresh cloak
#

I cant believe nobody has come up with a fix for that. Inline reactions. 😄

still merlin
#

you could use a embed

strong tundra
#

it would be possible but i wouldn't wanna go through that

#

bleh

slender thistle
#

A hyperlink in an embed sounds appropriate, yeah

strong tundra
#

i'd just go with reactions personally though

fresh cloak
#

I have new users that keep getting confused by the reactions on the bottom of the message. (keywords: New users) they don't get it, no matter how you word the message. I thought it might be simpler to inline the reaction.

slender thistle
#

Understandable then

strong tundra
#

ah i see

#

i guess what you could do is generate a url that has a special code for that specific user in it

#

you;d need to have a webserver that could get that code and send a webhook or something similar to your bot

fresh cloak
#

that's an idea. I'll play around with it.

#

thanks

earnest phoenix
#

Flower Image API ?

GET
discord.js
PNG - JPEG

#

v12

#

how do i know how many guild(s) my bot is in?
Discord.js v12

#

@rapid plaza "development"

rapid plaza
#

oh sorry

pale vessel
#

You forgot []. [@earnest phoenix]

marble scaffold
#

Is it possible to send notifications to everyone in the sever when a youtube vid goes live or any other socials?

digital ibex
#

yes

torn ravine
#

how would I turn a map into an array

fiery stream
#

message.lower() that is how you lower case the msg right? in py

pale vessel
#

assuming message is the content, yes

fiery stream
#
        cog = bot.get_cog("PrefixStore")
        message.lower()```
#

thats my code

#

so yeah?

#

@pale vessel that doesnt work

pale vessel
#

what's message?

#

is it a string?

fiery stream
#

wait nvm no its not a string

pale vessel
#

how did that not throw any error

fiery stream
#

message has no attribute lower()

#

wait may i ask how do you handle commands if user types em uppercased

pale vessel
#

make them lowercased lul

fiery stream
#

that what i wanna do lol

pale vessel
#

check for the content attribute in message

#

i'm not sure how to in dpy

#

or python in general

fiery stream
#

wait i got this now

#
        commands.Context = commands.Context.lower()
        self, message: discord.Message, *, cls=commands.Context
    ) -> commands.Context:
      ```
#

it gives me error with context on second line

digital ibex
#

what u trying to do?

fiery stream
#

lowercase the msgs

#

so it can pick up uppercased commands

torn ravine
#

how would I turn a map into an array so that I can use it in an array embed

#

my song queue is a map but I would like to make it an embed with pages

#

but to do this I need to make it an array

mossy vine
#

@torn ravine a map has both keys and values, which dont translate to a 1 dimensional array

torn ravine
#

is there a way I can use an array instead of a map?

mossy vine
#

i have no idea why its a map in the first place

true ravine
#

Can't you just be like .map(e=>e.DesiredProperty) or am I missing something here?

pale vessel
#

i don't think you can map a map lol

earnest phoenix
#

looping fishy on me until my bot reaches 20 users

#

been going for 3 hrs by now

#

i need 5 more guilds to add it

#

bruh this song

#

is

#

earrape

pale vessel
#

ok but does this have to do with development though

torn ravine
#

wrong channel

earnest phoenix
#

Oh

#

M,Y B

#

wrong channel

#

my b

pale vessel
#

if6, you can try iterate through the map

torn ravine
pale vessel
#

or just use arrays

#

why were you using map for queue anyway

torn ravine
#

when I started programming I used maps

pale vessel
#

refactor your code

torn ravine
#

yea there is alot of stuff I gotta clean up now that I think about it

tulip ledge
#

.setThumbnail(user.avatarURL) why does this not work? user is message.author

pale vessel
#

doesn't work as in what

#

error?

#

please explain

tulip ledge
#

No error

pale vessel
#

first off, what's your discord.js version

tulip ledge
#

How do Isee that again?

pale vessel
#

Discord.version

#

or npm ls discord.js

tulip ledge
#

12.2.0

pale vessel
#

avatarURL should be a function in v12

tulip ledge
#

So?

pale vessel
#

try making it a function

earnest phoenix
#

Can someone help me

#

With partner bot

tulip ledge
#

Alright ty

slender thistle
#

-wrongserver

gilded plankBOT
#

Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of our website. If there isn't a button that says Join Support Server, then we can't help you. Sorry :(

earnest phoenix
#

It said to come here ;-;

slender thistle
#

Where

tulip ledge
#

How do I add a blank field

pale vessel
#

use the unicode character

tulip ledge
#

?

marble scaffold
#

Is it possible to send notifications to everyone in the sever when a youtube vid goes live or any other socials?
How do you do this?

pale vessel
#

idk, ifttt?

earnest phoenix
#

you utilize the youtube api to get a websocket connection to youtube and a ws message whenever a selected streamer goes online

#

and combine that with a @everyone and there you go

marble scaffold
#

Is there a code for it?

pale vessel
#

oh god

earnest phoenix
#

there are several but i wont spoonfeed

marble scaffold
#

Will there be some on github?

earnest phoenix
#

maybe

quaint hornet
#

How do you do this?
Add a command rha mention everione in a server when called and put the link tha has been requested in comand like
!newvideo url

marble scaffold
#

Alright

autumn haven
#

Try it and see

marble scaffold
#

@quaint hornet where do I put the url?

quaint hornet
#

On the argument of comand

#

You can get the server notification channel to send the message of url or just ask on comand

marble scaffold
#

Command.

#

wdym by that?

quaint hornet
#

Wdym?

marble scaffold
#

Do you have an example of the code?

quaint hornet
#

When te bot receives a message you cant split it by spaces

marble scaffold
#

youtube.js?

#

As the file

quaint hornet
#

A file no

#

My bot uses a diferent way to run comands

digital ibex
#

When te bot receives a message you cant split it by spaces
@quaint hornet you can't? wdym

grand dagger
#

why can u not

copper cradle
#

When te bot receives a message you cant split it by spaces
@quaint hornet you clearly don't know what you're talking about

arctic osprey
#

@earnest phoenix Depends when you run the command. if ALL the command file does is delete one message, it would delete your command you typed..
If your command replies, THEN deletes, it will delete its own reply... etc etc

#

Delete again in your command file

#

Run another message.delete() or whatever you are using

#

Best to add a delay also. So the user has a time to read the reply before its deleted.

#

await message.channel.send(message.author+' This is the reply!!.').then(d_msg => { d_msg.delete(5000); }).catch(error => console.log(`Error: ${error}`));
@earnest phoenix

jade jungle
#

How would I put total members in my bot's status like this:
Playing c! | (servers) servers | (amount of users across all servers) (users)

arctic osprey
#

@jade jungle guild.memberCount ??

jade jungle
#

No but for users across all of the servers the bot is on

#

@arctic osprey

arctic osprey
#

@jade jungle bot.guilds.cache.size = guild count

jade jungle
#

Is it still guild.memberCount

#

Thats for servers i mean users across all servers

arctic osprey
#

bot.users.cache.size = user count of all guilds

jade jungle
#

Like counting every member in every guild that the bot is in

#

Okay

sudden geyser
#

^ If you want the total user count, you're going to want to iterate through each guild and add up .memberCount

earnest phoenix
#

how i do a exec with child_process? (js)

arctic osprey
#

And is very much a cleaner way to do it @earnest phoenix . Cheers 🙂

quaint hornet
#

@quaint hornet you clearly don't know what you're talking about
i know what i am talking just dont know how to speak it correctly in english (my country dont have english as main language)

jade jungle
#

I made a pay command and there is no errors but when I try to pay someone it doesnt respond the only time it says anything is when i do c!pay but not when mentioning or saying a users name
Anyone have any idea how to fix?
This is the code: https://sourceb.in/58b834a696

astral yoke
#

how would i make it so that my bot dosent join a server

#

so its kinda like

#

"blocked"

#

from the server

#

so if they try to invite him he just leaves

quaint hornet
#

message.delete() shold resolve it

jade jungle
#

I made a pay command and there is no errors but when I try to pay someone it doesnt respond the only time it says anything is when i do c!pay but not when mentioning or saying a users name
Anyone have any idea how to fix?
This is the code: https://sourceb.in/58b834a696

#

Can anyone help?

paper phoenix
#

how would i make it so that my bot dosent join a server
@astral yoke:

function guildCreate( guild ) {
 if( disallowedGuilds.includes( guild.id ) )
    guild.leave( );
}
astral yoke
#

tysm