Swyftey
Swyftey
Explore posts from servers
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.
case "next-button": {
if (currentConfig.index < info.pages.length-1) {
currentConfig.index += 1
currentConfig.page = info.pages[currentConfig.index]

await component.update({
embeds: [embeds.embed({
title: currentConfig.page.embed.title,
color: currentConfig.page.embed.color,
fields: currentConfig.page.embed.fields
})],
components: await setComponents(currentConfig)
});
}
break;
}
case "next-button": {
if (currentConfig.index < info.pages.length-1) {
currentConfig.index += 1
currentConfig.page = info.pages[currentConfig.index]

await component.update({
embeds: [embeds.embed({
title: currentConfig.page.embed.title,
color: currentConfig.page.embed.color,
fields: currentConfig.page.embed.fields
})],
components: await setComponents(currentConfig)
});
}
break;
}
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:
try {
const select = await initialReply.awaitMessageComponent({ filter: i => i.user.id === interaction.user.id, time: 15_000 });
} catch (error) {
console.log(`[setup.js]`, error);
// Instead of making a chat message appear stating the command timed out automatically, send the message if the user continues to try using the component within the message (if it exists)
}
try {
const select = await initialReply.awaitMessageComponent({ filter: i => i.user.id === interaction.user.id, time: 15_000 });
} catch (error) {
console.log(`[setup.js]`, error);
// Instead of making a chat message appear stating the command timed out automatically, send the message if the user continues to try using the component within the message (if it exists)
}
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.
No description
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
await foundWebhook.edit({
name: interaction.client.user.username,
avatar: interaction.client.user.displayAvatarURL(),
channel: channel.id -- change the channel
})
await foundWebhook.edit({
name: interaction.client.user.username,
avatar: interaction.client.user.displayAvatarURL(),
channel: channel.id -- change the channel
})
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
prompt.awaitMessageComponent({time: 15_000})
prompt.awaitMessageComponent({time: 15_000})
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
.awaitMessageComponent
.awaitMessageComponent
, 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.
No description
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?
No description
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
DIAdiscord.js - Imagine an app
Created by Swyftey on 4/26/2024 in #djs-questions
Simple question, how can I check if an incoming message is *specifically* a slash command?
How can I check to see if an incoming message (messageCreate) is a slash command? Sometimes a typo can happen and a slash ('/') may be at the beginning of a string and I don't want that to be considered a slash command, I just want to check if the message is an actual slash command.
6 replies
DIAdiscord.js - Imagine an app
Created by Swyftey on 4/22/2024 in #djs-questions
Interaction already replied on slash command?
No description
47 replies
DIAdiscord.js - Imagine an app
Created by Swyftey on 4/17/2024 in #djs-questions
Still need help understanding how I can stop a collector if await is used inside (for a modal)
No description
10 replies
DIAdiscord.js - Imagine an app
Created by Swyftey on 4/17/2024 in #djs-questions
How can I stop this collector if component disappears (for example, ephemeral msg closed)
No description
5 replies
DIAdiscord.js - Imagine an app
Created by Swyftey on 4/16/2024 in #djs-questions
(Sorry if it's not super relevant) Anybody know if there is an online builder for editable images?
For example, discohook.org is a website for building Discord embeds. Is there something similar but for easily designing an editable image template? Thank you for any tips.
3 replies
DIAdiscord.js - Imagine an app
Created by Swyftey on 4/16/2024 in #djs-questions
.addChannelType not working? I am still able to select voice channels.
No description
3 replies
DIAdiscord.js - Imagine an app
Created by Swyftey on 4/15/2024 in #djs-questions
Ways to get component input from another script?
No description
4 replies
DIAdiscord.js - Imagine an app
Created by Swyftey on 4/14/2024 in #djs-questions
Is it possible to keep message components active in a loop? How do big bots handle timed out buttons
No description
9 replies