#development

1 messages ¡ Page 82 of 1

wheat mesa
#

including message content, right?

cobalt spruce
#

Yessir

wheat mesa
#

Add a console.log(message) inside of your messageCreate

#

is your bot even coming online?

cobalt spruce
#
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
  GatewayIntentBits.Guilds,
  GatewayIntentBits.GuildMessages,
  GatewayIntentBits.MessageContent,
  GatewayIntentBits.GuildMembers,
    ]
});

const request = require('request');


client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('message', message => {
  // Only respond to messages that start with "!chatgpt"
  if (message.content.startsWith('!chatgpt')) {
    // Get the message text without the command prefix
    const prompt = message.content.slice('!chatgpt'.length);

    // Send a request to the ChatGPT API
    const options = {
      method: 'POST',
      url: 'https://api.openai.com/v1/chatbot',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${process.env.CHATGPT_API_KEY}`
      },
      body: JSON.stringify({
        'prompt': prompt,
        'model': 'chatbot'
      })
    };

    request(options, function(error, response, body) {
      if (error) throw new Error(error);

      // Send the ChatGPT response back to the channel
      const chatbotResponse = JSON.parse(body).response;
      message.channel.send(chatbotResponse);
    });
  }
});```
#

Current code

wheat mesa
#

oh... you never logged in

cobalt spruce
#

The bot is getting on

#

It's loges

wheat mesa
#

Okay

#

oh

cobalt spruce
#

It's just because the token is there I didn't copy it

wheat mesa
#

you're doing client.on('message')

#

You need client.on('messageCreate', ...)

cobalt spruce
#

Well, I was the problem and I got new one

wheat mesa
#

I think the error is fairly self explanatory no?

cobalt spruce
#

The message isn't empty.

wheat mesa
#

Except it definitely is

#

Log chatbotResponse and tell me what you get

cobalt spruce
#

That's what it log

#

The api key also says never used

cobalt spruce
wheat mesa
#

JSON.parse(body).response makes no sense

#

actually hold on im in the middle of smth

cobalt spruce
wheat mesa
#

I haven't used the request lib

#

I usually use built in node-fetch

#

Log body

#

There is no response prop on it, hence why you're getting undefined

cobalt spruce
#

Url invalid

lunar reef
#

hey guys, just had a general question. if i wanted to start a side hustle, is developing discord bots a decent way to do so? i've never made one, but looking over the docs and checking out the ecosystem, it seems pretty cool. i'm a fulltime dev just looking to do something for fun and still get paid 😅

cobalt spruce
lament rock
#

I'm lucky to have 1 consistent backer

lunar reef
#

ah good to know

lament rock
#

even then, I'm still doing this at a huge loss

#

and this has been going on for like 5 years

lunar reef
#

i've seen a bunch of posts about people paying money for discord bots on reddit, and it's something i've never explored so i decided to ask you guys, in your nest 😄

#

it still seems fun, though. i might give it a try.

lament rock
#

maybe some commissions would be nice to do, but a lot of devs can just churn out trash like nothing

wheat mesa
#

Definitely not a good way to make money

#

It's inconsistent and many people use discord bots simply because they're free in the first place

lunar reef
#

i'm currently switching stacks to elixir and phoenix, so it might be a good exercise to create some kind of open source discord library with elixir

#

just as a fun project

lament rock
#

might alr exist and lib creation is a nightmare

#

if you aren't dedicated to maintenance, do not make a lib

lunar reef
lament rock
#

You can do like a one off thing just to get used to the low level api, but I can tell you that even a simple wrapper is a nightmare to maintain

lunar reef
#

yeah, sounds like it

#

thanks for the advice 😉

#

i think if it's something i can't monetize easily, i might as well do something 100% for my own fun instead

#

e.g. nothing to do with discord bots ha

lament rock
#

I make a music bot for the hell of it. Audio related stuff is kinda getting deep in demand

#

Discord and YT cracking down on music bots

lunar reef
#

i don't really use discord, what does a 'music bot' do?

#

take song input and play the song?

lament rock
#

play music in a voice channel

lyric mountain
#

Music bots have to dedicate 100% of the resources to it

lament rock
#

One could take in data from many sources like yt, or soundcloud or spotify (just yt but scraping metadata), and some other less than popular options

#

Most of what I do to add new sources is scraping web pages

#

a lot of places dont have an api in place

lunar reef
#

sounds boring tbh

#

aren't scrapers a pain to maintain on big sites like youtube?

#

there's a new deploy like every day

lament rock
#

they are a pain, but changes have been super slow recently so little updates required

#

and you could get away with using already maintained stuff like ytdlp

#

unless you're super dedicated to native to lang solutions

#

which is what I'm working on

rustic nova
#

yo @neon leaf one thing that actually pisses me off

#

I dont get what the mailcrow hostname is supposed to be

#

mailcow*

atomic sun
#

Whats the best sql server out there for a discordjs bot?

wheat mesa
#

Postgresql is pretty nice

sudden geyser
#

default to sqlite

wheat mesa
#

All depends on your needs

atomic sun
#

Ahh whats the difference btwn postgresql and sqlite? Sorry new to sql 😅

sudden geyser
#

They're both SQL databases, but Postgres is used in larger environments, while SQLite is usually used in smaller environments.

#

The main difference being that Postgres uses a client/server model while SQLite is embedded.

#

Client/server meaning that your app acts as a user and talks to your database elsewhere, while embedded means that your database logic is sort of inside your app (bot)

#

Note that your database is not literally in your app when embedded, it's just closer to you.

#

I personally think that embedded databases, especially for Discord bots (since they're usually small), are a much better choice

atomic sun
#

ah i see. Is the database in sqlite visible? as in is there anyway we can view it with our own eyes?

sudden geyser
#

It'd be a file on disk, but you'd query (i.e. get data from) it with SQL.

atomic sun
#

ah i seee..thanks for info!

lyric mountain
#

Sqlite is for when need a fast and straightforward storage

#

It'd be akin to an SUV

#

Postgres is a huge complete toolset included inside a rich and fast database structure

#

It'd be akin to a truck with turbo

lament rock
#

sqlite doesnt work for multi process data access

sudden geyser
#

I'm pretty sure it does, though it's restricted to a single writer

lament rock
#

thats what I mean

#

Reads are fine since no locks

neon leaf
sharp geyser
#

So say I have a domain that I want to have subdomains point to specific rust servers. Would I just make a nginx config for it and have it proxy_pass to my server's ip+port

#

so like

server {
  listen somePort
  server_name 2x.horizon-rust.store
  
  location / {
    proxy_pass gameServersIP:port
  }
}

or does proxy_pass have to be a http(s) thing

neon leaf
#

well yeah nginx is a web server

#

your goal can be achieved by changing the game port

sharp geyser
#

oh?

lament rock
#

You shouldn't be having nginx redirect a client if it's on another machine. sub domains under nginx only makes sense if it's on the same machine in which case, proxy passing it to a local port is what to do based on subdomain. Otherwise, your DNS should just point to another ip

neon leaf
#

If you want to host multiple rust servers on default port just buy multiple ips

sharp geyser
#

I have multiple

neon leaf
#

then use em

sharp geyser
#

yes...but..the domain will be the same

neon leaf
#

no

sharp geyser
#

Im not buying multiple domains for the servers?

#

The servers will all be named the same just different versions, one will be 2x, one vanilla, etc

neon leaf
#

for each rust server you add a A record with the ip its on

#

done, I cant access 2x from 1x that way

sharp geyser
#

yea, I tried that

neon leaf
#

since you probably didnt bind the servers to ips

#

just 0.0.0.0

lament rock
#

ping amanda.moe
then ping beta.amanda.moe
They're on different servers with nginx installed.

But I also have a http only bot which I have Discord post interactions to on amanda.moe just under a different path. Subdomain would be the same concept

sharp geyser
#

I did bind the servers to ips

neon leaf
#

well then it would work

#

since it does for me

sharp geyser
#

I realize the issue now

#

Whenever i add numbers to the subdomain cloudflare ignores everything after the .

lament rock
#

shouldn't the dns entry just be the subdomain name and not the full address

neon leaf
#

indeed

sharp geyser
#

really?

neon leaf
#

yes

lament rock
#

Your * record should be the domain name

#

Then A is for subdomains and just the subdomain. In my example, it's just beta

#

or was it CNAME

#

whatever

#

I'm tired. Have fun

sharp geyser
#

I think it is a CNAME

#

So then something like this?

neon leaf
#

try it out ¯_(ツ)_/¯

sharp geyser
#

I am

lament rock
sharp geyser
#

yep that works

#

Thanks guys

lament rock
neon leaf
#

what are the numbers behind a , called again?

lament rock
#

example

neon leaf
#

10,5% discount

lament rock
#

decimal? Also, that's a regional formatting for EU

neon leaf
#

thanks

lament rock
#

Ah bio says german. Makes sense. US uses .

sharp geyser
#

ye

bright thorn
#

i am unable to create a index in mongo db with the same user id

deft wolf
#

You are most likely trying to create two documents with the same _id, right?

bright thorn
#

yes

#

in music bot with the same user id but with diffreent playlist name

deft wolf
#

_id It is unique to every document and should not be overwrited

bright thorn
#

but mongo db say's we can't create another one with same user id

bright thorn
#

so mongo will have to build it as with unique id

deft wolf
#

Okay, just send a screenshot or your schema code

#

It will be easier

bright thorn
deft wolf
#

That should work

#

Except that "E" after false

bright thorn
#

it typo

deft wolf
#

Have you tried to set a default value for userId?

#

And then check if this error occurs?

bright thorn
#

why we need default value for a useriD

deft wolf
deft wolf
rustic nova
flat copper
#

i have an input tag for multiple files

and i want to upload it to multer

my code:

let data = new FormData()
data.append("images", $(".input").prop("files"))

fetch("/post", { method: "POST", body: data})
in post.js
parser.array("images")

why its not working?

eternal osprey
#

Is anyone here well known with the challenge response authentication protocol?

#

if yes, the client would put the challenge in a mac function right, and send it over to the server (that only checks whether the hash is equal to its own crested one). Couldn’t we then as an attacker try to intercept this message and just send it later on so that WE instead of the actual client gets authenticated?

sharp geyser
lyric mountain
#

If I wasn't at mobile data I'd send a meme here

sharp geyser
#

lmao

#

Love how this is still a thing

#

Just made the bot application and can't even see the token

#

For security purposes, tokens can only be viewed once, when created. If you forgot or lost access to your token, please regenerate a new one.
yes but where is it 😔

wheat mesa
#

you only get to see it once

#

when it's generatede

#

reset it if you can't find it

#

and then put it somewhere safe

flat copper
#

The pics were not being stored

slender wagon
#

but when i do it it opens a cmd and then closes it immediatly

wheat mesa
#

did you download the correct release for your arch

#

actually nvm

#

Do you have the correct .NET version installed on your computer for running the release you downloaded?

slender wagon
#

my dotnet versions are becoming like mush potato

wheat mesa
#

keep in mind you may need to run it directly in the terminal as opposed to opening it

slender wagon
#

even if i am using windows?

wheat mesa
#

Yes

#

I'm using windows

slender wagon
#

why that terminal looking out of this world

wheat mesa
#

using a custom terminal for colors and font

slender wagon
#

ohh

#

right

#

lol

wheat mesa
#

starship

slender wagon
#

pro hecker

wheat mesa
#

eh I just like the way it looks

#

it's not meant to be used in the default command line

slender wagon
#

ok so it works now

#

earlier i was running the .exe by doubleclicking

#

(i also installed another sdk)

#

so one of them did the job

wheat mesa
#

it closes for me when I double click it

#

so it's meant to be used in the terminal

wheat mesa
slender wagon
#

and choose the il2cpp executable file

so as i am reading this github repo it says i shall run the il2cpp executable file?
like this thing is confusing me besides the metadata file that ik what to do with

slender wagon
#

i lose focus quickly

wheat mesa
#

I just have it set up like that

slender wagon
#

im like a moth

wheat mesa
#

you can change it to whatever you like

earnest phoenix
#

only use this if you are willing to learn whatever this shit is

wheat mesa
#

that's pretty basic

#

just bytecode ops

#

the actual compilation process of python -> bytecode is more interesting than the bytecode itself

earnest phoenix
#

to put it lightly

#

abhorrent

wheat mesa
#

to be fair nobody writes raw bytecode for a reason

#

it's just meant to be an efficient format to compile code to

earnest phoenix
#

it's just that the reason is stupid

#

it's more of a fun toy than an actual project anyways so who cares

ancient nova
#

what feature can i add to get the presence intent

#

my bot can't get past 100 servers

#

i got denied presence intent for one of the best features i ever came up with and i got no more ideas 🗿

sudden geyser
#

what was the feature

ancient nova
# sudden geyser what was the feature

The use is within our anti-raid system. It is detecting unusual patterns in presence. every form of "detection" adds a suspicious point, if it goes over certain treshold of points the user will be suspected of self botting by our bot. if the owner allows it, that will also be logged by our bot and moderators are notified. Such point of detection can for example be; staying online while no activity is being detected. having multiple presences eg. browser and desktop presence, "browser" obviously being the instance of the self bot.

#

bad copy paste but it explains the feature that i made

lyric mountain
#

That again

#

Why do u insist on getting an intent u clearly don't need?

sudden geyser
#

is this a clone of the guy waffle was talking about

lyric mountain
#

No, that's bae

wheat mesa
#

And might catch like 5 people out of 20 thousand

lyric mountain
#

They got denied when they tried to get presence intent without a good reason

#

Since then bae's been trying to find a good escape goat to get it

wheat mesa
#

Lmao

#

I don’t think they’re ever going to give it to you knowing that’s what you’re using it for

#

Because it definitely sounds to me exactly like what they want to prevent with the whole intent system

lyric mountain
#

And they're back calling the antispam/nuke an antiraid feature

sudden geyser
#

Really Discord just doesn't want to give the intent to anyone unless they absolutely need it

wheat mesa
#

There are VERY few reasons that you would absolutely need presence data

#

It’s very sensitive data

#

And therefore they’re very protective of it

ancient nova
ancient nova
ancient nova
#

and some backend stuff too

lyric mountain
wheat mesa
#

Yeah

lyric mountain
#

If it was possible discord would've done it already

ancient nova
#

yeah that's why i use a treshold system

wheat mesa
#

You’re also sending data to server owners about accounts that did not necessarily consent to have that data shared

ancient nova
#

the more detection points the higher the chance of self botting

#

goes from 0% to 100%

#

at around 10 different ways of detecting the self bot so far

wheat mesa
ancient nova
#

just saying something along the lines of "hey watch out! (user) may be self botting"

#

probably should've said that in the application ...

wheat mesa
#

I don’t see how you need presence data for that. It just sounds very very very unreliable

lyric mountain
#

Mind to give an example of what'd be detected as selfbotting?

ancient nova
#

for example staying online with no activity or being online on multiple platforms eg. desktop and browser

#

those two would account as around 25% to self botting, if it gets past 70% the bot sends a notification to the owners

spark flint
#

staying online with no activity

wheat mesa
#

Lmfao

spark flint
#

most of discord's users

ancient nova
#

yeah that's just one of the ways detections

wheat mesa
#

Dude, I’m on mobile and desktop right now. I have it open on my computer

#

You see how problematic that is?

ancient nova
#

well that would not give any point

#

only browser activity can count as a self bot

#

and not many users use browser anymore

wheat mesa
#

And some people are on mobile and browser

#

Yes they do

#

A lot of people do

ancient nova
#

less than they use desktop that is for sure

wheat mesa
#

Probably not

#

Not everyone is a hardcore discord user

ancient nova
#

well true

wheat mesa
#

And not everybody has a computer with enough resources to run discord on their native application

ancient nova
#

but that is only one way i detect it, if someone does that it won't automatically send notification to the owners

wheat mesa
#

Nor does everybody want to

ancient nova
#

it would have to add to more than 70%

wheat mesa
#

Again I’m saying that’s unreliable

ancient nova
#

that by itself would be around 1/10th so 10%

wheat mesa
#

I think that detecting self bots is not something you can do

#

Otherwise like @lyric mountain said, discord would already be doing this

ancient nova
#

and owners can check peoples % by using a specific command

#

probably not

wheat mesa
#

“Probably not” - a single dev with access to way less data and resources than an entire multi billion dollar company

ancient nova
#

well that is why i'm saying probably

#

its less likely because i haven't seen anyone really get banned for self botting

#

or they do and just don't care lol

wheat mesa
#

And yet that makes you qualified on the methods used to detect them..?

#

They ban them before you see them most likely

ancient nova
wheat mesa
#

I think that it’s not fair to assign arbitrary probability values to people based off of data that you just randomly decide makes them to be a selfbot

#

Hence why your request was denied

#

It’s not necessary

#

You just decided it was correlated

ancient nova
#

i mean it's not random, all of the data gatheted together makes quite a good argument for self botting, that's a kind of algorithm

ancient nova
#

person with no activity and staying online on both mobile and browser has a higher chance of self botting and person with activity and only mobile even if just by that 1 or 2%

sudden geyser
#

that's how any system works

ancient nova
lyric mountain
#

I imagine you'll also be flooded with false positives on servers with minigames

#

Since people tend to spam the hell out of it for credits

wheat mesa
#

He is just giving random values to it with absolutely no reliable data other than “I said so”

ancient nova
sudden geyser
#

well they're clearly not random

wheat mesa
#

He made it up

sudden geyser
#

it doesn't look like it

ancient nova
#

i don't understand your point

wheat mesa
#

You’re telling me that 1 in 10 discord users that use their phone and have their browser discord open at the same time are self bots? That’s clearly incorrect and unreliable

lyric mountain
#

Waffle means your severity metrics aren't really solid enough

ancient nova
#

no, again, those detections will account to around 25%, u need at least 70% to get a detection

sudden geyser
#

Then it's, at worst, unreliable; not made up.

lyric mountain
#

Like, for such types of detection you usually need a metric of how likely an action is from a selfbot

wheat mesa
#

And what makes you think that presence data correlates with selfbotting? Do users that just don’t set statuses selfbot?

#

It’s not just unreliable it is completely unreliable

sudden geyser
#

that's the same thing

lyric mountain
#

Ye, u don't need presences for detection

ancient nova
lyric mountain
#

Online status doesn't mean anything

wheat mesa
#

I don’t think you’re going to convince discord to give you access to sensitive data with this system

lyric mountain
#

Selfbots also can use offline status

#

And mobile, while at that

ancient nova
#

i also watch for users sending embeds in chats

digital swan
#

I don’t get why you’re arguing about it. Discord already said no and I highly doubt they would change their mind

wheat mesa
#

Okay that’s the only legitimate thing I’ve seen so far

lyric mountain
#

THAT's a solid proof

#

But the only one too

ancient nova
wheat mesa
#

That has nothing to do with your original complaint; getting presence data

#

That’s what this is about

lyric mountain
#

Like, for detecting a selfbot u need to watch for bot-exclusive features

ancient nova
#

yeah presence is a part of the detection

lyric mountain
#

Like embeds

ancient nova
#

the system itself is larger

#

than that

wheat mesa
#

Okay then why do you need presence data that is so clearly unreliable

ancient nova
#

just proving its actual data and not made up

wheat mesa
#

The rest should be enough

ancient nova
#

plus i also use it for other things, such as afk statuses, and game commands

lyric mountain
#

Depends

ancient nova
#

like hangman

lyric mountain
#

There's actually a quote from sun tzu abt that

wheat mesa
#

Ok then while you’re at it why not have my credit card number, SSN, address, phone number, email, and all of my personal data so you can determine if I’m a real person or not

lyric mountain
#

"Even worse than no information, is wrong information"

#

I think

#

Been some time since I read art of war

ancient nova
wheat mesa
#

and you do not need the presence data because it is sensitive on a user to user basis and completely useless for your intended purposes

ancient nova
#

nobody cares if their presence is being checked or not, its literally visible if u click their profile and if it really bothers anyone they can dm me and i'll blacklist them from my bot

wheat mesa
#

Yes they do

#

Automated systems can determine a lot about you based on your presence. Not everyone is assuming there’s a bot monitoring their status 24/7/365

lyric mountain
ancient nova
#

no, other detections will still work

#

i will blacklist u from presence detection

lyric mountain
#

Then u don't need presences if it works without it

ancient nova
#

it works better with them

#

i think presence is around 40% of the overall self bot detection

#

so without it it would never even go past 70%

#

would never trigger a detection

wheat mesa
#

Then it’s a bad system based on what you’re telling me

lyric mountain
#

So by ignoring my selfbot I'd have 40% more chance to pass undetected?

ancient nova
#

its good, it worked before

ancient nova
#

but it was required by discord so i had to do it

#

might change it up some

lyric mountain
#

Discord didn't ask for it

#

U just want it for reasons

ancient nova
#

i read advaith notes on that

wheat mesa
#

Discord is not going to give you permission to have access to very personal and sensitive data at a mass scale just because you have some unfounded ideas about how presence is connected with selfbotting

ancient nova
#

wait why are we even discussing this

wheat mesa
#

Because you wanted presence intent

ancient nova
#

i oeignally came here for a another idea to use the intent

wheat mesa
#

And we’re telling you that discord is extremely unlikely to ever give you that even if you have some other feature that needs it

lyric mountain
#

Well ok, I won't try convincing u how pointless the whole thing is, just know this is basically sisyphus' tale

ancient nova
#

at this point i got so many features that use it

lyric mountain
#

You'll chase ur own tail trying to cover the many holes users will find on it

ancient nova
#

2 big ones and other smaller ones in game commands or user info commands

#

and backend stuff too

wheat mesa
#

Personally if I saw a bot monitoring my presence to see if I’m a selfbot or not then I’d nope the fuck out of that server asap

#

People do not want software monitoring their personal info so closely for such illegitimate purposes

lyric mountain
#

I'm personally curious to see how this will end up

wheat mesa
#

I don’t even see what the point is even if you do see a likely selfbot. They’re going to get caught just the same as the rest of them, they show that they’re obviously selfbotting some way or another

ancient nova
wheat mesa
#

If anything your bot would cause people to receive way more false bans than true bans from server owners trusting your bot too much

lyric mountain
#

Nobody is gaslighting u

#

The thing is that the reason is way too weak to get a privileged intent

#

We've been trying to tell u that for a long time

ancient nova
lyric mountain
#

The only ever time I used presences was to know when people was online for my tamagotchi module

ancient nova
lyric mountain
#

So the pet wouldn't die when people were sleeping

ancient nova
#

and i use that for games like hangman

lyric mountain
#

...how and why

ancient nova
#

if they go offline theu get kicked out kf the game

wheat mesa
#

inb4 bae says “good idea I’ll make that”

ancient nova
#

the hangman games last between 10m to an hour so it was needed

wheat mesa
lyric mountain
#

Ha good luck making a tamagotchi module

ancient nova
lyric mountain
#

Thing is complex af to properly work, part of the reason why I dropped it

ancient nova
lyric mountain
#

Btw, as waffle said, u can go offline during the game without getting offline status

#

There's also the invisible status

ancient nova
#

wot

#

yeah offline/invisible is treated as kicked out of the game

lyric mountain
#

But what if it's someone who always uses invisible?

#

Even when online

ancient nova
#

i had to add that cuz ppl were going offline during games n that game was made for big severs

ancient nova
lyric mountain
#

Wouldn't be more sensible to add a timer?

ancient nova
lyric mountain
#

...how?

ancient nova
#

ppl would be mad that their time ran out, and it was a big commotion, a more simple way was to add lives on wrong guesses

lyric mountain
#

Just add an option to customize timer

#

With 0 being disabled

wheat mesa
#

Why patch a hole in a wall with putty when you can replace the entire wall

lyric mountain
#

Also, if someone took longer than, say, 1 minute to make a play then it's player's fault

#

My tcg uses 3 minutes for WO detection and very few were slow-thinkers

ancient nova
#

that makes ppl mad cuz they have to wait, imagine 10 out of 25 ppl in a row go offline then they have to wait 10 minutes for game to continue

lyric mountain
#

Mostly newbies that didn't read the guide

ancient nova
#

better to detect if they go offline

wheat mesa
#

Then have an option to end the game immediately

lyric mountain
#

Or votekick

wheat mesa
#

Yeah

ancient nova
#

well that would be hella complicated 😭

wheat mesa
#

Not at all but sure

lyric mountain
#

No, that's a proper solution

#

An example to freeze a game in ur current system: I leave my phone with discord open and go take a shower

#

Or go to the market, whatever

ancient nova
#

i would have to intruduce another command that goes into that command its a whole other mess to handle

lyric mountain
#

Or worse, I slept

ancient nova
#

my hangman is activated with a single command and then ppl just put keywords in the chat which make the game work

#

like end skip or guess

lyric mountain
#

I was supposing u had a runtime for interactive games independent from commands

lyric mountain
#

Then how is a votekick too complicated?

ancient nova
#

say a game started and a person has to guess they have to either guess say end or skip

lyric mountain
#

Hangman can't skip, but yeah

ancient nova
#

how would ppl vote kick then? i would have to add a command to do that

lyric mountain
#

Detect players even outside their turns

#

Just dont allow them to make a guess

ancient nova
#

that would be even more mess to handle

lyric mountain
#

Like votekick @somebody

lyric mountain
ancient nova
#

it is a bit of a messy code

#

i would have to change some stuff

lyric mountain
#

Been there, done that, threw it out of the window and rewrote it

ancient nova
#

cuz the way i do it rn it might not work too well

lyric mountain
#

Make it from scratch again

#

Technical debt ain't worth it

ancient nova
ancient nova
lyric mountain
#

Just give up on the intent, u won't get it with legitimate ways

ancient nova
#

u want me to go through that hell again

lyric mountain
ancient nova
ancient nova
lyric mountain
#

My runtime took 4 months for v1 + 1 year of QA and bugfixing

ancient nova
#

i dedicated about 4-6 hours of my day for that 🗿🗿

lyric mountain
#

v2 took around 2 months

ancient nova
#

that must've been really big then

lyric mountain
#

Not much

#

The issue was that I allowed too much technical debt

#

So I was making holes trying to fix others

#

My current runtime is rock solid cuz I learnt from my past mistakes

ancient nova
#

well i might have to do that for a couple of my things

lyric mountain
#

Rewrites are always worth it

ancient nova
#

but no way i'm going to remove presence, i'm too deep in this to stop

#

literally i would have to rewirte 80% of my bot

#

and that bot took me literal years to do

#

from the beginning to every command to every rewrite and to every bugfix ever

lyric mountain
#

I can't really imagine how presences would compose 80% of a bot

#

Don't u have encapsulation?

ancient nova
lyric mountain
#

Actually, what type of coding are u doing? Functional or oop?

ancient nova
#

so about 80% of all the scriptsin the bot have some part in presence

sudden geyser
lyric mountain
ancient nova
lyric mountain
#

...

sudden geyser
#

what language do you use

lyric mountain
#

So the changes would be minimal

wheat mesa
#

He’s using js, he’s definitely not doing traditional OOP

ancient nova
sudden geyser
#

which one is the majority

lyric mountain
#

How in the fuck

ancient nova
#

javascript is the base

sudden geyser
#

then it's oop

lyric mountain
#

Ah wait, ur seeing github metrics

#

Since u said bash

lyric mountain
sudden geyser
#

uploads binary by accident 99% go

lyric mountain
#

And I hate it

ancient nova
#

js is fine

#

why??

sudden geyser
#

most js is not functional today

wheat mesa
#

How are you using C# in this project

ancient nova
wheat mesa
lyric mountain
#

I feel like writing redundant shit without mutability

#

Perhaps I'm just too used to java

ancient nova
#

wdym everything u writr is mutable to some degree

lyric mountain
#

Functional by definition strives for non-mutable values

ancient nova
sudden geyser
#

oop is when let c = new Command(); c.call() c.name

lyric mountain
#

Everything is passed by function calls

sudden geyser
#

functional programming is great

#

fight me

ancient nova
lyric mountain
#

I prefer oop, feels cleaner

ancient nova
#

but that class is accessible and inside it there is functions to get data, edit data, and remove data

lyric mountain
#

Doesn't matter, keyword is class

ancient nova
#

but in it there is also prewritten stuffa

wheat mesa
#

That’s still OOP

ancient nova
#

and functikn which cannot be changed

wheat mesa
#

Wait I’m dumb

#

I thought you said that’s what functional is

#

Ignore me

ancient nova
#

🗿

#

btw i just hit a new PR with my bots uptime

#

month and a half of uptime with no downtime

lyric mountain
#

is it open source?

ancient nova
#

nope

lyric mountain
#

Thought so

ancient nova
#

i don't get the appeal of having open sourced bots tbj

#

tbh

lyric mountain
#

Well for one, u get some perks in certain services

ancient nova
#

technicallt everyone can look at and steal ur hard work

#

it kinda bothers me

#

so i only open source stuff i didn't spend a long time making

lyric mountain
#

The other is that it allows u to ask people to help u fix issues on it, and increase user trust

lyric mountain
#

And even then, nobody would bother to

sudden geyser
#

people do

ancient nova
#

they can, and trust me they would

lyric mountain
#

No they cant, not if u license it

ancient nova
#

i can't even count the times i went on github and steal some of others ppl code 🗿

sudden geyser
#

you think they care about licenses?

ancient nova
lyric mountain
#

Well, if they get famous u can use it as a resource

ancient nova
#

and if their bot is closed source nobody would even know lol

sudden geyser
#

good luck actually enforcing it for a small bot

ancient nova
sudden geyser
#

if it's large then sure if you can bother

ancient nova
#

my bot would probably hit about 1k servers by now

sudden geyser
#

mee6 not about to let their code get exposed

ancient nova
#

buut obviously discord won't give me the intent

lyric mountain
sudden geyser
#

some people do

lyric mountain
#

Unless u wrote the next billion-dollar code

ancient nova
lyric mountain
#

And what good would it do to them?

ancient nova
#

😳😳

ancient nova
#

making my bot useless

lyric mountain
#

Ever heard of coca-cola?

ancient nova
#

yes

lyric mountain
#

If your bot does something well, you make an image for yourself

ancient nova
#

they don't share their recipe that's why copycats like dr. pepper taste like poop

#

(imo)

lyric mountain
#

Even if others try to copy it, everyone will know yours is tge original

#

Heck if it was so simple I could just clone loritta and get a famous bot

ancient nova
lyric mountain
#

People won't copy a nobody's bot

ancient nova
#

they do

lyric mountain
#

What even is there to steal?

ancient nova
#

idk, my website css, my bots framework, my bots functions or classes, its commands or almost anything tbh

lyric mountain
#

If they clone 1:1 of ur bot they'll get a bunch of unmaintainable code

#

If they try to publish to topgg they'll get denied

#

If they publish on any other list u can recur to the license

ancient nova
#

i still don't see the point

lyric mountain
#

At best it'll be used as a private bot of a 10-member server

ancient nova
#

i don't wanna deal with a bunch of kids stealing my code

lyric mountain
#

That's the thing, u think a bunch of kids would even know what to do with that code?

ancient nova
#

probably

lyric mountain
#

They'll buy a server, setup a database, bother to maintain a whole bot at their own?

ancient nova
#

i mean i sometimes look at other peoples code when making games to see how they did it

#

or see how people did the stuff i did

solemn latch
#

Isn't that a good thing?

lyric mountain
#

That's just taking reference

ancient nova
#

and if they did it better than me i will obviously take the code 🗿

lyric mountain
#

Like reading a cooking book

ancient nova
lyric mountain
#

Or reading an academic research

wheat mesa
#

Unless you’re going to make money off of it or you’ve been contracted by a company and under an NDA or something, I don’t see why open sourcing is an issue

ancient nova
wheat mesa
#

Then you can C&D them

#

If the license prevents commercial use

lyric mountain
#

Not even, why would people use a paid bot if yours is free?

wheat mesa
#

^

ancient nova
wheat mesa
#

Your work is comprised of like 300 different people’s thoughts when you ask for help on things

#

Just saying

lyric mountain
#

And copied code

wheat mesa
#

^

lyric mountain
ancient nova
#

a code which i understand and copied it together myself 🗿

wheat mesa
#

Ah yes because that makes it your work 😉

ancient nova
wheat mesa
#

You know there’s a word for that in English classes… plagiarism C:

solemn latch
#

Which speaking of, you may be expected by some of the licenses of code you copied to make it open source.

Some licenses expect you to make anything you use open source.

lyric mountain
#

Ah, that too lul

#

Fear the GPL

wheat mesa
#

I was going to copy paste a simple vector2 class from someone’s GitHub, then I saw the license and didn’t want to bother with all of that and just made my own

solemn latch
#

You also might not have the license to make profit(and therefore anyone who would copy the bot anyway)

ancient nova
wheat mesa
#

No, but saying that everything you did was your work and yours alone would be a false statement

lyric mountain
#

Anyway my bot is licensed under GPL, it contains an intricate game framework and the entire tcg module

#

I would feel bad for whoever tried to copy it

wheat mesa
#

And that applies to literally every project on the planet

ancient nova
wheat mesa
#

Someone else’s work was used at some point in the process

lyric mountain
#

And the many nights trying to understand how to use it KEKW

wheat mesa
#

Yeah I tried using your repo to understand reflection, it was actually pretty understandable

wheat mesa
#

Java is verbose, but very readable

ancient nova
#

java is one of the languages where u get stuck at first but then it just becomes a part of your life

wheat mesa
#

I love Java

#

It’s the C of OOP languages

ancient nova
#

yeah

#

one of my first games i made in 2018 was in java 😳

lyric mountain
#

The issue is trying to manage the bot itself

wheat mesa
#

Yeah you have a LOT of code in there

lyric mountain
#

Much less now after the rewrite

ancient nova
#

i write my c# like i write my js

#

(very unreadable for people besides myself)

wheat mesa
#

Yeah if it’s anything like that than I would pity whoever has to look at it

#

I hope your formatting is better since visual studio is pretty strict on auto formatting C#

wheat mesa
#

Unless you specifically fight the formatter so you can save 3 lines

lyric mountain
wheat mesa
#

Oh god

#

VSC for C#?????

#

Maniac

lyric mountain
#

Darker times, nowadays I don't write behemoths for helper classes

#

...mostly

ancient nova
#

i'm just built different

#

🗿🗿🗿

lyric mountain
#

Wait, vsc for cs?

wheat mesa
#

Bro you’re just intentionally making developing difficult for yourself

#

At that point

ancient nova
#

that's A LOT of imports dammm

lyric mountain
#

Ah that's normal, intellij prefers individual imports over package imports

ancient nova
#

i am good with vsc

lyric mountain
#

I never write a single import

wheat mesa
#

Also @lyric mountain why did you make it an abstract class instead of just making a private constructor?

ancient nova
#

intelisense installed, formatting done the way i code

wheat mesa
lyric mountain
#

It's all static

wheat mesa
#

I know

ancient nova
wheat mesa
#

But you could make it a private constructor and would function the same

lyric mountain
#

Abstract classes tell the runtime I won't be instantiating it

wheat mesa
#

Ah

ancient nova
#

let me get some screenshots cuz i cba getting on my pc

wheat mesa
#

Some sort of optimization perhaps?

lyric mountain
#

Ig so, but I usually do it out of habit too

#

Abstracts are never instantiated, only extended

wheat mesa
#

I usually prefer private constructor but they both serve the same purpose

#

(In this case)

ancient nova
lyric mountain
#

Probably

#

I wonder what would be the generated bytecode in both cases

wheat mesa
#

Though I do prefer the Java brackets now

ancient nova
lyric mountain
#

Inline brackets ftw

ancient nova
#

i didn't like that it makes the code look messier imo

#

more spread out

wheat mesa
#

Though you do have quite a few explicit type usages when you could just use var for simplicity

#

But again not a terrible practice

ancient nova
#

but if i know what the variable is gonna be whh should i use var tbh

wheat mesa
#

C# prefers type inference when available

#

I also like rust for that reason, everything that can be inferred is inferred

lyric mountain
#

Rust enforces it?

wheat mesa
#

No no

#

Just the way it’s written strays you away from it because it declares variables like typescript

#

let variable_name: TypeName = initializer;

lyric mountain
#

Ah

wheat mesa
#

Since you don’t write the type first often times you’ll just end up letting the compiler infer

ancient nova
#

@wheat mesa u would really hate me for the way i write my js though 😭😭

wheat mesa
#

Rust has really advanced inference too

#

I do hate the way you write js

ancient nova
#

thanks

lyric mountain
#

Lmao sorry bae, but we usually refer to the "bae-o-meter" when people appear here with peculiar code

ancient nova
#

has anyone ever reached my level of code

lyric mountain
#

No, but close

ancient nova
#

dang

lyric mountain
#

A guy that used }; let stuff = ...;

ancient nova
#

people should learn from me

lyric mountain
#

And nier unreadable

ancient nova
#

maybe even more readable

#

anyways i'm gonna go already i'm tired asf

#

gn

#

and happy new year

lyric mountain
#

Cya

spark flint
#

is it possible to delete dms from a bot, djs

lyric mountain
#

technically, yes

#

but it isn't feasible

sudden geyser
#

Can you actually delete DMs? I thought you could only close them.

spark flint
#

was trying to censor a ban DM

#

lmao

lyric mountain
#

Tho actually, it'd not be possible

#

Since u cant delete the other side's messages

#

Nvm then

earnest phoenix
#

the dm will also still be open for the other party, you have no control over that

pulsar maple
#

umm.. is topgg made using scratch

sudden geyser
#

no

pulsar maple
#

wait what

wheat mesa
#

hmm... troll account

#

nice

knotty quartz
# wheat mesa nice

Waffle, I have a Database: sequelize

I am confused as in how to make a blacklist system using this database.

craggy pine
#

Under the assumption you mean like blacklisting a user from using commands you can do this in a multitude of ways.

Lets say you use /blacklist <user> what you could do is insert that data into your database. What I would do is the username and id to make it simple.

Then in the command handler you could code something like.

//fetch user by userid and store it in a variable

if(interaction.user.id === databaseVariable) {
//return whatever you want here.
}
indigo cobalt
spark flint
#

Its someone else who got banned via the bot

spark flint
#

just wanted to know if its possile

indigo cobalt
knotty quartz
craggy pine
indigo cobalt
#

Then fetch the messages and fins the one you want to remove.

#

Then when you do just call the <message>.delete() method.

#

At least it used to be like that.

spark flint
#

I tried fetching the DM channel, nothing gets returned

indigo cobalt
spark flint
#

Yes

#

It is a private moderation bot for a large server so we have all intents enabled

indigo cobalt
#

It returns a promise so it has to be resolved.

spark flint
#

It didn't return anything for the DM channel

#

fetching the user and then doing .DMChannel returned nothing

#

i can't remember the captilisation but i followed the docs

indigo cobalt
#

Have you got the message ID?

#

That you want to get.

spark flint
#

Nope

indigo cobalt
#

You should then cache the user.

#

Then get dmchannel

#

It should return a DMChannel

#

Then inside of it you can check the messages.

maiden gazelle
#

hi does somebody know whats wrong here and can help me with it

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

exports.run = async (bot, message) => {
let embed = new Discord.EmbedBuilder()
       .setDescription(`You can find all the commands in the selection below.`)
        embed.setColor("#2E3192")
    
        const row = new Discord.ActionRowBuilder()
            .addComponents(
                new Discord.SelectMenuBuilder()
                    .setCustomId('select')
                    .setPlaceholder('Nothing selected')
                    .addOptions(
                        {
                            label: 'Select me',
                            description: 'This is a description',
                            value: 'first_option',
                        },
                        {
                            label: 'You can select me too',
                            description: 'This is also a description',
                            value: 'second_option',
                        },
                    ),
            );
    
await interaction.reply({ content: [embed], compontents: [row] });
    exports.help = {
    name: 'help', 
    aliases: [],
    }
}
wheat mesa
#

you have given us no information on what is actually wrong

maiden gazelle
#

oh yea sorry it says interaction is not defined at the bottom

wheat mesa
#

because it's not defined, you have no variable named interaction

deft wolf
#

U have message

#

But not interaction

maiden gazelle
#

but i have that in none of my commands

wheat mesa
#

I would highly recommend learning javascript before copy pasting code from the internet

deft wolf
#

And its not even slash command i guess

maiden gazelle
#

its a normal command

#

i have much slashcommands

#

but im new with normal commands

deft wolf
#

Just change interaction to message

maiden gazelle
#

okay

eternal osprey
#

would a collector in djsv13 actually 'pause' a while loop or would the while loop just move on without waiting till the actual collector stopped?

#

Because right now i happen to have the issue where it keeps on spamming the while loop without the collector being fully done

#

(I am trying to repeat a certain collector as long as a certain variable is not in the correct format)

lyric mountain
#

depends

#

if the collector is async it'll run in a different moment

#

else it'll stop the loop

eternal osprey
#

collector is indeed async

lyric mountain
#

the same applies for anything in any programming lang

#

async = parallel

#

which means it's non-blocking

eternal osprey
#

ah i see

#

so removing the async should make the while loop work?

lyric mountain
#

there's a misunderstanding here

#

the while loop IS working

#

the issue is that you need to wait for the async task to return something

eternal osprey
#

yeah it is, but due to the async it will run seperate from the while right?

lyric mountain
#

yes, unless you await it

eternal osprey
#

hmm

#

so i could just remove the async so that they would align in runtime?

lyric mountain
#

you cant remove the async

#

djs built-in collector is async

eternal osprey
#

owh fuck

#

what should we do then?

lyric mountain
#

await

eternal osprey
#

await on the actual collector or while?

lyric mountain
#

sigh

#

what is async? the while or the collector?

eternal osprey
#

the collector.end and collect.on

#

collector*

lyric mountain
#

await can only be used on async stuff (well, in a way that it does anything at all)

#

connect the pieces now

eternal osprey
#

we await the collector obv.

lyric mountain
#

Yes

weary cradle
#

Hi everyone I’m very new here and I’m trying to learn how to do things to better my profile and server.

eternal osprey
#

sadly it's still spamming everything

#
 while(boolhit1 && boolhit2 || !boolhit1 && !boolhit2){
                                                         boolhit1 = false
                                                         boolhit2 = false
                               
                                                            const collector5 = r.createMessageComponentCollector({filter1,
                                                              componentType: "BUTTON",
                                                              time: 10000,
                                                              max: 1,
                                                            });
                                      
                                                           await collector5.on("collect", async (i) => {
                                                              if(i.member.id !== gamedatabase[key].user1){
                                                                return;
                                                              }```
lyric mountain
#

on doesn't return anything

eternal osprey
#

but we had to use the await on the collector right?

#

Isn't this exactly what we are doing

lyric mountain
#

Not really

#

Ur creating an event listener there

#

Also on isn't async per se

#

It just executes a task that might be async

eternal osprey
#

i know that i am creating an event listener

#

but like, the djs v13 collector itself is an event listener right?

lyric mountain
#

Apparently

eternal osprey
#

so what should i do else? Maybe remove the while loop and have some sort of other way to do this?

lyric mountain
#

Check the docs to see how to properly await for a single message

#

Also, why are u using a loop btw?

eternal osprey
#

it's not really a message

#

but a button

#

I am trying to make a user click a certain button, if not the right one is selected, it will repeat the process

#

hence the while

lyric mountain
#

Collectors have filters no?

eternal osprey
#

ye

#

i've added those but excluded them

lyric mountain
#

Simply put the button check in it

#

It won't execute unless the correct button is pressed

eternal osprey
#

i tried simplifying what i was doing in my explanation. I am trying to catch the input of 1 user, get the input of another user and then compare them to see whether a user made a goal.

#

It's basically a 1v1 shootout

#

where one is a keeper and other one the shooter

#

i try to keep on repeating this game till someone has scored as you can see

#

only problem that as soon as i reach my endgame it keeps on spamming this shit multiple times when i click a button

lyric mountain
#

U should write a proper game runtime for such interactive games

eternal osprey
#

yeah i know but this is just a temporary solution for now

#

as i want to present it to my friends

#

so its not really something too serious tbh

#

Only thing i am trying to figure out rn is how i can make sure my while loop doesn't start a new interation till my actual collector is done

lyric mountain
#

I smell technical debt, but well

#

See the docs to see if there's any way to collect a single press

eternal osprey
#

technical debt?

lyric mountain
#

If there isn't, use a promise to lock the loop, then resolve it inside the collector

lyric mountain
#

It snowballs very quickly and can easily make the code unmaintainable

#

As bugs start to grow from the ground

eternal osprey
#

Yeah that's true, the whole code is done already tho so this would be the only thing to fix and then i can play it with my friends

#

If it was something for public use or anything i would've used actual functions etc, but i thought that they were not really needed atm

eternal osprey
#

The max is set to 1, so it stops the collector when a button was pressed.

#

Problem is that it continously tries to only run the first part inside the while and then reloop

#

May i show you the snippet of the while?

eternal osprey
#

I have tried that already but it doesn;t work

lyric mountain
#

I said promise, not await

#

const lock = new Promise()

#

Then await it and resolve inside the event

eternal osprey
#

i see, so i will await the lock at the begin of the while loop, and then use .then(function(value){....} )?

#

Never worked with promises but this is what was on w3schools

lyric mountain
#

You will await right after you add the event

eternal osprey
#

and imagine that we would have 2 events?

lyric mountain
#

One

eternal osprey
#

Because i am having one collector.on and one collector.end

lyric mountain
#

I have no idea what ur doing, but you just need a single event to process the press and release the lock

eternal osprey
#

yeah i am lost in this promise as well

lyric mountain
#

Promise is just a task that might complete later

eternal osprey
#

    var promise = Promise.resolve(17468);
    
    promise.then(function(val) {
    console.log(val);
    });
    //Output: 17468

```I see, i am following this little snippet to basically understand it a bit more
lyric mountain
#

Then is just a chain

#

And that snippet doesn't make any sense

eternal osprey
#

it's on geeksforgeeks

#

but a promise.resolve basically returns a value that is trapped inside right? But how would it fix our timer issue?

lyric mountain
#
const lock = new Promise();
collector.on("collect", evt => lock.resolve(true));
await lock;
#

For example

eternal osprey
#

oowh

#

i see now!

#

Will try it out then.

#

that const lock = ...

#

must be placed outside the while i suppose

lyric mountain
#

No

#

Else it'll only lock a single time

eternal osprey
#

i see

#

and for each single collector i must create a new lock right?

#

Or only 1 for ALL collectors?

#

Suppose i have 2 collector.on

lyric mountain
#

You need to create a new lock for every single time you want to lock

#

Just make sure collector.on doesn't stay alive after resolving it

#

Else it'll memo leak

earnest phoenix
#

Uh, what the hell are you even trying to do exactly?

lyric mountain
#

He's trying to await a collector event

solemn latch
#

why not just use the event itself?

lyric mountain
#

Well...scroll up

#

I'm not sure what I'm looking at tbh, I just know that they want to run collectors inside a while loop

solemn latch
lyric mountain
#

I don't know if there are other ways of awaiting the collector result

earnest phoenix
#

There's a complete misunderstanding here, you can't halt the while loop from iterating like this when you're using a collector because that's not how promises work, the way you can achieve this is to make a function and put your entire code you want to run repeatedly, and once your conditions are met or the code has run the way you want it to, call the function again

#

Basically recursion

lyric mountain
#

U can't use promises as locks?

eternal osprey
eternal osprey
solemn latch
#

wouldnt you just create a new collector each time the last has ended, until a win condition is met.

eternal osprey
#

With the while

solemn latch
#

no need for a while loop, just create one inside the event callback

eternal osprey
#

not sure whether that would work?

#

Might need to show yall the snippet of the while

solemn latch
#

thats how other bots make turn based games.

eternal osprey
#

so you guys can see what i actually have

lyric mountain
#

For my runtime I just make a single collector that handles everything

#

The entire turn logic runs inside it

solemn latch
#

^ that works too

lyric mountain
#

Just make sure only the playing users are captured

#

After that it's just checking if the user is equal to the current player

eternal osprey
#

owh wow that is actually pretty smart

#

I will do that the first thing in the morning then, thanks yall for the help

lyric mountain
#

U said u didn't want to make a proper runtime when I told u earlier ;-;

eternal osprey
#

the problem with this is

#

that i only use 1 general collector right

#

but that collector is bound to a message

#

so after all these user actions, i would want to send another message and create another collector etc etc

#

but that wouldn't be possible within the while

#

that's what i've been trying to avoid

lyric mountain
#

You'd need to use a collector that isn't bound to anything

eternal osprey
#

owh is it possible for a buttoncollector to not bind to a message?

lyric mountain
#

Then filter to grab only of the specified message's buttons

earnest phoenix
# lyric mountain U can't use promises as locks?

Promises are just a floating state that holds an uncertain value, which can be either resolved or rejected, the program will keep going until you resolve the promise with the await keyword which'll halt the execution until the promise has been resolved, consider the following:

while (true) {
  const foo = new Promise((resolve) => setTimeout(resolve, 5_000));

  console.log('bar');
  await foo;
  console.log('baz');
}

This'll work as expected, it'll wait between each console.log() call for 5 seconds, and the while loop also waits for it

But consider this scenario:

while (true) {
  const foo = new Promise((resolve) => setTimeout(resolve, 5_000));

  // Let's say `bar` is a collector.
  bar.on('collect', async () => await foo);

  console.log('bar');
}

This one won't work the way you might expect it to, because the callback may or may not be called, and so the iteration keeps going and doesn't wait for the execution to be fully completed

#

What you're thinking of are mutexes and their locks, promises however, work differently

lyric mountain
#

I thought they worked like java's CompletableFuture (or just Future)

eternal osprey
#

where the collector will be bound to

earnest phoenix
#

You can

eternal osprey
#

owh i can?

earnest phoenix
#

All messages (except the ones the bot doesn't have permission to delete) can be deleted

#

It doesn't matter if a collector is bound to it or not

#

Although be sure to stop the collector before deleting it, because the collector may throw an error if it's not finished collecting yet

solemn latch
#

I've never thought about it throwing an error if deleted.

#

Good thing to keep an eye on

craggy pine
#

Does discord.js have a way for a user to simply select "on" or "off" without me specifying a value like String or Number? These are sub commands. Like if someone hits "on" I don't need it to use a String choice 'on' I can call which option they selected?

            name: 'auto-play',
            description: 'Makes the music player default to auto playing',
            type: 1,
            options: [
              {
                name: 'on',
                description: 'Turn on auto play | Will queue related songs',
                type: 3, // string
                required: false,
                choices: [{name: 'on', value: 'on'}]
              },
              {
                name: 'off',
                description: 'Turns off auto play',
                type: 3,
                required: false,
                choices: [{name: 'off', value: 'off'}]
              }
sudden geyser
#

there are booleans

#

which is a 5 for type

craggy pine
#

Knew that was there, wasn't sure if it was what I wanted but I'll test it out

sudden geyser
#

Though I personally think a single option like status of "on" or "off" (or even called play with a boolean) would be better, since the fields are likely mutually exclusive

craggy pine
#

Well it's nested within my settings command

#

it's for my database for initialize my queue

#

So I think understanding what you mean.

#
            name: 'auto-play',
            description: 'Makes the music player default to auto playing',
            type: 1,
            options: [
              {
                name: 'status',
                description: 'Turn on auto play | Will queue related songs',
                type: 3, // string
                required: false,
                options: [{name: "on", description: "on"}, {name: "off", description: "off"}]
              },
craggy pine
#

oh no I think I get it.

sudden geyser
#

It would mean that the command is run like /set auto-play status:on

craggy pine
#

ya I get you.

#

Hm.

#

I'll play around with my options.

hasty mulch
#

A friend sent me this since I don't know JS

wheat mesa
#

man that's a lot of spaghetti

hasty mulch
wheat mesa
#

from the look of it, should just be in the description

hasty mulch
#

I can't try it and see because I can't see what Discord sees it as

wheat mesa
#

But I cannot confirm whether or not the rest of the code actually works, I just looked at what you're sending in the POST request to discord

sharp geyser
#

What in the hell is that code

hasty mulch
sharp geyser
#

Oh I read that

#

thats not why I asked

#

First off why are you initiating the webhooks array with an empty string

#

just seems like you'll have an empty string in there on top of the webhooks I assume you will be pushing to the array

#

which is no bueno