How to get tag of user in discord.py?

Viewed 5005

If I have the user object, how would I get the tag of the user? For example, if I wanted to print something like CircuitSacul#1111, I would use something like

print(f"{owner.name}:#{owner.tag}")

However, I get the error that "User object has no attribute 'tag'".

1 Answers

This is the user's discriminator:

@bot.command()
async def tag(ctx):
    await ctx.send(ctx.author.discriminator)
Related