#djs-in-dev-version
35223 messages · Page 32 of 36
👍
Oh hi Jiralite
Hello, I no nothing of ws, pls continue (':
just saying hi
sounds good, lmk if it works
after that we are safe to merge ig
@grim gate The problem is that I installed a hotfix for the particular problem that was discussed earlier which is specific to startup. So it doesn‘t really make sense for me to revert production just for this. So my idea rn is to create a local branch just to test that startup problem, then checkout the PR in production afterwards only to check for the silent disconnects that occur many hours after startup
The pr also has the silent restart fix
its fine, lmk after your done testing
It'll be available in the next development release cycle now
So I reverted to the version that this screenshot is from. For some reason, I cannot reproduce this anymore, I just get this instead:
Wait, I might've forgotten to re-install the old discord package
@steel haven what do you think?
i think its the expected result
thats a normal reconnect
I now tried again with 14.7.2-dev.1672056271-3160ab0.0 which is what I used back then and while I'm getting a different error, I'm still not able to reproduce the issue, aka it reconnects. So I'm still not sure what happened between then and now that makes me unable to reproduce the issue
I'm gonna try on prod just to make sure
Did you add the task taking time to it?
anyways the pr got merged, if you come across any issue with pr let us know. Iterative development
Yes, I just reverted to the commit of that time.
I tried again on my production branch. I was able to recreate this issue. I think I used the wrong commit on my local branch actually
Tried inserting Vox's PR. This is what happens. So it seems to resolve itself
I now switched back to the newest of my commits but using Vox's PR. I'm gonna leave it at that and report if there are any problems
great!
The third line from the bottom reads wrong though 
Websocket was closed | WS state: OPEN
But explains why I thought it wouldn’t work as intended. Great to hear I was wrong
need to fix those logs, the problem is it waited 5s but by that time it was reconnected and then it logged
so the logs were logged after 5s
not sure how I can place logs elsewhere
You can’t put logs back in the past of course… maybe just adjust the wording: old was closed | current WS state: …
thats what I did
Why is it 4009 when discord States to do 1000 or 1001? ignore me, can’t read
any close code besides 1000 or 1001
np
Would’ve been better if they simply said use close code X but🤷♂️
4009 Session timed out Your session timed out. Reconnect and start a new one. true
bro wut is this
docs contradicts
Well, 4009 would be indeed wrong if we want to resume…
zombie connection is a session timeout
But we want to resume the session, so we shouldn’t call it a timed out session (because those should be abandoned and a new one made, right?)
wait I wanna to confirm if 4009 is zombie connection according to discord
Regarding docs contradicting itself:
If an app doesn't receive a Heartbeat ACK, it should close the connection and reconnect.
Ah wait, reconnect and resume aren’t mutually exclusive, ignore me once again
In the context of WebSockets, "reconnect" refers to the process of establishing a new connection to discord after the existing connection has been lost or closed.
resume is just using the same connection
Resume in the context of discord here is using the same session, not the same connection
oh sorry for my bad english but that's what I meant
All good, I was way too confused myself
and I am still confused if we should use 4009 in first place for the zombie connection
@boreal knot what do you think?
on op codes page
Reconnect and start a new one.
while on gateway page it said
If a client does not receive a heartbeat ACK between its attempts at sending heartbeats, this may be due to a failed or "zombied" connection. The client should immediately terminate the connection with any close code besides 1000 or 1001, then reconnect and attempt to Resume.
The codes in that table are sent by discord
Not ones we should use
And iirc we use 4900 for zombie
4900
Idk read the code
but we are setting those for zombie connection? while there is no code to extract that code for zombie
I'm confused about your question
if we get a zombie connection we are currently resetting and making a new session/connection while the discord docs asks for a resume instead of a new session
and in the new ws package we are resuming instead of starting a new session
We are highly unlikely to have a valid session then
I'd honestly suggest not trying to improve current ws further as we'd be better off providing support for using our new ws system
hmm, why is discord suggesting to to resume and why are we doing it in ws

any approx date when we will have new ws as the ws for djs
At least 1
yr?
At least 1 
v15?
If me saying it twice didn't make it clear, we have no approximates

sure np
I am more confused now thanks lol
it needs v15 since its breaking
but it can be done in a v14 version if users enable it themselves with a client option or something
and thus opting into the breaking stuff themselves
I opt in to breaking stuff… what should I break?🤭
everything, make it suffer 
https://github.com/discordjs/discord.js/pull/9003
can you please review, I previously messed up the backport which caused the issues
also not sure if package-lock.json should be updated
Why should it? Don’t, even less so on a backport
wdym
I saw the revert - it's fine to leave it
I used npm i and it auto updated
When a version is released the respective version will be updated accordingly <:
Oh, you meant on a previous PR?
the issue that you and I were trying to fix was caused by me messing up the backport
I initially fixed it on v13 then backported fixes to v14 where I forgot one line
Could you request me for review on that PR directly? I‘m gonna go to bed now and will forget to review it tomorrow otherwise
now I fixed on v14 and backporting to v13, I double checked it
Wouldn’t that be a forwardport then
you gotta comment on the pr so I can request a review ig
Hey maksi any updates?
There was no downtime so far 👍
great!
If anyone can reproduce https://github.com/discordjs/discord.js/issues/9007, I'd be interested to know what you were doing to make this occur
Have they set their user cache to 0 or something
The client.users cache shouldn't affect data.recipients
But it can effect client.user right?
No, as that is a real property on the client, not a getter from cache
Ahh
I suppose this will repro that. Didn't test it, I'm not home.
const channel = await client.users.createDM('id', { cache: false });
await channel.send('Hello!');
And probably that's the reason why the bot is in the array with index 0.
Wasn't able to reproduce
In the case of a bot, API failed on the first call saying it couldn't send messages to the user
In the case of a user, it sent the message via an existing DM channel (API returns existing one) or a new one
This is only called in the command interaction option resolver and nowhere else nvm I was lied to
Only the first shard (ID 0) receive DM messages. Probably the message was sent in another shard and received in the first one where the channel isn't cached.
yup, can repro
Really
Honestly that sounds like a Discord bug
Why?
We just don't have channel object and can't recover recipients array fully
Because of what you just said, we aren't sent the proper recipients
They're using sharding too, welp
Ty for the help all <:
Whats new in DJS DEV
You can check this
https://github.com/discordjs/discord.js/compare/14.7.1...main
@grim gate @steel haven My bot has been online for 40 hours now. It's a bit short since I accidentally restarted it a few times while being too quick with my fingers in ssh and trying to just see the logs haha.
But it's not short for me as someone who spent the last few months always restarting the bot every few hours and always having to check whether its online. It's really nice not having to deal with that anymore.
I want to thank you two for your support on this matter because it really means a lot to me that this problem is finally fixed!
is v15 existed?
no?
hm ok, just wondering
Nice, My bot is up for 12+ days now
Is it not yet possible to use .setNsfw on a slash command?
isn't it still in pr?
#7976 in discordjs/discord.js by suneettipirneni merged <t:1671156297:R>
feat: add support for nsfw commands
It is, just .edit({ nsfw: true })
https://discord.js.org/#/docs/discord.js/main/class/ApplicationCommand?scrollTo=edit
god knows what this means though
The pull request first appeared in
@discordjs/core@0.2.0
Hi I have a question, from the ddev server (screenshot below) it looks like sending a modal text input with .setValue() being an empty string is not allowed. but setValue doesn‘t allow undefined, so what do I do if there‘s one case where I do need a value and another where I don‘t? Why doesn‘t it work like embeds‘ setDescription()?
just dont set the value?
I assume they're conditionally removing it
in which case yeah its kinda scuffed we have no way to clear it
since you need to invert your entire control flow
but.. how do i "just not set it" when as i just said there are cases where i want to set it. Like, if X is true, I want it set, and if X is false, then I don't want it set.
then the only way is to first make a variable, then (conditionally) edit the variable, and then put that variable into the modal. that is more lines of code, and less pretty, than being able to set it to undefined
Looks like https://github.com/discordjs/discord.js/pull/8559 resolve this
awesome
Will there ever be a utility function that allows you to check if member A can moderate/manage member B?
This is incredibly difficult for a beginner like me who doesn't know much about the role system etc. I bet I'm not the only one
So what exactly is included in dev? Is it just the PRs that are upcoming or what?
I don't see a PR for this sadly
PRs that were merged are included. This can basically give you early access to some discord.js features, before they are released in stable
*Updated on a daily basis iirc
You can see the topic of this channel for the time of dev version releases (for your timezone)
Hello @everyone
Can anyone let me know this?
when try to fetch data by time range in discord channel, how to set option by not iterating whole messages
channel.messages.fetch(options);
where can I find interface of options.
Documentation suggestion for @copper sorrel:
FetchMessagesOptions
Options used to fetch multiple messages.
Is there anyone available I can ask and see if what i want done with the discord bot could be done please
What i am trying to do is have a bot transfer tokens from discord to a google spreadsheet is that possible?
this channel is for questions about using the discord.js in-development version
we cannot help you with google sheets in this server, check out some of the general programming servers in #useful-servers or server discovery
how do i get my discord.js version?
Not a question for this channel, but you can check the version of a package in a project using npm ls
So npm ls discord.js
is the new GUILD_AUDIT_LOG_ENTRY_CREATE Event planned or is it already a thing?
It'll be added of course
(Why would it not be planned?)
well the question is more if it was a thing yet
lmao
i don't know why my userCount return Nan
could somebody help me?
This is the support channel for the development version. Please use #986520997006032896 #djs-help-v14 #archive-djs-help-v13 for support for your version.
(It seems you are using v14, so you can use #djs-help-v14)
How to use v-dev(15) ?
The instruction how to use the dev version is in this channel’s topic. But it‘s not 15, it‘s 14.7.2-dev.
npm ls discord.js
thanks
and i have another question does version@12 of discord.js work?
works but:
- no support
- no updates/fixes
- it will die eventually this year (deprecated)
thanks
XD
Also kinda just doesnt work
Exactly for example it doesn't work for a discordv12 const Discord = require(chalk);
The chalk
...uhhh yeah
I would not expect requiring chalk and calling it Discord to work
i dont can use console.log(chalk.red("hi")
That has literally nothing to do with discord.js, please stop
a okey okey, is only example
Just joined — this server looks so different than others (in a good way). As to be expected for a bot framework :D
Are there any examples of setting the default role shown with the RoleSelectMenuBuilder object?
Not possible + not in correct channel
its a discord api limitation, discord.js has no control over that
Ah, unfortunate
I guess placeholder workaround works then
.setPlaceholder("Your role" + (role ? ` (@${role.name})` : ""))
yeah
btw upvote this if you haven't already: https://github.com/discord/discord-api-docs/discussions/5735
And this is the support channel for the development version. next time please use #986520997006032896 #djs-help-v14 for support.
https://github.com/discordjs/discord.js/pull/9099
@steel haven
Hey, I was wondering why are we replacing the old codes. Also I am wondering how its going to be in a non breaking way if the codes are replaced. Maybe a client option to use @ws package?
Its exactly the same interface, meaning nothing user-facing changes
We're replacing it to be more efficient and reduce the number of issues from the old package, increase modularity
oh, replacing is still breaking change I guess. But fine
No it isn't
🥰
Hi everyone! Not quite a djs@dev issue, but I think I've found a small issue with prism-media. TL;DR: prism specifies a peerDependency of "@discordjs/opus": "^0.8.0", but due to the way node-semver interprets the ^ caret, any 0.x version where x != 8 (ie, @djs/opus latest, 0.9.0).
This could be intentional- apparently a lot of authors treat 0.x versions as breaking, but given that every @djs/opus releases to date have been non-breaking, I would assume it's just an oversight.
Relevant gh issue: https://github.com/amishshah/prism-media/issues/109#issuecomment-1416383134
Didn't npm 8 pull back on installing every single peer dep it found?
From the npm 9 docs:
In npm versions 3 through 6, peerDependencies were not automatically installed, and would raise a warning if an invalid version of the peer dependency was found in the tree. As of npm v7, peerDependencies are installed by default.
Trying to install another plugin with a conflicting requirement may cause an error if the tree cannot be resolved correctly. For this reason, make sure your plugin requirement is as broad as possible, and not to lock it down to specific patch versions.
Relevant doc: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependencies
Fwiw, there is a --legacy-peer-deps flag for npm install that reverts it to npm 3-6 functionality, and that flag does indeed fix the issue, but it still think the dep was probably meant to encompass the entire major-version 0
Also fwiw @djs/opus 0.9.0 wants prism-media ^1.3.4 in its package.json - but that's ||(technically, speaking strictly about package.json dependency versioning requirements - prism appears to work fine with opus 0.9.0)|| impossible as of the moment, because prism-media 1.3.4 does not accept @djs/opus 0.9.0
doesn't seem like @discordjs/core is being published correctly on npm
It's not up to date with da new changes
Because you view the stable version‘s code there, which is 0.3.0 which had that code… the dev version has the new code afaik
Ahh, I gotta install @discordjs/core@dev then
Hey, Is the guide (https://discordjs.guide/) still valid to use or is it outdated with all the new updates?
It’s only for the latest stable (currently v14)
Oh perfect that's what I needed to know. Thanks!
I have no idea where this error is coming from. I looked into ws and rest, and I can't find anything that points me in right direction
import { Client, GatewayDispatchEvents, GatewayIntentBits, InteractionType, MessageFlags } from '@discordjs/core'; // 0.3.1-dev.1675512288-8b70f49.0
import { REST } from '@discordjs/rest'; // 1.5.0
import { WebSocketManager } from '@discordjs/ws'; // 0.6.0
const token = '';
const rest = new REST({ version: '10' }).setToken(token);
const ws = new WebSocketManager({
token,
intents: GatewayIntentBits.GuildMessages | GatewayIntentBits.MessageContent,
rest,
});
const client = new Client({ rest, ws });
client.on(GatewayDispatchEvents.InteractionCreate, async ({ data: interaction, api }) => {
console.log(interaction);
if (interaction.type !== InteractionType.ApplicationCommand || interaction.data.name !== 'ask') return;
await api.interactions.reply(interaction.id, interaction.token, { content: 'Pong!', flags: MessageFlags.Ephemeral });
});
my guess is dependency clash
I updated the code to be reproducible
you'd need to install the dev version of /util too for that to work
even if I do, it still won't work
Did you try it or is that a prophecy?
npm ls @discordjs/core shows what?
$ npm ls @discordjs/core
deptest@1.0.0 C:\Users\Isidr\Documents\Programming\Node\deptest
└── @discordjs/core@0.3.1-dev.1675512288-8b70f49.0```
Ah, I meant /util, my bad
yeah I figured lol
$ npm ls @discordjs/util
deptest@1.0.0 C:\Users\Isidr\Documents\Programming\Node\deptest
├─┬ @discordjs/core@0.3.1-dev.1675512288-8b70f49.0
│ └── @discordjs/util@0.1.0
├─┬ @discordjs/rest@1.5.0
│ └── @discordjs/util@0.1.0
├── @discordjs/util@0.1.1-dev.1675598630-405f940.0
└─┬ @discordjs/ws@0.6.0
└── @discordjs/util@0.1.0```
I feel like if I install the dev version of /core, then it should come with the dev version of /util as well
Well, no… but you can add module resolutions to your project to override the version of /util your code uses…
Add it as an overrides
Basically this but the package you need instead
#djs-in-dev-version message
ahh
alright cool thanks for the help guys!
Are we supporting endpoints that require oauth2?
Well guild.members.add exists
and whole ApplicationCommandPermissionsManager
however the are rather exceptions
so i am asking if can we support more?
what more do you want to support
there are many things
e.g. getting use info linked roles etc
so oauth stuff that is in no way related to bot api?
adding members?
core has oauth iirc
... is something we already support, as CanineData said
adding members is part of bot api, which is why it's in d.js
it takes an oauth token as one of its params, but how you obtain that token isn't really a bot's concern
that's the point
what is
What does dev have that the regular package doesn't have
106 commits..., time for v14.8?
nsfw commands, role connection support
Have selection menus been added to the forms?
whats the @discordjs/core
no
@discordjs/core is a thinly abstracted wrapper around the "core" components of the Discord API: REST, and gateway.
has anyone used @discordjs/core with TypeScript?
I've created a function that handles a single options layer that is then passed down to the rest and websocket packages but it errors telling me I must define a return type, I've tried (options: ClientOptions): typeof createClient but as you can imagine it returns the function type which then errors on the return line.
Should I pass it as any or is there a more appropriate workaround? I've attached the current state of the function.
EDIT: Not sure what I've changed but removing the return type no longer throws off errors, I'm still curious what would be the fix for this issue regardless
doesn't /core have types?
core is written in typescript
unless createClient returns itself, you'd want ReturnType<typeof createClient>
const modal = new ModalBuilder()
.setCustomId("ticket_modal")
.setTitle("Ticket Request")
.addComponents(
new TextInputBuilder()
.setCustomId("type")
.setLabel("With kind of help you need? Please specify:")
.setMinLength(10)
.setStyle(TextInputStyle.Short),
new TextInputBuilder()
.setCustomId("issue")
.setLabel("Explain your Issue/Question:")
.setMinLength(10)
.setStyle(TextInputStyle.Paragraph)
);
await interaction.showModal(modal);
ERROR:
DiscordAPIError[50035]: Invalid Form Body
data.components[0].components[BASE_TYPE_BAD_LENGTH]: Must be between 1 and 1521 in length.
data.components[1].components[BASE_TYPE_BAD_LENGTH]: Must be between 1 and 1521 in length.
Yeah I copied exact from there
just changed text and showing me this error
oh
actionrow builder
Yes
ty
Why is ClientEvents not using the Events enum? 😔
They don't contain each other fully. Like Events has raw, but we don't want to add typings for that because it's, well, raw
Hm okay
is message content intent isnt in v9 gateway ( which v13 uses)
then WHY https://github.com/discordjs/discord.js/pull/8580 is merged
Can still change the WebSocket/API version
cool.... lol
Also that PR links to a deleted ddevs announcement, so it probably had some reasoning that was later revoked
Was probably the message after if I had to guess
its wasnt revoked, MESSAGE_CONTENT is still there
Never said the flag got removed. Only that the announcement in #discord-dev-news that got linked in the PR as explanation for why it should be merged was.
So i misread
However this intent is still useless
It’s useless to provide when connecting to v9 gateway. It’s not useless to have in the enum
so we have it just to use it in api v10, which v13 doesnt use by default
makes a lot of sense
hello 🙂 Can I set range of roles here?
I doubt Discord has such thing
ahh
You should be able to select multiple tho
Give the min or max value is greater than 1
ahh unlucky, I wanted to give user option to choose only r1, r2, r3, thanks anyway
Well, you can use the string one and do some logic in the background
yee I know
often posted feedback in the discord devs server, that one (not being able to filter the selection at all)
it would be wonderful option tbh 
Ngl, at least filtering by perms would be an awesome option
webhookeditmessage not in dev version?
oh hello Jira :D thank you. will rectify & test
should i just... remove rate limiter for this test?
or can i import it directly from dev?
That isn't by us
No idea what that is
it was looking for a higher ver of discordjs so i had to remove it but not sure how to proceed
From a quick search, that package only seems to support version 12?
You should probably look into this
https://github.com/sapphiredev/utilities/tree/main/packages/ratelimits
very useful. i'll implement that our next bot version.
had the same issue with dev - unresponsive to any server on shard 0. just shard 1. i'm going to reply on github
Is it possible to have a Select Menu in a discordjs Modal?
No
Not 100% sure if this is the right channel
ok thanks
how do you make embed message if MessageEmbeded doesn't exist anymore?
EmbedBuilder. v13 -> v14 update guide exists, it's in #djs-help-v14 channel topic, as that's also where you should ask this question afterall.
from deleted thread: updating to a newer major version should not come with a surprise when your code doesn't work. that's exactly why it's a major version change.
does someone have an idea to prevent it from formatting to Caches[(typeof manager)['name']][1] when committing
https://github.com/discordjs/discord.js/blob/v13/typings/index.d.ts#L4394
I'm going to guess you have version 14 dependencies installed. So, when you moved to version 13, the versions of the linters are outdated and format differently on save
I nuked everything and ran npm ci on the version 13 branch and ran the format npm script and there were some changes, so it would seem that branch needs some formatting anyway
just wondering what shard related fixes happened in dev edition
Hi,
are there any plans to add role_subscription_data in message object?
Saw this PR, are there any timeline I should expect to see these changes in stable release?
https://github.com/discordjs/discord.js/pull/9025
Most likely with 14.8, since that PR is part of the 14.8 milestone.
is localhost a valid redirect for oauth2 (for test/building)?
You should ask that in Discord Developers
Is there a limit to how many characters I can put in a slash command string option?
you were already told to ask in ddevs server #useful-servers
Oh, I didn't realise it was a different server. Sorry
Does this version have linked roles
Looks like those PRs are merged so yes
I believe we have full feature parity in dev except for Text-in-Stage
is there any intention for djs 15 or future versions of djs to allow custom GuildManager/ChannelManager caches?
wdym?
well we aren't able to configure those caches in the same way that we can configure guildemojimanager, etc
unless I've misunderstood this
definitely you have
these objects are always cached ( with intents)
so you shouldn't change it
no, I know they're always cached—I'm asking if there's a plan to allow them to not be always cached
If you're at the point where you dont want to cache anything in discord.js there's very little reason to use the lib at all
Build something bespoke with @discordjs/ws and @discordjs/rest
that's fine—just asking if that was a goal on the roadmap, and it sounds like it isn't
Not a specific goal to my knowledge, no
alright, appreciate it
I want to know is there any api can do pop-up window in discord?
showModal, in response to interactions
got it, I will read the document
thx
can I install older commits for the specific mono-repo if the latest ones break a thing
Why not
Also what breaks?
the whole ws breaks in the latest commits
just had the time to test it rn
on worker sharder strategy
Are you talking about the ws package?
here are the things I encountered:
-
setup worker on worker sharding completely fails due to buildStrategy option.
(a patch solution is just don't pass buildStrategy to the worker)
https://safe.saya.moe/j6lhb0hihuej.png -
random error on connect function
https://safe.saya.moe/mztsxgkm1t7e.png
further investigation shows
https://safe.saya.moe/lgjojmyo6hmb.png
this line is changed for some reason, you should not wait for ready here and should have just waited for hello instead.
you didn't send any resume or identify messages yet, so ready will never fire
@uncut kelp yes ^ here is the issues I encountered so far
im not sure how it works on the latest pr if the ws shard itself dont listen to the right event, probably it was not tested enough(?)
this is great because I pinged both you and the person that opened the issue originally in the PR that made the timeout changes and i just got ghosted
either way, will fix both of those today
I was busy lately thats why I didnt respond there
I was not doing any code related things this past few weeks cause I'm busy attending things irl so sorry for that 
is there any reason why you're using dev btw
dont remember what else is in the current milestone
prior to those 2 prs just now that broke it a little
if I remember correctly why I'm using dev, is because the error bubbling in stable is not fixed, so I just used dev and patched it there since technically I'm experimenting things just for my own amusement and just lately realized why I didn't patch stable instead
ic
yeah the pr that broke timeouts was trying to fix error bubbling lol
seems its just a bad last-minute copy paste though, thats meant to be a hello timeout still
i just happened to change that method like 5 times back and forth
sorry if I didn't respond on the github pr sooner, nor let you know I was busy, not really in the greatest moods this past few weeks to check the github emails
its alright
its why it was just merged anyway
its just dev
how to install your branch of that
its gonna be merged soon anyway, 2/3 reviews already
probs when space hops on
I was directed here to ask whether this was a bug or user error before submitting an issue, as I'm more likely to get a response, I'm using a stable build. discord.js@14.7.1
channel.permissionOverwrites.delete(sota_role, `Locking alliance server (${interaction.member.displayName} - ${interaction.member.id})`)
Is this the correct syntax for an audit log reason, according to the docs, it is, as far as I can see, I also tried making it an object, with the key reason like the 'create' function uses, to no avail, I'm not getting the audit log reason when using permissionOverwrites.delete()
I'm trying to find out if it's user error or a DJs issue, so I can submit an issue
Have you actually tried fetching the audit log entry?
I haven't, I'll do that now to rule out DJS
Yes, you should do that
It's a bug in the client. Everything is fine API-wise
'1079785475612614666' => GuildAuditLogsEntry {
targetType: 'Channel',
actionType: 'Delete',
action: 15,
reason: 'Locking alliance server (Exitium - 153102177429094400)',
executor: [ClientUser],
changes: [Array],
id: '1079785475612614666',
extra: [Role],
target: [VoiceChannel]
}
Yep, looks like it's an issue with Discord, thanks for getting back to me
If I remember correctly, there's a bunch of events that support reason but the clients don't also. Just a fyi
gotcha, ty
I am using guildAuditLogEntryCreate event. So if I delete a channel it fires. Is it possible to get the parent id of that deleted channel?
#djs-help-v14 or #archive-djs-help-v13 as this is not related to the development release of djs nvm, it is
But no, you can’t because it will be purged from cache by then and the AuditLog entry doesn’t contain that information afaik
like you can use channelDelete
and then wait for entry create event
or you can cache deleted channel

I know that, but I want to do that directly
Js is a complicated lang for beginners
even complicated than JS
Keep off-topic out of support channels
oh sorry
thought I was in general
Just wondering where to find discord js dev branch in github ?
its the main branch
ahh ty
GuildMember.flags is undefined... per docs shouldn't that always be present?
Looking at the code, it seems impossible
The more reasonable explanation is you're on an outdated version
I really am an idiot, somehow downgraded to the non-dev version. :/ So sorry, and thanks!
Is there any way to Pause / Unpause invites?
Yes. You can already do this in version 14
How would you Do that?
Guild#disableInvites()
Sets whether this guild's invites are disabled.
Is it like a boolean for on / off?
yup like docs says
hi RE my github issue
its a v14 issue. i tested on v13
What issue is that?
im kaisarion!
https://github.com/discordjs/discord.js/issues/9139
Hello hello
very similar to https://github.com/discordjs/discord.js/issues/8486#issuecomment-1348104275
ive concluded the problem is v13 based off this stuff and my issue
ive also concluded the dev version does not address the issues sufficiently, as the problem did not go away on dev.
is there an ETA for the next minor version?
I want to say soon but there's no real ETA
i understand. its just frustrating with 1000 users offline on a shard so trying to get a grip around a good solution. a lot of our new features rely on the core of v14, so its not really an option to temporarily downgrade
how long does it take normally? like a month? two months? longer?
I would hope not that long, we have a feature we want to release into v14.8 (Audit log events)
But we don't ever promise ETAs
yea just trying to get a ROUGH idea
i know what eta promises are like bahahah.
but even the shard fixes on dev rn dont suffice.
Well if the dev version doesn't fix it, neither will a new release
Unless theres an unmerged PR?
i haven't found a cause to be able to even file a PR
This isn't planned for next release, but there's this: https://github.com/discordjs/discord.js/pull/9099
No idea if checking out that branch will resolve your issues
can i ask when will djs.15 come out?
answer is the same as always: when it's ready
and in case of v15 for the moment, as far as i know it's not even really planned to be yet, so there's nothing to make ready
unless you're asking about v15 for some specific reason
why is this channel created then. wdym by "djs-in-dev-version"
i don't see it having "v15" in the name
it's just development version
made out of current status of the main branch
u dont have to be rude bro. ok i understnad
if there were some merged pull requests to the main branch that did not land in a v14 minor or patch release, they will be available to try out via the dev build
How can i read profile connections? / like connected twitch account
- not related to dev version #986520997006032896
- even not releted to djs as you need to use oauth2
/core does have oauth2
not sure if we can count it
but yeah it has
I mean you can do it with /rest too
when v15 dev
Do you have a question or something relevant to this channel? If not then please,
When there's a change that would break v14. We don't just jump to v15 because we feel like it
checking out branch leaves some missing dependencies still
Like?
would have to double check, trying again with stable ver rn
https://github.com/discordjs/discord.js/issues/9139#issuecomment-1474986073
some new unusual things too
I was able to run it without issues
dont know if you recall but it was the sharding stuff we were working on - some logs have come to light that may be very useful to us, let me know what you think (and if it was fixed on 14.8)
#1073615824746725506 message
Probably not but what's more promising is Qjuh's pull request
jeez every time i interact with you you're around
is that pull request not part of 14.8?
I'm sorry
No
hahahah don't apologise, get some more rest (idk where you live though)
we'll try the pull request and i will keep you posted - was a recent one also made on this?
https://github.com/discordjs/discord.js/pull/9099
still this same one right
Uh-huh
Qjuh's branch replaces the current WebSocket implementation with our new one (in a non-breaking way)
and it seems to be functional on multiple-sharded bots?
I would hope so, but the only way to know for sure is for people to try it out
I don't possess such a bot personally :c
My lowly bot for a single guild runs alright on it
😂 gotcha - I’ll keep you posted through tomorrow 👍🏻
(:
I also tested it on a sharded bot, but a sample size of one is not enough, so yes, please test it more
@uncut kelp hi sorry to disturb, 14.8 issue?
Yeah TypeScript changes aren't breaking, but that is the correct type
build failed. what's its override?
No I mean what it suggested is the correct type!
oh!!!
sorry i thought you meant it can be overriden. did it get renamed? because editmessageoptions existed
wait- how does fetchmessage have the same options as editmessage
Yeah it got renamed into what you see
got it
Can you clarify this please? What types?
looks like a simple name change didn't suffice
you said that WebhookEditMessageOptions was renamed to WebhookFetchMessageOptions? that doesn't make much sense to me, they sound like completely different things
Oh
No it's WebhookMessageEditOptions lol oops
I didn't read it clearly enough T_T
o m g
:D
I don't think you need to do let options: <type> there (also looks like it's not reassigned)?
well it did build
What I mean is, you don't need to explicitly type it there, because it checks the type in the method instead
so that's something
oh got it. yeah, ex javascripter here
An ex you'll never forget
Ok, so the shard crashes exactly every 24 hours, so you two will know by tomorrow evening if it doesn't like 14.8
Not sure I have high hopes
btw, is this released in v14.8? not able to find docs for that version
But it's available on main branch @steel haven ^
Yes
it worked ;)
(;
Just wondering what is in development for djs rn like in the development version
Does each shard have it's own limit ? So 50/s requests per shard.
I dont think so, no
How does huge bot like Mee6 and Dyno can keep up with only 50.
They dont have only 50
At 250k guilds you can apply for larger rate limits
Not sure how these questions are related to discord.js development though
https://github.com/discordjs/discord.js/pull/9281
Will this allow us to make http only bots
Using @discordjs/core yes, but not discord.js
It's not merged yet 😕
Merge pls
Perhaps best to keep your thoughts at bay. They aren't particularly helpful
That PR merely makes it so HTTP bots depending on /core don't depend on the ws dependency, it includes nothing for running HTTP-only bots.
Oh but how do http bots depend on core when it can't be used to create http bots
It can be used for it. The PR you mentioned just doesn’t provide any additional stuff to help you with doing that
How?any guides
the readme for the core package does a really good job of explaining how
I had a question, what led discord.js to use async_event_emitter? Is there something wrong with Node.js included events module ? I would like to know. Not sure where to ask this, sorry if not the right place
web
Is v15 not coming?
prob april fools
Nahh
Hey I have issue if someone can help me
Is it with the dev version of djs? If not: #djs-help-v14 #archive-djs-help-v13
ok ty
Can’t wait to fix breaking changes again 🥰
Have select menus been added to modals yet? 🚶♂️
Nu-uh. You can inquire about the state of feature requests in Discord Developers, though
Is there going to be any updates towards the redis-collection PR? It'd be nice to have this as an option for making caches cross-shard friendly.
#8556 in discordjs/discord.js by imranbarbhuiya opened <t:1661426297:R> (review required)
feat: @discordjs/redis-collection
Probably not
no this implementation is like, not good at all, lol
is anyone working on a super reactions PR?
People always create upstream pull requests of work-in-progress features despite Discord explicitly stating to not do so. So dumb
i was going to, but if you want go on
also not exactly, sometimes its nice to show people what's coming
thanks to community discord can fix some bugs
its been a fat minute since ive done a PR for the library, so you can go ahead and do it if you want
anyone work on the soundboard
#9288 in discordjs/discord.js by Jiralite created <t:1679996675:R> (review required)
feat: Voice Channel Send Effects
i need help with discord.js@12
It's an unsupported version. It was deprecated a long time ago and has critical bugs. And it will stop working with the discontinuing of the API v6 soon.
Hello when version 14.10.0 will be available please ?
when it's ready
okay
Thanks
when is going to be released v15? this year?
When there’s changes that are breaking to the point they need a major version increase.
okay! thanks!
it includes ts rewrite right?
exported typings are pain
What’s a pain about them (other than for the devs that need to keep them up-to-date)? And ts rewrite has no version number. It’ll happen when it‘s ready and whatever the next major version is at that point will be it
Hello, a bot of mine that I keep active is running on version 1.0.0 Discord.are there any codes that work with version 1.0.0 from js's Github site? (The reason I chose this version is because most content producers use version 1.0.0 and I can't learn about other versions).
1.0.0 of discord.js? This version is very old and doesn't work at all. And how is that related to the dev version?
He has no relationship, but he works.
npm ls discord.js and show the output
A very strange moderator is deleting what we have written.
🤨
This still has nothing to do with the development version of djs. Which this channel is about. So 
Oh, sorry.
make a post on #1081585952654360687 if u want
No, thanks.
is discord opened gateway for soundboard
or is there is a way to use soundboard with bot
I believe there’s a pr about it
you meant djs pr or discord api pr
yes there is 2 pr in djs one for VoiceChannelEffectSend Event one for Sending VoiceChannelEffect
but i think we cant use them before discord opens gateway
(or can we??)
(also sorry for my trash english if you didnt understand)
Bots can’t use them, no. The PRs are only for receiving data users sent that way
Ah, sorry ^
will they can use at future?
Ask discord, we can only do what they release and they are the only ones that decide what to release

In the Managers (ChannelManager, UserManager, GuildManager and so on), shouldn't the return type for #fetch always be the non-null option? e.g. for ChannelManager it should be Promise<Channel> instead of Promise<Channel | null>
Or is there any case where it returns null? IIRC, if the channel doesn't exist, it will throw an error (which isn't a returned value)
If the channel exists but discord.js does not have a structure for it
oh, like if discord adds a new type but my d.js version doesn't have it yet
interesting, ty
The other two managers you mentioned do not have null as a return type
I was only on the channel manager and assumed it was a shared feature across managers, my bad there!
looks like breaking changes were released in a minor version?
Adding something to a union isn't breaking
but the bot wouldnt start without it
that is breaking
Adding a new permission is not breaking 
again, the bot would not start without it
I dont know what you want me to tell you, breaking changes would be removing things, not adding things
i guess i just want to find out how to warn myself of this in future
but technically so. to each their own
just pin versions and use dependabot if you care that much
I mean it is annoying, I agree, but releasing a major version every time discord adds a permission isn't really..correct semver wise
plus technically its better to catch it, add the new permission, and carry on
yea no definitely dont do that bahahah
just need to make sure im keeping track however that process may be
yeah agreed
I'm sorry for the annoyance haha, we had the same issue in Sapphire
lol no prob, comes with the job
also god ts errors love being useful /s
took me a full minute to see the actually missing permissions 
hahahahahah i had to parse it through trusty gpt. too many words
You should really do
public getString(permissionName: PermissionString, locale: Locale) {
return Lang.getRef(`permissions.${permissionName}`, locale);
}
you have a point.
hello, do you know a host with db sql for bots? powerful but not too expensive either 🤔
Not related to the topic of this channel, #resources
oh i didn't see that thank you 😄
Of course
is somewhere v15 docs getting updated i visited the website it says djs-next but the guide and docs still were for v14..
there is no v15 planned yet, so good luck finding it
so release model is being switched to rolling release?
if there is no reason to release a new major version, then there wont be one for now
always has been like that
got it, thanks!
when is automoderation coming?
What do you mean
AutoModerationRuleManager (extends CachedManager)
Manages API methods for auto moderation rules and stores their cache.
It's already supported
is there anything about soundboards in making atm?
#9288 in discordjs/discord.js by Jiralite created <t:1679996675:R> (review required)
feat: Voice Channel Send Effects
#9308 in discordjs/discord.js by jaw0r3k opened <t:1680354055:R> (review required)
feat: support voiceChannelEffectSend event
Does the "TSR" in some recent issues refer to a typescript rewrite?
Oh guess it is, only searched for messages here before asking
Hey, think I've just discovered that InteractionColletor, which comes with InteractionResponse#createMessageComponentCollector()
does not take into account when the original interaction was a component interaction, thus collecting interaction that does not belong to the message.
on InteractionCollector.js:156
if (
this.messageInteractionId &&
interaction.message?.interaction?.id &&
interaction.message.interaction.id !== this.messageInteractionId
) {
return null;
}
since the InteractionResponse was obtained by a MessageComponentInteraction, interaction.message.interaction would be null. (as I tested with ephemeral response for a button)
Since I don't fully understand how that check upper works, Im wondering if there's workaround, or a fix.
well seems like I could just fetchReply to make it be a Message, for now.
you dont need discordjs/builders it comes with djs now
(also this shouldn't be in this channel)
ow sorry it was a mistakee
discord.js v15 ?
no
oh ok
should there be a topic in the guide about the intents and what each intent does and the common methods that require the intent?
it feels like every time im in support, I answer at least 5 intents-related questions, some from the same users that come back a few minutes later asking about non-functional code due to an intent
Popular Topics: Gateway Intents
read more
Already exists, especially the link to discord documentation under Enabling Intents. We don’t intend to duplicate existing documentation on discords docs, especially because they tend to add/change stuff and linking to that will always be up-to-date
How can i get a User with Id, would need a Tag or Username+Discriminator
it's not too easy to get id by a tag
and isn't related to dev version anyway
so in the next version we need to create the websocketmanager etc. seperatly ?
No, the next version will use those subpackages (just like v14 already does internally)
the next docs redirect to old.discordjs.dev when sellecting discord.js
how to view the new docs for the main package
Correct. Because mainlib isn’t TS yet, so their docs aren’t on the new site yet
oh ok
is there example code for the next version
No, because the next version doesn’t exist/isn’t even released yet
Only subpackages that will be used by it are
I've a question. From the side of performance, is it better to continue using discord.js v14 or is it better to use the @discordjs/core package and co.?
they are different, but that isn't a question for this channel (this is about making d.js)
Oh, sorry, but thank you.
Hey @ornate solar, the main library now uses the /ws package under-the-hood (the new implementation). Are you having any better luck starting your bot now on 14.11.0+? x:
https://github.com/discordjs/discord.js/issues/9139
i haven't tested 14.11 yet, we're releasing it on tuesday. for now, it's stable on 14.9 so i'll keep you posted
Okidoki <:
Im seeing all the shard issue responses to the GitHub and scared to update the version 😅
;-;
All those issues have one thing in common: using discord-hybrid-sharding third-party-lib. I got the feeling they relied on some internals that changed in 14.10.0.
Looks like you're right https://github.com/discordjs/discord.js/issues/9139#issuecomment-1538487998
anything about uploading or using soundboards yet?
. uploading and using is not supported at the moment
will .upload be a thing for the next release?
I don't think there's been any documentation from Discord on APIs to manage voice events
So it depends entirely on that
If there are APIs, we'll support them
Probably very not important but in the new guide, when importing dotenv it can be done in just one line
import { config } from 'dotenv';
config();
vs
import 'dotenv/config';
https://guide.discordjs.dev/guide/creating-your-bot/configuration-files
also I think this note should be reworded (to use esm like example)
https://guide.discordjs.dev/guide/creating-your-bot/adding-commands
Does importing it that way actually run the config method? Because if so thats good
Good catch, yes that tip should have been rewritten
Ahh cool, thanks
TIL
It works for me that way, and I believe the package docs for dotenv said to use either when i last looked at it
yeah, that where I remembered it from
When you run a module containing an
importdeclaration, the modules it imports are loaded first, then each module body is executed in a depth-first traversal of the dependency graph, avoiding cycles by skipping anything already executed.
https://hacks.mozilla.org/2015/08/es6-in-depth-modules/
https://github.com/motdotla/dotenv#how-do-i-use-dotenv-with-import
Yeah thank you for that catch.
I believe we're moving towards preloading it, because it's important for preloading in ESM (node --require dotenv/config ...) with the import ordering (it's asynchronous)
Yeah, that is a better method 👍
sorry for the late reply but hybrid dont use anything regrating discordjs its basically just a process manager
(also nothing with handling shards btw)
It only spawns threads with the given args etc. and these guys have issues that makes the thread die / not noticing that the cluster is ready => timeout => process stop
linking an issue, which is orginally showing an issue with the djs sharding manager
If its working for sharding manager now, then it will work for hybrid sharding as well.
Umm, what you claim there simply is not true… I‘m still waiting for a reproduction of that error from anyone not using hybrid-sharding
The issue which was linked shows a reproduction with the normal sharding manager. I will test it with 215k Guilds tonight on both solutions.
But I would wait for the reproduction on v14.10 on the normal sharding manager
Which issue, linked where?
This one
...., The only thing we depend on from djs is the client.on("ready") event.
It shows no such thing though. Those who were able to reproduce it on 14.11.0 all were using Cluster sharding of discord-hybrid-sharding
Used djs v14.11 and can reproduce a ws issue, it burned 86 sessions with destroys in less than 8 minutes and did not spawn 60% of the shards.
Tested other libs and totally worked fine even with max concurrency 16.
No hybrid-sharding, no dark-magic 
is this internal sharding
the one without internal sharding has ~5-8 Destroys (with djs sharding manager), the logs are from internal sharding
so like, how many shards is this in a process
i have no idea how main lib sharding stuff works.
i just write /ws
on djs sharding manager just 1? and internal sharding, it was like 30-50, then it got stuck on the destroy loop....
Tested with other libs and it worked with 224 in one single thread. So its an issue on djs side on how they process the events....
¯_(ツ)_/¯
this seems like a classic case of "not my problem"
/ws standalone works fine on the big bot token we have to test it
so i'll delegate this to @boreal knot
What's with me
What's wrong
Someone tldr me
Quite sad that this is the conclusion 🤣
lots of shards when using mainlib allegedly break it
but i have my fair share of doubt
either way, not my field, we both know /ws standalone behaved fine on either strategy with lots of shards
maybe write some better code and it'll be easier to make assumptions in your favor
or alternatively keep snarky remarks to yourself
Well tbf we tested /ws with many shards, not mainlibs impl of it
yeah
all im saying is
that aint me no more

The lib is just a process manager, the only thing it depends on is client.on('ready'). It does not influence how djs handles stuff.
So my guesses are that upon a higher shard count on internal sharding there are some issues in djs as shown in the logs I posted above.
We have a lot of production users (<600k+ Guilds) and just one of them occurred an issue in form of an event emitter leak.
When you need me (for testing), just ping me, and if anyone else has that issue just tell them to use the djs sharding manager. Lets hope it works for them.
Anyways I am discussing probably in the wrong channel 👋
when djs v15 release?
There is no ETA
That code is an invalid usage of mainlib ShardingManager, because you pass shards property to the Client, so you use internal sharding and traditional sharding both at the same time, meaning you spawn all shards in all child workers. That’s supposed to cause issues because you now identify each shard several times. You shouldn’t pass shards: to Client options at all when using ShardingManager
lol
yeah that explains it
thanks qjuh
But this dont explains for me why the issue happens with hybrid bcs hybrid only reqs the user to set a shard list in the client nothing more 🤔
so it only uses internal sharding
The reproduction above did not use hybrid sharding at all. It was tested with the sharding manager and internal sharding. Both had issues. Close code 1006 and Discord staff explained that it is a network issue. Which would explain that invoking internal sharding, causes an higher overload...
Btw, how is the code an invalid test? The shards: "auto" was commented out during the test with the sharding manager. (Sorry, I sent the code on a confusing way lol)
IMO, ThreadManager#fetchActive() should not exist. GuildChannel#threads.fetchActive() is very misleading, it looks like it’s only getting active threads in that channel, when in reality it’s searching the whole server. Should this be deprecated?
@uncut kelp It looks like you did a breaking change there. Well, it still returns threads, but it used to return the channel's threads.
https://github.com/discordjs/discord.js/pull/9164
ooooh interesting
I share the same opinion. It's just a helper, but whatever. Helpers will soon die™️
hm
is the breaking change going to be reverted?
Yes, it's just a bug
ok cool
It does what it does now except filters the output to the parent channel lol
would a PR for fetching the pinned thread in a forum channel be possible?
https://discord.com/channels/222078108977594368/1106982995883216997
Of course it's possible, but egh... helper methods
looks like a new guild feature was added, CREATOR_ACCEPTED_NEW_TERMS
thought the picture uploaded w the message 
theres no upstream PR for the feature on the api docs afaik
It only matters what is documented
Everything else is irrelevant
https://github.com/discordjs/discord.js/pull/8832
What happened to this PR, will it be merged?
No, it's major
is this intentional with the types? #djs-help-v14 message
I am confused reading that, can you just explain the issue
mmmm yeah
p sure this is correct
since dapi-types just follows docs
but this is unfortunate to say the least
does it work fine at runtime?
I'll assume so, either way, v v annoying
The typings for parseEmoji function are just plain wrong... it returns id: Snowflake|undefined not null...
i noticed that in @discordjs/core, WebhooksAPI#get() has a different way of supporting the optional token than WebhooksAPI#edit() and WebhooksAPI#delete()... should it really be kept this way?
https://discord.js.org/docs/packages/core/main/WebhooksAPI:Class#get
https://discord.js.org/docs/packages/core/main/WebhooksAPI:Class#edit
https://discord.js.org/docs/packages/core/main/WebhooksAPI:Class#delete
@velvet jasper maybe^
I agree, token in get should be in options, instead of other optional param
but changing it will be a braking change
well there's already breaking changes merged for 0.7.0
it's 0.x.y and allowed by semantic versioning anyway
want to know, we should use discord.js/core instead of discord.js itself ?
Depends on what you want, discord.js/core is the very core ws implementation and d.js has helper utilities and cache so uses more ram (for most people, discord.js is better as core is more advanced ||and is kinda in beta still v0.6||)
but definitely it is usable
it just requires more creativity
currently it works well for a basic bot (I am using for a bot status notifier - sends a message in channel when offline), but as it is new it probably is more buggy
Supporting the api like this is a lot of repetitive work, which often results in some mistakes, so yeah right now there are problems sometimes
problems? like what
Mostly stuff like incorrect typings, not major problems
Im not sure if it is that good practice to do this: https://github.com/discordjs/discord.js/pull/9613#discussion_r1209622934 (while it is possible, it could cause weird looks on old clients and doesn't seem good practice to something that technically works)
- item 1
- item 2
1. item 1
1. item 2
oh woops this is in dev version should have done it in #992669226403909652 (sorry)
I don't see the problem, it won't even use the numbers you put there anyway, e.g.:
1. a
3. b
5. c
Still formats to
- a
- b
- c
You can even use
1. a
- b
- c
- a
- b
- c
yeah, i know that you 'can' but i don't think it is the best especially as it isn't too hard to implement a proper approact
I am also saying not only old clients, but people may log the output and be confused why it is only one's (i know it isn't that much of an issue though - just wanted to check if it is really that good practice to do it)
any reason why search wont work on the new documentation site?
which package and whats your query because they seem to work for me (ie https://discordjs.dev/docs/packages/formatters/main and markdown)
ok, it is more weird with versioned packages (not main)
is the search handles by search. domain something?
its working now but when i wrote that the console was filled with errors
for that subdomain
i think it was 401
Should AutoModerationActionExecution.channel typing include ForumChannel? Apparently you get a forum channel if the opening message or its title triggers the automod rule
There are no messages in a forum channel. Are you confusing it with a thread channel?
No i'm talking about forum channels
Creating a post in them might trigger the content rules
But if so, according to my tests, the AutoModerationActionExecution.channelId is the forum id and not the thread one
And the AutoModerationActionExecution.messageId might be the post id or null depending on which of the title and message content triggered the rule
For regular messages inside threads inside forum channels, i indeed get the thread id and the message id as usual
Lol, I can reproduce this
Then I guess the answer to your question is yes, it should include forum channels
That means if the post title triggered the rule, there is no way to retrieve the actual post message / thread
Would that mean it's also a bug on Discord side and not only in Discord.js?
You will receive matched keyword, matched content, and content still
I guess they consider post titles not being part of message then, thanks for the link
Just as a caution, I looked at the raw request and message_id was indeed missing (even with the guild messages + message content flag)
It looks like the only issue here is that the channel should just have forum channels added to the types
#9623 in discordjs/discord.js by Jiralite opened <t:1685893644:R> (review required)
types(AutoModerationActionExecution): Add forum channels as a possible type in channel()
Are there any plans to change User#tag in any following version
#9512 in discordjs/discord.js by Syjalo created <t:1683232367:R> (changes requested)
feat: support new username system
ty
Of course
is useUpdate not fired upon global display name changes? I'm not sure if that is a bug with this wrapper or if it is a limitation with the official API
We havent released a version with support for global name changes yet
Are you using the dev release?
Support was merged 8 hours ago
A dev release was only published 2 hours ago
yes I'm on the dev version
sorry, I assumed that PR merge would have included support for that change!
Only if you updated to the dev release 2 hours ago?
If so, we might need to review the user event filtering. Technically userUpdate is only for the client user - everything else is a guildMemberUpdate
But we redirect changes to the user object to userUpdate I think
I'm on that version, yes
guildMemberUpdate doesn't actually track username/avatar etc. changes afaik
it has to be done via userUpdate
No, it comes from GuildMemberUpdate
Well, from Discord
Discord emits USER_UPDATE for the current user (the bot) and GUILD_MEMBER_UPDATE for everyone else
But I think this is a bug, User#_equals doesnt check global_name
You could check by testing btw
So we wont be emitting userUpdate on global name changes
hrm I see, that is confusing that discord.js handles it differently
ah got it!
It's because discord doesn't send those events
Well, we handle it the way people would expect it to be handled, which is user object changes emit user update
don't worry i did that first, I wasn't sure if I was messing something up
Coolio
This assumes Discord emits an event at all on that change though
makes sense, yeah
Otherwise theres nothing to check
Two components here
Yeah what Monbrey said is definitely believable, don't recall seeing that being updated
I'll PR the change to _equals
I'd assume discord emits an event on that change, but I'm not sure
sweet, thanks!
No idea
But _equals should check it regardless
IF an event is emitted, fixing equals will cause userUpdate to fire
fingers crossed!
thanks for your help! :)
#9631 in discordjs/discord.js by monbrey opened <t:1686278296:R> (review required)
fix(User): check global name in equals
:)
What is the difference between djs in devv version, and normal djs
Dev versions have features and patches before the normal ones but aren't as stable and things can break at any new commit
Oh ok, thanks
Of course
any idea what could be causing this?
at Object.makeRequest (node_modules/@discordjs/rest/dist/index.js:66:18)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async makeNetworkRequest (node_modules/@discordjs/rest/dist/index.js:651:11)
at async SequentialHandler.runRequest (node_modules/@discordjs/rest/dist/index.js:980:17)
at async SequentialHandler.queueRequest (node_modules/@discordjs/rest/dist/index.js:915:14)
at async REST.request (node_modules/@discordjs/rest/dist/index.js:1441:22)
at async WebSocketManager.fetchGatewayInformation (node_modules/@discordjs/ws/dist/index.js:1322:18)
at async WebSocketManager.connect (node_modules/discord.js/src/client/websocket/WebSocketManager.js:167:9)
at async Client.login (node_modules/discord.js/src/client/Client.js:226:7)
this error is only thrown in the production environment, not locally
and yes, I'm on the latest builders/rest/ws dev versions
Wat
Are you using this in a browser?!
What is your Node.js version?
v18.15.0
ah hrm, production might be different...
Yes please double-check
redeploying with node v18, fingers crossed
You need Node.js 18.12.0 or higher
The reason why I asked if you were using this in a browser was because that error comes from when there was no native fetch API support in Node.js
ah welp- when did that change? I'm not sure if the service I'm using supports higher than v18
6th May 2023
#9416 in discordjs/discord.js by ckohen merged <t:1683400160:R>
refactor(rest): switch api to fetch-like and provide strategies
ah I see
nevermind, looks like the service I'm using has the latest v18 version, so I'm in the clear
thanks for your help!
You're welcome (:
:)
I suggest adding another field which will show the globalName, and if it's null then it will show username. And for bot it will show Bot Name#discriminator.
Thats already in the dev version
kind of a dumb question but what version is this?
i know it's the developer version, but what number is it (ex: v14, v15, etc)
Its whatever number it needs to be
At the moment its a 14.12.0 because theres no major changes in it
alright thank you
If we add something that would be major / break existing v14 code, it has to be a v15
i was still using v13 until like a couple minutes ago so i just need to wrap my head around it
oh okay that makes sense, thank you!
what dev version should I use so tags do not appear?
like edinlol#0
look at pined messages to find out what it is
and yeah dev version already has support for new username system
thanks
Using the new Discord.js system (@discordjs/core), is there the Color type or is that not going to be added for this update
What is that type?
Oh
No, that's a helper
Oh alright!
How can I use it now? I looked through the documentation on the new site but could not find it
Is there a djs way to get the new displayname stat of a user yet?
Should be in dev version
Where are the dev docs?
It's user.globalName
or user.displayName if you want "the global name of this user, or their username if they don't have one)
https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/User.js#L232
I don't know if this is where I ask about it, but here we go. I was testing @discordjs/core, but I ran into a problem (may be my mistake). When I use defer and try to reply again I get an Unknown Webhook error. I've tried both editReply and followUp and I still get this error
show code
though i'm already going to guess that you might have passed the interaction ID instead of the application ID to editReply and followUp
Omg lol
lul
Thanks ❤️
no worries... happened to me at first too lol
Okay it definitely worked, ty again
helloy, I've created script for ticket with slash command but idk what is wrong
It just says error when i interact
That is a js error and also not related to the development version of djs. So ask in #1081585952654360687 or #useful-servers , the second error is djs related but probably won’t occur anymore when you solve the first one
Hey - Just wondering when we can expect global name to be in an official release?
It‘ll be in the next release. We don’t give ETAs though
Thanks. There's no way to 'hack' it to see a global name in the current prod release is there?
Like hidden away on some magic property 🤞
Just install the dev version if you need it that urgently
14.11.1-dev.1686571462-6c2242f.0 correct?
Is there much risk? Currently over 100k users per day on our app 😅
Well, it’s not guaranteed to be stable, it’s not a release. Using a dev version always is on your own risk… which is why I said if you need it that urgently
Right. Trying to weigh known vs unknown risk... guess we'll wait
And max out our oauth capabilities in the meantime
If you use pnpm or Yarn, you could patch
for the upcoming version would there be a way to fetch a user with their username?
Changes to the API should be best ask in discord.gg/discord-developers
The answer though, is no
are PRs still being taken for the old guide (https://discordjs.guide/), or just for the new guide (https://guide.discordjs.dev/)?
Depends what it is I guess
just some phrasing and code changes for the new username system, theres a few things that still use .tag and .discriminator
Yeah that can go to the existing one
can it be done for both?
I mean we're not going to release a new guide that's wrong
Obviously it'll be done for the new one eventually
But for now, the old guide is the published one where fixes like that belong
👍 (i would react but...)
since discord will stick with discrims for bots, will <user>.tag stay?
no idea yet, discord hasnt announced plans for bots to keep discriminators permanently
so it'll just stay as deprecated until discord gets their stuff together
they will just return #0
if that member have the new username
why is the dev release sometimes 14.11 and sometimes 14.12? there's currently one of each that aren't deprecated, but it looks like there's typically only the 14.11 release, so which should i use?
(also, what's the easiest way to download dev releases of subpackages?)
its deprecated, so better to not include it in the guide
to download the dev version, its npm i discord.js@dev
but @discordjs/builders for example is still the stable version
thats probably because the dev build didn't need a dev version of builders
there are very few times where a dev version will use a dev version of a subpackage, if at all
hmm
ok so example: currently on djs@dev, User#defaultAvatarURL throws because calculateUserDefaultAvatarIndex is only in rest@dev
how would i install rest@dev when i don't directly depend on it? ideally it'd automatically use dev versions of subpackages so i don't have to worry about it
you can use
"@discordjs/builders": <version>
}```
in your `package.json`
hm, noted
Would this be the place to report bugs with the new guide?
We have an issue template on GitHub for issues relating to guide and website, you can use that
Hello everyone, Will the Tag function be removed in the next version of Discord.js (14.12.0) ?
Don't think so, bots will still have discriminators so it shouldn't be removed for now. It will probably be deprecated.
In the logic of deprecated, the goal is to remove, unless it finds a unique function to the bot that would surprise me
while correct, removal cannot be done without changing the major version, so it's quite impossible to remove it in 14.12
Generally all deprecated people end up suppressing the proof with the other function at the time that was depreciated.
uhh, what?
we will see well in the next versions
what are you even talking about right now
It can't be removed in v14.12 or any next versions until v15, since that's a breaking change.
okay
Surely bots would still use .tag though? As discord said that wouldn’t be changing or something. Plus not everyone would change right?
that's why it's deprecated
bots will eventually get moved onto their own system
Ah, just not atm
and for users it's going to be useless the moment everyone gets migrated
Currently won't, but there will be another system different from users.
Gotcha cheers
(btw, i ended up adding this)
"overrides": {
"@discordjs/builders": "dev",
"@discordjs/collection": "dev",
"@discordjs/formatters": "dev",
"@discordjs/rest": "dev",
"@discordjs/util": "dev",
"@discordjs/ws": "dev"
},
"dependencies": {
"discord.js": "dev",
}
Is there a difference between using .globalName and .username? Since I noticed .globalName can be null according to the types
well, one is global name and the other is username
Yeah people dont have to set a global name
ah, I see. So, global name refers to the default display name for all servers?
This
Yeah its a little confusing
Since we use display as the prefix for our getters which dynamically determine nickname > global name > username and stuff
But the API property for that is "global_name"
alrighty, thanks for the clarification 
What's the difference between <User>.globalName and <User>.username? From what I understand username is unique and globalName isn't?
Yes
Ok, so let's take your example. Your username will be syjalo and globalName would be Syjalo right?
Yes
And I can have also a guild nickname as before
There's <User>.displayName that returns the global name, or username if the user don't have the global one. Like <GuildMember>.displayName that now returns the nickname or the user's display name.
You need to pin /rest to its dev version
👆
thank you, this solved my problem ❤️
No problem
Is there a change to how the statuses are set as mine keeps going blank after an hour or two.
Pass it into client constructor to have it persist beyond restarts
I see.
So instead of client.on('ready') do it in the client = part?
Like this? (the intents are all listed because of testing, the prod version is more selective, not sure what happened to guildbans and what it was replaced with)
put your let result = await bot.db.query( below where you define bot const bot = new Discord.Client({
fixed that
doesnt matter now, just tryna make it wait for the response before doing anything, but its not working.
GuildModeration
This is not letting botConf[0] have anything, its not waiting for the DB to return a result.
Thanks
Of course, and don't think that's related to this channel
Probably not... stupid promises, but thats the error causing the bot not to deploy now...
This isn't setting any presence
what is typenum? and did you use ActivityType?
well it is when I change it to just presence (copilot error there, autocorrecting) but its not setting the status to DND
replace setPresence with presence
typeNum is declared above converting the presence type in the DB to a discord presenceType eNum
you use ActivityType.dnd or "DND"?
Hmm it works now... But I had to wrap my entire code into a main
ok nvm im blind, ActivityType is use for activity not for status
you can see, not showing as dnd
but test is?
Unless there is a cache on this that updates on the bot slowly, cus now its dnd... Which is annoying.
Did you do this👆? Also your partials are wrong, they need to be Partials.User or 'User', but never SCREAMING_SNAKE_CASE
ah ok thanks
Yes did that, is this what you mean?
Yes. But none of your questions are specific to the dev version. Use #djs-help-v14 for general v14 issues like yours
I thought this was changes to dev.
Guys,
i need help with the new name update for my djs 14.90 structure
i want to know which is the correct string to use the displayed name (not the global one), for example: to pull the name of a full user defined (originally), we use ${user.username}, or to pull the tag ${user. tag}, but how do I pull the name of the display that is the first to be displayed?
i want to do the test, but I don't know the correct parameter of the string, i say the display name
In frontend it's called "Display Name", in backend the property name is global_name
so would i use it in that format? example
const user = interaction.user
${user_globalname}
this string would already work to return the global name?
mainly, I want to do what is in this attachment
make a button and add the global name, but I don't know the correct string to pull it
@rain bramble
Nome Global = Global Name
