☃Alex<33🎄
☃Alex<33🎄
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
ill mark this as solved
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
okay so- thank you a lot
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
im a complete newbie in discord.js so idk how to get the URL, since the user chooses the attachment
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
const {
SlashCommandBuilder,
EmbedBuilder,
AttachmentBuilder,
} = require(`discord.js`);

module.exports = {
data: new SlashCommandBuilder()
.setName(`sbapply`)
.setDescription(`Applies for starboard.`)
.addAttachmentOption((option) =>
option
.setName(`image`)
.setDescription(`The image for starboard`)
.setRequired(true)
)
.addStringOption((option) =>
option
.setName(`message`)
.setDescription(`The message to send along side the application`)
),

async execute(interaction, client) {
let message = interaction.options.getString(`message`);
const attachment = interaction.options.getAttachment(`image`);
const attachmentUse = new AttachmentBuilder(`./${attachment}`, {
name: `${attachment.name}`,
});
const channel1 = client.channels.cache.get(`1285686651351334912`);
//const channel2 = client.channels.cache.get(`1284928279832428605`);

if (!message) message = `No message was provided with the application`;

const embed = new EmbedBuilder()
.setTitle(attachmentUse.name)
.setDescription(message)
.setImage(`attachment://${attachmentUse.name}`);

await interaction.reply({
content: `Applied successfully`,
embeds: [embed],
files: [file],
ephemeral: true,
});

await channel1.send({
embeds: [embed],
files: [file],
});
},
};
const {
SlashCommandBuilder,
EmbedBuilder,
AttachmentBuilder,
} = require(`discord.js`);

module.exports = {
data: new SlashCommandBuilder()
.setName(`sbapply`)
.setDescription(`Applies for starboard.`)
.addAttachmentOption((option) =>
option
.setName(`image`)
.setDescription(`The image for starboard`)
.setRequired(true)
)
.addStringOption((option) =>
option
.setName(`message`)
.setDescription(`The message to send along side the application`)
),

async execute(interaction, client) {
let message = interaction.options.getString(`message`);
const attachment = interaction.options.getAttachment(`image`);
const attachmentUse = new AttachmentBuilder(`./${attachment}`, {
name: `${attachment.name}`,
});
const channel1 = client.channels.cache.get(`1285686651351334912`);
//const channel2 = client.channels.cache.get(`1284928279832428605`);

if (!message) message = `No message was provided with the application`;

const embed = new EmbedBuilder()
.setTitle(attachmentUse.name)
.setDescription(message)
.setImage(`attachment://${attachmentUse.name}`);

await interaction.reply({
content: `Applied successfully`,
embeds: [embed],
files: [file],
ephemeral: true,
});

await channel1.send({
embeds: [embed],
files: [file],
});
},
};
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
Error: ENOENT: no such file or directory, stat '/home/alex/workspace/project-x-security-bot/[object Object]'
at async Object.stat (node:internal/fs/promises:1032:18)
at async resolveFile (/home/alex/workspace/project-x-security-bot/node_modules/discord.js/src/util/DataResolver.js:100:19)
at async MessagePayload.resolveFile (/home/alex/workspace/project-x-security-bot/node_modules/discord.js/src/structures/MessagePayload.js:294:35)
at async Promise.all (index 0)
at async MessagePayload.resolveFiles (/home/alex/workspace/project-x-security-bot/node_modules/discord.js/src/structures/MessagePayload.js:259:18)
at async TextChannel.send (/home/alex/workspace/project-x-security-bot/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:176:29)
at async Object.execute (/home/alex/workspace/project-x-security-bot/src/commands/starboard/sbapply.js:39:5)
at async Object.execute (/home/alex/workspace/project-x-security-bot/src/events/client/interactionCreate.js:14:9) {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/alex/workspace/project-x-security-bot/[object Object]'
}
Error: ENOENT: no such file or directory, stat '/home/alex/workspace/project-x-security-bot/[object Object]'
at async Object.stat (node:internal/fs/promises:1032:18)
at async resolveFile (/home/alex/workspace/project-x-security-bot/node_modules/discord.js/src/util/DataResolver.js:100:19)
at async MessagePayload.resolveFile (/home/alex/workspace/project-x-security-bot/node_modules/discord.js/src/structures/MessagePayload.js:294:35)
at async Promise.all (index 0)
at async MessagePayload.resolveFiles (/home/alex/workspace/project-x-security-bot/node_modules/discord.js/src/structures/MessagePayload.js:259:18)
at async TextChannel.send (/home/alex/workspace/project-x-security-bot/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:176:29)
at async Object.execute (/home/alex/workspace/project-x-security-bot/src/commands/starboard/sbapply.js:39:5)
at async Object.execute (/home/alex/workspace/project-x-security-bot/src/events/client/interactionCreate.js:14:9) {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/alex/workspace/project-x-security-bot/[object Object]'
}
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
of course theres a nevermind in this
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
it might have been me forgetting to npm run test after the changes
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
i do not know why it didnt work first time
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
the other error is just a InteractionAlreadyReplied
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
okay so currently the error with the attachment is fixed
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
and then makes an error
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
it just replies
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
does not work
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
yeah tried it too
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
oh the files: [attachmentUse] //in my case?
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
i sent the full code if thats okay
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
const {
SlashCommandBuilder,
EmbedBuilder,
AttachmentBuilder,
} = require(`discord.js`);

