#development

1 messages ยท Page 1057 of 1

hazy sparrow
#

oh i got it

gray zealot
#
if (command === `${prefix}caat`) {
            const { catFile } = await fetch('https://aws.random.cat/meow').then(response => response.json());
        
            message.channel.send(`${catFile}`);
        }
```it is supposed to get an image from catFile then send it... any ideas why it does not work?
pale vessel
#

it's not called catFile

gray zealot
#

oopsss ๐Ÿ˜‚

earnest phoenix
#

โ€Ž

#

โ€Žโ€Ž.

gray zealot
#

lol sorry

hazy sparrow
#

can i make something like i want to make the bot send either a or b but i want the chance to send a 75% and b 15%

slender thistle
#

math.random() <= 0.15

hazy sparrow
#

thank you so much

#

wait i did not get you

#

so will it be lke

math.random(b) <= 0.15
#

@slender thistle

slender thistle
#

if (random <= 0.15) a
else b

hazy sparrow
#

ohh

#

ty

earnest phoenix
lusty quest
#

3-4 Weeks

earnest phoenix
#

bruh

lusty quest
#

but its possible that it already aproach 5 weeks

earnest phoenix
#

it's going to start lowering

#

especially because of the intents update approaching

#

they're going to have to get more people on the team

#

is a lie?

#

wtf

lusty quest
#

?

earnest phoenix
#

And what advantages does it give you to be verified?

#

badge

#

._.XD

sudden geyser
#

grow past 100 servers, some intents if you may need them, upcoming updates (such as your bot having something to do with the little plus on the message bar; check the medium post), etc.

For a full list you should check the medium post

#

also the badge doesn't really mean anything

earnest phoenix
#

I know

#

but he asked about advantages

sudden geyser
#

ah yes more dms

earnest phoenix
#

intents are more trouble haha

#

91 server

#

nice

lusty quest
#

intends are not that bad.

earnest phoenix
#

I already use em in my bots

#

they're very useful

#

nvm I dont, oof

#

cutting out presence updates alone lowered resource usage by half for some

#

how come?

#

right.. caching

#

these are huge bots

#

my bot is at 200mb i think

#

115 guilds

#

receiving thousands of presence updates a second

#

that's kind of big

hazy sparrow
earnest phoenix
#

im presuming you're using djs

#

i used to hold steady 150mb on 2.1k

restive furnace
#

some big bots still receive 8million events/seconds

#

second*

sudden geyser
#

sounds like typing start

earnest phoenix
#

5 weeks bruh

#

intents thankfully resolve the issue of events polluting resource usage

#

how i can do categories on my help command

lusty quest
#

@earnest phoenix if you use d.js its maybe worth looking into d,js-light

earnest phoenix
#

umm

#

prevents caching

#

wont that become more api spammy

lusty quest
#

i use 80mb ram with 110 guilds

#

not really since its close to d.js v11

earnest phoenix
#

is what i want to solve

#

Wait so I'd have to recode my bot and remove all v12 functionality

lusty quest
#

no you keep the v12 syntax

earnest phoenix
#

Oh?

lusty quest
#

just not everything is cached

earnest phoenix
#

will it break anything in my bot

lusty quest
#

it will break everything that uses the cache if its disabled

#

but you can fetch it to cache it

earnest phoenix
#

ok so I would have to kind of recode

#

and fetch to cache

lusty quest
#

if you want a better explanation ask tim he made the lib

earnest phoenix
#

Tim as in @quartz kindle ?

lusty quest
#

yes

earnest phoenix
#

Oh

#

Ill wait for his reply

lusty quest
earnest phoenix
#

ik

restive furnace
#

or use eris PES_CoolNerd

earnest phoenix
#

that would require a huge recode

#

totally different library

#

wtf is this

#

a discord server

lusty quest
#

nothing you should worry about

knotty steeple
#

its not that different

mystic tundra
#

lol

autumn aspen
#

Welp

#

Guys anyone knows the cooldown command and the command that do so u cant kick urself

#

?

hazy sparrow
#

how can i make my bot edit the message it sent after 5 seconds (not instant)

autumn aspen
#

how can i make my bot edit the message it sent after 5 seconds (not instant)
@hazy sparrow wait

hazy sparrow
#

wut?

lusty quest
#

@autumn aspen check if the mentioned user is = command author if yes return

#

and for cooldown look into the d.js guide

#

@hazy sparrow setTimeout

hazy sparrow
#

i didnt get you

autumn aspen
#
 msg.delete();
        msg.channel.bulkDelete(args[0]).catch(e => { msg.channel.send("You can only delete 100 messages at once!")});
        msg.channel.send(`Successfully deleted \`${args[0]} messages\`!`).then(m => m.delete({ timeout: 5000 }));
#

@hazy sparrow

lusty quest
autumn aspen
#

thats the end

hazy sparrow
#

ty

earnest phoenix
#

guys anyone know how I can check what is eating up the most ram?

