#development

1 messages · Page 1879 of 1

lapis dock
#

agreed

green kestrel
#

if it does, youre about to enter a whole world of pain

lapis dock
#

these can run on raspberry pi, i have checked

green kestrel
#

sure, for one or two servers

lapis dock
#

yea

green kestrel
#

but each stream spawns a transcode via ffmpeg

#

so you end up with dozens -> hundreds of ffmpegs running

lapis dock
#

True that

#

even on heroku, its a huge problem

green kestrel
#

a friend of mine ran a music bot that worked like this, and it ate like 32gb ram on my box and killed it

#

with 7000 servers

green kestrel
#

he was rewriting it in D++

round edge
#

lol

green kestrel
#

but now hes not sure if hes going to, because of the aggressive takedowns

lapis dock
#

than ffmpeg and youtube-dl

round edge
#

so i guess it's not safe to run it on a pc

green kestrel
#

yeah lavalink scales a bit better

lapis dock
green kestrel
#

you cant just "use lavalink" though... he didnt write the code

lapis dock
#

if you really want to run it on pc

round edge
#

srry elaborate im not the coder im the sponser and host

green kestrel
#

that would mean a rewrite of the bots core functionality to use it

round edge
#

oh shut

#

shit

lapis dock
green kestrel
#

same as "move it to D++" is certainly not trivial either lol

round edge
#

ok ill let the guys know

#

thx

green kestrel
#

np

#

my current todo is making my bot speak slash command

#

its a fun one... because the lib i use has slash commands as a first class citizen, its not hard from that perspective.... but my bot takes command input from all over the place

#

not just messages, but via a dashboard command feed, via a scheduler, etc

#

so slash commands have to feed 'transformed' command input into that same system

#

heres how im approaching it

summer acorn
#

what was Structures changed to from djsv12 to djsv13?

#

ok 1Computer1 fuck you

pale vessel
#

Had a friend that was so pissed because of that change

#

It broke their library

summer acorn
#

@quartz kindle how would I make your editStructureAdd code work in djsv13

pale vessel
#

Honestly, it's so stupid

#

They're acting like everyone uses Structures

#

But no, only people that know what they're doing use them

#

Yet they still decided to say fuck you and removed it

summer acorn
#

I use Structures when I want to easily integrate a really useful feature into djs' classes

#

like Tim's edit structure

#
  • which is open source on github by the way
#

it's like so insanely useful

#

and that is what I use to keep Undefiner from flooding chats

#

actually, I wonder, did Tim update the repo for v13

green kestrel
#

whats this?

#

structures? hmm?

#

please enlighten the js-ignorant

cinder patio
#

Used to be a way to extend discord.js classes

summer acorn
#

no he did not

#

sad

green kestrel
#

sadgetastic

#

really....

summer acorn
cinder patio
#

it's not a big deal lol, there is definitely a way to do what you're doing without structures

summer acorn
#

yes but it's a mad pain

#

structures were so much better

#

this idiot is so stupid, I now hate 1Computer1

#

that's not even proper use of Structure, what a moron

cinder patio
#

literally it's just

function sendAndEditResponses(message, content, _options) => {
  let options = _options;
        if(typeof content === "string") {
            if(!options) { options = {}; }
            options.content = content;
        } else {
            options = content;
        }
        let sent;
        const previous = message.client.responses.get(message.id);
        if(previous) {
            // use the forge method if using discord.js-light else fallback to fetching for regular discord.js
            const msg = typeof message.channel.messages.forge === "function" ? message.channel.messages.forge(previous.id) : await 
            message.channel.messages.fetch(previous.id, false);
            if(previous.attachments || options.files) {
                await msg.delete().catch(() => {});
                sent = await message.channel.send(options);
            } else {
                if(previous.embeds && !options.embed) {
                    options.embed = null;
                }
                sent = await msg.edit(options);
            }
        } else {
            sent = await message.channel.send(options);
        }
        message.client.responses.set(message.id, {
            id: sent.id,
            attachments: Boolean(sent.attachments.size),
            embeds: Boolean(sent.embeds.length),
            timestamp: Date.now()
        });
        return sent;

}

Put this in your utils file or something and use it where you want to

#

I wouldn't classify this as mad pain

#

ALSO, in this specific case you can do this, too:

Message.prototype.send = function(content, options) { ... }
tardy hornet
#

when ever its time for my bot to post the guilds in top.gg it gives an error, Error: 401 Unauthorized, any idea?

pale vessel
#

Don't even need to do this anymore as you can now delete/update attachments for existing messages

limber mica
#

@opal plank im writing in TS now, happy?

quartz kindle
summer acorn
#

alright

urban slate
rose warren
#

Typescript

urban slate
#

what it do dood?

lyric mountain
#

thatscript

lyric mountain
urban slate
#

hmmm

lyric mountain
#

wrong top.gg token or wrong bot id

tardy hornet
#

where do i put the bots id again?

#

and its not a wrong token

lyric mountain
tardy hornet
#

const DBL = require("dblapi.js");
const dbl = new DBL(dbltoken, { webhookPort: deleted , webhookAuth: 'deleted' });

tardy hornet
lyric mountain
#

I mean, there HAS to be somewhere you input bot id

#

else how would the lib know where to post to?

urban slate
#

lads anyone knows how to do this? i want to make my bot reply to a message which was replied to when doing the command

urban slate
#

does mentions work for this?

lyric mountain
#

I didn't undestand a thing

#

rephrase that but in one message

urban slate
#

ok

tardy hornet
urban slate
#

lets theere is a command called -command which when a user replies a message with the bot replies to that specific message

#

for example

lyric mountain
urban slate
lyric mountain
#

you can grab referenced message

urban slate
#

how?

#

.refrence?

lyric mountain
tardy hornet
# lyric mountain

i want to add it to const dbl but i already added the webhook stuff

lyric mountain
lyric mountain
#

or have 2 instances

#

since that's the official lib

tardy hornet
lyric mountain
tardy hornet
#

can i just create a new DBL

#

?

lyric mountain
#

probably

tardy hornet
#

idk how to use it , wheres the docs?

lyric mountain
#

dblapi.js is deprecated

pale vessel
summer acorn
#

since when was embed descriptions required??

#

djs wtf you on

lyric mountain
#

you can always use void characters

tardy hornet
#

like that?

lyric mountain
#

ye

tardy hornet
#

well it says

#

that i need a token

