def METHOD_NAME(self, args: Sequence[Any], kwargs: Mapping[str, Any]) -> TF:
    full_message = self.factory()
    used_args, arg_index = set(), 0
    if isinstance(self.template, str):
        msg, arg_index = self._vformat(
            self.template, args, kwargs, used_args, arg_index
        )
        full_message += msg
    elif isinstance(self.template, self.factory):
        template = cast("Message[MessageSegment]", self.template)
        for seg in template:
            if not seg.is_text():
                full_message += seg
            else:
                msg, arg_index = self._vformat(
                    str(seg), args, kwargs, used_args, arg_index
                )
                full_message += msg
    else:
        raise TypeError("template must be a string or instance of Message!")
    self.check_unused_args(used_args, args, kwargs)
    return cast(TF, full_message)