#development

1 messages · Page 1629 of 1

opal plank
#

and test on that one

#

so if your "beta" bot is constantly going down or pausing, it wont affect the main bot where users are using it

#

as the name suggests, this is for "debugging"

agile lance
#

vsc is only good and only good for hosting a bot that ur using to test

simple zodiac
#

i dont have any users aside from in my test server if that matters

agile lance
#

debugging is very important

opal plank
#

then its fine

simple zodiac
#

so how do you recommend i host the bot

#

outside of repl

agile lance
#

vps

opal plank
#

the best way would be to buy a vps, something along the lines of $5 a month

simple zodiac
#

sorry but uh

#

is there anything free

agile lance
#

No.

opal plank
#

there is, but its shit

simple zodiac
#

oh

#

what is that

agile lance
#

Only heroku

#

But its trash

opal plank
#

heroku and glitch

agile lance
#

Not meant for bot hosting

opal plank
#

and f1 micro or aws, but those need credit card

agile lance
#

Glitch blocked pinging services so repl is the only good free one

opal plank
#

those 2 i mentioned are good, the former is free forever

#

the latter is1 year free triaal

agile lance
#

If repl fixed security, it would be 100x better

clever vector
#

I host the bot on Dynox Hosting

#

Free and Low Ping

simple zodiac
#

oh

#

how do i do that

opal plank
#

i would recommend NOT doing that

simple zodiac
#

why

agile lance
#

I had my token comprised when using repl

clever vector
#

I would DM you if you want

simple zodiac
#

i am so confused

opal plank
#

go with famous and big companies for hosting, remember you are putting your token and shit on an unknown host

#

i personally never heard of Dynox Hosting

#

so im not gonna recommend that

clever vector
opal plank
#

the only ones i do recommend are the ones i listed

simple zodiac
#

would making my repl private fix the security

opal plank
#

once again, what i said virak

clever vector
#

Anybody know how to fix this

clever vector
agile lance
#

Embed field is emoty

clever vector
#

Look the code first

opal plank
#

your friend is fine, the issue is other people

agile lance
#

When doing .addField(); the content of the 2nd statement is empty

clever vector
opal plank
#

i would not ever recommend going with a unknown or small vps

agile lance
#

So you did something like

clever vector
agile axle
#

Is this a league?

clever vector
#

?

agile lance
#

message.author.displayAvatarURL())
.addField("Cooldown", cooldown)
.addField("Aliases", aliases, true)
.addField("Usage", usage, true)
.addField("Example", example, true)

I think there, If there is no cooldown, wouldnt it return " "?

clever vector
#

?

opal plank
#

you NEED both parameters

clever vector
#

Did you check full?

opal plank
#

the error is pretty self explanatory my dude

#

one of the filds you're adding is undefined

clever vector
#

Its work when i put in repl

#

but vsc no

#

Im searching the way

opal plank
#

its clearly not related to that

agile lance
#

