From e7915ad2b66d44583bf194044fa7aeede02eccd8 Mon Sep 17 00:00:00 2001 From: Conner Harkness Date: Tue, 4 Mar 2025 11:41:34 -0700 Subject: [PATCH] Update README.md --- README.md | 12 +++++++++++- lib/events.py | 2 ++ lib/helpers.py | 3 --- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fe2ea94..f69c318 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,17 @@ A simplified interface to ComfyUI through Discord 1. Run `comfyui-discord.sh` to create `settings.json` -2. Put your Discord bot's token in `settings.json` +2. Modify `settings.json`, e.g. + + ``` + { + "token": "Your Discord bot's token here" + "api_url": "http://127.0.0.1:8188", + ... + } + ``` + + ...where `token` is set to your Discord bot's token and `api_url` is the address to your running & accessible ComfyUI web interface. 3. Set a channel's topic to `example-workflow` diff --git a/lib/events.py b/lib/events.py index 555f2f8..f515a45 100644 --- a/lib/events.py +++ b/lib/events.py @@ -20,6 +20,7 @@ async def on_message_or_reaction(client, obj): msg_types = [discord.MessageType.default] + # Handle reactions: if isinstance(obj, discord.RawReactionActionEvent): chl = await client.fetch_channel(obj.channel_id) msg = await chl.fetch_message(obj.message_id) @@ -30,6 +31,7 @@ async def on_message_or_reaction(client, obj): msg_types.append(discord.MessageType.reply) + # Handle direct messages from users: if isinstance(obj, discord.Message): msg = obj chl = obj.channel diff --git a/lib/helpers.py b/lib/helpers.py index 8e91513..30f3afb 100644 --- a/lib/helpers.py +++ b/lib/helpers.py @@ -1,7 +1,6 @@ import json import os - # Make it easy to read a json file def read_json(path, default_value={}): if os.path.isfile(path): @@ -14,7 +13,6 @@ def read_json(path, default_value={}): pass return default_value - # Merge dictionary b into a def merge_dicts(a, b): if b is None: @@ -42,7 +40,6 @@ def merge_dicts(a, b): return output - def write_json(path, o): try: with open(path, "w") as file: