code: def to(self, target: typing.Union[types.Message, types.Chat, types.base.Integer, types.base.String]):
          
          if isinstance(target, types.Message):
              chat_id = target.chat.id
          elif isinstance(target, types.Chat):
              chat_id = target.id
          elif isinstance(target, (int, str)):
              chat_id = target
          else:
              raise TypeError(f"Bad type of target. ({type(target)})")
  
          setattr(self, 'chat_id', chat_id)
          return self
docs: Send to chat
  
          :param target: message or chat or id
          :return: