#TOPIC

1 messages · Page 1 of 1 (latest)

sonic star
#
var messageProperties = {
                    embeds: [embed],
                    components: [buttons],
                }
                var authorObject = {}
                if (npc.title) {
                    var title = npc.title
                    authorObject.name = title
                }
                if (npc.tier) {
                    var tier = npc.tier
                    var authorIcon = new MessageAttachment(`C:/Users/jvcal/Documents/Cool Images/Tiers/${tier}.png`)
                    authorObject.iconURL = `attachment://${tier}`
                    messageProperties.files = [authorIcon]
                }
            try {
                embed.setAuthor(authorObject)
                if (!message.attachments.size < 1) {
                    var file = new MessageAttachment(message.attachments.first().url)
                    embed.setImage(`attachment://${message.attachments.first().url.replace(/https:\/\/.*\//, '')}`)
                    messageProperties.files.push(file)
                }
                const mainMessage = await message.channel.send(messageProperties)```

Function
ruby hollow
#

and the error?

sonic star
#

No error, this output instead:

ruby hollow
#

and what is the intended output?

sonic star
#

The roman 5 inside the authorIcon field

ruby hollow
#

and where should it be displayed
since you already have a image set

sonic star
#

I mean

#

As I said

#

in the author icon

#

lol

#

there's an author icon field isn't there

ruby hollow
#

yeah

tiny larkBOT
ruby hollow
#

wait so

#

uh

#

just a sec im unsure why its not working

sonic star
#

Lol

#

same

ruby hollow
#

messageProperties.files = [authorIcon]

#

oh

sonic star
#

what

ruby hollow
#

yeah so the image is in the message and not in the embed

#

yeah that makes a lot of sense

sonic star
#

lol what the

ruby hollow
#

authorObject.iconURL = `attachment://${tier}`
and unless im stupid, the attachment is set to a number

#

not a file

sonic star
#

so what should I do exactly?

#

I feel so dumb rn lol

#

it still gives the same output

#

so, you see the title goes in

ruby hollow
#

so we have this

authorObject.iconURL = `attachment://${tier}`
messageProperties.files = [authorIcon]

my guess would be that the goal was

authorUbject.iconURL = authorIcon

(i think, i have a feeling that isnt how iconURL works)

sonic star
#

ok let me try

#

what you said

#

I'll remove newMessageAttachment now

ruby hollow
#

yeah thing is

#

you dont have a url for the images

sonic star
#

Why does it matter reee

ruby hollow
#

best idea is to probably just throw them all in a channel and copy the links

#

so you can actually put them in an embed

sonic star
#

Yeah but that's so dumb :c

#

I wish I could do it the simpler way

ruby hollow
#

there most likely is a better way

#

exept im stupid

#

lemme just check something real quick

tiny larkBOT
ruby hollow
#

yeah probably authorUbject.iconURL = authorIcon.url would work

#

i hope

sonic star
#

LOL ok

#

So, we didn't get any errors, but the icon isn't there. Should I try resizing it?

#
var authorIcon = new MessageAttachment(`C:/Users/jvcal/Documents/Cool Images/Tiers/${tier}.png`)
authorObject.iconURL = authorIcon.url```
ruby hollow
#

no thats definitely not the issue

sonic star
#

weird thing is

#

this above is working:

#

var authorObject = {}
if (npc.title) {
var title = npc.title
authorObject.name = title
}

#

"O juiz do Tempo" is the title

#

but then when we go to the iconURL part it just doesn't

zenith dock
#

looks like you didnt do what i said initially

#
                    var authorIcon = new MessageAttachment(`C:/Users/jvcal/Documents/Cool Images/Tiers/${tier}.png`, 'icon.png')
                    authorObject.iconURL = `attachment://${authorIcon.name}`
                    messageProperties.files = [authorIcon]
sonic star
#

welp, it worked now. What a fucking surprise xd

#

Thank you so much @zenith dock

#

how do I resize this? It's looking weird

zenith dock
#

using any image editing software