#development

1 messages · Page 222 of 1

deft wolf
#

Also you can use neofetch command to check CPU model

#

One of my VPSs that is not hosted on Contabo

crystal wigeon
#

thanks lemme try

#

damn its amd but wtf why is it so slow

eternal osprey
#

contabo is so fucking shit

#

But @crystal wigeon it's most likely not the performance of the vps itself once you host something on it, just the interface. IIrc the vps itself is using a distributed file system, with other words the interface you are seeing is not even real. It actually stores all data into smaller blocks across a big cluster of machines.

crystal wigeon
#

Couldn’t find a cheaper one tbh

#

I see

eternal osprey
#

so what it does, is it must gather a lot of blocks from all the machines and concatenate them, which looks and operates just like it's running on your bought machine (which it isn't ).

crystal wigeon
#

Scam wtf

eternal osprey
#

If the network speed is fucked, for example the vps is ran on american servers and you are european, the download and upload will be slow too.

crystal wigeon
#

No wonder my small docker build took more than 1 min

#

hmm

eternal osprey
# crystal wigeon Scam wtf

It's not. You still get the computational power you bought for, but the files are just distributed over many other machines.

crystal wigeon
#

is there a better hosting service

#

Hmm

eternal osprey
#

To be fair, a lot of vps's i have been using tend to use dfs. It's the only way to work with big data realiably.

crystal wigeon
#

But why docker build took so long tho. On my Mac it builds in like 20s

#

Yeah

eternal osprey
#

not sure.

#

as long as the program itself is ran with decent performace, i don't mind the latency and slowness it comes with.

crystal wigeon
#

Tbh I have one more vps on contabp which had like 8gb ram and 4 cpu. My docker build there was 20s

#

But I bought new upgraded machine

#

Cause cheap price

#

On the new machine it’s so slow I was expecting it to be same or faster

eternal osprey
#

Why the fuck did each server turn into a rainbow lightshow brev

crystal wigeon
#

Even establishing a redis connection which is on the same machine takes time

#

Lmaoo fr

eternal osprey
#

It's german right

crystal wigeon
#

US

#

But this isn’t about network latency

#

I have redis installed on the same vm as my program

eternal osprey
crystal wigeon
#

there’s noticeable delay when starting the app

eternal osprey
#

Its german g

eternal osprey
crystal wigeon
#

it’s a EU company yeah

#

German region is free but they have us to for 2$ a month

eternal osprey
#

If it's using a dfs there is indeed going to be a startup delay.
It's because the blocks are stored over many smaller computers basically. the client must contact the namenode (the master of the cluster) to gather all blocks, and to start processing tasks on each block.

crystal wigeon
#

But that doesn’t explain how my other vm has little delay

#

Which is in the same region. US

eternal osprey
#

The other vm is also running on contabo right?

crystal wigeon
#

yeah

eternal osprey
#

It still needs to gather and concatenate all data, so even that vm shall have a delay.

#

even if it's sent over a network closer to yours, it's still having to process everything.

crystal wigeon
#

That’s the thing, the delay is not much there

#

Mm

eternal osprey
# crystal wigeon That’s the thing, the delay is not much there

yes, but the process still shall go like this;
i want to run file x -> namenode -> namenode gathers all blocks, by probing machine 1,2,3,4 -> these machines load the data into memory for you to run. All probes, all transmissions are done over the network. And well, depending on the used framework it adds a heavy delay.

#

Unless they are using apache Spark known for being pretty fast as it caches its data.

crystal wigeon
#

I’m not sure what they’re using. Is there a way to check it?

#

Welp ig I can live with the delay given that it’s way cheaper than any other provider

eternal osprey
#

let me check for you

surreal sage
#

slowest build with bun..

wooden ember
#

bruh turns out the same exact code that works on my pc and my server will not work on my pi. audio still drops out after 30-40 seconds with no errors at all.

#

fun times

neon leaf
neon leaf
crystal wigeon
#

US

neon leaf
#

(it randomly segfaults in cis)

neon leaf
crystal wigeon
#

ye

surreal sage
neon leaf
#

just make custom esbuild plugin

#

smh

surreal sage
#

that's like hardcoded innit

#

/ too much work

#

only using bun for that and that only

quartz kindle
#

they will either fix it or transfer you to another instance

#

shit like that happens in hosts all the time, some instances are just borked

#

run some benchmark scripts of both of them and then send them a complaint

crystal wigeon
#

damnn flork_think hmm i see. thanks for the info

wooden ember
#

wacky load balancer go brrrrrrrrrrrr

radiant kraken
neon leaf
#

pretty short

radiant kraken
#

fastest rust build time

neon leaf
eternal osprey
#

I know, I didn’t recommend them the vps. I just stated what they are running their framework on

quartz kindle
#

theres also datalix, they have pretty amazing prices

charred nest
#

it did not

deft wolf
quartz kindle
#

ah

#

im using hetzner US

#

a bit more expensive but pretty good

radiant kraken
#

does anyone know why OpenPGP said gpg: no valid OpenPGP data found. (after running the last command)?

      - name: Prepare java binding
        working-directory: bindings/java
        run: |
          echo 'org.gradle.jvmargs=-Dfile.encoding=UTF-8' >> gradle.properties
          echo 'signing.secretKeyRingFile=./keyring.gpg' >> gradle.properties
          echo '$MAVEN_GPG_PRIVATE_KEY' | gpg --dearmor > ./keyring.gpg
        env:
          MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
#

MAVEN_GPG_PRIVATE_KEY is formatted as ```
-----BEGIN PGP PRIVATE KEY BLOCK-----

urmom
-----END PGP PRIVATE KEY BLOCK-----```

radiant kraken
#

cc @lyric mountain @quartz kindle

quartz kindle
#

answers suggest using base64 key and pipe to base64 --decode then pipe to gpg

#

as well as separating the key decode/import into a separate step

mint quest
#

I am Blockchain Full Stack Developer. Who needs a developer?

deft wolf
#

I'm too lazy and don't want to program because of this temperature

radiant kraken
#

i tried removing the newlines and the -----BEGIN PGP PRIVATE KEY BLOCK----- and -----END PGP PRIVATE KEY BLOCK----- but to not avail

#

@quartz kindle wait i figured

radiant kraken
#

isn't --dearmor just... converting the base64 string in the private key to binary

#

and storing it in a .gpg file

quartz kindle
#

idk never used gpg exdee

radiant kraken
#

wtf Tim i thought you were <@&1230605757486202990>

#

😡

quartz kindle
#

get conned

sharp geyser
quartz kindle
#

im experienced in pretending to be experienced

radiant kraken
#

okay tim

#

do you know how to convert a base64 string to binary and store it to a binary file in linux

