diff --git a/wsai/dashboard.py b/wsai/dashboard.py index 2456d57..d29ef17 100644 --- a/wsai/dashboard.py +++ b/wsai/dashboard.py @@ -256,7 +256,13 @@ def _make_handler(dash: "Dashboard"): was_connected = dash.bot.state().get("connected") dash.bot.report(data) if not was_connected: # transition disconnected -> connected - who = data.get("botTag") or data.get("username") or data.get("identity") or "" + # identity is reported as {id, username, tag}; pull a string only + # (concatenating a dict here would TypeError and 500 the report). + ident = data.get("identity") + if isinstance(ident, dict): + who = ident.get("tag") or ident.get("username") or ident.get("id") or "" + else: + who = ident if isinstance(ident, str) else "" monitor.log("info", f"디스코드 봇 연결됨{(' · ' + who) if who else ''}", cat="CONNECT") # Hand the bot any queued commands + the current listen filters + # behaviour settings in the same round trip so it does not have to