Add per-target-bot send queues that throttle xdcc send messages and wait for active transfers to complete before sending the next request, with visibility via API/WebSocket and the web UI.
1. Core Queue Engine (dccbot/ircbot.py)
- Route
send commands into per-target queues (send_queues: dict[str, asyncio.Queue]) keyed by lowercase target nick.
- Spawn a dedicated
asyncio.Task per target (send_queue_tasks) that loops:
- Pop next queued message.
- Send it via
privmsg.
- Wait a configurable minimum delay since the last send (
send_queue_delay).
- Poll until no active transfers from that nick remain in
current_transfers.
- Wait a post-transfer cooldown (
send_queue_cooldown).
- Loop.
- Keep the existing
command_queue and process_command_queue() for join/part only.
- Add a safety cap so the loop does not stall forever if a transfer never starts (
send_queue_max_wait).
2. Configurable Timing (config.json)
Add three optional keys with sensible defaults:
send_queue_delay (default 15) — minimum seconds between sends to the same bot.
send_queue_cooldown (default 5) — extra seconds after a transfer finishes.
send_queue_max_wait (default 300) — max seconds to wait for a transfer to start/complete before proceeding.
3. API & WebSocket Exposure (dccbot/app.py)
- Extend
_build_info_payload() with a "queues" array: per-server, per-target list of pending message strings.
- Broadcast
{"type": "queues", "queues": [...]} over WebSocket alongside existing transfers broadcasts.
- Add
/queue WS command to list pending items.
- Add
/cancelqueue <server> <target> WS command to drop pending items for a target.
4. Web UI (static/index.html + static/ws.js)
- Add a new "Send Queue" panel rendering queued items grouped by server → target bot.
- Wire
onQueues in ws.js and update the panel on each broadcast.
5. Tests
test_ircbot.py: per-target queuing, delay enforcement, transfer-aware progression, max-wait fallback.
test_api_endpoints.py: /info returns queue snapshot.
test_websocket.py: queue broadcasts and WS /queue / /cancelqueue commands.
Add per-target-bot send queues that throttle
xdcc sendmessages and wait for active transfers to complete before sending the next request, with visibility via API/WebSocket and the web UI.1. Core Queue Engine (
dccbot/ircbot.py)sendcommands into per-target queues (send_queues: dict[str, asyncio.Queue]) keyed by lowercase target nick.asyncio.Taskper target (send_queue_tasks) that loops:privmsg.send_queue_delay).current_transfers.send_queue_cooldown).command_queueandprocess_command_queue()forjoin/partonly.send_queue_max_wait).2. Configurable Timing (config.json)
Add three optional keys with sensible defaults:
send_queue_delay(default15) — minimum seconds between sends to the same bot.send_queue_cooldown(default5) — extra seconds after a transfer finishes.send_queue_max_wait(default300) — max seconds to wait for a transfer to start/complete before proceeding.3. API & WebSocket Exposure (
dccbot/app.py)_build_info_payload()with a"queues"array: per-server, per-target list of pending message strings.{"type": "queues", "queues": [...]}over WebSocket alongside existingtransfersbroadcasts./queueWS command to list pending items./cancelqueue <server> <target>WS command to drop pending items for a target.4. Web UI (
static/index.html+static/ws.js)onQueuesinws.jsand update the panel on each broadcast.5. Tests
test_ircbot.py: per-target queuing, delay enforcement, transfer-aware progression, max-wait fallback.test_api_endpoints.py:/inforeturns queue snapshot.test_websocket.py: queue broadcasts and WS/queue//cancelqueuecommands.