sharp geyser
#

o o I do

#

not

#

:c

sharp geyser
# quartz kindle im experienced in pretending to be experienced

https://www.youtube.com/watch?v=LfaMVlDaQ24 watch this entire video then come back to me

Learn the basics of computer science from Harvard University. This is CS50, an introduction to the intellectual enterprises of computer science and the art of programming. The course is taught live every year and this is the 2023 version.

💻 Slides, source code, and more at https://cs50.harvard.edu/x.

⭐️ Course Contents ⭐️
⌨️ (00:00:00) Lectur...

▶ Play video
#

it's only 25h long

#

you got this

#

:)

radiant kraken
#

can't wait to become a google engineer in 25 hours

radiant kraken
#

wtf man

sharp geyser
#

wtf tim

radiant kraken
sharp geyser
#

what do you know

quartz kindle
radiant kraken
#

i don't think so

neon leaf
radiant kraken
#

why don't you use gpg tim

#

gpg is awesome

quartz kindle
#

i dont care about security

#

exdee

radiant kraken
#

time to hack to tim's account

quartz kindle
radiant kraken
#

why tf is openssl here

#

😭

quartz kindle
#

built in b64 things

radiant kraken
#

linux already has a base64 command built-in, no?

quartz kindle
#

should have yeah

#

base64 -d <<< "base64string" > file.bin

#

i think

radiant kraken
#

i think echo $PRIVATE_KEY | base64 -d > shit.gpg works

quartz kindle
#

try echo -n

radiant kraken
#

what does that do

quartz kindle
sharp geyser
#

command.data is undefined

charred nest
#

whats up my swag devs im back here with the same issue from 2 weeks ago
we're having a recurring issue with our bot (in one server, not sharded) randomly hitting 100% CPU. when i manage to get into the server to check why, these are the only errors i see spawned from undici:

  • ConnectTimeoutError: Connect Timeout Error
  • SocketError: other side closed
  • Error: write EPIPE
  • RequestAbortedError [AbortError]: Request aborted
    d.js is v14.15 / latest stable
sharp geyser
charred nest
sharp geyser
#

at this point its better to ask in the djs server themselves

#

its a dep of djs

#

It's likely something they themselves are doing, or an internet connection turning shite

charred nest
#

i'll try again ChinoPog

sharp geyser
#

because it's saying basically discord is refusing the connection / closing it

charred nest
#

the cpu spike today was very short compared to how it was prior but still happening

#

inchresting

sharp geyser
#

I'd recommend asking in djs

charred nest
#

thank u for all ur help iara_pray

sharp geyser
#

No problem

#

sorry I couldn't actually help 😭

charred nest
#

its okay HAHAHA i cant figure it out for the life of me either

quartz kindle
#

if you have 100% cpu, the program is blocked/frozen, meaning network requests will eventually break/timeout

charred nest
quartz kindle
#

do you know more or less what the bot is doing then it freezes?

charred nest
#

when i get in and check to see whats causing it, those are the only errors though sighsleepfox outside of these spikes, it runs under 4%

#

so, i don't know when its doing right before/as it happens, but its made to handle threads & track our support team's messages in our support channel

#

here's an example; it autocreates threads for users when they send a message in the channel, deletes/reposts the sticky message we created

#

internally, it queries to our db (we use enmap) to indicate the user has a thread. when one of our volunteer team members reacts to it with a checkmark or sends a message in the thread, the db is updated to reflect that

quartz kindle
#

hmm

#

from what i remember, enmap is not very scalable

#

not saying its the problem, but would be worth doing some tests against it

#

for example benchmarking some of the queries

charred nest
#

tbh we thought it was enmap at first too, but after talking to alterion, we realized it mightve been the intense caching we were doing at the time. we've since removed that, but it's still spiking, just not as often

quartz kindle
#

did you try running some benchmarks against it?

#

ie: ```js
const t = performance.now();
// run enmap query
console.log(performance.now() - t);

charred nest
#

i'll try that now 2te_bunn_nod thank you so much

quartz kindle
#

you can also add some timing breakpoints to the bot's code paths

#

ie from event received until the end of the action, add some timer logs in key places

#

to see the timings of the code in general

sharp geyser
#

tim the king of benchmarking

lyric mountain
#

if so, the place where you supply your key isn't on the project's build file

sharp geyser
#

hello haku

lyric mountain
#

took me several days to figure it out

#

hi misty

sharp geyser
#

I apologize yesterday

#

I was wrong

lyric mountain
#

for what?

sharp geyser
#

surrealdb's way of doing that sql query is different

#

what I showed you was graph

lyric mountain
#

ah, so that's why it was verbose af

sharp geyser
#

ye

#

surrealdb has graph relations built in

#

its one of the ways of doing relations but not the only way

#

as far as how to do that query from yesterday without graphs no fucking clue

#

tis still a new db

#

so its syntax for manging it is still WIP

#

part of the reason you have to define each field for a table like that is because by nature tables are schemaless

#

they still haven't worked out their schemafull syntax for defining tables and its fields

#

The DB is only roughly 1 years old tbf

neon leaf
#

@lyric mountain I need help with a query

#

installation is a 2d array, in each object of that array I need to remove the "optional" key from the object

sharp geyser
#

just ask chatgpt

neon leaf
#

how tf do I do that

neon leaf
sharp geyser
#

gpt 4

neon leaf
#

I am using gpt-4o

#

its still stupid asf

#

trying to use pg 9 features

#

that were nuked

sharp geyser
#

im just trolling anyway

neon leaf
#

ok I solved it with this amazing solution update "minecraftServerBuilds" set "installation" = replace(installation::text, '"optional": false,', '')::jsonb[];

#

yes its cursed

quartz kindle
#

huehuehue

#

thats probably more performant than a non-cursed solution

neon leaf
#

oh damn

#

well I only needed it to run once anyway

sharp geyser
quartz kindle
#

most people dont realise this, but working with json as strings is way faster than using it as an object

#

its just much harder to do json things with raw string tools only

past field
quartz kindle
neon leaf
#

you know what I just realized tim

#

if my servers ever generated a colliding uuid as request id, it will infinitely spam my cluster servers every 5 second

#

and stack up

quartz kindle
#

lmao

sharp geyser
neon leaf
#

well

#

its a cuid2 to be fair

quartz kindle
#

isnt uuid collision chances really low tho

#

like one in billions

neon leaf
#

yes

#

uuidv4 atleast since its 100% random

#

but I use cuid2 because it look cooler

sharp geyser
#

oh god

#

sacrificing security for coolness /j

quartz kindle
#

lmao

#

why not use nanoID then

quartz kindle
#

@sharp geyser@neon leaf actually that sparked my interest a bit for researching id generators and apparently cuid2 is the most secure of them all

#

but the slowest

#

huehuehue

sharp geyser
#

honestly

#

uuid in dbs is a bad idea anyway imo

neon leaf
#

depends on where

sharp geyser
#

as unique ids at least

#

like

id uuid not null,
blah text not null
sharp geyser
#

let me see if I can find it

neon leaf
#

just use a random email as identifier

sharp geyser
#

It's entire purpose is explaining why UUID is a bad id, and it speaks some on why its bad in a database

neon leaf
#

ez

sharp geyser
quartz kindle
#

there are many reasons why it can be bad depending on the use case

sharp geyser
#

yuh

#

I just think as primary keys in a db uuid is bad

quartz kindle
#

inefficient due to alphabet choice and dashes, non sortable, etc

sharp geyser
#

it def has its uses outside of db

neon leaf
#

well anyone trying to sort any kind of uuid is not sane

quartz kindle
#

if you want something to use as primaky key you need a sortable id, like uuidv7 or ulid

sharp geyser
#

uuidv7 is sortable?

neon leaf
#

cuid too

#

just not cuid2

sharp geyser
#

it seems to me a uuidv7 has the same index

#

0190222f-1205-7d2f-9262-f6aad263e458 bolded remains the same, but everything after changes

quartz kindle
#

uuidv7 has a timestamp in the front, so its sortable by time

sharp geyser
#

0190222f is the timestamp?

#

are you sure?

quartz kindle
#

ye

sharp geyser
#

cuz it never changes

neon leaf
#

it does

quartz kindle
#

its not milisecond resoluition

sharp geyser
#

what is it then

#

because that front part stays the same no matter how many times I change it

#

only the stuff after the first - changes

neon leaf
#

are you sure you are using uuidv7

#

(a real implementation)

sharp geyser
#

im like 99% sure yes

#

maybe not a real impl no

#

ok now it changes

#

What kind of timestamp is it?

neon leaf
sharp geyser
#

Because I can generate quite a lot of uuids with the same front index

quartz kindle
#

LMAO

neon leaf
#

LOL

#

I DIDNT EVEN SEE THAT

sharp geyser
#

neither did i

sharp geyser
#

cant even understand that

#

💀

neon leaf
#

unix_ts_ms:
48 bit big-endian unsigned number of Unix epoch timestamp as per Section 6.1.
ver:
4 bit UUIDv7 version set as per Section 4
rand_a:
12 bits pseudo-random data to provide uniqueness as per Section 6.2 and Section 6.6.
var:
The 2 bit variant defined by Section 4.
rand_b:
The final 62 bits of pseudo-random data to provide uniqueness as per Section 6.2 and Section 6.6.

#
|                           unix_ts_ms                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          unix_ts_ms           |  ver  |       rand_a          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|var|                        rand_b                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            rand_b                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+```
quartz kindle
#