#

but i already insert one

lyric mountain
#

did u define dbltoken?

tardy hornet
#

yes

lyric mountain
#

idk then, it was supposed to be only that

#

you'll need to ask someone who actively uses it to see if there's anything else

solemn latch
tardy hornet
#

i did

#

not working

solemn latch
#

try using the token directly rather than a variable

tardy hornet
#

i did

#

not working

solemn latch
#

does your token look something like
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpTYI6Ijg1OTE1MDM5MDEzNDMwODg5NCIsImJvdCI6dHJ1ZSwiaWF0IjoxNjMxODgyNTU2fQ.OytT6wKJhuRrK2ojFgwNh9IP4dyTqLufajX7Cp3yiLA

very likely starting with ey

tardy hornet
#

yes

boreal iron
solemn latch
#

try using the sdk then I guess?

tardy hornet
#

how

solemn latch
tardy hornet
#

like define

solemn latch
#
const Topgg = require(`@top-gg/sdk`)

const api = new Topgg.Api('Your top.gg token')
tardy hornet
#

to the token?

#

k

#

ty

solemn latch
tardy hornet
#

Error: 401 Unauthorized (You need a token for this endpoint)

solemn latch
#

are you absolutely sure your filling in with the top.gg token, not a bot token?

tardy hornet
#

yes

solemn latch
#

no idea then

tardy hornet
#

okay, ty for trying

urban slate
#

this is how you send a vid with your bot right?

midnight swallow
#

Hey, do u know how to get the message content from message id

lyric mountain
#

you first get the message by id, then u get the content

lyric mountain
#

did u try?

midnight swallow
lyric mountain
#

did u fetch the message?

midnight swallow
#

Yeah

lyric mountain
#

which error u got?

midnight swallow
#

I didn't get any.. It returned me script which had message id, guild and etc

#

Simply wanna use it so ppl can quote the message with id

lyric mountain
#

...again, did u FETCH the message?

midnight swallow
#

YUP

lyric mountain
#

show the code u tried

midnight swallow
#

I'll send the code snippet after few hrs

midnight swallow
lyric mountain
#

ok ok

midnight swallow
#

PoggersRow bot dev

urban slate
#

guys how do i send videos with my bot?

#

MessageAttachment dont work

lyric mountain
#

you send the file

#

just like images

urban slate
#

i have never done that......

#

this video is in the bots folder so i cant do it with a link

lyric mountain
#

google it

urban slate
#

thats how i got till this

#

but it doesnt work

lyric mountain
#

../ means "one folder above"

urban slate
#

it is

#

gave me the error cannot send empty messages

wheat mesa
#

🤦‍♂️

grim aspen
#

@flat pelican

eternal osprey
#

how do i add up all these numbers in my for loop?

#
  for (const key in g){
        let z =+ g[key][1].uses
        console.log(z)
      }```
lyric mountain
#

don't define a variable inside a loop

flat pelican
#

smh

lyric mountain
#

it'll get zeroed on the next pass

eternal osprey
flat pelican
#

Thanks

grim aspen
#

lol

lyric mountain
grim aspen
#

anyways i was about to say i need help with migrating old code to v16

#

on discord.js

eternal osprey
lyric mountain
lyric mountain
grim aspen
#

it's been on v12 for like 3 years

eternal osprey
#

i have but it's still outputting this

lyric mountain
#

are u talking abt node or djs?

eternal osprey
#

rather than adding up the numbers

lyric mountain
hybrid cargo
#

Bro what

grim aspen
#

wait

eternal osprey
#
ient.on('guildMemberAdd', async(member) => {
  let z;
    if(member.guild.id !== id) return;

    let gInvites = await member.guild.fetchInvites()
      let g= [...gInvites]
      console.log(g)
      for (const key in g){
        z =+ g[key][1].uses
       
      }
      console.log(z)``` this actually returned 1 lmao?>
lyric mountain
#
// declare variable here

for (/* loop */) {
  // sum here
}

// print here
grim aspen
#

oh god damnit

#

i mean discord.js newest version v13

eternal osprey
lyric mountain
#

then the sum is 1

tardy hornet
#

any idea how to post the servers on top.gg with out using dbl.postStats(bot.guilds.cache.size), since i cant because i have a webhook

lyric mountain
#

don't use dblapi.js

tardy hornet
#

i tried

#

and it did not work out

lyric mountain
#

dblapi is deprecated, you shouldn't use it no matter the reason

grim aspen
#

so i'm using repl.it as a sandbox currently. i assume repl.it does not support newer versions of node

lyric mountain
#

it doesn't, u need to use timhack

eternal osprey
grim aspen
#

where would i find that?

lyric mountain
lyric mountain
#

if you're curious, put a console.log inside the loop

rose warren
#

Bow down to the king

#

🙇

eternal osprey
#

the first one already has 7 uses

grim aspen
#

oh boy

lyric mountain
#

then sum it yourself to check the result

lyric mountain
#

ah

#

you're doing =+

#

it's +=

eternal osprey
#

owh... what is =+ for then?

lyric mountain
#

1 =+ 2 is the same as 1 = +2

grim aspen
#

so since the nodejs bash version is installed with the latest, i'm assuming i have to move all my files for code over to the bash?

lyric mountain
#

so 1 = 2

eternal osprey
#

ahha!

lyric mountain
#

meanwhile 1 += 2 is 1 = 1 + 2

eternal osprey
#

i see.

boreal iron
#

Even if Tim's not around, his face is freerealestate

#

cheap ads

eternal osprey
#

i defined it as let z, is that the cause of a NaN error?

grim aspen
simple stump
#

I’m a bit confused, but I’m using MySQL to store a bunch of data, however in the middle of the night the bot will disconnect from the database and shut down. I’m super confused since I’m not touching the bot. I’m hosting the bot an a raspberry pi, so I attached the error.

lyric mountain
lyric mountain
#

get used to random disconnects, data corruption and senseless errors

simple stump
#

Is it possible to avoid them or nah?

eternal osprey
#

i am basically adding things up to an undefined value. So i can better just use: let z = 0

boreal iron
#

get used to random disconnects

Maybe if you didn't configure it well enough

lyric mountain
#

mysql is famous for connection issues

#

even with perfect configurations

simple stump
#

Would I be better off paying $0.85 per month for hosting? Or would a hoster not change this issue?

boreal iron
#

I'm experiencing them really rarely

