Skip to content

Commit

Permalink
feat: Handle Tauri IPC error message (#66)
Browse files Browse the repository at this point in the history
Add handling for the Tauri IPC error message notification in FlightCore to image reader
  • Loading branch information
GeckoEidechse authored Oct 14, 2024
1 parent baacb57 commit f5a7654
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions reaper/cogs/image_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@
value=information_message,
)

flightcore_tauri_ipc_error = discord.Embed(
description="Detected FlightCore error message with mention of `_TAURI_IPC_` error\nTry restarting FlightCore to resolve the error. If that doesn't work, please make an issue on [GitHub](<https://github.com/R2NorthstarTools/FlightCore/issues>) or ping `@geckoeidechse`",
color=common_embed_color,
)
flightcore_tauri_ipc_error.add_field(
name="",
value=information_message,
)


async def handle_response(text: str, message):
if re.search(
Expand Down Expand Up @@ -211,6 +220,15 @@ async def handle_response(text: str, message):
)
return

# TypeError: window._TAURI_IPC_is not a function
if (
re.search("typeerror", text.lower())
and re.search("tauri", text.lower())
and re.search("ipc", text.lower())
):
await message.channel.send(embed=flightcore_tauri_ipc_error, reference=message)
return


class imageStuff(commands.Cog):
def __init__(self, bot: commands.Bot) -> None:
Expand Down

0 comments on commit f5a7654

Please sign in to comment.