also

neon leaf
#

each row is a segment

quartz kindle
#

the timestamp spans the first two blocks

#

not only the first

sharp geyser
#

icic

#

interesting

solemn latch
#

👀 I'm really confused.

I thought webhooks in different channels had different ratelimit buckets.

#

But aparently thats not true

sharp geyser
#

you thought wrong champ (im kidding idrk)

solemn latch
#

I wonder if its tied to the IP

quartz kindle
#

so its per webhook_id not per webhook channel

solemn latch
#

What the hell

#

I'm not getting that at all

#

the 3d2712a9e4fe17cc9d3fed4a8e672e5f
is the bucket

#

the other is the webhook ID

quartz kindle
#

huh idk then

solemn latch
#

I'm just going to assign a webhook ID to a specific IP

#

Thank you hetzner for the IPV6 block

sharp geyser
#

😋

solemn latch
#

Not my IP nooo

sharp geyser
#

time to ddos

quartz kindle
#

so if i understand is that even if the bucket is the same, it shouldnt count if the top level path is different?

#

idk discord is confusing af sometimes

neon leaf
#

hey guys i ddosed the ip from woo now my pc is lag why guys ???

#

⁉️

quartz kindle
#

the woovirus

neon leaf
#

oh no

#

‼️

#

how do I fix this

#

⁉️

sharp geyser
quartz kindle
#

you need to rm -rf

#

its uncurable

sharp geyser
#

im on windows

neon leaf
#

you mean rm -fr /* ?

#

to remove french language?

quartz kindle
#

yes

neon leaf
#

a ok

sharp geyser
#

I think its

neon leaf
#

I will run

sharp geyser
#

``rm -fr /world`

#

remove the french!

#

||legal reasons this is a joke||

neon leaf
sharp geyser
#

💀

quartz kindle
sharp geyser
#

ill watch it later

green kestrel
#

ive almost finished stripping out ALL cache from triviabot

#

its gonna be a big update

#

it'll cut the total memory use down for 18 clusters from 7gb to 1.4gb

#

78mb per cluster

sharp geyser
#

why aren't you caching

green kestrel
#

dont need to

sharp geyser
#

fair

#

how many servers is trivia bot in again

green kestrel
#

the only thing im caching rn was guilds, channels and roles, and ive eliminated the need to cache all 3

sharp geyser
#

18 clusters is crazy

green kestrel
#

channels and roles were needed for dashboard and put straight into the db, so now i feth them on the dashboard when the user visits a guilds settings page

#

208,000 servers

#

a cluster is 8 shards

sharp geyser
green kestrel
#

basically a lightweight process

#

one instance of dpp::cluster

sharp geyser
#

208k guilds using 7gb of ram on D++? I thought D++ was more memory efficient /j

#

so disappointed

green kestrel
#

lol

sharp geyser
#

😔

#

granted that same amount of guilds on a djs bot is like 16gb+

green kestrel
#

role cache sure adds bloat

#

people add ridiculous amounts of roles

#

colour roles and stuff

sharp geyser
#

im sure caching guilds adds a lot of bloat as well

green kestrel
#

a fair bit yeah

#

guilds are a quite large struct, roles are not

sharp geyser
#

ye

green kestrel
#

its the majority of 7gb

solemn latch
green kestrel
#

i dont wanna think how big thatd be in js or even worse, in py

sharp geyser
#

but the sheer amount of roles people add im sure outweighs guild cache

solemn latch
#

You're right, they're the same bucket, different ratelimits

green kestrel
#

i didnt even realise, when testing it on my server, my server has 68 roles

sharp geyser
green kestrel
#

and i dont just add tons of silly ones

sharp geyser
#

it was like 24+ on his vps

solemn latch
#

Both logged 4

green kestrel
sharp geyser
#

yea no

#

you'd have to shard at that point

#

which djs splits it into separate processes iirc

green kestrel
#

but shard doesnt mean new process... does it???

sharp geyser
#

I think djs does

#

or wait no

solemn latch
#

It depends

sharp geyser
#

they do it all in the same process just spawn new ws connections

#

At least if you are using djs sharding manager

quartz kindle
#

i remember a bot i helped on

#

150k guilds

#

using around 55gb ram

green kestrel
#

jesus H

sharp geyser
#

did they fetchAllMembers

green kestrel
#

thats crazy

quartz kindle
#

nah

#

just used normal djs sharding

#

150 processes

green kestrel
#

can you even disable caching on js

sharp geyser
sharp geyser
quartz kindle
sharp geyser
#

unless they changed it recently

green kestrel
#

iirc it even caches message history to a degree?

sharp geyser
#

but a lot of it is required

green kestrel
#

why required?

quartz kindle
#

yoi can disable more with some hacks

sharp geyser
#

djs uses cache in almost every part of its lib

sharp geyser
#

they only let you disable some of it yourself

green kestrel
#

heres my new settings for a cluster on trivia

#
/* Set cache policy for D++ library
 * --------------------------------
 * User caching:     none
 * Emoji caching:    none
 * Role caching:     none
 * Channel caching:  none
 * Guild caching:    none
 */