lyric mountain
boreal iron
#

Your script or lib should be able to try a reconnect if so.

earnest phoenix
#

MySQL is just ew

lyric mountain
earnest phoenix
#

PostgreSql is good

simple stump
lyric mountain
#

for example, do you have any VARCHAR(255) column?

lyric mountain
#

change to VARCHAR(191)

simple stump
#

Alr

boreal iron
#

Your bot also doesn't die if Discord disconnects the connection, it will reconnect as well

#

Keep that in mind to handle a database connection similar

simple stump
#

Okay. Sounds good. Thanks y’all

lyric mountain
#

but really, if you don't have much data I suggest going to postgres

#

mysql is too glitchy to be worth it

boreal iron
#

change to VARCHAR(191)

Imagine if your string to store is 192 KEKW

#

but really, if you don't have much data I suggest going to postgres

I would switch to SQLite but okay

lyric mountain
#

sqlite might be too simple for some stuff

earnest phoenix
#

SQLite is annoying

#

It doesn't support the cool data types

boreal iron
#

"cool" data types?

grim aspen
#

hey kuu, do i have to move my files over to the node bash?

earnest phoenix
#

arrays being one of em

lyric mountain
#

hmm..."to node bash?"

grim aspen
#

well i mean that's what came up with the timhack link

lyric mountain
#

ah, that

boreal iron
#

If you need to save an array in a table-based database you're doing something wrong.

lyric mountain
#

ye, there's a full tutorial there

earnest phoenix
#

How so?

lyric mountain
#

with pogres you can convert a resultset into an array and manipulate as you'd do in prog langs

boreal iron
#

Anyways serialization is the key you have to go with then

lyric mountain
#

serialized arrays won't allow element manipulation

earnest phoenix
#

If I need to save an array of thumbnails for an anime ima make the field be the type of text and also mark it to allow arrays

boreal iron
lyric mountain
#

pogres has a shitton of support for in-server manipulation

boreal iron
#

I've got a few tables only containing some JSON data and deserializing and serializing is indeed a bit annoying but the way it works.

#

I still wont change my opinion about saving an array in a database but I can accept your opinion, too

#

The use case matters and no MySQL MariaDB isn't bad or shady, not even close

lyric mountain
#

like, I agree with saving not being necessary at all

#

I just like the operations it allow after you typecast it

boreal iron
#

It's just not the best database to start with as beginner

grim aspen
#

bash index.js
index.js: line 1: syntax error near unexpected token (' index.js: line 1: const { REST } = require('@discordjs/rest');'

lyric mountain
#

mysql is the baddie

boreal iron
#

That's at least something I would sign to 100%

lyric mountain
#

also it's made by Or*cle

lyric mountain
boreal iron
#

Anything Oracle has "took" over the years got fucked up somehow

grim aspen
#

the single quotation?

#

that's not in it

lyric mountain
#

I love java but hate oracle for how shitty their business model are

#

java didn't deserve it

lyric mountain
boreal iron
#

Can't belive I've got the same opinion like you, but yeah

grim aspen
#

const { REST } = require('@discordjs/rest');

boreal iron
#

Even if I don't like Java

grim aspen
#

starting to think bash doesn't like node

lyric mountain
#

is that all of it?

#

like, no extra characters or whatever?

grim aspen
#

that's line 1

#

wait

#

lemme try something

#

ohhhhh wait

#

that was it, i didn't realize bash doesn't like to run index.js

#

now it works

#

it needs to run run.sh instead of index.js

lyric mountain
#

ah

grim aspen
#

so it works now, but issue i have being is how to get the old code migrated to the newest discord.js

lyric mountain
#

manually, slow and steady

grim aspen
#

sigh

#

well now it works with the slash command

#

imma have fun with converting old code into the new version

#

new issue

#

when a command is run, the bot does nothing, no errors

#

this is the newest version with interactions

lyric mountain
#

intents maybe?

grim aspen
#

omg

midnight swallow
#

@lyric mountain here


@bot.command()
async def getmsg(ctx, msgID: int): 
  msg = await ctx.fetch_message(msgID)
  await ctx.send(msg)

grim aspen
#

no privileged intents

#

that was the issue

#

new issue

#

NOTE: Once your bot reaches 100 or more servers, this will require Verification and whitelisting.

#

it's already verified with 237 servers

lyric mountain
#

you need to get the content with something like msg.content

#

or whatever it is for dpy

grim aspen
#

what would i do to enable intents

lyric mountain
#

go to discord dev dashboard and enable it there

#

then add to client during creation

grim aspen
#

i can't enable it

boreal iron
#

Did your bot already was in more than 75 servers?

grim aspen
#

this was during testing with old version

#

it is verified

boreal iron
#

Verified doesn't mean you can enable the intent

#

It must have been verified for this intent tho

grim aspen
#

well what can i do then?

earnest phoenix
boreal iron
#

Contact Discord to ask for a verification for this intent with a very good explanation why they should whitelist your bot

grim aspen
#

i'm guessing i'd have to do that through email

boreal iron
#

Not sure if there's another verification button

#

Probably not, yeah via. mail should be the right way to go

grim aspen
#

well that's going to be a problem, i won't be getting anywhere because they never respond to my emails

lyric mountain
#

apply for whitelisting and wait around 1 month

grim aspen
#

i will figure out a way

lyric mountain
#

or more

grim aspen
lyric mountain
#

you can disable those intents meanwhile

#

like, in the client

boreal iron
#

You need a verification process for each intent

lyric mountain
#

it should boot normally if u don't use either of them

lyric mountain
boreal iron
#

Yeah I meant like they check if you got a valid reason for each intent

lyric mountain
#

ah, yeah

grim aspen
#

will they just force intents in the future?

lyric mountain
#

they are

boreal iron
#

One can be denied, one can be accepted

lyric mountain
#

intent already are kinda forced

hybrid cargo
#

except message, which will soon be too

grim aspen
#

well i mean fully enforced

boreal iron
#

No bots with less 100 servers will not require it

lyric mountain
boreal iron
#

For developing reasons

hybrid cargo
# grim aspen well i mean fully enforced

guild member and presence are already enforced. If you are getting your bot verified it needs to apply for intents you need. in a couple of months message would be too

hybrid cargo
boreal iron
grim aspen
#

what would guild_members be

#

i don't understand

boreal iron
#

Depends on what events you need

#

Members joining/leaving for example do require the member intent

grim aspen
#

nope

#

i'm assuming the guild_presense is the bot's status?

hybrid cargo
grim aspen
#

well then i don't need privileged intents

boreal iron
#

There's no guild presence intent

grim aspen
#

although i will need it for when message intents come

boreal iron
#

Oh you mean PRESENCE_UPDATE

#

yeah nvm

grim aspen
#

like i said i'm smoothbrained with the new stuff

#

imma have fun fixing every code i have

boreal iron
#

That indeed sounds "funny"

grim aspen
#

oh ffs i've declared client twice for no reason

#

throw new TypeError('CLIENT_MISSING_INTENTS');
^

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.

#

bitch what

boreal iron
#

Are you updating to v13 atm?

sage bobcat
#

One message removed from a suspended account.

grim aspen
#

migrating my old code to the new version

#

with nodejs- wait

#

yes

boreal iron
#

Yeah just open the guide and take a look at the changes djs made

#

You will have to update some more code

grim aspen
#

i swear to gosh discord.js is going to make me have an aneurysm

boreal iron
#

lmao

#

Once you’re up to date v13 literally makes "more sense" to code with than v12

tardy hornet
#

its making me nuts

#

i have a token

grim aspen
#

omfg they're really making me reinvite my bot

#

i knew i should've stuck with developing my bot instead of discontinuing it

#

ReferenceError: CLIENT_ID is not defined

tardy hornet
coarse yoke
#

hey broken tooth does your bot use youtube api for music?

wild kindle
coarse yoke
#

or what does it use

grim aspen
#

@wild kindle wrong channel

#

one up

coarse yoke
#

XD

tardy hornet
#

they will just tell me to remove it right? since rythem is still a thing

tardy hornet
# coarse yoke XD

and there a huge bots with music commands in them, i dont think they will first try to get a bot that is in 490 servers

tardy hornet
#

because of the about me?

coarse yoke
#

cuz if your bot grows it could get deleted for terms of service

coarse yoke
tardy hornet
#

can you help me out?

#

and dont worry i am removing the music commands

coarse yoke
# tardy hornet can you help me out?

sorry but no because i don't understand the topgg API i tryed on like adding it to my bot for like voting = something for like a week but it just didn't work so yea i gave up :|

tardy hornet
#

i managed to make the voting works

#

with the webhook

#

hey

#

lol

#

he deleted the message

coarse yoke
tardy hornet
#

my bot has economy in it, so they get 20,000 coins from voting

#

and it sends a message

#

in a channel

coarse yoke
#

do you just use the discord coding or like discord js

tardy hornet
#

discord.js

#

i sent you how it looks like in DMs

coarse yoke
coarse yoke
tardy hornet
#

sure i can help you, lets move to DMs

#

@coarse yoke

#

DM me

solemn latch
grim aspen
#
  name: 'ping',
  description: 'Replies with Pong!'
}]; 

