From 9c0cbed99a92b49d9bd16ef6e9b8b5c246740072 Mon Sep 17 00:00:00 2001 From: jodth07 Date: Tue, 19 May 2020 07:42:41 -0400 Subject: 5/19 - bot | xmas, easter, evergreen - updated open statesments with explicit encoding --- bot/exts/christmas/adventofcode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bot/exts/christmas/adventofcode.py') diff --git a/bot/exts/christmas/adventofcode.py b/bot/exts/christmas/adventofcode.py index cc3923c8..00607074 100644 --- a/bot/exts/christmas/adventofcode.py +++ b/bot/exts/christmas/adventofcode.py @@ -429,7 +429,7 @@ class AdventOfCode(commands.Cog): def _build_about_embed(self) -> discord.Embed: """Build and return the informational "About AoC" embed from the resources file.""" - with self.about_aoc_filepath.open("r") as f: + with self.about_aoc_filepath.open("r", encoding="utf8") as f: embed_fields = json.load(f) about_embed = discord.Embed(title=self._base_url, colour=Colours.soft_green, url=self._base_url) -- cgit v1.2.3 From a1c1a9442730c20364d3765f3d4de64c4fd8ce36 Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Tue, 14 Jul 2020 12:15:01 -0700 Subject: Remove redundant f-strings This fixes a new lint error (F541) introduced by flake8 3.8. --- bot/exts/christmas/adventofcode.py | 2 +- bot/exts/evergreen/snakes/snakes_cog.py | 4 ++-- bot/exts/halloween/candy_collection.py | 6 +++--- bot/utils/decorators.py | 2 +- bot/utils/pagination.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'bot/exts/christmas/adventofcode.py') diff --git a/bot/exts/christmas/adventofcode.py b/bot/exts/christmas/adventofcode.py index 00607074..b3fe0623 100644 --- a/bot/exts/christmas/adventofcode.py +++ b/bot/exts/christmas/adventofcode.py @@ -58,7 +58,7 @@ async def countdown_status(bot: commands.Bot) -> None: hours, minutes = aligned_seconds // 3600, aligned_seconds // 60 % 60 if aligned_seconds == 0: - playing = f"right now!" + playing = "right now!" elif aligned_seconds == COUNTDOWN_STEP: playing = f"in less than {minutes} minutes" elif hours == 0: diff --git a/bot/exts/evergreen/snakes/snakes_cog.py b/bot/exts/evergreen/snakes/snakes_cog.py index b3896fcd..9bbad9fe 100644 --- a/bot/exts/evergreen/snakes/snakes_cog.py +++ b/bot/exts/evergreen/snakes/snakes_cog.py @@ -567,7 +567,7 @@ class Snakes(Cog): antidote_embed = Embed(color=SNAKE_COLOR, title="Antidote") antidote_embed.set_author(name=ctx.author.name, icon_url=ctx.author.avatar_url) antidote_embed.set_image(url="https://i.makeagif.com/media/7-12-2015/Cj1pts.gif") - antidote_embed.add_field(name=f"You have created the snake antidote!", + antidote_embed.add_field(name="You have created the snake antidote!", value=f"The solution was: {' '.join(antidote_answer)}\n" f"You had {10 - antidote_tries} tries remaining.") await board_id.edit(embed=antidote_embed) @@ -1078,7 +1078,7 @@ class Snakes(Cog): query = snake['name'] # Build the URL and make the request - url = f'https://www.googleapis.com/youtube/v3/search' + url = 'https://www.googleapis.com/youtube/v3/search' response = await self.bot.http_session.get( url, params={ diff --git a/bot/exts/halloween/candy_collection.py b/bot/exts/halloween/candy_collection.py index 2c7d2f23..caf0df11 100644 --- a/bot/exts/halloween/candy_collection.py +++ b/bot/exts/halloween/candy_collection.py @@ -212,9 +212,9 @@ class CandyCollection(commands.Cog): e = discord.Embed(colour=discord.Colour.blurple()) e.add_field(name="Top Candy Records", value=value, inline=False) e.add_field(name='\u200b', - value=f"Candies will randomly appear on messages sent. " - f"\nHit the candy when it appears as fast as possible to get the candy! " - f"\nBut beware the ghosts...", + value="Candies will randomly appear on messages sent. " + "\nHit the candy when it appears as fast as possible to get the candy! " + "\nBut beware the ghosts...", inline=False) await ctx.send(embed=e) diff --git a/bot/utils/decorators.py b/bot/utils/decorators.py index 519e61a9..9e6ef73d 100644 --- a/bot/utils/decorators.py +++ b/bot/utils/decorators.py @@ -285,7 +285,7 @@ def locked() -> t.Union[t.Callable, None]: embed = Embed() embed.colour = Colour.red() - log.debug(f"User tried to invoke a locked command.") + log.debug("User tried to invoke a locked command.") embed.description = ( "You're already using this command. Please wait until " "it is done before you use it again." diff --git a/bot/utils/pagination.py b/bot/utils/pagination.py index 9a7a0382..a4d0cc56 100644 --- a/bot/utils/pagination.py +++ b/bot/utils/pagination.py @@ -128,7 +128,7 @@ class LinePaginator(Paginator): if not lines: if exception_on_empty_embed: - log.exception(f"Pagination asked for empty lines iterable") + log.exception("Pagination asked for empty lines iterable") raise EmptyPaginatorEmbed("No lines to paginate") log.debug("No lines to add to paginator, adding '(nothing to display)' message") @@ -335,7 +335,7 @@ class ImagePaginator(Paginator): if not pages: if exception_on_empty_embed: - log.exception(f"Pagination asked for empty image list") + log.exception("Pagination asked for empty image list") raise EmptyPaginatorEmbed("No images to paginate") log.debug("No images to add to paginator, adding '(no images to display)' message") -- cgit v1.2.3