#development

1 messages ยท Page 1746 of 1

sudden geyser
#

But keywords like const are a bit annoying

#

Since it creates a constant value embedded in the binary when compiled

shadow stratus
#

my favourite language is js

sudden geyser
#

but it's whenever

#

and there's no real formula for developers to tell

#

I'd rather have Dart figure out when to make it constant for me

sudden geyser
shadow stratus
#

php, html, css, c#, learning solidity

sudden geyser
#

html, css
Current objective: survive

#

I haven't learned the other three languages though.

shadow stratus
#

I hate html

sudden geyser
#

yeah same

shadow stratus
#

css is ok

sudden geyser
#

never touching it

calm raft
#

ive seen some bots monitor their own uptime. Is there an easy way to do that? discord.py btw

outer void
#

worked with flutter for a company and the sensation of not touching html and css gave me joy tbh

calm raft
sudden geyser
prime mist
#

I feel like every dev should learn at least one functional programming focused language at some point. Clojure, Haskell, Elixir etc.

vivid fulcrum
#

definitely

sudden geyser
#

I tried Haskell but couldn't get its editor support working.

#

Now I use Clojure.

prime mist
#

Clojure is a great language ๐Ÿ™‚

sudden geyser
#

yeah it's nice

vivid fulcrum
#

just touching the general programming paradigms genuinely benefits you in the long run

prime mist
#

Hah yeah. People need to stop making everything a class.

#

Mutable state scares me now.

slender thistle
#

All things mutable

sudden geyser
prime mist
vivid fulcrum
#

nothing scares me anymore after having to work with bascom then asm for 4 months

eternal osprey
#

hey

#

how do i randomly choose 1 or 2?

#

using Math.random

sudden geyser
eternal osprey
#

thanks!

stiff lynx
#

I have no more ideas for my bot, suggestions?

sudden geyser
#

What's your bot about?

stiff lynx
#

about everything, I have no topic

earnest phoenix
#

Well YouTube kins thinga

sudden geyser
#

Then look at popular bots and draw inspiration from their commands

sterile lantern
#

if its about everything do you have a function that fetches google searches and relays them in an embed

#

twas completely random

#

but economy, moderation, picture cmds, etc

stiff lynx
sterile lantern
#

picture cmds?

#

triggered <@short wraith> red @short wraith

stiff lynx
#

when I try to do Google search Heroku gives me Always errors

sterile lantern
#

oof sorry for ping user

earnest phoenix
#

Well

#

Google blocks scrapees

#

So use a non scraper blocking one

stiff lynx
earnest phoenix
#

What

#

And yea

stiff lynx
#

Which is the usage of WOKCommands?

sudden geyser
#

WOKCommands?

stiff lynx
sudden geyser
#

You want to use the YouTube API?

vivid fulcrum
#

damn a channel created a whole ass package manager

#

/s

boreal heath
#

hey dose anyone know how to unlock a hidden channel on discord

earnest phoenix
#

Well you cant

#

since api Just sends the channel name and desc nothing else

vivid fulcrum
#

no

#

if it's bothering you, leave the server

#

as simple as that

quartz kindle
#

fuck man why is releasing libs so hard

#

every time i release something, i need to release 3-4 additional versions to fix readme mistakes in the following hour or two

sudden geyser
#

reject libs

quartz kindle
#

return to monke

plucky loom
#

I'm running into an unclosed client server error which then invokes a 429 ratelimiting error. How do I fix these? I don't know what I need to do to fix them.

fresh verge
#

How would I add text to an already created list?

#

Like I have my list, and I add it adds something when something happens.

earnest phoenix
#

language?

fresh verge
earnest phoenix
#

Oh

quartz kindle
#

how does your list look like? where is it stored?

fresh verge
quartz kindle
#

example?

fresh verge
quartz kindle
#

so, an array

#

you can add items to arrays using .push()

#

list.push("new value")

#

just keep in mind that arrays are in-memory

#

once your bot shuts down or restarts, the array will be reset to its initial value

plucky loom
sudden geyser
#

What's the exact error? Can you show the rate limit headers?

lyric mountain
#

push

#

nvm

plucky loom
#

Well, it's an unclosed client session which then http spams in trying to connect, causing the ratelimiting. :/

lyric mountain
#

close ur sessions

sudden geyser
lyric mountain
#

category names?

#

you mean, the channel categories?

#

just fetch the "channel"

solemn latch
#

dms are also a channel

lyric mountain
#

yes, you can also get it by getting a channel's parent

plucky loom
#

yes, idk how to close it while keeping my bot up 24/7

median rain
#

how do I make an api

lyric mountain
median rain
lyric mountain
#

you just answered urself

fair axle
#

What is message thread exactly?

median rain
lyric mountain
#

not a thing currently

median rain
#

free domain

solemn latch
#

freenom gives some free domains

lyric mountain
#

technically, freenom

earnest phoenix
fair axle
solemn latch
#

they are only a year iirc

lyric mountain
#

just note that they are """""free"""""

solemn latch
#

^

earnest phoenix
#

domain

median rain
lyric mountain
#

excessive quotation marks are intentional

solemn latch
#

#freenom @drowsy crag

plucky loom
#

@lyric mountain How do I close client sessions, but allow my bot to run 24/7?

lyric mountain
#

that error is probably not being caused by discord client

fair axle
lyric mountain
#

but some other client u opened and forgot to close

earnest phoenix
#

Create New one on close

fair axle
#

What do you mean by temporary channels?

earnest phoenix
#

And close all ones in opening client

lyric mountain
#

or reddit

#

whatever

#

channels that are there for limited time

fair axle
#

Is it like normal text channels?

lyric mountain
#

yes but temporary

earnest phoenix
#

They are sun channels kinda i thibk

plucky loom
#

I'm confused. Cuz I'm using Replit to run my bot and I only have one instance of the bot open, but not running. So it's running somewhere else????

lyric mountain
#

do you use any api?

quartz kindle
#

there are no truly free domains the same way there are no truly free vps and hosting services

fair axle
#

I get it thanks

median rain
lyric mountain
median rain
#

oxygen?

earnest phoenix
#

yes

lyric mountain
#

oxygen aint free

quartz kindle
#

soon enough not even oxygen

lyric mountain
#

you pay a toll to breathe it

median rain
#

bruh

lyric mountain
#

the more you breathe oxygen the more oxidized your cells get

earnest phoenix
median rain
#

is money free

#

what about yourself is it free

#

people that are broke

#

gets nothing

lyric mountain
#

you're heavy limited both because 99.9% websites/services don't trust freenom domains and because the farthest you can go with it is redirecting to another site

plucky loom
#

using discord.py, sql, js, html, css. ๐Ÿคทโ€โ™‚๏ธ Idk what the culprit could be

lyric mountain
#

you can't even set a dns to it

#

freenom embeds the site inside a screen-wide frame

#

just check the html of a freenom-masked domain

earnest phoenix
#

Well not really?

median rain
#

bruh

#

alright time to rob some banks holding an avocado and say it's a gernade

quartz kindle
#

be a twitch streamer

median rain
#

and stream what?

solemn latch
#

halo 3

quartz kindle
#

5 bucks a month is enough

median rain
quartz kindle
#

stream some bullshit

#

pdople love bullshit

solemn latch
#

drama works

quartz kindle
#

lkke

median rain
#

idk about that because i think mininum wage is definitely higher than 5 bucks an hour

quartz kindle
#

ztream yourself sleeping for example

median rain
earnest phoenix
median rain
#

im getting 500 subs in 1 night

#

$100 each

quartz kindle
#

exdee

#

anyways domains are not expensive

#

get some 1-2 hour job like cleaning someones garden for 10 bucks

#

and yoi hVe enougj for 1 year

#

fking mobile keyboard

earnest phoenix
#

i can feel your pain

plucky loom
#

My bot just fixed itself and I am no longer getting the issue. Idk what happened, or how it fixed itself, but I'm happy it's working. ๐Ÿ™‚

fresh verge
#

How do I make something repeat until a certain condition is met?

solemn latch
#

a while loop?

fresh verge
solemn latch
#

its called a while loop in js too.

fresh verge
solemn latch
#

while(condition) {
//code here
}
earnest phoenix
#

So, when I do my command: x/start 1h(time) test(prize) It shows the (time) Portion of the Command. Now I am now experience with args formations that much lol, which is why im asking.

time: time = args[0];
prize: args.join(" ").slice(22);

solemn latch
#

args is every arg, so args.join(" ") will join every arg, including time.
youll need to ignore the first arg

earnest phoenix
#

O_o

#

Ohhhh, lmao

fresh verge
#

Duration is spelt wrong. XD.

earnest phoenix
#

Gotcha.

earnest phoenix
#

I messed it up more . . . . . . . . . . . .

sudden geyser
deep mantle
earnest phoenix
#
  let item = args[1]
    
    var time;
    
    var winnerCount;
    for (var i = 0; i < args.length; i++) {
      item += args[i] + " ";
    }
    
    time = args[0];
    if (!time) {
      return message.channel.send('No Duration was Provided in your message.');
    }```
#

I have it set as that.

#

Now, I barely use args lolol. So I am learning that on my free-time.

earnest phoenix
deep mantle
#

dang i thought it was a langauge i could code sorry dont know that ๐Ÿ˜ฆ

opal plank
#

heres why

earnest phoenix
#

I used let, its still the same @opal plank

opal plank
earnest phoenix
#

Ah, okay lmao

opal plank
#

nvm

#

im dumb

#

its item not time

sour flame
#

...

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sudden knoll
#

put a print statement and see if it's looping

#

unless you already did

#

or just step through

#

with a debugger

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sudden knoll
#

get a debugger, use breakpoints

prime mist
#

Node has a pretty nice built-in debugger. You can even use it in production if you really have to hah. kill -SIGUSR1 <pid>

#

JSON is faster by quite a bit, but uses more bandwidth compared to a binary format.

fresh verge
#

How do I allow users to clear over 100 in one clear command?

lyric mountain
#

Repeat bulk delete every 100 messages

opal plank
twilit geode
#

code:

public static String getBalance(String userId) {
        String getBalanceQuery = "SELECT balance FROM master WHERE user_id == 679725208785125398;";
        String database = "economy.db";
        ResultSet rs = Database.sqlQuery(getBalanceQuery, database);
        
        try {

            if (rs.next()) {
                String balance = String.valueOf(rs.getInt("balance")); // line 44
                rs.close();
                return balance;
            } else {
                rs.close();
                addUser(userId);
                return "Setting up your account; try again!";
            }

        } catch (SQLException e) {
            e.printStackTrace();
        }
        
        return "ERR!";
    }

error

java.sql.SQLException: The prepared statement has been finalized
        at org.sqlite.core.NativeDB.throwex(NativeDB.java:487)
        at org.sqlite.core.NativeDB.column_int(Native Method)
        at org.sqlite.jdbc3.JDBC3ResultSet.getInt(JDBC3ResultSet.java:393)
        at org.sqlite.jdbc3.JDBC3ResultSet.getInt(JDBC3ResultSet.java:400)
        at commands.economy.CommandDatabaseBackend.getBalance(CommandDatabaseBackend.java:44)
        at commands.economy.temp.main(temp.java:5)
#

this is java, workign in sqlite

twilit geode
#

I got it working

earnest phoenix
#

typeof NaN (not a number) returns "number" Thonk

#

@opal plank wanna see smth

opal plank
earnest phoenix
opal plank
#

detritus aint there

#

biased

earnest phoenix
#

this proves deno libs are better

opal plank
#

using the shittiest lib to run the test

#

also dont trust that so readily

#

discorddeno was ruthlessly put on fire in dapi a while back

#

due to how shit some of the code was

#

nor were some of the comparisons fair at all

earnest phoenix
#

what's dapi

opal plank
#

dapi

earnest phoenix
#

did they actually print the source code and burn it

opal plank
earnest phoenix
#

Well discordeno is written in typescript

#

you'll like that no?

opal plank
#

i dont wanna get into specifics

#

but just know that you have ur lib put here if its good enough

#

my big boy is there at the very end

#

the lib devs and staff didnt deem deno was good enough of a lib to be put there

#

they said it multiple times in general

#

so yeah, dont go blindly looking at graphs made by the owner, 100% biased

#

and im gonna leave it at that note, dont wanan get into the specifics

opal plank
#

not the place for finding devs

gaunt stag
#

Hey , my bot plays music very nicely but when i do like #play lofi 24/7 like the music from YouTube streams of 24/7 it plays 1 second and there is no voice from the bot

#

I use ffmpeg package

heady lichen
#

Discord.js
guild.channels.set(channel.id, channel);

Getting error cannot read property of ID user undefined

When ading bot to server other than my Main server adding to anyother server is fine just with 1 server
It has 2fa enabled maybe something idk pls help

lament rock
#

you shouldn't set channels manually considering Discord.js manages the caches for you. What exactly are you trying to do?

heady lichen
#

Okay so its just an rank bot

#

And it worke fine on all server

#

Except when i add to main server to fails

lament rock
#

can you provide the full error stack

earnest phoenix
#

you need 2fa enabled on your account to have your bot working with servers that require 2fa

heady lichen
#

Its from ClientDataManager.js

#

Ahh let me check havent i disabled

earnest phoenix
#

i only read the 2fa part, lol

heady lichen
#

Enabled

#

Already

earnest phoenix
#

alr, so 2fa isn't the issue

earnest phoenix
#

i want to see the issue

heady lichen
#

Yea

earnest phoenix
#

Every time a webhook sends a message to a channel, my bot returns the following error:

if(!message.member.hasPermission("MANAGE_CHANNELS")) return;

TypeError: Cannot read property 'hasPermission' of null```
How can I check if using the user is a human or a webhook?
opal plank
#

