#This mans needs help making an image show
1 messages · Page 1 of 1 (latest)
such impatient
you seem like such a calm person
please like
const img = captcha.generateSync();
console.log(img)
code:```js
const embed = new MessageEmbed()
const imageFile = new MessageAttachment(captcha.generateSync(),"captcha.png")
embed.setColor("#08b9ff")
embed.setTitle("Captcha Verification")
embed.setDescription(**Confirm that you're not robot** Solve the captcha below You have **1 minute** to answer and **1 attemps** send \cancel` to cancel the process`)
embed.setImage("attachment://captcha.png")
embed.setFooter("Hi bro")
embed.setTimestamp()
const sent = await interaction.user.send({ content:"API Registeration Process", embeds:[embed], files:[imageFile]})
error: the image is not showing
then use the img in the image file thing
you say what console say
Yeah, I'd suggest that
GG
pls wait, i need sometime to deploy
And trying to send the attachment on its own and see if that works
when in doubt console.log everything
so true
i had to setup dev console.log 'ing it was too bad
my mans will scream for help but be slow attempting to implement the fix
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Unknown interaction
it says 404 but why still can send that embed
the interaction doesn't exist
then how it reply to interaction???
You're trying to reply to expired interaction or you reply twice
uhm
i send the full code
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
😠password locking a file for people who's trying to help
I can't open it
@dull elk
@Lawrster#1872
hey don't forget me
@Chance#0002
@noble umbra
what
why two off you left
I didn't forget about you!
ok
so
whats your code
what have you tried
and whats your goal
@warm coral
code:```js
const embed = new MessageEmbed()
const imageFile = new MessageAttachment(captcha.generateSync(),"captcha.png")
embed.setColor("#08b9ff")
embed.setTitle("Captcha Verification")
embed.setDescription(**Confirm that you're not robot** Solve the captcha below You have **1 minute** to answer and **1 attemps** send \cancel` to cancel the process`)
embed.setImage("attachment://captcha.png")
embed.setFooter("Hi bro")
embed.setTimestamp()
const sent = await interaction.user.send({ content:"API Registeration Process", embeds:[embed], files:[imageFile]})
error: the image is not showing
nope
the imageFile returns this :```json
it logs this
MessageAttachment {
attachment: <Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 c2 00 00 00 96 08 06 00 00 00 4d 70 88 10 00 00 00 01 73 52 47 42 00 ae ce 1c e9 00 00 00 04 ... 14460 more bytes>,
name: 'captcha.png'
}
that's why im asking way to convert image buffer to image object
search up how to write the buffer to a file
use a temp name
then use that file to upload
delete the file
it is truly that easy
encoding should be base64
@warm coral
@cerulean carbon but i don't want to save the file in my project