#djs-in-dev-version

1 messages ¡ Page 1 of 1 (latest)

rugged gorge
#

Hello , there is a diagram that shows how discord JS works ? (not how to use it)

cinder wraith
#

what would that diagram even show

scarlet tangle
#

does anyone know what is "Invalid Webhook Token" error?

#

nvm sorry

knotty plover
scarlet tangle
#

ty everyone <3

scarlet tangle
#

test

wary tartan
#

when im having issues with my code(whilst using discord.js) where do i seek help? In this channel? Or should i open a new thread in "developing-djs"?

scarlet tangle
#

Hi

odd tartan
#

Hey

vague coyote
#

this isnt a channel for small talk

spare fiber
#

i suppose djs v14 wont use @discordjs/ws, since it will be major change

gloomy kayak
#

Yeah, most probably it won't

tall verge
#

When they implement @discordjs/ws in discord.js?

spare fiber
#

v15 i suppose

spare fiber
#

i see something that called "set shard on the fly" on @discordjs/ws. does it resume the session if we set the shard on the fly?

fickle vapor
#

what npm do you recommend for my trivia bot

#

An npm of trivia

white nebula
snow loom
#

Hey, why is the bots switching to slash commands?

inner shard
snow loom
#

And why has it become a rule in September? Surly we have a choice to decide on if we want slash commands or not.

inner shard
snow loom
#

I wanted to know why did they're made it a rule?

inner shard
snow loom
inner shard
snow loom
#

Oh no I won't talk to them in here I will message them in DMs if you got their username....

snow loom
woven grove
#

What question even

inner shard
woven grove
#

Discord has articles about that on their help pages

#

And a dev isnt going to give you another answer

#

Or an answer that satisfies you probably

#

They are going to force slash commands and theres no way around that

snow loom
#

well discord doesn't care about their users then do they're... stuff them.

brazen vigil
#

So the builders package is bundled with djs 14 now.
Is there any plan to also bundle the rest package?

woven grove
#

It is

#

Well on the client, the rest instance is public

vague coyote
snow loom
vague coyote
#

I dont see how this is djs related, nor has anything to do with me

#

its obviously a promise

scarlet tangle
#

Pls tell how to change my bot to idle status

plain roverBOT
polar briar
#

migrating from bot commands, can anyone point me in the right direction to grab the message posted before the slash command is executed?

uncut kelp
#

A message isn't posted when using a slash command. It fires an interaction create event to which to application responds to

polar briar
woven grove
#

Well you can’t really

polar briar
woven grove
#

Oh

#

That’s what you mean lol

#

Well you do get a channel id

#

So you can just fetch the messages and check what the last message of the author was

#

But it could be like the first, or idk, 500 messages ago

#

You’d have to do a lot of fetching in that case

polar briar
#

this is an edgecase for the mod use, i want to post a breakdown in the channel then trigger the slash command right after to send it somewhere else with the API

#

so it would always be the last message from whoever is triggering the command

woven grove
#

But what if the last message was 10h ago

#

Before that person used that command

#

And others write stuff in between

#

It’d be hard to find the last message

polar briar
woven grove
#

I don’t think I understand

polar briar
#

So i have a channel that only I have access to and I make a post about the weather. Immediately after I make this post i want to then run the slash command and have the API get that previous post text so I can do something with it

#

dont mind the error but this is basically what im looking to do

woven grove
#

So you want to grab “post what I want to send”

#

Sure, so when you use the command, you can defer it

#

And with the command usually comes a channel id or even a whole channel class

#

This way you can fetch the last X messages and filter them by your user id

#

Or just fetch the last message if you don’t care

#

The result is the message

#

Just make sure you defer the slash command so it doesn’t time out

#

After deferring you have enough time to do whatever till you answer

#

@polar briar

#

Sorry for late answer

polar briar
# woven grove Sorry for late answer

no worries at all so thats what I thought, im just not sure on the syntax to actually grab it from within the slash command builder

