#This mans needs help making an image show

1 messages · Page 1 of 1 (latest)

lone monolith
warm coral
#

what

#

dude

#

what image show

#

hey

#

🤬

dull elk
#

such impatient

lone monolith
#

you seem like such a calm person

quick scroll
#

Check if the file is saved

#

ctrl + s

lone monolith
#

please like

const img = captcha.generateSync();
console.log(img)

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
lone monolith
#

then use the img in the image file thing

lone monolith
#

you say what console say

noble umbra
#

Yeah, I'd suggest that

lone monolith
#

GG

warm coral
#

pls wait, i need sometime to deploy

noble umbra
#

And trying to send the attachment on its own and see if that works

lone monolith
#

when in doubt console.log everything

dull elk
lone monolith
#

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

warm coral
#
throw new DiscordAPIError(data, res.status, request);

^

DiscordAPIError: Unknown interaction
#

it says 404 but why still can send that embed

dull elk
#

the interaction doesn't exist

warm coral
#

then how it reply to interaction???

quick scroll
warm coral
#

uhm

#

i send the full code

dull elk
#

😭 password locking a file for people who's trying to help

quick scroll
#

I can't open it

warm coral
#

uh

#

try pls help

#

idk it work or not

#

😩

#

that's my old bin pass

warm coral
#

@dull elk

#

@Lawrster#1872

#

hey don't forget me

#

@Chance#0002

#

@noble umbra

#

what

#

why two off you left

quick scroll
#

I didn't forget about you!

warm coral
#

help

#

I know what to do now

#

how to convert image buffer to image object?

cerulean carbon
#

ok

#

so

#

whats your code

#

what have you tried

#

and whats your goal

#

@warm coral

warm coral
# cerulean carbon <@!839659552786219038>

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
cerulean carbon
#

what is the generate function doing

#

captchaGenerate

#

any errors in the console

warm coral
warm coral
# cerulean carbon captchaGenerate

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

cerulean carbon
#

use a temp name

#

then use that file to upload

#

delete the file

#

it is truly that easy

#

encoding should be base64

#

@warm coral

warm coral
#

@cerulean carbon but i don't want to save the file in my project