module.exports = {
data: new SlashCommandBuilder()
.setName(`sbapply`)
.setDescription(`Applies for starboard.`)
.addAttachmentOption((option) =>
option
.setName(`image`)
.setDescription(`The image for starboard`)
.setRequired(true)
)
.addStringOption((option) =>
option
.setName(`message`)
.setDescription(`The message to send along side the application`)
),

async execute(interaction, client) {
let message = interaction.options.getString(`message`);
const attachment = interaction.options.getAttachment(`image`);
const attachmentUse = new AttachmentBuilder(`./${attachment}`, {
name: `${attachment.name}`,
});
const channel1 = client.channels.cache.get(`1285686651351334912`);
//const channel2 = client.channels.cache.get(`1284928279832428605`);

if (!message) message = `No message was provided with the application`;

const embed = new EmbedBuilder()
.setTitle(attachmentUse.name)
.setDescription(message)
.setImage(`attachment://${attachmentUse.name}`);

await interaction.reply({
content: `Applied successfully`,
embeds: [embed],
ephemeral: true,
});

await channel1.send({
embeds: [embed],
});
},
};
const {
SlashCommandBuilder,
EmbedBuilder,
AttachmentBuilder,
} = require(`discord.js`);

module.exports = {
data: new SlashCommandBuilder()
.setName(`sbapply`)
.setDescription(`Applies for starboard.`)
.addAttachmentOption((option) =>
option
.setName(`image`)
.setDescription(`The image for starboard`)
.setRequired(true)
)
.addStringOption((option) =>
option
.setName(`message`)
.setDescription(`The message to send along side the application`)
),

async execute(interaction, client) {
let message = interaction.options.getString(`message`);
const attachment = interaction.options.getAttachment(`image`);
const attachmentUse = new AttachmentBuilder(`./${attachment}`, {
name: `${attachment.name}`,
});
const channel1 = client.channels.cache.get(`1285686651351334912`);
//const channel2 = client.channels.cache.get(`1284928279832428605`);

if (!message) message = `No message was provided with the application`;

const embed = new EmbedBuilder()
.setTitle(attachmentUse.name)
.setDescription(message)
.setImage(`attachment://${attachmentUse.name}`);

await interaction.reply({
content: `Applied successfully`,
embeds: [embed],
ephemeral: true,
});

await channel1.send({
embeds: [embed],
});
},
};
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
still doesnt show the image
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
doing
const embed = new EmbedBuilder()
.setTitle(`${attachment.name`})
.setImage(`attachment://${attachment.name}`)
const embed = new EmbedBuilder()
.setTitle(`${attachment.name`})
.setImage(`attachment://${attachment.name}`)
is the same as
const attachmentBuild(`./${attachment}`, {name: `$attachment.name`})
const embed = new EmbedBuilder()
.setTitle(`${attachmentBuild.name`})
.setImage(`attachmentBuild://${attachment.name}`)
const attachmentBuild(`./${attachment}`, {name: `$attachment.name`})
const embed = new EmbedBuilder()
.setTitle(`${attachmentBuild.name`})
.setImage(`attachmentBuild://${attachment.name}`)
32 replies
DIAdiscord.js - Imagine an app
Created by ☃Alex<33🎄 on 9/28/2024 in #djs-questions
Attachment won't send
okay after another test
32 replies