dpp::cache_policy_t cp = { dpp::cp_none, dpp::cp_none, dpp::cp_none, dpp::cp_none, dpp::cp_none };
const bool compressed = false;

/* Construct cluster */
dpp::cluster bot(token, intents, dev ? 1 : from_string<uint32_t>(Bot::GetConfig("shardcount"), std::dec), clusterid, maxclusters, compressed, cp);
sharp geyser
#

I was going to use D++ for my bot

green kestrel
#

i turned off compression too

sharp geyser
#

but I cou;dn't figure out how to get a sync lib to not block async event loop

green kestrel
#

because sure it saves a ton of bandwidth, but im not exactly anywhere near my bandwidth limits

#

compression adds a ton of cpu usage at scale

#

ofc, without role cache or guild cache, you cant check permissions without an api call, but triviabot doesnt check permissions like that, youre either an owner, or a role id in the guilds triv mods list

sharp geyser
#

wait brain

#

you built your own http wrapper into d++ right?

green kestrel
#

yup

sharp geyser
green kestrel
#

websockets and http and everything

sharp geyser
#

that means I don't need to worry about blocking calls right?

green kestrel
#

correct, if you use them for http

sharp geyser
#

neat

green kestrel
#

bot.request(url, ...)

#

or, co_request

#

coroutine version

sharp geyser
#

that means this new db I am using I can just make all the calls over http

#

:D

quartz kindle
#

not ws compressiom

green kestrel
#

but it just didnt scale well, the backend didnt answer requests fast enough

sharp geyser
#

Well the db I am using doesn't have a C++ SDK yet, so I have to use the api instead

green kestrel
#

and i didnt want to change the legacy code to something else

sharp geyser
#

tho

#

I can also just connect via a websocket

#

it supports that as well

quartz kindle
#

no

#

per-packet compression

#

a setting you enable on identify

green kestrel
#

hmm

#

they dont support this any more iirc

quartz kindle
#

no?

green kestrel
#

it works, but is officially deprecated

#

wouldnt use it

quartz kindle
#

huh i didnt know that

#

welp rip

green kestrel
#

dpp doesnt even support it

#

whole-stream ws compression, or none

quartz kindle
#

ye

sharp geyser
#

what is the question

quartz kindle
#

?????

green kestrel
quartz kindle
green kestrel
#

i use it, its a shit ton faster in C++

#

parsing json is tons slower than etf

sharp geyser
#

That isn't a question

#

That is you telling us what you are doing

quartz kindle
#

its definitely faster than json yes

#

but still a terrible format

green kestrel
#

but when it comes to js, it has to still build a V8 object type to put it into, that is never going to be faster than json

quartz kindle
#

messagepack would be way better

green kestrel
#

which does the same thing

sharp geyser
#

😏

quartz kindle
#

i made the fastest etf lib for js

sharp geyser
#

ofc you did

quartz kindle
#

with it, etf is on par with json in js

green kestrel
#

dpp started with discord's one, and then tidied up and improved, made it more C++ish

#

got rid of the type punning etc

sharp geyser
#

What are you confused about. What you did was make a statement, not pose a question.

quartz kindle
#

the discord one is terrible

green kestrel
#

very

#

it took a lot of tidying

#

but a lot of the performance issues of the discord one, are what it does in v8, which i completely threw away

#

the dpp one builds nlohmann containers

quartz kindle
#

my etf lib is pure js and its 10x faster than the discord one whicj is cpp binginds

sharp geyser
#

Okay, then send a dm to the user?

#

You have all the information you need to do so

#

the top.gg api responds with the user id of the person who voted

#

use that to grab the user, send the ma dm

#

simple

#

Yes you do

#

top.gg api gives you the user ID of the person who voted. Use that to send a dm to the user

#

then do so?

#

Its the same response

#

top.gg api gives you the user id of the person voted through the webhook. So use that to send a dm to the user, and add the currency to the user

#

I just told you how to do it.....

#

Literally the message you responded to?

quartz kindle
sharp geyser
#

Im not sure how to help someone with a language barrier

neon leaf
#

has anyone here ever worked with https://www.npmjs.com/package/cli-progress

sharp geyser
neon leaf
#

if so how tf do I pad variables

sharp geyser
#

its up to them to implement what I give them themselves

sharp geyser
quartz kindle
sharp geyser
#

if im understanding you correctly that is

quartz kindle
#

like align the progress bar?

neon leaf
#

make the 2 variables on the left have same column width

sharp geyser
#

you want it to all align properly?

neon leaf
#

and make the bar fill the rest

sharp geyser
#

use multiBar

sharp geyser
#

This might help

neon leaf
#

thats what I am using

#

,

quartz kindle
#

how do you log those two? you log them yourself or you pass them to the lib?

sharp geyser
#

not sure, but it does auto align

neon leaf
sharp geyser
#

I told you how?!?!?!

#

the top.gg webhook api gives you everything you need.

quartz kindle
neon leaf
#

I tried

#

padend didnt change anything

#

it probably trims the vars

sharp geyser
#

When someone votes, top.gg will post to the webhook you specify, and it gives the user id of the person who voted. Use that to send a dm to the user by fetching the user from cache or the discord api. Then use that same user id when adding the currency to the user (assuming you index your databased based off user id)

sharp geyser
neon leaf
#

not a bad idea tbh

quartz kindle
#

braile blank character

neon leaf
#

what the fuck

#

I tried padding with ,

#

and it also didnt work

#

it just removed the padding after the bars started to move

#

oh wait

#

im stupid

#

ok so