autumn aspen
#
        msg.channel.bulkDelete(args[0]).catch(e => { msg.channel.send("You can only delete 100 messages at once!")});
        msg.channel.send(`Successfully deleted \`${args[0]} messages\`!`).then(m => m.delete({ timeout: 5000 }));
    }```
lusty quest
#

use htop if you use linux

autumn aspen
#

guys anyone know how I can check what is eating up the most ram?
@earnest phoenix yep

earnest phoenix
#

how

autumn aspen
#

use htop if you use linux
@lusty quest Whats the command for not kicking or baning ur self

#

I lost it lmao

earnest phoenix
#

@autumn aspen Do you know how to do it or not?

hazy sparrow
#

@autumn aspen check if the mentioned user is = command author if yes return

autumn aspen
#

Oh yeah

#

thx

earnest phoenix
#

guys anyone know how I can check what is eating up the most ram?

lusty quest
#

@earnest phoenix use htop if you use linux

earnest phoenix
#

ok ill see

#

I meant usage in my bot

lusty quest
#

ohh

earnest phoenix
#

Yea

#

I want to see if enmap is the problem or what

lusty quest
#

im not sure if you can see every command but you can check the process itself

#

enmap is the problem

earnest phoenix
#

How do u know..?

lusty quest
#

i used it before i switched to Mysql

#

after i switched to mysql the Ram usage droped by 1GB

earnest phoenix
#

my bot is using 1331mb for gods sake

#

Oh

#

Time to move to sql

lusty quest
#

maybe there is a way to lower the impact on the system but idk

elfin kiln
#

a

earnest phoenix
#

b

topaz fjord
#

maybe it's a memory leak

earnest phoenix
#

Not sure to be honest

lusty quest
#

enmap caches the DB into the ram

earnest phoenix
#

ik

lusty quest
#

and for some reason eats ram like crazy

earnest phoenix
#

is there an easy way to convert the sqlite db to sql

lusty quest
#

sqlite uses SQL so it should be easy

flat goblet
#

Suggestion for adding regional indicators as reactions with discord.net? ๐Ÿ‡จ for example isnt an emoji, not sure how to add using the :name:

earnest phoenix
lusty quest
earnest phoenix
#

enmap's storing way is so bad

lusty quest
#

its better than json db

earnest phoenix
#

they are using json in a db

#

columns exist for the reason to not use json smh

obtuse jolt
#

is there any free mysql hosts?

earnest phoenix
#

Bad idea

#

Will not last and will be very slow

obtuse jolt
#

i know but im poor

#

and theres no sensitive data

lusty quest
#

there is a free mongodb host

misty sigil
#

jus use mongodb atlas

#

very good i use it

obtuse jolt
#

jesus christ i get told to use a different kind of database every fking time i ask

lusty quest
#

bcs every database has it pros and cons

#

and everyone got his own opinion on it

flat goblet
#

@obtuse jolt How much data will you be storing?

#

Is it a public bot or private bot etc

obtuse jolt
#

public

flat goblet
#

How many servers?

obtuse jolt
#

10

flat goblet
#

How much you storing per server?

obtuse jolt
#

i think its 10 entries per server

flat goblet
#

Do you run a local test sql server for any projects?

obtuse jolt
#

bruh

#

no i dont

flat goblet
#

Where you hosting the bot?

obtuse jolt
#

its a commercial server i dont test things on it

#

through a discord bot host

flat goblet
#

For now, you could set a sql server up on aws and then move it over further down the line

#

What I usually do for smaller projects

dusky marsh
#

sqlite is even easier if you just need to test something

flat goblet
#

^

obtuse jolt
#

its happened again

#

@lusty quest who is it?

lusty quest
#

?

lusty quest
#

mongodb atlas

#

just google it

flat goblet
#

Get a free vm on aws, first year is free. Set a sql server up yourself

lusty quest
#

you need a credit card for this and not everyone got one

quartz kindle
#

is enmap really that bad lmao

earnest phoenix
#

hosting on raspberry pi is a good idea?

flat goblet
#

Its 2020

autumn aspen
#

@hazy sparrow check DM

lusty quest
#

well i switched from enmap to Mysql and dropped 1GB in ram usage. there where no other changes on the code

obtuse jolt
#

i made an aws account is sucked

autumn aspen
#

mongodb atlas
@lusty quest Man u rlly need to help me out! I cant find the mute and warn command anywhere for my versuin

#

version

lusty quest
#

@earnest phoenix sure if you have the internet connection

misty sigil
#

i had to move

flat goblet
#

You cant really be picky when you have ยฃ0..

misty sigil
#

to a vps

#

boi my internet bandwidth was being used

lusty quest
#

my listed bot on top.gg wont start on my PC bcs my internet is to slow

autumn aspen
#

my listed bot on top.gg wont start on my PC bcs my internet is to slow
@lusty quest Dude is it gonna be something in thos brackets? if (message.mentions.users.first() === message.author) return;
^^^

#

Is it something in the brackets u need?

quartz kindle
#

my sqlite db uses next to nothing of ram lul

autumn aspen
#

Tim

lusty quest
#

if you know how to optimize it it can be pretty efficent

autumn aspen
#

Superbrain8?

lusty quest
#

but most users that start with them have probably 0 knowledge how to optimize it

#

if you need a warn command get a idea yourself how it should work and what data to store, its the same stuff i would have to do to get it together

autumn aspen
#

but most users that start with them have probably 0 knowledge how to optimize it
@lusty quest but is it smth in the brackets?

#

Oh ok

lusty quest
#

why tf did you quote random stuff and then ask stuff that doesnt relate to it?

autumn aspen
#

Nvm I fixed it

flat goblet
#

๐Ÿคจ

obtuse jolt
lusty quest
#

?

obtuse jolt
#

the database

#

on mongo

lusty quest
#

idk i dont use Atlas

obtuse jolt
#

oof

lusty quest
#

i have my own Cluster

#

but i guess they wont expect that someone uses the free DB for a production system

obtuse jolt
#

hopefully it will still work

lusty quest
#

it will work. its just limited in space (512mb)

autumn aspen
#

Guys is it "Banned" or "Baned"?

lusty quest
#

2xn

obtuse jolt
#

banned

autumn aspen
#

aigh thx

#

t

cobalt spruce
flat goblet
#

Help with...

lusty quest
#

what did you expect it to do?

cobalt spruce
#

temp voice channel

flat goblet
#

What you trying to do, what happened, what didnt happen

knotty steeple
#

and what is the problem

earnest phoenix
#

sleep

cobalt spruce
#

it should create temp voice chat and when u leave it delete it

#

@restive pebble

#

i need u rn

lusty quest
#

and there goes the next random mention

earnest phoenix
#

wut u making

restive pebble
#

why pinged

cobalt spruce
#

read

#

bruh

lusty quest
#

so you want to create a voice channel if someone enters a voice channel?

cobalt spruce
#

true

lusty quest
#

and where does it stuck?

cobalt spruce
#

no error

flat goblet
#

So they join main voice channel, it creates a channel. Then when they leave, it deletes it?

cobalt spruce
#

and it dont do any thing

#

@lusty quest it dont stuck there is no error and nothing happens

lusty quest
#

i guess learn how to debug your code.

#

i would add console.logs for seeing if a part of the code executes

autumn aspen
#

Guys what is the embed thoto command

#

Is it .addPhoto?

#

I forgot

slender thistle
#

which photo

#

there's thumbnail and image

autumn aspen
#

Like a photo in a embed

#

image

#

I mean

cobalt spruce
#

.setImage

autumn aspen
#

thx

slender thistle
#

Try both

cobalt spruce
#

uhh

autumn aspen
#

lmao

#

Guys what is the cooldown command

#

for a message

#

I want it to be like 5sec

#

If someone can DM me it I will buy u a coockie

slender thistle
#

aka how to be spoonfed 101

autumn aspen
#

lmao

lusty quest
#

discord.js guide has instructions for this

autumn aspen
#

Noshit Im there now and poop my pants off

flat goblet
#

Im not sure how to get ๐Ÿ‡ฆ , ๐Ÿ‡ง , ๐Ÿ‡จ or ๐Ÿ‡ฉ as theyre technically not emojis... Any suggestions?

IEmote[] reactions = {
    new Discord.Emoji("๐Ÿ…ฐ๏ธ"),
    new Discord.Emoji("๐Ÿ…ฑ๏ธ"),
    new Discord.Emoji("C"),
    new Discord.Emoji("D"),
    new Discord.Emoji("โŒ"),
};
balmy raptor
#

guys, silly question...must i use this bot with coding?

flat goblet
#

Nevermind, looking at this wrong... need to pass them as emote not emoji

#

@balmy raptor to create your own, yes

lusty quest
#

you could use something like Discord Bot Maker but this is verry limited

balmy raptor
#

is there other way? i dont have knowledge towards coding tho

earnest phoenix
sudden geyser
#

You can make your bot with a program like Discord Bot Maker, but it's limited compared to what you can make if you learn a programming language and write it from scratch.

balmy raptor
#

oh damn..

earnest phoenix
#

aaa

autumn aspen
#

Im not sure how to get ๐Ÿ‡ฆ , ๐Ÿ‡ง , ๐Ÿ‡จ or ๐Ÿ‡ฉ as theyre technically not emojis... Any suggestions?

IEmote[] reactions = {
    new Discord.Emoji("๐Ÿ…ฐ๏ธ"),
    new Discord.Emoji("๐Ÿ…ฑ๏ธ"),
    new Discord.Emoji("C"),
    new Discord.Emoji("D"),
    new Discord.Emoji("โŒ"),
};

@flat goblet Dude u cant use custom emojis

#

U must use the discord ones

#

or u need to have a special command for that

#

Alsoo what u tryna do??

#

Anyone knows a cooldown command for discord.js

sudden geyser
#

Did I not already explain it to you a few days ago?

autumn aspen
#

Did I not already explain it to you a few days ago?
@sudden geyser I forgot, what?

autumn aspen
#

@sudden geyser now what was complicated can u help me thru this please?

#

Im doing the command now in the command I want

#

now aight?

sudden geyser
#

do you know what a JavaScript map object is

torpid edge
#

how long does it take for a bot to get approval?

sudden geyser
#

3-4 weeks

torpid edge
#

ok

#

thanks

autumn aspen
#

do you know what a JavaScript map object is
@sudden geyser Nope lol, also its wronf

#

g

#

@sudden geyser can I check the docs?

sudden geyser
torpid edge
#

how does one get a verified developer badge???

slender thistle
#

-verifybot @torpid edge

gilded plankBOT
#

@torpid edge

Hi! It seems like you are looking for information on how to get your bot verified.

Once your bot reaches 75 servers or more, you are eligible for bot verification. On October 7, 2020, bots with 100 servers or more that are not verified will not be able to be invited to any more servers. You verify your bot on your bot's application page, under the "Bot" section in the sidebar.

If you need more information, check out this article written by Discord about The Future of Bots on Discord and you can ask questions in the Discord Developer Server.

We cannot provide support on how to get your bot verified.

torpid edge
#

ohhhhhhh

#

ok

#

i see

#

thanks

earnest phoenix
#
    process.on('unhandledRejection', (error) => { console.log(error) });
```why this dont work?
#

