#development

1 messages · Page 1519 of 1

earnest phoenix
#

so you shard and split that connection into a bunch of smaller ones

#

hence shards

sturdy dock
#

hmm gotcha

earnest phoenix
#

lmao

earnest pollen
#

idk im sorry

#

i thought it would give the invite to the VC

proven lantern
#

base64 encode the image and put it in the css directly

buoyant aspen
#

Interesting... Won't decoding slow stuff down?

proven lantern
buoyant aspen
#

And does that even out, or are there significant advantages either way?

earnest phoenix
#

it's going to be slower

#

the end user ends up downloading the same amount of data

proven lantern
earnest phoenix
#

and then needs to also decode it

#

for small images, yeah, b64 is fine

proven lantern
#

image sprites are good way to reduce http connections without base64 encoding

deft lark
#

g

marsh oar
#

Hello I have a problem I have a welcome message with 0 errors but when the members join the discord nothing happens

#
const Discord = require('discord.js') 

module.exports = async(bot, guild, member, message, args) => {

    // création du embed.
    let embed = new Discord.MessageEmbed()
    .setColor('#ca0137')
    .setAuthor(`📥 — <@${member.id}> nous a rejoint`, member.user.avatarURL())
    .addField("Création", moment(member.user.createdTimestamp).format('ll') ,true)
    .addField("Jour(s)", checkDays(member.user.createdAt) ,true)
    .setDescription(`Concernant ${member.user}`)
    .setThumbnail(member.user.displayAvatarURL())
    .setFooter(`ID : ${member.user.id}`)
    .setTimestamp(new Date())
    bot.channels.cache.get("792435358368792607").send(embed) // Id du channel. [ALT + 8]
};
summer torrent
#

did you enable guild_members intent

proven lantern
#

https://discord.com/developers/applications/****BOT_ID****/bot

marsh oar
#

I do not change the name of guildmemberadd afterwards?

#

I have activated SERVER MEMBERS INTENT but nothing is still happening

quartz kindle
#

did you restart your bot after you activated it?

gilded olive
#

Can I learn typescript without needing to learn JS first

lament rock
#

Do you pass the proper intent to the client websocket options

gilded olive
#

Oh

#

Thats cool

quartz kindle
#

you will learn a lot of js in the process, but typescript will make it easier to learn if you have experience with java/C#

lament rock
gilded olive
#

Okee

quartz kindle
#

more like, to move from ts to js, you have to "unlearn" a bunch of stuff

lament rock
#

Aren't key words like public and private coming in newer revisions?

quartz kindle
#

not exactly

#

private already exists, but the syntax is different

lament rock
#

Right

gilded olive
quartz kindle
#

you dont use the keyword "private", you prefix it with a hash

#

#this.abc = "private"

#

in js that is

gilded olive
#

I'll try doing something simple but I haven't found anything worth while yet

quartz kindle
#

in typescript you use the keywords like normal

lament rock
#

I don't know any good resources off the top of my head, no. I learned TS after I learned JS so the transition was super natural

gilded olive
#

I see

#

Alr I'll find something probably

quartz kindle
# marsh oar yes

do you use the "intents" option in your client? like new Client({ws:{intents:"something here"}})

marsh oar
# quartz kindle do you use the "intents" option in your client? like `new Client({ws:{intents:"s...
const Discord = require('discord.js') 

module.exports = async(bot, guild, member, message, args) => {

    // création du embed.
    let embed = new Discord.MessageEmbed()
    .setColor('#ca0137')
    .setAuthor(`📥 — <@${member.id}> nous a rejoint`, member.user.avatarURL())
    .addField("Création", moment(member.user.createdTimestamp).format('ll') ,true)
    .addField("Jour(s)", checkDays(member.user.createdAt) ,true)
    .setDescription(`Concernant ${member.user}`)
    .setThumbnail(member.user.displayAvatarURL())
    .setFooter(`ID : ${member.user.id}`)
    .setTimestamp(new Date())
    bot.channels.cache.get("792435358368792607").send(embed) // Id du channel. [ALT + 8]
};
solemn latch
#

his question was about your client options

quartz kindle
#

show the code where you create your client

#

the part where you have bot = new Discord.Client

marsh oar
quartz kindle
#

in your code

#

in your index.js file

#

at the beginning of the file

#

you have this const bot = new Discord.Client()

#

show me this

cerulean ingot
#

should i make a fun bot or utility bot?

#

i was working on something until i hit a wall then had to stop

marsh oar
#

@quartz kindle

solemn latch
#

you need to enable the intent in your client.

marsh oar
solemn latch
#

that doesn't make any sense.

quartz kindle
#

you dont need to enable them

#

if none is specified, it defaults to all

#

so thats fine

solemn latch
#

oh, i thought it was all non privileged intents.

quartz kindle
#

how did you name the file?

#

guildmemberadd.js or guildMemberAdd.js?

marsh oar
# quartz kindle show your guildmemberadd.js file
const Discord = require('discord.js') 

module.exports = async(bot, guild, member, message, args) => {

    // création du embed.
    let embed = new Discord.MessageEmbed()
    .setColor('#ca0137')
    .setAuthor(`📥 — <@${member.id}> nous a rejoint`, member.user.avatarURL())
    .addField("Création", moment(member.user.createdTimestamp).format('ll') ,true)
    .addField("Jour(s)", checkDays(member.user.createdAt) ,true)
    .setDescription(`Concernant ${member.user}`)
    .setThumbnail(member.user.displayAvatarURL())
    .setFooter(`ID : ${member.user.id}`)
    .setTimestamp(new Date())
    bot.channels.cache.get("792435358368792607").send(embed) // Id du channel. [ALT + 8]
};
marsh oar
quartz kindle
#

delete these

mellow kelp
#

cuz guildMemberAdd only passes a member argument

marsh oar
quartz kindle
#

add const moment = require("moment") to the beginning of the file

#

and what is checkDays?

#

do you have a checkDays function in the file?

quartz kindle
#

then either create it or remove checkDays

#

where did you copy this code from?

marsh oar
#

I put const moment = require("moment")

gilded olive
#

whats the difference between let var and const ???

solemn latch
#

var declarations are globally scoped or function scoped while let and const are block scoped.
var variables can be updated and re-declared within its scope; let variables can be updated but not re-declared; const variables can neither be updated nor re-declared.
They are all hoisted to the top of their scope. But while var variables are initialized with undefined, let and const variables are not initialized.
While var and let can be declared without being initialized, const must be initialized during declaration.
https://www.freecodecamp.org/news/var-let-and-const-whats-the-difference/

sturdy dock
#

any recommendations for cheap us-based VPS? i'm using google cloud right now

#

thinking of OVH or digitalocean

solemn latch
#

galaxygate

#

cheap with a good amount of features and reasonably reliable.

sturdy dock
#

interesting, never heard of them

#

will look into it

manic cairn
sturdy dock
#

got it, thanks!

#

both seem good

solemn latch
#

@manic cairn hey, do you mind running a general purpose speed test if you have a VersatileNode vps?

#

i can get the command, just gotta find it lol

#

curl -sS https://raw.githubusercontent.com/jgillich/nixbench/master/nixbench.sh | sh

brittle raven
#

Hey

solemn latch
#

i want to compare to my host

drifting wedge
#

if i have an or, and both of the 2 are true

#

does it go or doesnt?

solemn latch
#

every time i find a host with better pricing than GG, and better cpu's they always have worse performance. no idea how

manic cairn
#

and exactly what is curl -sS https://raw.githubusercontent.com/jgillich/nixbench/master/nixbench.sh | sh gonna do?

drifting wedge
#

its gonna run that repo basically

#

nixbench.sh file

solemn latch
#

it runs a series of tests, cpu tests, network tests, and log the hardware you have.

drifting wedge
#

woo thats kinda sus ngl

solemn latch
#

itll also tell us the various cpu features enabled which some hosts

#

its an extremely commonly used set of tests.

drifting wedge
#

ik ik

#

but its still kinda sus

solemn latch
#

why 🤔

drifting wedge
#

like ik ur trusted

#

but i wouldnt run a rando repo

manic cairn
#

yea

drifting wedge
solemn latch
#

🤷‍♂️ i mean ive been using it for years, pretty sure most people use it.

drifting wedge
#

mhm

#

ik ik

manic cairn
#

still sketch

drifting wedge
#

just i wouldnt, but u do u

solemn latch
#

🤷‍♂️

drifting wedge
#

uh woo

#

does gg have good stuff?

#

ive had no problems with them so far

solemn latch
#

they have okay hardware, the big benefits are the drives, and unlimited bandwidth.

manic cairn
#

any other way to run a test without that thing?

solemn latch
#

i mean, all benchmarks require running a command

drifting wedge
#

& what specs r u getting?

solemn latch
#

their cheap plans are a 6700k or a 7700k

earnest phoenix
#

As there's the native package in JavaScript called events, it provides an EventEmitter class, is it possible to know the exact name of the event that was emitted on <EventEmitter>.emit()?

solemn latch
#

the more expensive ones are 9900k's i think?

drifting wedge
#

if i have like if arg1 == True or arg2 == True if theyre both true

#

what happens?

#

does it happen or not?

solemn latch
#

its true, so it happens

drifting wedge
#

but its an or

#

and if theyre both true

#

it happens?

#

its like either?

solemn latch
#

yep, your looking for exclusive or(one or the other)

manic cairn
#

24 USD with 2 vCore, 8GB DDR4 2666MHz, 60GB NVMe SSD Storage and i9-9900k @4.7GHz with other benefits

drifting wedge
#

nah im looking for either

#

but what works

#

so if both r true, it runs?

solemn latch
#

yeah

drifting wedge
#

alr ty woo

solemn latch
#

@slim void editing is generally better.

#

deleting and resending is two requests

#

editing is one

manic cairn
#

galaxygate seems pretty priced up

solemn latch
#

new york is expensive

quartz kindle
#

i wanna see the nixbench for that versatilenode thingy

solemn latch
#

yeah pandasad

#

i might have to buy one for testing

#

i just dont want to buy a vps AGAIN and not use it

manic cairn
#

Up to you but to me that thing seems pretty sketchy

solemn latch
#

🤷‍♂️ if you dont want to dont.

manic cairn
#

hehe i have an uptime of 913h43m38s

quartz kindle
#

whats sketchy about an open source piece of code lol

#

you can literally open it and see what it does

earnest phoenix
#

Oi tim

quartz kindle
#

you want to do like .emit("bla") and detect that a bla was emited without having any listener to it?

#

something like a catch all listener?

earnest phoenix
#

I mean, events are emitted using the <EventEmitter>.emit() method, so if i have an event listener for example, <EventEmitter>.on('message', () => { ... }), is it possible to know for example when the message event is emitted, get the name of the emitted event

ionic dawn
#

Hello guys, I have an issue, I want to list an array of emojis that is too long to fit in a single embed so Im trying to do a pagination to list them all. My question here is, how can I split a big array in pieces that will fit in different embeds?

earnest phoenix
#

Chunk the array

quartz kindle
#

name of the emitted event? the event name is "message", if you have a listener for it, you already know its name

ionic dawn
#

Chunk? LimesHmmm

solemn latch
#

if your looking to make your own events, you could also make a variable with the name of the event passed along with that event.

earnest phoenix
#

Oh wait nvm, i was planning to do some kind of iterations through them but then i realized <EventEmitter>._events exists that also includes their name LULW

quartz kindle
#

theres also .eventNames()

earnest phoenix
#

Chunk the array and iterate through them, first parameter takes an array, second the length of every subarray

sand dome
#

can anybody tell me why I can't put more then one/two spaces into embed ?

slim void
#

@solemn latch can a bot get rate limited for sending/deleting? If its a feature.

solemn latch
slim void
#

But what if it is just a feature

#

And the users spam the bot

solemn latch
#

you should be ratelimiting users from spamming commands

#

otherwise any command could result in a ratelimit

sudden geyser
#

@sand dome Discord trims it.

#

It's not good to rely on spacing like that since it may appear differently.

earnest phoenix
#

Discord doesn't trim spaces for bots

slim void
#

@solemn latch but my bot has a feature where you set the counting channel. Then the bit deletes any message sent to that channel, and converts it to a sent msg. How do I rate limit a delete msg?

sudden geyser
#

It does.

solemn latch
slim void
#

Wdum

quartz kindle
#

wdym converts it to a sent message?

#

do you resend the deleted message to another channel?

slim void
#

Tim no

#

So I have a counting feature

#

Let me just ss

#

You send the next number. Then it makes a new msg with the next number.

#

If u send an invalid num/text. It just deletes it.

quartz kindle
#

ah so if you post a message, it deletes it and edits the original one?

#

if the number is correct

slim void
#

No doesn't edit

#

Just deletes purges 1pp

#

100*

#