add a ? there

#

conditional chaining ftw

earnest phoenix
opal plank
#

that would add extra lines

earnest phoenix
#

try that

opal plank
#

could just use conditional chaining

heady lichen
opal plank
#
if(!message.member?.hasPermission("MANAGE_CHANNELS")) return;```
#

this simple

heady lichen
#

Ahh couldn't copy so ss@earnest phoenix

copper cradle
opal plank
earnest phoenix
opal plank
#

let d.js deal with that

earnest phoenix
#

no clue what the context is

heady lichen
#

Okay lemem check what the heck i did

#

Am confused now there isnt src at all hidden files

opal plank
#

wait a second

#

@heady lichenwhat version of d.js are u using?

heady lichen
#

Ohh

#

K

#

I was using 11 havent checked once lol

opal plank
#

use v12

earnest phoenix
#

erwin

opal plank
#

v11 no longer works

opal plank
earnest phoenix
#

mind showing me how you configured the gamesdk sometime?

heady lichen
#

Yea i modified some code which i forked in v12

opal plank
#

its all in c#, do you know c#?

earnest phoenix
#

@heady lichen do you have any prior programming experience

#

vscode is being a bitch

#

ye, some

heady lichen
#

A bit

earnest phoenix
#

vs isnt working either

opal plank
#

lowkey its mostly using node-napi and the snippet from the sdk docs

earnest phoenix
#

wouldn't recommed making a bot as your first project

#

and im starting to lose my braincells which are already at -500

opal plank
#

node-api

earnest phoenix
#

the fuck is a napi

heady lichen
#

I have 3 of em running fine@earnest phoenix

opal plank
#

its what i use to compile csharp code in js

heady lichen
#

I just fked this one

earnest phoenix
#

three bots

opal plank
earnest phoenix
#

small question: why

patent bear
#

-botinfo 842274047127846933

gilded plankBOT
#

tickNo That bot wasn't found

patent bear
#

-bots

gilded plankBOT
patent bear
#

-botinfo 841912784639492096

gilded plankBOT
#
Bot info
ID

841912784639492096

Username

karel ---->

Discriminator

5739

Short Description

No je zatรญm v betฤ› jsou vรฝpadky ale od 20:00 do 7:00 nenรญ to pล™esnรฉ se vypne

Library

undefined

Prefix

1

Total Upvotes

1

Monthly Upvotes

0

Server Count

No server count

Owner(s)

@patent bear

heady lichen
#

Ahhmm

#

Yes

opal plank
#

@patent beardont use commands here

patent bear
#

Sorry

heady lichen
opal plank
heady lichen
#

I did

#

Its working

#

Few stuff to fix most cmds working

hollow silo
#

-botinfo 839540536871878656

gilded plankBOT
#
Bot info
ID

839540536871878656

Username

Dragon Bot

Discriminator

7628

Short Description

Moderation Bot built to manage discord servers.
This bot has all the premium commands. Hackban/forceban [Type of ip ban] is also available.

Library

undefined

Prefix
Total Upvotes

1

Monthly Upvotes

0

Server Count

No server count

Owner(s)

@hollow silo

woeful pike
#

ip ban on discord lol

marble juniper
#

isn't it supposed to be that you use luca in #commands

#

lol

#

besides mods

prime mist
#

OMG finally got on demand caching working in a client I'm working on.

It will only activate the caches that you use.

rocky hearth
#

y can't I access the abstract properties in the constructor of same abstract class?

stiff lynx
#

Yo everyone, I have a question.
my currency system stores also the guild.id in the schema and the leaderbord Is made by people with the same guildID.
But now that some people tested my bot in my server added it to them server and in the leaderbord they don't figure out. How can I change the guildID when they use .beg?

earnest phoenix
#

-bots

gilded plankBOT
earnest phoenix
#

-info 3774573779170820096

#

-bots 3774573779170820096

gilded plankBOT
#

tickNo This user has no bots

earnest phoenix
#

smh

#

i doubt it

#

"-botinfo"

#

-botinfo 559726241280688130

gilded plankBOT
#
Bot info
ID

559726241280688130

Username

Watcher

Discriminator

8293

Short Description

This bot watches over the bots in the top.gg server to make sure everything is following the rules uwu

Library

discord.js

Prefix

watcher

Total Upvotes

15

Monthly Upvotes

2

Server Count

15 Servers

Owner(s)

@coral trellis dblMod dblCertified
@tulip loom

Links
formal crater
#

-support

#

.-.

#

-help

near stratus
#

Also Didn't knew luca had a help

green kestrel
#

hmmm

worn sonnet
#

i know hyperlinks in embeds can be inserted this way [Click me](link here) then why is it showing like this?

slender thistle
#

Field titles don't allow hyperlinks

green kestrel
#

when i delete a dedicated server, how can i be sure that the provider isnt just putting that dedicated server straight back into the pool again and reinstalling an OS image over it, e.g. what stops the next user of the box doing a basic data recovery on its disk and getting my data?

slender thistle
#

Only description and field values

green kestrel
#

never considered that till now

worn sonnet
#

thanks

lusty quest
#

if you use Linux, DD or shred can do it

boreal quest
#

So I was reworking some of my older code and found this and I have now tried coming up with a solution to my problem for some time but have not found anything that could work and is not redundant. ```js
try{
commands.get(CommandName).run(msg, client, Discord, args, commands.array());
}catch(e){
if(notCommandChannel(msg, client, false)) return
client.eventEm.emit('CommandError', msg, CommandName, args, e)
}


