Baracchino-Della-Scuola / Bot

Bad comparison test PTC-W0023
Anti-pattern
Minor
5 months ago2 years old
Use is when comparing type of two objects
 23    @commands.command(name="pat", aliases=["pet"])
 24    @commands.cooldown(rate=2, per=5, type=commands.BucketType.member)
 25    async def pet(self, ctx, image: discord.Member = None):
 26        if type(image) == discord.member.Member: 27            image = await image.avatar.read()  # retrieve the image bytes
 28        else:
 29            image = await ctx.author.avatar.read()