From cff4366b53bee2dfbd1bb0b77c26253453567da4 Mon Sep 17 00:00:00 2001 From: Pakobbix Date: Fri, 15 Aug 2025 11:08:31 +0200 Subject: [PATCH] Fix encoding and formatting inconsistencies in error messages and comments --- discord_connector/open-webui_to_discord.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discord_connector/open-webui_to_discord.py b/discord_connector/open-webui_to_discord.py index dab87e4..0bcbd2e 100644 --- a/discord_connector/open-webui_to_discord.py +++ b/discord_connector/open-webui_to_discord.py @@ -7,7 +7,7 @@ import aiohttp # ──────────────────────────────────────────────── def load_config(path: str): """Return a dict loaded from a YAML file.""" - with open(path, "r", encoding="utf‑8") as fh: + with open(path, "r", encoding="utf-8") as fh: return yaml.safe_load(fh) config = load_config("config.yml") # <- loads the config file @@ -59,7 +59,7 @@ async def _query_openwebui(user_text: str, channel_id: int, tools_list: list): if resp.status != 200: # If the response is not 200, raise an error with the response text data = await resp.text() - raise RuntimeError(f"Open‑WebUI responded {resp.status}: {data}") + raise RuntimeError(f"Open-WebUI responded {resp.status}: {data}") # If the response is OK, parse the JSON and return the content response_data = await resp.json() @@ -121,7 +121,7 @@ async def on_message(message): prompt = f"{SYSTEM_PROMPT}\n\nUser Question: {message.content}" # ----------------------------------------------------------------------- # - # B. Query Open‑WebUI and show typing indicator + # B. Query Open-WebUI and show typing indicator # ----------------------------------------------------------------------- # try: async with message.channel.typing(): @@ -130,7 +130,7 @@ async def on_message(message): # Send the reply await message.reply(reply) except Exception as e: - await message.reply(f"⚠ Error contacting the Open‑WebUI API: {e}") + await message.reply(f"⚠ Error contacting the Open-WebUI API: {e}") # No need to return here as the function ends after this block. # --------------------------------------------------------------------------- #