And makes a new one

quartz kindle
#

wait wut

slim void
#

Dms

quartz kindle
#

anyway, the rate limit for deletes is much higher than send/edit, so you should be fine

robust blade
#

while I was testing my play command for my bot
I got this error:
ReferenceError: Cannot access 'bot' before initialization

#
    // PLAY COMMAND
    if(command === 'play'){
        bot.player.play(message, args[0]); 
        // As we registered the event above, no need to send a success message here
    }
#

this is the command

earnest phoenix
#

You're using the variable bot before even defining it

robust blade
#

so what should i change it to?

drowsy grail
#

starting the long road of updating my codebase and api wrapper 😭

sudden geyser
#

What reason are you updating it for

solemn latch
swift cloak
#

hey

slim void
#

@solemn latch

swift cloak
#

does anyone here use macos? cause i need help

slim void
#

Can u join my server or test a feature on my bot and tell me if its ok?

#

And not rate limited

solemn latch
swift cloak
#

i need help
how to open port on macos? like i need my app to listen to a port but idk how to open
i turned off firewall
but no work

crimson vapor
#

what app?

#

express or something?

swift cloak
#

yes

#

express app

lament rock
#

Depending on where you're tying to access the app from, you may need to port forward in your router

swift cloak
#

so

#

it should be able to allow incoming connections

#

from anywhere

lament rock
#

That's not how it works

swift cloak
#

oh

#

i seached it up and it says to turn off firewall to open a port

lament rock
#

Your router also denies connections to a specific port unless the port is open

#

forwarded, that is. You need to go into your router admin panel and find port forwarding and configure the port

crimson vapor
#

yep in order to be accessible from outside you need to tell your router that

lament rock
#

If you're trying to access from within the same network, there is no need to port forward

#

keep in mind that random people may try to break into your systems. I set up a home security system once and someone tried to exploit the fact that the port was open. There was authentication for the web server listening on that port though.

swift cloak
crimson vapor
#

I mean its better to search online to see an article telling you how to on your router, with a good warning explaining why you shouldn't

solemn latch
#

@drowsy crag

drowsy grail
solemn latch
#

v11 has been deprecated for awhile now too, so a real good reason to move off it

long marsh
#

I get the port thing, but for what purpose?

swift cloak
long marsh
#

Right

swift cloak
long marsh
#

Yeah, I'd heavily advise against opening a port to your router from the internet ... lol

sturdy gazelle
#

What are some good ways to minimize the bandwidth usage of a discord bot?

long marsh
#

The only reason it'd be applicable is if you're running a server and you want people to connect from the outside to it (ie. Plex)

long marsh
sturdy gazelle
#

It’s just using a whole load of data I dunno if it’s all at once or just over time and specifically upload

long marsh
#

For my bot, which is in 131 servers, there's like little to no bandwidth going on 😄

sturdy gazelle
#

Yeah I think it might have to do with channel.stop typing being called too much?

#

I do call it twice for no reason

#

Idk if that’s the cause of it but my bot barely gets used either which is strange

misty sigil
#

@sturdy gazelle using intents?

sturdy gazelle
#

No I don’t think so

#

I only go so far as to set the bots status

#

Indirectly ig cuz I do set typing

#

I really don’t need to it honestly works terrible

swift cloak
#

express deprecated res.send(status): Use res.sendStatus(status) instead dashboard/routes/discord.js:4:9

#

help por favor

sterile lantern
#

How would your restrict a slash cmd to a certain role

#

In djs

sterile lantern
#

do res.sendStatus(status)

swift cloak
#

mb

sterile lantern
#

ah all good

lament rock
#

Your client might need to be apart of the guild for the role data. If it sends you the interaction initiator, you can just get the Member by ID and check their roles

#

Role data is usually only sent on GUILD_CREATE

sterile lantern
#

But how would i implement the restriction

lament rock
#

Are you not allowed to just not respond to the webhook?

sterile lantern
#

?

#

If I made a slash command it pops up for everyone

solemn latch
#

webhooks are generally not things you respond to.

sterile lantern
#

But I want to restrict it to role-only members

#

And I don’t have any prompts it’s just in the cmd

lament rock
#

I meant you could just return and end processing of the interaction if a condition isn't met

#

ah

sterile lantern
#

Yeah but I want it to say like “restricted u can’t use this”

#

If the user doesn’t meet the permission

lament rock
#

If the docs don't mention anything about restrictions they process on their side, I don't think there is anything like that. Does the interaction allow you to send messages only the user can see similar to clyde?

#

Because trying to do stuff like /nick causes clyde to send you a message

sterile lantern
#

Hmm

#

Well it shows for everyone

#

Not just the user

#

So maybe I’ll make it only show to the user

thick wind
#

hey what do i use for finding the time of an utc offset?

lament rock
sturdy gazelle
#

Did discord js have an update around the 3rd of this month?

earnest phoenix
#

Discord.js v13 is still in development, and there's no ETA so we don't know

sturdy gazelle
#

Did discord have an update around the 3rd?

#

Cuz that’s when my bot started acting all funny

zenith terrace
#

A d s lol

#

@coral trellis

#

Adums

#

owo

#

@oblique robin you arent getting far with them ads KEKW

#

Aw gone

lament rock
#

It's probably a logical issue on your end. Dependencies wouldn't auto update unless you specified you wanted a newer version.

I don't believe Discord's API/Gateway has received any updates recently

sturdy gazelle
#

Hm yeah it could easily be me

earnest phoenix
#

Why tho

#

I don't think anything is wrong there

mellow kelp
#

there's a trailing comma inside the brackets

solemn leaf
#
function meme() {
    const url = "https://meme-api.herokuapp.com/gimme/1";
let value;
    axios.get(url).then(function (response) {
        value = response.data.memes[0].url;
    });
return value;
};

Why is this returning nothing?

earnest phoenix
#

you're returning in a callback

solemn leaf
#

that returned nothing too

misty sigil
#

make the func async and use promises

earnest phoenix
#

learn how promises work

#

that code instantly returns value

#

it doesnt wait for the promise to resolve

#

the callback in then does

solemn leaf
#

Okay

#

thanks

earnest phoenix
#

is there a way you can make a bot advertise your server? or is there any out there can do one?

solemn latch
#

i mean, top.gg is a server list

earnest phoenix
#

what about just like general advertising?

drifting wedge
#

for a webhook

#

i give it a url

#

and how does it send the info?

solemn latch
#

via an http post request

solemn leaf
#

@earnest phoenix Dont get it

