diff --git a/captcha/core.py b/captcha/core.py index d3c4a5ba..cee81fc6 100644 --- a/captcha/core.py +++ b/captcha/core.py @@ -161,11 +161,9 @@ async def on_member_join(self, member: discord.Member) -> None: captcha: CaptchaObj = CaptchaObj(self, width=300, height=100) captcha.generate(message) - captcha.write(message, f"{str(self.data_path)}/captchas/{member.id}.png") + captcha.write(message, f"{str(self.data_path)}/{member.id}.png") - captcha_file: discord.File = discord.File( - f"{str(self.data_path)}/captchas/{member.id}.png" - ) + captcha_file: discord.File = discord.File(f"{str(self.data_path)}/{member.id}.png") message_before_captcha: str = await self.config.guild( member.guild @@ -251,7 +249,7 @@ def check(message: discord.Message) -> bool: self._user_tries[member.id].append(temp_success_message) - os.remove(f"{str(self.data_path)}/captchas/{member.id}.png") + os.remove(f"{str(self.data_path)}/{member.id}.png") role_id: int = await self.config.guild(member.guild).role_after_captcha() role: Optional[discord.Role] = discord.utils.get(member.guild.roles, id=role_id) @@ -326,6 +324,6 @@ async def on_message(self, message: discord.Message) -> None: except KeyError: pass - os.remove(f"{str(self.data_path)}/captchas/{member.id}.png") + os.remove(f"{str(self.data_path)}/{member.id}.png") del self._user_tries[member.id] # fmt: on