const rest = new REST({ version: '9' }).setToken('token');

(async () => {
  try {
    console.log('Started refreshing application (/) commands.');
    
    await rest.put(
      Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID),
      { body: commands },
    );

    console.log('Successfully reloaded application (/) commands.');
  } catch (error) {
    console.error(error);
  }
})();

const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });



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

client.on('message',  async msg => {
  if (!msg.isCommand()) return;
  if (msg.author.bot) return;

  if (msg.commandName === 'ping') {
   await msg.reply('Pong!');
  }
});```
#

ok markdown

tardy hornet
#

can you next time send it in like source bin

#

or something like that

solemn latch
#

```js
Code here

```

grim aspen
#

better

#

so my issue is nothing is happening

#

like the bot won't do anything

#

well except CLIENT_ID not being defined

solemn latch
#

What's the isCommand method?
👀

earnest phoenix
#

erwin included
detritus didn't serve him good

grim aspen
#

so like if the bot were to recieve a command, such as "/ping" or whatever it is, it should reply with pong

solemn latch
#

But where did you get that method from?

earnest phoenix
#

wait djs v13

solemn latch
#

You cannot just make up methods

#

Is it in v13‽

grim aspen
#

discord.js v13 docs

solemn latch
#

I dont see it in v13 docs

grim aspen
#

well the main/stable

earnest phoenix
#

when you read an actual idiot's guide

grim aspen
#

i mean that documentation made me lose most braincells

solemn latch
#

Hmm 👀

earnest phoenix
#

Detritusjs documentation uses typedoc

#

404 just takes you to the homepage

#

Good navigation is undefined

#

and finally
NO DESCRIPTIONS FOR ANYTHING

#

ditch typedoc, return to monke

grim aspen
earnest phoenix
grim aspen
#

OMG

solemn latch
#

It's the docs for discordjs

#

Tells you everything you have

grim aspen
#

oh what the fuck

#

i just realized it's input is if the msg is a command, do nothing

earnest phoenix
#

has anyone here ever worked with fastapi?

grim aspen
#

and i realized it's not

earnest phoenix
#

you have a ! in front of it so if it is false it returns true and if it is true it returns false

green kestrel
#

who here plans to leave their standard prefix commands in their bot after implementing slash commands fully

#

i mean sure, they wont work, unless you have message intents, but what if you plan to have those intents, and taking them out is more work?

grim aspen
#

me

green kestrel
#

i was thinking of leaving mine in until at least april

#

to give users time to get used to the slash commands, have both during a migratory period

novel jetty
#

Anyone know how i can fix this? Im not sure how the names are same

PS C:\Users\great\OneDrive\Desktop\New> node deploy-commands.js
Started refreshing application (/) commands.
DiscordAPIError[50035]: Invalid Form Body
4[APPLICATION_COMMANDS_DUPLICATE_NAME]: Application command names are unique
    at SequentialHandler.runRequest (C:\Users\great\OneDrive\Desktop\New\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:198:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (C:\Users\great\OneDrive\Desktop\New\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:99:20)
    at async C:\Users\great\OneDrive\Desktop\New\deploy-commands.js:31:3 {
  rawError: {
    code: 50035,
    errors: { '4': [Object] },
    message: 'Invalid Form Body'
  },
  code: 50035,
  status: 400,
  method: 'put',
  url: 'https://discord.com/api/v9/applications/883983230645198859/guilds/836514366643896340/commands'
}
grim aspen
#

i fixed except one probleem

#

401 unauthorized

earnest phoenix
#

@novel jetty one of your commands has the same name

#

you probably copy pasted command template then forgot to change the code

grim aspen
#

{"message": "401: Unauthorized", "code": 0}

earnest phoenix
#

@grim aspen you don't have permissions to do something

#

guild commands probably

novel jetty
# earnest phoenix you probably copy pasted command template then forgot to change the code

I only have this 2 and it doesn't seem to be the same

const { SlashCommandBuilder } = require('@discordjs/builders');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('ping')
        .setDescription('Replies with Pong!'),

    async execute(interaction) {
        const channel = interaction.client.channels.cache.get('878236244927209512')
        await channel.send(`Pong!`);
        await interaction.reply('Replied!')

    },
};
const { SlashCommandBuilder } = require('@discordjs/builders');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('online')
        .setDescription('Angelus is online!'),

    async execute(interaction) {
        const channel = interaction.client.channels.cache.get('878236244927209512')
        await channel.send(`Angelus is online!`);
        await interaction.reply('Message sent!')

    },
};
grim aspen
#

omg

earnest phoenix
novel jetty
# earnest phoenix ig it's a problem with the command handler
client.commands = new Collection();
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
    const command = require(`./commands/${file}`);
    // Set a new item in the Collection
    // With the key as the command name and the value as the exported module
    client.commands.set(command.data.name, command);
}
grim aspen
#

i wonder if it's guild.join

#

because i do not see guild commands

earnest phoenix
earnest phoenix
#

why does discordjs have guild.join anyways??

novel jetty
# earnest phoenix console.log client.commands and see what it says
PS C:\Users\great\OneDrive\Desktop\New> node .
Collection(2) [Map] {
  'online' => {
    data: SlashCommandBuilder {
      options: [],
      name: 'online',
      description: 'Angelus is online!',
      defaultPermission: undefined
    },
    execute: [AsyncFunction: execute]
  },
  'ping' => {
    data: SlashCommandBuilder {
      options: [],
      name: 'ping',
      description: 'Replies with Pong!',
      defaultPermission: undefined
    },
    execute: [AsyncFunction: execute]
  }
}
grim aspen
#

ok hold on

#

what needs to go in applicationGuildCommands()

earnest phoenix
novel jetty
#
const { SlashCommandBuilder } = require('@discordjs/builders');
const fs = require('fs');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { clientId, guildId, token } = require('./config.json');

const commands = [
    new SlashCommandBuilder().setName('ping').setDescription('Replies with pong!'),
    new SlashCommandBuilder().setName('server').setDescription('Replies with server info!'),
    new SlashCommandBuilder().setName('user').setDescription('Replies with user info!'),
]
    .map(command => command.toJSON());

    const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));

    // Place your client and guild ids here
//const clientId = '875735026317262928';
//const guildId = '823963920984965131';

    for (const file of commandFiles) {
        const command = require(`./commands/${file}`);
        commands.push(command.data.toJSON());
}

const rest = new REST({ version: '9' }).setToken(token);

(async () => {
    try {
        console.log('Started refreshing application (/) commands.');

        await rest.put(
            Routes.applicationGuildCommands(clientId, guildId),
            { body: commands },
        );

        console.log('Successfully reloaded application (/) commands.');
    } catch (error) {
        console.error(error);
    }
})();
#

I got it

#

It worked

#

Thanks

earnest phoenix
#

lmao

grim aspen
#

wait

#

OMG

#

i wonder if that was the issue

#

the new slashcommands code

novel jetty
#

@earnest phoenix You know where i can define client?

const { SlashCommandBuilder } = require('@discordjs/builders');
const { MessageEmbed } = require('discord.js');
const { version } = require("../package.json")

module.exports = {
    data: new SlashCommandBuilder()
        .setName('ping')
        .setDescription('Replies with Pong!'),

    async execute(interaction, client) {

        const embed = new MessageEmbed()
            .setAuthor('Watcher')
            .setColor('BLUE')
            .setDescription(`Watcher is running on ${version} with ${client.ws.ping}ms`)

        const channel = interaction.client.channels.cache.get('878236244927209512')
        await channel.send({ embed: {embed}});
        await interaction.reply('Embed Sent!')

    },
};

It's throwing this error

TypeError: Cannot read property 'ws' of undefined
    at Object.execute (C:\Users\great\OneDrive\Desktop\New\commands\ping.js:15:68)
    at Client.<anonymous> (C:\Users\great\OneDrive\Desktop\New\main.js:40:17)
    at Client.emit (node:events:406:35)
    at InteractionCreateAction.handle (C:\Users\great\OneDrive\Desktop\New\node_modules\discord.js\src\client\actions\InteractionCreate.js:66:12)
    at Object.module.exports [as INTERACTION_CREATE] (C:\Users\great\OneDrive\Desktop\New\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
    at WebSocketManager.handlePacket (C:\Users\great\OneDrive\Desktop\New\node_modules\discord.js\src\client\websocket\WebSocketManager.js:345:31)
    at WebSocketShard.onPacket (C:\Users\great\OneDrive\Desktop\New\node_modules\discord.js\src\client\websocket\WebSocketShard.js:443:22)
    at WebSocketShard.onMessage (C:\Users\great\OneDrive\Desktop\New\node_modules\discord.js\src\client\websocket\WebSocketShard.js:300:10)
    at WebSocket.onMessage (C:\Users\great\OneDrive\Desktop\New\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (node:events:394:28)
earnest phoenix
#

@novel jetty there is no client passed to execute, you should remove it and use interaction.client

novel jetty
quartz kindle
novel jetty
#

Ahh

eternal osprey
#

hey i would want to scrape this chart. How would i ever do that?

quartz kindle
#

link?

eternal osprey
#

got no clue where to start tbh

modest maple
#

get html, use regex to get each row

#

profit

eternal osprey
pale vessel
eternal osprey
#

How did you do this bro

modest maple
#

xD

solemn latch
#

f12, look at the requests

pale vessel
#

Network inspector DoordTroll

modest maple
#

but regex is so much better

eternal osprey
quartz kindle
#

you cant regex the html if the data is not included in the original request tho

eternal osprey
#

but flaz's method was kinda easier to use

pale vessel
quartz kindle
#

flaz's method is the correct method, i was about to post it but he found it first

#

xd

eternal osprey
#

flaz, do you know how i can use network inspector to use i myself later on?

pale vessel
solemn latch
#

press f12 on your keyboard, click network, click fetch/xhr

pale vessel
eternal osprey
#

oowh

solemn latch
#

then just look at each request

eternal osprey
#

awesome guys. Thanks!

#

what is the best way to get fetch the info's on the site and log tthem?

#

node-fetch?

earnest phoenix
#

smaller size: phin
browser like style: node-fetch
cool: axios

eternal osprey
earnest phoenix
eternal osprey
#

doesn't node-fetch only use import?

#

instead of require

pale vessel
#

Yeah

#

You can use 2.6.0

#

Or const fetch = await import("node-fetch");

earnest phoenix
#

await outside async

quartz kindle
eternal osprey
#
const response = await fetch('https://api.nasdaq.com/api/calendar/earnings?date=2021-09-17');
const data = await response.json();

console.log(data);```why is it sendin the error: fetch is not a function
quartz kindle
#