Now the problem is not the code itself, it is the try and catch. I want it to catch if an error occurs anywhere within that .run() call as many times when an error occurs the program exits. Instead of having to put redundant try catch blocks in all command functions I would like to know if there is an easier way to do this.
worn sonnet
#

hey! is there any way to have reaction menus for embeds with fields?

boreal quest
worn sonnet
#

what i'm trying to do is

#

an embed have 10 fields with values

#

now when the user reacts on next emoji

#

the fields and values should get changed

clear marlin
#

where the run() is being used

clear marlin
worn sonnet
#

any refs to it?

boreal quest
boreal quest
# worn sonnet any refs to it?
clear marlin
worn sonnet
#

i was looking for some Paginator

slender thistle
#

why you need a while True loop for this I have no idea

worn sonnet
#

oke alr i'll look into it

#

thanks for the refs

sacred juniper
#

How can i invite my bot? I did it on glitch

clear marlin
#

doesn't matter where you host it. Go over to the discord developers portal > your bot > oauth2

sacred juniper
#

Ok thanks

autumn kestrel
#

-botinfo 753597592637800478

gilded plankBOT
#
TTS
Bot info
ID

753597592637800478

Username

TTS

Discriminator

4855

Short Description

A Discord Bot that reads your messages to others with Google voice

Library

undefined

Prefix

Defult is !

Total Upvotes

4

Monthly Upvotes

2

Server Count

31 Servers | 1 Shards

Owner(s)

@autumn kestrel

Links
green kestrel
#

no luke, i am your father...

#

๐Ÿ˜„

#

if only you knew the power of the non-glitch side of the force

zenith terrace
green kestrel
#

because they are cringe people

#

you just answered your own question lol

zenith terrace
#

fair

autumn kestrel
#

sorry

earnest phoenix
#

F

sacred juniper
#

I did an music bot on glitch but it doesnt play any music it always first connecting and after disconnects

#

Idk what is the problam

boreal iron
# green kestrel when i delete a dedicated server, how can i be sure that the provider isnt just ...

Well thatโ€™s the common behavior of most of the providers I know. The costumer always is responsible for his data and security specially for an unmanaged server. Imagine each time a costumer changes the provider would run system tasks to override each byte on the hard disk. That would increase the time until a system being ready for the next costumer and dramatically reduce the life cycles of the hard drives, especially SSDs/NvME.

#

That would actually mean higher costs and higher chances of early hardware failing.

quartz kindle
#

i dont think vms even have access to the physical disk

#

vms are usually given virtual disks

#

the bytes they read are the bytes given to them by the virtualization, not by the disk hardware

#

or at least one would think thats how it works, in practice im not sure

boreal iron
#

Yeah I think so, too but his concerns are about dedicated ones

quartz kindle
#

yeah if you are given full access to a physical disk, then yes

latent heron
#

Tim I feel like you're the maintainer of the #development channel at this point ๐Ÿ˜…

quartz kindle
#

Lol

latent heron
#

69.2K messages from you in here

quartz kindle
#

help me maintain this project, donate now!

#

:^)

boreal iron
slender thistle
#

Tim literally owns this channel at this point

#

Literally called dibs

boreal iron
quartz kindle
#

i cant

#

its my competitor

#

kinda?

#

lmao

green kestrel
#

I'm gonna run Shred on it remotely before I shut it down for the last time

quartz kindle
#

run DBAN on it

green kestrel
#

I can't boot off my own iso, can I ru dban from inside Linux?

quartz kindle
#

you cant boot from an image?

#

wat

green kestrel
#

no only their predefined list of os and recovery images iirc

#

via ipmi

opal plank
quartz kindle
#

you can run something from a recovery image or a linux installation disk

#

linux install disks have plug an play systems that you can run without installing

boreal iron
opal plank
#

sus, im watching you duck boi

boreal iron
boreal iron
green kestrel
#

it has KVM, I dunno if I can use it though it's crummy and old and expects a java plugin ew

rare trail
#

hi, in dblpy, autopost doesn't work only for me or this is a lib issue?

green kestrel
#

ovh

boreal iron
#

lol itโ€™s an old LARA KVM console I guess

#

But they are capable of uploading your own image but due their low speed it takes forever

green kestrel
#

its built in ipmi

#

these are generally blade servers

#

in a 4u rack

boreal iron
#

I did install the OS via KVM consoles, too for Windows machines I couldnโ€™t put in VM containers because I needed bare metal power.
The providers actually offer Windows images but only in combination of they can sell you the license.
And a server key from eBay is cheaper KEKW

sage bobcat
#

One message removed from a suspended account.

quartz kindle
boreal iron
#

I have consistently removed guilds my bot was in if they are too small or havenโ€™t used the bot for a few weeks just to get rid of the verification process. oldEyes

vivid fulcrum
#

would be easier if you could just link the id to your account regardless of the state of the bot

boreal iron
#

Hmm yeah as you have to have your phone number being verified already

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

boreal iron
#

Thatโ€™s more than enough user data they should have access too tbh

#

But I guess Iโ€™m forced to verify if I donโ€™t wanna leave active guilds actually using the bot notlikenoot

opal plank
#

you've heard of coding in notepad
you've heard of coding on mobile
but i bet you've never heard of coding a discord bot in discord with eval()

boreal iron
#

It doesnโ€™t need any intents but Iโ€™m still limited to 75 servers
It already is dynamic as I said above removing "itself" from not used or too small guilds

#

lmao

opal plank
#

ure not limited to 75

