From d43a1ec80cd5e9fe5e44d629074a442768dad655 Mon Sep 17 00:00:00 2001 From: bobloy Date: Tue, 18 Aug 2020 10:24:13 -0400 Subject: [PATCH] Black formatting --- ccrole/ccrole.py | 4 ++-- chatter/chat.py | 6 ++++-- dad/dad.py | 6 ++++-- flag/flag.py | 8 ++++++-- hangman/hangman.py | 12 +++++++++--- lovecalculator/lovecalculator.py | 6 +++--- lseen/lseen.py | 4 +++- qrinvite/qrinvite.py | 4 +++- 8 files changed, 34 insertions(+), 16 deletions(-) diff --git a/ccrole/ccrole.py b/ccrole/ccrole.py index f162d44..7e92a48 100644 --- a/ccrole/ccrole.py +++ b/ccrole/ccrole.py @@ -229,7 +229,7 @@ class CCRole(commands.Cog): cmd_list = "Custom commands:\n\n" + cmd_list if ( - len(cmd_list) < 1500 + len(cmd_list) < 1500 ): # I'm allowed to have arbitrary numbers for when it's too much to dm dammit await ctx.send(box(cmd_list)) else: @@ -309,7 +309,7 @@ class CCRole(commands.Cog): async def eval_cc(self, cmd, message: discord.Message, ctx: commands.Context): """Does all the work""" if cmd["proles"] and not ( - set(role.id for role in message.author.roles) & set(cmd["proles"]) + set(role.id for role in message.author.roles) & set(cmd["proles"]) ): return # Not authorized, do nothing diff --git a/chatter/chat.py b/chatter/chat.py index 35e5b5b..54f3b2d 100644 --- a/chatter/chat.py +++ b/chatter/chat.py @@ -219,7 +219,7 @@ class Chatter(Cog): @chatter.command(name="algorithm", aliases=["algo"]) async def chatter_algorithm( - self, ctx: commands.Context, algo_number: int, threshold: float = None + self, ctx: commands.Context, algo_number: int, threshold: float = None ): """ Switch the active logic algorithm to one of the three. Default after reload is Spacy @@ -283,7 +283,9 @@ class Chatter(Cog): async with ctx.typing(): self.chatbot = self._create_chatbot() - await ctx.maybe_send_embed(f"Model has been switched to {self.tagger_language.ISO_639_1}") + await ctx.maybe_send_embed( + f"Model has been switched to {self.tagger_language.ISO_639_1}" + ) @chatter.command(name="minutes") async def minutes(self, ctx: commands.Context, minutes: int): diff --git a/dad/dad.py b/dad/dad.py index b59ceb1..ee5e3c0 100644 --- a/dad/dad.py +++ b/dad/dad.py @@ -116,8 +116,10 @@ class Dad(Cog): else: out = cleaned_content[4:] try: - await message.channel.send(f"Hi {out}, I'm {guild.me.display_name}!", - allowed_mentions=discord.AllowedMentions) + await message.channel.send( + f"Hi {out}, I'm {guild.me.display_name}!", + allowed_mentions=discord.AllowedMentions, + ) except discord.HTTPException: return diff --git a/flag/flag.py b/flag/flag.py index f93de2f..035ae1d 100644 --- a/flag/flag.py +++ b/flag/flag.py @@ -66,7 +66,9 @@ class Flag(Cog): Set the number of days for flags to expire after for server """ await self.config.guild(ctx.guild).days.set(days) - await ctx.maybe_send_embed("Number of days for new flags to expire is now {} days".format(days)) + await ctx.maybe_send_embed( + "Number of days for new flags to expire is now {} days".format(days) + ) @flagset.command(name="dm") async def flagset_dm(self, ctx: commands.Context): @@ -75,7 +77,9 @@ class Flag(Cog): dm = await self.config.guild(ctx.guild).dm() await self.config.guild(ctx.guild).dm.set(not dm) - await ctx.maybe_send_embed("DM-ing members when they get a flag is now set to **{}**".format(not dm)) + await ctx.maybe_send_embed( + "DM-ing members when they get a flag is now set to **{}**".format(not dm) + ) @staticmethod def _flag_template(): diff --git a/hangman/hangman.py b/hangman/hangman.py index 2aca999..c7d005d 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -180,14 +180,18 @@ class Hangman(Cog): current = await self.config.guild(ctx.guild).emojis() await self.config.guild(ctx.guild).emojis.set(not current) - await ctx.maybe_send_embed("Emoji Letter reactions have been set to {}".format(not current)) + await ctx.maybe_send_embed( + "Emoji Letter reactions have been set to {}".format(not current) + ) @commands.command(aliases=["hang"]) async def hangman(self, ctx, guess: str = None): """Play a game of hangman against the bot!""" if guess is None: if self.the_data[ctx.guild]["running"]: - await ctx.maybe_send_embed("Game of hangman is already running!\nEnter your guess!") + await ctx.maybe_send_embed( + "Game of hangman is already running!\nEnter your guess!" + ) await self._printgame(ctx.channel) """await self.bot.send_cmd_help(ctx)""" else: @@ -195,7 +199,9 @@ class Hangman(Cog): self._startgame(ctx.guild) await self._printgame(ctx.channel) elif not self.the_data[ctx.guild]["running"]: - await ctx.maybe_send_embed("Game of hangman is not yet running!\nStarting a game of hangman!") + await ctx.maybe_send_embed( + "Game of hangman is not yet running!\nStarting a game of hangman!" + ) self._startgame(ctx.guild) await self._printgame(ctx.channel) else: diff --git a/lovecalculator/lovecalculator.py b/lovecalculator/lovecalculator.py index ad57c5d..1b7e5c1 100644 --- a/lovecalculator/lovecalculator.py +++ b/lovecalculator/lovecalculator.py @@ -18,7 +18,7 @@ class LoveCalculator(Cog): @commands.command(aliases=["lovecalc"]) async def lovecalculator( - self, ctx: commands.Context, lover: discord.Member, loved: discord.Member + self, ctx: commands.Context, lover: discord.Member, loved: discord.Member ): """Calculate the love percentage!""" @@ -34,8 +34,8 @@ class LoveCalculator(Cog): try: description = ( soup_object.find("div", attrs={"class": "result__score"}) - .get_text() - .strip() + .get_text() + .strip() ) except: description = "Dr. Love is busy right now" diff --git a/lseen/lseen.py b/lseen/lseen.py index e22f479..a451f57 100644 --- a/lseen/lseen.py +++ b/lseen/lseen.py @@ -75,7 +75,9 @@ class LastSeen(Cog): else: last_seen = await self.config.member(member).seen() if last_seen is None: - await ctx.maybe_send_embed(embed=discord.Embed(description="I've never seen this user")) + await ctx.maybe_send_embed( + embed=discord.Embed(description="I've never seen this user") + ) return last_seen = self.get_date_time(last_seen) diff --git a/qrinvite/qrinvite.py b/qrinvite/qrinvite.py index c35f617..ab5f5dc 100644 --- a/qrinvite/qrinvite.py +++ b/qrinvite/qrinvite.py @@ -48,7 +48,9 @@ class QRInvite(Cog): invite = await ctx.channel.invites() invite = invite[0] except discord.Forbidden: - await ctx.maybe_send_embed("No permission to get an invite, please provide one") + await ctx.maybe_send_embed( + "No permission to get an invite, please provide one" + ) return invite = invite.code