From fa5898f771b4c7ac992bbe5a27058ce2c3506048 Mon Sep 17 00:00:00 2001 From: bobloy Date: Wed, 5 Dec 2018 15:13:23 -0500 Subject: [PATCH] Assorted inspection updates --- chatter/chat.py | 2 +- chatter/chatterbot/trainers.py | 4 +--- reactrestrict/reactrestrict.py | 3 ++- recyclingplant/recyclingplant.py | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/chatter/chat.py b/chatter/chat.py index e4cda92..8f68541 100644 --- a/chatter/chat.py +++ b/chatter/chat.py @@ -27,7 +27,7 @@ class Chatter(Cog): default_global = {} default_guild = {"whitelist": None, "days": 1} path: pathlib.Path = cog_data_path(self) - data_path = path / ("database.sqlite3") + data_path = path / "database.sqlite3" self.chatbot = ChatBot( "ChatterBot", diff --git a/chatter/chatterbot/trainers.py b/chatter/chatterbot/trainers.py index f3a4165..ace24cb 100644 --- a/chatter/chatterbot/trainers.py +++ b/chatter/chatterbot/trainers.py @@ -391,10 +391,8 @@ class UbuntuCorpusTrainer(Trainer): '**', '**', '*.tsv' ) - file_kwargs = {} - # Specify the encoding in Python versions 3 and up - file_kwargs['encoding'] = 'utf-8' + file_kwargs = {'encoding': 'utf-8'} # WARNING: This might fail to read a unicode corpus file in Python 2.x for file in glob.iglob(extracted_corpus_path): diff --git a/reactrestrict/reactrestrict.py b/reactrestrict/reactrestrict.py index 1d5b413..390d760 100644 --- a/reactrestrict/reactrestrict.py +++ b/reactrestrict/reactrestrict.py @@ -139,7 +139,8 @@ class ReactRestrict(Cog): return member - def _get_role(self, guild: discord.Guild, role_id: int) -> discord.Role: + @staticmethod + def _get_role(guild: discord.Guild, role_id: int) -> discord.Role: """ Gets a role object from the given guild with the given ID. diff --git a/recyclingplant/recyclingplant.py b/recyclingplant/recyclingplant.py index e8954b2..4f3ddfc 100644 --- a/recyclingplant/recyclingplant.py +++ b/recyclingplant/recyclingplant.py @@ -64,7 +64,7 @@ class RecyclingPlant(Cog): used["object"] ) ) - reward = reward + 50 + reward += 50 x += 1 elif answer.content.lower().strip() == opp: await ctx.send( @@ -72,7 +72,7 @@ class RecyclingPlant(Cog): ctx.author.display_name ) ) - reward = reward - 50 + reward -= 50 elif answer.content.lower().strip() == "exit": await ctx.send( "{} has been relived of their duty.".format(ctx.author.display_name)