how did you import it?

eternal osprey
#

const fetch = await import("node-fetch")

quartz kindle
#

show full code

eternal osprey
#
const Discord = require("discord.js");
const client = new Discord.Client();
const auth = require("./config.json");
const fs = require("fs");
client.on("ready", () => {
  console.log(
    "Your bot is Running on Discord. All checked and running!"
  );
  client.user.setActivity(`Stock gatherer!`, { type: "PLAYING" });
});



client.on("message", async (message) => {
  if(message.content.startsWith(auth.prefix+'start')){
    const fetch = await import("node-fetch")
    message.channel.send("**The earnings screener has started successfully!**") 
const response = await fetch('https://api.nasdaq.com/api/calendar/earnings?date=2021-09-17');
const data = await response.json();
console.log(data);
 }
});
client.login(auth.token);
#

literally the whole file

marble juniper
#

you might need to do

const fetch = (await import("node-fetch")).default
#

instead

grim aspen
#

question, how do i create a slash command

grim aspen
#

the code won't do it

quartz kindle
#

yes you need the default import

eternal osprey
grim aspen
#

i mean what i'm currently using

eternal osprey
#

as i am console.logging but it won't show.

#

axios worked fine

#

thanks boys

eternal osprey
#

but it didn't really work

pale vessel
#