Idk

#

E.E

autumn aspen
#

@sudden geyser whats the DM command?

#

Cant find it :/

earnest phoenix
#

For wuttrrr

slender thistle
#

You won't always find templates for Discord bot commands

#

Hence you'll have to code it yourself

flat goblet
#

@autumn aspen You can use custom ones, and I found my issue anyway... just need to use \๐Ÿ‡ฆ

sudden geyser
#

Hold you have to code it yourself.

#

People aren't going to throw the answer in your face always.

obtuse jolt
lusty quest
#

lol. why does MongoDB gives you issues for that?

obtuse jolt
#

what does it even mean

lusty quest
#

In computing, a symbolic link (also symlink or soft link) is a term for any file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.Symbolic links were already present by 1978 in minicomputer ...

#

but why does it error out while to many of them exist?

obtuse jolt
#

idk

#

what other database types have free hosting?

lusty quest
#

idk

#

most are paid

#

you could get a 5$ Digitalocean Droplet with MongoDB installed. then just install your enviroment and you are ready to go

cobalt spruce
#

guys

#

message.channel.replacePermissionOverwrites what is the new function?

#

@lusty quest are u here?

golden condor
#

Docs exist

cobalt spruce
#

bruh i couldnt find

#

i tried

golden condor
earnest phoenix
#

check the body

golden condor
#

@cobalt spruce

earnest phoenix
#

Why cant read property 0

golden condor
#

Can you send a ss instead?

earnest phoenix
#

why

#

its my old laptop

golden condor
#

Also it means that body.countrydata is undefined

earnest phoenix
#

but it worked 10-25 minuted ago?

golden condor
#

Rate limited?

earnest phoenix
#

then the country does not exits.?

golden condor
#