#

I forgot to pad the vars when updating LOL

sharp geyser
#

🍞

quartz kindle
#

stewpid

sharp geyser
#

time to shame you until the end of time

neon leaf
#

yes

#

well it works

#

who wouldve thought

sharp geyser
#

what

neon leaf
sharp geyser
#

wait

#

are you making a mc installation tool

neon leaf
#

I am updating it

sharp geyser
#

ok

#

lame

neon leaf
#

ok

sharp geyser
#

who plays mc anymore

#

im kidding im still an avid mc player

#

kinda cool tho

#

wish I had that when I was running mc servers

quartz kindle
#

its very hard to understand what you say, if you are using a translator, it is very bad

#

what library and language are you using? discord.js?

sharp geyser
#

im glad you agree

#

💀

quartz kindle
#

install it and use the vote webhook

deft wolf
#

The problem is that he can't even do it until his bot is accepted I guess kappalul

quartz kindle
#

oh lel

#

@earnest phoenix your bot needs aprove first, you cannot use votes without approve

shut trout
#

Guess he didn't see

neon leaf
shut trout
deft wolf
sharp geyser
#

right so for some reason, this if statement still runs (this is bash)

#

the alias it is looking for definitely exists because the docker output tells me as such

#

oh I see now

#

its because grep isn't a valid command inside docker container ig

radiant kraken
#

i tried the normal one and it didn't work lmao which is why i tried mavenPublishing

#

also i don't use any IDEs to write this java project 😭

sharp geyser
#

bro is docker smoked, why is it taking so long

radiant kraken
#

i use notepad++

#

lmfao

sharp geyser
#

ok nvm

#

forgor I set a timeout during the health check

lyric mountain
#

please download intellij community

sharp geyser
#

null cant

lyric mountain
#

skill issue

sharp geyser
#

her laptop is not good enough

sharp geyser
#

💀

sharp geyser
#

yuh

radiant kraken
#

i don't think i'm using ossrh

#
publishing {
  publications {
    mavenJava(MavenPublication) {
      groupId 'io.github.null8626'
      artifactId 'projectname'
      version '3.0.0'
      
      from components.java
      
      pom {
        name = 'projectname'
        description 'projectdesc'
        url = 'https://github.com/null8626/projectname'
        inceptionYear = '2021'
        
        licenses {
          license {
            name = 'MIT License'
            url = 'https://github.com/null8626/projectname/blob/v3.0.0/LICENSE'
          }
        }
        
        developers {
          developer {
            id = 'null8626'
            name = 'null8626'
          }
        }
      }
    }
  }
}
``` this doesn't work (gives the same error)
#

what does it do?

#

gradle publish worked for me btw

green kestrel
#

it is done! i saved 85.7% of my ram usage

#

its now 18 clusters each of approximately 70mb

#

basically same size as seven spells

pearl trail
surreal sage
#

chat should i buy a 2nd hand 48u server rack for 40 bucks

#

even if i have no space for it

lament rock
#

could resell it so maybe?

green kestrel
#

that is then divided up on the stats to get kbps

#

then i can get the total for all 18 clusters using SQL SUM() on it

green kestrel
#

thats about the going rate for them 2nd hand

#

businesses pay a fortune for them new, and then cheap 2nd hand because its cheaper than disposing of it or taking it with you to new office

#

just check the depth

#

theres full depth that'll hold a server

#

and half depth that'll only hold like a network switch

surreal sage
#

its 200x100x60 hxdxw cm

#

just need to know where i can put it lmao

green kestrel
#

yeah its full size

#

theyre deceptively tall

#

thats 2m high

#

it'll be as big as any room in your house, a few inches clearance from the roof

#

only thing is

#

once you got one, you need to get equipment to go in it

#

and when you buy a rack mount server, you usually dont get the rack rail kit with it

#

theyre extra

#

also, you need rack cooling

#

you cant just throw servers in it and hope they dont overheat, you need rack fans at the least, if you dont have aircon in the room running 24/7

#

ugh what, amazon is unsafe content?

surreal sage
#

rail kits are optional

green kestrel
#

lol

#

no

#

not for rack mounting

#

if you want to put it in the cabinet, they arent optional at all

surreal sage
#

oh that

#

already on it

#

them m6 nut hole rails

radiant kraken
surreal sage
#

and i might only use 12-18u of it

#

this just looks attractive as it's an old minkels rack (aka quality) for real cheap

pearl trail
green kestrel
#

yw 🙂

lyric mountain
#

ik u can connect to a remote server running intellij in server mode to offload the processing

#

tho idk how heavy fleet is

pale vessel
#

about a ton

lyric mountain
#

well nvm then

pale vessel
#

i really don't think his current laptop could handle it

radiant kraken
#

i doubt

#

tbh

#

my laptop can barely handle vscode lmao

#

@lyric mountain what are your thoughts on jreleaser

lyric mountain
#

never met her in my life

#

no idea what it is

quartz kindle
#

or you wanna record them yourself for stats over time

neon leaf
#

I think im addicted to writing complex ts types

frosty gale
neon leaf
#

same thing

#

wonder whats the longest utility type ive ever written

#

probably openapi3 to ts type

#

idk where it i though

green kestrel
#

just the parts that relate to discord

#

or it will be recording the database connections, internal api requests and stuff

radiant kraken
#

@lyric mountain @covert gale do you guys know what might have caused this?

plugins {
  id 'java-library'
  id 'maven-publish'
  id 'org.jreleaser' version '1.12.0'
}

// ...

repositories {
  // ...
}

jar {
  // ...
}

publishing {
  // ...
}

javadoc {
  // ...
}

java {
  // ...
}

test {
  useJUnitPlatform()
  
  // ...
  systemProperty 'java.library.path', '${System.getProperty('java.library.path')}${File.pathSeparatorChar}$rootDir/bin'
  // ^^^ Could not get unknown property 'java' for task ':test' of type org.gradle.api.tasks.testing.Test.
}

dependencies {
  // ...
}
#

i am new to gradle dont kill me 😭

#

what elephant

#

i am CRYING

#

i have been fighting with gradle for 2 days straight

#

gradle is harder than C 😭

#

i did and it still doesn't work 😭

#

not even commenting out```gradle
java {
withJavadocJar()
withSourcesJar()
}

radiant kraken
#

i did

lyric mountain
#

id "java"

#
plugins {
    id "java"
}
radiant kraken
#

i did

#

doesnt work

lyric mountain
#

what's ur updated build.gradle?

radiant kraken
#

here's the entire thing

lyric mountain
#

hm

#

systemProperty gets a -D value with that name

radiant kraken
#

mhm

lyric mountain
#

it's basically System.getProperty() in java

#

so u need to define that prop