Not all of them use an API

eternal osprey
#

owh

#

so we cannot pull data from them right

earnest phoenix
#

@eternal osprey you should try phin for just fetching data and converting it to json

earnest phoenix
#

it's super lightweight

pale vessel
#

You need to open the network tab and then refresh

#

If you open it after loading the page, it won't be able to capture the requests

earnest phoenix
#

flazepe remember sus npm logo

earnest phoenix
#

it's a javascript object but converted to a text file

eternal osprey
#

I know.

earnest phoenix
#

their api should give you an overview of what the heck you're getting from the api

eternal osprey
#

But i mean, the information in this json doesn't really match the one on the site

#

I am trying to get the market cap

earnest phoenix
#

of what?

eternal osprey
#

v

#

found it!

cinder patio
#

node-fetch at 7.5 mb? That's just false 🤔

earnest phoenix
eternal osprey
#

It's strangely called upravene

pale vessel
eternal osprey
#

yeah really strane

pale vessel
#

Oh ok

split hazel
#

node fetch you fat bastard

eternal osprey
#

their website is written in the slovak lanuae

earnest phoenix
#

here's a suggestion: add a command that gets market caps of cryptocurrencies

#

im tired of constantly opening coingecko

quartz kindle
#

looks like polish

eternal osprey
#
axios.get('https://www.finscreener.org/enginejs/cache/earnings/calendar/mapTyp1.json?t=1631900164069')
  .then(async (response) => {
  let m = await response
console.log(m)```the response is not logging?
grim aspen
#

i finally fixed my bot

quartz kindle
grim aspen
#

for four hours i overlooked on piece of code

quartz kindle
#

but yeah no idea why do that server side

split hazel
quartz kindle
#

wouldnt it be "safe" grammar/spelling?

#

lmao

#

like ascii safe

split hazel
#

probably just encoded like that for json

#

yeah

quartz kindle
#

kurwa perkele

split hazel
#

I mean I know you can't use special characters but some of it doesn't make sense

#

you can still talk in Polish without them

#

they're just there to add accent and pronunciations

quartz kindle
#

ye

#

seeing code in non-english languages is funny af

split hazel
#

ąmóńguś

quartz kindle
split hazel
#

if it doesn't let me declare a variable named this the language is racist

grim aspen
#

bug

split hazel
#

I was about to call js racist when I realised it does support characters from other languages

quartz kindle
#

not all tho

split hazel
#

damn

#

doesn't matter as long as my language is supported

boreal iron
earnest phoenix
grim aspen
#

ReferenceError: Discord is not defined

#

const embed = new Discord.MessageEmbed()

pale vessel
#

Define Discord

#

I think?

#

Idk man...

grim aspen
#

oh shit

split hazel
#

yes define discord

#

unless you named it amogus or whatever

earnest phoenix
earnest phoenix
grim aspen
#

embedMessage is not defined

earnest phoenix
grim aspen
#

oh, unknown interaction

pale vessel
#

Make it known

grim aspen
#

ohhhh

split hazel
#

I love these responses

grim aspen
#

i feel like imma get rate limited

#

it was a bad request

earnest phoenix
#

discord gives me 5head errors for some reason

#

like sending a response after 3 seconds is a 404

solemn latch
#

response to an interaction?

#

the interaction token is deleted after 3 seconds, so it doesnt exist, therefore 404

split hazel
#

I thought it lasted 15 minutes

earnest phoenix
#

how hard was it to store it for 5 seconds longer

solemn latch
#

15 minutes if you defer right? 3 seconds if not?

split hazel
#

ah idk I don't interact

earnest phoenix
#

i don't command

solemn latch
solemn latch
earnest phoenix
#

also
sending an invalid response fucked my discord client

#

it showed sending command forever until i reloaded the page

rich copper
#

Custom prefix is not mandatory for a bot right

grim aspen
#

oh boy my first ratelimit

#

ffs

solemn latch
rich copper
#

Ok thanks

split hazel
#

if you get ratelimited just slow down

earnest phoenix
#

ah yes the floor is made out of floor

grim aspen
#

how do i delete a waiting message

split hazel
#

you don't

#

discord hasn't thought out a lot of things

#

including getting a good development team

grim aspen
#

so what can i do

split hazel
#

restart client

grim aspen
#

i think that caused a ratelimit

#

now i'm not

split hazel
#

I think they mean the one that shows loading

pale vessel
#

that only shows to you

rich copper
#

If our bot is verified and tho bot developer role is removed can we request the staff for the role?

grim aspen
#

i. mean. this

split hazel
#

yeah

#

it's for ocd people

#

just restart it'll go away

#

unless it's one of those

grim aspen
#

it's stuck doing it

solemn latch
#

using djs?

grim aspen
#

yes

pale vessel
#

look man

#

all u had to do is to interaction.reply() CJ

grim aspen
#

embed

pale vessel
#

embed

#

What's up with embed

grim aspen
#

i'm trying to send an embed

pale vessel
#

how did you try to send it

earnest phoenix
#

why could it be

grim aspen
#

well i migrated the command to a module export system

#

ya know

#

command handlers

pale vessel
#

aka <@&264445053596991498>

earnest phoenix
#

hmm WAIT

pale vessel
earnest phoenix
pale vessel
earnest phoenix
solemn latch
#

rol vs role

pale vessel
#

also the role name is @everyone

#

or just do role.id === guild.id

solemn latch
#

epic embed fail

earnest phoenix
pale vessel
#

you did <@&guildid>

#

The role name isn't that

#

it's @everyone

earnest phoenix
pale vessel
#

what are you trying to do man

earnest phoenix
#

I want to sort the roles in the menu and select a role from there.

#

but the bot shows the roles and everyone role

pale vessel
#

You don't want the everyone role?

#

You can filter it out

earnest phoenix
#
  • bot role
#

@pale vessel when you throw a filter it doesn't show any role

pale vessel
#

bot role as in?

#

Your bot or all bots

earnest phoenix
#

yes

pale vessel
#

So you want to show all roles except managed roles (bot roles) and <@&264445053596991498> role?

earnest phoenix
#

I want to show only assignable roles

#

yes

pale vessel
#

What version of Discord.js are you on?

earnest phoenix
#

12

pale vessel
#

Ah then you need to upgrade to v13

#

Role tags (which has the integration/bot ID) is implemented in v13

earnest phoenix
#

v13 is much harder than v12

pale vessel
#

You could use the raw API but that's a bit too much

earnest phoenix
#

What are the obvious changes?

grim aspen
#

i will work on my bot later, i spent way too much time on fixing it

azure lark
#

is there any discord servers where i can get help with web dev

grim aspen
#

some of us here are web developers

#

i'm not

azure lark
#

well its kinda js problem

earnest phoenix
azure lark
#

oh ok,

#

basiclly, i want to get all data from a mongo db and display it, (using ejs)

solemn latch
#

it might be easier/better performing to use api requests rather than ejs for something like that

split hazel
#

fuck web development especially frontend

#

if you disagree with me send your message to /dev/null

solemn latch
azure lark
solemn latch
#

sure

azure lark
#

its a website that im gonna be able to put my code onto it, and people will be able to see it and ect, so its like my github page but only for me

umbral lake
#

to get what is it in this, how I do this?

solemn latch
azure lark
#

but how do i get all results from a mongo db

solemn latch
#

are you using mongoose?

azure lark
#

yes

solemn latch
#

await Model.find();
will get all documents

#

and return an array

#

Model being your model

azure lark
#

so can i just set is as a const then do found.options1 to get the option of data 1?

#
  options1: {
    type: String,
  }
});```
solemn latch
#

its an array, so getting the first thing will be found[0] to get the first document

azure lark
#

loke that, if its my scheme

solemn latch
#

getting options1 would be found[0].options1

#

so thats options1 of the first thing in found

azure lark
#

and could i just do found.forEach(found => {
console.log(found.option1)
});
to log add the options1's

simple stump
#

I’m having a bit of trouble with reactions. Whenever I react to the message, it returns “Reacted with neither.” Also, I’m not sure how I would get the user ID of the person who reacted. Any ideas?
Code: https://hatebin.com/qevrbikkdr

azure lark
#

alr

solemn latch
azure lark
solemn latch
#

instead of results as the variable, use found
then inside the loop, it would be found[i].options1

tribal crow
#

Hey! I have an inventory command for my bot, and i want items to stack, but i cant figure out how. I have tried for a long time, but havent found anything that works :/ Does any of you? Items are stored as objects in an array.

solemn latch
#

items probably would be easiest if stored as ints

for example

items = {
  "sword": 5,
  "shovel": 1
}

in this case this user has 5 swords and 1 shovel.

tribal crow
#

yeah

#

but what i dont understand is how i find the number of the same items

#

waaaait

#

im so dumb

#

i save items to the inventory as different objects

rich copper
#

can anyone help me How do I add server Acknowledgements code in my userinfo command discord.py

azure lark
solemn latch
#

you didnt await code.find()

azure lark
#

ah

solemn latch
#

find is a promise

azure lark
#

where do i add the async

solemn latch
#

the async goes with the parent function, if one exists

azure lark
#

it dosent lol

solemn latch
#

then you dont need async, top level should be async already

azure lark
#

it still shows nothing

#

the modle is
const CodeSettings = require("../models/settings");

solemn latch
#

then wouldnt it be CodeSettings.find();

azure lark
#

no, when rendering the file i sent CodeSettings as code

solemn latch
azure lark
#

its telling my await is only an async function

solemn latch
#

alright lemme look up ejs then

#

in your ejs.render method

azure lark
#

how do i iturn it to true lol

solemn latch
#

the page i linked to showed it

azure lark
#

it dosent tell me how to act do it lol

solemn latch
azure lark
#

so just do:

    async: true
  }

  const renderTemplate = (res, req, template, data = {}, options) => {```
solemn latch
#

yep

azure lark
#

still same error

solemn latch
#

how are you using renderTemplate?

azure lark
#

renderTemplate(res, req, "index.ejs")

solemn latch
#

it would probably just be easier to pass the data along rather than in the ejs file

renderTemplate(res, req, "index.ejs", await CodeSettings.find());

making sure
const CodeSettings = require("../models/settings");
is in the file

azure lark
#

so like,

      await CodeSettings});
  });```
tribal crow
#

Hey! How do i change the value of an object in an array? I need to change the count value to count + 1, but nothing i have tried works.

solemn latch
solemn latch
#

will change the first objects value to +1 of what it is

tribal crow
#

yeah

#

but

#

there will be more objects soon

#

and i want it to be able to change those as well

solemn latch
#

do you know how you want to change them?
like searching for the item value?

tribal crow
#

no

solemn latch
#

inventory.find(obj => obj.item === "dog");
for example will get the first one(since its "dog")

can also do the same thing with count

tribal crow
#

i want it to be like if there is no document it should create one, and if there is a document with the same item name as its trying to create it should add 1 to the count

solemn latch
#

your looking for mongoose update then

#

so by default it will update, if ones not found it creates it

#

youll also probably want setDefaultsOnInsert set to true, so it will by default set the new item count to 0

tribal crow
#

Wait

#

i think i explained wrong

#

the code starts with creating a document if there isn't any

#

and i want it to update the object, and if there is no object with that item value it should create a new object

solemn latch
#

Actually that might error

tribal crow
#
 item: newArg,
 count: 1,
}
#

thats what i have

simple stump
#

I’m having a bit of trouble with reactions. Whenever I react to the message, it returns “Reacted with neither.” Also, I’m not sure how I would get the user ID of the person who reacted. Any ideas?
Code: https://hatebin.com/qevrbikkdr

Also related to logging the error I’m dumb and didn’t put a check

split hazel
#

show us the $event file

proven lantern
#

is discord planning to improve the ui for slash commands so that the subcommand grouping is more organized?

spark flint
#

anyone here ever used projectsend?

#

I need to add Microsoft (Called windows live on there) Oauth but its giving HTTP ERROR 500

sterile lantern
#
const text = `\n[DATABASE - ${date} EST]: Database Action: Updated Comissions status to false.`
  await fs.writeFile("../DatabaseLogger.txt", text, (err) => {
  if (err)
    console.log(err);
  })```

no errors being printed, nothing being logged onto the txt file
lyric mountain
#

@quartz kindle NOW we have ephemerals

#

also whats up, discord gonna add events?

quartz kindle
#

like upload files and not just link them

lyric mountain
#

well, no ig

quartz kindle
#

rip

lyric mountain
#

but hey, ephemerals are no longer useless

quartz kindle
#

exdee

lyric mountain
#

although I still wish I could send ephemerals directly

quartz kindle
#

ye

#

depends

#

why is the object inside an array?

#

but you said you didnt want multiple?

#

it cant do that, its not possible

#

do you mean this? ```js
[{
"1234": [{
"user_id": "123456789123456789"
}],
},{
"1234": [{
"user_id": "123456789123456789"
}]
}]

#

just remove the outer array

#

make it like this

#
{
    "1234": [{
        "user_id": "123456789123456789"
    }],
    "12345": [{
        "user_id": "123456789123456789"
    }]
}
lyric mountain
#

arrays = access by index
objects = access by key

quartz kindle
#

because its an array

#

why so many arrays inside arrays lol

#

dont use arrays then, use the object directly

#

thats what objects are for?

#

objects cannot have duplicate keys

simple stump
#

I’m having a bit of trouble with reactions. Whenever I react to the message, it returns “Reacted with neither.” Also, I’m not sure how I would get the user ID of the person who reacted. Any ideas?
Code: https://hatebin.com/qevrbikkdr

Also related to logging the error I’m dumb and didn’t put a check

quartz kindle
#

why do you need 1234 to be inside an array?

quartz kindle
#

again, why is the 1234 object inside an array

quartz kindle
simple stump
#

sorry after 20 sec

quartz kindle
#

but you said you want them to not have duplicates

#

objects do not allow duplicates, arrays do

#

exactly

lyric mountain
#

that's impossible in an object

quartz kindle
#

literally remove the array

#

and it will work

lyric mountain
#

bruh

quartz kindle
#

again, literally remove the array

lyric mountain
#

arrays are only if you need to store duplicate values and/or access by index

#

maps are if you won't add duplicate values and/or access by key

quartz kindle
#
let obj = {};
if(!obj["1234"]) { obj["1234"] = []; }
obj["1234"].push({channel_id: "82374682763482"})
#

what are you trying to do?

quartz kindle
simple stump
#

no

quartz kindle
#

then something is wrong with your filter

#

try filter = () => true

#

and see if it logs

simple stump
#

aight

#

nice ping

quartz kindle
#

and why cant you use what i said?

#

what i said literally does what you are describing

#

?

simple stump
quartz kindle
#

still doesnt explain why what i said wouldnt work

quartz kindle
simple stump
#

v13

quartz kindle
#

yes

quartz kindle
simple stump
#

yes

quartz kindle
#

t[new_id_here] = []

simple stump
quartz kindle
simple stump
#

aight

lyric mountain
#

Make sure u have reaction intent

simple stump
#

i do

#

GUILD_MESSAGES_REACTIONS

lyric mountain
#

Ye

#

Bruh, formatting pc with ssd is not fair compared to hdd

quartz kindle
#

comparing ssd to hdd is not fair on any level

lyric mountain
#

I mean, hdds at least are big

quartz kindle
#

and cheap

simple stump
quartz kindle
#

there you go

blissful coral
#

<prop>.author prop is undefined

simple stump
#

oh i see. mb sorry u had to walk me thru that lol. thx

quartz kindle
#

why are you still using an array?

blissful coral
#

Why not just use a cache

quartz kindle
#

isnt that what hes doing?

simple stump
quartz kindle
#

put it back in the filter

simple stump
#

so smth like this?
return ([":white_check_mark:"].includes(reaction.emoji.name) && user.id != message.author.id);

quartz kindle
#

filter = (reaction, user) => reaction.emoji.name === ✅ && user.id !== message.author.id

#

but if you want reactions for multiple users, you have to check reaction.users in collected

#

or use a reaction collector

#

awaitReactions is good for single user

simple stump
#

aight. thx 👍

#

Sorry to bother, but is it possible to remove the time limit? Ex. just to send the message "yes" whenever the user reacts instead of waiting 10 sec?
Code: https://sourceb.in/9Djrtx8oxx

tribal crow
#

yeah

#

line 6

#

change 10000 to whatever you want

#

1000 = 1 sec

simple stump
#

yea rn it waits 10 sec tho. it would be nice if immediately whenever the user reacts it sends the message "yes" or whatever.

tribal crow
#

put 1 ig

simple stump
#

ex. if there is this message:

#

asdf

#

and i react

#

the bot still waits 10 sec

#

before doing whatever

solemn latch
#

set the max to 1

tribal crow
#

Woo

simple stump
#

alr ill try that.