Swyftey
Explore posts from serversDIAdiscord.js - Imagine an app
•Created by Swyftey on 11/17/2024 in #djs-questions
What is the best way to detect a change in server ownership when the bot happens to be offline?
Hi,
I am using Discord.JS and am trying to figure out how I might change a server in my database's owner_id field when the owner id is found to be different.
Here is an example:
If there isn't a way around this to changing the owner_id, what should I do? I'd rather a user who once owned a server (which is added to my database) not have access to it if they are no longer the owner.
12 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 11/2/2024 in #djs-questions
What is the best way to handle components when they've been timed out?
Hi,
I'm sorry, I've probably asked this question a long time ago but have forgotten the answer as it has been a minute.
What is the best way to go about timing buttons/components out? For example, a 60-second collector is started when a command is ran. When the 60 seconds are up, the buttons either disable or (what I'd prefer) have a different custom ID so that an error reply shows if the ID says the button is disabled.
Also, what should be done (if anything) for when let's say the bot goes offline during the time a collector is running, how does the button disable/become timed out then?
Thanks for any help.
5 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 10/30/2024 in #djs-questions
Embed Builder Not Defined When Using BroadcastEval
53 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 10/24/2024 in #djs-questions
Discord slash command(s) deleting itself. (Sorry closed last post too early)
53 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 10/24/2024 in #djs-questions
Why might a slash command delete itself after one use?
19 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 10/20/2024 in #djs-questions
Sharding questions.
Hi.
I am building a Discord bot which I can anticipate will eventually be in more than 2500 guilds pretty quick.
I have a few questions about sharding which I am looking to have answered, any help is greatly appreciated:
1. Is it best to prepare and set up sharding for the bot now while I can?
2. Once the sharding manager is created, do I have to go back into my code (such as commands) and change it to work with all shards? Or does that depend on if the command should affect other guilds, for example?
3. What are the main use cases for using commands such as
.broadcastEval()
to communicate to all shards?
Thanks!33 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 7/8/2024 in #djs-questions
Can the REST class be used to work with global rate limits (make sure you don't throttle)?
3 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 7/8/2024 in #djs-questions
How can I make sure slash commands are only added/registered once?
I was adding and removing my bot from my server once for testing purposes and recently ran into the "Interaction already acknowledged" error.
I fixed it by once again re-adding my bot, but how can I prevent slash commands from being added if they already exist or just prevent this in general?
11 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 6/18/2024 in #djs-questions
Just double checking to be extra sure: Do ALL DiscordJS fetch methods check the cache first?
I'm trying to understand if I should still make my own cache module, or if I can (or if it is *okay * to) trust that the cache will be called first before attempting to use discord's API.
For example, just calling
guild.fetchWebhooks()
upon an event that is fired, or checking my own cache module to see if the webhook is found before calling that.3 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 6/12/2024 in #djs-questions
Does DiscordJS support activities/activity creation? If not, will it in the future?
Title displays question.
Sorry if this is regularly asked, couldn't find.
10 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 6/3/2024 in #djs-questions
Role Select Menu not clearing/refreshing?
I swear it was working before. The input will not clear.
Once the "next-button" is clicked, the message should update and the select menu should not display the previous inputs. The page number is correct and the data to set/display for the role select menu is correct as well.
6 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 5/30/2024 in #djs-questions
Is it possible to check if component timed out AFTER it has timed out?
For example, when a message is sent with a select-menu component:
18 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 5/29/2024 in #djs-questions
Client.Users.Fetch(UserId) erroring, stating UserId is null when it is not.
2 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 5/28/2024 in #djs-questions
Webhook channel does not change after edit (webhook sends to wrong channel).
When I edit the webhook and change the channel, the webhook still sends to the prevous channel.
Does the token or id update after an edit? If so, how can I get the token after the edit?
2 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 5/28/2024 in #djs-questions
Webhook channels.
If you edit a webhook to post to a different channel, are you also supposed to visibly see the webhook within the new channel's integrations tab?
For example:
Using this function to edit the webhook
2 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 5/21/2024 in #djs-questions
How can I catch specific errors, or what is the best way to handle error catching?
I'm sorry if this is a more common question, but I want to know how I can catch specific discord.js errors.
For example, when times out, I want a specific message to be sent, but what if it's another error instead?
6 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 5/20/2024 in #djs-questions
What are some ways to make your code more neat and organized?
For example, slash commands. Is there a way to neatly organize what I've got going on here? Especially the , I have at least two of them here and it feels like there is a potential better way of using them for cleaner code.
4 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 4/30/2024 in #djs-questions
message.edit erroring with "Unknown Interaction", but message is found.
4 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 4/28/2024 in #djs-questions
Is there a way to loop through each guild and channel without getting error using fetch?
70 replies
DIAdiscord.js - Imagine an app
•Created by Swyftey on 4/26/2024 in #djs-questions
What Discord.js features have the potential to hit the limit/go over the set Discord API limits?
Where can I even find Discord's API limits? I just want to make sure that what I am doing with my bot won't eventually be throttled if it grows.
14 replies