async execute(interaction) { console.log(interaction.member.guild.channels); const channel = await interaction.member.guild.channels.get(interaction.channelId); channel.messages.fetch({ limit: 10 }).then(messages => { console.log(Received ${messages.size} messages); //Iterate through the messages here with the variable "messages". messages.forEach(message => console.log(message.content)) })

Currently i have something like this and just get undefined in my console log

woven grove
#

Interaction.channel should work

#

Which of those gives you undefined?

#

And do you have message content perms?

#

Like the intent

#

Needs to be enabled on the dev portal and provided as an intent on your client

polar briar
woven grove
#

No problem

woven grove
#

Otherwise if you take longer than 3s it will time out

polar briar
sleek pollen
#

it is possible to do that only if he have premmision he can click on the button?
if it is possible can I get example

hoary fox
#

u can use filter but not block clicking

sleek pollen
#

if it is possible to make in discord components ,button only those who have premmision canclick on the button.
if it is possible can I get example code?

sleek pollen
languid basin
steel quiver
#

Can someone help me?

rich cipher
steel quiver
#

hu

rich cipher
#

pressing CTRL + SPACE and clicking TAB will do that

steel quiver
#

wrong chat

lusty timber
#

Can you try {} catch () {} discord api errors without .catch()?

#

It's regarding my eval command

flat ice
#

yes, you will need to resolve all the promises

lusty timber
#

And how-

plain roverBOT
echo knot
#

Hi, how can i make a crud system in discord js

dawn phoenix
#

persistence has really nothing to do with this library, you can find some approaches in #resources and otherwise #useful-servers has general programming servers

#

if you actually mean something that has to do with this library, please elaborate on what you are trying to do

echo knot
#

Update the embed message using buttons

#

updating the values that are in each user's own embed message with buttons

#

Example:

Dex: 3
Damage: 3

Buton: Up/Damage (1/point)

Dex: 3
Damage: 4

dawn phoenix
#

you respond to the button press with an #update call and supply the state of embed(s) you want to be there after the edit

jaunty vault
scarlet tangle
scarlet tangle
#

Help pls

knotty plover
potent bluff
vague coyote
#

shitpost elsewhere, k thx

stuck sundial
#

any idea?

knotty plover
#

filter found nothing

stuck sundial
#

so

#

it's reply me and he didn't found anything

#

that's if founded

knotty plover
#

worked that time

stuck sundial
#

yes but i try with other account

#

he didnt found anything but he still reply ops

knotty plover
#

Oh okay

#

Because you used filter

#

An empty array is "true"

#

If you use find, you'll get null

#

Which is false

#

This really has absolutely nothing to do with the discord.js development version though?

scarlet tangle
#

i mean to embed or smth like this

lime whale
#

fix ?

copper jetty
cloud estuary
# lime whale

If you have not pre-set client.commands to a map/set, you can’t use client.commands.set.
However I’d advice you not to do this, as it’s technically an unknown property. (TypeScript would by default disallow this, however pure JavaScript does not)
Instead create a ClientCommands variable, and if needed send to commands.

knotty plover
#

This is not a discord.js dev version question

uncut kelp
#

Formatters class is gonna be deprecated. Everything in there is already a top-level export, so just use that.

Old way:

import { Formatters } from "discord.js";

Formatters.bold("bold");

Preferred way (which works even now):

import { bold } from "discord.js";

bold("bold");
knotty plover
#

Because its pointless

uncut kelp
#

Why? Well, I guess since everything is exported at the top level already, it's just... code duplication

knotty plover
#

I just dont want them at the top of the docs menu

uncut kelp
#

You can collapse them though right?

dawn phoenix
#

"should move the top level exports down" sounds odd firL
but yes, should, because they are all utilities and not as relevant to the overall library functionality as the structures are

hollow marlin
#

Hey

#

I’m trying to get djs v13 instead of v14

#

Any ideas how I can do this?

dawn phoenix
steel haven
jolly condor
#

hey is it me, or embeds now have a fixed static width?
they used to vary depending on the content

vague coyote
#

seems to be you and discord

#

I dont have that, even tho I just updated

knotty plover
#

yeah nothing here

steel haven
#

It’s discord client. Some version at least, no idea if canary or stable or which one though

sharp ridge
#

Hi guys, do you think it's possible to use a excel sheets with a discord bot ?

knotty plover
#

yes

turbid night
#

Depends on what you want to do with it

rigid zephyr
#

hello, do you know when v12 version will end?

nocturne kayak
#

it will end when discord decides to discontinue v6 which v12 uses
around early 2023

tame gazelle
nocturne kayak
#

well yeah, didnt really remember it correctly

knotty plover
#

v12 has basically already ended

#

There are things that will crash it

lusty obsidian
#

meh, seems like discordjs-button-pagination isn't working under v14 .-.

vague coyote
#

then tell them to upgrade

lusty obsidian
#

Did it by myself and made a PR

alpine locust
#

Hi guys!

#
        .setImage("https://c.tenor.com/M9fgYFTTCqQAAAAC/anime-cute.gif");
#

Shows, the image as expected.

#

    return new EmbedBuilder()
        .setColor(0x0099FF)
        .setAuthor({
            name: `${user.username} pinches ${mention?.username}!! Aaa, that hurts`,
            iconURL: user.avatarURL() || ""
        })
        .setImage("https://c.tenor.com/M9fgYFTTCqQAAAAC/anime-cute.gif");
#

But I have a list of random gifs in an array!

vague coyote
#

you kinda forgot the question here

alpine locust
#

Oh yes! I was formatting panik

#

I have an array like so...

#
export const PINCH = [
    'https://tenor.com/view/anime-pinch-face-gif-14114215.gif',
    'https://tenor.com/view/hestia-cheek-pinch-cute-danmachi-is-it-wrong-to-try-to-pick-up-girls-in-a-dungeon-gif-19893304.gif',
    'https://tenor.com/view/horimiya-anime-shota-hori-siblings-gif-19989089.gif',
    'https://tenor.com/view/anime-cute-pinch-tanakakun-is-always-listless-gif-14725930.gif',
    'https://tenor.com/view/anime-hibike-euphonium-asuka-tanaka-oumae-kumiko-pinch-gif-16488937.gif',
    'https://tenor.com/view/squishy-cheeky-anime-gif-15322355.gif',
    'https://tenor.com/view/rikka-takanashi-so-cute-chuunibyou-pinch-face-anime-gif-13451272.gif',
    'https://tenor.com/view/slap-butts-anime-hit-gif-14179587.gif',
    'https://tenor.com/view/anime-pinch-cute-gif-14117814.gif',
    'https://tenor.com/view/anime-pinch-nose-uzaki-uzaki-chan-wa-asobitai-cry-gif-17305037.gif',
    'https://tenor.com/view/anime-asia-highschool-dxd-pinch-gif-12410790.gif',
    'https://tenor.com/view/itsuki-gotobun-anime-pinch-squeeze-gif-16237877.gif',
];
#

And I am trying to show random image everytime from this array but it doesnt show..

alpine locust
#

const getEmbedWithUser = (user: User, mention: User) => {
    const image = PINCH[Math.floor(Math.random() * PINCH.length)]
    return new EmbedBuilder()
        .setColor(0x0099FF)
        .setAuthor({
            name: `${user.username} pinches ${mention?.username}!! Aaa, that hurts`,
            iconURL: user.avatarURL() || ""
        })
        .setImage(image);
}

#

The image does not show and its a poop image

vague coyote
#

then log image and make sure its the right one

alpine locust
#

Yes, I have logged the image and it shows the image in logs and if i click on the image it goes to the right url. eg:
https://tenor.com/view/itsuki-gotobun-anime-pinch-squeeze-gif-16237877.gif

vague coyote
#

looks fine to me

open copper
#

  registerEvents() {
    const eventFolders = readdirSync(path.join(__dirname, '..', 'events'));
    for (let folders of eventFolders) {
      const eventFiles = readdirSync(path.join(__dirname, '..', 'events', folders)).filter((file) => file.endsWith('.js'));
      for (let files of eventFiles) {
        const event: Event<keyof ClientEvents> = require(path.join(__dirname, '..', 'events', folders, files))?.default;
        if (event.event && event.run) {
          this.on(event.event, event.run);
        }
      }
    }
  };``` IDK why is my event handler doesnt work
dawn phoenix
#

nothing to do with the dev version of discord.js

jade meteor
#

DiscordAPIError[0]: 401: Unauthorized
at SequentialHandler.runRequest (/Users/abhi/Spherity bot/node_modules/@discordjs/rest/dist/index.js:748:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (/Users/abhi/Spherity bot/node_modules/@discordjs/rest/dist/index.js:560:14)
at async REST.request (/Users/abhi/Spherity bot/node_modules/@discordjs/rest/dist/index.js:1000:22) {
rawError: { message: '401: Unauthorized', code: 0 },
code: 0,
status: 401,
method: 'PUT',
url: ,
requestBody: {
files: undefined,
json: [
SlashCommandBuilder {
options: [],
name: 'ping',
name_localizations: undefined,
description: 'replies with pong',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: undefined,
dm_permission: undefined
}
]
}
}

#

why do i get this error, with correct guild and token??

dawn phoenix
#

the application you are trying to deploy commands for and the token you use do not match

jade meteor
#

i checked many time

#

its correct tokens

dawn phoenix
#

that is what that error means

jade meteor
#

yes i understand

#

but what else it could be?

dawn phoenix
#

nothing, that is what that error means

steel haven
rich mason
#

hey, is it possible to give one user immunity to slowmode on a channel?

#

the bot creates a thread that anyone can type in and I want staff and the user who solicited the thread creation to have slow mode immunity

dawn phoenix
#

immunity to slowmode is handled via the manage messages permission

uncut kelp
#

Or manage channel on the channel

rich mason
#

thx

#

im trying to handle some sort of voting system with reactions...
i need to allow a user to react only once to a message by removing the second reactions
is there a way to check if a user has reacted already from inside the collector's collect event?

plain roverBOT
#

Documentation suggestion for @rich mason:
property Collector#collected
The items collected by this collector

rich mason
#

@white nebula im actually trying to get all the other reactions other than the collected

boreal minnow
#

@rich mason why not use a select menu?

rich mason
#

client wants reaction

#

also, reactions in this case indeed looks better

#

it is kind of a pool system, and ther eis yes or no options.. so... i made it so it removes your other reactions when you add a new one

#
for(const emoji of config.reactionEmojis) {
            const mr = message.reactions.cache.get(emoji.name);
            if(mr.emoji.name !== messageReacton.emoji.name) {
                await mr.users.remove(user);
            }
        }
#

a bit slow.. but works

chrome spoke
#

What is the component used to add an emoji (normal or animated) to a button in json code in a webhook send? [sorted out]

dull mulchBOT
regal hemlock
#

Hii, does anyone know how to avoid your mongodb being sharded at the same time as index.js?

knotty plover
#

Connect in the sharder file, not the clients?

open copper
knotty plover
#

bot isnt logged in / ready

open copper
#

What is this mean

knotty plover
#

Importing Formatters as a class is deprecated, they'll just be top level direct exports in future

steel haven
graceful obsidian
#

when ever someone types anything in any server the bot is in, it sends this error
(link gone)

steel haven
graceful obsidian
steel haven
graceful obsidian
#

yeah alr

steel haven
#

And it definitely is a token. Just not for discord

graceful obsidian
steel haven
graceful obsidian
steel haven
graceful obsidian
steel haven
# graceful obsidian noo?

Then why is your code trying to login to it? Did you code it yourself? Or is there a framework involved?

graceful obsidian
dull quartz
#

hi guys, why embeds seem unnecessarily long? It wasn't like this before

cinder wraith
#

not like that's out fault in any way, but it's also not the first time ever that discord changed embeds

dull quartz
#

so

#

what can i do for this

cinder wraith
#

...?

#

what answer are you expecting?

dull quartz
#

embed messages used to be longer the longer their content is now it's getting unnecessarily long

white nebula
#

It looks like Discord simply standardized the length instead of having it vary, but there's nothing DJS can do to affect the width

dull quartz
#

but some bots look different messages work as before how do they do it

cinder wraith
#

they don't

hot yacht
#

The SlashCommandBuilder does not have a .from method.

knotty plover
#

Correct

hot yacht
#

Any reason for that? Every i there builder has a static .from method

knotty plover
#

There isn't much use for it

hot yacht
#

It should be added for consistency

dawn phoenix
#

what's the use case? command templates?

hot yacht
#

Json commands?

#

The same use case as for the other builders

dawn phoenix
#

but then you have the command already and the builder is useless

#

the use case for other builders is to use existing structures as templates

#

so you can, say, fetch an embed from a message and build on top of it instead of starting at 0 when editing it

hot yacht
#

Regardless of the use case, this method should be added for consistency. Im sure theres gonna be people that are gonna find a use case.

dawn phoenix
#

usually the people demanding that have one, hence me asking

hot yacht
#

👍

knotty plover
#

The use case for the other commands is to convert a received immutable embed into an EmbedBuilder, so you dont try to mutate cache

#

SlashCommands dont really have a 1:1 property equivalent, ApplicationCommands are a fairly different structure to a SlashCommandBuilder

scarlet tangle
#

Hi, I am trying to send an image embedded in v13, v14 dev and v14 versions, but it is not sending...

card.build()
                .then(data => {
                    setTimeout(() => {
                        const attachment = new MessageAttachment(data, "rank.png");
                        const newEmbed = new MessageEmbed()
                            .setColor("#2f3136")
                            .setDescription("You can earn 20% additional exp by voting for me on my Topgg page.")
                            .setImage("attachment/rank.png")
                        interaction.editReply({ embeds: [newEmbed], files: [attachment] })
                    }, 2000)
                });
#

When I send it as a regular file, it is sent without any problems ("The code belongs to the v13 version, but did not work when converted to v14")

uncut kelp
#

Well that code isn't compatible at all with dev

scarlet tangle
#

I said above that I adapted it to the dev version and tried it and didn't get any results, but I'm still going to the v13 channel.

#
                card.build()
                .then(data => {
                    setTimeout(() => {
                        const attachment = new AttachmentBuilder(data, "rank.png");
                        const newEmbed = new EmbedBuilder()
                            .setColor("#2f3136")
                            .setDescription("You can earn 20% additional exp by voting for me on my Topgg page.")
                            .setImage("attachment//:rank.png")
                        interaction.editReply({ embeds: [newEmbed], files: [attachment] })
                    }, 2000)
                });
#

These are the dev version codes

uncut kelp
#

Anyway this protocol is wrong

scarlet tangle
#

yes, you're right, it was a bit like that, sorry

scarlet tangle
uncut kelp
#

Well it should be ://

#

You know, like https://

scarlet tangle
#

I guess I can't see well, I thought I wrote that part correctly and I never felt the need to look at it.

#

Thanks for your help and sorry for not posting the dev code in the first place, it was irrational behavior.

uncut kelp
#

It's okay don't worry about it

mild apex
#

can anyone tell me how i can see my bots permissions in code in a server? I do coding in v14 but this doesn't seem to work for me?:
interaction.guild.me.permissions.has(PermissionsBitField.Flags.Administrator)

mild apex
#

Thank you :)

scarlet tangle
#

I need to fetch a file (.lua for example) and turn it into a code block, the bot can take inputs from "` ``" but not from files appaciarate any help

rich cipher
#

fs not djs related

twin torrent
#

I'm having a fit today, i don't know if many people have the same issue, but damn node.js 16.16.0 just refuses to download onto Ubuntu 22.04

knotty plover
#

How are you trying to install it?

twin torrent
#

doing a curl install, here is the thing, on another pc, it works, dose the hardware matters?

#

heh, even 14.x spits out the same error

#
dpkg: error processing archive /var/cache/apt/archives/nodejs_14.20.0-deb-1nodesource1_amd64.deb (--unpack):
 trying to overwrite '/usr/share/systemtap/tapset/node.stp', which is also in package libnode72:amd64 12.22.9~dfsg-1ubuntu3
Errors were encountered while processing:
 /var/cache/apt/archives/nodejs_14.20.0-deb-1nodesource1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
twin torrent
#

bruh, when did they drop d.js v14?

knotty plover
#

18th July

upbeat mantle
#

please I want someone tell me the details about _fetchMany and _fetchSingle funtions inside GuildMemberManager.js

dawn phoenix
#

you shouldn't directly use them, is all you really need to know

upbeat mantle
steel haven
#

Use the fetch method and let djs worry about the details😉

dawn phoenix
#

then you need to elaborate about what you are planning

#

else an explanation is a lot of writing with not all that much information density

upbeat mantle
upbeat mantle
#

mhmmm i think i didn't search correctly

upbeat mantle
#

please where is Auto Moderation in discord-api-types?

dull mulchBOT
graceful obsidian
open hatch
#

Hello, I created an embed on which there are buttons I would like to make sure that it deletes the embed sent before

open hatch
#

nevermind, I've just succeeded

humble knoll
#

I know this server is about discord.js only but the Puppeteer server is dead and I was hoping maybe someone here was familiar with the lib. I'm using it in my Discord.js bot if that helps. Basically the issue is, I get stuck on this prompt and seemingly have no way to interact with it. Doesn't trigger a dialog event and I can't interact with it through page keyboard inputs or mouse clicks. Any ideas?

steel haven
dark minnow
steady steeple
#

can someone you help me with this error, ||(and please for the love of f-ck if you send me a link to the front page of the d.js guide (Which provides no specific information or help) your a psychopath and I'm leaving the server))||

code which through the error (If you need more information please ask):

const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const fs = require('fs');

module.exports = (client) => {
    const { commands, commandArray } = client;

    client.handleCommands = async() => {
        const commandFolders = fs.readdirSync("./bot/commands");
        for (const folder of commandFolders) {
            const commandFiles = fs.readdirSync(`./bot/commands/${folder}`).filter(file => file.endsWith(".js"));
            
            for (const file of commandFiles) {
                const command = require(`../../commands/${folder}/${file}`);
                commands.set(command.data.name, command)
                commandArray.push(command.data.toJSON);
                console.log(`Command: ${command.data.name}`)
            }
        }

        const clientId = '';
        const guildId = '';

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

        try {
            console.log("application (/) command refreshing!");

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

            console.log("refresh successful!");

        } catch(error) {
            console.error(error);
        }
    } 
}
#

error code:

Command: ping
application (/) command refreshing!
DiscordAPIError[50035]: Invalid Form Body
0.name[BASE_TYPE_REQUIRED]: This field is required
    at SequentialHandler.runRequest (C:\Users\kech8\development\comp\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:287:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (C:\Users\kech8\development\comp\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.cjs:99:14)
    at async REST.request (C:\Users\kech8\development\comp\node_modules\@discordjs\rest\dist\lib\REST.cjs:52:22)
    at async Client.client.handleCommands (C:\Users\kech8\development\comp\bot\functions\handlers\handle_commands.js:29:13) {
  rawError: {
    code: 50035,
    errors: { '0': [Object] },
    message: 'Invalid Form Body'
  },
  code: 50035,
  status: 400,
  method: 'PUT',
  url: 'https://discord.com/api/v9/applications/1003740423463903233/guilds/1002060483735605328/commands',
  requestBody: { files: undefined, json: [ [Function: toJSON] ] }
}
knotty plover
#

command is missing a name is what the error says

#

Its because you pushed the toJSON function instead of calling it

#

commandArray.push(command.data.toJSON);

steady steeple
#

thanks

#

thats was dumb simple lol

knotty plover
#

Things often are

steady steeple
#

yup

regal gull
#

Anyone know if this has been fixed?

knotty plover
uncut kelp
#

If stuff isn't an issue it's just lost here in chat

#

I didn't even know about that

civic oyster
#

Hi! The "try catch" functions don't work for me when sending messages to the user. Can you tell me how to fix it? Or implement it in a different way?

              ^

DiscordAPIError[50007]: Cannot send messages to this user```
#

My code:

        bot.users.cache.get(UserID).send({embeds: [embed]});
    } catch (error) {
        console.log(error.text);
    }```
vague coyote
#

await the promise from .send() or use .catch()

hoary fox
#

is error.text a thing?

civic oyster
civic oyster
hoary fox
#

error has message

#

or name

plain roverBOT
#

mdn Error
Error objects are thrown when runtime errors occur. The Error object can also be used as a base object for user-defined exceptions. See below for standard built-in error types.

civic oyster
#

aaah, I understand what you mean) thanks

#

I made the function async, and set await before sending. it finally worked! thank you!

wheat heron
#

There is a problem for collectors concerning Modal submits.
When creating a modal and awaiting the submission, if the user cancels or clicks off the modal, the program has no way of knowing so the collector will wait until it times out.
It would be useful for collectors to receive a cancellation event, so that the modal can be requested again before waiting for the time out.
From what I can see the discord API doesn't actually provide for this situation yet though.

vague coyote
wheat heron
vague coyote
#

No idea.

wheat heron
#

All good, thank you for confirming that the API doesn't provision for it anyway!

plain spire
#

Excuse me, I run the same robot on multiple servers. For example, will guildMemberAdd events be triggered multiple times? How to solve the situation of triggering multiple times

vague coyote
#

not having the bot on multiple servers would be a way, or simply not listening to that event on the other servers

plain spire
#

Okay, thanks

real flume
#

I think I might have found a bug and I'd like to create a PR.
The file in question is packages\discord.js\typings\index.d.ts. The union ApplicationCommandOption is missing ApplicationCommandBooleanOption.

  1. Is this a bug? If so, I'm gonna create an issue on GH.
  2. How do I work on this? I think it would be a good first issue. Is index.d.ts automatically generated by a tool?
  3. Related to question 2: This is related to the main discord.js package, right?
#

Well maybe I shouldn't call this a bug, but rather incorrect typings.

hoary fox
real flume
#

But it should, right? Hence me asking.

hoary fox
#

idk dogeHaHa

gloomy kayak
real flume
#

if I do client.application.fetch().commands.fetch().first().options[0] I can easily get an instance of ApplicationCommandOption.
And using it's type property, I should be able to compare it with anything in ApplicationCommandOptionType. It works with .String, but tsc errors once I check for .Boolean.

#

Barebones example:

import { ApplicationCommandOption, ApplicationCommandOptionType } from 'discord.js'

let test: ApplicationCommandOption
if (test.type === ApplicationCommandOptionType.Boolean) {}
gloomy kayak
#

I can reproduce. Not sure if I'm missing something tho

elfin junco
#

anyone know how to create a message.channel.send({blah blah blah}) that performs like so?
I was thinking of having a switch tree where if a user inputs "luciddreams", "lucid dreams", or "lucid dream" then the variable would be set to simply "lucid dreams" for the message.channel.send({}) to read.

But I also wanted, say if they do enter "lucid dreams" and I have that switch tree that sets the variable 'title' as lucid dreams. Every cover art in my lucid dreams folder to be messaged into the server. Either through my local folder I have or if it's easier just through a discord message link that's linked to a message of image files that the bot can somehow pull the image from the message and display in the send.

knotty plover
#

just a switch case with overflowing cases?

carmine wadi
#

Is there any way I can use Timeout in discord.js?

uncut kelp
#

Yes

carmine wadi
#

How?

plain roverBOT
carmine wadi
#

Thank you

pseudo thorn
#

Hello
Is it possible to make a command of a whole category work in DM only?

uncut kelp
#

I don't think that's possible from Discord itself, but you can allow the command to exist in DMs and check when you receive the interaction to see if is present from a guild & return out

pseudo thorn
#

I'm coming from discord py where they is something like this
@commands.dm_only()

pseudo thorn
pseudo thorn
#

?

white nebula
pseudo thorn
#

So basically its not possible to create a command that can be used only in dm?

white nebula
#

Not so that Discord can disable using it in guilds altogether, but you can still manually return within your function

pseudo thorn
pseudo thorn
formal kernel
plain roverBOT
#

Tag suggestion for @pseudo thorn:
"Add to Server" button
• Developer Portal > Your app > OAuth2 (General) > Default Authorization Link
• Set authorization method to "In-app Authorization"
• Check scopes bot and applications.commands

Image: https://i.imgur.com/taMHw7o.png

pseudo thorn
dawn phoenix
#

yes

#

read the thing

#

"Add to Server" button

#

explains how it works

#

do it, will have it

pseudo thorn
#

Thanks

#

So what if i use custom
I can style the button or do it as i want ?

Any guidelines on that too?

dawn phoenix
#

no

pseudo thorn
dawn phoenix
#

no. you cannot customize it

pseudo thorn
#

Okay thanks

viscid forge
#
interaction.guild.channels.create( {name:category}, {type: "GUILD_CATEGORY"});
#

whats the right way to create a category in version 14?

viscid forge
#

this is outdated?

jaunty vault
#

that was never correct

plain roverBOT
viscid forge
#

thanks its fixed now 😄

viscid forge
neat pier
#

Docs bugged

#

Use main.

viscid forge
#

ohh i found it!

#

how do i stay updated with that info? like Interaction is BaseInteraction now?

plain roverBOT
#

Suggestion for @viscid forge:
guide Additional Information: Updating from v13 to v14
read more

viscid forge
#

@jaunty vault that resource was very helpful but I could not find the info that interaction was BaseInteraction in new version there

jaunty vault
#

guess they didn't put it in there

worn helm
#

quick question, is there a way to use the emoji selection without being kicked out of it as soon as I select something?

knotty plover
clever sky
#

@here can Anyone give me a Refresher on Importing discords library and replys to messages it's been a long while since I coded so I need refreshing

knotty plover
south bane
#

What major bots are made with djs

woven grove
#

Idk we don’t care

#

Neither do we keep track

weary ermine
#

@plain rover

lapis tulip
#

I am currently trying to develop a custom discord api wrapper (in python), but I have a question since this library works really well from my experience: how do you do heartbeat? Do you use JS/ES/TS-specific functions or an async loop?

steel haven
lapis tulip
#

Ah, I see, an interval

#

Welp, gonna have to use Threading

viscid forge
#

is there a way to get a channel or a category by its name rather than the id?

outer bane
#

you can use find

plain roverBOT
#
const channel = client.channels.cache.get("222086648706498562");
const channel = client.channels.cache.find(channel => channel.name === "general");

• Caches in discord.js are Collections which extend the native Map structure.
• learn more

viscid forge
#

thanks 😄

pseudo thorn
#

How to i check if the interaction is happening in DM

steel haven
pseudo thorn
mint vale
#

what is the hex code of this

steel haven
#

That’s probably Blurple, no hex code needed

mint vale
#

what is the code of blurple

pseudo thorn
#

Can i hide some specific commands from been shown when / is typed

You know by default discord suggests you all the possible commands any way to hide some from showing?

hybrid jungle
#

Hey, what's the latest v13 stable version?

mint vale
pseudo thorn
steel haven
mint vale
steel haven
dark minnow
plain roverBOT
mint vale
pseudo thorn
# mint vale what code

open your discord on your pc using Firefox and open developer menu and go to inspect look at the top right corner of the menu you will see a hex code pick us it to

pseudo thorn
steel haven
hybrid jungle
#

.

steel haven
pseudo thorn
dark minnow
mint vale
steel haven
pseudo thorn
#

Still doesn't solve it
Because it's not hidden

dark minnow
steel haven
pseudo thorn
dark minnow
pseudo thorn
#

Where can i host my bot free?

cinder moth
#

how do i setup rich presence on my bot?

steel haven
cinder moth
#

what if i do?

steel haven
cinder moth
#

@plain rover is using rich presence for "add to server" or is it something diffrent?

formal kernel
#

why on earth are you asking a bot

plain roverBOT
#

Tag suggestion for @cinder moth:
"Add to Server" button
• Developer Portal > Your app > OAuth2 (General) > Default Authorization Link
• Set authorization method to "In-app Authorization"
• Check scopes bot and applications.commands

Image: https://i.imgur.com/taMHw7o.png

cinder moth
steel haven
cinder moth
#

yea yea you guys are just making drama, ty

formal kernel
formal kernel
dark light
woven grove
#

lol

pseudo thorn
dark light
cinder moth
#

yes, misspelled

dawn phoenix
#

hosting discussion goes elsewhere, thanks

pseudo thorn
#

Xd?

pseudo thorn
plush nest
#

Hi, this is normal on the function 'addNumberOption' it is impossible to use the functions 'setMinValue ...'

knotty plover
#

No

plain spire
#

Hi, please ask a question. The connection BOT reports this network error. Is there any solution or VPN

knotty plover
#

Nothing to do with discord.js

#

Fix your connection

plain spire
#

Is there any recommended VPN

knotty plover
#

No

west loom
dawn phoenix
#

and stop. this channel is for issues and questions regarding the development release, not hosting

bitter lodge
#

Hello, how to start on creating a bot?

vague coyote
bitter lodge
#

thanks

dark minnow
#

While the Forum's Channels aren't added, the message event will trigger under the Unknown channel type?

uncut kelp
#

I don't think it will emit at all

#

We check if a channel is text-based before emitting that event. Since forum channels are not yet implemented, it will ignore it as it is not included in the text-based channel check

vague coyote
#

arent forum posts just threads

uncut kelp
#

Dunno lol

outer bane
#

the event should emit, @plain rover uses it

#

iirc it's the channel's parent that is null

uncut kelp
vague coyote
outer bane
#

not for interactions but I think it does for the ws connection to this guild

steel haven
zenith sky
dawn phoenix
#

please don't advertise questions in other channels
we look through forums regularly

midnight plume
#

When support for new gateway for reconnection event is planned XD ?

woven grove
#

?

dark minnow
#

It just got announced lol

dark minnow
knotty plover
#

Yeah I feel like you knew this question was basically a troll so kindly don't

dark minnow
#

I actually didn't though that tbh, but sorry

#

I suggested as a way to start to have a proper place to talk about the implementation

knotty plover
#

Oh no you, I meant the original question about when its planned

dark minnow
#

Oh 😅

steep kiln
#

Hey -- so I've got a djs bot that's gotten pretty popular -- I'm wondering if there's any best practices or tips for optimizing getting that interaction.deferReply out so the user doesn't see "interaction failed" when a lot of people are clicking buttons at the same time

#

Feels like since node is single-threaded there's kind of a hard limit on scaling with djs -- maybe worker threads are a solution? Though I expect you'd have to spin up a separate client on each thread and use a ton of memory, and deal with "unknown interactions" as well. But any thoughts or ideas on running a single djs bot on multiple processes?

copper jetty
#

dude use sharding

steep kiln
#

Ah I found it in the docs, ty!

plain roverBOT
steep kiln
#

Question about sharding -- if I set the totalShards value to a number, does it automatically divide all the guilds the bot is in by that number and put them into the shards? Is it possible to force certain higher-activity guilds into separate shards?

#

My bot is only in ~600 servers but it has a lot of interactions, especially in ~100 of those servers

#

So leaving it on auto doesn't seem like it will do anything for me

idle galleon
#

Guilds are assigned a shard based on the number shards you have and the created timestamp part of the id of the guild

steep kiln
#

Well this seems to work fantastically! And heroku gives 256 processes so tons of room to grow! Thanks you guys for helping me

inland wharf
#

hello, can somebody help me with something?

steel haven
upbeat mantle
#

please in MessageDelete.js file in actions folder, there is variable called message message = this.getMessage(data, channel); , so how can i know if this message is an embed?

vague coyote
#

Check if message.embeds.length is bigger than 0, also I dont really see how this is dev related

upbeat mantle
#

please i have been discovered a bug so if i made pull request how can i explain the bug like what i put to make pull request accepted

vague coyote
#

You just... explain the bug and your fix... if its an actual bug it gets merged

upbeat mantle
#

ok but if i made a changes in the coding of the file how can i explain that 😆

dark minnow
#

Writing what you did in the pr description

#

And follow the proper commit names

vague coyote
#

There are contribution guidelines, you should read them

upbeat mantle
dark minnow
#

What you changed, what was broken, how the code make the thing break

dark minnow
upbeat mantle
#

so how can i show the code i have been edited

dark minnow
#

GitHub already do this

upbeat mantle
#

i am sorry but i can not understand

dark minnow
#

Look at other prs commit pages, those are changes to the code

#

When you post your pr and commit something it will have those changes there

#

But look at some tutorials of Git and Github on the web

dark minnow
#

Before PR something

upbeat mantle
cold crown
#

i want to do , in any voice , using command will generate an invitation to enter that channel

plain roverBOT
rose estuary
#

just upgraded to v14 on djs and

#

node:events:505
throw er; // Unhandled 'error' event
^

DiscordAPIError[50035]: Invalid Form Body
0.type[NUMBER_TYPE_COERCE]: Value "CHAT_INPUT" is not int.
1.type[NUMBER_TYPE_COERCE]: Value "CHAT_INPUT" is not int.

#

tried exploring about it to fix it but still unable

jaunty vault
rose estuary
#

ok wait lemme check

#

ohk got it changes in slash commands

#

thanks btw

cold crown
dark minnow
#

The docs are for the voice channel

cold crown
plain roverBOT
#

Suggestion for @cold crown:
guide Getting Started: Introduction
read more

upbeat mantle
#

please it is a problem if it shows merged blocked?

woven grove
#

what PR is this?

white nebula
upbeat mantle
upbeat mantle
#

please if i made a feature that if someone added role or removed role from the member, and it will get the executor that added role and all details without user making a complex code,
are this feature is exists or not?

steel haven
upbeat mantle
upbeat mantle
idle galleon
#

It’s prob named ApplicationCommandOption

upbeat mantle
#

it is APIApplicationCommandOptionChoice not APIApplicationCommandStructure

#

i think i can not find APIApplicationCommandStructure

idle galleon
#

Remove Structure

steel haven
idle galleon
#

The link does seem to be scrolling to the wrong one

#

Nvm, worked when I reopened it like a 3rd time

upbeat mantle
idle galleon
#

Structure is not part of the name

#

There’s no reason to suffix every interface w/ Structure anyways

upbeat mantle
#

bro i want this exact features

idle galleon
#

That looks like a received/fetched application cmd

#

Only bc the version is non-nullable, but ur not allowed to set that when creating/updating a cmd

#

But that’s under APIApplicationCommand

upbeat mantle
#

ok thx

scarlet tangle
#

My bot is not coming online, something with Discord?

knotty plover
#

Probably not. What does this have to do with developing discord.js

gleaming scaffold
#

what is the use of discord.js v14?

uncut kelp
#

What

gleaming scaffold
#

how is it differant from the other api versions?

uncut kelp
#

Read the update guide

gleaming scaffold
#

i mean

#

what is the advantages

gleaming scaffold
ancient fox
#

I have a question. If v13 still has updates coming then wouldn't that be seperate from v14 updates? Like wouldn't they be different versions so v14 wouldn't end up getting those improvements from v13 updates

uncut kelp
#

V13 only gets what V14 gets

ancient fox
#

Makes sense

earnest lagoon
#

if (msg.has.embed) return;

#

?is this right

#

@uncut kelp

knotty plover
#

not even slightly

#

This isnt a topic for this channel, please dont ping people for answers to questions #rules

mystic raven
#

RangeError: Non-link buttons cannot have a url
how to fix this?

vague coyote
#

set the style to Link

mystic raven
#

ah oke

#

How can i copy attachments from message into a embed that u can see it as the Image of the embed?
and can gif be also in the embed image

mystic raven
#

oh shit

reef meadow
#

Hi
Idk if it's the right channel for ask that but does last discord gateway change (see #discord-dev-news) will be supported in next djs version ?

#

Haven't found recent commit or PR about that in discordjs/discord.js repo

dawn phoenix
reef meadow
#

Mb

steel haven
#

Not related to the development release of djs, wrong channel

upbeat mantle
#

please are autoModeration available in discord js?

#

i can not see it in the docs

dull mulchBOT
steel haven
#

Discord needs to finish their documentation of it first, then djs can release it. We don’t release undocumented features.

upbeat mantle
#

ok

upbeat mantle
#
export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
    /**
     * The message contents (up to 2000 characters)
     */
    content?: string;
    /**
     * Override the default username of the webhook
     */
    username?: string;
    /**
     * Override the default avatar of the webhook
     */
    avatar_url?: string;
    /**
     * `true` if this is a TTS message
     */
    tts?: boolean;
    /**
     * Embedded `rich` content
     *
     * See https://discord.com/developers/docs/resources/channel#embed-object
     */
    embeds?: APIEmbed[];
    /**
     * Allowed mentions for the message
     *
     * See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
     */
    allowed_mentions?: APIAllowedMentions;
    /**
     * The components to include with the message
     *
     * Requires an application-owned webhook
     *
     * See https://discord.com/developers/docs/interactions/message-components#component-object
     */
    components?: APIActionRowComponent<APIMessageActionRowComponent>[];
    /**
     * Attachment objects with filename and description
     */
    attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
    /**
     * Message flags combined as a bitfield
     */
    flags?: MessageFlags;
    /**
     * Name of thread to create
     *
     * Available only if the webhook is in a forum channel and a thread is not specified in {@link RESTPostAPIWebhookWithTokenQuery.thread_id} query parameter
     */
    thread_name?: string;
    /**
     * JSON encoded body of non-file params
     */
    payload_json?: string; // new here....
}>;

please if i added payload_json in RESTPostAPIWebhookWithTokenJSONBody it will make sense or what?

glass sierra
#

Hello,how to add ban user cmd to bot?

scarlet tangle
knotty plover
steel haven
upbeat mantle
#

ok

#

please if i added in audit-log.md like who edited message or who made role and more... , my pull request will be valid or no?

steel haven
upbeat mantle
upbeat mantle
#

please what is js {2-7,9-10,12-14,16-22} in the .md file like ```
js {2-7,9-10,12-14,16-22}
..coding

queen sable
#

line 2,7,9,10,12,14,16 & 22 are the lines that are highlighted in the codeblock

white nebula
raven owl
#

hello

upbeat mantle
#

please i can not understand what is diffrence symbol do - in highlighted code , like that js {2-7,9-10,12-14,16-22}

steel haven
upbeat mantle
#

mhmm ok

ruby tartan
#

Am i able to ask a question about threads here?

dawn phoenix
ruby tartan
#

Got it. Thank you so much! 🙂

scarlet tangle
#

What is the code to add permissions on V14

steel haven
woven fractal
#

how do i fix this error? sv RangeError [BitFieldInvalid]: Invalid bitfield flag or number: GUILDS. at IntentsBitField.resolve (C:\Users\user\OneDrive\Dokumenter\discord\SZ Bot\node_modules\discord.js\src\util\BitField.js:168:11) at C:\Users\user\OneDrive\Dokumenter\discord\SZ Bot\node_modules\discord.js\src\util\BitField.js:163:54 at Array.map (<anonymous>) at IntentsBitField.resolve (C:\Users\user\OneDrive\Dokumenter\discord\SZ Bot\node_modules\discord.js\src\util\BitField.js:163:40) at Client._validateOptions (C:\Users\user\OneDrive\Dokumenter\discord\SZ Bot\node_modules\discord.js\src\client\Client.js:482:41) at new Client (C:\Users\user\OneDrive\Dokumenter\discord\SZ Bot\node_modules\discord.js\src\client\Client.js:78:10) at Object.<anonymous> (C:\Users\user\OneDrive\Dokumenter\discord\SZ Bot\index.js:5:16) at Module._compile (node:internal/modules/cjs/loader:1120:14) at Module._extensions..js (node:internal/modules/cjs/loader:1174:10) at Module.load (node:internal/modules/cjs/loader:998:32) { code: 'BitFieldInvalid'

forest elm
#

GUILDS -> Guilds

woven fractal
#

doesn't work

#

or

#

now the error is RangeError [BitFieldInvalid]: Invalid bitfield flag or number: Guild_Messages.

woven fractal
#

Thank you very much to both

upbeat mantle
#

please why it shows 2 changed things in PR i want only 1 change !!!!

hoary fox
#

u changed Emoji class and
MessageDelete action

upbeat mantle
#

ok i want MessageDelete doesn't show

hoary fox
#

so remove changes in this file?

upbeat mantle
#

i removed it!

#

lol the wrong in the branch]

#

i fixed it anyway

knotty plover
upbeat mantle
#

why it shows this hole commits in the PR i want only one commit !

knotty plover
#

Because youve messed up your branches

#

or quite literally made that many commits

#

It can only show commits that you made

upbeat mantle
knotty plover
#

how what

#

These are commits you made

upbeat mantle
#

ok, so it should have only 1 commit for 1 changed file in PR not 10 commits so i want show only one commit in PR how?

knotty plover
#

I mean its technically possible to reset the entire thing and cherry pick one commit

#

Or rebase and squash them all but like

#

Thats not how commits work, you dont get to choose what it shows

#

You made 10 commits, it shows 10 commits

upbeat mantle
#

ok now i am understanding thx for help bro

knotty plover
#

That solution is still very incorrect though

#

The maintainers would never accept it in that state

upbeat mantle
knotty plover
#

The PR you opened

upbeat mantle
# knotty plover The PR you opened

that has this ?

url(extension) {
    let final_result;
    if (extension === 'png' && !this.animated) {
      final_result = this.id && this.client.rest.cdn.emoji(this.id, 'png');
    } else if (this.animated && extension === 'gif') {
      final_result = this.id && this.client.rest.cdn.emoji(this.id, 'gif');
    } else if (extension === 'webp' && !this.animated) {
      final_result = this.id && this.client.rest.cdn.emoji(this.id, 'webp');
    } else if (extension === 'jpeg' && !this.animated) {
      final_result = this.id && this.client.rest.cdn.emoji(this.id, 'jpeg');
    } else if (extension === 'jpg' && !this.animated) {
      final_result = this.id && this.client.rest.cdn.emoji(this.id, 'jpg');
    } else if (!extension && !this.animated) {
      final_result = this.id && this.client.rest.cdn.emoji(this.id, 'png');
    } else if (!extension && this.animated) {
      final_result = this.id && this.client.rest.cdn.emoji(this.id, 'gif');
    } else {
      final_result = undefined;
    }
    return final_result;
  }
knotty plover
#

yeah, no

#

We would never use an else if chain like that, its pointless duplication of code

#

The method also isnt correctly documented and typings werent updated

upbeat mantle
knotty plover
#

uhhh, none of the above? the existing code was essentially fine, extension just needed to be a variable instead of hardcoded .png

#

Optionally you could probably use one of the existing url options types for { forceStatic, extension }

velvet jasper
#

@upbeat mantle we see you want to contribute and that’s fine. However, it seems you’re missing the foundational JavaScript prerequisites here. I think it would be better if you took some time to learn more of JavaScript before trying to contribute again.

knotty plover
#

Mate if I'm going to write an example I might as well do the PR myself

#

Not going to spoon feed you contributions

upbeat mantle
knotty plover
#

Contributing to the library should not be an exhausting support conversation

#

Its ImageURLOptions or something idk

upbeat mantle
upbeat mantle
#

please why it shows this when i do commit?

knotty plover
#

I dont even know at this point

upbeat mantle
knotty plover
#

something wrong with your dependencies installed for discord.js

upbeat mantle
#

because when i make npm install it shows an errors

knotty plover
#

have you followed the contributing guide?

upbeat mantle
#

i will fix it

knotty plover
#

The contribution guide uses yarn though

upbeat mantle
#

yeah thx there is something i forgot to do

slate mango
#

@upbeat mantle please refrain from duplicating PRs any further, you can just edit existing branches (and PRs) by pushing new code to it. One PR is enough, 3 is too many, and it only places a further burden on the maintainers as well as the notifications of the 433 people who watch the repository.

All of the last three PRs contain code that either:

  • Introduces invalid JavaScript (#8490)
  • Introduces code duplication (#8491)
  • Introduces code that does not adhere to our style (#8491 and #8493)
  • Introduces tests that cannot be tested by others (#8493)

Also, all three PRs do not have the description filled out, this is a bad practice and edges getting an "invalid" label. I would suggest you write them in the future.

On top of that, the change is a breaking one, this means it would have to wait for v15, which is still very far away from happening (we don't even know if it'll be JS or TS!). The only correct way to implement this change is by creating a new method (getImageURL) and deprecating the getter, updating everything else accordingly.

If you are not confident in your Git or JavaScript skills, then I must remind you that Discord.js isn't really a playground for beginners, we require code to be up to our standards. We try to help anybody who struggles, but sadly we can't be holding your hand all the time, there's a limit on how much time we can spend helping.

If all you want is to contribute, you can always open an issue explaining what you want, then you or somebody else can pick it up and submit a PR, this is generally a very accepted approach to contributing in many repositories: they're very welcome and often easy to make (just a bit hard to spot! And you spotted one, that's great! \o/)

upbeat mantle
# slate mango <@558922015105351701> please refrain from duplicating PRs any further, you can j...

hello kyra,
firstly thanks for telling me about that and it is good note,
so i am not beginner at well i have 4 years experience in javascript and typescript already anya_smile

my problem is i can not understand the system that discord js in the pull requests,
so i am trying and i am doing effort to make a feature in discord js or fixing a bug in it , i am just trying at all methods,

so i will wait for the reviewers to review my pull request and i will see if they will accept it or not.

at all i am sorry for annoying and open many pull requests i will not do my fault again and at all we do mistakes

#

and we will see what reviewers can suggest to do !

#

and yeah, i do not knoow why this error comes and i am doing everything well !!

#

we will see everything\

woven grove
#

why aren't you leveraging those 4 years of experience

upbeat mantle
slate mango
#

On a side note, what Discord.js uses is pretty much industry standard, we don't require special stuff or extra steps before contributing, so if you have at least some knowledge in Git and GitHub, you should be fine with Discord.js as well.


#

Making mistakes with Git because you never used it in the 4 years of JS is understandable, they're different technologies with different purposes.

What Crawl is saying here, is that you claim to be an experienced JS developer, but it doesn't add up with what we're seeing in your code.

upbeat mantle
upbeat mantle
#

please can someone from reviewers see this PR it has been 1 day and no one from reviewers made any response and from 5 hours i have been made a new changes.

knotty plover
#

lol 1 day is nothing dude

#

Kyra and Crawl both gave you their thoughts here though

upbeat mantle
knotty plover
#

That was me replying to those

cinder wraith
#

yes, the initial replies to a PR. but you did 3 PRs already, and most of the comments you would get would be just copy pasted anyway.

crisp shadow
#

Hey quick question, what "coverage" is it talking about in PRs?

summer tundra
# crisp shadow Hey quick question, what "coverage" is it talking about in PRs?

"coverage" is referring to covering all the lines of code
for instance, when you add an if-statement, you need to have tests that execute the if. similarly, if you also have an 'if' and an 'else', you need to have tests that execute the lines in the 'if' as well as the lines in the 'else'

a reduction in coverage % indicates there are lines of code that don't have tests executing them (and would then be "untested code")

dawn phoenix
#

this channel is for the in-development version of discord.js specifically
this seems to be an issue with your storage setup and is not on topic for this server

wide ermine
knotty plover
#

we dont support discord-buttons

wide ermine
#

What?

knotty plover
#

We, the discord.js server, did not make, publish, and do not support the use of the npm package discord-buttons

#

It has nothing at all to do with us, and it's use is not recommended

#

discord.js includes support for buttons natively

wide ermine
#

ok

dark minnow
#

I would like to suggest the bot to have an delete button for the first 10-15 seconds on all the queries

#

Or an way to preview messages before they get sent

copper jetty
dark minnow
#

Yeah, I know, the reason I think a delete button is useful is to when:

  • Clicked the wrong tag or the tag content isn't the one you wanted
  • The documentation sent isn't the one necessary for the user, making the support probably more difficult and confusing
  • The less reliable queries like Node and Mdn does not point to the location you wanted them
  • Guide has a lot of duplicated names and sometimes it's is difficult to find the exact topic you wanted
#

Yuudachi had when it was the main bot for docs

spring otter
#

https://github.com/discordjs/discord.js/issues/8084

Having a single state store and using a message broker would be handy.

Have the client be orchestrator agnostic and have RPC be pluggable.

I'm a fan of https://dapr.io/, CNCF hosted OSS ect.

There are tons of projects that can do the hard parts already, building on top of them seems like a smart choice. Lifecycle handling, secret management, state management, message delivery can be made to be plug and play.

Q: Why is eval necessary?

slate mango
#

Q: Why is eval necessary?
A: Legacy, discord.js has had broadcastEval since it has a sharder. I find it unnecessary and want to remove it in favour of safer and faster alternatives.

#

dapr looks interesting, I already had plans to make all components of the sharder pluggable, via strategies.

My experience with many tools in the ecosystem is pretty negative, though, many of them limit our options, are legacy software, have some kirks that blocks our projects, or some other reason. My idea was to try to implement it using what I have learnt over the last years of this, although my knowledge falls limited when it comes to remote sharding (aka cross-server sharding), I feel confident about my skills with local sharding.

Then again, my idea of the remote sharder is to make it, just like the local sharder, customizable to the point you don't even need to use it, as long as you follow the protocol.

If some tool has a protocol that could be useful for our sharder, please let me know and I'll investigate if I can include it in the RFC for implementation.

spring otter
#

Agree with the eval removal, eval and object poisoning are always what get people.

Building on top of Dapr would create some lock in*, But it's CNCF (aka TONS of funding and support) and allows people to use whatever they want. Redis, postgres, Kafka, nats, cloud services, blob storage (S3 ect). It can run on normal docker, bare metal or k8s, and is super super light / fast. Also has telemetry (tracing ect). I would recommend giving it a look and popping in their discord. They are super responsive, have active community calls and again , backed by major company with deticated engineers.

Protocol wise: grpc gets my vote

https://cloudevents.io/ or having a standard for RPC is always nice.

Other projects are probably to heavy for the normal users tho (consul/zookeeper)

slate mango
#

I must also add, while the sharder will have some sort of RPC, I discourage the rather over-usage of it, they're optimized for talking to other processes across the... tree, but not between leaves, you should use Redis streams, RabbitMQ, gRPC, or any other similar tool for that.

#

I'm a fan of gRPC too, used it on .NET projects and it's wonderful how nice it works. But the tooling for Node.js... iara_sigh

#

Still, because of the first sentence, the sharder will be kept simple and rather low-level with high control. Simpler things are harder to break after all, and the low-level API allows you to use whatever you want.

Mind you that the tree communication is irreplaceable in some cases, you can't replace how Node.js's child processes work and talk to the parent. Network sharding is easily replaceable, yes.

spring otter
#

That would be the good thing about Dapr, communication across shards can be done directly or over a message broker.

As an added bonus, the rest of Dapr opens up to devs, so they can create functionality without having to pull in other libraries if wanted. Would also open up having "commands" living outside of the client process, so the shared clients would be privileged (has token in memory) and commands would be outside of the node process. (Node sandbox is a thing but it's not the best...)

Yeah, the tie in with Dapr would be a dependency.

I'll have to think about what the client really needs to expose to allow easy extensions.

slate mango
#

Of course, I'm not saying we're going to replace things like gRPC, those have dedicated tools like source generators that would otherwise be too painful to maintain for us. We would just expose whatever is needed to make gRPC (or anything else) easier to use.

Also, a sharder's job should be to shard, it doesn't include communication between them, that's just an extra I added for convenience and for small setups.

spring otter
#

But if there is sharing, there is still going to be some level of shared state.

I'll think a bit more about the topic and see what else I can find.

I believe adapting the client a little while working on sharding could make DX a lot better.

slate mango
#

Uhm... I'm not really a fan of this from Dapr

#

Oh wait, I misunderstood it, sorry, the slides were moving too fast and made me mix some stuff.

slate mango
spring otter
#

That's a bit overkill of a design (the photo)

I image Dapr as being a small helper for discordjs to either:

Give if free RPC to the other shards (http, grpc built in)

State store if the project desired (redis, postgres, internal) rate limiting, command registering, shard client stats, client stats,

Telemetry (logging, tracing, metrics)

Super easy Dev exp

slate mango
#

Shared ratelimiting can already be achieved with @discordjs/proxy, by the way 👀. There's also a Docker image for it.

#

Command registering, I believe the guide recommends it must be done manually by the developer, and not automatic by the bot.

#

Shard and client stats are easily retrievable through tree communication, current discord.js already does that. But yeah, with the current RFC, you would need to make the brokers yourself, or wait for us to release said brokers (I believe Crawl had plans around them) which simplifies this enormously anyways.

#

Telemetry... that I don't know much about what the industry standards for it are, there are way too many possibilities, you still have all the hooks needed to make your own, though, or at least, that's the idea. With current RFC, that would probably be a separate package to keep the main package simple.

spring otter
#

With a shared state, it wouldn't need a proxy, it could just query a shared state

Command registering would just be a helper, not exactly a built in.

Registering allows a client side shared state to push up, this can then be built however the person wants(polling for changes, pushing new code, registering it with invoke)

Currently you can call across all shards, but they each have their own state and you then have to reduce across. Now adays state stores are so fast you can share them network side for almost free*

Telemetry is standardized nowadays with https://opentelemetry.io/

slate mango
#

As for Dapr having HTTP/gRPC built-in, I'll need to see tooling and code examples, see how they compare, if they're user-friendly and have first-class TypeScript support.

#

With a shared state, it wouldn't need a proxy, it could just query a shared state
/rest supporting shared state is in our backlog, that's absolutely not the sharder's job. And /ws supports strategies for shared state as well, /sharder would just hook it to its shared data and update accordingly so they don't hit it.

#

Command registering would just be a helper, not exactly a built in.
Current RFC makes this inevitable, because we need a way to distinguish between a shutdown and a re-shard request, for example. 😅

#

Registering allows a client side shared state to push up, this can then be built however the person wants(polling for changes, pushing new code, registering it with invoke)
Are you talking about blue/green deployments? If so, I have many questions about it, primarily, how do they work alongside Docker containers.

spring otter
#

(side note: if discordjs has auto instrumentation for tracing that would be sooo nice)

I'll pull up some docs / examples or make poc one really quick.

While it's not the shaders job, if you are going to be adding a dependency or DIY, might as well plan for shared usage

Yes, kind of, I'm more looking towards the decoupling of the shards, clients and the business logic

slate mango
#

Currently you can call across all shards, but they each have their own state and you then have to reduce across. Now adays state stores are so fast you can share them network side for almost free*
That's because the current (and RFC) way is to have tree communication, since it's a side-effect of processes having a parent they can talk to in both ways. Supporting inter-leaf communication is outside of the sharder's job. Shared caching is too, but we'll support it via hooks to help making network sharders more resilient by not having the data in a single point of failure.

#

side note: if discordjs has auto instrumentation for tracing that would be sooo nice
May I ask what do you mean with tracing? 🤔

spring otter
#

Docker containers are just a host, the control plane on top does blue green (nomad, k8s, swarm, custom IAC)

This kinda blurs the lines of the shaders job. I imagine a case where the goal is HA, rapid releases.

#

Tracing: moment on that one, just manually did a opentelemetry Jaeger one last night I can make some screen caps for, lemme find a link tho for ya

slate mango
#

Oh, tracing is part of opentelemetry, I also see the package is written in TypeScript, that's a relief. Kinda looks like Sentry SDK too 😅

spring otter
#

Open telemetry is a standard

#

It just defines a spec so other tools can use it.

It's just for tool introp, since it was starting to get fragmented. Think of it like a protocol like grpc that also comes with helper libraries.

slate mango
#

You'll have to elaborate more on the gRPC example, I never used it as a protocol or as a spec, but more as a CLI (to generate the JS/TS code) and a library (calling the generated code), kinda like how Prisma does, except for RPC.

spring otter
#

gRPC is a spec / standard that encodes binary data

It has a specification that allows others to develop libraries to handle it

gRPC also comes with implementations of the standard/ spec that can consume a proto file and create client libraries to use.

it's like http, http is just an old RFC that people built tools around. gRPC just happens to have centralized premade tools.

Opentelemetry Is a spec that was meant to give a common ground for players like sentry, datadog and tools like Prometheus, Jaeger ect to use

slate mango
#

gRPC is a spec / standard that encodes binary data
Is it? I thought that was more protobuf's thing. And gRPC more about about the whole system combining HTTP2 with extra stuff and protobuf 🤔

spring otter
#

Apologies, you are correct, protobuf is the underlying format, tied the two together in my mind.

The http example still works

slate mango
#

Wrapping up:

I want to keep sharder simple, I also want to have the local sharder done first, the 99% of djs users use it. In remote sharding, I also want to encapsulate the local sharder as if it was a single shard rather than a cluster of shards, it simplifies the process even more.

Furthermore, with the possibility to make HTTP-only bots, the needs for huge infrastructures is reduced, and one can handle slash commands and interactions in a more standarized stack for HTTP servers, if not in a single server due to how lightweight those bots are. Making a hybrid bot isn't too hard at all, and if done correctly, it can easily scale very well as long as things are kept separately.

Custom message formats are supported by the RFC, so you can use JSON, V8, ETF, protobuf, or whatever else. And so are commands. I might need to look into authentication for the shards as an extra security step.

Both local and remote sharders will have hooks to have an easy way to store state information in a shared place (e.g. Redis), and of course, this also comes with a way to recover with it.

Do we want to support custom protocols for remote sharders? Like TCP (raw, HTTP1.1, HTTP2) or UDP (QUIC). Or stick to one for simplicity? The strategy system abstracts it away anyways, so not like it makes the sharder code any more complex.

Leaf-to-leaf communication will not be supported out of the box, tree communication will (most methods of sharding open a channel we can use for this. Besides, shards need to talk to the parent and vice-versa, but doesn't need to talk to others, that's extra complexity). We may publish message brokers in the future to make leaf-to-leaf easier. Most likely powered by Redis streams, but other brokers may be done.

Telemetry (and tracing) are missing in the RFC.

Did I miss something else?

spring otter
#

Only thing I would like to emphasize is keeping in mind dev experience. From adapting the bot to support sharding to operations and deployment, some have roots in client deployment and sharding itself. This includes security.

slate mango
#

I plan to make sharder use sensible defaults, so it runs a reasonable level of security and user comfort. The very low-level serialized data would surely be abstracted to give the user's hooks/strategies the ready-to-use deserialized one. I also want to keep in mind that in some cases, the OS can do some of the security for us (e.g. firewalls), so there isn't really much of a necessity for a secondary layer. Of course, most users don't know how to configure the OS, so such things would be opt-out if anything.

There are also SSH tunnels which I plan to support once I learn the how.

spring otter
#

I would avoid using ssh tunnels.

Security should be as easy as possible, and encourage safe use. This point should steer protocol choices away from unauthenticated or poorly deployed options . (I would go so far to say that tokens should ONLY be loaded from process env and discordjs should integrate secret loading with SOPS or have more tutorials on secret management. There are to many tokens on github)

The threat model for discordjs should be defined a bit.

Instead of ssh tunnels, normal VPN's (WG). Other options would be a tad better but the easier the better

slate mango
#

Right, the VPN model might be a lot easier to adopt in large projects.

I believe we mention the usage of ENV for secrets (including Discord's token) in the guides, but as for any library, values must also be specifiable without ENV.

(Also, what's SOPS? We use dotenv or dotenv-cra for loading ENV files anyways)

spring otter
#

https://github.com/mozilla/sops

helper for keeping secrets

SSH tunnels mean users have to secure SSH on their systems. WG and ssh both need key management, but one gives access to an entire machine and the other to a network.

slate mango
#

Ok, it's too late for me now (2:28 AM) to understand the advantages of SOPS over... dotenv-cra or something.

I'll update the RFC tomorrow to include some of the stuff we talked about, and talk internally about the brokers.

spring otter
#

SOPS it just encrypts files,

The ideal would be force people to only pass in the token at the commandline or heavily discourage leaving tokens around, SOPS is not really a full solution

Goctha, Have a nice night / sleep!

slate mango
#

I just find SOPS very... overkill, dotenv-cra allows you to have .env (always loaded), .env.production (overrides for prod), .env.production.local (local overrides for prod), .env.development (overrides for dev), .env.development.local (local overrides for dev), and .env.test (overrides for Jest, Vitest...)

You write the secrets in the .local files and absolutely never upload those. Alternatively, dotenv is simpler and loads only from .env.

If they're never uploaded in the first place, they can't be stolen, so secret encryption becomes a bit unnecessary. Keep also in mind that security is good, but also inconvenient, and the average developer dislikes inconvenience.

Do not also forget that we're building a library here, not an application, we don't have a say on how users must secure their stuff, only provide them with recommendations.

spring otter
#

That is the main point, env files are either behind .gitignore or saved in the code.

If a dev gets compromised, the token is gone, If someone gets RCE, fs is very commonly imported already, and could be taken (they are also in mem but thats another story.)

At the library level, making the developer exp as smooth as possible while pushing towards secure setups is possible.

knotty plover
#

I still think its well out of scope

#

In no way are you wrong about development practices, but thats what they are. Development practices are largely the responsibility of the developer, the libraries just need to make sure they arent making it more difficult

#

Or preventing the developer from implementing these solutions in some way

spring otter
#

The token is already read from proc env, increasing the difficulty to make a less secure choice or making it easier to be more secure could be as simple as having another bool on a login_unsafe(token, I_secured_my token)

SOPS is an example, but having quick blurbs with (hey, you can secure the token at rest with xyz)

knotty plover
#

Yeah if you want to write a discordjs.guide page on security principles / suggestions that would be welcome

#

I really don't see how providing an unsafe method with a bool is in any way an improvement though

spring otter
knotty plover
#

We could, but you also have to remember that the guide starts with VERY beginner concepts

#

A lot of what we, as IT professionals with big enterprise careers, know is good practice just doesn't fully extend to a bunch of kids learning to program for the first time lmao

spring otter
#

A=123 B=456 DISCORD_TOKEN=your-token-goes-here node index.js is already there

and the 2nd point is exactly the reason why secure practices should be promoted

knotty plover
#

At the right time though

#

The guide is a bit of a mess at the moment, its fragmented and doesnt flow well

#

But it would make sense to have a "Securing your bot before you go live" page/section

spring otter
#

If you look at the page for config files, the only client.login() shown is with the token passed into it.

knotty plover
#

yeah

#

I agree, there's definitely ways the guide can be improved, but we're not about to start implementing SOPS or anything like that into the library

spring otter
#

The starting developer (and almost all tutorials) will focus on that bit, heck, even I'm lazy and thow it in there

SOPS is just for at rest, it would be more like gitignore guidance

knotty plover
#

So pr

#

Make the example use a .env file

slate mango
knotty plover
#

Of course they'll just go an upload that to git anyway

#

Which file it is doesn't matter

#

The important lesson still has to be "dont make it public"

spring otter
#

env and dotenv already have examples, just not with an empty login

and again, thats why there is the side of making it easier for the "right" choices to be made and harder (a unsecure flag or i know what im doing) for discouragement

knotty plover
#

unsecure flags are bad

#

Because trust me, we know our community

#

They'll just immediately start using that because its easier

knotty plover
slate mango
#

Newcomers don't care, they'll copypaste the bool from the guide or from somebody's code and call it a day

knotty plover
#

yup

cinder wraith
#

and then post a screenshot in support that shows full token

spring otter
#

// const dotenv = require('dotenv');
// dotenv.config();

client.login();

// client.login(token);```
cinder wraith
#

and while gh does scan for tokens in public repos, discord doesn't do that for screenshots

spring otter
#

The changes to promote security would be removing the json part of the guide or having a warning, showing an empty login is possible, and in a more drastic measure, only allowing login with a token when a bool is passed in

slate mango
#

If you do the non-portable CLI way, somebody will post a screenshot of the token when somebody asks "what command are you running?"

knotty plover
#

The former would require us to support multiple different shells, and I still maintain that passing a bool is a bad approach

cinder wraith
#

you're new here, basing on your new member badge

spring otter
#

the commandline is already an example in the guide, dotenv would not change

knotty plover
#

I really think this whole thing is a mountain out of a molehill, people are going to want to keep their secrets in a file in which they are managed

cinder wraith
#

go to support channels and see how many people pass "32767" for intents

#

and then look at how many have literally any idea what that means

knotty plover
#

Yeah, an example nobody uses because its not an easy approach

cinder wraith
#

your boolean would end up with literally the same fate

knotty plover
#

A .env file is common, and some people will use that and not pass the token to login

spring otter
#

The token thing was an example of something simple to think about when creating the sharding system, since security is part of DX

knotty plover
#

But these examples have nothing to do with sharding

slate mango
#

And the sharder doesn't throw tokens around

spring otter
#

Security should be as easy as possible, and encourage safe use. This point should steer protocol choices away from unauthenticated or poorly deployed options . (I would go so far to say that tokens should ONLY be loaded from process env and discordjs should integrate secret loading with SOPS or have more tutorials on secret management. There are to many tokens on github)

This was the segway to this topic

slate mango
#

Unless you send tokens yourself (in which case, it's your responsibility), they're as secure as they can be

knotty plover
#

Yeah, and we've all said that no

#

discord.js should not integrate with a secret management tool because its out of scope of an API wrapper

slate mango
#

It's a library, not an app nor an ecosystem

cinder wraith
#

and if it is, it's made into that by you, not us

#

so it's kind of your burden to secure it

spring otter
#

Yeah, that is a for Hashi vault ect,

The point was to think about how they are handled

#

SOPS is again, more like gitignore guidance

knotty plover
#

Again, it is up to the application developer to handle it, not the sharder tool

#

Provided we're not like, passing a token in plain text between processes of course

#

Which it wouldnt

slate mango
#

It wouldn't even pass the token between processes

#

Encrypted or not

#

They already have it in env anyways

spring otter
#

Yes, exactly.

The point Im trying to make is that users will take the easy option, which i believe we all agee on.

So that should be a thought as well for what RPC to go over, They wont set up ssl for tls, ssh keys are also hard and require some os hardening.

The token example was to point out how people will use what they are given.

slate mango
#

Network sharder would use encryption by default, and I'll look into how can I make a secure default that's reasonably easy to set up.

But for most intents and purposes, H2 with an auth token (not necessarily Discord's) is enough security for most

#

Or we can even use the Discord token to build a crypto key using webcrypto, encrypt the payload, and send it under a verification header just like Discord's HTTP interactions work. Now disabling security is one extra step, and encryption is guaranteed by HTTPS/H2/H3

spring otter
#

I would say the 2nd idea is a bit verbose,

Sharing the token across containers / node instances is good enough.

The client has to be made at some point, having them in env is fine.

slate mango
#

It really isn't, because users define nothing, and they also don't send the token, just a verification string that was the payload in the body, but encrypted using the token as a key. Receivers use the same key to verify it.

spring otter
#

https://12factor.net/ is a decent frame of mind

The token is under user control, the user are in control of the infra, I don't think there is a reason to distribute secrets from the manager itself

slate mango
#

Re-read my message, please

spring otter
#

The token as a key?

slate mango
#

I already stated that the technique doesn't send the token, just the payload encrypted using the token so the receiver can verify it's legit

#

Yeah, by default, they can make their own

spring otter
#

I'm not sure I fully understand the intent of that

slate mango
#

Just a fallback to make something decently secure easier than no security at all

#

Discord's HTTP interactions as well as Twitch subscriptions use that technique to verify it's them and not some random trying to hijack your app, I believe the algorithm used is Ed25525

spring otter
#

I would personally let the transport layer handle that

woven grove
#

All of those concerns are out of scope for a library. And we already brought this up.
If you develop an application you are free to construct however complicated you want it to.

#

We don’t even do anything fancy. We just wrap a http/ws api. Whatever you do on top of that is up to you.

#

It’s not like we put barricades in your way

slate mango
#

^, as Monbrey said earlier, development practices are that, and what we can do as library developers is not make them any harder to follow

spring otter
#

I know, this is a very long sidetrack over the original topic lol

I don't think I made the point about security, but yes, we are in agreement with that as well

slate mango
#

Anyways, it'll be a long time since I'll have to start considering anything security, because local sharder doesn't really need it since IPC channels aren't exposed anywhere, it's more for the remote sharder, and I don't see myself doing that for the time being

#

And by then I may forget this entire topic, so it's best to keep the important bits we agree on in the RFC's comments

gloomy otter
#

Hi, do you know how to get the person who invited a member in the guildMemberAdd event?

steel haven
gloomy otter
dawn phoenix
#

this is specifically for things diverging from stable in the dev release

#

if you are running stable, please use the channels for that

rich cipher
#

why this channel keep changing nanes

velvet jasper
#

Bc why not?

median jetty
#

v15?

vague coyote
#

no

#

maybe

velvet jasper
#

Tomorrow

vague coyote
rain bramble
#

TypeScript rewrite?

uncut kelp
#

Day after tomorrow

rain bramble
#

😞

dark minnow
pastel flare
#

If I might ask a question, in the Docs for AutocompleteInteraction there is guildId...so why was commandGuildId added, is this not duplication?

#

.commandGuildId
The id of the guild the invoked application command is registered to
vs
.guildId
The id of the guild this interaction was sent in

vague coyote
#

one is registered to, so if its a global command its null?

#

no idea why it exists, but in that sense it makes sense

pastel flare
#

ah I see yes...so a way to work out if it's a Guild/Global command I guess 🤔

vague coyote
#

pointless, but yes

pastel flare
#

Perhaps.
Welp, that's my first pass through the upgrade guide done to move to v14 (from v13) 😁
Have a good one

spare fiber
#

are updateSessionInfo called every dispatch emits? (@discordjs/ws)

scarlet tangle
#

cool. what's new?

cinder wraith
#

If you're asking about what's new in v14, #djs-help-v14 has a pin with a link to changes from v13

scarlet tangle
queen sable
#

nvm 14.3.1 or 14.4.0 probably since 14.3.0 just got released

queen sable
#

probably because api v9 is still supported, i think v13 will be deprecated when v9 gets deprecated

knotty plover
#

We said we werent going to drop v13 support yet

#

v14 gets priority new features, but if they can be backported and someone can be bothered, we'll do so until we decide to drop support

dawn phoenix
#

v13 is still being used by a large amount of people and we should give them the chance to move over to v14 for quite some while, without suffering bugs or missing features.
of course we recommend people to upgrade to the latest stable version (14) as soon as they can, to be future-proof

slow cairn
#

Some people (including me) are waiting for sapphire to support v14 before we update

rain bramble
grim flame
cinder wraith
#

A year of what

grim flame
cinder wraith
#

English please

grim flame
#

isnt spanish

#

XD

cinder wraith
#

A year of what

grim flame
cinder wraith
#

Asking cause the entire conversation doesn't mention any dates whatsoever

#

So what year are you talking about

#

Year since v14? Year until v9 gets dropped? Arbitrary day?

grim flame
#

The versions of djs so they continue to be supported only one more year since the last one came out

cinder wraith
#

🤔

#

When is v9 ending

grim flame
# cinder wraith 🤔

I don't want to imagine the work of those who develop discord bots alone, and they are multifunctional bots XD

grim flame
cinder wraith
#

Both january 1st and December 31 are in next year, with a span of a full year between them.

Anyway, it still works. Until there's some actual timeframe for dropping v9 there's not much reason to deprecate v13. v14 and v13 are essentially the same thing feature wise, but that's because we wrap external API. This wasn't like that with v12 and v13, and there was no point in backporting entire interactions portion of the API to a lib version that runs on deprecated API anyway

vapid lake
#

anyone can help me

hoary fox
#

not djs

dark minnow
#

There are any projects/forks going on for the TS rewrite of djs?

knotty plover
#

Most of the modules are TS already

dark minnow
#

Sorry it was confusing, I mean the main library

#

discord.js

idle galleon
#

That will most likely come naturally as d.js becomes modularized

dark minnow
#

I'm dumb sorry, but just for clarification, for now there aren't any plans going on regarding the TS rewrite of the main library that can be contributed?

idle galleon
#

That’s correct

dark minnow
#

Okay, thankss

scarlet tangle
#

When is discord.js 13 going to not be useable?

copper jetty
candid sorrel
#

how can i install the dev version?

vague coyote
#

npm i discord.js@dev

candid sorrel
#

okay thx!

drowsy notch
#

@woven grove not sure where's the proper channel for this, but deno has announced upcoming support for node packages apparently

fervent dock
#

Ngl it would be nice to see deno support with nodejs polyfills

#

Or even just making some parts of the system completely standards complaint so they'd work across deno and node

#

I know deno has some node polyfills but I don't know how good they are

#

Haven't used them yet

#

Also gotta consider that there are like, 10 different discord bot libraries being worked on for deno, so you have some competition

knotty plover
#

Half those libraries only exist because we don't in the Deno ecosystem honestly

fervent dock
#

This is fair too

shy willow
#

So I am a little out of date here, is there a legitimate concern/thought process to move to Deno? 🤔 or drop CJS support?
Just wondering, so either I can avoid this library entirely (and fallback on the API) or find alternatives?

fervent dock
#

I feel like dropping node support would be a bad idea

#

There's an entire community that has been around this library with node for like, 5 years

#

But also cjs is quite legacy at this point imo

shy willow
# fervent dock I feel like dropping node support would be a bad idea

I mean personally I don't like Deno, I think it's a cool concept, but I just see it as the "new thing out" like everything else, Deno does not seem to have many features that make me go "wow, this is amazing".
Additionally, importing from a URL is a big fat NO NO in my company.

I agree there, but I wish ESM support was better, because import .js files instead of just the file name (because for some reason - in the last setup I had, that is how it worked with ESM and TS).

fervent dock
#

On top of that, node has been around longer than a lot of web standards, so personally I think it would be a good idea to make some parts of the system more up to date with web standards, i.e. typed arrays instead of nodejs buffers

#

Especially as a lot of these are being brought back into node now, I feel like there's an ability to support both, to some degree

wanton trench
#

it would be painful to support both though

shy willow
#

I definitely agree with supporting both, or building for one, and poly-filling/transpiling for the other.

fervent dock
shy willow
wanton trench
#

package.json my beloved

fervent dock
#

I used deno for a bit when it came out, and while I loved the idea, no one will reasonably use it, nodejs has too big of a community, and deno is a big move for a lot of people

shy willow
#

If they had a proper package manager, I would be all for Deno, because of the security things it implements.
Not being able to run installed packages against security checkers, etc, is a straight no no for any security focussed company.

fervent dock
#

Bit I also like a lot of where they have gone with deno, the capability based permissions, adhering to web standards

#

So I'd say seeing if supporting deno without dropping nodejs support would be nice to see, but that really depends on how much effort it is

shy willow
#

Yeah they have some features which are great, but like if I am being honest.
When was node used for web applications?

#

It wasn't... it's a server-side software.

fervent dock
#

Yeah

shy willow
#

I don't see the obsession of trying to make node (a backend, server-side software) something for the web, it's not.

fervent dock
#

A lot of the web standards are still useful on the server

#

What's wrong with using Request and Response and fetch etc on the server

#

You're flipping things around slightly to how it's done on the client side

#

But having a single standardized api makes it quite nice for people to transition between the two

shy willow
#

I agree, some features, are great, fetch being added to node, was of course a huge win.
But again, as noted above, the web has restrictions that the server doesn't need.

fervent dock
#

I guess I'm not trying to treat node as a web application, I'm more trying to treat web standards as designed for more than just front end, which we're seeing more and more commonly, even with wasm and wasi

#

What was originally just a simple compile target on the web, now has a proper server side interface in the making

shy willow
#

Yeah that is true, it's definitely becoming more in-depth and way more functionality, like JavaScript is becoming a very different language than it was ever intended for.

fervent dock
#

And I feel like while nodejs is nice, it's certainly behind, or to be more precise, the current community is quite behind

shy willow
#

But I think if node was to implement the standards that ECMAScript release, (like it would be freakin' nice if they damn support decorators already - this is more of a dig at tc<insert-numbers-here>), it would be not an issue.

fervent dock
#

Nodejs has had some great improvements recently with standards

#

But imo I don't see them being used too much for some time

#

Cos everyone's used to the node way of doing things

shy willow
#

Yeah, I mean Yarn 2 has made great strides in handling node modules much better.

shy willow
#

Before anyone complains, I am aware it's an anti-pattern, but they are awesome, and are very useful, and I will die on this hill.

fervent dock
#

Composing functions is an anti pattern??