deal with error_code not in payload for scope error

This commit is contained in:
Florent 2025-12-06 19:35:57 +01:00
parent 7b0631bc4b
commit ae10bb701a

View file

@ -1604,8 +1604,11 @@ async def set_scope (mc, scope) :
return scope
res = await mc.commands.set_flood_scope(scope)
if res is None or res.type == EventType.ERROR:
if not res is None and res.payload["error_code"] == 1: #unsupported
if res is None :
return None
if res.type == EventType.ERROR:
if "error_code" in res.payload and res.payload["error_code"] == 1: #unsupported
set_scope.has_scope = False
return None