I suggest using https://disease.sh

An open API for disease-related statistics. No signup required.
Over 20,000,000,000+ Requests & 50 TB of Data Served to Date!

earnest phoenix
#

Also,why are you using replace?

#

idk

#

I suggest using https://disease.sh
@golden condor problem isnt api

An open API for disease-related statistics. No signup required.
Over 20,000,000,000+ Requests & 50 TB of Data Served to Date!

golden condor
#

It is

earnest phoenix
#

hm lets try it

surreal sage
#

hey uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

client.guilds.forEach

#

HOW DOES IT WORK

earnest phoenix
#

what?

surreal sage
#

(v11 btw)

sudden geyser
#

it works by iterating over each guild and running a function you pass it.

autumn aspen
#

Guys this is message.author what is the persons id then?

surreal sage
#

but how? @sudden geyser

earnest phoenix
surreal sage
#

Because i want to log every guild's id & name

autumn aspen
earnest phoenix
autumn aspen
#

no nvm

sudden geyser
#

You pass it a function. So, you pass it a function to console.log each one of them. The first argument is a Guild instance.

autumn aspen
#

thx

earnest phoenix
#

Same

quartz kindle
#

@surreal sage discord.js v11 or v12?

surreal sage
#

v11

#

Discord is changing endpoints but i think pple will just change it on the v11

sudden geyser
#

v11 will stop working soon

quartz kindle
#

v11 wont be updated anymore

#

unless people update it themselves

surreal sage
#

I know

earnest phoenix
#

wait WHAT

surreal sage
#

unless people update it themselves
@quartz kindle i am gonna yes

earnest phoenix
#

i am using v11

sudden geyser
#

look into migrating haxer

surreal sage
#

You are allowed to re-publish on npm with a modifation

autumn aspen
#

Same
@earnest phoenix is it message.author.id(ID)

Bc I want, if u mention the bot that u use its says "U cant kick the bot u are using!"

quartz kindle
#

anyway, do you know how a forEach works?

surreal sage
#

No

quartz kindle
#

the normal array.forEach method?

surreal sage
#

That's why i'm here.

#

wait lemme get a simple script to test

quartz kindle
autumn aspen
#

is it message.author.id(ID)

Bc I want, if u mention the bot that u use its says "U cant kick the bot u are using!"

surreal sage
earnest phoenix
#

Just try

autumn aspen
#

Aight

earnest phoenix
#

if v11 stops do my bot will stop working?

sudden geyser
#

yes

earnest phoenix
#

;-;

sudden geyser
earnest phoenix
#

idk how to upgrade v11 to v12

#

Discord.RichEmbed = Discord.MessageEmbed guys, i have 200IQ

sudden geyser
#

big brain

surreal sage
#

@quartz kindle so in case for client.guilds > client.guilds.forEach(guild => console.log(guild.id))

earnest phoenix
#

big brain
@sudden geyser but its working,lol

sudden geyser
#

lazy!

surreal sage
#

@quartz kindle so in case for client.guilds > client.guilds.forEach(guild => console.log(guild.id))
@surreal sage works, thanks!

earnest phoenix
#

what is command for installing v12

#

@quartz kindle can you help me again?

sudden geyser
#

npm install discord.js

#

depending on what you use, it may be different.

autumn aspen
#

Node.js

#

and promt

lusty quest
#

uninstall V11 before this

autumn aspen
#

command

#

lmao

#

Discord.RichEmbed = Discord.MessageEmbed guys, i have 200IQ
@earnest phoenix What is that?

torpid tiger
#

qWeq:WEQewqe

#

v12โ€™s fucking

autumn aspen
#

if (message.mentions.users.first() === '731927983274721301') this is not working?

#

why

#

if (message.mentions.users.first() === '731927983274721301') return msg.channel.send(":x: **You can't kick me!** :x:"); whole command

#

Its for a bot

#

u use like u cant kick the bot ur using

sinful belfry
#

the message.mentions.users returns a user object

misty sigil
#

bots canโ€™t kick themselves tho

autumn aspen
#

I want it to, if u mention the bot u using its says You can't kick me!

#

Yes

#

but I want a special one for it

sinful belfry
#

you need to do .first().id in order to get the id of the user

autumn aspen
#

oh

#

and where is the id?

sinful belfry
#

then you can check if it is equal

#

wdym

autumn aspen
#

Like where u put the bots id?

opal plank
#

what

sinful belfry
#

you put it in the if statement?

autumn aspen
#

if (message.mentions.users.first.id() === ) return msg.channel.send(":x: **You can't kick me!** :x:");

#

like this?

opal plank
autumn aspen
#

@sinful belfry

sinful belfry
#

lol

autumn aspen
#

lol

opal plank
#

=== must have something

#

aka your client id

autumn aspen
#

oh

sinful belfry
#

^

#

yup

opal plank
autumn aspen
#

WHAT

#

wait

sinful belfry
#

and also

autumn aspen
#

tf

#

explain

sinful belfry
#

you have done users.first.id()

opal plank
#

i forgot the path, but i believe client has a me property that can be accessed

#

its a comparison

autumn aspen
#

oh

opal plank
#

it must be compared to something

autumn aspen
#

yes yes

opal plank
#

if (me === meh)

autumn aspen
#

if (message.mentions.users.first.id() === ) return msg.channel.send(":x: **You can't kick me!** :x:"); What can I use now?

#

Or change

sinful belfry
#

you have done users.first.id()
.first() is a method, and the id is simply a property

opal plank
#

again

#

comparison

#

you arent comparing anything

autumn aspen
#

Yes

sinful belfry
#

^

autumn aspen
#

but whats the right command?

marble juniper
#

smh

autumn aspen
#

Bc Im lost

opal plank
#

no

slender thistle
#

1 === 2 makes sense
1 === doesn't

opal plank
#

you need to compare it

marble juniper
#

maybe learn js

#

lol

autumn aspen
#

w8

opal plank
#

^^

autumn aspen
#

Bruh stop

#

Ik

sinful belfry
#