Maybe here:

      embed.addField(`${mod.name}`, mod.cmds.map(x => `\`${x}\``).join("** . **"));
    }```
#

Maybe a module is returning undefined

opal plank
#

same thing i sent to the other guy

agile lance
#

Making the field seamlessly empty

opal plank
#

check how to debug your own code

agile lance
#

And. Repl replaces empty fields with "undefined" automatically

#

hence why its not as good as vsc

simple zodiac
#

If I bought the repl thing that lets me make my repls private, would that fix the token security?

opal plank
#

if you're gonna buy something, buy a vps

agile lance
#

vsc returns undefined not as a string making the bot read it as " "

opal plank
#

dont go with repl

agile lance
#

My token was still comprised

simple zodiac
#

do you have a recommendation for a free vps? not looking to spend money rn

agile lance
#

Thats when I stopped using repl

opal plank
#

like i said, you got a credit card?

simple zodiac
#

not looking to spend money rn

agile lance
opal plank
#

i never said you were going to SPEND IT

agile lance
opal plank
#

they require it for registration

simple zodiac
#

why

agile lance
#

He asked for if u had a cc

simple zodiac
#

i got one yes

opal plank
#

ask them not me

agile lance
#

so u can get a FREE vps

opal plank
#

f1 micro from Google

#

its forever free

simple zodiac
#

ooh

opal plank
#

or AWS, which is amazing, but only lasts for a year

agile lance
opal plank
opal plank
spare portal
#

@simple zodiac if you dont have a credit card you can use an empty like Visa gift card iirc

agile lance
simple zodiac
opal plank
#

f1 micro is free forever

simple zodiac
#

oh its telling me to enter a cc

opal plank
simple zodiac
#

im there

#

says free trial

opal plank
#

read till the end

agile lance
#

Yep ^ I was about to post that-

opal plank
#

remember, its FREE

#

it WILL run fine, but you must'nt write shit code

#

its free because its limited

#

so try to avoid doing expensive or REALLY poorly optimized stuff on ur bot

simple zodiac
#

so i enter my cc but i wont get charged right

#

not a one time fee or anything

opal plank
#

read what i sent

#

okay, for real, wtf is going on with my bot?

simple zodiac
#

so im not going to get charged

opal plank
#

im not going to answer something i already told you 4 times my dude

simple zodiac
#

as long as i turn that thing off

#

okay

opal plank
#

did my bot hit trending?

#

wtf

craggy pine
#

Is your bot going brr

opal plank
#

yeah wtf

craggy pine
#

congrats

#

trending botum is big pog

opal plank
#

i dont think its coming frmo top.gg tho

craggy pine
#

Hm?

opal plank
#

cuz referrers are off

#

i mean, its unrelated to top.gg in a sense

#

the numbers im getting are directly from guildCreate from discord

#

so im seeing a surge in servers

craggy pine
#

Like maybe your bots invite cmd is generating the traffic?

opal plank
#

broke the previous all time high record by quite a margin

#

could be

#

hmmmm

#

*visible confusion*

craggy pine
#

What is a "quite a margin"

opal plank
#

my avarage daily is around 50-60 guilds

#

its at 110 now

craggy pine
#

Gaming

opal plank
#

moment, indeed

craggy pine
#

Well, that's good for sure.

#

Does that includes leaves?

opal plank
#

yup

craggy pine
#

Not bad at all

opal plank
#

it takes last lowest count in macro and subtracts from current count

craggy pine
#

We just kinda graph the total daily so we can see the growth.

#

We don't have a "Daily" log

#

Probably could do that tho

opal plank
#

@craggy pine

#

i marked the 2 important steps

craggy pine
#

oh ya I see it

opal plank
#

current macro is set to 24h

craggy pine
#

200 votes a day is super nice aswell

opal plank
#

ironically thats within margin

#

not the guilds tho

#

its a bit above what was expected for this week tho

#

i was aiming at 170-180

#

based on previous growth]

craggy pine
#

2333 servers?

opal plank
#

no

#

erm

#

2701

craggy pine
#

2702

#

ya

#

How long have you been running?

opal plank
#

can always click on me to see live stats too lul

#

let me check

#

3 months i think tho

craggy pine
#

yo

#

that's solid

#

It took us like a few months for our first 1000

opal plank
craggy pine
#

tho multi-purpose grows slower. Since you are based around a topic. It's easy to attract a fan base

opal plank
#

4 months on the clock, but it wasnt public for a good month

#

so, yeah, 3 months and a half i'd say

craggy pine
opal plank
#

indeed, multi purpose is super slow

craggy pine
#

Our growth came from our scrims FN command we yeeted a few months ago

#

since we connected to a fortnite client

#

but fuck that since api changes every updte

opal plank
#

kek i feel ya

#

breaking changes every week or so

craggy pine
#

indeed

opal plank
#

its annoying to have to maintain all of it

craggy pine
#

not fun

#

it at one point gave us $700 a month in patreon rev but like

#

no

#

not worth it

opal plank
#

im on the edge about monetizing my bot tbh

craggy pine
#

That was at fortnites like peak tho

opal plank
#

donations? sure

#

i can make an exception

craggy pine
#

I mean, nothing wrong with that.

opal plank
#

but idk, im kinda on the fence with adding anything freemium

craggy pine
#

Patreon could come with benefits if you want or just simply make it like a "Buy me coffee"

#

thing

opal plank
#

indeed, but that falls under donations

#

it would be mainly roles or something else to support

#

nothing that would add currency or the likes

craggy pine
#

Ya I see.

#

Could have like a "Patreon's" command

#

pageinate the duders

earnest phoenix
#

Pls porn

sudden geyser
#

you tried

craggy pine
earnest phoenix
#

Um!

#

🙄

opal plank
#

not the server nor the channel for that m8

craggy pine
#

☝️

earnest phoenix
#

I was kidding gtfo...

opal plank
#

¯_(ツ)_/¯

#

i might go code some stuff on my bot tbh

earnest phoenix
#

I was developing a joke????

craggy pine
#

Shoo

earnest phoenix
#

🖕 🤮

craggy pine
#

byeeee

opal plank
#

so much stuff in my todo

#

might spend the whole night getting rid of it

craggy pine
#

Do you have a site for the botum

#

I don't play Genshin but just curious

opal plank
#

frontend is not my area, but i will need one in the future

craggy pine
#

I used wordpress for ours ngl

#

bec not good at frontend

#

I'm not bad at top.gg bot page design but

#

ya not full on website

opal plank
#

i did work with websites before, but im not confident in making something that'll work on this scale for the bot

#

its more me refraining from starting something that is not going to be at an acceptable quality for a bot this size

craggy pine
#

Gotchaa

#

I work in the video production scene so maybe we could work on something for your bot if your ever interested. 😉

opal plank
#

always looking for help

#

code wise im fine, but theres a lot of contribution when it comes to sourcing

craggy pine
#

noice

opal plank
#

i got API devs, forums devs, wiki devs, artists and a bunch of other people helping on this bot

#

they dont touch code, but they provide the data

craggy pine
#

I'm decent at trailers n things. Coding, I'm like a little better than that one duder who gets flammed here KEKW

opal plank
#

if you interested in that i can dm you todya/tomorrow

craggy pine
#

Sure.

opal plank
#

i always take every help i can ❤️

novel osprey
#

How to make a link like the text is click here to join server and when we click on the text it redirects us to the server.

#

like link inside text.

opal plank
novel osprey
#

ok

opal plank
#

or the other way around

#

i forgot discord markdown

novel osprey
#

does it work here.

opal plank
#

yeah i said it right

#

no, only in embeds

novel osprey
#

ok thanks

#

I wanted to do that with my bot

opal plank
#

some fields dont work, keep that in mind

novel osprey
#

😊

#

ok

#

which?

opal plank
#

title doesnt work(only author), footer, and some other

novel osprey
#

Yeah

opal plank
#

description and fields work

#

which is where you'll mainly be writting

novel osprey
#

Yeha

#

thanks

opal plank
#

np

agile lance
#

unless its apple. apple holds $0.08 for a week

simple zodiac
#

Hi, how can I check if a user who ran a command doesnt have a certain permission in discord.js? I want to make a command that only an admin can use, how could i do this?

river panther
knotty quartz
earnest phoenix
#

@river panther you forgot )

opal plank
knotty quartz
#

Oh I see

zinc palm
#

i wanna make another bot

#

what should i do

#

i want code

#

:_;

river panther
zinc palm
#

@river panther can you come to my dm pls

earnest phoenix
#

@river panther dont spoonfeed him btw

river panther
#

@earnest phoenix

#

answer me ;-;

earnest phoenix
#

is someone good with css?

#
.main {
    font-family: Poppins;
    text-align: left;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 300;
    background-color: #353535;
    padding: 15px 48px;
    text-decoration: none;
}

.about {
    text-align: left;
    font-size: 30px;
    color: white;
}

.yt-video {
    box-align: right;
    border-radius: 10px;
    background-color: #353535;
    padding: 15px 48px;
}

cause this is my code and it looks like this:

#

but i want that the boxes are side by side

slender thistle
#

display: inline; might be what you're looking for

#

Try applying it to .about and .yt-video

earnest phoenix
#

okay wait

#

didnt work

#

.about is only the word "about"

#

its another div class in the div class "main"

slender thistle
#

Ah

earnest phoenix
#

but both didnt work

slender thistle
#

Could you DM me your HTML?

earnest phoenix
#

yep

zinc palm
#

hm

cinder patio
#

You want the youtube video to fit the about box?

wide wharf
#
(node:36) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
content: Must be 2000 or fewer in length.
    at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async RequestHandler.push (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
(node:36) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:36) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
```Uh
novel osprey
#

