diff --git a/chatbot/chatbot.py b/chatbot/chatbot.py index 3528602..45f7f5d 100644 --- a/chatbot/chatbot.py +++ b/chatbot/chatbot.py @@ -536,7 +536,10 @@ class Chatbot(commands.Cog): i = 0 # in case of inf loop, two tries to generate a non-empty messages TODO: make configurable while output == "" and i < 2: text = self.model.generate( - max_length=numtokens + 70 + 5 * max_len, prompt=message + "\n", temperature=temp, return_as_list=True, + max_length=numtokens + 70 + 5 * max_len, + prompt=message + "\n", + temperature=temp, + return_as_list=True, )[0] text = ( text[len(message) :] @@ -660,6 +663,9 @@ class Chatbot(commands.Cog): return await message.reply(response, mention_author=False) async def red_delete_data_for_user( - self, *, requester: Literal["discord_deleted_user", "owner", "user", "user_strict"], user_id: int, + self, + *, + requester: Literal["discord_deleted_user", "owner", "user", "user_strict"], + user_id: int, ): pass diff --git a/translate/api.py b/translate/api.py index 4538728..5b6e6b7 100644 --- a/translate/api.py +++ b/translate/api.py @@ -149,7 +149,10 @@ class GoogleTranslateAPI: self.cache["guild_whitelist"][guild.id] = await self.config.guild(guild).whitelist() async def check_bw_list( - self, guild: discord.Guild, channel: discord.TextChannel, member: Union[discord.Member, discord.User], + self, + guild: discord.Guild, + channel: discord.TextChannel, + member: Union[discord.Member, discord.User], ) -> bool: can_run = True if guild.id not in self.cache["guild_blacklist"]: @@ -427,7 +430,10 @@ class GoogleTranslateAPI: translated_msg = await ch.send(msg, files=files) async def translate_message( - self, message: discord.Message, flag: str, reacted_user: Optional[discord.Member] = None, + self, + message: discord.Message, + flag: str, + reacted_user: Optional[discord.Member] = None, ) -> None: guild = cast(discord.Guild, message.guild) channel = cast(discord.TextChannel, message.channel) diff --git a/translate/translate.py b/translate/translate.py index 5722ef5..a29c380 100644 --- a/translate/translate.py +++ b/translate/translate.py @@ -108,7 +108,11 @@ class Translate(GoogleTranslateAPI, commands.Cog): @commands.command() async def translate( - self, ctx: commands.Context, to_language: FlagTranslation, *, message: Union[discord.Message, str], + self, + ctx: commands.Context, + to_language: FlagTranslation, + *, + message: Union[discord.Message, str], ) -> None: """ Translate messages with Google Translate