do you know how an if statement works? you need to assess 2 values to check if they're equal

opal plank
#

if is a basic operation in JS

obtuse jolt
#

hey @quartz kindle remember when you told me I'd regret using json? yeah well i am rn

opal plank
#

im clueless as how you've gone thru this far without knowing comparators

quartz kindle
#

lmao

marble juniper
#

An if statements is there for you to check a condition and do stuff if that condition has been fullfilled

#

basic js stuff

#

that you should know

opal plank
#

if i give you any more help i'll just be spoonfeeding

marble juniper
#

same

opal plank
#

i told you whats wrong, WHY its wrong, and given you what you should use to be comparing

marble juniper
#

and I explained what an if statement is

#

lol

marble juniper
#

imagine not using canary

torpid edge
#

in my bot i added a feature in when u type a specific message u can become a member
now is there a way u can use carlbot or mee6 to delete those messages everytime someone types that specific message?

autumn aspen
#

if (message.mentions.users.first() === bot.me.id) return msg.channel.send(":x: **You can't kick me!** :x:");

@opal plank

#

Like this?

opal plank
#

there we go

quartz kindle
#

why not make your bot delete it

autumn aspen
#

aight

quartz kindle
#

you're still missing the .id

#

lmao

autumn aspen
#

oh

marble juniper
#

in my bot i added a feature in when u type a specific message u can become a member
now is there a way u can use carlbot or mee6 to delete those messages everytime someone types that specific message?
@torpid edge why do you need mee6 to do that

autumn aspen
#

where do I put the id

#

?

opal plank
#

first() returns user object

#

you need to access the id property of it

marble juniper
#

or maybe he means how he would do all that stuff with mee6 and he is not talking about his own bot

autumn aspen
#

so I put the id where?

marble juniper
#

cuz in that case

opal plank
#

in the first

quartz kindle
#

message = message
message.mentions = mentions in this message
message.mentions.users = users mentioned in this message
message.mentions.users.first() = first user mentioned in this message
message.mentions.users.first().id = id of the first user mentioned in this message

autumn aspen
#

yes

opal plank
#

^^

autumn aspen
#

oh

marble juniper
#

bet he just waited for u to post the code

opal plank
#

its like a folder, you going deeper and deeper seeing whats inside

autumn aspen
#

so I put the ID in the brackets?

marble juniper
#

internal rage

opal plank
#

no, first() is a method

autumn aspen
#

internal rage
@marble juniper lmao

#

yes

#

and then?

opal plank
#

i completely understand Link's rage

marble juniper
#

no

#

this is too much

marble juniper
#

and then come back

opal plank
#

Tim literally gave you what you needed PLUS how to easily understand

marble juniper
#

and don't even think of skipping a part in that

#

or copy pasting

#

or we are back here again

opal plank
#

wrong guide Link

marble juniper
#

k

opal plank
slender thistle
#

Hold, weren't you told multiple times to get to basics of JS?

autumn aspen
#

But where do I post the id lmao

#

YES

slender thistle
#

Refer to Tim's message

marble juniper
#

@opal plank it does show guides for other guides about js so

opal plank
marble juniper
#

isn't that for normal js

#

lol

opal plank
#

indeed

quartz kindle
#

does it matter?

opal plank
#

the basics first

marble juniper
#

k

#

lol

vestal star
#

Learn js first, then learn npm and nodejs

marble juniper
#

well lets hope he just doesn't copy paste the answers

opal plank
#

you dont need expertize, but you need to learn the basics

marble juniper
#

also you don't have to learn npm

#

npm is a package manager

#

lmao

opal plank
#

bot making is an intermediate level project

vestal star
#

npm is the package manager for node, so yes you need to know how it works

misty sigil
#

you dont need expertize, but you need to learn the basics
@opal plank I learned the basics as I went KEKWait

marble juniper
#

at least know some stuff before you start without any knowledge at all

opal plank
#

you trying to write a russian essay without knowing russian

vestal star
#

?

quartz kindle
#

i mean

misty sigil
#

I knew a bit of code before

marble juniper
#

its like trying to climb a wall without knowing how to climb it

quartz kindle
#

you can probably write a russian essay with blyat and cyka everywhere and be done with it

#

jk

opal plank
#

^^

marble juniper
#

yes

#

lol

opal plank
#

and then get it approved on top.gg

vestal star
#

lmao

misty sigil
#

blyat blyat cyka blyat cyka cyka wide putin
graded 100%

opal plank
#

forgot to end the sentence with Putin @misty sigil

vestal star
#

Translation: fuck fuck bitch fuck bitch bitch

earnest phoenix
#

Is it possible to get url of every emoji even if the bot doesn't have access to the emoji?

vestal star
#

no

opal plank
#

if you have id, yes

vestal star
#

Kinda

#

If you have id

opal plank
#

i do that

vestal star
#

its on the cdn

opal plank
#

if you have id, you can fetch emoji

vestal star
#

so you could get it

earnest phoenix
#

@opal plank <I don't think you can fetch an emoji>

vestal star
#

?

#

Yes you can

opal plank
#

@earnest phoenix if you have id, you can

vestal star
#

if you are using node-fetch, you can

earnest phoenix
#

Wait lemme check something

autumn aspen
#

so you could get it
@vestal star if (message.mentions.users.first() === bot.me.id) return msg.channel.send(":x: **You can't kick me!** :x:");literally where do I pit the id lol

vestal star
#

lmao

opal plank
autumn aspen
#

I did everything right

opal plank
#

@earnest phoenix

marble juniper
#

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

#

where at the same again

quartz kindle
slender thistle
#

Hold, read this

opal plank
#

how can someone be so stubborn

autumn aspen
#

Dude i'd understand

#

I do

earnest phoenix
#

@opal plank i see, not fetching, just getting it from the url

vestal star
#

Who uses discord.js lmao

autumn aspen
#

Who uses discord.js lmao
@vestal star mw

marble juniper
#

@vestal star a lot of people

opal plank
#

@earnest phoenix indeed, if you have id, you can fetch it at that url, just replace id

