DEV Community

Cover image for Get a user's banner in discord.js v12
Tejas Lamba
Tejas Lamba

Posted on

Get a user's banner in discord.js v12

The code will be below

Discord Server -

YouTube -

So it uses the Cryptons API

If user has a banner it will reply with a banner


What if user doesnt have a banner?

It will reply with user doesnt have a banner

No Banner


 const { MessageEmbed } = require('discord.js');
const axios = require('axios');
  const user = message.mentions.users.first() || client.users.cache.get(args[0]) || await client.users.fetch(args[0]).catch(err => undefined);
    if (!user) return message.reply('You must mention someone to get there banner').catch(console.error);

    const res = await fetch(`${}`)

    const json = res.json()

    if(json.url === "null") return message.repy('User doesnt have a banner')

        .then(function(response) {
        if( === "null") return message.reply('User doesnt have a banner')
            const embed = new MessageEmbed()
Enter fullscreen mode Exit fullscreen mode

Discussion (0)