#

u limited to 100

#

75 unless you dont want intents

#

which idk why you wouldnt

#

just turn them off in the gateway identify

#

rather than the portal

boreal iron
#

They are off and I donโ€™t need them

opal plank
#

then whats the matter

boreal iron
#

Well than 100 ... doesnโ€™t really matter

opal plank
#

it should take just a week to verify

#

is ur bot blowing that much?

boreal iron
#

Nope itโ€™s not thatโ€™s not the issue, I just donโ€™t like sharing personal data to companies like Discord

#

Itโ€™s already enough what Iโ€™m providing in here okeh

opal plank
#

oh, fair enough

#

11h coding spree tho

quartz kindle
#

why

opal plank
#

and its still not finished

#

wdym why

#

cuz im a NEET, i can stay up for a couple days coding

quartz kindle
#

why you torture yourself

#

i cant code for more than a couple hours straight, i get tired

opal plank
#

same reason why you bother working with discord.js

#

its shit, but has to be done

quartz kindle
#

but i dont do it 11 hours straight

#

:^)

opal plank
#

hasnt been one day either

#

average of 9h a day

quartz kindle
#

i wish i had that much energy and willpower

#

i would be rich by now

opal plank
#

starvation is a good motivator to work

quartz kindle
#

i guess im not poor enough

opal plank
#

just be poorer

#

duh

quartz kindle
#

xd

cinder patio
#

What syntax do you prefer to annotate that a variable is mutable:

let mut varName = value; // For mutable
let varName = value; // For immutable

or

let varName = value; // For mutable
const varName = value; // For immutable
quartz kindle
#

i'll just invest all my money on a shitcoin

boreal iron
opal plank
#

give it to me then

#

at least one of us wont starve

quartz kindle
opal plank
opal plank
quartz kindle
#

but i've never used a language where you have to specify mutability with a second keyword

opal plank
#

mostly when its compiling

quartz kindle
#

so im biased

opal plank
#

starting the bot takes a minute or two

#

tis enough time to reply to people

boreal iron
#

Oh I forgot to mention the empty bottle you will need for things, you know what KEKW

opal plank
#

the only empty bottles i have are the vodka ones i chugged

#

and theres quite a few of them

#

coding buzzed is a bliss

#

less thinking and more anger

boreal iron
opal plank
#

i was always the drunk developer here though

boreal iron
crystal pivot
#

Hi there

latent heron
#

@green kestrel are interfaces required in sep. files with PSR-4?

#

i've always done interfaces in OOP for coding practices but not sure if it's honestly needed

viscid thistle
#

anyone knows why writting to a text file in batch writes the previous string instead of the current one?

earnest phoenix
opal plank
viscid thistle
#

ight

#
set /p id="Enter your ID: "
if %id% == "" (
    echo Login failed. Your input is blank :/
) else (
    echo %id% > config.txt
    echo Login saved.
)
#

when I run the batch file it writes what I inputed the last time

#

I have no idea why :/

opal plank
#

actually thank you for reminding me

#

is there a way to run input from the vsc debugger window?

#

readline , but here

#

use-case: bot is offline, i want to run evals in it, but the process is still running

#

could do with a browser, but i wanna see how to do it here

#

and now we ping the person who's most likely to know the answer

#

@quartz kindle you got a customer

viscid thistle
#

too of them

#

I was first

quartz kindle
#

Lol

quartz kindle
# opal plank

idk the answer to that, not sure if its possible, if it is, you would have to keep it always on

opal plank
#

well i can always use the inspect port

quartz kindle
#

to attach a debugger midprocess would require something from the nside

opal plank
#

to attach the debugger

quartz kindle
#

the easiest way i can think of would be to use some socket messaging that evals stuff

opal plank
quartz kindle
#

or even a web api

opal plank
#

vsc already has an attach debug option

quartz kindle
#

but its attaches at the start

opal plank
#

nope

#

you can do midway

#

i do that in production

quartz kindle
#

not sure if you can randomly attach/detatch it

opal plank
#

you can

#

i do it for my production

quartz kindle
#

then use that

opal plank
#

well, i can, but the part idk how to work with is the readline

#

since its a debugger, not a console

#

the debugger runs actual code

quartz kindle
#

connect it to chrome dev tools i guess

opal plank
#

frick

boreal iron
#

when I run the batch file it writes what I inputed the last time
what does that mean?

viscid thistle
boreal iron
#

If you wanna append the text to the file you can't go with >

viscid thistle
#

I dont want to append

#

I tried it anyway

boreal iron
#

I dont want to append

#

What do you wanna do instead?

quartz kindle
#

i feel like you didnt show all the code

boreal iron
#

It is all the code

quartz kindle
#

you said "the last thing you wrote", your code its only showing one input

viscid thistle
#

the last time I ran it

#

and wrote in the input

#

it always writes my last input instead of the one I write

quartz kindle
#

isnt %% an env variable?

boreal iron
#

yes

#

it's also a var

viscid thistle
#

should it be %id ?

boreal iron
#

in batch

sage bobcat
#

One message removed from a suspended account.

viscid thistle
#

no it shouldn't

viscid thistle
#

doesn't matter

sage bobcat
#

One message removed from a suspended account.

umbral zealot
#

pm2, forever, and nodemon, are 3 very excellent modules for managing processes like nodejs apps, without requiring a batch file and especially without needing an open command prompt at all times to run them.

viscid thistle
#

but I want an open cmd

#

thats the point

#

the batch file is just a part of the cli

#

the rest if handled in python

boreal iron
#
@echo off

SET /p id="Enter your ID: "

if [%id%] == [] (
    echo Login failed. Your input is blank :/
) else (
    echo %id% > test.txt
    echo Login saved.
)

pause
#

got no issue

viscid thistle
#

thats not what I did bruh

boreal iron
#

can enter whatever I want the next time

viscid thistle
#

try writing to a file

boreal iron
#

same result just changed it bc of recording the window

viscid thistle
#

its not the same for me

boreal iron
#

You mean the batch isn't overwriting the text file?

viscid thistle
#

its not writting the correct data

boreal iron
#

If so just check if the file exists and remove it

viscid thistle
#

its writting something from the past

boreal iron
#

wut... that makes no sense

viscid thistle
#

