code: def encode(self, text: str) -> str:
          
  
          def callback(match: Match) -> str:
              name = match.group("name").lower()
              if name in ["here", "everyone", "channel"]:
                  return f"<!{name}>"
              else:
                  for user in self.users.values():
                      if user.name == name:
                          return f"<@{user.id}>"
              return match.group(0)
  
          return self.encode_re.sub(callback, text)
docs: Encode @username into <@id> or <!alias>.