earnest phoenix
#

what exactly don't you get

solemn leaf
#

I returned the promise still empty

earnest phoenix
#

show your code

solemn leaf
#
function meme() {
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            axios.get("https://meme-api.herokuapp.com/gimme/1")
            .then(function (response) {
                resolve(response.data.memes[0].url)
            })
            .catch(reject(new Error("Failed getting")))
        }, 1000);
    })
};
earnest phoenix
#

what in the literal fuck

solemn leaf
#

idk dud

earnest phoenix
#

axios.get is already a promise

solemn leaf
#

Okay

misty sigil
#

what in the fuck

earnest phoenix
#

why are you wrapping it inside of another one

misty sigil
#

await axios.get()

#

simple?

crimson vapor
#

LOOOL

solemn leaf
#

1 min

misty sigil
#

Promisify the promise shall we?

mellow kelp
crimson vapor
#

(await axios.get()).shit[number]

solemn leaf
#

yeah the thing it it trys sending the message before I have the fucntion returning the link

#

at this point Idk

#
async function meme() {
    await axios.get(
#

SyntaxError: await is only valid in async function

#

isnt that function asynced?

mellow kelp
#

whoa what

#

what's the full code?

pale vessel
#

you either didn't save your code or one of your callback functions weren't async

sacred trout
#

@client.event
async def on_ready():
    await client.change_presence(activity=discord.Game(name=f"playing {client.guilds} servers | .help"))
    # await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"looking over {len(client.guilds)} server | ?help"))
    print("yeah")

status = cycle(['{0} servers | >help', '{1} users'])


@tasks.loop(seconds=5)
async def change_status():
    await client.wait_until_ready()
    content = next(status)
    await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=content.format(len(client.guilds), len(client.users))))```
#

File "c:\Users\schwt\OneDrive\Desktop\Projects\py projects\bot but with cog\main.py", line 20, in <module>
status = cycle(['{0} servers | >help', '{1} users'])
NameError: name 'cycle' is not defined

#

please help

mellow kelp
#

you probably don't have any function named cycle

sacred trout
#

yea

#

@mellow kelp how to make one me nub 😦

mellow kelp
#

i don't even know what that function should do

#

did you copy-paste that code?

sacred trout
#

@client.event
async def on_ready():
    await client.change_presence(activity=discord.Game(name=f"playing {client.guilds} servers | .help"))
    # await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"looking over {len(client.guilds)} server | ?help"))
    print("yeah")


async def ch_pr():
    await client.wait_until_ready()
    statuses = [f"on {len(client.guilds)} servers | .help"]
    while not client.is_closed():
        status = random.choice(statuses)

        await client.change_presence(activity=discord.Game(name=status))
        await asyncio.sleep(5)
client.loop.create_task(ch_pr())
```i had this previously then changed to that
mellow kelp
#

well i dont do any python anyways

#

this is about all i can make out of this

sacred trout
#

yeah np

earnest phoenix
#

5 seconds is too fast imo

#

you never started the loop as well, and why do you need to cycle an iterable that only contains 1 element

glacial pagoda
#

Anyone Know How To Make It So The Bot Command Only Works In 1 Specific Server?

#

I Need The Code

summer torrent
#

compare server ids

#

we don't give code

glacial pagoda
#

oh

#

wait why

#

not

#

like the code for how to do it

summer torrent
#

spoonfeeding not allowed

glacial pagoda
#

oh

#

so what do you mean compare server ids

sacred aurora
#

use if statement

glacial pagoda
#

ik

#

but idk what to put

solemn latch
#

the server id the message id was in, vs the server id you want.
if its the same, do it.

misty sigil
#

message server id == server id

sacred aurora
#

just do

if(message.guild.id != "your server id") return
misty sigil
#

!==, i really don't like seeing !=

sacred aurora
#

that'll be much better

glacial pagoda
#

oh

sacred aurora
#

:v

misty sigil
#

inb4 message is not defined

sacred aurora
#

its the same so yeah

summer torrent
#

how did you know he is using js smh

sacred aurora
#

oh

#

shoot sorry

solemn latch
#

mind reading powers

misty sigil
#

no no

pale vessel
misty sigil
#

they just have a crystal ball

solemn latch
#

oh the crystal ball! it was found!

sacred aurora
#

:v

misty sigil
#

well no

pale vessel
#

inb4 bdfd

glacial pagoda
misty sigil
#

nO

pale vessel
#

No not =

glacial pagoda
#

Right?

misty sigil
#

no

glacial pagoda
#

oh

pale vessel
#

and don't negate the guild id

#

that will make it false

misty sigil
glacial pagoda
#

oh

misty sigil
#

no its not flaze, its false

#

shit

pale vessel
#

feck you

misty sigil
#

fuck me then

pale vessel
#

:clarksonsad:

misty sigil
glacial pagoda
#

RIght?

misty sigil
#

==

glacial pagoda
#

ok

misty sigil
#

learn some basic js please

pale vessel
sacred aurora
#

why not != bruh

misty sigil
#

wh?

sacred aurora
#

then return

#

no i mean it would be lot nicer

misty sigil
#

oh wait i htought you were same person

sacred aurora
#

:V

misty sigil
#

5am is getting to me

sacred aurora
#

welp

solemn latch
#

generally inside the command i do {} only do returns like that in the command handler

glacial pagoda
sacred aurora
#

yeah that'll work

glacial pagoda
#

ok

#

Thanks

misty sigil
#

tha'll do. tha'll do.

twilit geode
#

how do I get the 4 digit tag in js

#

(of the client if its different)

pale vessel
#

Huh

mellow kelp
#

<User>.discriminator

long marsh
#

You guys are champs for taking these questions and responding 😄

valid crane
valid crane
#

its easy to keep stuff running

bleak glacier
#

you have to search in the packages PyNaCl

valid crane
#

how do i do that?

bleak glacier
#

wait..

valid crane
#

im kinda new to this

bleak glacier
#

lemme show you screenshot

#

Press that button

#

then search PyNaCl

valid crane
#

and install

bleak glacier
#

yes

valid crane
bleak glacier
#

Almost everything

valid crane
#

like...?

solemn latch
#

if you have no issue with it, its fine.

bleak glacier
#

It only runs the repl for 30m

valid crane
#

not if i keep pinging it with uptime robot

bleak glacier
#

But.. then your token will be leaked

valid crane
#

not if i have it in a env

solemn latch
#

you can hide your token with env variables

bleak glacier
#