ikr

#

even when I delete the file

#

still

boreal iron
#

record it, never heard or have seen something like that

quartz kindle
#

works fine for me?

viscid thistle
#

wait

earnest phoenix
#

property role.edit js v11

quartz kindle
#

i just ran the code twice, and the file was correctly replaced

earnest phoenix
#

pls

boreal iron
# viscid thistle ikr

Try

@echo off

SET /p "id=Enter your ID: "

if [%id%] == [] (
    echo Login failed. Your input is blank :/
) else (
    echo %id% > test.txt
    echo Login saved.
)

pause
viscid thistle
#

ok

boreal iron
#

It's an issue with the scope of the var as I read

dark lagoon
#

so i'm trying to figure out why my command line is throwing me an error, and i guess i can't really explain it because i'm new to coding a discord bot
i can send you the error in dms or here if need be

earnest phoenix
#

property role.edit js v11

#

pls

quartz kindle
dark lagoon
#

Error: Cannot find module './discordbot.js'
Require stack:

  • /home/spaceguy/discord-bot/commands/commands.js
  • /home/spaceguy/discord-bot/discordbot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
    at Function.Module._load (node:internal/modules/cjs/loader:774:27)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/home/spaceguy/discord-bot/commands/commands.js:3:20)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/spaceguy/discord-bot/commands/commands.js',
    '/home/spaceguy/discord-bot/discordbot.js'
    ]
    }
quartz kindle
#

do you have a file called discordbot.js?

dark lagoon
#

yep

quartz kindle
#

where are you requiring it from?

#

if you want to require discordbot.js from inside commands.js you need ../ not ./

dark lagoon
#

oh

#

lemme try that

quartz kindle
#

./ means current folder

#

../ means previous folder

boreal iron
viscid thistle
#

wha

boreal iron
#

setlocal EnableDelayedExpansion

#

guess no

#

it's ok if not

viscid thistle
#

no

#

I dont

