#development

1 messages · Page 1833 of 1

stray seal
#

vivid fulcrum
boreal iron
#

You gotta replace timestamp with a timestamp, lol

stray seal
#

<t:time:d>

#

<t:uh:d>

boreal iron
#

READ WHAT I WROTE

vivid fulcrum
#

click on the link

stray seal
#

<t:16:20:d>

#

lyric mountain
#

bruh

#

do you even timestamp?

stray seal
#

???

stray seal
lyric mountain
#

a time stamp is

#

a stamp of time

stray seal
#

<t:T:d>

boreal iron
#

Google what a UNIX timestamp is

vivid fulcrum
#

they're probably underage llol

boreal iron
#

haven't even noticed that

shy turret
#

If I were to change an open source project (mine specifically) from MIT to something else, would that force everyone to follow the new license, or am I not allowed to change it?

vivid fulcrum
#

well

#

you're allowed to change it

#

however

#

you can't retrospectively force users to update to the new license

#

if they have a version of the project with the older license, they're obliged to follow that one

#

in other words, the new license is only effective once the user pulls it

rose warren
#

This is fugly

#

Thanks djs 13

boreal iron
#

tbh I like the style even more, used it in v12 already

long crow
#

It is something to do with overload

boreal iron
#

I somehow prefer that style

rose warren
#

EZ FIX

const args = [interaction.options.get('guess', true).value, interaction.options.get('bet').value]
boreal iron
#

instead of calling the damn embedcreator method always

rose warren
#

Embed creator is better imo

boreal iron
#

well, the default format the API accepts won't change anyways

#

so it's just less code

rose warren
#

Yeah. MessageEmbed() didn't change in v13

#

So it's not an issue

#

Just if you want to attach files

boreal iron
#

doesn't bother me, as I'm creating my embed as obj anyways (manually)

rose warren
#

But most embeds are easy to transfer

boreal iron
#

hmm, never needed to send attachments yet tbh

rose warren
#

I have and it was always a pain in my use-case so I'm not looking forward to doing it again...

boreal iron
#

well yeah, makes sense then

lyric mountain
#

and I'm yet again asking discord to FUCKIN ALLOW SENDING EPHEMERALS DIRECTLY

#

who cares about interactions smh

#

direct ephemerals + files would be perfect for me

quartz kindle
#

how are you gonna send them without interactions tho

#

with no message.content

lyric mountain
#

idk, like normal messages but supply an user

boreal iron
#

it's good how it is tho

lyric mountain
#

or like user.sendMessage

boreal iron
#

use to send them as DM

#

so users have the choice to block them

quartz kindle
#

inb4 bot spams user with ephemerals and nobody can see

#

:^)

boreal iron
#

interacting with something means they have to expect a result

rose warren
#

Alright 2 slash commands down... 103 to go...

boreal iron
#

lmao

rose warren
#

ETA November 2053

quartz kindle
#

i cant even begin moving mine without attachments

rose warren
#

without attachments?

shrewd dragon
#

Hii

quartz kindle
#

yes

rose warren
#

wdym?

shrewd dragon
#

Top gg pls accept my bot

#

Pls

quartz kindle
#

my commands require attachments

#

slash commands dont support them

rose warren
#

Ah like user-submitted?

#

From the message?

quartz kindle
#

no, i need to send them

#

but as a file, not with a url

rose warren
#

Oh you can't send attachments?

cinder patio
#

You can send attachments via followup messages

quartz kindle
#

there is no files field

#

in the interaction response

rose warren
#

wut 👀

#

ah frick

#

one of my main features relies on sending attachments

quartz kindle
#

they said they are working on it

rose warren
#

well by the time i get there... KEKW

errant flax
#

how do i parse a custom emoji in discord?
like this emoji: danceydance
i want to get the id how would i do that?

crimson oracle
#

To get the ID of an Animated emoji, I use the Emoji bot

errant flax
#

wdym emoji link isee

dense flame
crimson oracle
#

it would be something like this: <a:emoji.name:emoji.id> i think

dense flame
#

yes, if its animated

errant flax
#

what i mean is i want to get the emojis in a message content like:
hehe iara_sunglasses_cool danceydance
and retrieve the emoji id
how would i do that??

dense flame
#

if not, then just remove the a

#

^

errant flax
#

im confused on what ur talking about

dense flame
#

The format is <a:emoji.name:emoji.id>

#

for animated emojis

waxen bough
#

@worthy ivy
try putting this before your callback function

/**
 * @param {import('discord.js').Message} message
 */
waxen bough
#

yeah

worthy ivy
#

how about for every discord method then

waxen bough
#

idk about that

dense flame
#

stomp for example this emoji would be <a:stomp:866113062494404698:>

long crow
heady lance
#

Hi everyone

