Skip to content

Commit

Permalink
Merge pull request #228 from The-4th-Hokage/deepsource-fix-3bf54a8e
Browse files Browse the repository at this point in the history
Use `is` to compare type of objects
  • Loading branch information
Dhruvacube authored Oct 18, 2021
2 parents c0aa6d6 + 0e1d268 commit 2212363
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions minato_namikaze/bot_files/cogs/img/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def spank(self, ctx, member: Optional[discord.Member]):
desc = f"** <@{ctx.author.id}> spanks themselves !!! LOL!**"
elif member in ["@everyone", "@here"]:
await ctx.send(f"** <@{ctx.author.id}> why would you spank @everyone? **")
elif type(member) == discord.Member:
elif type(member) is discord.Member:
desc = f"** <@{ctx.author.id}> spanks {member.mention} !!! Damm! **"
else:
desc = f"** <@{ctx.author.id}> spanks themselves !!! LOL! **"
Expand All @@ -63,7 +63,7 @@ async def slap(self, ctx, member: Optional[discord.Member]):
desc = f"** <@{ctx.author.id}> slaps themselves !!! LOL!**"
elif member in ["@everyone", "@here"]:
await ctx.send(f"** <@{ctx.author.id}> why would you slap @everyone? **")
elif type(member) == discord.Member:
elif type(member) is discord.Member:
desc = f"** <@{ctx.author.id}> slaps {member.mention} !!! Damm! **"
else:
desc = f"** <@{ctx.author.id}> slaps themselves !!! LOL! **"
Expand Down Expand Up @@ -105,7 +105,7 @@ async def hug(self, ctx, member: Optional[discord.Member]):
desc = f"** <@{ctx.author.id}> hugs themselves :heart: :heart: :heart: :heart: **"
elif member in ["@everyone", "@here"]:
await ctx.send(f"** <@{ctx.author.id}> why would you hug @everyone? **")
elif type(member) == discord.Member:
elif type(member) is discord.Member:
desc = f"** <@{ctx.author.id}> hugs {member.mention} !!! :heart: :heart: :heart: **"
else:
desc = f"** <@{ctx.author.id}> hugs themselves !!! :heart: :heart: :heart: :heart: **"
Expand All @@ -131,7 +131,7 @@ async def poke(self, ctx, member: Optional[discord.Member]):
desc = f"** <@{ctx.author.id}> pokes themselves! **"
elif member in ["@everyone", "@here"]:
await ctx.send(f"** <@{ctx.author.id}> why would you poke @everyone? **")
elif type(member) == discord.Member:
elif type(member) is discord.Member:
desc = f"** {member} <@{ctx.author.id}> pokes you !!! **"
else:
desc = f"** <@{ctx.author.id}> hugs themselves !!! **"
Expand All @@ -157,7 +157,7 @@ async def high5(self, ctx, member: Optional[discord.Member]):
desc = f"**<@{ctx.author.id}> high-fives **"
elif member in ["@everyone", "@here"]:
desc = f"**@everyone <@{ctx.author.id}> high-fives **"
elif type(member) == discord.Member:
elif type(member) is discord.Member:
desc = f"**<@{ctx.author.id}> high fives {member.mention} !!! **"
else:
desc = f"**<@{ctx.author.id}> high-fives **"
Expand All @@ -182,7 +182,7 @@ async def party(self, ctx, member: Optional[discord.Member]):
desc = f"**<@{ctx.author.id}> is partying !!**"
elif member in ["@everyone", "@here"]:
desc = f"**@everyone <@{ctx.author.id}> is partying!! come join them !! **"
elif type(member) == discord.Member:
elif type(member) is discord.Member:
desc = f"**<@{ctx.author.id}> parties with {member.mention} !!! Yaay !!! **"
else:
desc = f"**<@{ctx.author.id}> is partying !!!**"
Expand Down
4 changes: 2 additions & 2 deletions minato_namikaze/bot_files/cogs/img/img.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def wni(self, ctx, *, member: discord.Member = ""):
f"** <@{ctx.author.id}> yes yes bro!!! Everyone is not sus!**"
)
return
elif type(member) == discord.Member:
elif type(member) is discord.Member:
desc = f"** {member} was not the imposter**"
elif member != "":
desc = f"** {member} was not the imposter**"
Expand All @@ -52,7 +52,7 @@ async def wi(self, ctx, *, member: discord.Member = ""):
desc = f"Hmmmmmmm ** <@{ctx.author.id}> , Hey guys <@{ctx.author.id}> is the sus !!!**"
await ctx.send(desc)
text = f"{ctx.author.display_name} is the imposter"
elif type(member) == discord.Member:
elif type(member) is discord.Member:
desc = f"** {member.mention} is the imposter**"
text = f"{member.display_name} is the imposter"
elif member != "":
Expand Down
2 changes: 1 addition & 1 deletion minato_namikaze/bot_files/cogs/info/snipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def snipe(self, ctx):
if snipe is None:
return await ctx.send("No snipes in this channel!")
emb = discord.Embed()
if type(snipe) == list: # edit snipe
if type(snipe) is list: # edit snipe
emb.set_author(
name=str(snipe[0].author), icon_url=snipe[0].author.avatar.url
)
Expand Down

0 comments on commit 2212363

Please sign in to comment.