mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-30 14:36:41 +00:00 
			
		
		
		
	🎨 change event log
This commit is contained in:
		| @@ -155,7 +155,7 @@ class Event(abc.ABC, BaseModel): | |||||||
|     def get_event_description(self) -> str: |     def get_event_description(self) -> str: | ||||||
|         raise NotImplementedError |         raise NotImplementedError | ||||||
|  |  | ||||||
|     def get_log_string(self) -> str: |     def __str__(self) -> str: | ||||||
|         return f"[{self.get_event_name()}]: {self.get_event_description()}" |         return f"[{self.get_event_name()}]: {self.get_event_description()}" | ||||||
|  |  | ||||||
|     @abc.abstractmethod |     @abc.abstractmethod | ||||||
|   | |||||||
| @@ -209,7 +209,7 @@ async def handle_event(bot: "Bot", event: "Event"): | |||||||
|     show_log = True |     show_log = True | ||||||
|     log_msg = f"<m>{bot.type.upper()} {bot.self_id}</m> | " |     log_msg = f"<m>{bot.type.upper()} {bot.self_id}</m> | " | ||||||
|     try: |     try: | ||||||
|         log_msg += event.get_log_string() |         log_msg += str(event) | ||||||
|     except NoLogException: |     except NoLogException: | ||||||
|         show_log = False |         show_log = False | ||||||
|     if show_log: |     if show_log: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user