Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 333
CircuitSacul Avatar asked Oct 15 '25 04:10

CircuitSacul


1 Answers

This is the user's discriminator:

@bot.command()
async def tag(ctx):
    await ctx.send(ctx.author.discriminator)
like image 129
Patrick Haugh Avatar answered Oct 16 '25 21:10

Patrick Haugh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!