Best practice for object cloning (in TS)?
Looking to get deep copies of things like EmbedBuilder.
structuredClone doesn't copy functions. Should we be doing something like const secondEmbed = new EmbedBuilder({...firstEmbed})?Retrieving GuildChannel#setName ratelimit
Hi, I was wondering if there's any way to tell whether I'm being ratelimited from renaming a particular channel or not when I'm doing setName.
It would be really helpful because I have a ticket system that renames the channel when the ticket gets closed/reopen/transferred and sometime happens that it gets triggered more than 2 times per 10 minutes and I'd like to inform the user about this ratelimiting without needing to implement an internal timer if possible.
Thanks in advance...
Are there downsides to always deferReply / deferUpdate?
My code is starting to get littered with
await interaction.deferReply() at the beginning of each slash command function.
I'm considering to make defer part of my command router, which would make defer global to every command, even if some of them respond very quickly.
Are there downsides to doing this, other than always editing the reply and showing the user "bot is thinking" etc?...Sending deploy request
✅ .env is read correctly
✅ Token, Client ID, and Guild ID are valid
✅ 44 commands are loaded correctly...
Modals
Now that u can add Menu or AttachFile in modal's labels. How to get output of file? like how to get file that user attached or which option he selected in menu
Reply to user with decorated text based on HTML
Hi, I'm looking for something like the opposite of
discord-html-transcripts.
I'm writing a bot that allows looking up terms from a wiki site. The description of a term often contains primitive text styling, like color (inline CSS) or <b> / <strong> etc.
What should I look into? Embeds? Write my own primitive converter that only does the normal Discord markdown formatting?...Negative timeout in @discordjs/ws
Not sure if this is a possible bug in ws package, i left my development bot running overnight on my pc and saw this warning in my console the next day, so i have no idea if its reproducible, a harmless warning, or anything else. It could be caused by my pc going into sleep mode or losing internet perhaps, but it still seems like an undesirable bug to have a negative 6 hour timeout.
```ts
(node:5556) TimeoutNegativeWarning: -22236190.632072948 is a negative number.
Timeout duration was set to 1....
modal select menu
```js
const allTextChannels = interaction.guild.channels.cache.filter(c => c.type === ChannelType.GuildText || c.type === ChannelType.GuildForum);
const channels = allTextChannels.filter(c => allowedChannelIds.includes(c.id));
const options = channels.map((c, i) =>...
Is it relevant?
Is this package still functioning or is it outdated? and can i use it in a browser environment with a websocket transport?
Redis as a cache backend
Has anyone ever experimented with using Redis as the cache backend? I have my own experiment where I have it sort of working, but because djs doesn't expect the cache to be async I have to cheat somewhat and it's not perfect. Has anyone been successful in making this work, or has a good reason why I should just not bother testing this out?
Adding Application Emojis
Is this possible that when my client gets ready I can check if my Bot has these specific Application emojis if it won't am I able to upload them via their url to the application and get back that emoji id?
Need help with editMe() (Changing bot's bio/pfp per server)
So I updated my discord.js version to discord.js v14.24.x so I can add a command for server admins to change's the bot's pfp and bio for their server. Right now I am working on the bio part but I couldn't figure out how to get it working. It acts like it succeeded (not returning any errors and sends my success message) but nothing appears to happen for me and the bio is still the application's bio.
Here is my simplified code from my command where it does use an argument to set the bot's bio per server that is relevent to my problem (Yes, I am using prefix commands).
```js
let biooption = args[0]...
values in modal
I'll send a warning message to the user when they make an error in a component within a modal. However, after sending the warning message, I want the user's old messages to be visible when they reopen the old modal. Is the modal's content deleted when the interaction is replied to? Is there any documentation on this?
When is the values of a modal deleted?...
Did PermissionFlagBits change?
Hey, for the past several years my code base has used this to check if a user has permission to view and send messages in a channel:
However, as of earlier today,
devadminChannel.permissionsFor(msg.author.id)?.has(PermissionFlagsBits.SendMessages)
devadminChannel.permissionsFor(msg.author.id)?.has(PermissionFlagsBits.SendMessages)
PermissionFlagsBits.SendMessages is resolving to "true" because I haven't explicitly denied everyone from sending messages, I only denied them from viewing messages. Previously, if I prevented viewing, it would automatically know you can't send messages. ...ColorResolvable being quirky
Hi yall I want to set e color for my embed, so I gave it a string in the format of
"#abcxyz" and it said "me no like that". Then I checked the reference and that should have worked. Then I tried an array of three number with rgb format and then it said again "me no like that". What does it take? And why does the reference give an array of numbers as example, yet number[] is not in the union type?Can't set up localized commands
When I try to use the
setNameLocalization or setDescriptionLocalization builders, I get this trace:
https://sourceb.in/Mi21E9xgjR
When I instead use setName() and setDescription(), everything works fine and I can deploy my commands.
...Using SHARE_ENV with ShardingManager
I'm trying to share my main process
process.env with my worker threads by using worker_threads.SHARE_ENV when spawning worker threads with discord.ShardingManager.
Is there a way to do this?
```js...Server Icon for Embed Thumbnail
Anybody know how to get a server icon for a thumbnail?
```js
const { SlashCommandBuilder, EmbedBuilder, Guild } = require('discord.js');
...
Proxy
Hello, I’m running multiple shards. What’s the best way to implement proxies and avoid the Cloudflare bans?
Ideally both websocket and rest...
