CircuitSacul
CircuitSacul

Reputation: 1830

How to get tag of user in discord.py?

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'".

Upvotes: 4

Views: 6454

Answers (1)

Patrick Haugh
Patrick Haugh

Reputation: 60944

This is the user's discriminator:

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

Upvotes: 7

Related Questions