Skip to content

Commit

Permalink
Merge pull request #234 from The-4th-Hokage/deepsource-fix-76ca485b
Browse files Browse the repository at this point in the history
Remove unnecessary use of comprehension
  • Loading branch information
Dhruvacube authored Oct 18, 2021
2 parents 8b7763c + 9e42d13 commit 9e8e084
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion minato_namikaze/bot_files/cogs/developer/developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async def sharedservers(self, ctx, *, user: discord.Member):
"""Get a list of servers the bot shares with the user."""
guilds = [
f"{guild.name} `{guild.id}` ({guild.member_count} members)"
for guild in [guild for guild in user.mutual_guilds]
for guild in list(user.mutual_guilds)
]

await self._send_guilds(ctx, guilds, "Shared Servers")
Expand Down
18 changes: 6 additions & 12 deletions minato_namikaze/bot_files/cogs/img/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ async def spank(self, ctx, member: Optional[discord.Member]):
desc = f"** <@{ctx.author.id}> spanks {member.mention} !!! Damm! **"
else:
desc = f"** <@{ctx.author.id}> spanks themselves !!! LOL! **"
onlyfiles = [f for f in listdir(
join(self.DEFAULT_GIF_LIST_PATH, "spank"))]
onlyfiles = list(listdir(join(self.DEFAULT_GIF_LIST_PATH, "spank")))

embed = discord.Embed(
description=desc, timestamp=discord.utils.utcnow())
Expand All @@ -69,8 +68,7 @@ async def slap(self, ctx, member: Optional[discord.Member]):
desc = f"** <@{ctx.author.id}> slaps themselves !!! LOL! **"

if member == "" or random.choice([True, False]):
onlyfiles = [f for f in listdir(
join(self.DEFAULT_GIF_LIST_PATH, "slap"))]
onlyfiles = list(listdir(join(self.DEFAULT_GIF_LIST_PATH, "slap")))

embed = discord.Embed(
description=desc, timestamp=discord.utils.utcnow())
Expand Down Expand Up @@ -109,8 +107,7 @@ async def hug(self, ctx, member: Optional[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: **"
onlyfiles = [f for f in listdir(
join(self.DEFAULT_GIF_LIST_PATH, "hug"))]
onlyfiles = list(listdir(join(self.DEFAULT_GIF_LIST_PATH, "hug")))

embed = discord.Embed(
description=desc, timestamp=discord.utils.utcnow())
Expand All @@ -135,8 +132,7 @@ async def poke(self, ctx, member: Optional[discord.Member]):
desc = f"** {member} <@{ctx.author.id}> pokes you !!! **"
else:
desc = f"** <@{ctx.author.id}> hugs themselves !!! **"
onlyfiles = [f for f in listdir(
join(self.DEFAULT_GIF_LIST_PATH, "poke"))]
onlyfiles = list(listdir(join(self.DEFAULT_GIF_LIST_PATH, "poke")))

embed = discord.Embed(
description=desc, timestamp=discord.utils.utcnow())
Expand All @@ -161,8 +157,7 @@ async def high5(self, ctx, member: Optional[discord.Member]):
desc = f"**<@{ctx.author.id}> high fives {member.mention} !!! **"
else:
desc = f"**<@{ctx.author.id}> high-fives **"
onlyfiles = [f for f in listdir(
join(self.DEFAULT_GIF_LIST_PATH, "high5"))]
onlyfiles = list(listdir(join(self.DEFAULT_GIF_LIST_PATH, "high5")))

embed = discord.Embed(
description=desc, timestamp=discord.utils.utcnow())
Expand All @@ -186,8 +181,7 @@ async def party(self, ctx, member: Optional[discord.Member]):
desc = f"**<@{ctx.author.id}> parties with {member.mention} !!! Yaay !!! **"
else:
desc = f"**<@{ctx.author.id}> is partying !!!**"
onlyfiles = [f for f in listdir(
join(self.DEFAULT_GIF_LIST_PATH, "party"))]
onlyfiles = list(listdir(join(self.DEFAULT_GIF_LIST_PATH, "party")))

embed = discord.Embed(
description=desc, timestamp=discord.utils.utcnow())
Expand Down
2 changes: 1 addition & 1 deletion minato_namikaze/bot_files/cogs/moderation/moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async def ban(
@commands.guild_only()
@commands.has_guild_permissions(ban_members=True)
async def banlist(self, ctx, *, member: Optional[Union[str, int, discord.Member]]):
banned_users = [i for i in await ctx.guild.bans()]
banned_users = list(await ctx.guild.bans())
if not member:
if len(banned_users) == 0:
await ctx.send(
Expand Down
2 changes: 1 addition & 1 deletion minato_namikaze/bot_files/lib/classes/games/hangman.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __init__(self):
"z",
]
self.word = random.choice(list(english_words_set)).lower()
self.letters = [l for l in self.word]
self.letters = list(self.word)
self.correct = [r"\_" for __ in self.word]
self.wrong_letters = []
self._embed = discord.Embed(title="HANGMAN")
Expand Down

0 comments on commit 9e8e084

Please sign in to comment.