radiant kraken
#

how then

radiant kraken
#

how would i append directories to the java.library.path then topggSob

warm imp
#

How to fix?

#
                         ^

Error: ENOTDIR: not a directory, scandir 'D:\Invite Manager\commands\ping.js'
    at Object.readdirSync (node:fs:1509:26)
    at Object.<anonymous> (D:\Invite Manager\index.js:25:26)
    at Module._compile (node:internal/modules/cjs/loader:1434:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
    at Module.load (node:internal/modules/cjs/loader:1249:32)
    at Module._load (node:internal/modules/cjs/loader:1065:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:12)
    at node:internal/main/run_main_module:30:49 {
  errno: -4052,
  code: 'ENOTDIR',
  syscall: 'scandir',
  path: 'D:\\Invite Manager\\commands\\ping.js'
}```
surreal sage
#

should i be worried

#
  • i had to contact support smhhh
green kestrel
#

how do you analyse the reason for a user kicking the bot
it would be nice if discord provided us with reporting and metrics on this and asked the users for a reason for the kick, after they kick a bot, so we can see aggregate data
but they probably wont do that
so how do you improve?

radiant kraken
#

@lyric mountain @covert gale I GOT IT

#

THE ERROR WAS BECAUSE I USED SINGLE QUOTES INSTEAD OF DOUBLE QUOTES

#

😭

lyric mountain
#

Yeah groovy ' and " are different in that the former doesn't parse $interpolation

#

It's meant for plain strings

radiant kraken
#

3 hours of debugging all just for that 😭

lyric mountain
#

Doesn't np++ highlight interpolations?

#

Or does it not differ between string literal and regular?

neon leaf
#

@quartz kindle it happened

#

it wasnt a colliding cuid2 but code exploded

#

it has like 1000 requests queued up now

quartz kindle
neon leaf
#

I updated my validator middleware and forgot to update the route responsible for inserting requests into the database

#

atleast no users noticed

quartz kindle
#

ripperinos

quartz kindle
#

usually that happens when you use readdir with a wrong path

quartz kindle
#

show your code

warm imp
#
const { token } = require('./index.js');
const fs = require('node:fs');
const path = require('node:path');

const commands = [];
// Grab all the command folders from the commands directory you created earlier
const foldersPath = path.join(__dirname, 'commands');
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
    // Grab all the command files from the commands directory you created earlier
    const commandsPath = path.join(foldersPath, folder);
    const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
    // Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
    for (const file of commandFiles) {
        const filePath = path.join(commandsPath, file);
        const command = require(filePath);
        if ('data' in command && 'execute' in command) {
            commands.push(command.data.toJSON());
        } else {
            console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
        }
    }
}

// Construct and prepare an instance of the REST module
const rest = new REST().setToken(token);

// and deploy your commands!
(async () => {
    try {
        console.log(`Started refreshing ${commands.length} application (/) commands.`);

        // The put method is used to fully refresh all commands in the guild with the current set
        const data = await rest.put(
            Routes.applicationGuildCommands(clientId, guildId),
            { body: commands },
        );

        console.log(`Successfully reloaded ${data.length} application (/) commands.`);
    } catch (error) {
        // And of course, make sure you catch and log any errors!
        console.error(error);
    }
})();```
deft wolf
#

It appears that your code is trying to read the folders inside the commands folder, but from what you write it appears that there are only command files in this folder

#

Can you try to create a folder inside this commands folder and put your ping.js file there?

#

Even the comment explains what this piece of code does

// Grab all the command folders from the commands directory you created earlier

warm imp
#

It is commands then a subfolder called ping.js

quartz kindle
deft wolf
#

Yea, make a proper folder and call it whatever you want

warm imp
quartz kindle
#

whatever you want

deft wolf
#

They don't have to, it only serves you so that you can "segregate" your commands

warm imp
#

Ok i made a folder called etc

quartz kindle
#

the code above is made to work with something that is organized like this:

commands
  misc
    ping.js
    etc.js
  games
    game1.js
    game2.js
  chat
    chat.js
    fun.js
``` (example)
warm imp
#

Oh alr

quartz kindle
#

if you want to organize it differently then you need to change the code

#

for example if you want to organize like this ```
commands
ping.js
etc.js
game1.js

#

then the code needs to be changed to account for it

warm imp
#

It worked i got a command now

#

await interaction.reply('Ping: ${Math.round(client.ws.ping)}ms!'); But how do i get that to say the real ping and not what that says

radiant kraken
#

it doesn't even highlight anything in a .gradle file

#

it's like using notepad

quartz kindle
#

only the third way supports templating with ${}

#
"abc ${1}"
'abc ${1}'
`abc ${1}`
#

notice the difference in colors

radiant kraken
#

they all look the same in discord mobile :^)

quartz kindle
#

discord mobile sucks

#

@_@

warm imp
#

Yeah

#

await interaction.reply(Ping: ${Math.round(client.ws.ping)}ms!);

#

So it should look like that?

quartz kindle
#

yes

warm imp
#

I am getting this when i try to do a command

#

The application did not respond

lyric mountain
deft wolf
#

Well, either you didn't manage to respond in time or you have some error in your code

lyric mountain
#

if so, you can force groovy on it

warm imp
#

Right when i put it back to " it fixed it

deft wolf
#

Try using interaction.client.ws.ping instead

#

Probably your code doesn't have access to the client so it has to be taken from the interaction

warm imp
#

I think its because it is taking to long to work

warm imp
#

Because it isnt coming back with any errors

radiant kraken
lyric mountain
#

a

deft wolf
#

So you need to defer your interaction with .deferReply() and instead of .reply() use .editReply()

warm imp
#

Also didnt work

deft wolf
#

Interactions must receive a response within 3 seconds, otherwise their token is invalidated and the interaction will not work. If you are unable to reply within 3 seconds, you use .deferReply() which gives you up to 15 minutes to edit the deferred reply

warm imp
#

here

#

await interaction.reply(Ping: ${Math.round(client.ws.ping)}ms!);

deft wolf
#

Before this line

#

interaction.deferReply()

warm imp
#

