reaction.message.author
is of the discord.Member
type. So, it'll never be equal to a username (with the discriminator
/number tag).
You can use its string representation for the check:
...
if str(reaction.message.author) == "sample#0000":
await reaction.message.clear_reactions()
...
But as users might change their usernames, you should check their id
s instead:
...
if reaction.message.author.id == <integer id>:
await reaction.message.clear_reactions()
...
If you want to check the username for some reason, see my previous answer for a comparison of commonly used properties of users (applicable to Member
s) that are username strings (display names, full usernames, etc.).
From these two answers:
I've not tested the codes, but they should work fine. Also, I'm not sure if it's a big deal, but the @client.event
should probably be indented.