code: def update_aliases(self):
          
          changed = False
          try:
              response = self.client.api.get_room_state(self.room_id)
          except MatrixRequestError:
              return False
          for chunk in response:
              content = chunk.get('content')
              if content:
                  if 'aliases' in content:
                      aliases = content['aliases']
                      if aliases != self.aliases:
                          self.aliases = aliases
                          changed = True
                  if chunk.get('type') == 'm.room.canonical_alias':
                      canonical_alias = content['alias']
                      if self.canonical_alias != canonical_alias:
                          self.canonical_alias = canonical_alias
                          changed = True
          if changed and self.aliases and not self.canonical_alias:
              self.canonical_alias = self.aliases[0]
          return changed
docs: Get aliases information from room state
  
          Returns:
              boolean: True if the aliases changed, False if not