#embed text

1 messages · Page 1 of 1 (latest)

upper oracle
#

Hi, so i want to have embed text stored in json file and then like showed, and im facing problem with getting fields, so in fields, name1, value1 etc. it doesnt display string, just undefined

#
    "color": "[255, 0, 255]",
    "title": "Title",
    "url": "",
    "author": {
        "name": "Author Name",
        "url": "",
        "icon_url": ""
    },
    "description": "Description",
    "thumbnail": {
        "url": ""
    },
    "fields": [
        {
            "name1": "Field Name",
            "value1": "Field Value",
            "inline1": true
        },
        {
            "name2": "Field Name",
            "value2": "Field Value",
            "inline2": true
        },
        {
            "name3": "Field Name",
            "value3": "Field Value",
            "inline3": true
        },
        {
            "name4": "Field Name",
            "value4": "Field Value",
            "inline4": true
        },
        {
            "name5": "Field Name",
            "value5": "Field Value",
            "inline5": true
        }
    ],
    "image": {
        "url": ""
    },
    "timestamp": "",
    "footer": {
        "text": "Footer Text",
        "icon_url": ""
    }
}```
limber spire
#

also those are incorrect keys, its just name, value and inline, without the numbers

upper oracle
#

i know, but i want to have it limited

limber spire
#

what do you mean limited?

upper oracle
#

im making discord bot creator and now im doing templates

limber spire
#

there is no point in having numbers in the keys, array items have indexes you know

upper oracle
#

im too lazy to do it when this is simplier

limber spire
#

this really isnt

upper oracle
#

its not final just scratch

limber spire
#

okay well what was the question

upper oracle
#

description and thumbnail works, but fields doesnt

#

inline does

limber spire
#

because you are surrounding the string with ""

upper oracle
limber spire
#

yeah

#

no point in putting it in template strings though

upper oracle
limber spire
#

oh

#

lol

upper oracle
#

thats why

limber spire
#

fields is an array

#

not an object

upper oracle
#

and how can i use these values in embed?

limber spire
#

use <Array>.map() or something

upper oracle
#

lookin on it

#

will it work same when i have it in json?

limber spire
#

why wouldnt it

#

i feel like you are overcomplicating things for yourself

upper oracle
#

so i can you like persons.map(getname) in embed as string?

limber spire
#

i dont think you understand basic js to be honest

upper oracle
#

just askin to be sure i dont have to waste time on it

limber spire
#

waste time on what

#

i still have no clue what you're trying to do exactly

#

just remove the numbers on the fields keys