hot sleet
#
Collection [Map] {
  '872835212990631996' => Message {
    channel: DMChannel {
      type: 'dm',
      deleted: false,
      id: '607478773906145292',
      recipient: [User],
      lastMessageID: '872835212990631996',
      lastPinTimestamp: null,
      messages: [MessageManager],
      _typing: Map {}
    },
    deleted: false,
    id: '872835212990631996',
    type: 'DEFAULT',
    system: false,
    content: 'w',```
#

how to get content

#

message.content isn't working

lyric mountain
#

that's a map btw

hot sleet
#

ik

#

i searched how to get data from map

lyric mountain
#

console.log what message is then

dense flame
#

try logging message

#

console.log(message)

hot sleet
#

i got that from console

lyric mountain
#

you logged the map not the message

hot sleet
dense flame
#

why is it logging the map then

hot sleet
#
Collection [Map] {
  '872835212990631996' => Message {
    channel: DMChannel {
      type: 'dm',
      deleted: false,
      id: '607478773906145292',
      recipient: [User],
      lastMessageID: '872835212990631996',
      lastPinTimestamp: null,
      messages: [MessageManager],
      _typing: Map {}
    },
    deleted: false,
    id: '872835212990631996',
    type: 'DEFAULT',
    system: false,
    content: 'w',
    author: User {
      id: '269132764576481282',
      system: null,
      locale: null,
      flags: [UserFlags],
      username: 'Zyad',
      bot: false,
      discriminator: '1273',
      avatar: '12900bbbc63c0852aaf14e8b6523167d',
      lastMessageID: '872835212990631996',
      lastMessageChannelID: '607478773906145292'
    },
    pinned: false,
    tts: false,
    nonce: '872835159643127808',
    embeds: [],
    attachments: Collection [Map] {},
    createdTimestamp: 1628170531271,
    editedTimestamp: 0,
    reactions: ReactionManager {
      cacheType: [Function: Collection],
      cache: Collection [Map] {},
      message: [Circular]
    },
    mentions: MessageMentions {
      everyone: false,
      users: Collection [Map] {},
      roles: Collection [Map] {},
      _members: null,
      _channels: null,
      crosspostedChannels: Collection [Map] {}
    },
    webhookID: null,
    application: null,
    activity: null,
    _edits: [],
    flags: MessageFlags { bitfield: 0 },
    reference: null
  }
}
#

full log

lyric mountain
#

you're acessing the map not the message

#

maps don't have "content"

#

for example

#

<map>.get(the id).content works

#

<map>.content don't

quartz kindle
#

its a collection, you have to chose 1 of the items inside the collection, using either .get(id) or .first() if your collection only has 1 item

lyric mountain
#

oh yeah, get

hot sleet
#

ok ty btw that message is map because i get the message with this => message.channel.awaitMessages(filter, {...

lyric mountain
#

awaitMessages

#

plural

quartz kindle
#

^

brave garnet
#

wtf?! someone know why i always get "file not found"?!

@bot.command()
async def wget(ctx, arg1):
    url = arg1
    r = requests.get(url, allow_redirects=True)
    if url.find('/'):
        with open(url.rsplit('/', 1)[1], "rb") as f:
            downloaded = discord.File(f)
            await ctx.send(file=downloaded)

👀

lyric mountain
#

'/'

#

try './'

#

/ is literally the root directory

brave garnet
#

not from files in server. from online. urls, requests, etc....

lyric mountain
#

ah, sure

brave garnet
#

there even is "url.split"...

lyric mountain
#

I don't think you can do that anyway

brave garnet
#

=[

lyric mountain
#

I mean, remote files are just a text page unless downloaded

brave garnet
#

ik

lyric mountain
#

and u aint downloading it before opening

brave garnet
#

anyways - i have a dumb idea

crimson oracle
lyric mountain
#

a wget cmd

#

like unix's

brave garnet
#

command for bot to "download" and send files online. yea, same. bot based on linux =p

crimson oracle
#

ooh

brave garnet
#

ye but for discord

lyric mountain
#

inb4, your bot won't last long before you remove most cmds

brave garnet
#

means? im gonna verify =p

lyric mountain
#

just watch me wget a huge file

#

thus killing your bot

#

because RAM

brave garnet
#

cmd is cmd. and hosted not at me but replit =p

lyric mountain
#

you're assigning the downloaded file to a variable

brave garnet
#

ye

lyric mountain
#

if I use that cmd to wget a huge file

#

your heap will cry

#

aka OOM error

hot sleet
#

another stupid question about that map

#

what should i add in the id
<map>.get(the id).content

lyric mountain
#

the id of the desired message

hot sleet
#
Collection [Map] {
  '872835212990631996' => Message {```
lyric mountain
#

maps are collections of key-values

hot sleet
#

i got undefined

lyric mountain
#

the id would be that big number

#

if you don't know the id, convert the map to a list and get by index

hot sleet
#

ik

brave garnet
lyric mountain
#

I can easily fake content-size header

brave garnet
#

nope. check for size remotely

hot sleet
#

i use let mId = message.id;

then let reason = message.get(mId).content;

lyric mountain
#

and make your request think it's a small file

brave garnet
#

how?

lyric mountain
#

you can't get the id of something that doesn't have an id yet

hot sleet
#

mId is real id because its from normal message not map

lyric mountain
#

but that means you can easily deceive the request by sending a fake content-size header

#

like

#

file is 1TB, I set the content-size to 1B

brave garnet
lyric mountain
#

no

brave garnet
#

yes

lyric mountain
#

to find the size you NEED to download the file

brave garnet
#

nope

lyric mountain
#

ok then, tell me how you'd do it

#

remember: if you READ the file you've already downloaded it

brave garnet
#

idk yet. now im a little unfocused and u know... tons to do

hot sleet
#

here
i logged mid
then awaited message
872839586743738398 Collection [Map] { '872839586743738398' => Message {...

lyric mountain
#

if you don't know why are you even arguing then?

#

I'm telling u, there's no way to be 100% sure about the remote file size

brave garnet
#

i was just asking for downloads. not other things. u started

hot sleet
#

wait

lyric mountain
#

1 malicious user is all it needs

brave garnet
#

anyways - im gonna find another development server

#

bye

lyric mountain
brave garnet
#

ik. and bye. im not a retard

lyric mountain
#

if you say so

brave garnet
#

bye

lyric mountain
#

@hot sleet you need to get the message before you try to access its properties

hot sleet
#

i got it

lyric mountain
#

as I said, if you know the id beforehand use it to get the entry

hot sleet
#

i found how to get the content

#

ty btw

lyric mountain
#

np

#

@quartz kindle wannabet the filesize thing will become an issue?

lyric mountain
#

making a wget cmd for a discord bot and downloading the file without checking the source

brave garnet
#

bruh. stop talkin bout this. ok?

lyric mountain
#

well, that's bcuz we know how it'll end

brave garnet
#

shut

quartz kindle
#

you can stream the file

#

idk how it works in python but pretty sure it supports file streams

#

so you can pipe the download stream into the discord upload stream

brave garnet
#

i also know and now shut. i try yet another method =p

waxen bough
#

is there a speed difference between stdio and socket files?

quartz kindle
#

discord still only allows 8mb if im not wrong

brave garnet
lyric mountain
lyric mountain
waxen bough
#

haha idk

#

it's just the same?

quartz kindle
#

On UNIX-like platforms, using stdin/stdout is a socket, so there's no difference

lyric mountain
#

if it is, pretty much nothing can beat directly accessing the file

#

ah

waxen bough
#

ohh

#

thanks for info

brave garnet
#

did you ended that alr?

lyric mountain
#

I know you didn't

crimson oracle
#

so, im trying to re create the Balance command used in dank memer, but when I try running the command, It works when i dont mention a user, but when i mention a user, this pops up

vast crown
#

id is not defined

#

check if you are passing member

slender thistle
#

member in your case is a string

charred wyvern
#

This site can’t be reached 127.0.0.1 refused to connect.
I get this error
When I try and connect to the localhost

slender thistle
#

You'll need to convert it to a Member, I assume. Use typehints for the member parameter, member: discord.Member = None

#

Also, could make a oneliner, member = member if member or ctx.author

earnest phoenix
#

dont tell me python throws errors for undefined object properties

slender thistle
#

It does

charred wyvern
#

from flask import Flask

app = Flask(name)

@app.route
def home():
return render_template(index.html)

if name == "main":
app.run(debug=True)

earnest phoenix
#

why

slender thistle
#

Because you're accessing what doesn't exist

lyric mountain
#

the actual question is "why javascript doesn't"

slender thistle
#

^

earnest phoenix
#

wouldn't that add extra error handling

lyric mountain
#

well, yeah

slender thistle
#

Vastly more convenient than having to figure out where and what is undefined

#

At least it makes sure your code is clean

lyric mountain
#

but also means the compiler knows EXACTLY what are the properties of the object beforehand

#

making it faster

#

and technically better to debug

earnest phoenix
#

considering i access undefined properties on every line of my code 😅

lyric mountain
slender thistle
#

Most of the time you won't get that issue if you write proper code and handle shit properly

solemn latch
#

imagine doing things properly

#

mmLol not me

quartz kindle
#

imagine being demoted

#

:^)

slender thistle
#

@clear marlin You gotta be fucking kidding me LMAO

#

0.7.0 druid::WindowDesc takes a Fn that returns a widget

#

0.8.0 just straight up demands a widget

earnest phoenix
#

this just seems... better

function (props) {
  if (!props.bruh) {
    return <bruh />;
  }

  return <bruh />;
};

than this

function props() {
  try {
    props.bruh;
    return <bruh />;
  } catch (_) {
    return <bruh />;
  }
};
slender thistle
#

Or just

#

Check for the object's type before accessing crap

#

aka make sure it is what you want it to be

lyric mountain
#

models

slender thistle
#

Models?

earnest phoenix
#

maybe i just love dynamic types

#

I heard ES2021 is adding optional typings?

crimson oracle
#

Ok so my problem is fixed.
thanks Shivaco and neuroframe! (didnt wanna ping outta nowhere)

slender thistle
#

It's fine if you have a reason

#

and you're welcome

lyric mountain
slender thistle
#

Isn't that what a class basically is?

earnest phoenix
#

classes can be extended with extra stuff

#

djs uses Base classes and adds other things on top of it

slender thistle
#
>>> x = 5
>>> type(5), isinstance(x, int)
(<class 'int'>, True)
#

That's all I can think of by reading that sentence

lyric mountain
#

classes that have the sole purpose of representing an object

slender thistle
#

Input for a Python command in the Python interpreter (REPL), essentially

lyric mountain
#

people who work in maintaining REPL

#

are they called REPL IT?

earnest phoenix
#

what is that comma on the second line supposed to do

slender thistle
#

Please get out

tired panther
#

Is there any host, which offers 4gb ram under 8$ and has a good uptime?

earnest phoenix
#

replit does (except the good uptime)

#

but they suck as hell

tired panther
lyric mountain
#

$6.99, full SSD, haven't had downtime yet (they tell if it's planned to happen), 8GB ram, 5vCPU

tired panther
lyric mountain
#

ye

#

I use the second plan

#

they used to have even cheaper plans, but they were semi-ssd

#

like, mixed with hdd

#

and were quite shitty

#

since last year they remodeled their entire infra and solved many issues regarding service

#

and the website now is less sketchy-lookin than before

clear marlin
tired panther
#

7$ for 8gb ram, thats fair

slender thistle
#

Tbf yeah

#

I'm the one to blame

crimson oracle
split hazel
#

though it's not guaranteed to be ram

solemn latch
solemn latch
earnest phoenix
clear marlin
hexed sedge
#

Hey! I made a txt command to autodeploy my slash commands, and this is the source code to it: https://pastebin.com/ReBgKKzL
When I try running it, discord returns this error: https://pastebin.com/3q2ku2ZH
I have narrowed down the file whichs options give an error, but I dont exactly see an error with it... This is the files options: https://pastebin.com/SHqSvzqW
Can someone help me with figuring out why this is happening? I have been trying to fix it for awhile now... This is all in JavaScript btw

signal estuary
#
DiscordAPIError: Invalid Form Body
embeds[0].fields[0].value: Must be 1024 or fewer in length.

How can I split the message in two parts. So the first part is 1020 characters long and I can avoid the error.

I mean instead of:

Here is a text which is longer || than 1024 character

"|" is the border where the message is longer than 1024 and I want to split it to this

Here is a text which is longer

So only the text till 1024 is shown

lyric mountain
slender thistle
tired panther
lyric mountain
quiet pawn
#

thats what i use atm

lyric mountain
#

use substring to split the string

slender thistle
#

Oop it seems like I will have to use threads after all. My main thread decided to just hang and my program stopped responding

quiet pawn
#

but im switching to a my own thing soon because im buying another pc to host stuff on

tired panther
split hazel
#

galaxy gate is more expensive but at least they offer real hardware

solemn latch
#

its much cheaper than do, as all the extra features cost money on DO.

tired panther
# quiet pawn ?

digital ocean offers 1gb ram for 5$, GalaxyGate does it for 3$

quiet pawn
#

its 10cad

#

so like

#

8 or 7 usd

split hazel
#

I'm on the $5 plan because it's just a test server open to the public lol

quiet pawn
#

there support is ass but service is good

earnest phoenix
#

whats a vcpu

split hazel
#

virtual cpu

quiet pawn
#

no idea

lyric mountain
#

same as cpu basically

split hazel
#

multiple vms are on a cpu

quiet pawn
#

my bot only uses 1% of it so i dont pay mind

split hazel
#

and they share those cpu cores all it means

earnest phoenix
tired panther
# earnest phoenix whats a vcpu

"A vCPU (virtual CPU) represents a portion or share of a physical CPU that is assigned to a virtual machine (VM). A vCPU is also known as a virtual processor. In many virtualization systems, hardware elements are partitioned off into different virtual machines that can provide the same functionality as traditional physical computer workstations."

quiet pawn
#

lol

split hazel
#

I love it when I have 99% free cpu usage

quiet pawn
#

lol

lyric mountain
#

what about negative cpu usage?

tired panther
#

lol

lyric mountain
#

don't ask me wtf happened there

earnest phoenix
#

chart sus

split hazel
solemn latch
#

lol

#

back in time

summer sorrel
#

sorry language barrier so I don't know what you guys are talking about :((((((

lyric mountain
#

cpus that undoes operations

earnest phoenix
#

about hosting->price->cpu->negative cpu usage on a chart

solemn latch
#

👀 i just passed $100 on my host from affilate codes pogey

split hazel
#

nice

#

but does azure give you $100 free credit like every month

solemn latch
#

no pandasad how do i get that

split hazel
#

(not stacked)

#

idk tbh

#

I think I accidentally glitched their student account

solemn latch
#

oh grats

earnest phoenix
solemn latch
#

ah

split hazel
#

I just spin up a bunch of vms with it

#

it's been more than 1 time for me lol

earnest phoenix
#

Normal customers get 200$ for 29 days and some free things for 1y

solemn latch
#

I've been meaning to get the free stuff from google for awhile.
i should do that soon.

split hazel
#

they'll never know

long crow
split hazel
#

when I get a job part of that money will go towards cloud hosting

earnest phoenix
#

hey how can we choose a random member who reacted to a message in a guild by specifying these [reaction emoji] message-id, channel-id, guild-id using eval?

#

akio ty for redirecting me OwO_TY

near stratus
jovial nexus
split hazel
#

nice

near stratus
hexed sedge
long crow
near stratus
#

Also you'll need GUILD_MEMBERS intent

hexed sedge
solemn latch
boreal iron
#

LOL

hexed sedge
solemn latch
#

ez fix smh

near stratus
#

@earnest phoenix try this

const getReactedUsers = async(msg, channelID, messageID, emoji) => {
    let cacheChannel = msg.guild.channels.cache.get(channelID); 
    if(cacheChannel){
        cacheChannel.messages.fetch(messageID).then(reactionMessage => {
            reactionMessage.reactions.resolve(emoji).users.fetch().then(userList => {
                return userList.map((user) => user.id)
            });
        });
    }
}
jovial nexus
#

not the border

hexed sedge
#

He was trolling

solemn latch
#

thats the joke yeah

boreal iron
earnest phoenix
#

ty akio

boreal iron
#

just add both

near stratus
boreal iron
#

nope, :hover is not active

near stratus
#

nvm

hexed sedge
jovial nexus
boreal iron
#

Yes?! oldEyes

#

where else?

solemn latch
jovial nexus
earnest phoenix
#
selector {
  &:focus &:active &:hover {
    border: 0;
  }
}
hexed sedge
#

Everything specifies the type

jovial nexus
#

aaah okok

earnest phoenix
boreal iron
hexed sedge
boreal iron
#

Go on with your now, modern, magical stuff

earnest phoenix
#

enjoy

boreal iron
#

aktually

selector:focus, selector:active, selector:hover
{
  border: 0;
}
earnest phoenix
#

ah

#

i forgor whitespace means child element

jovial nexus
#

my css is css .dashfill { background-color: #ac77fe; color: #ffffff; border: none; padding: 8px 18px; text-align: center; font-weight: bold; font-size: 0.9em; border-radius: 15px; position: fixed; top: 50%; left: 50%; }, how do i add that then

boreal iron
#
.dashfill:focus, .dashfill:active, .dashfill:hover
{
  border: 0;
}
jovial nexus
#

yeah, but still does nothing

boreal iron
#

border: none; doesn't really work in some browsers, use border: 0;

#

clear your cache

boreal iron
#

all of the elements incl. their style is cached by any browser by default

jovial nexus
near stratus
hexed sedge
jovial nexus
long crow
boreal iron
near stratus
jovial nexus
#

same

hexed sedge
#

Tbf I fixed it, I have no idea what was the issue... d.js says that number is supposed to be an option for slash, but apparently not, so I switched it to integer

boreal iron
#

lemme check real quick...

hexed sedge
#

Its a really dumb issue

long crow
#

lemme try changing it from int to numbers on mine

hexed sedge
#

Im using main branch, and its in discordjs.guide

#

So I assumed it was implemented

#

Because that guide is from discord.js iirc

long crow
#

"discord.js": "^13.0.0-dev.t1628124537.3eb4140", this commit?

hexed sedge
#

My package says this "discord.js": "github:discordjs/discord.js"

long crow
#

npm i discord.js@dev

hexed sedge
#

Ill run that again

#

I mean like tbf I can work with integer, just didnt know that number was the issue

#

bc at that point ill just use integer

boreal iron
# jovial nexus same

We were missing the outline property

.dashfill:focus, .dashfill:active, .dashfill:hover
{
  border: 0;
  outline: none;
}
hexed sedge
#

Yeah it works now :/

#

That really sucks

boreal iron
#

@near stratus

hexed sedge
#

But, thanks for your time <3

boreal iron
#

oops. wrong guy

#

@jovial nexus see above

vast crown
#

help, im very confused

#

why is this happening

long crow
vast crown
#

it does, however at the end it sends message multiple times

jovial nexus
vast crown
#

and gives "cant send empty message"

hexed sedge
earnest phoenix
#

msg.channel.send(msg.channel.send

vast crown
#

oh fuck xd

#

i copied it by accident

earnest phoenix
#

you're not the only one who uses stackoverflow

hexed sedge
#

New error! Funsies

vast crown
#

nah, i didnt copy it from anyone just forgot to check

#

my brain is just fried

earnest phoenix
#

d e e p f r i e d

jovial nexus
#

thank yu man)))

boreal iron
#

👍

hexed sedge
long crow
#

it happen during when you re deploy command

#

test it again, should be gone

#

I abuse it with pinging websocket to get immediate slash command on global command

hexed sedge
#

The deploy command deploys to a guild. So it is supposed to be instant...

#

now it works... Bruh this is so confusing

earnest phoenix
#

it's a cache problem

#

imagine discord trying to inform 1000 guild member devices that a slash command was updated all at the same time

long crow
#

for setting guild command <message>.guild.commands.set(guildCommands); is much more simpler

vast crown
#

heres the actual problem, it works fine but.. it doesnt wait and just spams this code several times

earnest phoenix
#

because the setTimeouts are run every few milliseconds so they all wait 3 seconds then run super quickly

#

If you have an async function as your exports.main then you can use this to stop anything from happening for a few seconds:

await new Promise(res => setTimeout(res, interval));
vast crown
#

.. but why does it send this message several times

#

and then deletes channel after 3 seconds

last tapir
#

Hey.

earnest phoenix
#

because the setTimeouts are run every few milliseconds so they all wait 3 seconds then run super quickly

last tapir
earnest phoenix
#

assign to the role to the user inside that

quartz kindle
last tapir
#

like that?

boreal iron
#

@quartz kindle
creating an interval calling a function, let's call it damnHelpMe()
I'm importing something from a file inside the function, for example const { something } = require("./hello.json");
(something is an array)
At the next iteration, AFTER I removed one element of the array, the script still has all elements in the array something
Do I need to load the file over and over again with fs?

vast crown
#

if it deletes 5 channels it will repeat 5 times

earnest phoenix
earnest phoenix
quartz kindle
long crow
earnest phoenix
#

a single user can have different roles in different servers

quartz kindle
# vast crown

its not actually sending multiple messages, its just sending 1 message, but with multiple lines of text

#

because you did .join(" line of text here")

vast crown
#

so i joined everything not just a list

earnest phoenix
#

yes, but they'll get ratelimited by the improper setTimeout

green kestrel
#

hey there @quartz kindle

quartz kindle
#

you joined the list using the entire sentence as the separator

reef pine
#

why my is my localhost not running :c

quartz kindle
#

so for each item, there will be an entire sentence in the middle

last tapir
#
message.guild.roles.create({
  data: {
    name: 'Chill',
    color: '#7289DA',
  },
  reason: 'A role for Chill',
})
  .then(message.member.roles.add(role))
  .catch(console.error);

This didn't work...

green kestrel
#

why does vscode have a cartoon teenager in a bra in the corner

quartz kindle
earnest phoenix
last tapir
#

OH

earnest phoenix
#

hiii

reef pine
#

:3 *

quartz kindle
reef pine
#

its ishtar from fate

last tapir
#
message.guild.roles.create({
  data: {
    name: 'Chill',
    color: '#7289DA',
  },
  reason: 'A role for Chill',
})
  .then(role => message.member.roles.add(role))
  .catch(console.error);
#

like this?

boreal iron
# quartz kindle code?

Errr.. nothing more to show than what I explained:

timer_test = setInterval(() => { app.test(); }, 5000);

test()
{
   const { something } = require("./hello.json");
}

// hello.json
{
   "something":
   [
      "default"
   ]
}

Adding an element the array something and saving the file will not update the var inside my function.
Even if I'm requiring it again.

green kestrel
#

so im just gonna leave this here. currently unpicking a really bad bit of code for work with the aim of rewriting it. its full of stuff like this.

$today = date('Y-m-d', strtotime("+" . $dayPlus . " day"));```
comments anyone?
earnest phoenix
vast crown
#

even after i changed up the code

earnest phoenix
#

im beginner at developing discord bots, and i want idea for bots that can i start with it???

earnest phoenix
vast crown
#

wait

#

im dumb

reef pine
last tapir
earnest phoenix
#

oof

boreal iron
quartz kindle
boreal iron
#

just by going into the file, adding an element, pressing save?!

earnest phoenix
boreal iron
quartz kindle
earnest phoenix
boreal iron
last tapir
quartz kindle
boreal iron
#

Yeah as code said, so I'm forced to delete it's cache then

quartz kindle
#

or use fs

earnest phoenix
quartz kindle
#

fs.readFile would be better if you dont want caching

boreal iron
#

weird tho, never heard of a cache of the required files

reef pine
earnest phoenix
#

do dynamic imports in es6 cache the file?

boreal iron
earnest phoenix
#

does json even work with that though

reef pine
#

@green kestrel you dont happen to use local hosts or anything do you :3

earnest phoenix
reef pine
quartz kindle
earnest phoenix
quartz kindle
#

i mean, if it didnt have a cache, then everyone would be constantly re-reading their dependencies all the time, whch would be stuipd

reef pine
boreal iron
green kestrel
#

not sure what you mean by local hosts, you dont mean like localhost as in 127.0.0.1 yes?
i dont even use node.js 😛

boreal iron
earnest phoenix
#

imagine

// index.js
module.exports = require("./index.js");
green kestrel
#

parts of my discord lib use such bindings, but no i dont use express or node

#

nope

reef pine
#

oh :3

green kestrel
#

🔌

boreal iron
# quartz kindle lmfao

At least we could figure that out right now...
Makes things easier for me right now tbh KEKW

green kestrel
#

hmm that plug emoji is THE worst. it doesnt show right on dark mode

earnest phoenix
#

good thing i use light mode

boreal iron
#

lol

#

your poor eyes

ionic coral
#

why is tupper offline?

vast crown
#

ask him

long crow
boreal iron
# quartz kindle i mean, if it didnt have a cache, then everyone would be constantly re-reading t...

One last question regarding that.
Importing methods of classes is okay but what if the method relies on a different method within the class?

const config = require("./src/config.json");
const utilities = require("./src/utilities.js");
const database = require("./src/database.js");
const application = require("./src/application.js");

const utils = new utilities();
const sql = new database(utils);
const app = new application(utils, sql);

// utilities.js
class Utilities
{
   test()
   {
      // not important
   }
   whatEver()
   {
      this.test();
   }
}

// application.js
const { whatEver } = require("./utilities.js");

// OR
class Application
{
    #utils;
    #sql;
    
    constructor(utils, sql)
    {
        this.#utils = utils;
        this.#sql = sql;
    }
}

Would that be the recommended way?

#

Actually... what would you recommend?

quartz kindle
#

i'd put unitilies in the constructors

boreal iron
#

I'm passing the initiated classes to the classes

const sql = new database(utils);
const app = new application(utils, sql);
quartz kindle
#
const Utilities = require("./Utilities.js");

class Application {
  constructor() {
    this.utilities = new Utilities()
  }
}
boreal iron
#

hmm... so an initialization again

quartz kindle
#

yes

boreal iron
#

Is there a benefit or contra vs mine and this version?

quartz kindle
#

you have a self-contained instance of Utilities that belongs to Application only, and its not shared with anything else

#

keeps all the state in the same place

#

if all utilities methods are stateless then you can do something else

#

you can create something similar to an interface for example, for classes that have the exact same methods

quaint wasp
#

umm

#

so there are packages using canvas

#

and when I use em

quartz kindle
#

i did this in one of my libs, there i have a client and a server class that share methods

quaint wasp
#

it keeps telling me its missing "canvas.node"

#

i tried searching it everywhere on npmjs.com but didnt find it

#

(ping in replies)

quartz kindle
#
const interfaces = {
  method1() {}
  method2() {}
}

class A {}

class B {}

for(const [name, method] of Object.entries(interfaces)) {
  A.prototype[name] = method;
  B.prototype[name] = method;
}
#

thats a way to create functions once, and add them as methods to multiple classes

quartz kindle
boreal iron
#

Yeah I mean I could extend the classes and init it once like I do in PHP but I want to split it up in a few files for a better overview

quaint wasp
quartz kindle
#

which package are you installing?

quaint wasp
#

canvas

boreal iron
#

Anyway, I got what you mean, thanks for the explanation tho

quartz kindle
#

canvas directly? or something that needs canvas to work?

quaint wasp
#

or the one that needs canvas?

#

oh

#

one sec ill get it

quartz kindle
quaint wasp
#

@clashperk/quickchart

quartz kindle
#

it just sucks that js doesnt support inheriting from multiple classes at once

boreal iron
#

oh wait one second, I haven't mentioned something

quartz kindle
quaint wasp
#

im using a host and it doesnt show it, but in dependencies its this:

#

"@clashperk/quickchart": "github:clashperk/quickchart"

boreal iron
#

In my example above I init const sql = new database(utils);
The constructor within the database class is calling the function this.#openConnection();
Initing the database in application.js again for example, would open another connection

quaint wasp
quartz kindle
#

ah its one of those pterodactly shit

#

you should have access to a terminal no?

#

it should have logs there somewhere

quaint wasp
#

ya i got terminal..

#

Oh

#

wait there are logs in settings...

#

ill copy paste em here

lyric mountain
#

time do download the internet

quartz kindle
#

the install logs should show in the terminaç

wheat mesa
#

Go download the entirety of YouTube to show those fools what a bad idea it is to give you an unmetered connection

quaint wasp
#

there is no log of today..

#

It gives the logs of yesterday so i think they will show todays log tommorow... :/

quartz kindle
#

but if you have multiple applications accessing a single database, then yes, pass it as an argument

boreal iron
#

hmm yeah I would prefer to pass at least this one, too

#

alright

quartz kindle
lyric mountain
slender thistle
#

The only guess I have for my app stopping responding is my Mutex being locked at the time of being used, but I'm not sure why that could be the case

quartz kindle
#

tysm

boreal iron
#

no problemo... it's not the first time you helped out a lot

quartz kindle
#

:)

boreal iron
#

oh JS doesn't require to declare the var inside a class before assigning a value to it in the constructor()

#

?

lyric mountain
#

js doesn't require anything tbf

boreal iron
#

lol

lyric mountain
#

just throw it all somewhere, mix a bit and it somehow works

boreal iron
#
class Application
{
    #utils;
    #sql;

    constructor(sql)
    {
        this.#utils = new utilities();
        this.#sql = sql;
    }
...
#

well PHP requires to declare the vars before using them, which makes sense I mean

#

as in this example above

lyric mountain
#

ye

#

that's the sane way of doing it

boreal iron
#

this doesn't cause an error, too

lyric mountain
#

ye

#

remember js is so lenient that jsfuck is a thing

boreal iron
#

weird I thought I need the declaration, too (const var or let)

#

yeah I agree JS is weird sometimes

#

anytime

quartz kindle
#

typescript does it like that

#

pure js doesnt require anything since everything is dynamic

long crow
#

// @ts-expect-error go Brrrr

crystal tendon
#

n.help

vital void
#
client.on("message", (message) => {
  if(!message.content.startsWith(prefix) || message.author.bot) return;
  const args = message.content.slice(prefix.length).split(/ +/);
  const command = args.shift().toLowerCase();
  
  if(command === 'help'){
    client.commands.get('help').execute(embed, args);
  }
});

this is my trigger code

  name: 'help',
  description: "send help embed",
  execute(message, args){

    const embed = new Discord.MessageEmbed()

    .setTitle("COMMANDS")
    .setDescription("list of commands")
    .setColor('#40E0D0')
    .addField("savetag","Tells you how to save your shiny-hunt ping tag ")
    .addField("retag","Tells you how to change you shiny-hunt ping tag")
    .addField("deltag","Tells you how to delete your tag ")
    .setFooter("use my commands by alice <command>")
    
    message.channel.send(embed);
  }
};``` this is the "help" command code 
can any one help why is it arrising this error (||i am new to coding , i will be grateful if you help||)
lyric mountain
#

.get('help') returned nothing

#

do you have a command called "help"?

vital void
lament rock
#

// @ts-ignore

lyric mountain
#

it's trying to execute "help" at index line 207

obsidian sky
#

For some reason top.gg is messing up my alignment?

#

Also the colors...

#

The text color seems to be a darker on top.gg

split hazel
#

they probably changed something that messed up your css

obsidian sky
split hazel
#

flexbox the cause and savour of our issues

lunar cove
#

Hi, I'm new to bot development, made couple of easy bots. I want to create a bot which tracks vote for server cast by users and award them role.

Can someone show me some docs or open source code for tracking votes on top.gg for server ?

earnest phoenix
#

@lunar cove the dsl bot already does that

lunar cove
earnest phoenix
#

it is possible

#

there are api endpoints to see how many votes the user gave

#

you can also use webhooks to fire events when a user votes

lunar cove
earnest phoenix
#

You can see other people's (suffering) code in #topgg-api

lunar cove
# earnest phoenix You can see other people's (suffering) code in <#412006692125933568>

Ohh thanks that is helping me understand better.
Also how to get your webhook auth in

const express = require("express")

const app = express()

const webhook = new Topgg.Webhook("your webhook auth")

app.post("/dblwebhook", webhook.listener(vote => {
  // vote will be your vote object, e.g
  console.log(vote.user) // 395526710101278721 < user who voted\

  // You can also throw an error to the listener callback in order to resend the webhook after a few seconds
}))

app.listen(80)```
lyric mountain
#

message.guild

#

that's returning null for some reason

quartz kindle
#

btw you're ignoring your prefix lol

#

if message content starts with prefix, return

#

ah

tired panther
#

Is the member cached?

#

Could you log out message.member

median ivy
#

How do you add a color list to your server?

tired panther
tired panther
lyric mountain
#

I think he means color roles

#

in that case, you need a bot

median ivy
#

When i was on my server color chan said you need to add a color list

lyric mountain
median ivy
#

Ok

tired panther
#

Lol

earnest phoenix
#

rip

lyric mountain
#

fill all dem ports

solemn latch
#

'

#

]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]'

#

nala smh

hot olive
#

Hey, how do I add some ads to my site? to all pages and to the vote section so I can make some money

umbral oriole
#

I need vote thx code

digital ibex
boreal iron
#

God save the PiHole

digital ibex
#

wut

split hazel
boreal iron
#

(not just adblocking… even more)

rose warren
#

You can just use adguard DNS too. No ads ez

boreal iron
#

I don’t think so… not gonna route my traffic through an unknown service provider

wheat mesa
#

Gotta love it when your bot decides to throw a fatal error and continue to make multiple instances of itself (somehow) until your VPS runs out of ram and kills the process...

rose warren
#

Fun

wheat mesa
#

Very odd

#

Still trying to figure it out

rose warren
#

It's more fun getting rate-limited by Discord for 72h because of an unavailable guild that caused a crash loop overnight.

wheat mesa
#

Nice 👍

#

For some reason my bot tried to add its command files more than once

rose warren
#

Attack of the clones

wheat mesa
#

There should've been no reason for it either

#

No commands were run that caused the error

#

No reason for my bot to try to add files

#

Was already online for a few days

#

No logs for a restart of the bot

#

Happened literally out of the blue

boreal iron
#

AI is enveloping trying to devastate human life!! oldEyes

wheat mesa
#
0|npm star | Loaded with:
0|npm star | commands: 17
0|npm star | cached users: 1457
0|npm star | total users: 1704
0|npm star | cached channels: 408
0|npm star | cached members: 1521
0|npm star | cached guilds: 17
``` kept caching more and more users till it was out of ram. There should only be about 300 users cached right there
rose warren
#

1.5k cached users is baby cache

wheat mesa
#

Yeah, I know

#

But it was also caching those users over multiple instances of itself (I think)

#

So like 1500 cached users in tons of instances of itself

#

Not something that my 1gb RAM vps was prepared for KEKW

boreal iron
#

Hmm well 1GB isn’t really much at all

wheat mesa
#

Yeah I'm aware

#

However the bot usually is using ~15mb of ram on average

boreal iron
#

Small bot and/or cache management?

wheat mesa
#

Small bot + detritus clusterclient

split hazel
#

you can easily fit a decent bot in 1gb if you cache well

wheat mesa
#

It fits perfectly fine

#

This just randomly happened

#

Hasn't happened since

#

Happened about 6 hours ago, PM2 killed the process when it ran out of memory and started a new one. No errors.

#

(And the bot was up for a few days before this event)

split hazel
#

memory leak?

wheat mesa
#

Nope

#
0|npm star | [
0|npm star |   ImportedCommandsError: Error while importing multiple commands
0|npm star |       at CommandClient.addMultipleIn (/home/opc/wafflebot-detritus/node_modules/detritus-client/lib/commandclient.js:248:19)
0|npm star |       at Object.execute (/home/opc/wafflebot-detritus/src/events/clusterClient/gatewayReady.ts:14:7) {
0|npm star |     errors: {
0|npm star |       '/home/opc/wafflebot-detritus/src/commands/admin/listguilds.ts': Error: Alias/name `listguilds` already exists.
0|npm star |           at CommandClient.add (/home/opc/wafflebot-detritus/node_modules/detritus-client/lib/commandclient.js:182:23)
0|npm star |           at addCommand (/home/opc/wafflebot-detritus/node_modules/detritus-client/lib/commandclient.js:212:22)
0|npm star |           at CommandClient.addMultipleIn (/home/opc/wafflebot-detritus/node_modules/detritus-client/lib/commandclient.js:241:17)
0|npm star |           at Object.execute (/home/opc/wafflebot-detritus/src/events/clusterClient/gatewayReady.ts:14:7),
#

Did this error for EVERY command and alias

#

And I assume it decided to create more instances of itself because it had more cached users than usual (normally <300, it had 1700)

#

Oh, apparently a larger discord server added my bot, so I have 1500 total users now. Shot my ram usage up from 8mb to 41mb

#

Seems rather large for a measly 1500 users, though

#

Do Gateway intents eat up RAM?

rose warren
#

Yes

wheat mesa
#

Makes sense

#

I have a lot of the gateway intents enabled, should probably disable the ones I don't use

#
    intents: [
      GatewayIntents.GUILDS,
      GatewayIntents.GUILD_MEMBERS,
      GatewayIntents.GUILD_MESSAGES,
      GatewayIntents.GUILD_PRESENCES,
      GatewayIntents.GUILD_MESSAGE_REACTIONS,
      GatewayIntents.DIRECT_MESSAGES,
      GatewayIntents.DIRECT_MESSAGE_REACTIONS,
      GatewayIntents.GUILD_VOICE_STATES,
    ]
``` lol
#

I suppose it'll eat up a lot less ram whenever I migrate to slash commands though

quartz kindle
#

15mb ram is not even possible for node.js itself

#

unless you're only counting heap

wheat mesa
#

Not sure, just monitoring using the basic stuff PM2 gives me for my process

quartz kindle
#

the only way i can see pm2 reporting 15mb for a node.js process would be if the OS is swapping it out and putting half of it in the page file lul

wheat mesa
#

¯_(ツ)_/¯

#

Is there a better way to check the usage on a VPS linux terminal

quartz kindle
#

well, there is top/htop

#

but usually pm2 does a good enough job, since most servers are not configured with heavy swappiness

wheat mesa
#

That's quite a bit more than PM2 is posting

quartz kindle
#

132mb sounds reasonable

wheat mesa
#

So estimate that node itself uses ~80mb

quartz kindle
#

yes, anywhere between 40-80 is considered normal for node

wheat mesa
#

Not terrible I guess, long term I'll likely have to upgrade if my bot continues to grow

quartz kindle
#

it can go as low as 25 if its idle for a long time

wheat mesa
#

Half of the usage I have is probably from gateway events that I don't even need to receive

shrewd dragon
#

If I get approved how to know that

wheat mesa
shrewd dragon
#

Ohh

wheat mesa
#

With a message showing either your bot getting approved or declined

#

Also I believe @livid jackal will send you a dm

quartz kindle
#

i have a couple node processes running web servers that are rarely accessed

#

they are sitting around 25-30mb

#

(RES is what matters)

wheat mesa
#

nice

#

I'll look into removing as many gateway intents as possible to reduce my ram usage

quartz kindle
#

you just need to remove 1

#

GUILD_PRESENCES

#

although it affects more cpu than ram

wheat mesa
#

Do the others not make a noticeable difference in RAM usage?

#

Compared to presences

quartz kindle
#

not nearly as much

#

GUILD_MEMBERS used to

#

but not anymore after discord's changes

wheat mesa
#

I also need to remove it anyways as I don't feel like applying for a gateway intent I don't even need (in the future)

quartz kindle
#

disabling PRESENCES now automatically disables 90% of MEMBERS anyway

#

disabling those two will reduce your cpu usage by like 90% lol

wheat mesa
#

CPU usage is only at like 2% for me anyways

#

But I guess it'll get heavier as I cache more users

quartz kindle
#

it gets heavier with more guilds

#

without presences, your cpu should go from 2% to 0.5% lol

wheat mesa
#

I'll do that rn to see the difference

#

If I disable presences, I assume I would need to fetch the members instead of trying to grab them from the cache?

quartz kindle
#

ye

wheat mesa
#

If I'm not caching the users, how would I tell how many total users there are? Loop through cached guilds' member count?

#

Currently using this: ```ts
let guildCount = 0;
let userCount = 0;
let memberCount = 0;
let totalUsers = 0;
let channelCount = 0;

  for (const shard of (client.client as ClusterClient).shards.values()) {
    guildCount += shard.guilds.size;
    userCount += shard.users.size;

    for (const guild of shard.guilds.values()) {
      memberCount += guild.members.size;
      totalUsers += guild.memberCount;
    }

    channelCount += shard.channels.size;
  }
#

Nevermind, was a bug

quartz kindle
#

member doesnt exist on webhooks

#

check for message.webhookID (webhookId in v13) or check for message.member

#

checking for message.member works for both dms and webhooks at once

split hazel
quartz kindle
#

did you see the last commit?

#

they bumped required node.js version to 16.6+

#

like wtf

#

yes it should

split hazel
#

cant they just not use the latest syntax there is

#

there is 95% of the time an alternative

#

16 isnt even fucking stable

#

they're having a laugh

waxen bough
#

can i just take master branch and feed it to tsc and then have output that is compatible with older versions?

split hazel
#

i was thinking something similar

#

but it seems rather annoying

#

youd have to modify some things and maintain your own copy

long crow
waxen bough
#

i haven't done that before but it theoretically that should work right?

long crow
#

also on last day they change defer() to deferReply() lolzer

waxen bough
long crow
#

I think the only good feature is ??=? array.at maybe not so

split hazel
#

it would probably work

#

one thing i've learnt is theres no reasoning with the djs community

#

evie was right lol

quartz kindle
waxen bough
#

ohh im not familiar with babel

split hazel
#

maybe have a shell file which runs babel on node_modules/discord.js ?

#

dont know how it works exactly

quartz kindle
#

you still have to edit their package.json

#

tbh idk if node respects the engines field

split hazel
#

pretty sure it doesnt care

#

npm only warns you when you do that

#

i swear every time someone says something that the lets say "djs fanboys" dont like they dont listen lol

#

sadly its the only frequently maintained library

quartz kindle
#

its frequently maintained because of how chaotic it is lel

#

just do if(!message.member)

long crow
split hazel
#

i'd be using d++ if my bot was in c++ lol since brain actively maintains it

quartz kindle
#

will put on githunb soon

long crow
#

Confidence Tim, the confidence is the lacking factor

#

other factor is not a factor as now to make my own

split hazel
#

i'd totally use a lib that has methods/props very close to djs

#

because i have a massive codebase

quartz kindle
#

im aiming for the oposite

#

make it closer to the actual api

split hazel
#

pain but i see what you're doing

#

so the discord dev docs dont look too foreign

quartz kindle
#

ye plus they are much more stable

#

and a lib based on them doesnt even need updates to support new featuyres

split hazel
#

though if the time comes and theres a lib that doesnt have frequent breaking changes, annoying updates and performant i might put in the effort to completely switch

#

since it would be better in the long run

waxen bough
#

in npm is it possible to trigger script of a module when another module is being installed?

quartz kindle
#

like what

split hazel
#

i'll play around with babel a bit and see if its possible to directly mutate node modules with backwards compatible code

#

god i love linux

waxen bough
#

when i install a npm package.

split hazel
#

i dont actually think so

#

pip does

#

but i never saw npm do that

#

except when building node gyp

waxen bough
#

i do npm i and then a js file from another module executes

quartz kindle
#

like what kind of script do you need

waxen bough
#

idk how to describe

#

haha

quartz kindle
#

do you have an example?

split hazel
#

do you mean the discordjs babel thing

waxen bough
#

nvm

split hazel
#

lmao

#

was getting excited

waxen bough
#

haha

split hazel
#

time to get to business with code .

quartz kindle
#

what you can do is have a script in module 1 that runs npm i module2 then does something

#

so you would run module1 instead of npm

split hazel
#

close enough

quartz kindle
#

lel

waxen bough
#

well oke

split hazel
#

whats some node 16 syntax

#

actually optional chaining will do

quartz kindle
#

[1,2,3].at(1)

split hazel
#

ah yes at

#

saw it on v8 twitter

#

i dont really see the point of it

#

cant you just do arr[0] or something

waxen bough
#

[1,2,3].at(1)
^

#

jk

split hazel
#

im on 16.5 and its not working either lmao

#

perfect

quartz kindle
#

its made to suppport negative indexes

waxen bough
split hazel
#

i really need to install nvm on my system

quartz kindle
#

so you can do .at(-1) for the last item

split hazel
#

arr[arr.length - 1] go brr

quartz kindle
#

ye

split hazel
#

or even -2!

waxen bough
#

did double ended iteration get through haha

quartz kindle
#

dont think so

wheat mesa
#

Hmmmm... My node is taking 150mb for only 17 cached guilds, and about 40 cached users & members

#

Is that normal?

quartz kindle
#

doesnt look nomal

wheat mesa
#

I doubt I have a memory leak but I guess it's a possibility

split hazel
#

femboy vibes does the job

long crow
#

45mb with 72 guilds here, so something might be wrong somewhere

quartz kindle
#

owo

split hazel
#

this uwu was sponsored by Arch Linux

wheat mesa
#

This is my cache/intents: ```ts
const commandClient = new CommandClient(process.env.BOT_TOKEN as string, {
useClusterClient: true,
shardCount: config.shards,
cache: {
presences: { enabled: false },
emojis: { enabled: false },
messages: { enabled: true, expire: 60 * 60 * 1000 },
},
gateway: {
loadAllMembers: false,
intents: [
GatewayIntents.GUILDS,
GatewayIntents.GUILD_MESSAGES,
GatewayIntents.GUILD_MESSAGE_REACTIONS,
GatewayIntents.DIRECT_MESSAGES,
GatewayIntents.DIRECT_MESSAGE_REACTIONS,
] /* 'ALL'*/,
},

quartz kindle
#

by raid shadow legends

split hazel
#

funnily enough i've never used babel

#

nextjs abstracts it to the point of me never seeing it so im diving in first

quartz kindle
#

what does process.memoryUsage() say?

wheat mesa
#

Two

#

I should probably change the shard count seeing as I really don't need it...

wheat mesa
#

Or does pm2 monit do the job

quartz kindle
#

edit file or eval comand

wheat mesa
#

shit, always knew I should've made an eval command

quartz kindle
#

lel

split hazel
#

lol

wheat mesa
#

Making one for the next update I push to it, but still haven't started on that yet

#

pm2 monit says the process is using 42mb of RAM

quartz kindle
#

where did you read 150mb?

wheat mesa
#

top

quartz kindle
#

under RES?

wheat mesa
#

Yup

split hazel
#

you know theres no hope when babel itself doesnt understand the syntax

wheat mesa
quartz kindle
#

weird

#

process.memoryUsage() should have an answer

wheat mesa
#

Alright, I'll edit a file

#

nano time

quartz kindle
#

put it in the ready event

split hazel
#

does babel seriously not support optional chaining

#

it says on the babel site to install a plugin for it

#

what lmao

#

for a tiny feature

long crow
#

kekw

quartz kindle
#

lmao

split hazel
#

fine then babel have it your way

#

i'll bloat my system more

long crow
#

go for ??= too djs might use it soon

#

TM

split hazel
#

what does it even do

#

i couldnt find any docs for it

quartz kindle
#

assign if not null/undefined

split hazel
#

thought so

split hazel
#

i like it

#

short way of doing if(bool)

long crow
#

basically same like ?.

waxen bough