and to make repls private you need hacker plan (which i have)

valid crane
#

expensive

solemn latch
#

private repls are un-needed if you use env variables

bleak glacier
glacial pagoda
#

message.channel.send('link 1', 'link 2', 'link 3')

Will The Bot Rotate Throught The Links?

#

Or Send Firts One Only

solemn latch
#

no

glacial pagoda
#

rotate?

tribal siren
#

is the event guildMemberAdd a Presence Intent or a Server Members Intent?

glacial pagoda
#

sounds like server member intent

#

i would reccommend having both on

solemn latch
#

dont turn on presence intents if you dont need them

tribal siren
#

i mean my presence intent got declined when whitelisting and i want to reappeal

glacial pagoda
#

oh

solemn latch
#

guildmemberadd is guild_members intent

glacial pagoda
#

soo woo, rotate?

#

or no

tribal siren
solemn latch
#

it will not rotate.

glacial pagoda
#

Then How Do I Make It Rotate

valid crane
#

a loop

glacial pagoda
#

through the link

#

message.channel.send('link 1', 'link 2', 'link 3');

valid crane
#

message.channel.send('link 1')
message.channel.send('link 2')

#

message.channel.send('link 3')

solemn latch
#

depends what you define as rotate, as in it edits every few seconds to the next link, or every time the commands run a different link is sent?

glacial pagoda
#

wont that send all

#

at the same time

#

:/

valid crane
#

nearly

glacial pagoda
#

0-0

tribal siren
#

can you please send a link for guild_presences intent?

#

i can't find it..

glacial pagoda
#

When the command runs again, it shows a diff link

solemn latch
tribal siren
#

like the docs

#

explanation of everyting it stands for

solemn latch
#

use said int to get the current link from the array

glacial pagoda
#

oh ok

#

ill try

tribal siren
#

ok thanks

drowsy epoch
#

whats a DM channel called?

solemn latch
#

pretty sure discord just refers to them as "dm"

opal swift
#

Hey so, i was trying to make my own bot but while following the tutorial it didnt work...
it worked from to the coding part but then it did'nt work.. Btw i'm on mac so that might be the reason idk

solemn latch
#

macs are generally a good platform to code on

#

any specific tutorial you followed?

opal swift
#

i cant download from steam cause my software denies it

solemn latch
#

the steam one is a really bad one imo.

topaz prairie
#

I'm trying to display the total shards for my bot on top.gg and this is my code

I'm not sure why it isnt working

solemn latch
opal swift
#

i'll try it later

solemn latch
topaz prairie
earnest phoenix
#

anyone know py?

slender thistle
#

just

#

state your question

solemn latch
#

are you following each page of the guide?

#

you cannot skip parts

opal swift
solemn latch
#

what errors or issues are you having?

opal swift
#

the bot is not responding

solemn latch
#

have you done any of the code yet?

opal swift
#

yes

spark badger
#

Türkce komutu ne

#

Selamın aleyküm cumleten

solemn latch
solemn latch
opal swift
#

Great.. i cant find it

solemn latch
#

ah. well lmk when you do.

opal swift
#

ok

#

Also my bot is offline...

solemn latch
#

so, you need to actually run the code

#

the docs go into that

#

the guide*

opal swift
#

how can i get it online?

solemn latch
#

every one of them. skipping steps, or parts of steps and it wont work.

opal swift
#

The language is JavaScript right?

solemn latch
#

yep.

opal swift
#

ok

cunning gorge
#

How do you find the amount of users across all guilds? Like a total sum

solemn latch
#

easiest way, probably mapping all guilds by their memberCount and reducing it.

lusty quest
#

^

umbral zealot
#

Well you don't need to map first. Lol

solemn latch
#

oh shoot you are right

umbral zealot
#

What language, though?

cunning gorge
#

js

umbral zealot
#

1 sec

cunning gorge
#

So like bot.guilds.cache.reduce

umbral zealot
#
client.guilds.cache.reduce((x, y) => x + y.memberCount, 0)
zenith terrace
#

@umbral zealot no spoonfeed

umbral zealot
#

yo this is not an easy one to explain aight

cunning gorge
#

interesting

umbral zealot
#

took me a while to grasp reduce() in all its glory

zenith terrace
#

ok fair

cunning gorge
#

So first paramter is function

solemn latch
#

its hard because everyone x y's it

opal swift
#

i also have another question.. How do i restart my bot?

umbral zealot
#

And second parameter is the initial value

cunning gorge
#

"accumulator, currentValue, currentKey, and collection", would this be collection?

solemn latch
umbral zealot
#

so it's reduce( (accumulator, currentValue, currentID, collection) => { return accumulator }, defaultValue) essentially

solemn latch
#

the guide goes into pm2 and stuff later.

umbral zealot
#

you always have to make sure to return the accumulator which, well, "accumulates" data through the loop - it's passed down to the next iteration loop

cunning gorge
#

It may take my a while to grasp this 😅 I'll read the docs online and research it, ty!

umbral zealot
#

Sure, and in the meantime what I sent earlier is the literal answer, for discord.js 😂

cunning gorge
#

Thanks 🤟

umbral zealot
#

I use it in many places, myself, so I made a util function for it ```js
client.getAllMembers = () => client.guilds.cache.reduce((x, y) => x + y.memberCount, 0);

cunning gorge
#

wait nvm

#

that's my testing bot

opal swift
solemn latch
#

did you run the code?

opal swift
solemn latch
#

why

opal swift
solemn latch
#

the bot is offline unless you run the code

opal swift
solemn latch
#

the guide covers this, please dont skip parts.

opal swift
lusty quest
#

the guide covers it.

opal swift
#

uhhh.. whats this?
code: 'MODULE_NOT_FOUND'

solemn latch
#

did you install discord.js?

opal swift
#

yep

solemn latch
#

while it was installing did it give any errors?

lusty quest
#

it should say somewhere in the error stack what module is missing

opal swift
#
  throw err;
  ^

Error: Cannot find module 'discord.js'
Require stack:
- /Users/apple/mybot.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/apple/mybot.js:1:17)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/apple/mybot.js' ]```
#

thats what it shows

solemn latch
#

looks like you didnt install discord.js

umbral zealot
#

As a sidenote your code shouldn't be directly in your user's folder Make a new folder in your Document or something

#

because now you're mixing system files and bot files and it's going to get messy real quick

lusty quest
#

what if his bot is called apple?

opal swift
#