Umm why isn’t this working on embed.

wide wharf
novel osprey
wide wharf
novel osprey
#

That’s same but except the link,

wide wharf
#

Could you send some more context?

novel osprey
#
.addfield(“ - [click to join](link)”```
#

this is my code.

wide wharf
novel osprey
#

is there a limit to this thing

#

because I did twice already in my code and it’s working

#

But it doesn’t work in this embed

wide wharf
#
client.user.setActivity(`in ${client.guilds.size} servers! :tada:`, { url: 'https://www.twitch.tv/ItsIsmailZ', type: 'STREAMING' });
``` "undefined servers" ![waitWhat](https://cdn.discordapp.com/emojis/622740549673418782.webp?size=128 "waitWhat")
misty sigil
#

it doesn’t work in field titles

wide wharf
#

lemme test

boreal iron
#

And the method is called addField() not addfield()

wide wharf
#

${client.users.cache.size} doesn't work (only say 20)

misty sigil
#

not all users are cached

wide wharf
#

And how to cache them?

misty sigil
#

memory go brr

wide wharf
misty sigil
#

caching all users would fucking murder your memory

wide wharf
#

Oh.

#

Sad

misty sigil
#

so you reduce guilds.cache

#

guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)

wide wharf
#

Hmmm

#

None of my commands work

#

But bot is running and online

#

(But there's some text that comes over n over again in panel)

misty sigil
#

what is it

wide wharf
#

My script can I dm it to you?

misty sigil
#

no

wide wharf
#

(site)

#

0bin

wide wharf
misty sigil
#

just tell me the output

wide wharf
#

Ok

#

w8

wide wharf
misty sigil
#

I’m on mobile

wide wharf
#

oh

#
(node:36) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
content: Must be 2000 or fewer in length.
    at RequestHandler.execute (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async RequestHandler.push (/home/container/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
(node:36) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)
``` (a part of the spamming bug in panel)
misty sigil
#

you’re sending a message

#

and it’s too big

misty sigil
river panther
#

wot?

tame goblet
#

d!help

#

!help

earnest phoenix
#

after discord.js v11, they relocated it to the bot cache and tempfiles hence property cache

wide wharf
wide wharf
river panther
wide wharf
river panther
#

bruh wait

wide wharf
#

epic game presence @river panther

wide wharf
zenith terrace
wide wharf
zenith terrace
#

would be better yes

wide wharf
zenith terrace
#

ok

earnest phoenix
#

Can't I get server owner data without (exp guild.ownerID) presence intent? i have server members intent

wide wharf
#

:/

wide wharf
#
  if (message.content.toLowerCase().startsWith(prefix + "avatar")) {
    const embed = new Discord.MessageEmbed()
      .setTitle("Your Avatar")
      .setAuthor(message.author.tag, "https://cdn.discordapp.com/avatars/643091174243958814/9ec6fc0169e8c4658d87765b1d663efe.png?size=128")
      .setColor(0x00AE86)
      .setDescription("What a wonderful picture.")
      .setImage(message.author.avatarURL())
      .setTimestamp()
    .setFooter(':copyright: Its_IsmailZ#8826') 
  message.channel.send({embed})};
``` How to edit this to make it available for tags (eg. !avatar @onyx cloak)
tired panther
tired panther
wide wharf
#

Why doesn't the error say where (line n°) it is?!?! UGH

wide wharf
tired panther
earnest phoenix
#

heyo, your src is

#

uh

tired panther
wide wharf
earnest phoenix
#

you could learn how to use command handler

wide wharf
#

I don't understand the discordjs docs btw

#

so they won't help me out

tired panther
wide wharf
wide wharf
#

I learn from it

tired panther
#

the docs

wide wharf
#

no

#

if someone does it for me

#

and I see how he has done it

#

Than I understand

#

If you tell me, I will listen. If you show me, I will see. But if you let me experience, I will learn.

vivid fulcrum
#

you're in the wrong channel

split osprey
#

aah where should i send it?

vivid fulcrum
split osprey
#

okido

#

it was never here

haughty mirage
#

have i got something really badly wrong here or?
i cannot deposit any currency and i think i have some math wrong, second pair of eyes would be great...
Note: stash.balance is the database reference for the stash, amount is the deposit amount and limit is a variable which changes based on level

var amount = args[0];
if (stash.balance + amount > limit) {
                return message.reply(`You can only store ${limit} in your stash right now, go level up your HQ to store more.`)

        }```
earnest phoenix
#

Does anyone know how i only show the Lvl in a channel?

lyric mountain
#

You're welcome

#

A second option would be to install java and gradle in ur vps then execute the code directly

#

It'd speed up deployment since shadow takes some time to generate

sand carbon
#

@true shuttle @slim otter

#

I luv y nerdis much much

crystal wigeon
#

Anyone know how to read heapsnapshot on Chrome? Like I don't understand it at all, so confusing

stone quest
#

I'm currently trying to solve this other situation now xD

lyric mountain
#

for that you'll need to use a database

#

lul you really opened a thread

crimson vapor
#

I don't understand why you would open a stackoverflow thread for something like this ngl

#

everyone does their own command handling so there is no standard multi prefix

vivid fulcrum
#

if you don't know how to do logical ORs you should probably learn how to work with your language before making a bot

stone quest
crimson vapor
#

ah

stone quest
quartz kindle
#

From what i understand, youre looking for a simple dual prefix setup right?

#

Then simply put both prefixes in your env

#

And then check if message starts with one OR if message starts with another

#

if(message.startsWith(prefix1) || message.startsWith(prefix2))

lyric mountain
#

which is good don't get me wrong

crystal wigeon
#

i cant make any sense out of the heapsnapshots TT help

#

:c

#

idk why djs permissions array never get GC

cinder patio
#

Damn permissions are taking up a lot of space

quartz kindle
#

are you deleting them?

#

you want them removed?

crystal wigeon
#

for every message there is a +5 new things in memory

#

which is not being GC(garbage collected)

#

which will eventually lead to crash

#

for some messages, it create 33 new things

#

and none of them got deleted after the func finished

#

why is it still stored in memory

#

bruh

#

it literally has every content someone would type

#

and why is it global tf

quartz kindle
#

you're using discord.js

#

thats expected

crystal wigeon
#

its literally dumb

#

2 heap shots. like bruh, the message keeps growing

#

wtf man

#

i have a 300mb heapsnapshot because of this wtf

#

thank god for this

#

hope this solves my problem

#

;_;

waxen snow
#

How do I set the emoji code from famry's discord bot GDPS?

cinder patio
waxen snow
#

Emoji code not set

cinder patio
#

you are coding your bot in php and on mobile? savage

waxen snow
#

Yea I need to set the emoji code

vivid fulcrum
#

your bot is not in the guild where those emojis are at

quartz kindle
# crystal wigeon hope this solves my problem

thats how discord.js is designed to work. it caches all data it receives. got a message from a member? check if member data is cached, if not cache it. did someone create a new channel? check if channel data is cached, if not cache it. thats how discord.js works lol

#

thats what enables discord.js to have everything available to you when you need it

waxen snow
#

I need to follow famry's video

#

Bye

quartz kindle
#

discord.js is a general purpose library with a shit ton of features

#

but no, its not a scalable library, precisely because of this, many of its features have high scaling costs

vivid fulcrum
#

djs is fine for something like a private bot and you want it up and running quickly

#

if you're making something for the public, i firmly believe you should just step away from node in general

quartz kindle
#

i believe node is fine, if done correctly

latent heron
#

if you're looking for ease and scalability, d.py is the way to go imo

crimson vapor
#

it really depends on knowledge imo

#

there are a few scalable libs in js such as eris

latent heron
#

you're not wrong but they have tradeoffs

crimson vapor
#

everything has a tradeoff

latent heron
#

API wrappers shouldn't have tradeoffs

#

they're created solely for the lone purpose of making the API interpretative through whatever programming language you're writing it in

#

the moment API devs offer leniency on their stuff is when things can go downhill very quickly

crimson vapor
#

well djs, for example, trades off memory size and scalability for ease and less requests. Other libs such as d-rose allow cache to be configured but api requests need to be done manually and the data isn't turned into a class

quartz kindle
latent heron
#

d.py is scalable wdym?

#

eris is arguably scalable as well

crimson vapor
#

its not?

#

I thought thats what dankmemer used

quartz kindle
#

being scalable needs at least cache configuration

crimson vapor
#

unless they are on custom lib atm

quartz kindle
#

if you dont have cache configuration, you are by definition hyper-bloated

#

which is not scalable

latent heron
#

d.py has cache config

quartz kindle
#

since when

latent heron
#

it's not everywhere though

#

guild cache

#

user cache

crimson vapor
#

so you would say discord-rose is scalable? @quartz kindle

latent heron
#

cursed_anxious i swear there's cache in d.py

quartz kindle
#

can you make discord.py use 100mb ram with thousands of guilds?

latent heron
#

I cannot say because I have not achieved that yet

quartz kindle
crimson vapor
#

its basically done

quartz kindle
shell prawn
#

Hello dare, i have a question who can help me whit a discord game bot?

latent heron
#

okay but cache doesn't always mean full memory optimization though

crimson vapor
#

berry needs to add some quality of life features but so far its basically done

latent heron
#

i don't think that's a fair analogy

quartz kindle
#

well, my definition of "scalable" is something that can grow exponentially while keeping resource increase logarithmic

latent heron
#

aw man

shell prawn
#

No body 😄

latent heron
#

i dislike arguing semantics of how something gets defined

quartz kindle
#

if your bot doubles in size and your resource usage doubles as well, its not scalable

latent heron
#

not everyone will agree with the same concept even with a mutual sentiment established

lyric mountain
latent heron
#

thus why i always follow just the mutual sentiment and not special definitions

crimson vapor
#

idk if I agree with that but 100% resources should not double when size doubles

quartz kindle
#

^

latent heron
#

I don't think d.py does that

crimson vapor
#

logarithmic doesn't make sense tim

quartz kindle
#

a bot with 10k guilds should not use 10x more resources than a bot with 1k guilds

crimson vapor
#

basically that would max

latent heron
#

that's mathematically unsound

#

and also

crimson vapor
#

which it can't

latent heron
#

frankly impossible

quartz kindle
#

i used the wrong term then

crimson vapor
#

yea

quartz kindle
#

but you get what i mean

crimson vapor
#

mhm

shell prawn
#

I have maded a game like * retro habbo * i will instal a bot when a player plays in my retro hotel then the discord accoutn says * user 1 plays retro hotel *

latent heron
#

i don't think things double up with d.py or d.js as the wrapper alone

#

half of the scalability comes down to the developer

quartz kindle
#

they may not exactly double up, but they do increase in a proportion that is way too large to be acceptable

latent heron
#

if someone is doing some stupid shit in their code then ofc it's bound to go up in mem usage

#

but what do we define as an "unacceptable margin" of increased memory usage that says it isn't scalable?

#

there isn't actually any clear consensus on that

quartz kindle
#

if you launch a discord.js bot with no code except the lib itself, and it jumps to 500mb ram with a few thousand guilds, that is a scaling problem

crimson vapor
misty sigil
#

no thats just discord.js

crimson vapor
#

well

#

lemme fix

quartz kindle
#

yes, its just discord.js

#

but other libs are not much different

lyric mountain
#

yeah, exp growth and log resources looks surreal

#

blue is log

latent heron
#

correct

#

that means d.js would most likely not be considered scalable then

shell prawn
misty sigil
#

definitely no

latent heron
#

the wrapper alone should be able to sustain low memory usage

quartz kindle
#

exactly

latent heron
#

that's what i'm also getting at

quartz kindle
#

and last time i heard, d.py and eris were not much different

latent heron
#

d.py v1.6 changed a lot of things internally under the hood with that

quartz kindle
#

i can try running my bot in a barebones dpy and test

cinder patio
#

libraries aside, node.js is generally faster than python because of it's event-based architecture

lyric mountain
#

python is quite a low bar tho

latent heron
#

how?

shell prawn
lyric mountain
#

like, just search "how to make http request in X lang"

#

and make a webserver so the bot listens to it

#

basically the same process as top.gg voting webhook

shell prawn
#

thank you

olive pilot
#

hey how to make a command that gives you the bot invite link discord.py

quartz kindle
#

i logged in with a barebones discord.py and it takes 400mb ram

crimson vapor
#

what the fuck?

quartz kindle
#

so i did barebones d.py vs barebones d.js

#

py takes 412mb

#

js takes 534mb

pallid quail
#

those are some meaty bones...

quartz kindle
#

so yes, py is slightly more scalable than js

#

but the difference is not much

crimson vapor
#

oh wait on your bot token?

quartz kindle
#

yes

crimson vapor
#

ah

#

that makes sense

quartz kindle
#

let me test eris

crimson vapor
#

@quartz kindle you should also test discord-rose tbh

wise umbra
#

I'm having trouble installing the npm packagae color-thief.

umbral zealot
#

probably missing some pre-requisites?

#

what problem are you gettting?

wise umbra
#

no clue what i need to do here

umbral zealot
#

sounds like color-thief should bother pointing to the cnavas installation guide

#

but they don't

quartz kindle
#

eris: 458mb

wise umbra
#

Wait, i have canvas installed already

#

Installed it without any issues.. lemme look into it

crimson vapor
quartz kindle
#

testing drose rn

#

rose took 360mb

crimson vapor
#

how long did you test it for?

quartz kindle
#

but i guess its expected since it has less features and structures

crimson vapor
#

my bot starts at 70mb but goes down to 20 later

#

later being like 3 minutes or something

quartz kindle
#

its on for about 5min now

#

8 shards with shard auto

crimson vapor
#

ah

#

thats with default shit right?

quartz kindle
#

ye

crimson vapor
#

do you think you could try with the options I use?

quartz kindle
#

rose only has guilds, channels, members and roles right?

#

no messages yet?

crimson vapor
#

no messages

quartz kindle
#

so yeah, rose has less stuff than others

#

so its expected it uses less

crimson vapor
#
    intents: ['GUILDS', 'GUILD_MESSAGES'],
    cacheControl: {
      guilds: ['name', 'description', 'preferred_locale', 'unavailable', 'icon', 'owner_id'],
      members: ['nick', 'user'],
      channels: ['nsfw', 'permission_overwrites'],
      roles: ['permissions']
    }``` these are the options I use
#

could you try with that?

wise umbra
crimson vapor
#

poggers

#

is this heapUsed or rss?

snow urchin
#

Has anyone made a simple html interface that could be used for creating slash commands easier than manually doing all the api requests 😄
Seems like something that surely someone has done 😮

quartz kindle
#

so likely rss

crimson vapor
#

yeah

#

you should just js setInterval(() => { console.log(Object.entries(process.memoryUsage()).reduce((T, [K, V]) => (T[K] = (V / (1024 ** 2)).toFixed(1) + 'MB', T), {}) }, 1000 * 15)

quartz kindle
#

its gonna be the same thing anyway

#

plus the heaps will be wrong because it will only show process heap

crimson vapor
#

true

#

ive always just used process stats since any overhead for js would be for every lib

quartz kindle
#

currently sitting at 232mb

crimson vapor
#

pogging

#

ngl

#

13k?

quartz kindle
#

8k

crimson vapor
#

oh so 1k per shard

quartz kindle
#

ye

crimson vapor
#

right discord prefers 1k per

#

I really wish discord could have a token with tons of fake guilds to test stuff like this

quartz kindle
#

well its not hard to bulk generate random objects

crimson vapor
#

true

#

you could technically call the guild create event with a set of fake guild objects

zenith cape
#

How do you start creating a discord bot on Python?

crimson vapor
#

but the real memory stuff is when you get events constantly right?

#

thats why presense is so bad?

quartz kindle
zenith cape
#

I've tried that, it comes up with this:

#

What is the code again?

quartz kindle
#

even if you ignore presences, you still need to decode/decompress them

#

before you can know what type of packet they are

zenith cape
earnest phoenix
#

pip install discord.py

crimson vapor
#

oh right

earnest phoenix
#

or py -m pip ... or python3 -m pip depending on what os lol

zenith cape
#

Ohh thanks

#

I tried that

earnest phoenix
#

not in REPL

thick nexus
earnest phoenix
#

do exit()

zenith cape
#

I did

thick nexus
#

What do I do about 429 too many requests

zenith cape
#

Im on windows 10, python version 3.9

earnest phoenix
quartz kindle
thick nexus
zenith cape
thick nexus
quartz kindle
earnest phoenix
quartz kindle
zenith cape
thick nexus
#

Just nothing?

zenith cape
earnest phoenix
#

I told you, do exit()

zenith cape
earnest phoenix
#

You're not supposed to do it in REPL

zenith cape
#

Then went back in

quartz kindle
zenith cape
quartz kindle
#

if you type "python" you will enter REPL mode

#

you have to type the install command in cmd

#

not in REPL mode

zenith cape
#

Ahh

#

What do I use then?

earnest phoenix
#

Literally the same command

quartz kindle
#

put the install command

#

in cmd

#

and press enter

snow urchin
quartz kindle
quartz kindle
cinder patio
#

It's a mongodb problem

#

I'm getting it too

quartz kindle
#

why does mongo have a circular dependency

#

Lol

zenith cape
#

How do you get to cmd?

cinder patio
#

¯_(ツ)_/¯

quartz kindle
zenith cape
#

Ahhh

#

Got it thanks

thick nexus
cinder patio
#

Hmmm yeah... too many requests.. I wonder what that means thonkku

thick nexus
#

Well ik but

#

Like

earnest phoenix
#

Maybe it means that they send too many requests

thick nexus
#

No ik that

#

But

#

It hasn't been on in like 8 hrs

#

Ahhh

quartz kindle
#

is that all it says? is there no more information?

cinder patio
#

There should be a stack trace usually for this type of error

umbral zealot
#

Their "punishment" for this is increasingly long for each time this happens

#

So it could very well be you failed to heed it many times and it got really long?

#

¯_(ツ)_/¯

umbral zealot
#

You don't know if this has happened in the past?

quartz kindle
#

there should be either a timer in the stacktrace or a retry-after in the headers

zenith cape
thick nexus
#

File "main.py", line 508, in <module>
bot.run(os.getenv('TOKEN'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 718, in run
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 697, in runner
await self.start(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 660, in start
await self.login(*args, bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 509, in login
await self.http.static_login(token.strip(), bot=bot)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 293, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 209, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.

Discord Developer Portal

Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

lusty quest
#

did you try to login on a crash?

earnest phoenix
#

d.py should handle the ratelimit, shouldn't it?

umbral zealot
#

Normal ratelimits yes but not "you've been temp banned from the API"

quartz kindle
#

dpy should probably provide header information lol

snow niche
#
let dUser = message.guild.member(message.mentions.users.first()) || message.guild.members.cache.get(args[0]);```

How would I allow this to take ids as well?
umbral zealot
#

At this point it's not just a normal ratelimit it's literally that the bot or IP is temporarily banned

quartz kindle
#

wait why does dpy request /users/me at login?

lusty quest
#

ive got locked out once bcs ive attempted to reconnect when the connection where lost, or the process crashed, some bug caused the bot to attemp to login 600 times in 1 hour, after ive added a cooldown to attempts and added a max number of attempts it goes all fine now

earnest phoenix
#

to build ClientUser ig

quartz kindle
#

clientUser is given by the gateway tho?

umbral zealot
snow niche
#

it doesnt tho..

umbral zealot
#

Well it should. What's the issue you're getting?

snow niche
#

can I make it so they dont have to be in the guild

#

Cause message.guild

umbral zealot
#

Well sure, ok, for what command is this?

snow niche
#

a simple modmail command

quartz kindle
#

if you want a user, sure

snow niche
#

the user dms bot with questions

#

and we reply back

#

it works if we ping them

umbral zealot
#

Right so you could just get from client.users.cache then

quartz kindle
#

you dont need the member object for that

snow niche
#

but if they arent in server then iut doesn work

#

ok

#

client.users.cache.get(args[1]);

#

?

quartz kindle
#

also, you should probably fetch it

umbral zealot
#

why did that turn into args[1] instead of args[0]? lol

snow niche
#

i changed it rn xD

earnest phoenix
#

I am making one

umbral zealot
#

Well sure then if it's your second argument.

snow niche
#

Yes

umbral zealot
#

thumbs should be good

earnest phoenix
#

so apparently just to check whether or not the token is valid, but shrug

snow niche
#

still doesnt work@umbral zealot :c

umbral zealot
#

ok so what error do you get?

snow niche
#

none

umbral zealot
#

Can you show us the current code?

snow niche
#

<@id>

#

ok

umbral zealot
#

like the whole thing

snow niche
#

yes

#

the actual dm

#

the receiving works fine

#

its the dm that doesnt

quartz kindle
#

you're still trying to use a member

snow niche
#

huh

#
let dUser = message.guild.member(message.mentions.users.first()) || client.users.cache.get(args[1]);```
quartz kindle
#

message.guild.member()

snow niche
#

oh

#

but thats for a mention

quartz kindle
#

same thing

#

you dont need it

umbral zealot
#

lol no the problem is this

#
if (message.author.id === '756289468285190294'|| '557016470048210964') {
quartz kindle
#

Lol

#

i didnt see that

#

lmao

umbral zealot
#

That's not a valid condition

quartz kindle
#

that would cause a different error message tho

umbral zealot
#

would it? that's "I can't find that user"

snow niche
#

oh

quartz kindle
#

yes, which is from if !dUser

snow niche
#

its suposed to be so only me and my other dev can use the command

umbral zealot
#

Anyways you need to fix that condition

#

that's the first step

quartz kindle
#

yes

snow niche
#

ok

#

how could I say the comand will only run if the message.author.id is mine and my dev's

umbral zealot
quartz kindle
#

and second your user should be message.mentions.users.first() || await client.users.fetch(id)

snow niche
#

ok

umbral zealot
#

The second thing is, I'm pretty sure, like, pretty damn sure, it's args[0]

quartz kindle
snow niche
#

eek

#

the condition seems right?

umbral zealot
#

you didn't fix it

snow niche
#

whats wrong in it?

#

it seenms fine..

umbral zealot
#

you... literally changed nothing

#

is that still your old code?

snow niche
#

no I changed the === to = but thats wrong

umbral zealot
#

no MarioFP

snow niche
#

so i changed nothing

umbral zealot
#

read the link I sent

snow niche
#

i dont see whats wrong?

#

i did

umbral zealot
#

Not closely enough it seems

snow niche
#

const myName = input.name || 'No Name';
const text = hasDetail(input) && User Message: ${input.message};

#

like that

umbral zealot
#

Did you just skip to the end and pretend you read the page

#

this isn't a test. the answer isn't at the end

#

this is a page that tells you how conditions work. read it. The whole thing. Actually read.

snow niche
umbral zealot
#

Still not getting it. read the page.

snow niche
#

what

#

I did

umbral zealot
#

Stop mashing at the keyboard randomly and actually read the thing

quartz kindle
#

lmao

umbral zealot
#

smh

snow niche
#

bruh I literally did read it

quartz kindle
#

you didnt

umbral zealot
#

No you skipped to the end, copied the last bit of code, and tried to randomly change things

wise umbra
#

hey hindsight, in the md, it said this

Install Visual C++ Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" workload) or Visual Studio 2017 Community (using the "Desktop development with C++" workload)

i've installed it and i'm not sure how i need to follow the next step... And i did npm install -g windows-build-tools 🤔

umbral zealot
#

that's not understanding conditions, ytou clearly did not read the entire thing. Read it.

quartz kindle
snow niche
#

yes I did see that. i made it a variable and not a array tho

river panther
#

can someone tell whats wrong, i did /ping but the bot is also reading /echo

umbral zealot
river panther
#

oh god i am so st00pid

quartz kindle
river panther
#

ffs

quartz kindle
#

thats not the same

umbral zealot
#

What you did was make devs equal to '557016470048210964'

snow niche
#

ok

river panther
#

also, is there any way i can integrate slash commands in my command handler?

quartz kindle
#
const devs = '756289468285190294'|| '557016470048210964' // devs is now '756289468285190294'
if(something === devs) {
  // will only work if something is '756289468285190294'
}
sage bobcat
#

One message removed from a suspended account.

snow niche
#

I see

#

So I amde it an array now

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

snow niche
#

wairt

snow niche
#

ye

#

i see

quartz kindle
#

if(message.author.id === ["756289468285190294", "557016470048210964"].includes(devs)) {
means
if(message.author.id === true) {

umbral zealot
#

it's getting wronger and wronger

snow niche
#

ye

#

so

umbral zealot
#

lol

snow niche
#

I do

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

you literally just.... a === b || a === c

#

jfc

snow niche
#

const array = "values"
if message.author id = (array)

river panther
#

wait, he is helping a guy

#

wait

umbral zealot
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
umbral zealot
#

It is, but it's not the #general clowntown kekface

sage bobcat
#

One message removed from a suspended account.

snow niche
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

its getting worse and worse lmao

snow niche
#

then what do I do?

#

It said to use arrays

vivid fulcrum
#

stop skim reading and actually think about what you're reading

quartz kindle
#

you can use arrays for a large amount of comparisons, but you only have 2, so you dont need it

#

you literally just need to compare 2 times

#

thats all

#

look

sage bobcat
#

One message removed from a suspended account.

vivid fulcrum
#

simply going over the whole article as fast as possible is basically just not reading it in the first place 🙄

umbral zealot
#

You just needed the "Combining conditions" section

umbral zealot
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

if(a === b || c)
is the same as
if( true or false || true)

#

the second one is ALWAYS true

snow niche
#

oh so

#

&&

quartz kindle
#

because there is no comparison

snow niche
#

ohhh

sage bobcat
#

One message removed from a suspended account.

umbral zealot
#

you didn't which makes it a bad spoonfeed which is worse 😛

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

snow niche
#

ok so I get th issue

#

to fix it I do

river panther
#

can someone help me now?

sage bobcat
#

One message removed from a suspended account.

snow niche
#

const devs = '756289468285190294' && '557016470048210964'

probably wrong

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

lmfao

#

jesus christ

sage bobcat
#

One message removed from a suspended account.

river panther
#

elemphahoh

quartz kindle
# river panther ^

that question is too broad. there is a way yes, buts its complicated and depends on your library

river panther
#

discord.js

quartz kindle
#

discord.js doesnt officially support slash commands yet

#

so you have to use the raw api

river panther
#

yes i am using that only

#

and it works!!!!!

#

but i want to integrate it into the command handler

quartz kindle
#

then do

#

what is the issue?

sage bobcat
#

One message removed from a suspended account.

river panther
sage bobcat
#

One message removed from a suspended account.

river panther
#

or do i wait for v13

warm marsh
#

You already done it.

quartz kindle
cinder patio
#

We don't know what the structure of your command handler is

#

so we can't tell

warm marsh
#

All you need to do is implement roughly the same code just not hard coded values into your "command handler"

sage bobcat
#

One message removed from a suspended account.

snow niche
#

Im gonna make an arrya

#

lol i was gonna do that

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

you can use arrays but its not needed lol

river panther
quartz kindle
#

its overcomplicating it

snow niche
#

how would I do it without arrays

quartz kindle
#

you literally compare it twice

#

as i said

#

lmao

warm marsh
#

All the data you need is available in that handler.

wise umbra
#

Is this supposed to take time? been there for 20m i think

tribal siren
#

hello tim and googlefeud

#

how are you

outer zenith
#

if anyone is good at designing using css plz dm me

warm marsh
#

Is anyone actually good at CSS though?

river panther
#

jk jk

tribal siren
#
body{
  style: style
  color: color  
}```
#

¯_(ツ)_/¯

warm marsh
#

Yeah, just CSS becomes rather tedious.

cinder patio
# snow niche how would I do it without arrays

expression1 || expression2 - If either one of the provided expressions returns a "truthy' value, the if statement will be executed - all non-empty strings are truthy values, so if expression2 is a non-empty string, the if statement will always execute. You need to compare the ID string with the id of the author in all of the expressions

warm marsh
#

small voice of calm and reason - your let pull variable should have the data needed.

river panther
#

okay...