module.exports = {
    data: new SlashCommandBuilder()
        .setName('ping')
        .setDescription('Replies With Bot Latency!'),
    async execute(interaction, client) {
        try {
            await interaction.deferReply(); // Defer reply to buy time
            await interaction.editReply(`Ping: ${Math.round(client.ws.ping)}ms!`);
        } catch (error) {
            console.error(error);
            await interaction.editReply('There was an error trying to execute that command!');
        }
    },
};```
deft wolf
#

Should work

warm imp
#

It dont

#

TypeError: Cannot read properties of undefined (reading 'ws')
at Object.execute (D:\Invite Manager\commands\etc\ping.js1059)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Client.<anonymous> (D:\Invite Manager\index.js:48:3)

deft wolf
#

Oh, so your client is probably not what a client should be

#

Can you change it real quick to interaction.client?

warm imp
#

Sure

#

fixed it now what?

earnest phoenix
#

so i'm trying to make a server which when someone joins creates a new channel just for that single person, the person joining only seeing that single channel
it's supposed to let me verify that person before gaining access to the entire server, how would i start?

warm imp
#

I went into my index.js and it said const command = interaction.client.commands.get(interaction.commandName);

#

Thats why it didnt work lol

#

Ty i didnt understand that

quartz kindle
#

deferring is definitely not needed there

slender wagon
#

Has any of yall worked with discordeno

quartz kindle
#

client.ws.ping is not an async call, it does not take any time to run

warm imp
#
    at Object.execute (D:\Invite Manager\commands\etc\bot-info.js:16:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Client.<anonymous> (D:\Invite Manager\index.js:48:3)``` Let me know if you need the code for the command
#

I am making a botinfo command

deft wolf
#

Certainly, without it we will not be able to find the source of the problem

quartz kindle
warm imp
#

Oh

quartz kindle
warm imp
#

How do i use the right one?

quartz kindle
#

show the code

warm imp
quartz kindle
#

the botinfo

warm imp
#

module.exports = {
    data: new SlashCommandBuilder()
        .setName('bot-info')
        .setDescription('Replies with bot information'),
    async execute(interaction, client) {
        try {
            await interaction.deferReply(); // Defer reply to buy time

            const uptime = process.uptime();
            const uptimeHours = Math.floor(uptime / 3600);
            const uptimeMinutes = Math.floor((uptime % 3600) / 60);
            const uptimeSeconds = Math.floor(uptime % 60);

            const totalGuilds = client.guilds.cache.size;
            const totalUsers = client.users.cache.size;

            const embed = new EmbedBuilder()
                .setColor(0x0099ff)
                .setTitle('Bot Information')
                .addFields(
                    { name: 'Uptime', value: `${uptimeHours}h ${uptimeMinutes}m ${uptimeSeconds}s`, inline: true },
                    { name: 'Servers', value: `${totalGuilds}`, inline: true },
                    { name: 'Users', value: `${totalUsers}`, inline: true },
                )
                .setTimestamp()
                .setFooter({ text: 'Bot Info', iconURL: client.user.displayAvatarURL() });

            await interaction.editReply({ embeds: [embed] });
        } catch (error) {
            console.error('Error executing botinfo command:', error);
            if (interaction.deferred) {
                await interaction.editReply({ content: 'There was an error while executing this command!' });
            } else {
                await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
            }
        }
    },
};```
quartz kindle
#

you see where you have async execute(interaction, client) {

warm imp
#

Yeah

quartz kindle
#

that means the client needs to be given from the index.js file, in the line where you use command.execute()

#

but regardless, you dont need that at all, because all interactions have a valid client inside them

#

so you can just do interaction.client

#

and remove the unneeded client

warm imp
#

and replace this

#

async execute(interaction, client)

quartz kindle
#

show your index.js real quick

warm imp
#
const path = require('node:path');
// My Intents
const { Client, Collection, Events, GatewayIntentBits } = require("discord.js");
const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
  ]
});
// Bot Turn On Message Don't Touch
client.on('ready', () => {
  console.log(`Yay! Logged in as ${client.user.tag}!`);
});

client.commands = new Collection();

const foldersPath = path.join(__dirname, 'commands');
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
    const commandsPath = path.join(foldersPath, folder);
    const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
    for (const file of commandFiles) {
        const filePath = path.join(commandsPath, file);
        const command = require(filePath);
        // Set a new item in the Collection with the key as the command name and the value as the exported module
        if ('data' in command && 'execute' in command) {
            client.commands.set(command.data.name, command);
        } else {
            console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
        }
    }
}

client.on(Events.InteractionCreate, async interaction => {
    if (!interaction.isChatInputCommand()) return;

    const command = interaction.client.commands.get(interaction.commandName);

    if (!command) {
        console.error(`No command matching ${interaction.commandName} was found.`);
        return;
    }

    try {
        await command.execute(interaction);
    } catch (error) {
        console.error(error);
        if (interaction.replied || interaction.deferred) {
            await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
        } else {
            await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
        }
    }
});

client.on('messageCreate', async message => {
  if (message.content === '!ping') {  
    message.channel.send(`Ping: ${Math.round(interaction.client.ws.ping)}ms`);
  }
});

// Bot TOKEN Don't Touch Unless Reset
client.login("TOKEN");```
quartz kindle
#

so check this

#
// index.js
await command.execute(interaction); // <-- this is the caller, the caller sends "interaction"

// botinfo.js
async execute(interaction, client) {...} // <-- this is the receiver, the receiver expects "interaction" and "client"
#

the caller does not send anything in the second parameter, so the client in the receiver is invalid

#

you can just remove the client from the receiver

warm imp
#

The receiver meaning?

quartz kindle
warm imp
#

kk

#

I get errors when i do

quartz kindle
#

what did you do?

warm imp
quartz kindle
#

which part of it did you remove?

warm imp
#

async execute(interaction, client) {

quartz kindle
#

you removed all of it?

warm imp
#

I think so

quartz kindle
#

🤦‍♂️

#

you can just remove the client from the receiver

warm imp
#

I deleted the corresponding } from the line of code

warm imp
#

Ok i removed it without errors 🙂

quartz kindle
#

ok now show your botinfo.js

warm imp
#

