mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 13:34:40 +00:00
460cf072adbdefb76fd7a656942ed23a110a98aa
The restart-loop with only 'Starting discord bot' in the logs was caused by
gather(return_exceptions=True) eating the client.start() exception: a failed
login looked like a clean exit and docker just restarted the container.
bot.py:
- _run_bot: catch discord.LoginFailure / PrivilegedIntentsRequired with
CRITICAL messages telling exactly what to fix (token entry / Developer
Portal intents), full traceback for anything else, then re-raise
- main() returns an exit code; every task exception is re-logged as the
LAST line in docker logs ('Task died: ...'); process exits 1 on failure
- log the token source (env vs netrc) and its length at startup to catch
truncated/wrong-field netrc entries
- _run_comm_subroutine: comm crash is logged loudly but no longer relies on
gather to surface it (bot keeps running - Discord side is independent)
communication_subroutine.py (crash found by the new stub tests):
- comm_subroutine used 'logger' before its local assignment
(UnboundLocalError killed the whole comm layer at every startup)
- re-comment the flask_debug thread: it binds the same host:port as
waitress, so running both dies with 'address in use'
Verified via stub-injected client: LoginFailure -> CRITICAL + exit 1,
PrivilegedIntentsRequired -> CRITICAL + exit 1, unknown exception -> full
traceback + exit 1, clean shutdown -> exit 0; comm layer no longer crashes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
conjurer
Discord.py bot for fun, sex and BDSM
Languages
Python
99.7%
Shell
0.3%