0

i want to get bot information like name, avatar ecc. by using id.
For fetch user information, i use this code:

        fetch('https://discord.com/api/users/@me', {
              headers: {
                  authorization: `Bearer ${accessToken}`
              }
          })
              .then(result => result.json())
              .then(response => {
                 console.log(response)
                // do something
            })
        })

How i can do similar for bot using only the bot id?
Thanks in advice and sorry for bad english!

EDIT:

        fetch(`https://discord.com/api/users/${data.id}`, {
            
        })

I found this code, but when i try it it's give me an error:

{ message: '401: Unauthorized', code: 0 }

How can i fix that?

BlackdestinyXX
  • 331
  • 3
  • 17

0 Answers0