earnest phoenix
#

Yea nice

slender thistle
#

And for the love of God, you have been pushing your luck with the help vampirism. If you keep ignoring any offers to learn the basics, I'll have to mute you.

opal plank
#

remember that extensions matter

vestal star
#

Discord.js is wayy too easy, so i use eris

earnest phoenix
#

Thanks

autumn aspen
#

@earnest phoenix indeed, if you have id, you can fetch it at that url, just replace id
@opal plank lmao finally please'

#

thanks

opal plank
#

wot?

marble juniper
#

And for the love of God, you have been pushing your luck with the help vampirism. If you keep ignoring any offers to learn the basics, I'll have to mute you.
@slender thistle you truly are saving my nerves ngl

opal plank
#

i second this

slender thistle
#

@autumn aspen please read my message.

#

Thank you.

opal plank
#

i wonder

#

-vampire

#

not quite

#

command idea right there

vestal star
#

Aight time to make a proxy scraper ๐Ÿ™‚

slender thistle
#

Meh, help vampirism isn't often

opal plank
#

< crawlers

slender thistle
#

Easier to warn manually

opal plank
#

fair enough

vestal star
#

@opal plank what?

opal plank
#

i prefer crawlers

vestal star
#

It's a crawler/scraper, almost same thing

quartz kindle
#

what are you gonna scrap

autumn aspen
#

if (message.mentions.users.first().'731927983274721301') still not working

opal plank
#

nooot quite

quartz kindle
#

LOL

opal plank
#

similar but not the same

#

omg

autumn aspen
#

LOL
@quartz kindle Im lost

quartz kindle
#

@autumn aspen you dont need to put your literal id anywhere

opal plank
#

we have given you the awsner

autumn aspen
#

oh

#

wait

opal plank
#

comparison

#

why you backtracking

#

you arent comparing anymore

vestal star
#

They are similar

marble juniper
#

did he just try to add a string to that

opal plank
#

he did

marble juniper
#

can I puke

quartz kindle
#

@autumn aspen discord.js is object oriented, which means everything is accessible via linking objects and properties, ie: getting something from something else from something else from something else

opal plank
#

right ahead

quartz kindle
#

everything is linked together

marble juniper
#

ok gimme a minute then im back once I recovered from this

opal plank
#

if (this === that) do this
Read as, If THIS EQUAL TYPE that, do this

autumn aspen
#

@quartz kindle if (message.mentions.users.first().id)

#

Bruh

quartz kindle
#

if you literally type .id it means "get the id from this"

autumn aspen
#

Yes

marble juniper
#

YESSSSSS YOU FINALLY GOT IT

misty sigil
#

itโ€™s not hard

#

so just compare it

opal plank
#

speak to yourself how you read it Hold

#

what you typed is:

autumn aspen
#

oh ok

marble juniper
#

we gotta celebrate this

opal plank
#

read it backwards

quartz kindle
#

so message.mentions.users.first().id means "get the id, from the first, from users, from mentions from message". or, "get the id of the first user mentioned in a message"

marble juniper
#

its easy

opal plank
#

IF (the id, of the FIRST MENTION from, MENTIONS, from the MESSAGE) do this

#

you arent comparing it to anything

#

without a comparison it'll just check if that exists

marble juniper
#

message (message object the user sent)
.mentions (the mentions from the message)
.users (the users that got mentioned)
.first() (the first user that got mentioned)
.id (the id of the first user that has been mentioned)

#

easy to understand

#

ngl

autumn aspen
#

yes

#

if (message.mentions.users.first().id)
Just askin is this right?

quartz kindle
#

for checking if it exists, yes

opal plank
quartz kindle
#

you're just checking if it exists

#

not comparing to anything

autumn aspen
#

yes

opal plank
marble juniper
autumn aspen
#

but should I replace it with the bot id

marble juniper
quartz kindle
#

do you know what "comparison" means?

autumn aspen
#

BRO JUST TELL I DONT GET IT

opal plank
marble juniper
#

all effort for nothing

#

nah im done

opal plank
#

read carefully what i sent

quartz kindle
#

do you know how to compare 2 items?

autumn aspen
#

Yes ===

slender thistle
#

Thin ice

quartz kindle
#

a === b
this is a comparison. it compares a and b, and checks if they are equal
in other words, it means a EQUALS b

marble juniper
#

save me for the love of god and my mentality and soul

quartz kindle
#

so you just need to do the same thing

opal plank
#

if(this) check if it exists
if( 1 > 2) checks if 1 is bigger than 2
if(0 == 0) checks if 0 equals to 0

slender thistle
#

Leave this channel if you're not willing to help.

autumn aspen
#

Leave this channel if you're not willing to help.
@slender thistle me??

slender thistle
#

Anyone who keeps on complaining.

autumn aspen
#

Yes

#

@marble juniper u have been a noob before too

#

so shut

#

please

quartz kindle
#

in your case, message.mentions.users.first().id is like the a in my comparison example

autumn aspen
#

read the rules

quartz kindle
#

you just need to add the rest of the comparison

autumn aspen
#

Oh ok

marble juniper
#
if (a === b)    //Check if a is the same as b and if the types are the same
slender thistle
#

No minimodding here. You kept breaking the rules for the past days if not a week already.

obtuse jolt
opal plank
#

its not about being noob or not, its the fact that 3 people are explaining the same thing for the past 18 minutes with the same basic thing

autumn aspen
#

in your case, message.mentions.users.first().id is like the a in my comparison example
@quartz kindle ohhh and the b is??

marble juniper
#
if (a == b) //check if a is the same as b but not if they are the same types
quartz kindle
#

what do you want to compare it to?

autumn aspen
#

the bot

quartz kindle
#

the bots id

#

right?

marble juniper
#

well you want to compare the id with the bots id

opal plank
autumn aspen
#

yes

quartz kindle
#

so thats your b

marble juniper
#

so b is the bots id

pure lion
#

How do I create channel overwrites that only allows the author to speak in the channel?

opal plank
#

if you arent understanding with words, do give it a try

marble juniper
#

try it >>

autumn aspen
#

so thats your b
@quartz kindle should I put it in ", ' or `

#

?

quartz kindle
#

an id is a string

pure lion
#

Any

marble juniper
#

it doesn't matter

quartz kindle
#

strings can be done in any of the three forms

opal plank
#

" or ' is the same

marble juniper
#

they are all strings

#

so its fine

opal plank
#

` is used for template literals

slender thistle
#

Multiple people explaining at once wasn't the best idea in the end

opal plank
#

agreed

marble juniper
#

same

#

Im gonna leave cuz I got stuff to do

#

and that is being lazy

autumn aspen
#

Thanks guys its worked!

#

Im slow bc it night here

#

@opal plank

pure lion
#

How do I create a channel that denies everyone else permission to talk

autumn aspen
#

Thanks @quartz kindle!

sudden geyser
#

what library

pure lion
#

djs light

#
                let tChannel = await msg.guild.channels.create(`${msg.author.id}-ticket`, {
                    type: 'voice',
                    permissionOverwrites: [
                        {
                            id: msg.author.id,
                            allow: [
                                'SEND_MESSAGES', 
                                'VIEW_CHANNEL'
                            ]
                        }
                    ]
                })

got this so far

sudden geyser
#

the everyone role has the same ID as the guild

#

So you could set the ID as the guild id, deny as an array with SEND_MESSAGES, and the type as role to refer to the role.

pure lion
#

but that would deny the author too

marble juniper
#

@pure lion do you have permissions enabled in the client options

#

just to be sure

#

lol

sudden geyser
#

You already overwrote the author to have permission.

pure lion
#

wait oops i put voice

sudden geyser
#

no that was fine

barren mauve
#

Tem br

pure lion
#

wait i got it

misty sigil
#

hey

#

my muted role overrides overwrite all of my perms, should i use updatePermissions instead of overwritePermissions?

livid rivet
#

huh

#

there's no updatePermission??

#

or what are you talking about

misty sigil
#

theres something similar

livid rivet
#

language I mean

misty sigil
#

d.js

livid rivet
#

oh okay then sorry, I am d.py

misty sigil
#

oh its updateOverride

pure lion
#

yeah was just gonna say x))))

misty sigil
#

can i use multiple for it, do i just , or do i use an array

pure lion
#

You gotta

#

updateOverwrite(user, { PERMISSION_NAME: Boolean }
)

#

Note, the permission name is not a string

misty sigil
#

user can be a role ID yes?

summer torrent
#

yes

misty sigil
#

ok

#

and how do i set multiple overrides

pure lion
#

commas

misty sigil
#

thought that yea

pure lion
#

the permission names are properties

#

ye gl

misty sigil
#

so just put the flag?

#

like SEND_MESSAGES

pure lion
#

Yeah

#

Omfg fuck my internet

snow urchin
misty sigil
#

it could be because the bot doesn't have admin perm

snow urchin
#

it does..

#

infact

slender wagon
#

The fuck

opal plank
#

bot cant create guilds, wtf

#

not sure you can transfer ownership either

#

holdup

pale vessel
#

they can

#

up to 10 iirc

quartz kindle
#

they can create guilds if they are in less than 10 guilds

#

xd

pale vessel
#

oh

opal plank
#

wait what

slender thistle
#

Yeah

pale vessel
#

what did i even read

opal plank
#

i wasnt aware of that

pure lion
#

How do I close an awaitMessages collector when a message is sent

quartz kindle
#

give it max:1

pure lion
#

Alright

opal plank
#

or collector.stop once the requirement is met

quartz kindle
#

awaitMessages doesnt expose the collector itself

#

i dont think you can access it

opal plank
#

wait rlly?

quartz kindle
#

yeah

#

awaitMessages wraps the collector into a promise

opal plank
#

oh yeah

#

i just read it

quartz kindle
#

its like doing ```js
return new Promise(resolve => {
collector = createMessageCollector()
collector.on("end", resolve)
})

pure lion
#

Can I filter for 2 message contents using an or in the filter definition?

#

E.g bot says "send 1 for bla and 2 for bla"

pale vessel
#

a filter is a function so yes

tulip ledge
#

I just got some chips and was hoping to watch some people get helped here so I can learn turns out no one needs help ๐Ÿ˜ฆ

#

Tim isn't it doing collector = new createMessageCollector() as .on is a method right? Making collector a class

opal plank
#

good practice to skim thru the docs

#

even if you arent using something

#

.on is just listening to an event emitted by the colector you are creating(message)

tulip ledge
#

oh

#

ok

quartz kindle
#

well

#

messageCollector is a class

#

but channel.createMessageCollector does it for you

tulip ledge
#

oh

quartz kindle
#

and the .on doesnt have anything to do with classes per se

tulip ledge
#

oh

quartz kindle
#

it just means that said class is an event emitter

#

and most likely extends the native event emitter

tulip ledge
#

oh ok

earnest phoenix
#

Hey Tim

#

I wanted to ask you; if I convert to djs-lite will my bot work fine or do i need to change some stuff

quartz kindle
#

depends on your code and features

#

make a test bot with it and see

earnest phoenix
#

I mean..

#

Sure let me try

#

My bot is at 1.5gb ram and im sick of it tbh

quartz kindle
#

rule of thumb is, everywhere that you use .cache.something, that isnt guilds, will need to be reworked

sudden geyser
#

yikes

earnest phoenix
#

Then Ill need to do some changes

quartz kindle
#

.cache.get can usually be replaced with .fetch()

tulip ledge
#

whats the catch with djs lite?

quartz kindle
#

.cache.find/filter most likely wont work out of the box

sudden geyser
#

the catch is less caching, so more requests

quartz kindle
#

you can re-enable certain caches if you need them, but it will increase memory usage

tulip ledge
#

oh ok

quartz kindle
#

the goal is less memory usage (wayyy less) in exchange for losing some features

earnest phoenix
#

when we fetch does it get added to cache

