Daniel
Daniel
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Daniel on 7/31/2023 in #djs-questions
Slash Command Permissions
In my Slash Command JSON, I put default_member_permissions What value do I put to only allow server administrator perms to use it by default?
3 replies
DIAdiscord.js - Imagine an app
Created by Daniel on 10/13/2022 in #djs-questions
Modal Invalid Body
const modal = new ModalBuilder().setCustomId("hiring").setTitle("Hiring Prompt");

const something = new TextInputBuilder()
.setCustomId("title")
.setLabel("What is the title of your post?")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const something2 = new TextInputBuilder()
.setCustomId("description")
.setRequired(true)
.setLabel("Set a description for your post.")
.setStyle(TextInputStyle.Paragraph);
const something8 = new TextInputBuilder()
.setCustomId("link")
.setLabel("How does a user apply? Put a link or text.")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const something3 = new TextInputBuilder()
.setCustomId("image")
.setRequired(false)
.setLabel("Include all image links here.")
.setStyle(TextInputStyle.Paragraph);
const something4 = new TextInputBuilder()
.setCustomId("payment")
.setLabel("Include all payment details here.")
.setPlaceholder("Payment Method(s), Payment Amount, Payment Frequency, etc.")
.setRequired(false)
.setStyle(TextInputStyle.Short);

const ActionRow = new ActionRowBuilder().addComponents([something, something2, something8, something3, something4]);

modal.addComponents(ActionRow);

await interaction.showModal(modal);
},
const modal = new ModalBuilder().setCustomId("hiring").setTitle("Hiring Prompt");

const something = new TextInputBuilder()
.setCustomId("title")
.setLabel("What is the title of your post?")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const something2 = new TextInputBuilder()
.setCustomId("description")
.setRequired(true)
.setLabel("Set a description for your post.")
.setStyle(TextInputStyle.Paragraph);
const something8 = new TextInputBuilder()
.setCustomId("link")
.setLabel("How does a user apply? Put a link or text.")
.setRequired(true)
.setStyle(TextInputStyle.Short);
const something3 = new TextInputBuilder()
.setCustomId("image")
.setRequired(false)
.setLabel("Include all image links here.")
.setStyle(TextInputStyle.Paragraph);
const something4 = new TextInputBuilder()
.setCustomId("payment")
.setLabel("Include all payment details here.")
.setPlaceholder("Payment Method(s), Payment Amount, Payment Frequency, etc.")
.setRequired(false)
.setStyle(TextInputStyle.Short);

const ActionRow = new ActionRowBuilder().addComponents([something, something2, something8, something3, something4]);

modal.addComponents(ActionRow);

await interaction.showModal(modal);
},
Promise {
<rejected> DiscordAPIError[50035]: Invalid Form Body
data.components[0].components[1][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[2][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[3][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[4][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
Promise {
<rejected> DiscordAPIError[50035]: Invalid Form Body
data.components[0].components[1][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[2][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[3][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
data.components[0].components[4][COMPONENT_LAYOUT_WIDTH_EXCEEDED]: The specified component exceeds the maximum width
3 replies
DIAdiscord.js - Imagine an app
Created by Daniel on 10/4/2022 in #djs-questions
Message Component Collector Issue
msg.awaitMessageComponent({
filter: (i) => i.user.id === interaction.user.id,
componentType: ComponentType.Button,
time: 60000,
})
.then(async (i) => {
console.log(2);
})
msg.awaitMessageComponent({
filter: (i) => i.user.id === interaction.user.id,
componentType: ComponentType.Button,
time: 60000,
})
.then(async (i) => {
console.log(2);
})
2 does not log when I click a button and I get the following error 5 seconds later
Unhandled Rejection at: Promise Promise {
<rejected> Error: InteractionCollectorError
at InteractionCollector.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\InteractionResponse.js:37:21)
at Object.onceWrapper (node:events:628:26)
at InteractionCollector.emit (node:events:525:35)
at InteractionCollector.emit (node:domain:489:12)
at InteractionCollector.stop (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:218:10)
at Timeout.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:96:61)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
Unhandled Rejection at: Promise Promise {
<rejected> Error: InteractionCollectorError
at InteractionCollector.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\InteractionResponse.js:37:21)
at Object.onceWrapper (node:events:628:26)
at InteractionCollector.emit (node:events:525:35)
at InteractionCollector.emit (node:domain:489:12)
at InteractionCollector.stop (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:218:10)
at Timeout.<anonymous> (C:\Users\dzold\OneDrive\Documents\CodingProjects\aerHub-v2\node_modules\discord.js\src\structures\interfaces\Collector.js:96:61)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
11 replies
DIAdiscord.js - Imagine an app
Created by Daniel on 8/9/2022 in #djs-questions
erlpack Issues
When installing discord.js, it also installs a package called erlpack which fails to install.
9 replies
DIAdiscord.js - Imagine an app
Created by Daniel on 8/9/2022 in #djs-questions
client.guilds.cache.array()
I am converting my old bot from discord.js v12 to v14. In v12, there was a function client.guilds.cache.array() which does not work in v14. What are the alternative(s) for v14?
9 replies
DIAdiscord.js - Imagine an app
Created by Daniel on 7/27/2022 in #djs-questions
Default Permissions
How would I make my /ban command automatically be allowed for Administrators only until they update it in Integrations settings? For obvious security reasons, it needs to be disabled for on-admins by default in case an admin doesn't configure the permissions.
9 replies
DIAdiscord.js - Imagine an app
Created by Daniel on 7/20/2022 in #djs-questions
Select Menu Reply
await firstMessage.edit({
embeds: [productEditChooserEmbed],
components: [
new ActionRowBuilder().addComponents(
new SelectMenuBuilder()
.setCustomId("editProduct")
.setPlaceholder("Please choose what you want to edit...")
.addOptions([
{
label: "Name",
description: "The Product's Name",
value: "name",
},
])
),
],
});
await firstMessage.edit({
embeds: [productEditChooserEmbed],
components: [
new ActionRowBuilder().addComponents(
new SelectMenuBuilder()
.setCustomId("editProduct")
.setPlaceholder("Please choose what you want to edit...")
.addOptions([
{
label: "Name",
description: "The Product's Name",
value: "name",
},
])
),
],
});
For some reason this select menu shows the loading icon right next to the menu and says Interaction failed 3 seconds later without me even choosing an option
7 replies
DIAdiscord.js - Imagine an app
Created by Daniel on 7/18/2022 in #djs-questions
Product File Solution
I have a command where you can either put a file or external link for an image. When we had message content intents, I would just say either upload a file or send a link. But slash command options only support one. Conditional options don’t exist either so what can I do? One attachment option and one text option is too confusing.
5 replies