earnest phoenix
#
 message.channel.editRole({
                 ^
TypeError: message.channel.editRole is not a function
boreal iron
viscid thistle
#

I just realized something

#

when I use it with the rest of the code

#

that happens

green kestrel
latent heron
#

searched it up earlier, apparently everything has to be separate

clear marlin
viscid thistle
clear marlin
viscid thistle
#

and before yall say anything, I use this for myself

lusty quest
umbral zealot
#

true. pm2 is much better. But I like giving unbiased options.

stiff lynx
#

for the bot verification, the bot must be in 100 servers?

viscid thistle
#

75

umbral zealot
#

No. 76, actually.

#

"over 75" = 76.

stiff lynx
#

76 Is a big Number, Actually my bot Is in 4

viscid thistle
#

but tbh having to verify it sucks

#

no more intents

#

unless you have a good reason for them

stiff lynx
#

but the numbers of members matter in the verification? I know that I cant create servers for get the verification, but a server with 10 members for example Is counted?

stiff lynx
viscid thistle
#

bruh

viscid thistle
#

just dont rush it

#

enjoy while you can

stiff lynx
viscid thistle
#

because you have intents!

viscid thistle
#

ok

stiff lynx
viscid thistle
#

..

#

nvm

boreal iron
#

Change >> to >

viscid thistle
#

it was like that already

#

but if you mean yours ok

fading badger
# stiff lynx what are intents?

Intents are maintaining a stateful application can be difficult when it comes to the amount of data you're expected to process, especially at scale. Gateway Intents are a system to help you lower that computational burden. Some of these gateway intents are defined as "Privileged" due to the sensitive nature of the data they grant, and access can be enabled below.

boreal iron
viscid thistle
#

ye ok

fading badger
#

Presence Intents - If your bot tracks presence data, you may need the presence intent to receive presence event data.

Server Member Intents - If your bot tracks server members or downloads the entire member list, you may need the server members intent to receive member events and the member list.

stiff lynx
#

so all this intents are connected to the data that I collect from servers?

viscid thistle
#

@boreal iron it worked! thanks a lot

boreal iron
#

alright, np

stiff lynx
#

the difference between a verified bot and a bit verified one Is only this intents thing?

viscid thistle
#

no exactly

stiff lynx
#

a website where I can find this or someone that wants to explain?

viscid thistle
#

verified bot tag, unverified cant join more than 100 servers

fading badger
viscid thistle
#

yep

stiff lynx
viscid thistle
#

you probably dont need them if you dont even know what they are

fading badger
latent heron
#

is this a bad thing to do?

finally { return; }
#

feels a little wrong but im used to doing it so ยฏ_(ใƒ„)_/ยฏ

cinder patio
#

is that js? or php

quartz kindle
#

i mean

#

it should implicitly return anyway

#

so thats kinda redundant

latent heron
#

it's php

#

they force you to write finally if you use try

quartz kindle
#

wut

#

since when

latent heron
#

php 8.0.3

#

that's what i'm currently using

#

i mean yes it states catch there too, but in other OOP langs they don't force you to use either of the two if you use try

quartz kindle
#

oh

#

they do lol

#

i thought you had both catch and finally

#

one of them is required in most langs

#

people usually do try { something() } catch(e) { /* no-op */ }

frigid mountain
#

What does this mean

boreal iron
#

well at least PHP 8 allows to drop the exception capture

#

not that you would always need it

latent heron
#

yeah

quartz kindle
#

ye, js also allows an empty catch since node v12

boreal iron
#

I generally like the changes in 8 tho

latent heron
quartz kindle
#

the thing

#

is

#

try finally will not catch the error

#

so isnt the try redundant there?

latent heron
#

im not catching any errors

quartz kindle
#

then why the try?

latent heron
#

im passing exceptions but their custom exceptions

#

which handle the logic in different files

quartz kindle
#

i mean

latent heron
#

i mean i can add a catch if i want but the other files literally do that for mew

quartz kindle
#

idk the specifics of php in this case

#

but in js, try finally is basically the same as no try at all

latent heron
#

ill just be honest, php sucks ass at times

quartz kindle
#

any error that happens will bubble up

#

try finally is basically used to run cleanup code after the error, but still throw the error anyway

latent heron
#

yeah so thing of php

#

i think since 7.3 they allowed devs to now build off of the base exception code

#

we can use this for example

#

since this is nothing more than an extension of the exception class now

frigid mountain
#

What does this mean

latent heron
#

i'm already throwing it to begin with

#

and the base exception has a built-in catch state

#

there's no reason for me to write a catch for it at all

boreal iron
latent heron
#

i'm aware

boreal iron
#

just to say

latent heron
#

i already have PHP 8 code written

boreal iron
#

but I'm not sure if that somehow looks more clear than switch

latent heron
#

So far the library is written with PHP 7.3 in mind.

#

I think I spoke with @green kestrel about it but since a good amount of PHP devs are still using 7.3 and haven't moved to 8 yet, there's no reason for me to make the lib 8+ exclusive yet

boreal iron
#

tbh I haven't moved to 8, too

#

just read about the changes a while ago

latent heron
#

yeah

#

so while the finally is redundant i dont have any other choice to put it lmao

boreal iron
#

well putting catch() {}

earnest phoenix
#

can somebody help with apache2?

latent heron
#

i don't need to catch anything though pepeHands

boreal iron
#

just ask

latent heron
#

angryrage reeee

earnest phoenix
#
<VirtualHost *:80>
    ServerName mydomain.com
    ProxyPreserveHost  On
    ProxyPass /  https://ip:25568/ retry=0
    ProxyPassReverse /  https://ip:25568/
</VirtualHost>
<VirtualHost *:443>
  ServerName mydomain.com
  ProxyPreserveHost  On
  ProxyPass /  https://ip:25568/ retry=0
  ProxyPassReverse /  https://ip:25568/
  SSLEngine on
  SSLCertificateFile /etc/letsencrypt/live/mydomain.com/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
</VirtualHost>

which line i missing for force https?

#

since atm if i go to my domain it does not redirect to https

slender thistle
opal plank
boreal iron
#

For example:

<VirtualHost *:80>

    ServerName www.evilshit.hate
    ServerAlias evilshit.hate

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
    
</VirtualHost>
earnest phoenix
boreal iron
#

doesn't make if your virtualhost listens to port 80 <VirtualHost *:80>

earnest phoenix
deft peak
#

ๆฉŸๆขฐไบบๅฆ‚ไฝ•็”จ๏ผŸ

boreal iron
#

If your webserver listens to port 25568 then tell the virtualhost to do as well

#

httpd.conf Listen 25568

#

<VirtualHost *:25568>

#

Make sure to add/edit the firewall rules

earnest phoenix
#

will it work firster then rewrite rules?

boreal iron
#

of course, lol creating internal proxies between 1 machine is ... idk weird and useless

#

You can even put anything into one virtualhost

#

For example:

<VirtualHost *:25568 *:443>

    ServerName www.evilshit.hate
    ServerAlias evilshit.hate

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/mydomain.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem

   DocumentRoot "${WWWROOT}/evilshit.hate"

   ...
    
</VirtualHost>
earnest phoenix
#

i don't use file it is a express app

deft peak
#

ๅฆ‚ไฝ•ๆ•ด๏ผŸ

umbral zealot
#

oh god for a second there I thought the domain was "evieshit" kekface

pale vessel
#

same

rose warren
#

I've checked my code but can't figure out which command or line this is coming from. Any way to trace it to a specific line in the code?

(node:7093) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
     at RequestHandler.execute (/root/bot/source/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
     at runMicrotasks (<anonymous>)
     at processTicksAndRejections (internal/process/task_queues.js:97:5)
     at async RequestHandler.push (/root/bot/source/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
 (node:7093) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)
boreal iron
boreal iron
earnest phoenix
boreal iron
#

create a function which handels them and log the line and file where it happens

sharp ledge
#

btw my current bot not require presence intent and server member intent

without verification, can my bot add more than 100 servers?
or should my bot leave a server which has less member when bot reach 100 servers?

latent heron
#

@slender thistle wanna see why i hate php?

boreal iron
#

SHH

boreal iron
opal plank
boreal iron
#

<VirtualHost 12.34.56.78:25568 *:443>

latent heron
#

stupid errors

boreal iron
#

will listen to that one only

latent heron
#

because if i do get rid of them

earnest phoenix
#

but the domain is linked to the server ip how would it know the ip?

latent heron
#

you go

#

"oh you need to make the class as abstract" right?

#

SIKE WRONG

#

I SWEAR TO GOD

#

WHY IS PHP SO INCONSISTENT

#

IM GONNA LOSE IT

cinder patio
#

why are you using pgp

#

php

latent heron
#

because i code php

cinder patio
#

but why

boreal iron
clear marlin
sharp ledge
boreal iron
earnest phoenix
#

okay thx

boreal iron
#

I mean I'm not familiar with express but try and and see I guess

earnest phoenix
clear marlin
#

basically translating it into simple language, you're trying to edit the role of the channel lol

#

channels have no roles

quartz kindle
#

they probably want a permission overwrite for a role

#

channel.updateOverwrite(roleid, {SEND_MESSAGES: false})

heady lichen
#

discord.js

umbral zealot
#

Don't put event handlers inside of other event handlers or functions, thanks

heady lichen
#

Ahh

#

Ohhh

#

Yeaaa

quartz kindle
#

lel

heady lichen
#

How to export var from inside the function

umbral zealot
#

You... do'nt

heady lichen
#

Ahh kinda new to this

umbral zealot
#

What are you even trying to do here

heady lichen
#

Yt sub count channel

umbral zealot
#

uhhhhh

heady lichen
#

How to make it global actualy

umbral zealot
#

you... just need to set the status of the bot here

#

nothing else

#

I mean it's clear to me you're just mashing codes together with zero clue what you're doing here.

heady lichen
#

Yes

umbral zealot
heady lichen
#

Ahh

#

Noo

#

Okayy

umbral zealot
#

yes. you need to learn the language instead of just shoveling code together. please.

umbral zealot
#

I did. Your help is : go learn javascript.

heady lichen
#

Fine

near stratus
#

Anyone know why I'm having this error UnhandledPromiseRejectionWarning: TypeError: (intermediate value).setTitle(...).setURL(...).setThumbnail(...).setDescription(...).addFeilds is not a function ?

umbral zealot
#

addFeilds

#

Just like that famous song, "Feilds of gold"

quartz kindle
#

feilds lmao

near stratus
#

now i know why I was about to fail in inlish lit.

earnest phoenix
#

how can i do it

frigid mountain
#

How do I define this

if (member.user.bot)
umbral zealot
#

"Define"?

#

that's... already defined

#

what do you mean

frigid mountain
umbral zealot
#

ok well you don't have a defined member then

#

what event is this

frigid mountain
umbral zealot
#

ok well you don't have a defined member then
what event is this

frigid mountain
#

What do you mean?

umbral zealot
#

the code

#

where does it run

#

under what event

frigid mountain
# umbral zealot the code

I was trying to run a user-info command then go that error for mod-logs

const roles = ['Moderator']

module.exports = (client) => {
  const channelId = '842412267894210622'

  client.on('message', (message) => {
    const { guild, content, member } = message

    if (member.user.bot) {
      return
    }

    const hasRole = member.roles.cache.find((role) => {
      return roles.includes(role.name)
    })

    if (hasRole) {
      const channel = guild.channels.cache.get(channelId)
      if (channel) {
        channel.send(`<@${member.id}> said this:
      
"${content}"`)
      }
    }
  })
}
umbral zealot
#

jesus christ MarioFP

#

is that supposed to be a command?

#

Don't put an event handler inside another, that doesn't work

#

or it does but it fucks up real fast

earnest phoenix
umbral zealot
#

I... I mean this entire command, you should scrap it

#

To be honest

earnest phoenix
#

client.on and module.exports

slender thistle
umbral zealot
#

copying every single message into another channel breaks privacy laws

earnest phoenix
#

like he/she copied something from everywhere

umbral zealot
#

I mean, maybe, but that's not really that relevant I think

earnest phoenix
#

logging messages hashflushed

umbral zealot
#

Yeah that's my main concern. don't do that.

stiff lynx
#

why?

earnest phoenix
stiff lynx
#

I never Saw this before

crimson vapor
#

@quartz kindle 111 more messages here and you have 69420 pog

quartz kindle
#

im gonna stop being active here when i reach it

#

:^)

crimson vapor
#

sad day but worth it

umbral zealot
#

Then we'll get hat new account, Tim2

slender thistle
#

Tim0.1, Tim0.2a, Tim1.0, Tim6.9, Tim42.0

quartz kindle
#

i could also delete my oldest message here for every new message i send :^)

slender thistle
quartz kindle
#

my old messages are probably super cringe

crimson vapor
#

no

#

that would be heresy

#

deleting tims messages in development

#

thats like

#

idek something as bad as that

solemn latch
#

was looking at all my old messages, coming up on my 1 year here ๐Ÿ‘€

stiff lynx
#
    try{
        profileData = await profileModel.findOne({ userID: message.author.id});
        if(!profileData){
            let profile = await profileModel.create({
                userID: message.author.id,
                serverID: message.guild.id,
                coins:        10              ,
                bank:         0               ,
                tier:         0               ,
                nlavoratori:  1               ,
            });
            profile.save();
        } else {
          let profile = await profileModel.findOneAndUpdate({
            serverID: message.guild.id,
          });
        }
    } catch(err){
        console.log(err)
    }```
Is possible that this code updates only me?
cobalt spruce
#

lol

crimson vapor
#

big brain time

#

what is floor(.9...)

zenith terrace
pale vessel
#

Or an account called timsmart

#

Oh wait

quartz kindle
#

Lol

zenith terrace
#

tims mart

quartz kindle
earnest phoenix
#

can someone help me code my new roblox game?

umbral zealot
#

probably not, no

earnest phoenix
#

dang.

umbral zealot
#

There's probably a number of servers you can find with people that are proficient in Lua and Roblox itself

#

just use server discovery, I'm sure you'll find something!

earnest phoenix
#

alright, thanks.

snow urchin
crimson vapor
#

@quartz kindle I need your preference, is js if (!ctx.args[0]) { await ctx.respond('CURRENT_LANGUAGE') return } or js if (!ctx.args[0]) return await ctx.respond('CURRENT_LANGUAGE') better?

#

@opal plank mr. I would like some help with ts

opal plank
#

return a promise

crimson vapor
#

no not that

#

so basically

opal plank
#

i said second

crimson vapor
#

wait what

#

huh

opal plank
#

u asked which is better

#

second

crimson vapor
#

that was tims question

#

yours is about ts

opal plank
#

go ahead

crimson vapor
#

ok so ive got an object for language stuffs, some values are strings while some are functions ex. http://img.terano.dev/CYqYxBw2
how would I type a function that takes the name and paramaraters to the function. ex. lang('CMD_BLACKLIST_ADDED', '277183033344524288')

#

and it be typed

opal plank
#

make an enum or an object with keyof

quartz kindle
#

without await

crimson vapor
#

nah eslint be mad if I don't await it

quartz kindle
#

it wont

crimson vapor
#

sec

opal plank
#
declare enum MyEnum{
  CMD_BLACKLIST_NAME: 'Blacklist'
}
export type (user: keyof MyEnum) => void 
crimson vapor
#

so I would need to make an enum duplicating the object I already have?

quartz kindle
#

its the opposite

#

eslint doesnt let you do return await

crimson vapor
#

settings I have ig

#

redundant await aside, do I return the promise or void?

#

I dislike the way it looks using the one liner for short files but for files with like 10 checks its stupid to have it be 40 lines

#

imho

quartz kindle
#

i mean

#

if you want the function to return void

#

but you also want to await it

#

then do await X; return;

crimson vapor
#

I just want to know what you would do for looks tbh

quartz kindle
#

you could also return X.then(r => void 0)

crimson vapor
#

ye I could lmao

quartz kindle
#

i would just return the promise

#

and maybe use the .then() variant if i really need it to return void

crimson vapor
#

so you prefer how it looks?

#

alright ive got another question

#

so say I have code like this ```js
const x = await y()

// I could do this
let x;
try {
x = await y()
} catch (e) {
console.error('Handled some error or something')
return
}

// or this
const x = await y()
.catch(() => null)
if (!x) return console.log('Handled some error or something')``` I find the top part makes more sense but find it stupid to deal with using let like that, how do you handle things like this?

quartz kindle
#

depends

#

both of those are doing different things