quartz kindle
#

by default yes, but you can turn it off

#

.fetch(id,false)

earnest phoenix
#

Ok Ill test it

#

do u think better-sqlite3 can be a reason to that much ram usage

quartz kindle
#

the current version on npm is v2, so you need to switch to the v2 branch

#

depends

#

if you use it correctly, no

#

im using better-sqlite3 myself

earnest phoenix
#

im using it through enmap

quartz kindle
#

then possibly yes

#

according to superbrain, his experience with enmap was pretty terrible

earnest phoenix
#

was talking with creator

#

he/she said shouldnt be an issue

quartz kindle
#

of enmap or better-sqlite3?

earnest phoenix
#

enmap

quartz kindle
#

well, depends on your use case i guess

earnest phoenix
#

It's guildSettings

quartz kindle
#

but better-sqlite3 gives you direct control over everything, so if anything goes wrong its your fault

#

enmap doesnt

earnest phoenix
#

ok then

#

Ill move to sql and hope it gets better

quartz kindle
#

my sqlite is using virtually no memory

#

although my database size is like 15mb

earnest phoenix
#

My issue is there is no way I can see what is using how much ram

quartz kindle
#

well, you can probably get an estimate if you stringify your objects

#

let me check something

earnest phoenix
#

it's 115 guilds

#

so 115 enmap records

quartz kindle
#

do you have an eval command?

earnest phoenix
#

yep

quartz kindle
#

try evaling db.export.length

earnest phoenix
cinder patio
#

1.5 GB for 115 guilds? That's insane

earnest phoenix
#

Turns out it's a function

cinder patio
#

You must have a memory leak somewhere

quartz kindle
#

ah

#

so thats 23k characters, that isnt much

earnest phoenix
#

so enmap not the issue

quartz kindle
#

try db.fetchEverything().export().length

#

just to see if it makes a difference

earnest phoenix
#

23984

quartz kindle
#

so at 1 byte per character, thats basically 24kb

#

even if you make it 4 bytes per character, plus object and enmap overhead, i doubt the entire db will use more than 100-200kb

earnest phoenix
#

Im suspecting voice has something to do with it
Anyway to check?

quartz kindle
#

are you using dicord.js's built in voice streaming and stuff?

#

with ytdl or something?

earnest phoenix
#

Yep

placid iron
quartz kindle
#

eval process.memoryUsage()

earnest phoenix
#
    "ytdl-core": "^3.1.0"
    "@discordjs/opus": "^0.3.2",
quartz kindle
#

yup

#

its voice

earnest phoenix
#

What gave it away

quartz kindle
#

external

#

600mb on external memory

#

which means buffers and streams and other non-primitive data

#

audio uses those

#

your actual discord.js is only using 285mb

earnest phoenix
#

So that's good for my guild count yea?

quartz kindle
#

its average

#

depends on the point of view

#

if you want to compare with djs-light

#

3700 guilds ^

earnest phoenix
#

I cant on production

pure lion
#

how do i await messages without a filter?

#

just leave it blank?

earnest phoenix
#

might error

#

try an empty filter

quartz kindle
#

filter = () => true

#

or simply awaitMessages(() => true, {options})

pure lion
#

ty tim

#

:>

misty sigil
#

how do i fetch user again

earnest phoenix
#

Tim is amazing

misty sigil
#

i forgot keklol

pure lion
#

client.users.fetch()

misty sigil
#

ty

pure lion
#

np

obtuse jolt
#

ok i have myJSON and in myJSON the data is json [{"user":"YxriDev#3160","userid":2147483647,"channelid":2147483647,"messageid":2147483647,"type":"url","input":"connection.co","isautoscan":1,"priority":0,"scanid":"q6Zd8H"}]

but when i do myJSON.user is say undefined, how do i read the data inside of myJSON?

quartz kindle
#

its an array

obtuse jolt
#

how to do i do it with an array?

earnest phoenix
#

just do array[0]

pure lion
#

arraโ„ข๏ธ

marble juniper
#

array[0].object

obtuse jolt
#

this is my attempt at using mysql @quartz kindle

#

myJSON.array[0].user?

earnest phoenix
#

No

quartz kindle
#

myJSON[0]

obtuse jolt
#

i tried that

#

it said undefined

earnest phoenix
#

weird..

quartz kindle
#

show code

obtuse jolt
#
connection.query('SELECT * FROM automatedScans WHERE scanid = "q6Zd8H"', function (error, results, fields) {
    // When done with the connection, release it.
connection.end(function(err) {if(err) console.log(err)});
 
    // Handle error after the release.
    if (error) throw error;

var myJSON = JSON.stringify(results); 

console.log(myJSON)

    // Don't use the connection here, it has been returned to the pool.
  });```
quartz kindle
#

you're stringifying it

earnest phoenix
#

results is already an array, by stringiying it it isnt an array anymore

obtuse jolt
#

im not good with this

misty sigil
#

how do i mention someone in an embed?

quartz kindle
#

results[0].user

pure lion
#

@misty sigil you cant mention in field names

#

and the person isnt pinged

misty sigil
#

I didn't want in field names

earnest phoenix
#

You can but it wont reach the user

quartz kindle
#

JSON.stringify is to convert data to string, so the data becomes readable, but not workable
JSON.parse is to convert string to data, so the data become workable, but not necessarily readable

misty sigil
#

I wanted in a field, and not reaching the users

pure lion
#

ye does that all the time

earnest phoenix
#

Okay then you can simply put the user's object

misty sigil
#

wait really?

obtuse jolt
#

much appreciated @quartz kindle

quartz kindle
#

in your case, results is already workable data, if you stringify it, it becomes non workable, its just a string

earnest phoenix
#

yep

#

@earnest phoenix How long do I have to wait?

#

for what

#

verifed?

#

discord verified or top.gg verified

misty sigil
earnest phoenix
misty sigil
#

3+ weeks

obtuse jolt
#

they're both about a month aren't they tho

misty sigil
#

yea

earnest phoenix
#

oww