diff --git a/.gitignore b/.gitignore index f218880..aad663e 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ botty_v*/ custom.ini config/custom.ini config/custom.*.ini +config/*.local.ini .vscode .vs/ test/assets/ @@ -36,3 +37,9 @@ pickit_screenshots/ *.log log/ blizzpw.txt + +# Local user/workspace files +.claude/ +GEMINI.md +botty_v*.zip +test_config_load.py diff --git a/config/custom.ini.example b/config/custom.ini.example new file mode 100644 index 0000000..216a366 --- /dev/null +++ b/config/custom.ini.example @@ -0,0 +1,22 @@ +; Personal overrides for your local machine/user. +; This file is tracked as an example. +; Copy to config/custom.ini and edit values there. +; +; Botty auto-loads config/custom.ini when present. + +[general] +; name=botty +; custom_message_hook= +; custom_loot_message_hook= + +[char] +; type=blizz_sorc +; atk_len_pindle=3.0 +; show_items=alt + +[sorceress] +; teleport=t + +[blizz_sorc] +; blizzard=f1 +; ice_blast=f2 diff --git a/src/messages/discord_embeds.py b/src/messages/discord_embeds.py index 9c69d90..b0900be 100644 --- a/src/messages/discord_embeds.py +++ b/src/messages/discord_embeds.py @@ -7,7 +7,7 @@ import traceback import discord from version import __version__ import numpy as np -from discord import Webhook, SyncWebhook, Color +from discord import SyncWebhook, Color import json class DiscordEmbeds(GenericApi): def __init__(self): @@ -22,7 +22,7 @@ class DiscordEmbeds(GenericApi): hook_url = Config().general['custom_message_hook'] if hook_url: try: - hook = Webhook.from_url(hook_url, adapter=SyncWebhook(), ) + hook = SyncWebhook.from_url(hook_url) except BaseException as e: Logger.warning(f"Your custom_message_hook URL {hook_url} is invalid, Discord updates will not be sent") Logger.error(f"Error initializing webhook {hook_url}: {e}") @@ -95,6 +95,8 @@ class DiscordEmbeds(GenericApi): self._send_embed(e, self._webhook) def _send_embed(self, e, webhook, file = None): + if webhook is None: + return e.set_footer(text=f'Botty v.{__version__} by Aeon') e.timestamp=datetime.datetime.now(datetime.timezone.utc) try: