mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-11-04 00:46:43 +00:00 
			
		
		
		
	✏️ fix validator
This commit is contained in:
		@@ -249,19 +249,9 @@ class Message(list, abc.ABC):
 | 
			
		||||
        return ''.join((str(seg) for seg in self))
 | 
			
		||||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def __get_validator__(cls):
 | 
			
		||||
    def __get_validators__(cls):
 | 
			
		||||
        yield cls._validate
 | 
			
		||||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def __modify_schema__(cls, field_schema):
 | 
			
		||||
        field_schema.update(
 | 
			
		||||
            examples=["foo", {
 | 
			
		||||
                "type": "text",
 | 
			
		||||
                "data": {
 | 
			
		||||
                    "text": "bar"
 | 
			
		||||
                }
 | 
			
		||||
            }])
 | 
			
		||||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def _validate(cls, value):
 | 
			
		||||
        return cls(value)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user