Skip to content

Commit 78c4966

Browse files
authored
Update client.py (#975)
1 parent 1c7e5b8 commit 78c4966

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

interactions/api/gateway/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,10 @@ def __modify_guild_cache():
466466
self._dispatch.dispatch(f"on_{name}", obj)
467467
__modify_guild_cache()
468468

469-
elif "_update" in name and hasattr(obj, "id"):
469+
elif "_update" in name:
470+
self._dispatch.dispatch(f"on_raw_{name}", obj)
471+
if not hasattr(obj, "id"):
472+
return
470473
old_obj = self._http.cache[model].get(id)
471474
if old_obj:
472475
before = model(**old_obj._json)
@@ -481,7 +484,6 @@ def __modify_guild_cache():
481484
self._dispatch.dispatch(
482485
f"on_{name}", before, old_obj
483486
) # give previously stored and new one
484-
return
485487

486488
elif "_remove" in name or "_delete" in name:
487489
self._dispatch.dispatch(f"on_raw_{name}", obj)

0 commit comments

Comments
 (0)