should temporarily fix some weird bug happening

This commit is contained in:
phixxy 2024-02-06 01:39:32 -08:00
parent 820dc7c5a2
commit be8364b69c

View file

@ -36,9 +36,13 @@ class PhixxyCom(commands.Cog):
lines = f.readlines() lines = f.readlines()
for line in reversed(lines): for line in reversed(lines):
if filename in line: if filename in line:
try:
prompt = line[line.index("Prompt: ") + 7:line.index("Filename: ")] prompt = line[line.index("Prompt: ") + 7:line.index("Filename: ")]
prompt = ''.join(prompt.rsplit(',', 1)) # Remove the last comma prompt = ''.join(prompt.rsplit(',', 1)) # Remove the last comma
return html.escape(prompt) return html.escape(prompt)
except:
self.bot.logger.exception("PhixxyCom failed to find prompt from filename")
return "Unknown Prompt"
return "Unknown Prompt" return "Unknown Prompt"
async def upload_sftp(self, local_filename, server_folder, server_filename): async def upload_sftp(self, local_filename, server_folder, server_filename):