#Banner command.

1 messages · Page 1 of 1 (latest)

torn tree
#

this is not disnake

limber geode
#

you need to fetch the user to get banner

viral sigil
limber geode
#

read what he said

viral sigil
#

lmfao

limber geode
viral sigil
#

probably because it was not right

#

cuz ive never done something like that

#

lol

#

So yeah i need to learn how to fetch users i guess

limber geode
#

-d commands.Bot.fetch_user

median gardenBOT
#

await fetch_user(user_id, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Retrieves a [`User`](https://docs.disnake.dev/en/latest/api/users.html#disnake.User "disnake.User") based on their ID. You do not have to share any guilds with the user to get this information, however many operations do require that you do.

Note

This method is an API call. If you have [`disnake.Intents.members`](https://docs.disnake.dev/en/latest/api/clients.html#disnake.Intents.members "disnake.Intents.members") and member cache enabled, consider [`get_user()`](https://docs.disnake.dev/en/latest/ext/commands/api/bots.html#disnake.ext.commands.Bot.get_user "disnake.ext.commands.Bot.get_user") instead.
limber geode
#

user = await self.bot.fetch_user(member.id)
and user.banner

viral sigil
# limber geode user = await self.bot.fetch_user(member.id) and user.banner
    @commands.command(name="banner")
    async def banner(self, ctx, member: discord.Member = None):
        if not member:
            member = ctx.author
        elif isinstance(member, int):
            user = await self.bot.fetch_user(member.id)
            if not member:
                embed = discord.Embed(description="User not found.")
                return await ctx.send(embed=embed)

        banner = user.banner```
#

is this enough or