def _update(self, data: MessageUpdateEvent) -> None:
    for (key, handler) in self._HANDLERS:
        try:
            value = data[key]
        except KeyError:
            continue
        else:
            handler(self, value)
    for attr in self._CACHED_SLOTS:
        try:
            delattr(self, attr)
        except AttributeError:
            pass
def _update(self, data: MessageUpdateEvent) -> None:
    for (key, handler) in self._HANDLERS:
        try:
            value = data[key]
        except KeyError:
            continue
        else:
            handler(self, value)
    for attr in self._CACHED_SLOTS:
        try:
            delattr(self, attr)
        except AttributeError:
            pass