code: async def on_raw_mode(self, message):
          
          nick, metadata = self._parse_user(message.source)
          target, modes = message.params[0], message.params[1:]
  
          self._sync_user(nick, metadata)
          if self.is_channel(target):
              if self.in_channel(target):
                  # Parse modes.
                  self.channels[target]['modes'] = self._parse_channel_modes(target, modes)
  
                  await self.on_mode_change(target, modes, nick)
          else:
              target, targetmeta = self._parse_user(target)
              self._sync_user(target, targetmeta)
  
              # Update own modes.
              if self.is_same_nick(self.nickname, nick):
                  self._mode = self._parse_user_modes(nick, modes, current=self._mode)
  
              await self.on_user_mode_change(modes)
docs: MODE command.