module.exports = {
    data: new Discord.SlashCommandBuilder()
        .setName('bot-info')
        .setDescription('Replies with bot information'),
    async execute(interaction, client) {
        try {
            await interaction.deferReply(); // Defer reply to buy time

            const uptime = process.uptime();
            const uptimeHours = Math.floor(uptime / 3600);
            const uptimeMinutes = Math.floor((uptime % 3600) / 60);
            const uptimeSeconds = Math.floor(uptime % 60);

            const totalGuilds = client.guilds.cache.size;
            const totalUsers = client.users.cache.size;

            const embed = new Discord.EmbedBuilder()
                .setColor(0x0099ff)
                .setTitle('Bot Information')
                .addFields(
                    { name: 'Uptime', value: `${uptimeHours}h ${uptimeMinutes}m ${uptimeSeconds}s`, inline: true },
                    { name: 'Servers', value: `${totalGuilds}`, inline: true },
                    { name: 'Users', value: `${totalUsers}`, inline: true },
                )
                .setTimestamp()
                .setFooter({ text: 'Bot Info', iconURL: client.user.displayAvatarURL() });

            await interaction.editReply({ embeds: [embed] });
        } catch (error) {
            console.error('Error executing bot-info command:', error);
            if (interaction.deferred) {
                await interaction.editReply({ content: 'There was an error while executing this command!' });
            } else {
                await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
            }
        }
    },
};```
quartz kindle
#

?

#

you didnt remove anything

#

what did you remove?

warm imp
#

Idk how to remove it without getting errros

quartz kindle
#

what are you removing?

warm imp
#

async execute(interaction, client) {

#

I removed the client but i cant remove the whole line of code

normal badge
quartz kindle
#

like how it was before, and how it is after you changed it

warm imp
#

module.exports = {
    data: new Discord.SlashCommandBuilder()
        .setName('bot-info')
        .setDescription('Replies with bot information'),
        try {
            await interaction.deferReply(); // Defer reply to buy time

            const uptime = process.uptime();
            const uptimeHours = Math.floor(uptime / 3600);
            const uptimeMinutes = Math.floor((uptime % 3600) / 60);
            const uptimeSeconds = Math.floor(uptime % 60);

            const totalGuilds = client.guilds.cache.size;
            const totalUsers = client.users.cache.size;

            const embed = new Discord.EmbedBuilder()
                .setColor(0x0099ff)
                .setTitle('Bot Information')
                .addFields(
                    { name: 'Uptime', value: `${uptimeHours}h ${uptimeMinutes}m ${uptimeSeconds}s`, inline: true },
                    { name: 'Servers', value: `${totalGuilds}`, inline: true },
                    { name: 'Users', value: `${totalUsers}`, inline: true },
                )
                .setTimestamp()
                .setFooter({ text: 'Bot Info', iconURL: client.user.displayAvatarURL() });

            await interaction.editReply({ embeds: [embed] });
        } catch (error) {
            console.error('Error executing bot-info command:', error);
            if (interaction.deferred) {
                await interaction.editReply({ content: 'There was an error while executing this command!' });
            } else {
                await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
            }
        }
    },```
#

Thats after

quartz kindle
#

🤦‍♂️

normal badge
#

uh.

#

why are u removing it (the execute)

quartz kindle
warm imp
#

Ohhhh

#

I am dumb

#

lol

#

I fixed it now lol sorry about that one

normal badge
quartz kindle
#

you should go learn how functions work

#

anyway, there is still something else you need to change now

#

now that you removed client

#

these two lines are still looking for a client that doesnt exist anymore

#

so you need to change them to use the client that exists inside interaction

normal badge
#

wouldn’t he use interaction.client now Happy

quartz kindle
#

exactly

normal badge
#

I cannot stand that

quartz kindle
#

:^)

warm imp
#

completed

quartz kindle
#

good

normal badge
#

I vowed to myself not to use interaction

#

cuz it looks weird TO ME

warm imp
#

is it bad to me if i get

#

Error executing bot-info command: ReferenceError: client is not defined
at Object.execute (D:\Invite Manager\commands\etc\bot-info.js:28:45)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Client.<anonymous> (D:\Invite Manager\index.js:48:3)

normal badge
#

did you even

#

change the line of code

quartz kindle
#

about the client and the interaction

normal badge
warm imp
quartz kindle
#

show what you did

warm imp
#

const totalGuilds = interaction.client.guilds.cache.size;
const totalUsers = interaction.client.users.cache.size;

#

Thats the line now

#

Ill show the whole thing

quartz kindle
#

whats line 28?

normal badge
warm imp
#

.setFooter({ text: 'Bot Info', iconURL: client.user.displayAvatarURL() });

quartz kindle
#

need to change there as well

warm imp
#

Completed

quartz kindle
#

good

#

any other client?

normal badge
#

so now u should be okay

warm imp
#

it worked 🙂

quartz kindle
#

gj

warm imp
deft wolf
quartz kindle
#

now back to the deferring thing, you should not really be using defer for no reason

#

i mean, you can just keep it, but its not really correct

warm imp
#

Will it do anything to my code if i dont need it?

normal badge
#

no

quartz kindle
#

it makes the bot slightly slower

normal badge
#

it will run the same result

quartz kindle
#

because the bot essentially has to respond twice

normal badge
#

just quicker without deferring

quartz kindle
#

instead of once

warm imp
#

How would i know if i need it or not?

normal badge
#

if your bot is doing some fetching/awaiting on some code (api, functions, etc)

#

that’s what I use it for mostly

quartz kindle
#

^ ie does your command read a file from your pc? does your command access an api or website or database? or some function that is very slow (like AI)?

#

then you need it

#

otherwise no

normal badge
quartz kindle
#

:^)

normal badge
warm imp
#

I just removed it from my ping.js and it wont work

normal badge
quartz kindle
normal badge
warm imp
normal badge
warm imp
# normal badge did u change editReply to reply

module.exports = {
    data: new SlashCommandBuilder()
        .setName('ping')
        .setDescription('Replies With Bot Latency!'),
    async execute(interaction,) {
        try {
            await interaction.reply(`Ping: ${Math.round(interaction.client.ws.ping)}ms!`);
        } catch (error) {
            console.error(error);
            await interaction.reply('There was an error trying to execute that command!');
        }
    },
};```
quartz kindle
#

you can remove this comma lol interaction,

warm imp
normal badge
warm imp
normal badge
#

check ur interactionCreate event

normal badge
warm imp
normal badge
#

it’s BOTHERING me.

silver jackal
#

hello i just joined a server

normal badge
#

ok thanks Heart

warm imp
silver jackal
#

and owners bot is spamming pings

#

is this allowed

#

The server has 10k members

normal badge
silver jackal
normal badge
#

or a moderator, idk…

silver jackal
#

Is it possible to report whole server

#

for spamming

quartz kindle
#

its not from here

silver jackal
#

so is it possible to report the server to justice

normal badge
#

oh sorry

normal badge
#

is it even executing*

warm imp
# normal badge what about the execute
        await command.execute(interaction);
    } catch (error) {
        console.error(error);
        if (interaction.replied || interaction.deferred) {
            await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
        } else {
            await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
        }
    }
});```
quartz kindle
silver jackal
#

Can't

quartz kindle
#

why not?

silver jackal
#

a person from that server wants to give me nitro for my birthday in two days

#

and i can't get rid of constant pings

normal badge
#

ur not serious…

quartz kindle
#

thats an obvious scam

normal badge
neon leaf
#

reached 1gb 🔥

normal badge
#

@warm imp maybe try some debugging

#

and see if you’re receiving the command

silver jackal
#

wait my database is at 475kb?

warm imp
quartz kindle
normal badge
silver jackal
#

is 475kb alot for database

silver jackal
#

because i only have 15GB for database

quartz kindle
normal badge
warm imp
quartz kindle
warm imp