now it shows this:

    at WebSocketManager.connect (/Users/apple/node_modules/discord.js/src/client/websocket/WebSocketManager.js:133:26)
    at Client.login (/Users/apple/node_modules/discord.js/src/client/Client.js:223:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1652) 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:1652) [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.```
umbral zealot
#

Yeah no that's now how file systems work 😂

lusty quest
#

nvm

opal swift
lusty quest
#

yea just saw the path

umbral zealot
opal swift
#

yep

solemn latch
#

skipping parts of the guide wont work.

opal swift
#

i copy pasted the token

umbral zealot
#

maybe you should go through a few javascript tutorials as well before trying to write bots.

solemn latch
#

youll do this for litterally days when it could take 20 minutes if you dont skip parts.

zenith terrace
lusty quest
#

just skipping the text and reading only the codeblocks wont help

opal swift
#

and the main prob it shows invalid token

umbral zealot
#

Also, again, skipping the part about "learning javascript before making a bots" won't help at all

#

the guide expects you to at least have the basics, which you clearly don't have

opal swift
#

done it for a year

umbral zealot
zenith terrace
#

but you didnt know about installing a module?

umbral zealot
#

or starting your project

opal swift
#

dont judge me

umbral zealot
#

Or, in this case, probably, just copy/pasting a single string in the right place

lusty quest
#

pretty much everything you make in node.js requires some external modules

umbral zealot
#

This has nothing to do with "bots", it has to do with the basics of nodejs.

lusty quest
#

not just bots

opal swift
#

i know

umbral zealot
tardy hornet
tardy hornet
#

how do i get the message.mentions.members.first() id?

solemn latch
#

message.mentions.members.first().id

umbral zealot
#

Remove the .members at the end

opal swift
#
umbral zealot
umbral zealot
#

you have to learn the LANGUAGE first.

#

nodejs is based on javascript

lusty quest
# restive furnace fALse

i know there are cases where its not true, but most stuff usually depend on some external Modules.

restive furnace
# restive furnace fALse

i can prove it by doing a whole discord bot without external modules, not even ws, just the built-in fearures

umbral zealot
#

they're languages

tardy hornet
umbral zealot
#

that wasn't the point

solemn latch
#

i want to see this bot though

lusty quest
#

also using modules make developing faster, with no need to make your own methods for certain stuff

solemn latch
umbral zealot
#

Yes please do go ahead and make it without any external dependency

#

Literally no use of require or import, go ahead

tardy hornet
#

if its only message.mentions.members.first().id it says that the id is undefined

umbral zealot
#

the latter makes no sense

lusty quest
#

you could make it in a single file, but it would be horrendous to read and to keep track of stuff

umbral zealot
#

you don't get the members of a member

#

Also it wouldn't say id is undefined

#

would it maybe say cannot get property id of undefined ?

drifting wedge
#

If I make the dbl vote webhook be one of my websites thing

#

How do I get what the webhook is sending?

umbral zealot
#

you.... receive it through the http address the webhook is sending to.

#

it's a simple POST message.

drifting wedge
#

Like the webhook sends it thru the url?

#

I dont understand lmao

#

Me no smart lmfao

umbral zealot
#

A webhook is literally just an HTTP POST request to a specific URL that usually includes a secret or a token

#

So first off, what do you mean by If I make the dbl vote webhook be one of my websites thing

#

because... I'm not sure I fully undrestand what you're saying here

earnest phoenix
solemn latch
#

your webhook receiver is just an http server, same as one that would host a website, just specialized for receiving inter-server data.

drifting wedge
#

I don't understand http too well

umbral zealot
#

you might want to get message.mentions.users.first().id instead.

#

that one's always available

tardy hornet
#

still

#

doing the same error

#

@umbral zealot

umbral zealot
#

did you even mention anyone in your message

tardy hornet
#

1s

earnest phoenix
#

How can i make a forEach to deny the send messages permissions to a Muted role on every channel the guild has

umbral zealot
#

guild.channels.cache.forEach()

fast trench
#

ok so I'm completely brain dead...should this console log the given guild's name? It's straight from the docs

client.guilds.fetch('797555277146357792')
  .then(guild => console.log(guild.name))
  .catch(console.error);``` and the error is ```js
client.guilds.fetch is not a function```
old cliff
#

oof

umbral zealot
#

client.guilds.cache.get("id")

old cliff
#

try client.guilds.cache.get(id)

umbral zealot
#

you don't need to Fetch a guild. Guilds are always cached

fast trench
#

Then why tf is the docs telling me different...also I tried the .get method

umbral zealot
#

and what happens when you use get

solemn latch
#

the docs provide a fetch method just in case its ever needed, as guilds can be removed from cache if dev's force them to be.

umbral zealot
#

I don't remember ever seeing a guild not be already fetched, that would be an extreme edge case, tbh.

fast trench
#

didn't know that...and of course it works when I go to show you what happens 🙃

true ravine
#

I use discord.js-light so my understanding might not be quite right, but surely if you fetch a guild that is already cached it will just use the cached one without fetching?

solemn latch
#

yep

umbral zealot
#

Oh right some people use that thing. smh

golden condor
#

It does look through the cache first yes

true ravine
#

So surely their code should work?

golden condor
#

Depends what the client variable is

true ravine
#

True

umbral zealot
#

Are they even using discordjs-light though

#

¯_(ツ)_/¯

fast trench
#

so when do I use this way of defining things? I have always used it in d.js v12

const bleh = client.guilds.cache.find/get(u => u.id === `123`)```
golden condor
#

No but it's the same with djs

true ravine
#

I assume not but I thought fetch worked that same

#

Yeah ^

umbral zealot
#

get("id") , get doesn't take a function

golden condor
umbral zealot
#

It's client.guilds.cache.get("264445053596991498") for example

#

Also make sure you're inside an event handler, if you're not inside an event, the cache doesn't exist yet

fast trench
#

then why wouldn't it work when I used .find? It was getting an error at .cache

umbral zealot
#

What error

golden condor
#

Some functions can't be used until the bot readies

solemn latch
#

Inb4 v11

umbral zealot
#

That would be funny

fast trench
#

I hate my computer...why isn't it throwing the errors anymore 😅 either way it's all good and working lol

golden condor
#

I use djs v10, why doesn't my bot start?

fast trench
#

ok then why won't this work? I've never ever had this issue 🙃

const mainGuild = client.guilds.cache.get(`797555277146357792`);
const devOne = mainGuild.members.cache.get(`495702607982231586`);```
umbral zealot
#

The second one might not work, if the member isn't cached.

#

But the first one, yes it should always work as long as you're inside an event handler.

fast trench
#

so I need to fetch the member? the member is going to be the owner of the guild and bot so it better be cached lol

umbral zealot
#

No it's not going to be cached.

#

You need to fetch it.

fast trench
#

I appreciate the help...it's 3:30 am and I need sleep lol

umbral zealot
#

No worries!

#

But go to bed now 😜

slender thistle
#

Yes you do bye goodnight sleep well don't respond

fast trench
#

It won't let me send a message to them...it's saying devOne.send isn't a function when I try to send a message to myself

#

I need to get this done or I honestly won't be able to go to bed because it should be simple

umbral zealot
#

Tired programmers are dumbass programmers.

cinder patio
#

Alright so I've been toying around with slash commands... and I definitely like them way more than normal commands

#

they work even if the bot can't see the channel, and the bot can reply to them even if they don't have the SEND_MESSAGES permission, you don't need a websocket connection to use them

topaz prairie
#

im currently using this code but idk why total shards isnt showing up on top.gg

client.on('ready', () => {
    setInterval(() => {
        dbl.postStats(client.guilds.cache.size, client.shards.Id, client.shards.total);
    }, 3600000);
});
topaz prairie
#

yeah i do, this is just my second discord acc

#

okie ty

timber fractal
#
        const wyr = new Discord.MessageEmbed()
        .setTitle(`Would You Rather`)
        .setAuthor(message.author.tag, message.author.displayAvatarURL())
        .addField(`${response}`, `What would you rather?`)
        .setColor(`RANDOM`)
        .setFooter(`React below with A or B`)
        .setTimestamp```Why if i try to send this embed it says "cannot send an empty message
umbral zealot
#

Well that's part of the code. what's the rest of it?

timber fractal
umbral zealot
#

is it wyr or embed

#

code doesn't match

timber fractal
#

embed

#

i changed it to embed instead of wyr @umbral zealot

umbral zealot
#

Ok and... does it work now?

timber fractal
#

no

#

still same error

umbral zealot
#

Are you sure that's the right command that's causing the error?

timber fractal
#

yes

#

i use >wyr

#

and command is >wyr

umbral zealot
#

And this is discord.js v12, right?

#

if you do npm ls discord.js in your project folder

timber fractal
#

discord.js@12.5.1

#

so yes

#

its v12

umbral zealot
#

I don't see how this code could cause that error then

timber fractal
#

oof

umbral zealot
#

Like, that's... correct code...

timber fractal
#

i had this a time ago and then i fixed it but i tried same thing again and it doesnt work

#

and how i fixed it was gjust changing thename to embed

#

im just gonna try to write a new embed

umbral zealot
#

Honestly though, that code looks fine.

#

other than the fact that you're using the same variable for message inside the callback

#

but that's... still scoped so it should work even if it's confusing

timber fractal
#

@umbral zealot its the embed i tried to make it send js message.channel.send(`What would you rather`, embed) and it sends What would you rather and it reacts but it doesn't send the embed

umbral zealot
#

try doing message.channel.send({ embed }) instead

zenith terrace
#

honestly I dont see anything wrong with it

umbral zealot
#

Could also be message.channel.send("What would you rather", { embed }) if you want both message + embed

zenith terrace
timber fractal
timber fractal
timber fractal
zenith terrace
#

I did what was shown in the hastebin file and it worked so idk what is wrong with it for you

timber fractal
#

normally its only message.channel.send(embed) but i will try it

#

it works!!!!

zenith terrace
#

oh nvm

#

xD

timber fractal
#

with {embed}

#

thanks

#

but without {} in my other commands it works fine so dumb command

#

but it works so i will nvm it

earnest phoenix
#

Hi one question

#

Is there any way to create timer which stops a fucntion after 10 seconds in js

#

pls ping me

#

setTimeout

earnest phoenix
#

and not stops

#

because you did it wrong

#

show your code

earnest phoenix
#

it's simple setTimeout syntax

#

...show your code

earnest phoenix
#

this executes after 3 seconds

#

correct

#

but i want a timer xD
like after 3 seconds it will stop the function

#

...so why would you want a timer

#

a timer is for repeating actions

#

a timeout is for delayed actions

#

to terminate a code

#

i still don't see why you would need a timer for that

#

you can execute anything and everything in a setTimeout callback

#

i am making a custom command bot and if a user ues a while loop i could stop it with a timer

pure lion
#

what's it going to do for 3 seconds

earnest phoenix
#

like

while(!a){
//endless loop

}```
#

are you sure custom commands which execute code directly are a good idea

#

la can stop it with the timer

#

in the first place

#

because attackers can do actual proper harm

earnest phoenix
#

u cant use your own function

pure lion
#

someone could just make your bot delete every channel in every server its in

#

or just leave everything

earnest phoenix
#

no because u cant acess it

#

that's what you think

#

u can only acess message object

#

not client

#

i am not a dump xD

pure lion
#

client is under message

earnest phoenix
#

so how would you block accessing client

#

checking for it as a string?

#
function executecc(ccstring,message){
      try{
     function SEND(stringmessage,channelid){
         channelid = String(channelid);
         if(!stringmessage) return "No Message provided!";
         if(channelid) channelid = message.guild.channels.cache.get(channelid);
         if(!channelid) channelid = message.channel
         channelid.send(stringmessage);
     }
     return //execute function
    }
    catch(error){
    return clean(error);
    }
#

see this is a function

#

if use client it will throw undefinded

slender thistle
#

Stopping a while loop? Okay, I'll just spawn million child processes. Or, maybe, DM every user the bot sees a thousand times.

earnest phoenix
#

since it is over the scope

pale vessel
#

String(channelid); what are you doing

pure lion
#

that code formatting tho

earnest phoenix
#

stolen

#

probably

#

no

#

i can code bruh

#

you might not have an improted client in that file

#

but attackers can still access it

pure lion
#

just as a ref

earnest phoenix
#

how?

pure lion
#

message.client is the client object

slender thistle
#

M e m o r y 🤩

earnest phoenix
#

lol let me try

#

you can also require/import everything, find where client is used

#

use fs

#

do tons of more harm

slender thistle
#

It all comes back to... oh look, public eval being a bad idea! :o

earnest phoenix
#

this is the reason why custom commands are not executed directly but rather often have their own language which is then preprocessed into actual code

#

nope undefinded

sacred aurora
#

anyone use puppeteer for web scraping?

#

i have a problem here

#

so when i try to scrape from my local computer its working

#

but when on host its not working

earnest phoenix
slender thistle
earnest phoenix
#

like if(token=Send)
get args
function send
like this

pure lion
#

yes i have public eval

#

but its safe eval

earnest phoenix
earnest phoenix
fathom plinth
#

message.client

#

gives the client

earnest phoenix
#

no it returns undefinded

#

by mines

eternal osprey
#

hey guys

#

nvm

lusty quest
#

you could run a Public Eval command on a Express server that got no connection to your Bot and then limit certain stuff, But i dont think this is worth the efford

lusty quest
#

bcs its stupid, like a public eval command

earnest phoenix
#

a custom command bot + multi purpose is on hype

tardy hornet
#

i forgot what to put there:

i wanna do that if args 2 isnt a number it will return

#

and i forgot what define the number

#

like if(args[2] != ??)

earnest phoenix
#

!Number(args[2]) @tardy hornet

tardy hornet
#

k ty

tribal siren
#

how does getting invite info work?

#
let invite = message.guild.fetchInvites(args[0])
message.channel.send(invite.channel)```
#

this doesn't seem to work

earnest phoenix
tribal siren
#

you didn't define discord

#

const Discord = require('discord.js');

fathom plinth
#

thats kindaweird cause the documentation says message.client returns the actual client

eternal osprey
#
collector.on('collect', m => {
                let tradepokemon = m.content
                console.log(m.content)
                
                });

                const exampleEmbed = new Discord.RichEmbed()
                .setColor("RANDOM")
                .setDescription('Trade request.' + "@<"+firstmember+">" + "'s " + found.name +  " for " + targetMember + "'s " + tradepokemon)
                .setImage('')
                .setTimestamp()
                .setFooter('Made for your server!');
                message.channel.send(exampleEmbed);
                const reactionEmoji1 = "❌";
                const reactionEmoji2 = "✅";
              let msg = await message.channel.send();``` hey is there any way how i can define tradepokemon outside the scope of the collector?
crimson vapor
eternal osprey
#

or outside?

boreal iron
#

Outside of course

crimson vapor
#

anywhere lol

boreal iron
#

Before calling your collector

#

If you wanna change the var inside the collector to use it later again

eternal osprey
#

yeah i know

#

thanks!

#

how would i actually check whether the m.content contains any type of text?

crimson vapor
#

m.content.includes()

clever vector
#

How to make Python bot

knotty stirrup
earnest phoenix
#

Why tho

#

Can anyone check for errors and correct me?

gilded olive
sacred aurora
#

the command code is should be inside the run function

#
module.exports = {
    name: "lockdown",
    category: "owner",
    run: async (client, message, args) => {
        ///the code
    }
}
zenith terrace
#

@earnest phoenix ur putting the code outside of the { } KEKW

earnest phoenix
#

@sacred aurora I'm not

#

I mean I copy pasted from another code in my bot

#

Since I'm a lazy ass

#

WAIT

#

I'm so dumb

#

I didn't notice

#

This

#

Thing

#

Bruh

sacred aurora
#

brrruhh

tribal siren
#

How to delete an already sent ticket to the discord support?

pale vessel
#

Did you threaten a staff

gilded olive
#

you can just press close ticket

#

tickets do not go away ever afaik

earnest phoenix
#

{"code": 0, "message": "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."}

when i try to open my bot i am getting rate limit error i have 3,200 servers i have 3 shards thats weird I'm using v12.5.1

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.

rustic nova
#

congratz you got ratelimited

earnest phoenix
#

I can open the bot on my own computer but vds also does not work

rustic nova
#

check through your code and make sure it follows the ratelimit guidelines from the link mentioned

#

You won't be able to start it

#

you got ratelimited

#

does that show up when starting your bot?

earnest phoenix
#

yes "sharding ready timeout shard 2 client took to long to do"

#
const Discord = require('discord.js')
const { ShardingManager } = require('discord.js')
const manager = new ShardingManager('./bot.js', {
  token: ayarlar.token,  
  totalShards: 3
});

manager.on('shardCreate', shard => {
 console.log(`[${shard.id+1}/3] Numaralı Shard Discord'a Yeniden Bağlandı ve Aktif.`);
});

manager.spawn();
manager.on('message', (shard, message) => {
    console.log(`Shard[${shard.id}] : ${message._eval} : ${message._result}`);
});``` this is a my sharding manager
#

i have 3,200 servers

rustic nova
#

yeah you got ratelimited, re-read how to shard properly

twilit geode
#

can someone explain how it works, nothing is wrong with it, I just dont know how it works

client.guilds.cache.reduce((a, g) => a + g.memberCount, 0)
rustic nova
#

@drowsy crag get some beaning here

twilit geode
#

b e a n

drowsy crag
#

tsk

earnest phoenix
twilit geode
#

oop

rustic nova
#

check the ratelimiting guidelines

earnest phoenix
#

Thats so weird because the bot is running on my computer but vds also does not work

rustic nova
#

your whole application got ratelimited

#

check the ratelimit guidelines

earnest phoenix
#

When do you need to start sharding?

orchid cobalt
#

If I remember correctly , there is something in dpy to reset all the cache . Do you know what it is? There is something I am pretty sure , I just don't remember what its called.
Note: I don't want to restart
Ping me if you know something

rustic nova
#

sharding is required around 250,000

#

i suggest you to start sharding with 20k servers or so

orchid cobalt
#

thankss

quartz kindle
rustic nova
quartz kindle
#

thats for "very large bots", which have special sharding requirements

#

sharding is required at 2500 and recommended at 1500

umbral zealot
#

Can confirm, you need to start at 2500 and add a new shard every 2500 after that

earnest phoenix
#

explain

#

why

#

msg.guild.members.forEach(member => {
member.setNickname(e- + member.user.username)
})

#

that

#

when the bot has every permission

#

and i the owner

#

use this command

#

it returns missing permissions in the console log

crimson vapor
#

is your name above the bots?

earnest phoenix
#

uhh

#

why

#

its below it

#

also

#

im using it to change other peoples nicknames

#

everyones nickname*

#

and idk why it wont change them

#

makes no sense

runic lantern
#

@earnest phoenix make sure that the bot's role is above all the roles of whoever you're trying to nick

earnest phoenix
#

mhm

#

it is

#

you want me to take away the rest of the bots perms

#

and keep the bot im trying to use with perms

#

cause i hve literaly not a clue

#

wtf this is happening

#

sounds dumb

#

but i really dont get it